CN106603386A - Method for managing instant messaging application chat records - Google Patents
Method for managing instant messaging application chat records Download PDFInfo
- Publication number
- CN106603386A CN106603386A CN201611167480.6A CN201611167480A CN106603386A CN 106603386 A CN106603386 A CN 106603386A CN 201611167480 A CN201611167480 A CN 201611167480A CN 106603386 A CN106603386 A CN 106603386A
- Authority
- CN
- China
- Prior art keywords
- message
- local
- instant messaging
- messaging application
- cached
- 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.)
- Pending
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L51/00—User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail
- H04L51/04—Real-time or near real-time messaging, e.g. instant messaging [IM]
- H04L51/046—Interoperability with other network applications or services
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/22—Indexing; Data structures therefor; Storage structures
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L51/00—User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail
- H04L51/07—User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail characterised by the inclusion of specific contents
- H04L51/18—Commands or executable codes
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L51/00—User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail
- H04L51/21—Monitoring or handling of messages
- H04L51/216—Handling conversation history, e.g. grouping of messages in sessions or threads
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Transfer Between Computers (AREA)
Abstract
The invention discloses a method for managing instant messaging application chat records. The method comprises steps of: first caching chat records acquired by a client in a local database and defining the chat records as a set and merging the set; when historical message records are needed, determining whether or not the historical message records exist in the local set generated in the above step, and acquiring and displaying the historical message records if yes; acquiring the historical message records from a network if not, then caching the historical message records locally and displaying the historical message records. Compared with the prior art, the method for managing instant messaging application chat records can make an instant communication application in the client timely and promptly display the historical chat data, is less influenced by the network, fast in acquisition speed, good in experience, good in practicality, complete in data display, ideal in customer experience, and wide in application range, and has a very good popularization and application value.
Description
Technical field
The present invention relates to technical field of information communication, specifically a kind of manager of instant messaging application chat record
Method.
Background technology
With the development of mobile Internet, the Internet instant messaging is also being expanded to mobile.Communication applications have furthered people
The distance between with people, instant messenger further promote between affective interaction, also can record when exchanging each other
Word and image, for user afterwards again backtracking provide out and out record.At present chat record all can be preserved
On the webserver, while also locally being preserved.If when user wants to check historical record directly from network clothes
Business device is obtained, and because by web influence, acquisition speed is slower, is experienced poor.If from local acquisition, due to instant messaging application
Can there is the situation of multiple terminals login, so each terminal saves the chat record of part, and it is imperfect, so to user
Cause very big puzzlement.
Based on this, now provide a kind of management method of instant messaging application chat record to solve the above problems.
The content of the invention
The technical assignment of the present invention is for above weak point, there is provided a kind of management of instant messaging application chat record
Method.
A kind of management method of instant messaging application chat record, it realizes that process is:
First the chat record that client is obtained is cached to into local data base, is defined as a collection and merges;
When needing to obtain contact list, judge whether in the local set for generating from above-mentioned steps first, if
Presence is then obtained and shown;, from Network Capture, show again after being cached to locally if without if.
It is by the process that chat record is cached to local data base:Got by installing the terminal unit of client first
All chat records, and local data base is cached to, record the id of the head and the tail of each continuous meassage fragment, i.e., record gets
First of each continuous meassage and the last item id, be defined as a set, the definition of the id of the message with disappear
The generation time of breath is positive correlation or negative correlation.
When the continuous message for getting only has one, then a up-and-down boundary identical set is constituted.
The merging for entering row set in the local database refers to the merging of all message segments, and its process is:By definition
Set is merged with all of message segment set in the aggregate list for locally having cached, then preserves into aggregate list.
Obtain contact list process be:When instant communication applications need to obtain a number of contact list
When, determine whether from local set neutralization message cache database first this quantity message be buffered in locally, if
Just obtain message and show from local;If not then be cached to again from after Network Capture, acquisition local and show.
Determine whether in above-mentioned steps the message of this quantity be buffered in locally refer to determine whether it is nearest and continuous
The message of this quantity be buffered in locally, that is, when obtaining the N bar Message Records before certain a piece of news, obtaining first should in caching
Before bar message and continuous message bar number, this number, then from local acquisition, obtains more than N otherwise from the webserver,
Here N is the natural number more than or equal to 1.
Obtain contact list detailed process be:
When the history message of N bars is recorded before needing to obtain message AId, first determine whether whether AId is included in local set row
In table;
If there is the border then gathered according to this, the minimum a piece of news BId of id are obtained, then from local message data base
The quantity of the message between inquiry AId and BId;
If the not little N of quantity, directly obtains this section of message from message database.Otherwise from Network Capture, obtaining should after message
Cached again, N here is the natural number more than or equal to 1.
Inquire about the message number in local data base between AId and BId and obtain message from data base and pass through calling system
The API of data base is realized.
Obtain after message from network, then be cached to local process and be:
First from the continuous meassage of Network Capture requirement;
Then message is cached in local data base, composition one is with this combination of message g. slice header and afterbody as border;
Assembly Listing present in this combination and caching is merged, by new Assembly Listing storage to locally.
The present invention a kind of instant messaging application chat record management method compared to the prior art, with following beneficial
Effect:
A kind of management method of instant messaging application chat record of the present invention, can make the instant messaging application of client timely
Quickly show history chat data, less by web influence, acquisition speed is very fast, and experience property is strong, practical, data display
Completely, customer experience is preferable, applied widely, with good application value.
Description of the drawings
Accompanying drawing 1 is flowchart of the invention.
Specific embodiment
Below in conjunction with the accompanying drawings and specific embodiment the invention will be further described.
As shown in Figure 1, the invention provides a kind of management method of instant messaging application chat record, it provides one
Plant technical resolving ideas.When instant communication applications support multiple terminals, the chat messages of each terminal buffers might not
It is continuous.Local data base is cached to by all chat records for getting this terminal, and records each and continuously disappeared
The id of the head and the tail of breath fragment, is defined as a set(Need ensure message the definition of id be with the generation time of message
Positive correlation or negative correlation), then enter the merging of row set.Application every time needs to obtain a number of contact list
When, determine whether message that is nearest and being continuous this quantity from local set neutralization message cache database first
It is buffered in local.Just from local obtain message and show if any, if not then cache again from after Network Capture, acquisition
To local.Made using the purpose of faster and better displaying history chat data with reaching.
The method specifically includes following steps:
One section of continuous message that client gets is cached to into local data base, and obtains the head and tail of this message segment
The id of the message in portion, combines a set(It is the act that is proportionate that this sentences the definition of the id of message with the generation time of message
Example), due to without the api of relevant set, need oneself to write in java one gather realize class.
If only a piece of news, constitutes a up-and-down boundary identical set.
It is implemented as follows described:
public class MatheSet {
long start = 0L;The border of // set
long end = 0L;The border of // set
public MatheSet(long start, long end) {
this.start = start;
this.end = end;
}
// set merges
public void merge(MatheSet other) {
List<Long> l = Arrays.asList(start, end, other.start, other.end);
start = Collections.min(l);
end = Collections.max(l);
other.start = 0;
other.end = 0;
}
// judge whether two set have common factor
public static boolean isIntersection(MatheSet one, MatheSet other) {
if (one == null || other == null) {
return false;
}
return one.inMatheSet(other.start) || one.inMatheSet(other.end);
}
// judge whether element is included in set
public boolean inMatheSet(long target) {
return (target >= start && target <= end);
}
}
This set is merged with all of message segment set in the aggregate list for locally having cached, set is then preserved into
List.
Iterator<MatheSet> it = matheSetList.iterator();
while (it.hasNext()) {
MatheSet temp = it.next();
if (MatheSet.isIntersection(temp, targetMatheSet)) {
targetMatheSet.merge(temp);
it.remove();
}
}
matheSetList.add(targetMatheSet);
When needing to obtain history message record, that is, when obtaining the Message Record before certain a piece of news.When need obtain history
During Message Record, that is, when obtaining the N bar Message Records before certain a piece of news AId.First in acquisition caching before bar message
And the bar number of continuous message.This number, then from local acquisition, is obtained more than N otherwise from the webserver, then will be obtained again
The message for taking is cached.
Obtain contact list detailed process be:
When the history message of N bars is recorded before needing to obtain message AId, first determine whether whether AId is included in local set row
In table;
If there is the border then gathered according to this, the minimum a piece of news BId of id are obtained, then from local message data base
The quantity of the message between inquiry AId and BId;
If the not little N of quantity, directly obtains this section of message from message database.Otherwise from Network Capture, obtaining should after message
Cached again, N here is the natural number more than or equal to 1.
Judge whether message AId is included in local aggregate list, call the inMatheSet methods of MatheSet classes.
If including AId in set, starts of the minimum a piece of news id of id for MatheSet classes is obtained.
Inquire about the message number in local data base between AId and BId and obtain message from data base, then calling system number
According to the API in storehouse.
Obtain after message from network, then be cached to local process and be:
First from the continuous meassage of Network Capture requirement;
Then message is cached in local data base, composition one is with this combination of message g. slice header and afterbody as border;
Assembly Listing present in this combination and caching is merged, by new Assembly Listing storage to locally.
By specific embodiment above, the those skilled in the art can readily realize the present invention.But should
Work as understanding, the present invention is not limited to above-mentioned specific embodiment.On the basis of disclosed embodiment, the technical field
Technical staff can the different technical characteristic of combination in any, so as to realize different technical schemes.
In addition to the technical characteristic described in description, the known technology of those skilled in the art is.
Claims (10)
1. the management method that a kind of instant messaging application chat is recorded, it is characterised in that it realizes that process is:
First the chat record that client is obtained is cached to into local data base, is defined as a collection and merges;
When needing to obtain contact list, judge whether in the local set for generating from above-mentioned steps first, if
Presence is then obtained and shown;, from Network Capture, show again after being cached to locally if without if.
2. the management method that a kind of instant messaging application chat according to claim 1 is recorded, it is characterised in that will chat
Record buffer memory to the process of local data base is:First all chat records are got by installing the terminal unit of client,
And local data base is cached to, and record the id of the head and the tail of each continuous meassage fragment, that is, record each for getting and continuously disappear
First of breath and the id of the last item, it is defined as a set, the definition of the id of the message and the generation time of message
For positive correlation or negative correlation.
3. the management method that a kind of instant messaging application chat according to claim 2 is recorded, it is characterised in that work as acquisition
To continuous message there was only one when, then constitute a up-and-down boundary identical set.
4. the management method that a kind of instant messaging application chat according to claim 1 and 2 is recorded, it is characterised in that
The merging for entering row set in local data base refers to the merging of all message segments, and its process is:By definition set with it is local
All of message segment set in the aggregate list for having cached is merged, and then preserves into aggregate list.
5. the management method that a kind of instant messaging application chat according to claim 2 is recorded, it is characterised in that acquisition disappears
Breath historical record process be:When instant communication applications need to obtain a number of contact list, first from local
The message that this quantity is determined whether in set neutralization message cache database is buffered in locally, if just disappearing from locally obtaining
Cease and show;If not then be cached to again from after Network Capture, acquisition local and show.
6. the management method that a kind of instant messaging application chat according to claim 5 is recorded, it is characterised in that above-mentioned step
Determine whether that the message of this quantity is buffered in rapid and locally refer to the message for determining whether nearest and continuous this quantity
It is buffered in local, that is, when obtaining the N bar Message Records before certain a piece of news, obtains first in caching before the message and connect
The bar number of continuous message, this number, then from local acquisition, is obtained more than N otherwise from the webserver, N here be more than etc.
In 1 natural number.
7. the management method that a kind of instant messaging application chat according to claim 5 or 6 is recorded, it is characterised in that obtain
The detailed process for taking contact list is:
When the history message of N bars is recorded before needing to obtain message AId, first determine whether whether AId is included in local set row
In table;
If there is the border then gathered according to this, the minimum a piece of news BId of id are obtained, then from local message data base
The quantity of the message between inquiry AId and BId;
If the not little N of quantity, directly obtains this section of message from message database;Otherwise from Network Capture, obtaining should after message
Cached again, N here is the natural number more than or equal to 1.
8. the management method that a kind of instant messaging application chat according to claim 7 is recorded, it is characterised in that inquiry is originally
Message number between AId and BId and API reality of the message by calling system data base is obtained in ground data base from data base
It is existing.
9. the management method that a kind of instant messaging application chat according to claim 1 or 5 or 6 is recorded, it is characterised in that
Obtain after message from network, then be cached to local process and be:
First from the continuous meassage of Network Capture requirement;
Then message is cached in local data base, composition one is with this combination of message g. slice header and afterbody as border;
Assembly Listing present in this combination and caching is merged, by new Assembly Listing storage to locally.
10. the management method that a kind of instant messaging application chat according to claim 7 is recorded, it is characterised in that from net
Obtain after message in network, then be cached to local process and be:
First from the continuous meassage of Network Capture requirement;
Then message is cached in local data base, composition one is with this combination of message g. slice header and afterbody as border;
Assembly Listing present in this combination and caching is merged, by new Assembly Listing storage to locally.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201611167480.6A CN106603386A (en) | 2016-12-16 | 2016-12-16 | Method for managing instant messaging application chat records |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201611167480.6A CN106603386A (en) | 2016-12-16 | 2016-12-16 | Method for managing instant messaging application chat records |
Publications (1)
Publication Number | Publication Date |
---|---|
CN106603386A true CN106603386A (en) | 2017-04-26 |
Family
ID=58599875
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201611167480.6A Pending CN106603386A (en) | 2016-12-16 | 2016-12-16 | Method for managing instant messaging application chat records |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106603386A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110457451A (en) * | 2019-07-08 | 2019-11-15 | 北京达佳互联信息技术有限公司 | Information display method, device, electronic equipment and storage medium |
CN115086264A (en) * | 2022-08-23 | 2022-09-20 | 北京普华恒信技术服务有限公司 | Data set generation method, equipment and computer system |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103684980A (en) * | 2012-09-17 | 2014-03-26 | 阿里巴巴集团控股有限公司 | Method and system for synchronizing chatting records in instant chat tool |
CN104811366A (en) * | 2014-01-26 | 2015-07-29 | 阿里巴巴集团控股有限公司 | Network communication message roaming method and device |
CN104883292A (en) * | 2015-04-16 | 2015-09-02 | 江苏中威科技软件***有限公司 | Method and system for realizing message roaming at different terminals |
-
2016
- 2016-12-16 CN CN201611167480.6A patent/CN106603386A/en active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103684980A (en) * | 2012-09-17 | 2014-03-26 | 阿里巴巴集团控股有限公司 | Method and system for synchronizing chatting records in instant chat tool |
CN104811366A (en) * | 2014-01-26 | 2015-07-29 | 阿里巴巴集团控股有限公司 | Network communication message roaming method and device |
CN104883292A (en) * | 2015-04-16 | 2015-09-02 | 江苏中威科技软件***有限公司 | Method and system for realizing message roaming at different terminals |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110457451A (en) * | 2019-07-08 | 2019-11-15 | 北京达佳互联信息技术有限公司 | Information display method, device, electronic equipment and storage medium |
CN115086264A (en) * | 2022-08-23 | 2022-09-20 | 北京普华恒信技术服务有限公司 | Data set generation method, equipment and computer system |
CN115086264B (en) * | 2022-08-23 | 2022-12-13 | 北京普华恒信技术服务有限公司 | Data set generation method, equipment and computer system |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11606384B2 (en) | Clustering-based security monitoring of accessed domain names | |
Kostakos et al. | Brief encounters: Sensing, modeling and visualizing urban mobility and copresence networks | |
CN103501486B (en) | A kind of information push method and push server | |
JP5674665B2 (en) | System and method for collaborative short message and discussion | |
US9514446B1 (en) | Remarketing content to a user associated with multiple devices | |
US9100286B2 (en) | System for tracking diffusion | |
CN107784516A (en) | Advertisement placement method and device | |
US20090307325A1 (en) | System and method for sharing content in an instant messaging application | |
JP2018529148A (en) | Group message prompt method and apparatus for instant messaging application | |
US20070282877A1 (en) | Open overlay for social networks and online services | |
US20140074612A1 (en) | System and Method for Targeting Information Items Based on Popularities of the Information Items | |
US20120089732A1 (en) | Method and system for establishing a new account for a user with an online service | |
EP2118782A1 (en) | Detecting a user's location, local intent, and travel intent from search queries | |
KR20140016278A (en) | Sponsored stories unit creation from organic activity stream | |
JP2012502371A5 (en) | System and method for collaborative short message and discussion | |
WO2012148863A2 (en) | Targeting advertising based on tracking content sharing | |
US20110161440A1 (en) | System and method for enhancing digital content | |
US20080059584A1 (en) | Method and apparatus for sharing resource addresses | |
EP2449481A1 (en) | System and method for enhancing digital content | |
CN110413476A (en) | Webpage collapses monitor method, device, computer equipment and storage medium | |
CN106603386A (en) | Method for managing instant messaging application chat records | |
CN105740407A (en) | Tree structure generation method and system | |
US20190166224A1 (en) | Near real time notifications distribution platform | |
CN112243144B (en) | Input method barrage display method, device, equipment and storage medium | |
CN106559264B (en) | Loading display method and system for topological view |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20170426 |
|
RJ01 | Rejection of invention patent application after publication |