Contact person's tag synchronous method of a kind of self-defined chat tool and deviceTechnical field
The present embodiments relate to technical field of mobile terminals, particularly relate to a kind of self-defined chat workContact person's tag synchronous method of tool and device.
Background technology
In recent years, developing rapidly and mobile terminal Intellectualized Tendency along with mobile communication technologyAccelerating, people are just entering into new mobile Internet epoch.Varied possess network evenConnect the mobile terminal of ability, the appearance of such as mobile phone, panel computer, electricity paper book etc., bring peopleAccess the convenient of the Internet whenever and wherever possible.
The appearance of two big mobile platform AppleiOS and Google Android, especially will be mobileTerminal has pushed the epoch taken as the leading factor with application and data to.The mobile-terminal platform of today possessesThe several functions such as office, amusement, social activity, data of its storage also become more to enrich, such asPicture, music, video, animation etc..
User enjoy dissimilar mobile terminal bring convenient time, also encounter multiple terminals and depositThe problem of the data uniformity management of storage.
Multiple terminals data syn-chronization can be based on SyncML (Synchronization MarkupLanguage) agreement is carried out, and SyncML is general mobile data synchronization agreement, permissibleData syn-chronization is carried out at compatible equipment, program and network.
Critically important in the data syn-chronization of multiple terminals one is the synchronization of contact person, if multiple terminalLogged in same account, then when one of them terminal contact person increased newly, delete,The operations such as amendment, then the last state of data can be synchronized on server, and server completesAfter information updating, it is notified that other-end logs in the mobile phone agreeing to account, promotes terminal to pass through sameStep obtains these data and updates.So, the contact data in the terminal of same account is maintained forConsistent.
This is very important, and such as, someone account opens the function of synchronization, then heData just total face the most on the server deposit.If he has changed new cell-phone, or has forgotten band mobile phone,He has only to login account on other mobile phone, by synchronizing, just the contact number of himselfAccording to being retrieved.
Contact person's label has very important data, i.e. a chat tool, such as, skype,Qq, ring is chatted, self-defined etc., wants contact person and synchronizes successfully, it is necessary to ensure chat tool numberAccording to normal synchronized.
The method of prior art can utilize the instant message in tool kit ezvcard.propertyTransmission and on-line checking agreement (Impp, instant messaging and Presence Protocol)Class, the chat tool of Impp class one contact person of definition form in synchronization, it is used for building oneIndividual have space reception, the instant messages system of issue capability.
Chat tool is represented as Uniform Resource Identifier (URI, Uniform ResourceIdentifier) form is: "<agreement>:<process>".
Such as, chat tool Yahoo:
Account is johndoe@yahoo.com;
The URI generated is: " ymsgr:johndoe@yahoo.com ";
The form of URI is: [scheme :] scheme-specific-part [#fragment];
Wherein, the name of chat tool exists in the scheme of URI, the account of chat toolIt is put in the scheme-specific-part of URI.
But, the mode stored in URI due to Impp class is limited, the name of chat toolLimited by the significant character of scheme in URI.Such as, scheme cannot deposit certainA little punctuation marks, such as colon, ": ", and emoticon, so User Defined chatIf imprudence have input colon and emoticon when of instrument, may result in chatting of contact personIt instrument cannot synchronize successfully.
Summary of the invention
The embodiment of the present invention provides contact person's tag synchronous method and the dress of a kind of self-defined chat toolPut, it would be preferable to support contact person's tag sync of the self-defined chat tool of band punctuate and emoticon.
The embodiment of the present invention provides contact person's tag synchronous method of a kind of self-defined chat tool, bagInclude:
Pre-setting URI on the server and store mapping table, described URI stores corresponding relationTable includes scheme row, Scheme-specific-part row and fragment row;
As the contact person increased newly and revise, if contact person's label exists self-defined chat tool,The chat data of described self-defined chat tool is stored in described URI storage mapping table,The name of wherein said chat tool is stored in described Scheme-specific-part row, chat toolAccount be stored in described fragment row;
When synchronizing contact person, from server, obtain described URI store mapping table, from instituteState Scheme-specific-part row and parse the name of chat tool, solve from described fragment rowSeparate out the account of chat tool, and the data of the contact person parsed are updated local data base.
The embodiment of the present invention provides a kind of shifting that self-defined chat tool synchronizes in contact person's labelDynamic terminal, including:
First processing module, for during as the contact person of newly-increased and amendment, if in contact person's labelThere is self-defined chat tool, the chat data in described contact person's label is stored in described URIIn storage mapping table, described URI storage mapping table is configured the most on the server,The name of the chat tool that described contact person uses is stored in described Scheme-specific-part row,The account of the chat tool that described contact person uses is stored in described fragment row;
Second processing module, for when synchronizing contact person, obtaining described URI and deposit from serverStorage mapping table, parses, from described Scheme-specific-part row, the chat that contact person usesThe name of instrument, parses the account of the chat tool that contact person uses from described fragment row,And the contact person parsed is updated local data base.
Contact person's tag synchronous method of the self-defined chat tool that the embodiment of the present invention provides and dressPut, by Immp class storage mode in URI is improved, since the form of URI is:[scheme :] scheme-specific-part [#fragment], and scheme-specific-part is permissibleDeposit punctuate and emoticon, then the scheme-specific-part part of URI can be utilized to depositThe title of storage chat tool, fragment stores the account of chat tool so that User Defined is chattedWhen synchronizing, no longer there is character and limit, thus ensure that the connection of self-defined chat tool in it instrumentIt it is people's tag sync.
Accompanying drawing explanation
In order to be illustrated more clearly that the embodiment of the present invention or technical scheme of the prior art, below willThe accompanying drawing used required in embodiment or description of the prior art is briefly described, aobvious and easyInsight, the accompanying drawing in describing below is some embodiments of the present invention, for ordinary skillFrom the point of view of personnel, on the premise of not paying creative work, it is also possible to obtain it according to these accompanying drawingsHis accompanying drawing.
Fig. 1 be the present invention a specific embodiment in self-defined chat tool contact person's label withThe schematic flow sheet of one step process;
Fig. 2 be the present invention a specific embodiment in self-defined chat tool contact person's label withThe detailed process schematic diagram of one step process;
Fig. 3 is URI in contact person's chat tool syncsort Impp in the present invention and prior artStorage relation correspondence table contrast schematic diagram.
Fig. 4 be the present invention a specific embodiment in self-defined chat in contact person's labelThe structural representation of the mobile terminal that instrument synchronizes.
Detailed description of the invention
For making the purpose of the embodiment of the present invention, technical scheme and advantage clearer, below in conjunction withAccompanying drawing in the embodiment of the present invention, carries out clear, complete to the technical scheme in the embodiment of the present inventionGround describes, it is clear that described embodiment is a part of embodiment of the present invention rather than wholeEmbodiment.Based on the embodiment in the present invention, those of ordinary skill in the art are not making creationThe every other embodiment obtained under property work premise, broadly falls into the scope of protection of the invention.
It is as follows that the URI of character string forms quotes grammer:
[scheme:]scheme-specific-part[#fragment]
Wherein, square brackets [...] are used for describing optional ingredient;
Scheme is scenario name;
The concrete part that scheme-specific-part: scenario name is corresponding;
Fragment is fragment;
Character ": " and " # " represent their own.
RFC 2396 accurately point out URI quote in each different ingredients allow the word that usesSymbol includes: alpha US-ASCII alphabetic character, ' A ' to ' Z ' and ' a ' to ' z ';digitUS-ASCII decimal digit, ' 0 ' to ' 9 ';Alphanum all alpha and digit character;Unreserved all alphanum character and character string " _-!.~' () * " in the character that comprises;punctCharacter string ",;: $ &+=" in the character that comprises;Reserved all punct character and character string"?/ []@" in the character that comprises;Escaped escape eight hyte, i.e. three part combinations: percentage sign (' % ')Two hexadecimal numbers of heel (' 0 '-' 9 ', ' A '-' F ' and ' a '-' f ');Other is not included in US-ASCIIUnicode character in character set is not that control character is (according to Character.isISOControl sideMethod), and be not space character.
One concrete URI example is as follows:
www.java2s.com:8080/yourpath/fileName.htm?Stove=10&path=32&id=4#harvic
Wherein:
Sheme: be http;
Scheme-specific-part: the part being included between scheme and fragment,//www.java2s.com:8080/yourpath/fileName.htm?Stove=10&path=32&id=4,Note bringing //, because except [scheme :] and [#fragment] part is entirelyscheme-specific-part;
Fragment: be harvic.
If from decomposing it can be seen that the URI of chat tool above, the name of chat tool is depositedIn the scheme of URI, the account of chat tool is put into the scheme-specific-part of URIIn.
In prior art, the mode stored in URI due to Impp class is limited, the name of chat toolWord is limited by the significant character of scheme in URI, so during User Defined chat tool such asFruit imprudence have input restricted character, and the chat tool that may result in contact person cannot synchronize intoMerit.
Immp class storage mode in URI is improved by the present invention, since the form of URIFor: [scheme :] scheme-specific-part [#fragment], and scheme-specific-part canTo deposit punctuate and emoticon, then the scheme-specific-part part of URI can be utilizedThe title of storage chat tool, fragment stores the account of chat tool so that User DefinedWhen synchronizing, no longer there is character and limit, thus ensure that self-defined chat tool in chat toolContact person's tag sync.
Embodiment one:
Fig. 1 be the present invention a specific embodiment in self-defined chat tool contact person's label withThe schematic flow sheet of one step process.
As it is shown in figure 1, the method is applied on mobile terminal, including:
Step S11, pre-sets URI on the server and stores mapping table, and described URI depositsStorage mapping table includes scheme row, Scheme-specific-part row and fragment row.
Step S12, as the contact person increased newly and revise, if existing self-defined in contact person's labelThe data of described self-defined chat tool are stored in URI storage mapping table by chat tool,The name of the chat tool in the chat data of wherein said self-defined chat tool is stored inScheme-specific-part arranges, and the account of chat tool is stored in fragment row.
Step S13, when synchronizing contact person, obtains URI from server and stores mapping table,Parse the name of chat tool from Scheme-specific-part row, parse from fragment rowThe account of chat tool, and the data of the contact person parsed are updated local data base.
Embodiment two:
Fig. 2 be the present invention a specific embodiment in the detailed stream of synchronous method of contact person's labelJourney schematic diagram.
As in figure 2 it is shown, the method is applied on mobile terminal, including:
Step S21, the URI pre-setting self-defined chat tool stores mapping table.
In this step, the URI storage correspondence of self-defined chat tool is set the most on the serverRelation table, the URI of character string forms is: [scheme :] scheme-specific-part [#fragment],Therefore, described URI storage mapping table includes scheme row, Scheme-specific-part rowArrange with fragment.
Step S22, the newly-increased and contact person of amendment, and fill contact person's chat tool syncsort ImppThe storage relation correspondence table of middle URI.
In this step, as the contact person increased newly and revise, obtain and need connection that is newly-increased and that reviseIt is people, searches the chat data in contact person's label, it is judged that the chat tool class that chat data usesWhether type is customization type.
If contact person's label exists self-defined chat tool, chatting according to self-defined chat toolDay data structure URI, and store in URI storage mapping table on the server.
URI in contact person's chat tool syncsort Impp in prior art and embodiments of the inventionStorage relation correspondence table as shown in Figure 3.
In currently existing scheme, the scheme row in URI storage mapping table are used for storing chatThe name of instrument, Scheme-specific-part row are for the account of chat tool, and fragment is classified asEmpty.
In an embodiment of the present invention, in URI storage mapping table, scheme is used for storing characterString constant, Scheme-specific-part is for storing the name of chat tool, and fragment is used for depositingThe account of storage chat tool.
Due to the scheme-specific-part field of URI have than scheme field the most legalCharacter.Scheme uppercase/lowercase beginning of letter, after be empty or and then more capitalization/littleWrite mother, numeral, plus sige, minus sign and period.A lot of conventional symbol such as ": " and emoticonNumber all it is unsatisfactory for the form of Scheme.And ": " and emoticon can beScheme-specific-part stores.So, in the embodiment of the present invention, Scheme is used for storage notComprising the character string constant of restricted character, Scheme-specific-part is for storing the name of chat toolWord, Impp, for storing the account of chat tool, is changed and is best understood by least by fragment,And still can store data with URI.
According to data genaration contact person's chat tool syncsort Impp in URI storage mapping tableObject.
Step S23, populated contact person is uploaded onto the server on.
In this step, contact person's chat tool syncsort Impp object of generation is stored in serviceIn electronic business card (vcard) on device.
Step S24, if needing to synchronize contact person, obtains the data of contact person from server.
In this step, when needs synchronize contact person, from the electronic business card of server, obtain ImppObject.
Step S25, resolves the data of contact person.
In this step, carry out Impp object resolving the contact obtaining URI storage mapping tablePeople, the Scheme-specific-part row from the URI storage mapping table that contact person is corresponding solveSeparate out the name of the chat tool that this contact person uses, parse this contact person from fragment row and makeThe account of chat tool.
Step S26, updates local data base by the contact person parsed.
Embodiment three:
Fig. 4 be the present invention a specific embodiment in for the mobile terminal of contact person's tag syncStructural representation.
As shown in Figure 4, the mobile terminal of the present invention includes:
First processing module 41, is used for as the contact person increased newly and revise, if contact person's labelIn there is self-defined chat tool, the chat data of described self-defined chat tool is stored in describedIn URI storage mapping table, described URI storage mapping table is carried out the most on the serverArrange, the name of described chat tool is stored in described Scheme-specific-part row, chatThe account of instrument is stored in described fragment row;
Second processing module 42, for when synchronizing contact person, obtaining described URI from serverStorage mapping table, parses chatting of contact person's use from described Scheme-specific-part rowThe name of it instrument, parses the account of the chat tool that contact person uses from described fragment row,And the data of the contact person parsed are updated local data base.
Specifically,
First processing module 41 is used for: takes and needs the newly-increased and contact person of amendment, searches contact person's markChat data in label, it is judged that whether the chat tool type that chat data uses is customization type;If contact person's label existing self-defined chat tool, according to the chat data in contact person's labelStructure URI, and store in URI storage mapping table on the server;Store according to URIContact person in mapping table generates contact person's chat tool syncsort Impp object;By generateIn Impp object storage electronic business card on the server.
Second processing module 42 is used for: when needs synchronize contact person, from the electronic business card of serverMiddle acquisition Impp object;Carry out Impp object resolving the connection obtaining URI storage mapping tableIt is people;Scheme-specific-part row from the URI storage mapping table that contact person is correspondingParse the name of the chat tool that described contact person uses, parse described from fragment rowIt it is the account of the chat tool that people uses.
Device embodiment described above is only schematically, wherein said as separating componentThe unit illustrated can be or may not be physically separate, the parts shown as unitCan be or may not be physical location, i.e. may be located at a place, or can also divideCloth is on multiple NEs.Some or all of mould therein can be selected according to the actual needsBlock realizes the purpose of the present embodiment scheme.Those of ordinary skill in the art are not paying creativenessIn the case of work, i.e. it is appreciated that and implements.
Through the above description of the embodiments, those skilled in the art is it can be understood that arriveEach embodiment can add the mode of required general hardware platform by software and realize, and the most also may be usedTo pass through hardware.Based on such understanding, technique scheme is the most in other words to prior artThe part contributed can embody with the form of software product, and this computer software product canWith storage in a computer-readable storage medium, such as ROM/RAM, magnetic disc, CD etc., includingSome instructions with so that computer equipment (can be personal computer, server, orThe network equipment etc.) perform the method described in some part of each embodiment or embodiment.
Last it is noted that above example is only in order to illustrate technical scheme, rather thanIt is limited;Although the present invention being described in detail with reference to previous embodiment, this areaThose of ordinary skill is it is understood that it still can be to the technical scheme described in foregoing embodimentsModify, or wherein portion of techniques feature is carried out equivalent;And these are revised or replaceChange, do not make appropriate technical solution essence depart from various embodiments of the present invention technical scheme spirit andScope.