CN105897545B - A kind of method and device of mail synchronization - Google Patents

A kind of method and device of mail synchronization Download PDF

Info

Publication number
CN105897545B
CN105897545B CN201510038837.XA CN201510038837A CN105897545B CN 105897545 B CN105897545 B CN 105897545B CN 201510038837 A CN201510038837 A CN 201510038837A CN 105897545 B CN105897545 B CN 105897545B
Authority
CN
China
Prior art keywords
mail
local
mobile
action
addition
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201510038837.XA
Other languages
Chinese (zh)
Other versions
CN105897545A (en
Inventor
林以明
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Chongqing Yixin Ward Technology Co Ltd
Original Assignee
Nine Jade (beijing) Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nine Jade (beijing) Technology Co Ltd filed Critical Nine Jade (beijing) Technology Co Ltd
Priority to CN201510038837.XA priority Critical patent/CN105897545B/en
Publication of CN105897545A publication Critical patent/CN105897545A/en
Application granted granted Critical
Publication of CN105897545B publication Critical patent/CN105897545B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention discloses a kind of method and devices of mail synchronization, for realizing reducing the interaction times of terminal device and server, saving the occupied extra network traffic of mail protocol and reducing unnecessary simultaneously operating.The described method includes: establishing the operating list of mail, operating list is for recording the local operation to mail on the terminal device;The local operation of mail is merged by what is recorded in preset time period in operating list;The synch command including the local operation after merging is sent to server, the local operation after the merging to mail for being synchronized in server by server according to synch command.The technical solution can reduce the interaction times of terminal device and server, and save the occupied extra network traffic of mail protocol, additionally it is possible to be much less unnecessary simultaneously operating.The state for allowing to have part success and part failure in a batch synchronization simultaneously improves synchronous efficiency so as to cancel to the simultaneously operating of part failure.

Description

A kind of method and device of mail synchronization
Technical field
The present invention relates to Internet technical field more particularly to a kind of method and devices of mail synchronization.
Background technique
On mobile terminal to the local operation of mail include it is newly-built, delete, mobile, label has been read or do not read, add asterisk, Recoil state etc. is changed, and for these local operations, requiring to be synchronized to just can guarantee on mail server by mail Local operation saves in the server, and other Mail Clients can just be updated.
Current synchronous method is usually individually to synchronize each local operation with server, how many local behaviour Make, it will how many be subsynchronous.And for extra network traffic caused by mail protocol when every subsynchronous, synchronous time Number is more, and additional network flow is also more, this process for resulting in these local operations to be synchronized to server needs to expend greatly The network flow of amount, and for mobile terminal, saving network flow is using one of key factor in need of consideration.Its Secondary, part local operation can become engineering noise because of subsequent operation, such as by after envelope mail addition asterisk, delete again quickly In addition to the mail, then the operation of addition asterisk is lost being synchronized on server because of subsequent delete operation before Go meaning.
For the deficiency of above-mentioned synchronous method, the state difference that there are also a kind of by recording local client and server end Come the method synchronized.By recording mail in the state difference of local client and server end, and according to state difference The upload command for needing to send to server is calculated, to realize that local client is synchronous with server.However, this side Although method solves the above problem, but still there are many deficiencies.Firstly, this method is due to only having recorded two states, and The operation for not recording user, in the case where no network, accumulative local operation can make the difference of two states Very big, this upload after being just, which synchronizes, causes very big risk, complexity and synchronization failure including calculating.Once synchronous Failure, needs to return to the state before synchronizing and redoes, and there is no the states of " part success ".Likewise, due to not remembering The operation at family is employed, " revocation " operation can only also return to the state before synchronizing, and there is no the states of " part failure ", therefore lack Flexibility also results in the waste of network flow.Secondly as this method record is state change within the scope of account, nothing Method reflects that the mail variation an of account is influenced caused by another account, therefore cannot achieve the mobile behaviour across mail account Make.Again, the data structure of this method can not record the mail for needing upload server, therefore cannot achieve the upload of mail. Again, it be easy to cause local operation to lose, for example, when an envelope mail (does not need to delete beyond synchronous window, needs from local deletion Except the mail on server) when, the corresponding local operation of the mail also deletes therewith, to cause the loss of local operation; For another example, if new operation occurs during uploading local operation, these new operations also can be after specifically uploading successfully It is deleted, to cause the loss of local operation.Finally, this method wastes memory space.For example, in order to record on an envelope mail Operation, need to replicate the mail, and most of data in mail be for the operation it is nonsensical, such as message body.
Summary of the invention
The embodiment of the present invention provides a kind of method and device of mail synchronization, for realizing terminal device and server is reduced Interaction times, save the occupied extra network traffic of mail protocol and reduce unnecessary simultaneously operating.
A kind of method of mail synchronization is used for terminal device, comprising the following steps:
The operating list of mail is established, the operating list is for being recorded on the terminal device to the sheet of the mail Ground operation;
The local operation of the mail is merged by what is recorded in preset time period in the operating list;
The synch command including the local operation after the merging is sent to server, the server is used for according to Local operation after merging to the mail is synchronized in server by synch command.
Some beneficial effects of the embodiment of the present invention may include: by the way that the local operation of mail is buffered in local end End, and merges the local operation in a period of time, and then batch is uploaded to server, thus can greatly reduce terminal device and The interaction times of server, and save the occupied extra network traffic of mail protocol, additionally it is possible to it is unnecessary to be much less Simultaneously operating.Meanwhile the state that the program allows to have part success and part failure in a batch synchronization, so as to The simultaneously operating of part failure is cancelled, synchronous efficiency is improved.
In one embodiment, the local to the mail that will be recorded in preset time period in the operating list Operation merges, comprising:
Identify addition mail action and deletion mail action whether are existed simultaneously in the local operation;It is described when recognizing When existing simultaneously addition mail action in local operation and deleting mail action, eliminates the addition mail action and described add Add upper one or next deletion mail action of mail action, and eliminates the addition mail action and the addition postal Upper one or next other local operations deleted between mail action of part operation;
It identifies in the local operation with the presence or absence of deletion mail action;It is deleted when recognizing to exist in the local operation When mail action, described other local operations deleted before mail action are eliminated;
Similar terms in the local operation are merged, the local operation after being merged, the similar terms are to add Mail action and mobile e-mail is added to operate, the operation of multiple mobile e-mails or the local operation of inverse operation each other;
Local operation after the merging is ranked up.
In the embodiment, eliminated, merged by specific local operation, sorted and etc., largely need not it reduce The operation to be synchronized, and then batch is uploaded to server, so that the interaction times of terminal device and server greatly reduce, and Save the occupied extra network traffic of mail protocol, additionally it is possible to be much less unnecessary simultaneously operating.
In one embodiment, the similar terms in the local operation merge, the local after being merged Operation, the similar terms be addition mail action and mobile e-mail operation, multiple mobile e-mails operate or inverse operation each other Local operation, comprising:
When the similar terms are addition mail action and mobile e-mail operates, by the addition mail action and mobile postal The addition mail action in the file that the mobile e-mail operation is directed toward is merged into part operation;
When the similar terms are that multiple mobile e-mails operate, a movement is merged into the operation of the multiple mobile e-mail Mail action, one mobile e-mail operation operate for the mail is moved to the last one mobile e-mail from initial position Pointed file;
When the similar terms are the local operation of inverse operation each other, the local behaviour of the inverse operation each other is eliminated Make.
In the embodiment, by merging local operation, reduce the operation of a large amount of unnecessary synchronizations, and then batch It is uploaded to server, so that the interaction times of terminal device and server greatly reduce, and is saved occupied by mail protocol Extra network traffic, additionally it is possible to be much less unnecessary simultaneously operating.
In one embodiment, the local operation to after the merging is ranked up, comprising:
In local operation after judging the merging, whether other local operations in addition to adding mail action are described Mail action is added to carry out later;
In local operation after determining the merging, other local operations in addition to adding mail action add described When mail action being added to carry out later, the addition mail action in the local operation after the merging is come into all local operations Before most;
In local operation after determining the merging, other local operations in addition to adding mail action are not in institute State after addition mail action when carrying out, by the local operation after the merging addition mail action and/or mobile e-mail Operation comes the most preceding or last of all local operations.
In the embodiment, the local operation after merging is ranked up according to the sequence that local operation carries out, so that service Device is capable of the local operation of batch synchronization mail, improves the efficiency of synchronous mail, so that it is occupied additional to save mail protocol Network flow, additionally it is possible to be much less unnecessary simultaneously operating.
In one embodiment, the local to the mail that will be recorded in preset time period in the operating list After operation merges, the method also includes:
Whether operated comprising mobile e-mail in local operation after judging the merging;
When in the local operation after the merging including mobile e-mail operation, the local operation of the mail will be sorted out For mobile request;When not including mobile e-mail operation in the local operation after the merging, the local of the mail will be grasped Work is classified as non-moving request;
The synch command including non-moving request and/or mobile request after the classification, the clothes are sent to server Business device is used to that the non-moving request and/or mobile request to be synchronized in server according to the synch command, wherein described Server first synchronizes the non-moving request, synchronizes again to the mobile request.
In the embodiment, the local operation of mail is divided into two classes of non-moving request and mobile request, so that server It can be according to the organizational form batch synchronization of mail on the server, to improve the success rate of mail action when synchronous mail.
A kind of method of mail synchronization is used for server, comprising:
The synch command that receiving terminal apparatus is sent, the synch command include the local behaviour after the merging to the mail Make;
According to the synch command, the local operation after the merging to the mail is synchronized in the server.
Some beneficial effects of the embodiment of the present invention may include: that the local operation progress batch after the merging to mail is same Step, greatly reduces the interaction times of terminal device and server, and save the occupied additional networks stream of mail protocol Amount, additionally it is possible to be much less unnecessary simultaneously operating.
In one embodiment, when in the synch command including the non-moving request and mobile request after sorting out, institute It states according to the synch command, the local operation after the merging to the mail is synchronized in the server, comprising:
According to the synch command, the non-moving request is synchronized in the server;
After the non-moving request is synchronized in the server, the mobile request is synchronized to the server In.
In the embodiment, when server sync mail can according to the organizational form batch synchronization of mail on the server, To improve the success rate of mail action.
A kind of device of mail synchronization is used for terminal device, comprising:
Module is established, for establishing the operating list of mail, the operating list is for being recorded in the terminal device To the local operation of the mail;
Merging module, for by the local operation to the mail recorded in preset time period in the operating list into Row merges;
First sending module, it is described for sending the synch command including the local operation after the merging to server Local operation after merging to the mail for being synchronized in server by server according to the synch command.
In one embodiment, the merging module includes:
First eliminates submodule, whether exists simultaneously addition mail action in the local operation for identification and deletes postal Part operation;When recognize exist simultaneously addition mail action in the local operation and delete mail action when, add described in elimination Add upper one or next deletion mail action of mail action and the addition mail action, and eliminates the addition postal Upper one or next other local operations deleted between mail action of part operation and the addition mail action;
Second eliminates submodule, for identification with the presence or absence of deletion mail action in the local operation;When recognizing When stating in local operation in the presence of mail action is deleted, described other local operations deleted before mail action are eliminated;
Merge submodule, for being merged to the similar terms in the local operation, the local operation after being merged, The similar terms are addition mail action and mobile e-mail operation, the operation of multiple mobile e-mails or the local of inverse operation is grasped each other Make;
Sorting sub-module, for being ranked up to the local operation after the merging.
In one embodiment, the merging submodule includes:
First combining unit, for adding described when the similar terms are addition mail action and mobile e-mail operates Mail action and mobile e-mail is added to operate the addition mail action merged into the file that the mobile e-mail operation is directed toward;
Second combining unit is used for when the similar terms are that multiple mobile e-mails operate, by the multiple mobile e-mail A mobile e-mail operation is merged into operation, and one mobile e-mail operation is to be moved to the mail most from initial position The pointed file of the latter mobile e-mail operation;
Third combining unit, for when the similar terms are the local operation of inverse operation each other, elimination to be described each other The local operation of inverse operation.
In one embodiment, the sorting sub-module includes:
Judging unit, other locals for judging in the local operation after the merging, in addition to adding mail action Whether operation carries out after the addition mail action;
First sequencing unit, in local operation after determining the merging, its in addition to adding mail action When his local operation carries out after the addition mail action, by the addition mail action in the local operation after the merging Come all local operations most before;
Second sequencing unit, in local operation after determining the merging, its in addition to adding mail action His local operation is not when carrying out after the addition mail action, by the addition mail in the local operation after the merging Operation and/or mobile e-mail operation come the most preceding or last of all local operations.
In one embodiment, described device further include:
Judgment module, for judging in the local operation after the merging whether to operate comprising mobile e-mail;
Classifying module will be to the mail when in the local operation after the merging including mobile e-mail operation Local operation be classified as mobile request;It, will be to institute when not including mobile e-mail operation in the local operation after the merging The local operation for stating mail is classified as non-moving request;
Second sending module, for sending to server including the non-moving request and/or mobile request after the classification Synch command, the server is used to be synchronized to the non-moving request and/or mobile request according to the synch command In server, wherein the server first synchronizes the non-moving request, synchronizes again to the mobile request.
A kind of device of mail synchronization is used for server, comprising:
Receiving module, for the synch command that receiving terminal apparatus is sent, the synch command includes to the mail Local operation after merging;
Synchronization module, for according to the synch command, the local operation after the merging to the mail to be synchronized to institute It states in server.
In one embodiment, the synchronization module includes:
First synchronous submodule, for according to the synch command, the non-moving request to be synchronized to the server In;
Second synchronous submodule, for after the non-moving request is synchronized in the server, by the movement Request is synchronized in the server.
Other features and advantages of the present invention will be illustrated in the following description, also, partly becomes from specification It obtains it is clear that understand through the implementation of the invention.The objectives and other advantages of the invention can be by written explanation Specifically noted structure is achieved and obtained in book, claims and attached drawing.
Below by drawings and examples, technical scheme of the present invention will be described in further detail.
Detailed description of the invention
Attached drawing is used to provide further understanding of the present invention, and constitutes part of specification, with reality of the invention It applies example to be used to explain the present invention together, not be construed as limiting the invention.In the accompanying drawings:
Fig. 1 is a kind of flow chart of the method for mail synchronization in the embodiment of the present invention.
The flow chart that Fig. 2 is step S12 in a kind of method of mail synchronization in the embodiment of the present invention.
Fig. 3 is the flow chart of the method for another mail synchronization in the embodiment of the present invention.
Fig. 4 is the flow chart of the method for another mail synchronization in the embodiment of the present invention.
Fig. 5 is a kind of flow chart of the method for mail synchronization in the embodiment of the present invention one.
Fig. 6 is the block diagram of one of the embodiment of the present invention device of mail synchronization.
Fig. 7 is the block diagram of merging module in one of the embodiment of the present invention device of mail synchronization.
Fig. 8 is the block diagram for merging submodule in one of the embodiment of the present invention device of mail synchronization.
Fig. 9 is the block diagram of the device of another mail synchronization in the embodiment of the present invention.
Figure 10 is the block diagram of the device of another mail synchronization in the embodiment of the present invention.
Figure 11 is the block diagram of synchronization module in the device of another mail synchronization in the embodiment of the present invention.
Specific embodiment
Hereinafter, preferred embodiments of the present invention will be described with reference to the accompanying drawings, it should be understood that preferred reality described herein Apply example only for the purpose of illustrating and explaining the present invention and is not intended to limit the present invention.
Fig. 1 is a kind of flow chart of the method for mail synchronization in the embodiment of the present invention.As shown in Figure 1, this method is for eventually End equipment includes the following steps S11-S13:
Step S11, establishes the operating list of mail, and operating list is used to record and grasp on the terminal device to the local of mail Make.
Include addition mail to the local operation of mail, delete mail, mobile e-mail position, label mail are to have read or not It reads, add asterisk etc. for mail.
Step S12 merges the local operation of mail for what is recorded in preset time period in the operating list.
Step S13 sends the synch command including the local operation after merging to server, and server is used for according to synchronization Local operation after merging to mail is synchronized in server by order.
Each envelope mail has a respective Identity Code, when terminal device sends synch command to server, need by The Identity Code of file belonging to the Identity Code and mail of mail is sent to server together, and server is according to mail Identity Code and mail belonging to the Identity Code of file mail is positioned.
For example, preset time period is set as 1 minute, then terminal device can record all locals within 1 minute to mail Operation, and all local operations recorded in this 1 minute are merged according to set rule, then the local after merging is grasped Make Batch sending to server, the mail synchronization with terminal device local client is carried out by server.
Using technical solution provided in an embodiment of the present invention, by the way that the local operation of mail is buffered in local terminal, and Merge the local operation in a period of time, and then batch is uploaded to server, therefore can greatly reduce terminal device and service The interaction times of device, and save the occupied extra network traffic of mail protocol, additionally it is possible to it is much less unnecessary same Step operation.Meanwhile there may be the states of part success and part failure for batch synchronization of the program, so as to part The simultaneously operating of failure is cancelled, and synchronous efficiency is improved.
In one embodiment, as shown in Fig. 2, step S12 is implementable for following steps S121-S124:
Step S121 identifies addition mail action and deletion mail action whether are existed simultaneously in local operation;Work as identification When existing simultaneously addition mail action into local operation and deleting mail action, addition mail action and addition mail are eliminated Upper one or next deletion mail action of operation, and eliminate upper one for adding mail action and adding mail action Or next other local operations deleted between mail action.
If being indicated to delete mail action with symbol "-", addition mail action is indicated with symbol "+", is indicated with symbol " * " Other local operations then after implementation steps S121, can eliminate the local operation of similar [-, * ,+] sequence and [+, *, -] sequence, Deleting other local operations " * " between mail action in addition mail action "+" and "-" can be an operation, can also be with It is multiple operations.Under normal conditions, [-, * ,+] sequence is that [- ,+] sequence would not also exist because once deleting mail Other local operations.
Step S122 is identified in local operation with the presence or absence of deletion mail action;It is deleted when recognizing to exist in local operation When except mail action, other local operations before deleting mail action are eliminated.
If being indicated to delete mail action with symbol "-", other local operations are indicated with symbol " * ", due to deleting mail After operation, other local operations before are also just meaningless, therefore implementation steps S122 is to be substituted for sequence [*, -] [-], that is, eliminate other local operations before deleting mail action.It should be noted that deletion mentioned here Other local operations before mail action do not include addition mail action, and deletion mail action cannot be ignored.
Step S123, merges the similar terms in local operation, the local operation after being merged, and similar terms are to add Mail action and mobile e-mail is added to operate, the operation of multiple mobile e-mails or the local operation of inverse operation each other.
Step S124 is ranked up the local operation after merging.
In one embodiment, step S123 may be embodied as following steps A1-A3:
Step A1, when similar terms are addition mail action and mobile e-mail operates, by addition mail action and mobile postal The addition mail action in the file that mobile e-mail operation is directed toward is merged into part operation.For example, being added in a file One envelope mail, and the mail is moved in another file, then similar terms, terminal device can each other for this two local operations This two local operations are merged into and directly add the mail in another file, wherein another file is to move The file that dynamic mail action is directed toward.
The operation of multiple mobile e-mails is merged into a movement when similar terms are that multiple mobile e-mails operate by step A2 Mail action, a mobile e-mail operation are to be moved to mail pointed by the operation of the last one mobile e-mail from initial position File.For example, the initial position of an envelope mail is that the mail is moved to file B by file A first in file A In, then the mail is moved in file C by file B, then the mail is moved in file D by file C, altogether Mobile e-mail operation three times is carried out, this can be moved three times postal by similar terms, terminal device each other for mobile e-mail operation three times for this Part operation, which is merged into, is directly moved to mail in file D from file A, i.e., finally merges into a mobile e-mail operation.
Step A3 eliminates the local operation of inverse operation each other when similar terms are the local operation of inverse operation each other. For example, adding asterisk for an envelope mail, then cancel the asterisk on the mail again, then this two local operations behaviour opposite each other Make, terminal device directly deletes addition asterisk and deletes the operation of asterisk.
In one embodiment, step S124 may be embodied as following steps: judgement merge after local operation in, except adding Add whether other local operations other than mail action carry out after adding mail action;Local operation after determining merging In, other local operations in addition to adding mail action grasp the local after merging when carrying out after adding mail action Addition mail action in work come all local operations most before;In local operation after determining merging, except addition mail Other local operations other than operation are not when carrying out after adding mail action, by the addition in the local operation after merging Mail action and/or mobile e-mail operation come the most preceding or last of all local operations.
In the embodiment, in local operation after merging, other local operations in addition to adding mail action are adding Add when carrying out after mail action, that is to say, that when mail carries out local operation, be first added the operation of mail, then to being added The mail added carries out other operations, these other local operations are to rely on what addition mail action carried out, therefore, will when sequence Addition mail action comes before all local operations, otherwise can be because can not find mail position when server progress mail synchronization And it is invalid to regard other local operations, leads to synchronization failure.In local operation after determining merging, in addition to adding mail action Other local operations be not when being carried out after adding mail action, that is to say, that other local operations independent of addition postal Part operation carries out, and mail itself is stored in local client, and is synchronized with server, therefore, when sequence can will Addition mail action come the most preceding of all local operations or finally, when merge after local operation in include mobile e-mail behaviour When making, mobile e-mail can be operated and come the most preceding of all local operations or finally, mobile postal together with addition mail action Part operation with other local operations whether rely on add mail action it is unrelated.After server receives synch command, Neng Gougen Mail synchronization is carried out according to the local operation to have sorted, first synchronous addition mail action, then synchronizes other local operations;Or In the case that other local operations are independent of addition mail action, other local operations, resynchronisation addition mail behaviour are first synchronized Make and/or mobile e-mail operates.Sequence is determined according to the organizational form of mail on the server in this way.Due on server One mailbox includes multiple file parts, such as inbox, outbox, draft, each file possess a unique identity Identification code presss from both sides to identify this document, while comprising sealing mails or files to be empty in file, every envelope mail is also owned by one more A unique identity code identifies.But mail is added in a file or is moved to from a file another When in a file, server will distribute to one new identity code of the mail.Therefore, by the local operation after merging In addition mail action or mobile e-mail operation come the most preceding of all local operations or finally, enable the server to most First synchronous addition mail action or mobile e-mail operation, distribute new identity code for the mail and then synchronize the mail Other local operations, or other local operations independent of addition mail action in the case where, synchronize the mail at first Other local operations, finally synchronous addition mail action or mobile e-mail operation, and in addition mail action or mobile e-mail It operates in the file being directed toward and distributes new identity code for the mail.
In one embodiment, as shown in figure 3, after executing step S12, the further comprising the steps of S31- of the above method S34:
Step S31 judges whether operate comprising mobile e-mail in the local operation after merging;Local operation after merging In do not include mobile e-mail operation when, execute step S32;When in the local operation after merging including mobile e-mail operation, hold Row step S33;
Step S32 will be classified as non-moving request to the local operation of mail;
Step S33 will be classified as mobile request to the local operation of mail;
Step S34 sends the synch command including non-moving request and mobile request after sorting out, server to server For non-moving request and mobile request to be synchronized in server according to synch command, wherein server is first asked to non-moving It asks and synchronizes, mobile request is synchronized again.In this step, terminal device can be interacted twice with server, I.e. first to server send include non-moving request synch command, device to be serviced synchronize the local operation in non-moving request it Afterwards, then to server sending includes the mobile synch command requested, the local operation in the mobile request of server sync.
In this embodiment, terminal device will sort out the local operation of mail, enables the server to basis and returns Local operation classification after class merges, this is determined by the organizational form of mail on the server.Due on server One mailbox includes multiple file parts, such as inbox, outbox, draft, each file possess a unique identity Identification code presss from both sides to identify this document, while comprising sealing mails or files to be empty in file, every envelope mail is also owned by one more A unique identity code identifies.But mail is added in a file or is moved to from a file another When in a file, server will distribute to one new identity code of the mail.Therefore, server is first asked to non-moving It asks and synchronizes, then mobile request is synchronized, and be mail in the file that the moving operation in mobile request is directed toward New identity code is distributed, to improve the success rate of mail action.And if server elder generation synchronizing moving is requested, once together Step failure (such as causing synchronization failure by server, network or client reason), terminal device does not obtain the new body of mail The Identity Code of part identification code and affiliated file, other local operations also can not just synchronize success.
Fig. 4 is a kind of flow chart of the method for mail synchronization in the embodiment of the present invention.As shown in figure 4, this method is for taking It is engaged in device, includes the following steps S41-S42:
Step S41, the synch command that receiving terminal apparatus is sent, synch command include the local behaviour after the merging to mail Make;
Local operation after merging to mail is synchronized in server by step S42 according to synch command.
In one embodiment, when in synch command including the non-moving request and mobile request after sorting out, step S42 Implementable is following steps: according to synch command, non-moving request being synchronized in server;Clothes are synchronized in non-moving request After being engaged in device, mobile request is synchronized in server.Server synchronizes non-moving request and mobile request respectively, This is determined by the organizational form of mail on the server.Since a mailbox includes multiple files on server, such as receive Part case, outbox, draft etc., each file possess a unique Identity Code to identify this document folder, same to eight-legged essay Comprising mails or the files of sealing for sky in part folder, every envelope mail is owned by a unique identity code also to identify more.But When mail is added in a file or is moved in another file from a file, server will be distributed Give the mail one new identity code.Therefore, server first synchronizes non-moving request, then carries out to mobile request It is synchronous, and new identity code is distributed for mail in the file that the moving operation in mobile request is directed toward, to improve The success rate of mail action.And if server elder generation synchronizing moving is requested, once synchronization failure is (such as by server, network or visitor The reasons such as family end cause synchronization failure), terminal device does not obtain the identity of mail new Identity Code and affiliated file Identification code, other local operations also can not just synchronize success.
Using the technical solution of the embodiment, enable the server to carry out the local operation after Mail Merge same in batches Step, greatly reduces the interaction times of terminal device and server, and save the occupied additional networks stream of mail protocol Amount, additionally it is possible to be much less unnecessary simultaneously operating.
Fig. 5 is the flow chart of one of the embodiment of the present invention one method of mail synchronization.
Embodiment one
In this embodiment, terminal device, which can be smart phone, personal computer or tablet computer etc., can install postal The smart machine of case client.As shown in figure 5, including the following steps S51-S55:
Step S51, terminal device establish the operating list of mail, and operating list is for recording on the terminal device to mail Local operation;
Step S52, terminal device close the local operation of mail for what is recorded in preset time period in operating list And;For example, preset time period is 2 minutes, then terminal device will be buffered in terminal device to the local operation of mail in 2 minutes In database, and after having recorded all local operations, all local operations are merged according to set rule, it should Merging process includes the local operation that can eliminate unnecessary synchronization, eliminates similar terms and carry out to the local operation after merging Sequence etc.;
Step S53, terminal device send the synch command including the local operation after merging to server;
Step S54, the synch command that server receiving terminal equipment is sent;
Local operation after merging to mail is synchronized to clothes according to the synch command received by step S55, server It is engaged in device.
Using the technical solution in the present embodiment, by the way that the local operation of mail is buffered in local terminal, and merge one Local operation in the section time, and then batch is uploaded to server, enables the server to the local operation of batch synchronization mail, To greatly reduce the interaction times of terminal device and server, and save the occupied additional networks stream of mail protocol Amount, additionally it is possible to be much less unnecessary simultaneously operating.Meanwhile there may be part success and portions for batch synchronization of the program Divide the state of failure, so as to cancel to the simultaneously operating of part failure, improves synchronous efficiency.
For that two be synchronized in server on terminal device to the local operation of mail main mails can be assisted View are as follows: IMAP (Internet Mail Access Protocol, Interactive Mail Access Protocol) and Exchange agreement.For For both agreements, mail synchronization method provided in an embodiment of the present invention is all applicable.Difference is have under different agreement The interaction times of body are different.
Under IMAP protocol, it is non-moving request class order in include local operation there are three types of: delete mail action, add Add mail action and addition marking operation, and moves the local operation for including in the order for requesting class and only have mobile e-mail operation one Kind.And since IMAP protocol divides file to carry out the operation of mail, the interaction times of terminal device and server It is related with the number of file.And under Exchange agreement, since Exchange agreement does not need single cent to the operation of mail Part folder carries out, therefore the local operation in the order of non-moving request class can be included in the same synch command, only Limited by the operation number of synch command, thus server and terminal device only need carry out twice synchronous interaction can be completed it is all Simultaneously operating, i.e., the synch command interaction of non-moving request class and the synch command interaction of mobile request class.It can be seen that this hair The technical solution that bright embodiment provides effect under Exchange agreement is more excellent.
Fig. 6 is the block diagram of one of the embodiment of the present invention device of mail synchronization.As shown in fig. 6, the device is for eventually End equipment, comprising:
Module 61 is established, for establishing the operating list of mail, operating list is for recording on the terminal device to mail Local operation;
Merging module 62, for being closed what is recorded in preset time period in operating list to the local operation of mail And;
First sending module 63, for sending the synch command including the local operation after merging, server to server For the local operation after the merging to mail to be synchronized in server according to synch command.
In one embodiment, as shown in fig. 7, merging module 62 includes:
First eliminates submodule 621, whether exists simultaneously addition mail action in local operation for identification and deletes postal Part operation;When recognize existed simultaneously in local operation addition mail action and delete mail action when, eliminate addition mail behaviour Upper one or next deletion mail action of mail action made and added, and addition mail action and addition postal eliminated Upper one or next other local operations deleted between mail action of part operation;
Second eliminates submodule 622, for identification with the presence or absence of deletion mail action in local operation;When recognizing local When there is deletion mail action in operation, other local operations before deleting mail action are eliminated;
Merge submodule 623, for being merged to the similar terms in local operation, the local operation after being merged, Similar terms are addition mail action and mobile e-mail operation, the operation of multiple mobile e-mails or the local operation of inverse operation each other;
Sorting sub-module 624, for being ranked up to the local operation after merging.
In one embodiment, as shown in figure 8, merging submodule 623 includes:
First combining unit 6231, for postal will to be added when similar terms are addition mail action and mobile e-mail operates The addition mail action in the file that mobile e-mail operation is directed toward is merged into part operation and mobile e-mail operation;
Second combining unit 6232, for when similar terms are that multiple mobile e-mails operate, multiple mobile e-mails to be operated A mobile e-mail operation is merged into, a mobile e-mail operation moves postal for mail is moved to the last one from initial position The pointed file of part operation;
Third combining unit 6233, for eliminating opposite each other when similar terms are the local operation of inverse operation each other The local operation of operation.
In one embodiment, sorting sub-module 624 includes:
Judging unit, other locals for judging in the local operation after the merging, in addition to adding mail action Whether operation carries out after the addition mail action;
First sequencing unit, in local operation after determining the merging, its in addition to adding mail action When his local operation carries out after the addition mail action, the addition mail action in the local operation after merging is come All local operations most before;
Second sequencing unit, in local operation after determining the merging, its in addition to adding mail action His local operation is not when carrying out after the addition mail action, by the addition mail in the local operation after the merging Operation and/or mobile e-mail operation come the most preceding or last of all local operations.
In one embodiment, as shown in figure 9, above-mentioned apparatus further include:
Judgment module 64, for whether judging in the local operation after merging comprising mobile e-mail operation;
Classifying module 65, when in the local operation after merging including mobile e-mail operation, by the local to mail Operation is classified as mobile request;When not including mobile e-mail operation in the local operation after merging, the local of mail will be grasped Work is classified as non-moving request;
Second sending module 66, for including the non-moving request and/or mobile request after sorting out to server transmission Synch command, server are used to that non-moving request and/or mobile request to be synchronized in server according to synch command, wherein Server first synchronizes non-moving request, synchronizes again to mobile request.
Using technical solution provided in an embodiment of the present invention, by the way that the local operation of mail is buffered in local terminal, and Merge the local operation in a period of time, and then batch is uploaded to server, therefore can greatly reduce terminal device and service The interaction times of device, and save the occupied extra network traffic of mail protocol, additionally it is possible to it is much less unnecessary same Step operation.Meanwhile there may be the states of part success and part failure for batch synchronization of the program, so as to part The simultaneously operating of failure is cancelled, and synchronous efficiency is improved.
Figure 10 is the block diagram of one of the embodiment of the present invention device of mail synchronization.As shown in Figure 10, which is used for Server, comprising:
Receiving module 101, for the synch command that receiving terminal apparatus is sent, after synch command includes the merging to mail Local operation;
Synchronization module 102, for according to synch command, the local operation after the merging to mail to be synchronized to server In.
In one embodiment, as shown in figure 11, synchronization module 102 includes:
First synchronous submodule 1021, for according to synch command, non-moving request to be synchronized in server;
Second synchronous submodule 1022, for after non-moving request is synchronized in server, mobile request to be synchronized Into server.
Using the technical solution of the embodiment, enable the server to carry out the local operation after Mail Merge same in batches Step, greatly reduces the interaction times of terminal device and server, and save the occupied additional networks stream of mail protocol Amount, additionally it is possible to be much less unnecessary simultaneously operating.
It should be understood by those skilled in the art that, the embodiment of the present invention can provide as method, system or computer program Product.Therefore, complete hardware embodiment, complete software embodiment or reality combining software and hardware aspects can be used in the present invention Apply the form of example.Moreover, it wherein includes the computer of computer usable program code that the present invention, which can be used in one or more, The shape for the computer program product implemented in usable storage medium (including but not limited to magnetic disk storage and optical memory etc.) Formula.
The present invention be referring to according to the method for the embodiment of the present invention, the process of equipment (system) and computer program product Figure and/or block diagram describe.It should be understood that every one stream in flowchart and/or the block diagram can be realized by computer program instructions The combination of process and/or box in journey and/or box and flowchart and/or the block diagram.It can provide these computer programs Instruct the processor of general purpose computer, special purpose computer, Embedded Processor or other programmable data processing devices to produce A raw machine, so that being generated by the instruction that computer or the processor of other programmable data processing devices execute for real The device for the function of being specified in present one or more flows of the flowchart and/or one or more blocks of the block diagram.
These computer program instructions, which may also be stored in, is able to guide computer or other programmable data processing devices with spy Determine in the computer-readable memory that mode works, so that it includes referring to that instruction stored in the computer readable memory, which generates, Enable the manufacture of device, the command device realize in one box of one or more flows of the flowchart and/or block diagram or The function of being specified in multiple boxes.
These computer program instructions also can be loaded onto a computer or other programmable data processing device, so that counting Series of operation steps are executed on calculation machine or other programmable devices to generate computer implemented processing, thus in computer or The instruction executed on other programmable devices is provided for realizing in one or more flows of the flowchart and/or block diagram one The step of function of being specified in a box or multiple boxes.
Obviously, various changes and modifications can be made to the invention without departing from essence of the invention by those skilled in the art Mind and range.In this way, if these modifications and changes of the present invention belongs to the range of the claims in the present invention and its equivalent technologies Within, then the present invention is also intended to include these modifications and variations.

Claims (2)

1. a kind of method of mail synchronization, which is characterized in that be used for terminal device, comprising:
The operating list of mail is established, the operating list is used to be recorded on the terminal device and grasps to the local of the mail Make;
The local operation of the mail is merged by what is recorded in preset time period in the operating list;
The synch command including the local operation after the merging is sent to server, the server is used for according to the synchronization Local operation after merging to the mail is synchronized in server by order;
It is described the local operation of the mail is merged by what is recorded in preset time period in the operating list after, institute State method further include:
Whether operated comprising mobile e-mail in local operation after judging the merging;
When in the local operation after the merging including mobile e-mail operation, shifting will be classified as to the local operation of the mail Dynamic request;When not including mobile e-mail operation in the local operation after the merging, the local operation of the mail will be returned Class is non-moving request;
The synch command including non-moving request and/or mobile request after the classification, the server are sent to server For the non-moving request and/or mobile request to be synchronized in server according to the synch command, wherein the service Device first synchronizes the non-moving request, synchronizes again to the mobile request;
It is described that the local operation of the mail is merged by what is recorded in preset time period in the operating list, comprising:
Identify addition mail action and deletion mail action whether are existed simultaneously in the local operation;When recognizing the local When existing simultaneously addition mail action in operation and deleting mail action, the addition mail action and the addition postal are eliminated Upper one or next deletion mail action of part operation, and eliminate the addition mail action and addition mail behaviour Upper one or next other local operations deleted between mail action made;
It identifies in the local operation with the presence or absence of deletion mail action;Mail is deleted when recognizing to exist in the local operation When operation, described other local operations deleted before mail action are eliminated;
Similar terms in the local operation are merged, the local operation after being merged, the similar terms are addition postal Part operation and mobile e-mail operation, the operation of multiple mobile e-mails or the local operation of inverse operation each other;
Local operation after the merging is ranked up;
The similar terms in the local operation merge, the local operation after being merged, and the similar terms are to add Mail action and mobile e-mail is added to operate, the operation of multiple mobile e-mails or the local operation of inverse operation each other, comprising:
When the similar terms are addition mail action and mobile e-mail operates, the addition mail action and mobile e-mail are grasped Merge into the addition mail action in the file that the mobile e-mail operation is directed toward;
When the similar terms are that multiple mobile e-mails operate, a mobile e-mail is merged into the operation of the multiple mobile e-mail Operation, one mobile e-mail operation are signified for the mail is moved to the operation of the last one mobile e-mail from initial position To file;
When the similar terms are the local operation of inverse operation each other, the local operation of the inverse operation each other is eliminated;
The local operation to after the merging is ranked up, comprising:
In local operation after judging the merging, whether other local operations in addition to adding mail action are in the addition It is carried out after mail action;
In local operation after determining the merging, other local operations in addition to adding mail action are in the addition postal When carrying out after part operation, the addition mail action in the local operation after the merging is come into all local operations most Before;
In local operation after determining the merging, other local operations in addition to adding mail action are added described When mail action being added to carry out later, by the addition mail action and/or mobile e-mail operation in the local operation after the merging.
2. a kind of device of mail synchronization, which is characterized in that be used for terminal device, comprising:
Module is established, for establishing the operating list of mail, the operating list is for being recorded on the terminal device to institute State the local operation of mail;
Merging module, for being closed what is recorded in preset time period in the operating list to the local operation of the mail And;
First sending module, for sending the synch command including the local operation after the merging, the service to server Local operation after merging to the mail for being synchronized in server by device according to the synch command;
Described device further include:
Judgment module, for judging in the local operation after the merging whether to operate comprising mobile e-mail;
Classifying module, when in the local operation after the merging including mobile e-mail operation, by the sheet to the mail Ground operation is classified as mobile request;It, will be to the postal when not including mobile e-mail operation in the local operation after the merging The local operation of part is classified as non-moving request;
Second sending module, for sending including the non-moving request after the classification to server and/or moving the same of request Step command, the server are used to that the non-moving request and/or mobile request to be synchronized to service according to the synch command In device, wherein the server first synchronizes the non-moving request, synchronizes again to the mobile request;
The merging module includes:
First eliminates submodule, whether exists simultaneously addition mail action in the local operation for identification and deletes mail behaviour Make;When recognize existed simultaneously in the local operation addition mail action and delete mail action when, eliminate the addition postal Upper one or next deletion mail action of part operation and the addition mail action, and eliminate the addition mail behaviour Work and upper one or next other local operations deleted between mail action of the addition mail action;
Second eliminates submodule, for identification with the presence or absence of deletion mail action in the local operation;When recognizing described When there is deletion mail action in ground operation, described other local operations deleted before mail action are eliminated;
Merge submodule, for merging to the similar terms in the local operation, the local operation after being merged is described Similar terms are addition mail action and mobile e-mail operation, the operation of multiple mobile e-mails or the local operation of inverse operation each other;
Sorting sub-module, for being ranked up to the local operation after the merging;
The merging submodule includes:
First combining unit is used for when the similar terms are addition mail action and mobile e-mail operates, by the addition postal The addition mail action in the file that the mobile e-mail operation is directed toward is merged into part operation and mobile e-mail operation;
Second combining unit, for when the similar terms are that multiple mobile e-mails operate, the multiple mobile e-mail to be operated A mobile e-mail operation is merged into, one mobile e-mail operation is that the mail is moved to last from initial position The pointed file of a mobile e-mail operation;
Third combining unit, it is described opposite each other for eliminating when the similar terms are the local operation of inverse operation each other The local operation of operation;
The sorting sub-module includes:
Judging unit, other local operations for judging in the local operation after the merging, in addition to adding mail action Whether carried out after the addition mail action;
First sequencing unit, in local operation after determining the merging, other in addition to adding mail action When ground operation carries out after the addition mail action, the addition mail action in the local operation after the merging is come All local operations most before;
Second sequencing unit, in local operation after determining the merging, other in addition to adding mail action Ground operation is not when carrying out after the addition mail action, by the addition mail action in the local operation after the merging And/or mobile e-mail operation comes the most preceding or last of all local operations.
CN201510038837.XA 2015-01-26 2015-01-26 A kind of method and device of mail synchronization Active CN105897545B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510038837.XA CN105897545B (en) 2015-01-26 2015-01-26 A kind of method and device of mail synchronization

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510038837.XA CN105897545B (en) 2015-01-26 2015-01-26 A kind of method and device of mail synchronization

Publications (2)

Publication Number Publication Date
CN105897545A CN105897545A (en) 2016-08-24
CN105897545B true CN105897545B (en) 2019-09-10

Family

ID=56999738

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510038837.XA Active CN105897545B (en) 2015-01-26 2015-01-26 A kind of method and device of mail synchronization

Country Status (1)

Country Link
CN (1) CN105897545B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107239246A (en) * 2017-04-28 2017-10-10 福建天泉教育科技有限公司 A kind of picture synchronous display method and system
CN109120503B (en) * 2017-06-26 2022-05-13 中兴通讯股份有限公司 Mail operation synchronization method, device and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1656454A (en) * 2002-03-29 2005-08-17 卓越技术公司 System and method for full wireless synchronization of a data processing apparatus with a data service
CN1851685A (en) * 2006-05-18 2006-10-25 迈世亚(北京)科技有限公司 Mobile electronic mail processing system and method
CN101098313A (en) * 2006-06-30 2008-01-02 华为技术有限公司 Mail transmitting method and system
CN101711386A (en) * 2007-04-24 2010-05-19 丹吉尔股份有限公司 Synchronize email message externally and/or between local electronic mail server and/or the wireless device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1656454A (en) * 2002-03-29 2005-08-17 卓越技术公司 System and method for full wireless synchronization of a data processing apparatus with a data service
CN1851685A (en) * 2006-05-18 2006-10-25 迈世亚(北京)科技有限公司 Mobile electronic mail processing system and method
CN101098313A (en) * 2006-06-30 2008-01-02 华为技术有限公司 Mail transmitting method and system
CN101711386A (en) * 2007-04-24 2010-05-19 丹吉尔股份有限公司 Synchronize email message externally and/or between local electronic mail server and/or the wireless device

Also Published As

Publication number Publication date
CN105897545A (en) 2016-08-24

Similar Documents

Publication Publication Date Title
CN101711386B (en) Synchronizing email messages between an external and/or local email server and/or a wireless device
WO2015017508A1 (en) Systems and methods for electronic message prioritization
CN101227379B (en) Method and system for implementation of data synchronization
CN105745902A (en) Synchronizing event history for multiple clients
WO2014093979A1 (en) Attachment collaboration within message environments
CN106453541A (en) Data synchronization method, server and data synchronization system
US20200233878A1 (en) Card-based information management method and system
WO2020258666A1 (en) Distributed system and data processing method
CN107734017A (en) Data service method and system
CN107704550A (en) File migration method, apparatus and computer-readable recording medium
CN105897545B (en) A kind of method and device of mail synchronization
CN110427134A (en) Data processing method, device, equipment and the readable storage medium storing program for executing of instant messaging
CN106888264B (en) A kind of method for interchanging data and device
CN103679435A (en) Method and system for processing transaction information
CN109688050A (en) The control method and system of instant messaging
CN109710623A (en) A kind of intelligence order synchronous method
CN105450733B (en) A kind of business datum distribution processing method and system
KR20200003764A (en) Apparatus and method for processing work based on work object
KR20140013892A (en) Method of comparing output in a plurality of information systems
CN108600347A (en) A kind of distributed computational data synchronous method and device
CN106850980B (en) The method for cleaning and mobile terminal of Email attachment in a kind of mobile terminal
CN113114557B (en) Message sending method and device, electronic equipment and storage medium
CN113382075A (en) Enterprise information management platform, management method, electronic device and storage medium
CN112491692A (en) Method and system for collecting information at fixed time, computer readable storage medium and electronic equipment
CN102737302A (en) Method, apparatus, and system of information transmission

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 1228133

Country of ref document: HK

GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20190920

Address after: No. 85 Jinyu Avenue, North New District, Chongqing 400000

Patentee after: Chongqing Yixin Ward Technology Co., Ltd.

Address before: 100190 Beijing City, Haidian District Zhichun Road No. 49 sigma apartment block A room 1807

Patentee before: Jiuyu (Beijing) Technology Co., Ltd.

TR01 Transfer of patent right
REG Reference to a national code

Ref country code: HK

Ref legal event code: WD

Ref document number: 1228133

Country of ref document: HK