Summary of the invention
Based on above-mentioned situation, the present invention proposes a kind of terminal data synchro system and method, so that task data can be synchronous at different terminals.
A kind of terminal data synchro system, comprise back-end server and two or more terminal,
Described terminal, receive user's login, and send authentication request to described back-end server;
Described back-end server, receive described authentication request and the active user authenticated, and after authentication is passed through, what the active user of take was the director does not finish the work, and described abortive last execution terminal is sent to described terminal;
Described terminal, receive active user's selection, determines described middle the task that terminal is pending of not finishing the work; The task pending to this terminal carried out identification, judges whether its last execution terminal is this terminal, if this terminal keeps the pending task of this terminal constant in the service data of this terminal; If non-terminal, send and wake the notice of waking up that this task is finally carried out terminal up to described back-end server;
Described back-end server, receive described wake notice up after, judge that the pending task of described terminal finally carries out the current state of terminal, if current state is off-line and upper subnormal exiting, by the service data of the pending task of described terminal at the final updating time feedbacking of book server to described terminal; If current state, for online or last time of improper exiting, sends to this last terminal of carrying out the up-to-date service data that this task is obtained in instruction, and by the final updating time feedbacking of this up-to-date service data to described terminal;
Described terminal, by the final updating time of the service data of the pending task of this terminal of described back-end server feedback, compare in the final updating time of this terminal with the service data of this task; If the final updating time in this terminal upgraded than the final updating time of described back-end server feedback, keep the pending task of this terminal constant in the service data of this terminal; If the final updating time of described back-end server feedback upgraded than the final updating time in this terminal, or the pending task of this terminal does not have service data in this terminal, to the up-to-date service data of described back-end server request, receive the up-to-date service data that described back-end server returns and be updated to this terminal.
A kind of terminal data synchronous method comprises step:
When user's registration terminal and by after the authentication of back-end server, from described back-end server, obtain and take not finishing the work that the active user is the director and described abortive last execution terminal;
Receive active user's selection, determine the pending task of current terminal in described not finishing the work;
The task pending to current terminal carried out identification, judges whether its last execution terminal is current terminal;
If the last execution terminal of the pending task of current terminal is current terminal, keep the pending task of current terminal constant in the service data of current terminal;
If the last execution terminal of the pending task of current terminal is non-current terminal, judge the current state of the last execution terminal of the pending task of current terminal, if current state is off-line and upper subnormal exiting, the final updating time of from back-end server, obtaining these task run data; If current state is online or last time of improper exiting, from this, finally carries out up-to-date service data and final updating time that terminal is obtained this task, and up-to-date service data is uploaded to back-end server;
By the service data of final updating time of obtaining and the pending task of current terminal final updating time of current terminal relatively;
If the service data of the pending task of current terminal was upgraded than the final updating time of obtaining in the final updating time of current terminal, keep the pending task of current terminal constant in the service data of current terminal;
If the final updating time of obtaining upgrades in the final updating time of current terminal than the service data of the pending task of current terminal, from back-end server, obtain the up-to-date service data of this task and be updated to current terminal.
Terminal data synchro system of the present invention and method, terminal can be uploaded to back-end server by uncompleted task and related data, make the user when the conversion terminal, uncompleted task and task related data can be synchronized to current terminal from back-end server, and continue to carry out.So, the user executes the task and is not subject to the restriction of terminal, has improved task and has completed efficiency.
Embodiment
In order to make purpose of the present invention, technical scheme and advantage clearer, below in conjunction with drawings and Examples, the present invention is described in further detail.Should be appreciated that embodiment described herein, only in order to explain the present invention, does not limit protection scope of the present invention.
Fig. 1 is the structural representation of terminal data synchro system of the present invention, and as can be seen from the figure, native system comprises 1 back-end server and the terminal more than 2 or 2.Each terminal all keeps communicating by letter by wired or wireless network and back-end server, and each uses each terminal with logining per family.Back-end services management field operating systems assignment database, task data comprises mission bit stream and task run data.All comprise clear and definite person liable in mission bit stream, corresponding with the terminal use who downloads this task.All comprise unique identification (ID) in mission bit stream to distinguish over other tasks.Mission bit stream comprises the information that the task run data are finally carried out terminal of describing.Mission bit stream also comprises the details to task definition, mission requirements and tasks carrying standard.The task run data are many data that task produces in the process of implementation, wherein also comprise the unique identification consistent with mission bit stream unique identification (ID) to distinguish over the data of other tasks.Interocclusal record when the task run data contain final updating, with year, month, day, hour, minute, second means.Terminal has unique identification (TID) to distinguish over other-end equipment.Terminal has been opened up a memory space for each login user, in order to preserve user-dependent mission bit stream and task run data.
The user is after terminal login, and whether the terminal periodic polling exists back-end server to be assigned to user's task, if so, carry out immediately the task download and be kept in local user storage space, otherwise etc. pending poll next time.In the process that the user executes the task in the use terminal, the task run data of generation, as: the table meter table code value of making a copy of, the records such as power distribution room of tour, will at first be stored in local terminal, can upload the data to back-end server under following scene:
To the data of time-sensitive, as emphasis examination time point data, will after typing, upload immediately;
After tasks carrying completes, data will be uploaded immediately;
Arrive the timing node of regular uploading data, as within 15 minutes, uploaded the task run data one time in backstage;
If the user normally logs off, all task run data of not uploading all will be uploaded immediately.
The task run data upload is after server, and the task run data final updating time in server immediate updating assignment database, it is data upload place terminal that the task in mission bit stream of simultaneously arranging is finally carried out terminal.
After the user logins certain terminal of terminal data synchro system of the present invention, the terminal of native system and the workflow of back-end server are as follows:
Described terminal, receive user's login, and send authentication request to described back-end server;
Described back-end server, receive described authentication request and the active user authenticated, and after authentication is passed through, what the active user of take was the director does not finish the work, and described abortive last execution terminal is sent to described terminal.Herein, can be only abortive ID and the last TID that carries out terminal to be sent to described terminal.
Described terminal, receive active user's selection, determines described middle the task that terminal is pending of not finishing the work; The task pending to this terminal carried out identification, judges whether its last execution terminal is this terminal, if this terminal keeps the pending task of this terminal constant in the service data of this terminal; If non-terminal, send and wake the notice of waking up that this task is finally carried out terminal up to described back-end server.
Described back-end server, receive described wake notice up after, judge that the pending task of described terminal finally carries out the current state of terminal, if current state is off-line and upper subnormal exiting, by the service data of the pending task of described terminal at the final updating time feedbacking of book server to described terminal; If current state, for online or last time of improper exiting, sends to this last terminal of carrying out the up-to-date service data that this task is obtained in instruction, and by the final updating time feedbacking of this up-to-date service data to described terminal.
Described terminal, by the final updating time of the service data of the pending task of this terminal of described back-end server feedback, compare in the final updating time of this terminal with the service data of this task; If the final updating time in this terminal upgraded than the final updating time of described back-end server feedback, keep the pending task of this terminal constant in the service data of this terminal; If the final updating time of described back-end server feedback upgraded than the final updating time in this terminal, or the pending task of this terminal does not have service data in this terminal, to the up-to-date service data of described back-end server request, receive the up-to-date service data that described back-end server returns and be updated to this terminal.
As a preferred embodiment, after described back-end server is sent to described terminal by the up-to-date service data of described terminal request, also the last execution terminal of task corresponding to this up-to-date service data is set to described terminal.Described terminal also will be responsible for artificial non-active user's local task detach, in order to avoid mistake is carried out.
The course of work to terminal and back-end server is carried out combing, obtains the schematic flow sheet of the user's registration terminal A shown in Fig. 2, wherein comprises following steps:
Step 201, user login at terminal A;
Step 202, back-end server are received user's logging request, after authenticating by normal user, and all ID of not finishing the work that the user of take is the director and finally carry out terminal unique identification TID and turn back to terminal A;
Step 203, user select to wish carrying out in this locality of task in the task list obtained from step 202;
Step 204, terminal A carry out identification one by one for mission bit stream user-selected in step 203, if the last execution terminal of task is terminal A, carry out 205, if not, carry out 206;
Step 205, terminal A retain local task run data and do not do variation;
Step 206, back-end server are received the request of terminal A for the up-to-date service data of appointed task, the last execution terminal of these tasks is not A, wake the former execution terminal of task up by remote command immediately, former execution terminal is uploaded up-to-date service data immediately to background server;
Step 207, back-end server arrive terminal A by the final updating time feedbacking of up-to-date service data;
The final updating time of the up-to-date service data that step 208, terminal A obtain according to step 207 and this task were compared in the local final updating time, if upgrade the update time of returning, carry out 209, if upgrade local update time, carry out 205;
Step 209, upgrade the task of service data according to the needs that obtain in step 208, the task run data that server request is complete to the back-end, receive and upgrade local data base;
The last execution terminal of the mission bit stream related in step 210, server step 209 and step 205 is set to terminal A;
Step 211, for the local task be not included in the list of not finishing the work that step 202 returns, will carry out local the removing;
Step 212, user login end.
Fig. 3 is that back-end server wakes the terminal flow chart up, wherein comprises following steps:
Step 301, back-end server judge this terminal whether off-line and upper subnormal exiting, if current off-line and normally exiting, the task run data will be upgraded in time, carry out 305, if online or last time improper exiting, carry out 302;
Step 302, back-end server send the command request terminal and submit up-to-date task run data to;
After step 303, terminal are received the instruction that back-end server sends, the local task run data of not yet submitting to of retrieval are submitted data to after setting up the network channel with back-end server simultaneously;
After step 304, back-end server receive the up-to-date task run data of terminal submission, be saved in the final updating time of system database task run data;
Step 305, wake terminal procedures up and finish.
Fig. 4 is that back-end server upgrades terminal data flow process figure, wherein comprises following steps:
Step 401, back-end server send to terminal by the final updating time of task ID and service data thereof;
After step 402, terminal receive the data that transmit in step 401, in local retrieval tasks and service data final updating time thereof, and the final updating time that final updating time and back-end server transmit is contrasted;
Step 403, in the contrast of step 402, if the task run data final updating time that the discovery back-end server is sent is newer, carry out 404, if find that the final updating time that the local task run data final updating time sends unlike back-end server is old, carry out 405;
Step 404, terminal server are to the back-end initiated the request of data for the up-to-date task run data of a certain task, upgrade local task run data after receiving the data of returning;
Step 405, whole terminal data more new technological process finish.
Terminal data synchronous method of the present invention as shown in Figure 5, comprises step:
Step S501, when user's registration terminal and by after the authentication of back-end server, obtain and take not finishing the work that the active user is the director and described abortive last execution terminal from described back-end server;
Step S502, reception active user's selection, determine the pending task of current terminal in described not finishing the work;
Step S503, the task pending to current terminal are carried out identification, judge whether its last execution terminal is current terminal;
If the last execution terminal of the pending task of the current terminal of step S504 is current terminal, keep the pending task of current terminal constant in the service data of current terminal;
If the last execution terminal of the pending task of the current terminal of step S505 is non-current terminal, judge the current state of the last execution terminal of the pending task of current terminal;
If step S506 current state is off-line and upper subnormal exiting, the final updating time of from back-end server, obtaining these task run data;
If step S507 current state is online or last time of improper exiting, from this, finally carries out up-to-date service data and final updating time that terminal is obtained this task, and up-to-date service data is uploaded to back-end server;
Step S508, by the service data of final updating time of obtaining and the pending task of current terminal final updating time of current terminal relatively;
If the service data of the pending task of the current terminal of step S509 was upgraded than the final updating time of obtaining in the final updating time of current terminal, keep the pending task of current terminal constant in the service data of current terminal;
If the final updating time that step S500 obtains upgrades in the final updating time of current terminal than the service data of the pending task of current terminal, from back-end server, obtain the up-to-date service data of this task and be updated to current terminal.
As a preferred embodiment, if the last execution terminal of the pending task of current terminal is non-current terminal, the last execution terminal that this method can also this task is set to current terminal.
As a preferred embodiment, this method can also comprise step: to being responsible for artificial non-active user's local task, from current terminal, remove.
Adopt terminal data synchro system of the present invention and method, the user logins from arbitrary terminal, its uncompleted task will be synchronized to this terminal, so that this user continues to execute the task on this terminal, and needn't get back to former terminal, and saved the time, improved efficiency, facilitate the user, be conducive to completing fast of task.
The above embodiment has only expressed several execution mode of the present invention, and it describes comparatively concrete and detailed, but can not therefore be interpreted as the restriction to the scope of the claims of the present invention.It should be pointed out that for the person of ordinary skill of the art, without departing from the inventive concept of the premise, can also make some distortion and improvement, these all belong to protection scope of the present invention.Therefore, the protection range of patent of the present invention should be as the criterion with claims.