CN104811366B - A kind of loaming method and device of network communication message - Google Patents

A kind of loaming method and device of network communication message Download PDF

Info

Publication number
CN104811366B
CN104811366B CN201410038754.6A CN201410038754A CN104811366B CN 104811366 B CN104811366 B CN 104811366B CN 201410038754 A CN201410038754 A CN 201410038754A CN 104811366 B CN104811366 B CN 104811366B
Authority
CN
China
Prior art keywords
message
time
time section
history
trusted
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
CN201410038754.6A
Other languages
Chinese (zh)
Other versions
CN104811366A (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.)
Alibaba Group Holding Ltd
Original Assignee
Alibaba Group Holding 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 Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN201410038754.6A priority Critical patent/CN104811366B/en
Publication of CN104811366A publication Critical patent/CN104811366A/en
Priority to HK15109535.6A priority patent/HK1208968A1/en
Application granted granted Critical
Publication of CN104811366B publication Critical patent/CN104811366B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/50Reducing energy consumption in communication networks in wire-line communication networks, e.g. low power modes or reduced link rate

Landscapes

  • Information Transfer Between Computers (AREA)

Abstract

This application provides a kind of loaming method and device of network communication message, the method includes:It initiates message and obtains request;It determines that the message obtains and asks corresponding first time section;Determine the corresponding one or more trusted times section of history message that client locally preserves, wherein each history message of the user in trusted time section has all been stored in client local;Judge whether the first time section falls into trusted time section;When the first time section does not fall within trusted time section, then the request that the first history message of the user is downloaded from server is initiated.While the application ensures history message accuracy, reduce the number downloaded with server to the maximum extent, also the number of operations for reducing client and server response to the maximum extent, reduces the resource occupation of client and server, improves client and the operational efficiency of server.

Description

A kind of loaming method and device of network communication message
Technical field
This application involves the technical fields of instant communication information processing, more particularly to a kind of roaming of network communication message Method, and, a kind of roaming device of network communication message.
Background technology
With the development of Internet technology, instant message applications (Instant Messenger, abbreviation IM) rapid proliferation. Instant messaging is a kind of business of instant exchange message Internet-based, and two people or more people is allowed to use the instant biography in network Message language, archives, voice is passed to exchange with video.
User can log in the same instant messaging account on different terminal devices using same instant message applications, It is directed to the processing of same instant messaging account generated history message on different terminal equipment at present, there are two types of modes:One Kind is that history message of the instant messaging account on each terminal device is respectively stored in terminal device local, but such end End equipment cannot check the history message in another station terminal equipment, when user's changes terminal equipment, chat record before Can not automatic synchronization come;
Another processing mode is that the history message of the instant messaging account is stored in server by each terminal device, every time After instant messaging account logins successfully, all from server sync history message to local, for example, if login user is good with some Friend has the chat up to a hour, and within this hour, which frequently switches in 3 station terminal equipment.So this The chat messages of one hour are scattered in 3 station terminal equipment, received message in every equipment, and only therein one Part.At this point, if user wants to check the chat record of this hour whole on terminal device A, it is necessary to from server-side Synchronization message only saves some scrappy message segments, then terminal device A can not confirm local message piece due to local Whether there are other message between section N and message segment N+1.Therefore, terminal device A is in order to ensure that message is not missed, Zhi Nengcong The message of server synchronization whole.When the 2nd registration terminal device A of the user, the history for checking this primary hour again is thought When chat record, whether the message that terminal A does not still know local is fully synchronized, then it can only be again fully synchronized again Once.Citing:If there is 10 history messages, on terminal device A, history message 4,5,6 is set history message 1,2,3 in terminal On standby B, history message 7,8,9 is on terminal device C, and history message 10 is on terminal device A.When user is on terminal device A It logs in, reads local data base, there are 4 history messages, number to be:1,2,3,10.Terminal device A has no idea to know this 4 History message belongs to a period or multiple periods, also has no idea to know among them whether also have that omits to go through History message can uniquely be done, and be exactly every time from the message of server synchronization whole.Flow is relatively expended in this way, and synchronous History message repeatability it is high, cause local to history message difficult management.
Therefore, those skilled in the art's problem in the urgent need to address is:A kind of message roaming in instant messaging is provided Mechanism saves Internet resources to complete synchronization instant messaging account while the history message on different terminal equipment.
Invention content
Technical problems to be solved in this application are to provide a kind of loaming method of network communication message, to complete synchronization Instant messaging account saves Internet resources while the history message on different terminal equipment.
Correspondingly, present invention also provides a kind of roaming devices of network communication message, to ensure the above method in reality Application in border.
To solve the above-mentioned problems, this application discloses a kind of loaming methods of network communication message, including:
It initiates message and obtains request;
It determines that the message obtains and asks corresponding first time section;
Determine the corresponding one or more trusted times section of history message that client locally preserves, wherein Yong Hu Each history message in trusted time section has all been stored in client local;
Judge whether the first time section falls into trusted time section;
When the first time section does not fall within trusted time section, then initiate to download the of the user from server The request of one history message.
Preferably, what the history message was opened with client is associated with the session of another user client communication, described Session has corresponding time shaft, includes one or more of trusted time sections on the time shaft.
Preferably, further include:
First history message is stored in client local, and the corresponding time interval of the first history message is incorporated to Trusted time section.
Preferably, the message request includes time qualifications, and the time qualifications limit the first time Section;And the time of origin of first history message falls into the first time section.
Preferably, the message request includes time qualifications, and the time qualifications include a timestamp;
The determination message obtains the step of asking corresponding first time section and includes:
Determine user the second of the predetermined quantity that client locally preserves and time of origin is before the timestamp History message;And
Determine that the start and end time interval of the second history message of the predetermined quantity is first time section;
Wherein, the time of origin of first history message is before the timestamp.
Preferably, the message request includes time qualifications, and the time qualifications include a timestamp;
The determination message obtains the step of asking corresponding first time section and includes:
Determine user the second of the predetermined quantity that client locally preserves and time of origin is after the timestamp History message;And
Determine that the start and end time interval of the second history message of the predetermined quantity is first time section;
Wherein, the time of origin of first history message is after the timestamp.
Preferably, further include:
When the first time section falls into trusted time section, then the first time area is locally obtained from client The second interior history message.
Preferably, it when the first time section does not fall within trusted time section, then initiates from described in server download The request of the second history message of user, including:
Judge whether to be stored with the first history message for meeting and imposing a condition;
If server storage has satisfaction to impose a condition and is not stored in the first history message of client local, from The satisfaction that server downloads the user imposes a condition and is not stored at least partly the first history message of client local;
At least partly first history message is stored in client local, and at least partly first history is disappeared It ceases corresponding time interval and is incorporated to trusted time section;
Wherein, described impose a condition includes time qualifications, and the time qualifications are asked according to message acquisition Ask determining.
Preferably, further include:
If server is not stored with the first history message for meeting and imposing a condition, is obtained and asked according to the message The one or more the second history messages are locally obtained from client, and the first time section is incorporated to trusted time section.
Preferably, the situation that the first time section does not fall within trusted time section includes:The first time section It is at least partly not Chong Die with the trusted time section.
Preferably, the situation that the first time section does not fall within trusted time section includes:The first time section Part at least partly Chong Die not with the trusted time section and the first time section and the trusted time section Overlapping;
The request of first history message for initiating to download the user from server, including:
User is downloaded in the first time the section not partial section Chong Die with the trusted time section from service At least partly history message occurred.
Preferably, the situation that the first time section does not fall within trusted time section includes:The first time section There are interval sections with the trusted time section;
The request of first history message for initiating to download the user from server, including:
At least partly history message that user occurs in the interval section is downloaded from service.
Preferably, the step that first history message is stored in client local includes:
First history message is stored in the message database of the client local;
Duplicate removal processing is carried out to the first history message being stored in the message database of client local.
Disclosed herein as well is a kind of loaming methods of network communication message, including:
When user account logins in the duration of client the chat window opened for the first time with communication object, initiate Message initialization is asked, and the first message that the first preset quantity of active user's account is downloaded from server records, and described first Information of the first message record with first time section of preset quantity;
It is the corresponding trusted time section of the chat sessions by the first time interval mark;
Within the duration, user initiates history message and obtains request;
Request, which is obtained, according to the history message determines one second time interval;
Judge whether second time interval falls into trusted time section;
When second time interval does not fall within trusted time section, downloading second message from server records;
Show the second message record.
Preferably, further include:The message that user occurs within the duration is stored in client local, and by institute Stating the duration is incorporated to the trusted time section.
Preferably, further include:By the second message record storage in client local, and the second message is recorded Corresponding time interval is incorporated to the trusted time section.
Preferably, further include:Show the first message record.
Preferably, it includes time qualifications that the history message, which obtains request, described in the time qualifications restriction Second time interval;And the time of origin of the second message record falls into second time interval.
Preferably, it includes time qualifications that the history message, which obtains request, and the time qualifications include for the moment Between stab;
It is described that determining one second time interval of request is obtained according to the history message, including:
Determine user client locally preserve and time of origin in the timestamp before or after it is second default The second message of quantity records;
According to the start and end time interval of the second message of second preset quantity record and timestamp restriction Second time interval.
Preferably, further include:
When second time interval falls into trusted time section, the second message record is shown.
Preferably, the situation that second time interval does not fall within trusted time section includes:Second time interval Part at least partly Chong Die not with the trusted time section and second time interval and the trusted time section Overlapping;
It is described to download second message record from server, including:
From service download user second time interval the not partial section Chong Die with the trusted time section At least partly Message Record of interior generation.
Disclosed herein as well is a kind of roaming devices of network communication message, including:
Message obtains request initiation module, and request is obtained for initiating message;
First time interval determination module asks corresponding first time section for determining that the message obtains;
Trusted time interval determination module, for determining the corresponding one or more of history message that client locally preserves Trusted time section, wherein each history message of the user in trusted time section has all been stored in client local;
First falls into judgment module, for judging whether the first time section falls into trusted time section;
First history message request module, for when the first time section does not fall within trusted time section, then sending out Play the request that the first history message of the user is downloaded from server.
Preferably, what the history message was opened with client is associated with the session of another user client communication, described Session has corresponding time shaft, includes one or more of trusted time sections on the time shaft.
Preferably, further include:
First history message memory module, for first history message to be stored in client local;
First history message is incorporated to module, for the corresponding time interval of the first history message to be incorporated to trusted time area Between.
Preferably, the message request includes time qualifications, and the time qualifications limit the first time Section;And the time of origin of first history message falls into the first time section.
Preferably, the message request includes time qualifications, and the time qualifications include a timestamp;
The first time interval determination module includes:
First determination sub-module, for determine user client locally preserve and time of origin the timestamp it Second history message of preceding predetermined quantity;And
Second determination sub-module, for determining that the start and end time interval of the second history message of the predetermined quantity is first Time interval;
Wherein, the time of origin of first history message is before the timestamp.
Preferably, the message request includes time qualifications, and the time qualifications include a timestamp;
The first time interval determination module includes:
Third determination sub-module, for determine user client locally preserve and time of origin the timestamp it Second history message of predetermined quantity afterwards;And
4th determination sub-module, for determining that the start and end time interval of the second history message of the predetermined quantity is first Time interval;
Wherein, the time of origin of first history message is after the timestamp.
Preferably, further include:
Second history message acquisition module, for when the first time section falls into trusted time section, then from visitor Family end obtains the second history message in the first time section.
Preferably, the first history message request module includes:
Setting condition judging submodule is stored with the first history message for meeting and imposing a condition for judging whether;
First part downloads submodule, if having satisfaction to impose a condition for server storage and not being stored in client sheet When first history message on ground, then the satisfaction that the user is downloaded from server imposes a condition and is not stored in client local At least partly the first history message;
Part sub-module stored, at least partly first history message to be stored in client local;
First part is incorporated to submodule, can for the corresponding time interval of at least partly first history message to be incorporated to Believe time interval;
Wherein, described impose a condition includes time qualifications, and the time qualifications are asked according to message acquisition Ask determining.
Preferably, further include:
Second part acquisition submodule, if not being stored with the first history message for meeting and imposing a condition for server When, then request is obtained according to the message and locally obtains the one or more the second history messages from client;
Second part is incorporated to submodule, for the first time section to be incorporated to trusted time section.
Preferably, the situation that the first time section does not fall within trusted time section includes:The first time section It is at least partly not Chong Die with the trusted time section.
Preferably, the situation that the first time section does not fall within trusted time section includes:The first time section Part at least partly Chong Die not with the trusted time section and the first time section and the trusted time section Overlapping;
The first history message request module includes:
Part III download submodule, for from service download user the first time section not with it is described credible when Between section be overlapped partial section in occur at least partly history message.
Preferably, the situation that the first time section does not fall within trusted time section includes:The first time section There are interval sections with the trusted time section;
The first history message request module includes:
Part IV downloads submodule, is at least partly gone through for what is occurred in the interval section from service download user History message.
Preferably, the first history message memory module includes:
Message database sub-module stored, the message for first history message to be stored in the client local In database;
Duplicate removal submodule, for carrying out duplicate removal to the first history message being stored in the message database of client local Processing.
Disclosed herein as well is a kind of roaming devices of network communication message, including:
First message records download module, for when user account login in the duration of client open for the first time with When the chat window of communication object, message initialization request is initiated, the first present count of active user's account is downloaded from server The first message of amount records, information of the first message record with first time section of first preset quantity;
Mark module, for being the corresponding trusted time section of the chat sessions by the first time interval mark;
History message obtains request module, within the duration, user to initiate history message and obtains request;
Second time interval determining module determines one second time interval for obtaining request according to the history message;
Second falls into judgment module, for judging whether second time interval falls into trusted time section;
Second message records download module, for not falling within trusted time section in second time interval, from service Device downloads second message record;
Second message record display module, for showing the second message record.
Preferably, further include:
Duration memory module, for the message that user occurs within the duration to be stored in client sheet Ground;
Duration is incorporated to module, for the duration to be incorporated to the trusted time section.
Preferably, further include:
Second message record storage module, for the second message record storage is local in client;
Second message record be incorporated to module, for by the second message record corresponding time interval be incorporated to it is described credible Time interval.
Preferably, further include:
First message record display module, for showing that first message records.
Preferably, it includes time qualifications that the history message, which obtains request, described in the time qualifications restriction Second time interval;And the time of origin of the second message record falls into second time interval.
Preferably, it includes time qualifications that the history message, which obtains request, and the time qualifications include for the moment Between stab;
The second time interval determining module includes:
5th determination sub-module, for determine user client locally preserve and time of origin the timestamp it Preceding or the second preset quantity later second message record;
6th determination sub-module, start and end time interval for being recorded according to the second message of second preset quantity and The timestamp limits second time interval.
Preferably, further include:
Second message record display module, for when second time interval falls into trusted time section, showing institute State second message record.
Preferably, the situation that second time interval does not fall within trusted time section includes:Second time interval Part at least partly Chong Die not with the trusted time section and second time interval and the trusted time section Overlapping;
The second message records download module:
Lap download submodule, for from service download user second time interval not with it is described credible At least partly history message occurred in the partial section of time interval overlapping.
Compared with the background art, the embodiment of the present application has the following advantages:
In the embodiment of the present application, client is each session creation time axis in the communication tool account logged in, On a timeline with trusted time section, mark carried out the corresponding time zone of the history message of consistency desired result with server Between, when history message is checked in user's request, determine first time section, then judging whether first time section falls into can Believe time interval, for not falling within the first time section in trusted time section, then initiates to disappear from the first history of server download The request of breath, for falling into the first time section in trusted time section, then the message that client of being subject to is locally stored, no longer It is downloaded from server, for identical history message, client only can once be downloaded from server, ensure history While message accuracy, reduces the number downloaded with server to the maximum extent, also reduce client to the maximum extent With the number of operations of server response, reduce the resource occupation of client and server, improves client and server Operational efficiency, and due to reducing download time to the maximum extent, correspondingly reduce the consumption of Internet resources to the maximum extent.
Furthermore for the message that the first time section for falling into trusted time section, then client of being subject to are locally stored, It is no longer downloaded from server, the effect speed of displaying history message can be greatly speeded up, while improving user experience.
In addition, when history message is downloaded from server every time to local message database, all can to history message into Row duplicate removal processing, it is unique for ensure that the history message stored in message database all, saves the memory space of database, side Just to the management of the history message in message database, the efficiency for reading history message in message database is improved.
Description of the drawings
Fig. 1 is a kind of step flow chart of the loaming method embodiment 1 of network communication message of the application;
Fig. 2 is a kind of step flow chart of the loaming method embodiment 2 of network communication message of the application;
Fig. 3 is a kind of step flow chart of the loaming method embodiment 3 of network communication message of the application;
Fig. 4 is a kind of step flow chart of the loaming method embodiment 4 of network communication message of the application;
Fig. 5 is a kind of structure diagram of the roaming device embodiment 1 of network communication message of the application;
Fig. 6 is a kind of structure diagram of the roaming device embodiment 2 of network communication message of the application.
Specific implementation mode
In order to make the above objects, features, and advantages of the present application more apparent, below in conjunction with the accompanying drawings and it is specific real Applying mode, the present application will be further described in detail.
Referring to Fig.1, a kind of step flow chart of the loaming method embodiment 1 of network communication message of the application is shown, Wherein, message roaming refer to when user multiple client switching use with a communication tool login same account when, one Client-side can check the history message of other client-sides, be produced merely for example, user has logged in account in customer end A Its message, user replace client, and the same account is logged in customer end B, open chat window, can roam in client The message of the generation of A.
The embodiment of the present application may comprise steps of:
Step 101, it initiates message and obtains request;
Message obtain request can be client receive user for a certain session Message Record obtain instruction when The acquisition of the history message of initiation is asked.For example, when user can be by way of touching or clicking mouse in a certain session " Message Record " function button is selected in chat window interface, alternatively, top is reached toward the chat window for pulling up a certain session, It is equivalent to the Message Record acquisition instruction for receiving user for a certain session.
In a kind of situation, the message request may include time qualifications, and the time qualifications can limit The fixed first time section;And the time of origin of first history message can fall into the first time section.
In practical applications, if the history message of a certain session is large number of, user can specify some time to limit The history message occurred in condition, such as 12 days December -2013 years on the 11st December in 2013, time period can be formed at the first time Section.
In another situation, user can be obtained based on the history message of current presentation first occurred or in rear hair Raw history message.For example, the history that user occurs when by indicating that time restriction condition checks 11 days 20 December in 2013 After message, the history message that occurs when can ask to check 11 days 19 December in 2013 or when 11 days 21 December in 2013.
In the concrete realization, the session phase with another user client communication that the history message can be opened with client Association, the session have corresponding time shaft, include one or more of trusted time sections on the time shaft;And it uses Each history message of the family in trusted time section has all been stored in client local.
Session can be two or more users by being established in respective client login user account , as single chat or group chat (group is chatted), the user for establishing session can have friend relation, can also not have friend relation.User When opening session, other associated accounts can be online, can also be offline, the embodiment of the present application is not subject to this Limitation.
In the account that client logs in, each session of the account may have respective time shaft.
Using the embodiment of the present application, client formerly can carry out message consistency desired result with server, will verify successfully The corresponding time interval of message afterwards is write on time shaft, and trusted time section is obtained.
For example, user is in the survival time, (user continuously logs in some client the time of the account of communication tool, user It is the survival time next time to exit after the account and log on same account) in first (first opens meeting within the survival time Words are to be initially opened, and session is closed after first switching on and opened again, then the openings such as second are not to be initially opened) open some When session, then this can be gone through from the history message of the newest preset quantity of trend server acquisition request chat sessions The corresponding time interval of history message is write on the time shaft of the chat sessions, and trusted time section is obtained.
In another example it (may include currently producing that user's active request client carries out message with server for some session Raw message can also be history message) progress the verification of message consistency such as synchronize, successful message pair will be verified The time interval answered is write on the time shaft of the chat sessions, and trusted time section is obtained.
It, can be with if user wants to delete certain one or more history message in a preferred embodiment of the present application It selectes one or more history message and triggers the delete button generation deletion instruction of current chat session window, client After receiving deletion instruction, the history message that user indicates deletion is searched in message database, is deleted for history message addition Except mark, without directly deleting the history message from message database.The deletion mark indicate the history message by User deletes, and the history message for being added to deletion mark is hidden in the window of chat sessions.It in this way can be to avoid again From these history messages of service synchronization, also for the integrality for ensureing the time interval on time shaft
In practice, it can be increased " deleted " field of the history message to delete mark.If this field Value be 1 expression this history message deleted by user, default value be 0 expression the history message be not deleted, user The history message that deleted values are 0 is will only see, the history message user deleted will not see again.
It should be noted that in order to protect individual subscriber privacy, deletion mark can be synchronized in server so that should Deleting mark can be synchronized in any client.
Step 102, it determines that the message obtains and asks corresponding first time section;
In above-mentioned former, the time restriction condition that user specifies can be extracted and be determined as first time section.
In above-mentioned latter, the message request may include time qualifications, the time qualifications It may include a timestamp;Step 102 may include following sub-step:
Sub-step S11, determine user client locally preserve and time of origin it is predetermined before the timestamp Second history message of quantity;And
Sub-step S12 determines that the start and end time interval of the second history message of the predetermined quantity is first time section;
Wherein, the time of origin of first history message is before the timestamp.
It in the concrete realization, can be first from visitor when message of the user based on current presentation obtains formerly generation history message The history message for the predetermined quantity that the extraction of family end is locally stored.For example, the message of current sessions displaying sorts according to time of origin Shared A20-A1 totally 20 message, the wherein time of origin of A20 (such as 17 days 11 December in 2013:00:00) it is less than the generation of A1 (such as 17 days 11 December in 2013 time:10:00), and user can based on the message A20-A1 of current sessions, ask check A20 Message before.
Minimum time of origin in the message that timestamp in time qualifications can show for current sessions.For example, For above-mentioned message A20-A1, timestamp can be the time of origin of A20.
In above-mentioned latter, the message request may include time qualifications, the time qualifications It may include a timestamp;Step 102 may include following sub-step:
Sub-step S21, determine user client locally preserve and time of origin it is predetermined after the timestamp Second history message of quantity;And
Sub-step S22 determines that the start and end time interval of the second history message of the predetermined quantity is first time section;
Wherein, the time of origin of first history message is after the timestamp.
In the concrete realization, message of the user based on current presentation is obtained in rear generation history message, can be first from visitor The history message for the predetermined quantity that the extraction of family end is locally stored.For example, the message of current sessions displaying sorts according to time of origin Shared A20-A1 totally 20 message, the wherein time of origin of A20 (such as 17 days 11 December in 2013:00:00) it is less than the generation of A1 (such as 17 days 11 December in 2013 time:10:00), and user can based on the message A20-A1 of current sessions, ask check A1 Message later.
Timestamp in time qualifications can be maximum time of origin in the message that current sessions are shown.For example, For above-mentioned message A20-A1, timestamp can be the time of origin of A1.
Step 103, the corresponding one or more trusted times section of history message that client locally preserves is determined;
The information that client is recorded in specified position enquiring time shaft, to obtain trusted time section.
Step 104, judge whether the first time section falls into trusted time section;
When first time, section was Chong Die with trusted time section, first time section falls into trusted time section.When When one time interval falls into trusted time section, it may indicate that the first time section for falling into trusted time section is and server Carried out consistency desired result.
When first time, section was underlapped with trusted time section, first time section does not fall within trusted time section. When first time section does not fall within trusted time section, it may indicate that the first time section for not falling within trusted time section is Consistency desired result was not carried out with server.
In the concrete realization, the situation that the first time section does not fall within trusted time section may include:Described One time interval it is at least partly not Chong Die with the trusted time section.
In this case, first time segment part or all not Chong Die with trusted time section.
Step 105, it when the first time section does not fall within trusted time section, then initiates from described in server download The request of the first history message of user.
Server can extract the corresponding history message of the request according to the request, which is sent to client End.
In the concrete realization, at least partly not Chong Die with the trusted time section of the first time section can wrap Include following three kinds of situations:
In the first situation, first time section does not fall within trusted time section all, then in this case, it is possible to send out It rises from server and downloads at least part of first history message in first time section.
When history message quantity is greater than or equal to a preset amount threshold in the first time section of server storage When, it may be considered that the quantity of the history message occurred in first time section is larger, it, can be only to avoid waste Internet resources The first history message of returning part.
When history message quantity is less than a preset amount threshold in the first time section of server storage, then may be used To think the negligible amounts of the history message occurred in first time section, the first whole history messages can be returned.
In second case, the situation that the first time section does not fall within trusted time section may include:It is described The part at least partly Chong Die not with the trusted time section and the first time section in first time section with it is described Trusted time section is overlapped;
In this case, first time segment part is Chong Die with trusted time section, and part is not heavy with trusted time section It is folded.
Then step 105 may include following sub-step:
It is not Chong Die with the trusted time section in the first time section to download user from service by sub-step S31 At least partly history message occurred in partial section.
When the first time section history that partial section Chong Die with trusted time section does not occur of server storage disappears When ceasing quantity more than or equal to amount threshold, it may be considered that the quantity of the history message occurred in first time section is larger, It, can the first history message of returning part to avoid waste Internet resources.
In practical applications, when be directed to the not partial section Chong Die with trusted time section first that server side returns The quantity of history message is less than a certain preset quantity, then next not portion Chong Die with trusted time section can be asked to server The history message of by stages, and so on, until the quantity of history message reaches the preset quantity that can be shown or until institute There is the history message request of the partial section Chong Die with trusted time section to finish.
When the first time section history that partial section Chong Die with trusted time section does not occur of server storage disappears When ceasing quantity less than amount threshold, it may be considered that the quantity of the history message occurred in first time section is smaller, it can return Return the first whole history messages.
In the third situation, the situation that the first time section does not fall within trusted time section may include:It is described There are interval sections with the trusted time section in first time section.
In this case, there are interval sections for first time section and trusted time, that is, be spaced trusted time section when Between section.
Then step 105 may include following sub-step:
Sub-step S41 downloads at least partly history message that user occurs in the interval section from service.
It, then can be with when the history message quantity occurred in the interval section of server storage is greater than or equal to amount threshold Think that the quantity of the history message occurred in interval time section is larger, it, can returning part to avoid waste Internet resources First history message.
When the history message quantity occurred in the interval section of server storage is less than amount threshold, it may be considered that Every the negligible amounts of the history message occurred in time interval, the first whole history messages can be returned.
In the embodiment of the present application, client is each session creation time axis in the communication tool account logged in, On a timeline with trusted time section, mark carried out the corresponding time zone of the history message of consistency desired result with server Between, when history message is checked in user's request, determine first time section, then judging whether first time section falls into can Believe time interval, for not falling within the first time section in trusted time section, then initiates to disappear from the first history of server download The request of breath, for falling into the first time section in trusted time section, then the message that client of being subject to is locally stored, no longer It is downloaded from server, for identical history message, client only can once be downloaded from server, ensure history While message accuracy, reduces the number downloaded with server to the maximum extent, also reduce client to the maximum extent With the number of operations of server response, reduce the resource occupation of client and server, improves client and server Operational efficiency, and due to reducing download time to the maximum extent, correspondingly reduce the consumption of Internet resources to the maximum extent.
Furthermore for the message that the first time section for falling into trusted time section, then client of being subject to are locally stored, It is no longer downloaded from server, the effect speed of displaying history message can be greatly speeded up, while improving user experience.
With reference to Fig. 2, a kind of step flow chart of the loaming method embodiment 2 of network communication message of the application is shown, The embodiment of the present application may include steps of:
Step 201, it initiates message and obtains request;
Step 202, it determines that the message obtains and asks corresponding first time section;
Step 203, the corresponding one or more trusted times section of history message that client locally preserves is determined, In, each history message of the user in trusted time section has all been stored in client local;
Step 204, judge whether the first time section falls into trusted time section;
Step 205, it when the first time section does not fall within trusted time section, then initiates from described in server download The request of the first history message of user;
In a preferred embodiment of the present application, step 205 may include following sub-step:
Sub-step S51 judges whether to be stored with the first history message for meeting and imposing a condition;Wherein, the setting condition Including time qualifications, the time qualifications obtain request according to the message and determine;
In a kind of situation, time qualifications limit first time section;And first the time of origin of history message fall Enter first time section.
In another situation, time qualifications include a timestamp, and the time of origin of the first history message is in the time Before or after stamp.
Sub-step S52, if server storage has the first history for meeting and imposing a condition and be not stored in client local When message, then the satisfaction that the user is downloaded from server imposes a condition and is not stored at least partly the first of client local History message;
When the first history message for meeting setting condition and not being stored in client local of server storage is more than or waits When a preset amount threshold, it may be considered that the quantity of first history message is larger, to avoid waste Internet resources, It can the first history message of returning part.
When the satisfaction of server storage imposes a condition and is not stored in the first history message of client local less than one When preset amount threshold, it may be considered that the negligible amounts of first history message, can return to the first whole history and disappear Breath.
At least partly first history message is stored in client local by sub-step S53, and by described at least partly The corresponding time interval of first history message is incorporated to trusted time section;
At least partly first history message is that client carried out consistency desired result with server, can be by its time Time shaft is write in section, obtains trusted time section.
Sub-step S54 disappears if server is not stored with the first history message for meeting and imposing a condition according to Breath obtains request and locally obtains the one or more the second history messages from client, and the first time section is incorporated to credible Time interval.
In practical applications, the ten hundreds of message of numerous clients is faced, the message storage capacity of server can be limited System, therefore, server can only store the message of predetermined volumes, such as nearest 30 days history messages.
And the not all history message of client can all store, therefore the history that can meet the storage long period disappears Breath, the time can be longer than the time of the history message of server storage.
At this point, server can not be stored with the first history message for meeting and imposing a condition.Then client can be according to disappearing Breath obtains request and locally obtains the one or more the second history messages from client, and the time of origin of second history message can be with Time qualifications limit first time section within, alternatively, can the timestamp for including in time qualifications it It is preceding or later.
Step 206, first history message is stored in client local;
Client the first history message for a certain chat sessions synchronous from server may be stored in client It holds in local message database, before or after the first history message is stored in message database, client can be right First history message carries out duplicate removal processing.
In another preferred embodiment of the present application, step 206 may include following sub-step:
Sub-step S61 carries out duplicate removal processing to first history message;
The first history message after duplicate removal processing is stored in the message database of client local by sub-step S62.
In the present embodiment, duplicate removal processing can be first carried out, then stores the history message after duplicate removal processing again.Client In the buffer by the storage of the first history message, first history message is taken out from caching every time, is looked into message database Look for the history of (every history message all carries unique message identifier) identical as the message identifier of the first history message Message illustrates that the first history message that this takes out from caching is the history message repeated, then abandons this if searching successfully First history message;Otherwise, this is stored in from the first history message taken out in caching in message database.
Wherein, message identifier can be the unique mark of the message of chat sessions, can be the generation according to the message The random value for one group of 64 bit that time generates according to preset algorithm, such as 4827948882813720239.
In a preferred embodiment of the present application, step 206 may include following sub-step:
First history message is stored in the message database of the client local by sub-step S71;
Sub-step S72 carries out duplicate removal processing to the first history message being stored in the message database of client local.
In the present embodiment, first the first history message can be stored in message database, then utilizes message data The characteristic in library carries out duplicate removal processing, the history message that removal is locally repeated with client.
It is the action that duplicate removal is completed using the characteristic of database in database rank duplicate removal.It is specifically as follows, client First history message is stored in message database by end, judges whether that two message identifiers are identical in message database History message, if so, the first history message for being stored in after deleting.
When carrying out history message duplicate removal, client can preferentially be disappeared using the history stored in local message database Breath can be to disappear if the history message downloaded to from service side is repeated with the history message stored in message database Subject to the history message stored in breath database, the history message downloaded from server side is abandoned.
In addition, it is necessary to which explanation, is checked, the history stored in the message database of client disappears in order to facilitate user Breath can carry out sequence from big to small according to the time of origin of every history message, and the history message generated recently is deposited In front, the history message earlier generated is stored in below for storage.
By above two method, when downloading history message from server every time to local message database, all can Duplicate removal processing is carried out to history message, it is unique for ensure that the history message stored in message database all, saves database Memory space, the convenient management to the history message in message database improves and reads history message in message database Efficiency.Certainly, the mode of above-mentioned history message duplicate removal is only the example of the application, and those skilled in the art can also use Other means achieve the purpose that message duplicate removal, and the embodiment of the present application is to this without limiting.
Step 207, the corresponding time interval of the first history message is incorporated to trusted time section.
The corresponding time interval of first history message and for time of origin minimum in history message and maximum generation when Between before period.For example, the first history message is ordered as B20-B1 totally 20 message according to time of origin, wherein B20's Time of origin is 18 days 10 December in 2013:00:00, B1 time of origin is 18 days 11 December in 2013:00:00, then first The corresponding time interval of history message is [18 days 10 December in 2013:00:00,2013 on December 18,11:00:00].
In practice, if on time shaft front and back write-in time interval may with former trusted time section there are Chong Die, It can be so merged into a time interval, for example, time interval A is [11 days 10 October in 2013:00:00,2013 year On October 11 11:00:00], trusted time interval B is [11 days 10 October in 2013:30:00,2013 on October 11,11:30: 00], then its credibility interval merged is [11 days 10 October in 2013:00:00,2013 on October 11,11:30:00].
Step 208, when the first time section falls into trusted time section, then described the is locally obtained from client The second history message in one time interval;
In the concrete realization, the situation that first time section falls into trusted time section may include:First time section It is at least partly Chong Die with trusted time section.
In this case, first time segment part or all Chong Die with trusted time section.
It, can be to be locally stored in order to reduce network resource consumption when first time section falls into trusted time section History message subject to, no longer ask identical history message to server, but can be in extraction first time section It is shown after second history message.
With reference to Fig. 3, a kind of step flow chart of the loaming method embodiment 3 of network communication message of the application is shown, The embodiment of the present application may include steps of:
Step 301, when logining in the duration of client the chat window opened for the first time with communication object in user account When mouth, message initialization request is initiated, the first message record of the first preset quantity of active user's account is downloaded from server, Information of the first message record with first time section of first preset quantity;
Applied to the embodiment of the present application, user logs in the account of a certain communication tool in client every time, and in the survival phase Between when detecting the window of a certain chat sessions that user is initially opened in the account, client can be synchronized from server The first message of preset quantity records, wherein what the first message of the preset quantity was recorded as storing in server is directed to this The newest history message of chat sessions.Disappear it should be noted that the preset quantity is one page history that can be shown in window The quantity of breath, can be different according to the difference of chat window size, and can be by user or those skilled in the art voluntarily Setting sets preset quantity if best suiting the reading experience of user when for example, the quantity of one page history message being 20 in window 20 are set to, certainly, the setting method of above-mentioned preset quantity is only a kind of example of the embodiment of the present application, the embodiment of the present application pair The particular number and setting method of the preset quantity are without limiting.
In the concrete realization, user judges the chat of some session after the account that client logs in a certain communication tool Whether window is initially opened, and following method may be used:It is opened in a certain account to preserve that one data capsule is set The ID of the association user account of window empties the data capsule after client successfully logs in a certain account, open every time After the window of chat sessions, the ID of the corresponding association user account of the window is obtained, and matching should in the data capsule The ID of association user account illustrates that the window is not initially opened if successful match;Otherwise, then illustrate that the window is first It opens, and in the corresponding association user account deposit data capsule.
It is each due to each time after same client logs in same account since data capsule can all be emptied All meeting, can be from clothes when certain window is initially opened there are one the chance being initially opened after each account logs in again for chat window The newest history message of corresponding chat sessions is obtained in business device.For example, at 10 points in user's morning some day steps in client-side A certain account has been recorded, the window of the chat sessions of good friend A is opened, client in server from synchronizing in the chat sessions at this time Newest 20 history messages, subsequent user close the window of the chat sessions of good friend A and exit account;At noon 12 when, User has logged in same account in same client again, opens the window of the chat sessions of good friend A, at this time instant messaging client End judge that the window is initially opened, then again from server synchronized buddies A newest 20 history messages;User closes The window of the chat sessions of good friend A but do not exit account, at noon 1 when, user is again turned on the window of the chat sessions of good friend A Mouthful, instant communication client judges that the window of the chat sessions is not initially opened at this time, therefore will not be from server sync Newest history message.
After the first message record for downloading preset quantity from server side, the first message of the preset quantity can be obtained The information in the first time section of record.Specifically, every first history message all has time of origin, client is from service After getting the first message record record of preset quantity in device, carried out according to the time of origin of every first message record record Sequence remembers sequence in the time of origin of primary first message record record and sequence in last first message The time of origin of record is organized into first time section.
If returning to 0 or 1 first message record in server, illustrate to service side (such as 30 in message retention cycle It) is without more history messages, then the computational methods in first time section are [current time -30 days, current time].
Step 302, it is the corresponding trusted time section of the chat sessions by the first time interval mark;
After client is that server carries out message consistency desired result, the first time section after can verifying successfully is write Upper time shaft obtains trusted time section.
Step 303, within the duration, user initiates history message and obtains request;
Step 304, request is obtained according to the history message and determines one second time interval;
In a kind of preferred implementation of the application, it may include time qualifications, institute that the history message, which obtains request, Second time interval can be limited by stating time qualifications;And the time of origin of second message record falls into described the Two time intervals.
In a kind of preferred implementation of the application, it may include time qualifications, institute that the history message, which obtains request, It may include a timestamp to state time qualifications;Step 304 may include following sub-step:
Sub-step S81, determine user client locally preserve and time of origin in the timestamp before or after The second preset quantity second message record;
Sub-step S82, according to the start and end time interval of the second message of second preset quantity record and the time Stamp limits second time interval.
Step 305, judge whether second time interval falls into trusted time section;
Step 306, when second time interval does not fall within trusted time section, second message note is downloaded from server Record;
In a kind of preferred implementation of the application, the situation that second time interval does not fall within trusted time section can be with Including:The portion at least partly Chong Die not with the trusted time section and second time interval of second time interval Divide Chong Die with the trusted time section;Step 306 may include following sub-step:
Sub-step S91 downloads user in the not Chong Die with the trusted time section of second time interval from service Partial section in occur at least partly Message Record.
Step 307, the second message record is shown.
, can be in specified position, such as the window of current chat session after obtaining second message record, or working as The side of the window of preceding chat sessions generates one dedicated for showing the window of history message, carries out the exhibition of second message record Show.
It should be noted that in the embodiment of the present application, due to step in step 303- steps 306 and embodiment of the method 1 The application of 101- steps 105 is substantially similar, so description is fairly simple, referring to the portion of embodiment of the method 1 in place of correlation It defends oneself bright, the embodiment of the present application is not described in detail herein.
With reference to Fig. 4, a kind of step flow chart of the loaming method embodiment 4 of network communication message of the application is shown, The embodiment of the present application may include steps of:
Step 401, when logining in the duration of client the chat window opened for the first time with communication object in user account When mouth, message initialization request is initiated, the first message record of the first preset quantity of active user's account is downloaded from server, Information of the first message record with first time section of first preset quantity;
Step 402, the first message record is shown;
In the embodiment of the present application, after getting first message record, can directly it be shown, for the chat sessions Build the coherent chat environment of a context.
Step 403, it is the corresponding trusted time section of the chat sessions by the first time interval mark;
Step 404, within the duration, user initiates history message and obtains request;
Step 405, request is obtained according to the history message and determines one second time interval;
Step 406, judge whether second time interval falls into trusted time section;
Step 407, when second time interval does not fall within trusted time section, second message note is downloaded from server Record;
Step 408, when second time interval falls into trusted time section, the second message record is shown;
In the embodiment of the present application, the second time interval can partly fall into trusted time section, and can partly not fall within can Believe time interval.
It, then can be with this to reduce network resource consumption for falling into the part of the second time interval of trusted time section Subject to second history message of ground client storage, it is shown after the second history message of extraction local client storage.
Step 409, displaying second message record.
Step 410, by the second message record storage in client local;
Step 411, the second message is recorded into corresponding time interval and is incorporated to the trusted time section;
Step 412, the message that user occurs within the duration is stored in client local, and by the survival Period is incorporated to the trusted time section.
In the embodiment of the present application, user is chatted based on current chat sessions, be equivalent to client and server into It has gone the consistency desired result of message, can will write time shaft the duration, and obtain trusted time section.
It should be noted that since the network information number is unstable, when especially client is located at mobile device, it is easy to go out Existing message is sent or the situation of reception failure.Therefore, for the situation that the duration is incorporated to trusted time section, Ke Yi When meeting preset condition, such as client is without other tasks, when network speed reaches some network speed threshold value, client and server The message of gaps and omissions can be downloaded, or to credible when verifying out the message of gaps and omissions by carrying out completeness check with regard to the duration Time interval is split, and the time point of the message of gaps and omissions is marked off to come from trusted time section.
It should be noted that for embodiment of the method, for simple description, therefore it is all expressed as a series of action group It closes, but those skilled in the art should understand that, the application is not limited by the described action sequence, because according to this Shen Please, certain steps can call other sequences or be carried out at the same time.Next, those skilled in the art should also know that, specification Described in embodiment belong to preferred embodiment, necessary to involved action not necessarily the application.
With reference to Fig. 5, a kind of structure diagram of the roaming device embodiment 1 of network communication message of application, this Shen are shown Please embodiment may include with lower module:
Message obtains request initiation module 501, and request is obtained for initiating message;
First time interval determination module 502 asks corresponding first time section for determining that the message obtains;
Trusted time interval determination module 503, for determine history message that client locally preserves it is corresponding one or Multiple trusted time sections, wherein each history message of the user in trusted time section has all been stored in client local;
First falls into judgment module 504, for judging whether the first time section falls into trusted time section;
First history message request module 505, for when the first time section does not fall within trusted time section, then The request of the first history message of the user is downloaded in initiation from server.
In a preferred embodiment of the present application, the history message can be with client unlatching and another client The session of end communication is associated, and the session can have corresponding time shaft, may include one on the time shaft Or multiple trusted time sections.
In a preferred embodiment of the present application, the embodiment of the present application can also include following module:
First history message memory module, for first history message to be stored in client local;
First history message is incorporated to module, for the corresponding time interval of the first history message to be incorporated to trusted time area Between.
In a preferred embodiment of the present application, the message request may include time qualifications, the time Qualifications can limit the first time section;And the time of origin of first history message can fall into described first Time interval.
In a preferred embodiment of the present application, the message request may include time qualifications, the time Qualifications may include a timestamp;
The first time interval determination module 505 may include following submodule:
First determination sub-module, for determine user client locally preserve and time of origin the timestamp it Second history message of preceding predetermined quantity;And
Second determination sub-module, for determining that the start and end time interval of the second history message of the predetermined quantity is first Time interval;
Wherein, the time of origin of first history message is before the timestamp.
In a preferred embodiment of the present application, the message request may include time qualifications, the time Qualifications may include a timestamp;
The first time interval determination module 505 may include following submodule:
Third determination sub-module, for determine user client locally preserve and time of origin the timestamp it Second history message of predetermined quantity afterwards;And
4th determination sub-module, for determining that the start and end time interval of the second history message of the predetermined quantity is first Time interval;
Wherein, the time of origin of first history message is after the timestamp.
In a preferred embodiment of the present application, the embodiment of the present application can also include following module:
Second history message acquisition module, for when the first time section falls into trusted time section, then from visitor Family end obtains the second history message in the first time section.
In a preferred embodiment of the present application, the first history message request module 506 may include following son Module:
Setting condition judging submodule is stored with the first history message for meeting and imposing a condition for judging whether;
First part downloads submodule, if having satisfaction to impose a condition for server storage and not being stored in client sheet When first history message on ground, then the satisfaction that the user is downloaded from server imposes a condition and is not stored in client local At least partly the first history message;
Part sub-module stored, at least partly first history message to be stored in client local;
First part is incorporated to submodule, can for the corresponding time interval of at least partly first history message to be incorporated to Believe time interval;
Wherein, described impose a condition may include time qualifications, and the time qualifications can disappear according to described Breath obtains request and determines.
In a preferred embodiment of the present application, the embodiment of the present application can also include following module:
Second part acquisition submodule, if not being stored with the first history message for meeting and imposing a condition for server When, then request is obtained according to the message and locally obtains the one or more the second history messages from client;
Second part is incorporated to submodule, for the first time section to be incorporated to trusted time section.
In a preferred embodiment of the present application, the situation that the first time section does not fall within trusted time section can To include:The first time section it is at least partly not Chong Die with the trusted time section.
In a preferred embodiment of the present application, the situation that the first time section does not fall within trusted time section can To include:The first time section it is at least partly Chong Die not with the trusted time section and the first time section Part is Chong Die with the trusted time section;
The first history message request module 506 may include following submodule:
Part III download submodule, for from service download user the first time section not with it is described credible when Between section be overlapped partial section in occur at least partly history message.
In a preferred embodiment of the present application, the situation that the first time section does not fall within trusted time section can To include:There are interval sections with the trusted time section in the first time section;
The first history message request module 506 may include following submodule:
Part IV downloads submodule, is at least partly gone through for what is occurred in the interval section from service download user History message.
In a preferred embodiment of the present application, the first history message memory module may include following submodule Block:
Message database sub-module stored, the message for first history message to be stored in the client local In database;
Duplicate removal submodule, for carrying out duplicate removal to the first history message being stored in the message database of client local Processing.
With reference to Fig. 6, a kind of structure diagram of the roaming device embodiment 2 of network communication message of application, this Shen are shown Please embodiment may include with lower module:
First message records download module 601, is opened for the first time for working as to login in the duration of client in user account When opening the chat window with communication object, message initialization request is initiated, first from server download active user's account is pre- If the first message of quantity records, information of the first message record with first time section of first preset quantity;
Mark module 602, for being the corresponding trusted time section of the chat sessions by the first time interval mark;
History message obtains request module 603, within the duration, user to initiate history message and obtains request;
Second time interval determining module 604 determines one second time zone for obtaining request according to the history message Between;
Second falls into judgment module 605, for judging whether second time interval falls into trusted time section;
Second message records download module 606, for not falling within trusted time section in second time interval, from clothes Device download second message of being engaged in records;
Second message record display module 607, for showing the second message record.
In a preferred embodiment of the present application, the embodiment of the present application can also include following module:
Duration memory module, for the message that user occurs within the duration to be stored in client sheet Ground;
Duration is incorporated to module, for the duration to be incorporated to the trusted time section.
In a preferred embodiment of the present application, the embodiment of the present application can also include following module:
Second message record storage module, for the second message record storage is local in client;
Second message record be incorporated to module, for by the second message record corresponding time interval be incorporated to it is described credible Time interval.
In a preferred embodiment of the present application, the embodiment of the present application can also include following module:
First message record display module, for showing that first message records.
In a preferred embodiment of the present application, it may include time qualifications that the history message, which obtains request, The time qualifications can limit second time interval;And the time of origin of the second message record can be fallen into Second time interval.
In a preferred embodiment of the present application, it may include time qualifications that the history message, which obtains request, The time qualifications may include a timestamp;
The second time interval determining module 604 may include following submodule:
5th determination sub-module, for determine user client locally preserve and time of origin the timestamp it Preceding or the second preset quantity later second message record;
6th determination sub-module, start and end time interval for being recorded according to the second message of second preset quantity and The timestamp limits second time interval.
In a preferred embodiment of the present application, the embodiment of the present application can also include following module:
Second message record display module, for when second time interval falls into trusted time section, showing institute State second message record.
In a preferred embodiment of the present application, the situation that second time interval does not fall within trusted time section can To include:Second time interval it is at least partly Chong Die not with the trusted time section and second time interval Part is Chong Die with the trusted time section;
The second message record download module 607 may include following submodule:
Lap download submodule, for from service download user second time interval not with it is described credible At least partly history message occurred in the partial section of time interval overlapping.
Since above-mentioned apparatus embodiment essentially corresponds to preceding method embodiment, thus in the description of the present embodiment it is not detailed it Place, may refer to the related description in preceding method embodiment, does not just repeat herein.
Each embodiment in this specification calls progressive mode to describe, the highlights of each of the examples are with The difference of other embodiment, the same or similar parts between the embodiments can be referred to each other.For device embodiment For, since it is basically similar to the method embodiment, so description is fairly simple, referring to the portion of embodiment of the method in place of correlation It defends oneself bright.
It should be understood by those skilled in the art that, embodiments herein can be provided as method, system or computer program Product.Therefore, the application can call complete hardware embodiment, complete software embodiment or reality combining software and hardware aspects Apply the form of example.Moreover, the application can be invoked at the computer that one or more wherein includes computer usable program code The computer program production implemented in usable storage medium (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.) The form of product.
In a typical configuration, the computer equipment includes one or more processors (CPU), input/output Interface, network interface and memory.Memory may include the volatile memory in computer-readable medium, random access memory The forms such as device (RAM) and/or Nonvolatile memory, such as read-only memory (ROM) or flash memory (flash RAM).Memory is to calculate The example of machine readable medium.Computer-readable medium includes that permanent and non-permanent, removable and non-removable media can be with Information storage is realized by any method or technique.Information can be computer-readable instruction, data structure, the module of program or Other data.The example of the storage medium of computer includes, but are not limited to phase transition internal memory (PRAM), static RAM (SRAM), dynamic random access memory (DRAM), other kinds of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), fast flash memory bank or other memory techniques, CD-ROM are read-only Memory (CD-ROM), digital versatile disc (DVD) or other optical storages, magnetic tape cassette, tape magnetic disk storage or Other magnetic storage apparatus or any other non-transmission medium can be used for storage and can be accessed by a computing device information.According to Herein defines, and computer-readable medium does not include non-persistent computer readable media (transitory media), such as The data-signal and carrier wave of modulation.
The application is with reference to method, the flow of equipment (system) and computer program product according to the embodiment of the present application Figure and/or block diagram describe.It should be understood that can be realized by computer program instructions every first-class in flowchart and/or the block diagram The combination of flow and/or box in journey and/or box and flowchart and/or the block diagram.These computer programs can be provided Instruct the processor of all-purpose computer, special purpose computer, Embedded Processor or other programmable data processing devices to produce A raw machine so that the instruction executed by computer or the processor of other programmable data processing devices is generated for real The device for the function of being specified in present one flow of flow chart or one box of multiple flows and/or block diagram or multiple boxes.
These computer program instructions, which may also be stored in, can guide computer or other programmable data processing devices with spy Determine in the computer-readable memory that mode works so that instruction generation stored in the computer readable memory includes referring to Enable the manufacture of device, the command device realize in one flow of flow chart or multiple flows and/or one box of 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 count Series of operation steps are executed on calculation machine or other programmable devices to generate computer implemented processing, in computer or The instruction executed on other programmable devices is provided for realizing in one flow of flow chart or multiple flows and/or block diagram one The step of function of being specified in a box or multiple boxes.
Although the preferred embodiment of the application has been described, created once a person skilled in the art knows basic Property concept, then additional changes and modifications can be made to these embodiments.So it includes excellent that the following claims are intended to be interpreted as It selects embodiment and falls into all change and modification of the application range.
Finally, it is to be noted that, herein, the terms "include", "comprise" or its any other variant are intended to Cover non-exclusive inclusion, so that the process, method, article or equipment including a series of elements includes not only those Element, but also include other elements that are not explicitly listed, or further include for this process, method, article or setting Standby intrinsic element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that There is also other identical elements in the process, method, article or apparatus that includes the element.
The loaming method to a kind of network communication message provided herein and a kind of network communication message is unrestrained above Trip device is described in detail, and specific examples are used herein to illustrate the principle and implementation manner of the present application, The description of the example is only used to help understand the method for the present application and its core ideas;Meanwhile for the one of this field As technical staff, according to the thought of the application, there will be changes in the specific implementation manner and application range, to sum up institute It states, the contents of this specification should not be construed as limiting the present application.

Claims (38)

1. a kind of loaming method of network communication message, which is characterized in that including:
It initiates message and obtains request;
It determines that the message obtains and asks corresponding first time section;
Determine the corresponding one or more trusted times section of history message that client locally preserves, wherein user is credible Each history message in time interval has all been stored in client local;
Judge whether the first time section falls into trusted time section;
When the first time section does not fall within trusted time section, then initiation is downloaded the first of the user from server and is gone through The request of history message;
First history message is stored in client local, and the corresponding time interval of the first history message is incorporated to credible Time interval.
2. according to the method described in claim 1, it is characterized in that, the history message and client unlatching and another visitor The session of family end communication is associated, and the session has corresponding time shaft, includes one or more of on the time shaft Trusted time section.
3. according to the method described in claim 1, it is characterized in that, the message request includes time qualifications, when described Between qualifications limit the first time section;And the time of origin of first history message falls into the first time area Between.
4. according to the method described in claim 1, it is characterized in that, the message request includes time qualifications, when described Between qualifications include a timestamp;
The determination message obtains the step of asking corresponding first time section and includes:
Determine user the predetermined quantity that client locally preserves and time of origin is before the timestamp the second history Message;And
Determine that the start and end time interval of the second history message of the predetermined quantity is first time section;
Wherein, the time of origin of first history message is before the timestamp.
5. according to the method described in claim 1, it is characterized in that, the message request includes time qualifications, when described Between qualifications include a timestamp;
The determination message obtains the step of asking corresponding first time section and includes:
Determine user the predetermined quantity that client locally preserves and time of origin is after the timestamp the second history Message;And
Determine that the start and end time interval of the second history message of the predetermined quantity is first time section;
Wherein, the time of origin of first history message is after the timestamp.
6. according to the method described in claim 1, it is characterized in that, further including:
When the first time section falls into trusted time section, then locally obtained in the first time section from client The second history message.
7. according to the method described in claim 1, it is characterized in that, when the first time section does not fall within trusted time section When, then the request that the second history message of the user is downloaded from server is initiated, including:
Judge whether to be stored with the first history message for meeting and imposing a condition;
If server storage has satisfaction to impose a condition and is not stored in the first history message of client local, from service The satisfaction that device downloads the user imposes a condition and is not stored at least partly the first history message of client local;
At least partly first history message is stored in client local, and at least partly the first history message pair by described in The time interval answered is incorporated to trusted time section;
Wherein, described impose a condition includes time qualifications, and the time qualifications obtain request really according to the message It is fixed.
8. the method according to the description of claim 7 is characterized in that further including:
If server is not stored with the first history message for meeting and imposing a condition, request is obtained from visitor according to the message Family end obtains the one or more the second history messages, and the first time section is incorporated to trusted time section.
9. according to the method described in claim 1, it is characterized in that, the first time section does not fall within trusted time section Situation includes:The first time section it is at least partly not Chong Die with the trusted time section.
10. according to the method described in claim 9, it is characterized in that, the first time section does not fall within trusted time section Situation include:At least partly Chong Die not with the trusted time section and first time area in the first time section Between part it is Chong Die with the trusted time section;
The request of first history message for initiating to download the user from server, including:
User is downloaded from service in the first time the section not partial section Chong Die with the trusted time section to occur At least partly history message.
11. according to the method described in claim 9, it is characterized in that, the first time section does not fall within trusted time section Situation include:There are interval sections with the trusted time section in the first time section;
The request of first history message for initiating to download the user from server, including:
At least partly history message that user occurs in the interval section is downloaded from service.
12. according to the method described in claim 1, it is characterized in that, described be stored in client by first history message Local step includes:
First history message is stored in the message database of the client local;
Duplicate removal processing is carried out to the first history message being stored in the message database of client local.
13. a kind of loaming method of network communication message, which is characterized in that including:
When user account logins in the duration of client the chat window opened for the first time with communication object, message is initiated Initialization requests download the first message record of the first preset quantity of active user's account from server, and described first is default Information of the first message record with first time section of quantity;
It is the corresponding trusted time section of the chat sessions by the first time interval mark;
Within the duration, user initiates history message and obtains request;
Request, which is obtained, according to the history message determines one second time interval;
Judge whether second time interval falls into trusted time section;
When second time interval does not fall within trusted time section, downloading second message from server records;
Show the second message record;
By the second message record storage in client local, and the second message is recorded into corresponding time interval and is incorporated to The trusted time section.
14. according to the method for claim 13, which is characterized in that further include:User it will occur within the duration Message be stored in client local, and the duration is incorporated to the trusted time section.
15. according to the method for claim 13, which is characterized in that further include:Show the first message record.
16. according to the method for claim 13, which is characterized in that it includes the time limiting item that the history message, which obtains request, Part, the time qualifications limit second time interval;And the time of origin of second message record fall into it is described Second time interval.
17. according to the method for claim 13, which is characterized in that it includes the time limiting item that the history message, which obtains request, Part, the time qualifications include a timestamp;
It is described that determining one second time interval of request is obtained according to the history message, including:
Determine user client locally preserve and time of origin in the timestamp before or after the second preset quantity Second message record;
Described second is limited according to the start and end time interval of the second message of second preset quantity record and the timestamp Time interval.
18. according to the method for claim 13, which is characterized in that further include:
When second time interval falls into trusted time section, the second message record is shown.
19. according to the method for claim 13, which is characterized in that second time interval does not fall within trusted time section Situation include:At least partly Chong Die not with the trusted time section and second time zone of second time interval Between part it is Chong Die with the trusted time section;
It is described to download second message record from server, including:
User is downloaded from service to send out in the not partial section Chong Die with the trusted time section of second time interval Raw at least partly Message Record.
20. a kind of roaming device of network communication message, which is characterized in that including:
Message obtains request initiation module, and request is obtained for initiating message;
First time interval determination module asks corresponding first time section for determining that the message obtains;
Trusted time interval determination module, for determining that the corresponding one or more of history message that client locally preserves is credible Time interval, wherein each history message of the user in trusted time section has all been stored in client local;
First falls into judgment module, for judging whether the first time section falls into trusted time section;
First history message request module, for when the first time section does not fall within trusted time section, then initiate from Server downloads the request of the first history message of the user;
First history message memory module, for first history message to be stored in client local;
First history message is incorporated to module, for the corresponding time interval of the first history message to be incorporated to trusted time section.
21. device according to claim 20, which is characterized in that the history message opened with client with it is another The session of user client communication is associated, and the session has corresponding time shaft, includes one or more on the time shaft A trusted time section.
22. device according to claim 20, which is characterized in that the message request includes time qualifications, described Time qualifications limit the first time section;And the time of origin of first history message falls into the first time Section.
23. device according to claim 20, which is characterized in that the message request includes time qualifications, described Time qualifications include a timestamp;
The first time interval determination module includes:
First determination sub-module, for determine user client locally preserve and time of origin before the timestamp Second history message of predetermined quantity;And
Second determination sub-module, for determining that the start and end time interval of the second history message of the predetermined quantity is at the first time Section;
Wherein, the time of origin of first history message is before the timestamp.
24. device according to claim 20, which is characterized in that the message request includes time qualifications, described Time qualifications include a timestamp;
The first time interval determination module includes:
Third determination sub-module, for determine user client locally preserve and time of origin after the timestamp Second history message of predetermined quantity;And
4th determination sub-module, for determining that the start and end time interval of the second history message of the predetermined quantity is at the first time Section;
Wherein, the time of origin of first history message is after the timestamp.
25. device according to claim 20, which is characterized in that further include:
Second history message acquisition module, for when the first time section falls into trusted time section, then from client Local the second history message obtained in the first time section.
26. device according to claim 20, which is characterized in that the first history message request module includes:
Setting condition judging submodule is stored with the first history message for meeting and imposing a condition for judging whether;
First part downloads submodule, and client local is imposed a condition and be not stored in if having for server storage and meeting When the first history message, then the satisfaction that the user is downloaded from server imposes a condition and is not stored in client local at least The first history message of part;
Part sub-module stored, at least partly first history message to be stored in client local;
First part is incorporated to submodule, when for the corresponding time interval of at least partly first history message to be incorporated to credible Between section;
Wherein, described impose a condition includes time qualifications, and the time qualifications obtain request really according to the message It is fixed.
27. device according to claim 26, which is characterized in that further include:
Second part acquisition submodule, if be not stored with the first history message for meeting and imposing a condition for server, Request, which is obtained, according to the message locally obtains the one or more the second history messages from client;
Second part is incorporated to submodule, for the first time section to be incorporated to trusted time section.
28. device according to claim 20, which is characterized in that the first time section does not fall within trusted time section Situation include:The first time section it is at least partly not Chong Die with the trusted time section.
29. device according to claim 28, which is characterized in that the first time section does not fall within trusted time section Situation include:At least partly Chong Die not with the trusted time section and first time area in the first time section Between part it is Chong Die with the trusted time section;
The first history message request module includes:
Part III download submodule, for from service download user the first time section not with the trusted time area Between at least partly history message that occurs in the partial section that is overlapped.
30. device according to claim 28, which is characterized in that the first time section does not fall within trusted time section Situation include:There are interval sections with the trusted time section in the first time section;
The first history message request module includes:
Part IV downloads submodule, disappears for downloading at least partly history that user occurs in the interval section from service Breath.
31. device according to claim 20, which is characterized in that the first history message memory module includes:
Message database sub-module stored, the message data for first history message to be stored in the client local In library;
Duplicate removal submodule, for being carried out at duplicate removal to the first history message being stored in the message database of client local Reason.
32. a kind of roaming device of network communication message, which is characterized in that including:
First message records download module, opens and communicates for the first time for working as to login in the duration of client in user account When the chat window of object, message initialization request is initiated, the first preset quantity of active user's account is downloaded from server First message records, information of the first message record with first time section of first preset quantity;
Mark module, for being the corresponding trusted time section of the chat sessions by the first time interval mark;
History message obtains request module, within the duration, user to initiate history message and obtains request;
Second time interval determining module determines one second time interval for obtaining request according to the history message;
Second falls into judgment module, for judging whether second time interval falls into trusted time section;
Second message records download module, for not falling within trusted time section in second time interval, under server Carry second message record;
Second message record display module, for showing the second message record;
Second message record storage module, for the second message record storage is local in client;
Second message record is incorporated to module, and the trusted time is incorporated to for the second message to be recorded corresponding time interval Section.
33. device according to claim 32, which is characterized in that further include:
Duration memory module, for the message that user occurs within the duration to be stored in client local;
Duration is incorporated to module, for the duration to be incorporated to the trusted time section.
34. device according to claim 32, which is characterized in that further include:
First message record display module, for showing that first message records.
35. device according to claim 32, which is characterized in that it includes the time limiting item that the history message, which obtains request, Part, the time qualifications limit second time interval;And the time of origin of second message record fall into it is described Second time interval.
36. device according to claim 32, which is characterized in that it includes the time limiting item that the history message, which obtains request, Part, the time qualifications include a timestamp;
The second time interval determining module includes:
5th determination sub-module, for determine user client locally preserve and time of origin before the timestamp or The second message of the second preset quantity later records;
6th determination sub-module, start and end time interval for being recorded according to the second message of second preset quantity and described Timestamp limits second time interval.
37. device according to claim 32, which is characterized in that further include:
Second message record display module, for when second time interval falls into trusted time section, displaying described the Two Message Records.
38. device according to claim 32, which is characterized in that second time interval does not fall within trusted time section Situation include:At least partly Chong Die not with the trusted time section and second time zone of second time interval Between part it is Chong Die with the trusted time section;
The second message records download module:
Lap download submodule, for from service download user second time interval not with the trusted time At least partly history message occurred in the partial section of section overlapping.
CN201410038754.6A 2014-01-26 2014-01-26 A kind of loaming method and device of network communication message Active CN104811366B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201410038754.6A CN104811366B (en) 2014-01-26 2014-01-26 A kind of loaming method and device of network communication message
HK15109535.6A HK1208968A1 (en) 2014-01-26 2015-09-29 Method and apparatus for network communication message roaming

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410038754.6A CN104811366B (en) 2014-01-26 2014-01-26 A kind of loaming method and device of network communication message

Publications (2)

Publication Number Publication Date
CN104811366A CN104811366A (en) 2015-07-29
CN104811366B true CN104811366B (en) 2018-11-02

Family

ID=53695875

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410038754.6A Active CN104811366B (en) 2014-01-26 2014-01-26 A kind of loaming method and device of network communication message

Country Status (2)

Country Link
CN (1) CN104811366B (en)
HK (1) HK1208968A1 (en)

Families Citing this family (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106921554B (en) * 2015-12-24 2020-09-29 北京新媒传信科技有限公司 Message transmission method and device
CN106130883B (en) * 2016-07-14 2019-10-01 北京元心科技有限公司 Instant messaging message pushing method and pushing device
CN106470138A (en) * 2016-08-30 2017-03-01 成都科来软件有限公司 A kind of method that corresponding time interval data is screened according to user's request
CN106603386A (en) * 2016-12-16 2017-04-26 济南浪潮高新科技投资发展有限公司 Method for managing instant messaging application chat records
CN108632130B (en) * 2017-03-16 2021-04-30 北京京东尚科信息技术有限公司 Method and device for multi-terminal chat input transfer, electronic equipment and storage medium
CN107733785A (en) * 2017-10-18 2018-02-23 苏州亿科赛卓电子科技有限公司 A kind of multiple terminals chat message synchronization removal method and device
CN109885604A (en) * 2019-01-22 2019-06-14 平安科技(深圳)有限公司 Chat messages methods of exhibiting, electronic device and computer readable storage medium
CN110365739A (en) * 2019-06-05 2019-10-22 平安科技(深圳)有限公司 Message synchronization method, apparatus, computer installation and computer readable storage medium
CN110932966A (en) * 2019-12-09 2020-03-27 网易(杭州)网络有限公司 Message processing method and device, computer storage medium and electronic equipment
CN112737921B (en) * 2020-12-23 2022-07-29 北京百分点科技集团股份有限公司 Message interaction method, client and communication system
CN112787910A (en) * 2021-01-29 2021-05-11 联仁健康医疗大数据科技股份有限公司 Message processing method and device, electronic equipment and storage medium

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030043186A1 (en) * 2001-08-30 2003-03-06 Marina Libman Method and apparatus for storing real-time text messages
CN100473012C (en) * 2006-03-28 2009-03-25 腾讯科技(深圳)有限公司 Message recording merging method and user terminal
CN101227425B (en) * 2007-12-25 2010-11-10 腾讯科技(深圳)有限公司 System, client end and method for obtaining history message and feeding back history message
CN103139259A (en) * 2011-11-30 2013-06-05 百度在线网络技术(北京)有限公司 Method and server of achieving low-flux synchronous message logging
CN103051520B (en) * 2013-01-05 2015-11-25 小米科技有限责任公司 The method of synchronous offline session message and device in JICQ

Also Published As

Publication number Publication date
HK1208968A1 (en) 2016-03-18
CN104811366A (en) 2015-07-29

Similar Documents

Publication Publication Date Title
CN104811366B (en) A kind of loaming method and device of network communication message
CN109787946B (en) Access method and authority management method and device for shared space
TWI649986B (en) Method and system for synchronizing instant messaging unread messages
CN110971655B (en) Offline client playback and synchronization
CN106648903B (en) The method and apparatus for calling distributed file system
CN106897155B (en) A kind of method for showing interface and device
CN113438355B (en) Communication method, device, equipment and storage medium based on cloud mobile phone
CN111651418B (en) Document content downloading method and device, computer equipment and storage medium
US20200233878A1 (en) Card-based information management method and system
US20120158864A1 (en) Contextual conversation framework
TWI684873B (en) Conversation processing method and device in instant communication
CN105592118B (en) Synchronous user applies method, system and the server-side of data
CN112272137B (en) Method, computing device and computer readable memory device for mass data management in a communication application via multiple mailboxes
US10798047B2 (en) Systems, devices and methods for text message communication
US20160337308A1 (en) Electronic mail prompting method and server
CN110365797A (en) A kind of synchronous method and device of contact information
CN117235400A (en) Unified multi-platform portal system based on Kafka technology
CN106657172A (en) Method and device for realizing information push
CN105991744A (en) Method and equipment used for synchronizing user application data
KR101522728B1 (en) Data transmission method and device based on slide detection
CN109213955B (en) Data processing method and related equipment
TWI515684B (en) Method and apparatus for message processing and system thereof
CN105681262A (en) Interaction message allocating method and system
CN112769673A (en) Communication record generation, recommendation and display method and device
WO2016131264A1 (en) Method and device for constructing contact information

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
EXSB Decision made by sipo to initiate 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: 1208968

Country of ref document: HK

GR01 Patent grant
GR01 Patent grant