CN107656936A - A kind of terminal data base construction method in instant messaging field - Google Patents
A kind of terminal data base construction method in instant messaging field Download PDFInfo
- Publication number
- CN107656936A CN107656936A CN201610595093.6A CN201610595093A CN107656936A CN 107656936 A CN107656936 A CN 107656936A CN 201610595093 A CN201610595093 A CN 201610595093A CN 107656936 A CN107656936 A CN 107656936A
- Authority
- CN
- China
- Prior art keywords
- database
- message
- information
- group
- group members
- 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.)
- Granted
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/14—Error detection or correction of the data by redundancy in operation
- G06F11/1402—Saving, restoring, recovering or retrying
- G06F11/1415—Saving, restoring, recovering or retrying at system level
- G06F11/1435—Saving, restoring, recovering or retrying at system level using file system or storage system metadata
-
- 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/23—Updating
-
- 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/27—Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
-
- Y—GENERAL 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
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Databases & Information Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- Computing Systems (AREA)
- Library & Information Science (AREA)
- Quality & Reliability (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention discloses a kind of terminal data base construction method in instant messaging field, the present invention is divided into system information database, group members database and chatting message data storehouse by the various data for being related to database;Information includes nearest contact person, good friend, personal settings, system configuration and group in the system information database;Information includes group members information and group members timestamp in the group members database;Information in the chatting message data storehouse includes chat messages.The terminal development difficulty of instant messaging application/software can be substantially reduced using the database construction method of the present invention, the development time is reduced, reduce fund, the time cost of exploitation;The execution efficiency of timely communication applications/software can be significantly improved, reduces the usage experience that energy consumption improves user;When final end chat data backup is safeguarded after use, backed up using archival database, do not influence current database and continue to provide quickly read-write service, be easy to backup to safeguard.
Description
Technical field
The present invention relates to instant messaging field, and in particular to a kind of terminal data base construction method in instant messaging field.
Background technology
Instant messaging, a kind of business of the instant exchange message based on internet is referred to, also referred to as " real-time Communication for Power ", letter
Referred to as IM.Two people or more people is allowed to transmit word message, file, voice and video exchange in real time using network.
In current various desk devices, in the case that mobile device is popularized, the market demand of the timely communications field is explosive
Ground increases, and software and number of applications also significantly increase.But product good in actually using is few, most of product makes
It is poor with experiencing, or experience is preferable when start to install and use, slower and slower using system after a period of time, experience becomes
Difference.
It is due to that network I/O is not handled well to cause such phenomenon part, and this can be related to server section, terminal
Developer can not be fully solved;A part is that disk I/O is not handled well, that is, terminal buffers data are not handled well.
Because the structural data of present terminal buffers is substantially all the local data library storage, actually database processing the problem of,
This can just be handled well in terminal.
In engineer applied, the method for improving database efficiency is essentially all increase index, or divides the method for table.But
Some field is specific to, there is the characteristics of different again.The software of different field or application have different business characteristics, same neck
The product in domain has different function emphasis again, so designing the efficient local cache database processing in a set of instant messaging field
Method turns into an important problem.
The processing method that existing terminal database uses mostly is to use to lose data cached method or not sub-category,
The not jejune method such as optimization processing.But the whole efficiency that so will ultimately result in system is not high, the experience of user of service
It is bad.
Also there are some softwares/using database optimizing method, but there is also many problems:1. optimization means list
One, conventional method is exactly to index, and due to not classified according to practical business, is more made as the increase of data volume often occurs
With slower situation;2. carrying out a point table to optimize, lack the methodology of system, the full experience for depending on developer, influence the friendship of work
Connect, often occur that data are asynchronous, the situation of the wasting of resources.
The content of the invention
It is an object of the present invention to it can be protected in order to solve the above technical problems, providing one kind in the case of big data quantity
The terminal data base construction method in the instant messaging field of the whole efficiency of card system.
In order to solve the above technical problems, the present invention adopts the following technical scheme that:A kind of number of terminals in instant messaging field
According to base construction method, step includes:The various data that database is related to be divided into system information database, group members database and
Chatting message data storehouse;Information includes nearest contact person, good friend, personal settings, system configuration in the system information database
And group;Information includes group members information and group members timestamp in the group members database;The chatting message data storehouse
In information include chat messages.
The terminal data base construction method in instant messaging field as the aforementioned, for storing in the system information database
The tables of data of information is placed in an independent database, can be cached in internal memory, can also directly be operated in system operation
Database.
The terminal data base construction method in instant messaging field as the aforementioned, the group members database are believed including group members
Table is ceased, for storing the group members information, the title of the group members information is according to unique ID of group come dynamic generation;It is described
Group members information table number is identical with group's number.
The terminal data base construction method in instant messaging field as the aforementioned, is read out to the group members information
When, group members database table can be found according to unique ID of group, reads and is only carried out in the group members database table.
The terminal data base construction method in instant messaging field as the aforementioned, the group members database also include group members
Timestamp table, for recording each group members timestamp information.
The terminal data base construction method in instant messaging field as the aforementioned, the chatting message data storehouse includes:Currently
Message database and historical archive database;The chat messages include:Current message and historical archive message;And store respectively
In the message table of the message database and historical archive database, the title of the message table is according to the unique of chatting object
ID dynamic generations.
The terminal data base construction method in instant messaging field as the aforementioned, the current message data storehouse and historical archive
The message table of database includes contact person's message table and group's message table.
The terminal data base construction method in instant messaging field as the aforementioned, the contact person in the current message data storehouse disappear
Breath table and group's message table storage message number there is upper limit threshold, when the message number is more than the threshold value, delete compared with
Early message, keeps the entry number in contact person's message table and group's message table to be not more than the threshold value.
The terminal data base construction method in instant messaging field as the aforementioned, first write when having new information arrival current
Message database, after write historical archive database.
Compared with prior art, the present invention is divided into system information database, group by the various data for being related to database
Member database and chatting message data storehouse;Information is set including nearest contact person, good friend, individual in the system information database
Put, system configuration and group;Information includes group members information and group members timestamp in the group members database;The chat
Information in message database includes chat messages, and the terminal that instant messaging application/software can be substantially reduced using this method is opened
Degree of raising difficult questions, the development time is reduced, reduce fund, the time cost of exploitation;Holding for timely communication applications/software can be significantly improved
Line efficiency, reduce the usage experience that energy consumption improves user;When the backup of final end chat data is safeguarded after use, using depositing
Profile database is backed up, and is not influenceed current database and is continued to provide quickly read-write service, is easy to backup to safeguard.
Brief description of the drawings
Fig. 1 is the inventive method schematic flow sheet;
Fig. 2 is loading system information database flow chart in the present invention;
Fig. 3 is loading group members database flowchart in the present invention;
Fig. 4 is loading group members database flowchart in the present invention.
The present invention is further illustrated with reference to the accompanying drawings and detailed description.
Embodiment
To make the purpose, technical scheme and advantage of the embodiment of the present invention clearer, below in conjunction with the embodiment of the present invention
In accompanying drawing, the technical scheme in the embodiment of the present invention is explicitly described, it is clear that described embodiment be the present invention
Part of the embodiment, rather than whole embodiments.
The embodiment of the present invention 1, as shown in figure 1, in the system information database information include nearest contact person, good friend,
Personal settings, system configuration and group;Tables of data for storing information in the system information database is placed on one individually
In document data bank, MAIN_DB can be named as;
File in system information database can be cached in internal memory because quantity is little in system operation, can also
According to storehouse, performance and experience on system influence little immediate operand;
Resettle group members database GMBER_DB;When information includes group members information and group members in group members database
Between stab;
Group members information table in group members database, the title of table can be according to unique ID of group come dynamic generation.Than
Unique ID such as group is 10000, and the title of group members table can be named as gbr_10000_tbl.How many group, with regard to how many
Open group members information table;
Group members timestamp table in group members database, for recording each group members timestamp information;
In time communication in group members information read when, database table can be found according to the unique mark of group,
Read and only carried out on this table, operation data collection is smaller, and does not influence the read-write operation of other groups;
Resettle chatting message data storehouse MSG_DB, OLDMSG_DB.MSD_DB is current message data storehouse, OLDMSG_DB
For historical archive database;
There was only a kind of table inside MSG_DB, be exactly message table, the title of table can be moved according to unique ID of chatting object
State generates;
Chatting object is divided into people and group, if the ID of people and group are same systems, for example the ID of chatting object is 10000,
The title of message table can name msg_10000_tbl;
If the ID of people and group are not same systems, for example the ID of group is 10000, and the title of group's message table can be named as
Msg_1_10000_tbl, the ID of people is 10000, and the title of people's message table can be named as msg_2_10000_tbl.
As MSG_DB with OLDMSG_DB database structures, the quantity of table name and table is all;
The message of table storage inside MSG_DB has transformation, can set a maximum number of messages threshold value, applicable
Most of scene is that user needs quickly to check the scene of nearest chat message record, because the data volume in every table is small,
So it can be rapidly performed by retrieving;
Storage is that the naming method of table is identical with MSG_DB in locally generated whole historical informations inside OLDMSG_DB,
The quantity of table is also identical;
There is a maximum number of messages threshold value in MSG_DB tables, when the message number of the inside is more than this threshold value, delete
Message earlier, the entry number in every table is kept to be not more than the threshold value.
The number read due to message and experience when reading are far longer than when write message, so having what new information arrived
When first write current table in MSG_DB, after write OLDMSG_DB history lists.
Application/software in certification by rear, as shown in Fig. 2 loading system information database flow:First loaded from server
The timestamp of data, it is compared further according to local time stamp and server timestamp, first loading system information database, finally
Data are preserved into MAIN_DB.
As shown in figure 3, loading group members database:Crowd group_1 is found in group table first, obtains the group members time
Stamp, if group members timestamp table is not present, establishes database GMBER_DB, establishes group members table gbr_1_tbl, compares this
Ground timestamp and network time stamp, renewal group gbr_1_tbl member data table.
As shown in figure 4, loading group members database:Message is sent in group group_1, after network interface calls successfully,
Message m sg1 is produced, judges that message database MSG_DB whether there is, if it does not exist, then establishing database MSG_DB.Judge
Msg_g1_tbl whether there is, if it does not exist, then resettling table msg_g1_tbl tables, and chat data msg1 be inserted into msg_
G1_tbl tables;
Judge that historical data base OLDMSG_DB whether there is, if it does not exist, then establishing database OLDMSG_DB.Judge
OLDMSG_DB whether there is table msg_g1_tbl, if it does not exist, then establishing table msg_g1_tbl.Then by message data
Msg1 inserts msg_g1_tbl;
Finally judge whether the data volume of msg_g1_tbl tables is more than message threshold 5000, if greater than the threshold value, then
Batch deletes message to 2000, retains nearest 2000.
When needing to check crowd group_1 newest 10 Message Records, judge that MSG_DB whether there is, if do not deposited
Returning.If it does, judge that message table msg_g1_tbl whether there is, if it does not, returning.If it does, arrive msg_
G1_tbl query messages record, and because single table database amount is no more than 5000, the SQLITE database basic queries used exist
Millisecond returns.
The foregoing is only a specific embodiment of the invention, but protection scope of the present invention is not limited thereto, any
Those familiar with the art the invention discloses technical scope in, the change or replacement that can readily occur in, all should
It is included within the scope of the present invention.Therefore, protection scope of the present invention should it is described using scope of the claims as
It is accurate.
Claims (9)
1. a kind of terminal data base construction method in instant messaging field, it is characterised in that step includes:Database is related to
Various data are divided into system information database, group members database and chatting message data storehouse;In the system information database
Information includes nearest contact person, good friend, personal settings, system configuration and group;Information includes group in the group members database
Information about firms and group members timestamp;Information in the chatting message data storehouse includes chat messages.
2. the terminal data base construction method in instant messaging field as claimed in claim 1, it is characterised in that for storing
The tables of data for stating information in system information database is placed in an independent database, and internal memory can be cached in system operation
In, can also immediate operand according to storehouse.
3. the terminal data base construction method in instant messaging field as claimed in claim 1, it is characterised in that the group members
Database includes group members information table, for storing the group members information, the title of the group members information according to group only
One ID carrys out dynamic generation;The group members information table number is identical with group's number.
4. the terminal data base construction method in instant messaging field as claimed in claim 1, it is characterised in that to the group into
When being read out of information of member, can find group members database table according to unique ID of group, read only in the group members number
According to being carried out on the table of storehouse.
5. the terminal data base construction method in instant messaging field as claimed in claim 1, it is characterised in that the group members
Database also includes group members timestamp table, for recording each group members timestamp information.
6. the terminal data base construction method in instant messaging field as claimed in claim 1, it is characterised in that the chat disappears
Breath database includes:Current message data storehouse and historical archive database;The chat messages include:Current message and history are deposited
Shelves message;And it is stored respectively in the message table of the message database and historical archive database, the title of the message table
According to unique ID dynamic generations of chatting object.
7. the terminal data base construction method in instant messaging field as claimed in claim 6, it is characterised in that described currently to disappear
The message table of breath database and historical archive database includes contact person's message table and group's message table.
8. the terminal data base construction method in instant messaging field as claimed in claim 7, it is characterised in that described currently to disappear
Ceasing contact person's message table of database and the message number of group's message table storage has upper limit threshold, is more than in the message number
During the threshold value, message earlier is deleted, keeps the entry number in contact person's message table and group's message table no more than described
Threshold value.
9. the terminal data base construction method in instant messaging field as claimed in claim 8, it is characterised in that having new information
Current message data storehouse is first write when arrival, after write historical archive database.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610595093.6A CN107656936B (en) | 2016-07-26 | 2016-07-26 | Terminal database construction method in field of instant messaging |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610595093.6A CN107656936B (en) | 2016-07-26 | 2016-07-26 | Terminal database construction method in field of instant messaging |
Publications (2)
Publication Number | Publication Date |
---|---|
CN107656936A true CN107656936A (en) | 2018-02-02 |
CN107656936B CN107656936B (en) | 2021-03-02 |
Family
ID=61127403
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610595093.6A Active CN107656936B (en) | 2016-07-26 | 2016-07-26 | Terminal database construction method in field of instant messaging |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107656936B (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109446204A (en) * | 2018-11-27 | 2019-03-08 | 北京微播视界科技有限公司 | A kind of date storage method of instant messaging, device, electronic equipment and medium |
WO2020020048A1 (en) * | 2018-07-25 | 2020-01-30 | 北京达佳互联信息技术有限公司 | Method and apparatus for updating group member data, and terminal, system and storage medium |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1992625A (en) * | 2005-12-28 | 2007-07-04 | 腾讯科技(深圳)有限公司 | Method for processing muti-topic discussion group information flow based on instant communication |
US7725552B2 (en) * | 2006-01-24 | 2010-05-25 | Markport Limited | Content and service delivery in telecommunication networks |
CN101997783A (en) * | 2009-08-21 | 2011-03-30 | 阿里巴巴集团控股有限公司 | Implementation method and server for instant messaging tool contact structured group |
-
2016
- 2016-07-26 CN CN201610595093.6A patent/CN107656936B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1992625A (en) * | 2005-12-28 | 2007-07-04 | 腾讯科技(深圳)有限公司 | Method for processing muti-topic discussion group information flow based on instant communication |
US7725552B2 (en) * | 2006-01-24 | 2010-05-25 | Markport Limited | Content and service delivery in telecommunication networks |
CN101997783A (en) * | 2009-08-21 | 2011-03-30 | 阿里巴巴集团控股有限公司 | Implementation method and server for instant messaging tool contact structured group |
Non-Patent Citations (1)
Title |
---|
乐游网: "QQ5.9.1版本", 《QQ5.9.1》 * |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2020020048A1 (en) * | 2018-07-25 | 2020-01-30 | 北京达佳互联信息技术有限公司 | Method and apparatus for updating group member data, and terminal, system and storage medium |
US11184305B2 (en) | 2018-07-25 | 2021-11-23 | Beijing Dajia Internet Information Technology Co., Ltd. | Method and apparatus for updating group member data, and terminal, system and storage medium |
CN109446204A (en) * | 2018-11-27 | 2019-03-08 | 北京微播视界科技有限公司 | A kind of date storage method of instant messaging, device, electronic equipment and medium |
Also Published As
Publication number | Publication date |
---|---|
CN107656936B (en) | 2021-03-02 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN101080056B (en) | A management method and system of network browser collection folder of mobile terminal | |
US10110727B2 (en) | Systems and methods for event stream management | |
CN103078933B (en) | A kind of method and apparatus determining data migration time | |
US9413703B2 (en) | Synchronizing conversation structures in web-based email systems | |
US7783712B2 (en) | System and method for bi-directional synchronized conversion of electronic mail data | |
CN101673192B (en) | Method for time-sequence data processing, device and system therefor | |
CN104113466A (en) | Harassing phone call identification method, client, server and system | |
CN101025702A (en) | Method for automatic backup using computer network | |
JP5631886B2 (en) | Always ready client / server synchronization | |
CN107241444B (en) | Distributed cache data management system, method and device | |
US10873552B2 (en) | Large data management in communication applications through multiple mailboxes | |
US11507277B2 (en) | Key value store using progress verification | |
CN103617007A (en) | Method and system for achieving multilevel intelligent storage | |
CN102769640A (en) | Method, server and system for user information updating | |
CN1996305A (en) | Data saving and reading method and device therefore, and data transmission system | |
CN107656936A (en) | A kind of terminal data base construction method in instant messaging field | |
US20200311029A1 (en) | Key value store using generation markers | |
US20160337308A1 (en) | Electronic mail prompting method and server | |
CN104866245B (en) | The method and apparatus of synchronisation snapshot between buffer memory device and storage system | |
CN106487653A (en) | A kind of message treatment method and server | |
CN103714089A (en) | Method and system of rolling back cloud database | |
CN107040455B (en) | Instant message communication method and system based on redis | |
CN109407988A (en) | Cold data storage system and its storage method | |
CN110196881B (en) | Block chain-based data reading and writing method and block chain network structure | |
CN116820323A (en) | Data storage method, device, electronic equipment and computer readable storage medium |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |