TW201820903A - Method and device for processing chat log of real-time chat tool - Google Patents

Method and device for processing chat log of real-time chat tool Download PDF

Info

Publication number
TW201820903A
TW201820903A TW106127146A TW106127146A TW201820903A TW 201820903 A TW201820903 A TW 201820903A TW 106127146 A TW106127146 A TW 106127146A TW 106127146 A TW106127146 A TW 106127146A TW 201820903 A TW201820903 A TW 201820903A
Authority
TW
Taiwan
Prior art keywords
chat
user
cache
historical
records
Prior art date
Application number
TW106127146A
Other languages
Chinese (zh)
Other versions
TWI743163B (en
Inventor
徐蘇杭
Original Assignee
香港商阿里巴巴集團服務有限公司
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 香港商阿里巴巴集團服務有限公司 filed Critical 香港商阿里巴巴集團服務有限公司
Publication of TW201820903A publication Critical patent/TW201820903A/en
Application granted granted Critical
Publication of TWI743163B publication Critical patent/TWI743163B/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/14Details of searching files based on file metadata
    • G06F16/156Query results presentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/14Details of searching files based on file metadata
    • G06F16/148File search processing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/172Caching, prefetching or hoarding of files
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L51/00User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail
    • H04L51/21Monitoring or handling of messages
    • H04L51/216Handling conversation history, e.g. grouping of messages in sessions or threads

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Library & Information Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

A method and device for processing a chat log of a real-time chat tool. The method comprises: in response to a request for acquiring a chat log history of a chat between a current user and a specific user, reading, from a buffer, the chat log history of the chat between the current user and the specific user, wherein the buffer stores a chat log history pre-read from a local data storage space and a chat log history directly buffered therein; and displaying the chat log history of the chat between the current user and the specific user. The method can be utilized to quickly read from a buffer a chat log history, reducing use of a hard disk resource, and increasing efficiency of acquiring a chat log.

Description

即時聊天工具的聊天記錄處理方法及裝置    Method and device for processing chat record of instant chat tool   

本發明實施例關於計算機技術領域,具體關於一種即時聊天工具的聊天記錄處理方法及裝置。 The embodiments of the present invention relate to the field of computer technology, and in particular, to a method and device for processing chat records of an instant chat tool.

即時聊天工具(英文全稱為Instant Messaging,英文簡稱為IM)是一種可以在使用者之間傳遞即時消息的應用程式,可以方便使用者進行交流。現有技術中,使用者可以通過即時聊天工具接收新消息以及查看歷史聊天記錄。舉例說明,使用者可以通過滾動屏幕或點擊“查看更多消息”選項觸發歷史聊天記錄的顯示。現有技術中,使用者與其他使用者之間的聊天記錄一般是在本地磁碟中儲存。當使用者需要查看歷史聊天記錄時,也是從本地磁碟中讀取歷史聊天記錄。由於現有技術每次讀取聊天記錄時均從本地磁碟中讀取,不僅會造成磁碟資源的消耗,而且從磁碟讀取資料存在耗時長、無法及時快速展示聊天記錄的缺陷。 Real-time chat tool (English is called Instant Messaging in English, IM for short) is an application that can transfer instant messages between users, which can facilitate users to communicate. In the prior art, users can receive new messages and view historical chat records through an instant chat tool. For example, the user can trigger the display of historical chat records by scrolling the screen or clicking the "View more messages" option. In the prior art, chat records between users and other users are generally stored on a local disk. When the user needs to view the historical chat history, the historical chat history is also read from the local disk. Because the current technology reads the chat record from the local disk each time, it not only causes the consumption of disk resources, but also has the drawback of taking a long time to display the chat record in a timely manner.

本發明實施例提供了一種即時聊天工具的聊天記錄處 理方法及裝置,可以從快取中快速讀取歷史聊天記錄,減少磁碟資源的消耗,提高了獲取聊天記錄的效率。 Embodiments of the present invention provide a method and a device for processing a chat record of an instant chat tool, which can quickly read historical chat records from a cache, reduce the consumption of magnetic disk resources, and improve the efficiency of obtaining chat records.

為此,本發明實施例提供如下技術方案:第一方面,本發明實施例提供了一種即時聊天工具的聊天記錄處理方法,包括:響應於獲取當前使用者與特定使用者間的歷史聊天記錄的請求,從快取中讀取當前使用者與特定使用者間的歷史聊天記錄;其中,該快取中保存有預先從本地儲存空間中讀取的歷史聊天記錄以及直接儲存在該快取的歷史聊天記錄;展示該當前使用者與特定使用者間的歷史聊天記錄。 To this end, the embodiment of the present invention provides the following technical solution: In a first aspect, the embodiment of the present invention provides a method for processing a chat record of an instant chat tool, including: in response to obtaining a historical chat record between a current user and a specific user; Request to read the historical chat history between the current user and a specific user from the cache; wherein the cache stores the historical chat history read in advance from the local storage space and the history directly stored in the cache Chat history; show the historical chat history between the current user and a specific user.

在一些實施方式中,該從快取中讀取當前使用者與特定使用者間的歷史聊天記錄包括:判斷是否從本地儲存空間讀取過該當前使用者與特定使用者間的歷史聊天記錄;若判斷結果為是,從快取中讀取當前使用者與特定使用者間的歷史聊天記錄。 In some embodiments, the reading the historical chat records between the current user and the specific user from the cache includes: determining whether the historical chat records between the current user and the specific user have been read from the local storage space; If the determination result is yes, the historical chat history between the current user and the specific user is read from the cache.

在一些實施方式中,該方法還包括:若判斷結果為否,從本地儲存空間讀取該當前使用者與特定使用者間的歷史聊天記錄,將讀取的該聊天記錄儲存在快取中,記錄已從本地儲存空間讀取過該當前使用者與特定使用者間的歷史聊天記錄。 In some embodiments, the method further includes: if the determination result is no, reading the historical chat record between the current user and the specific user from a local storage space, and storing the read chat record in a cache, The history has read the historical chat history between the current user and the specific user from the local storage space.

在一些實施方式中,該方法還包括:當確定滿足觸發條件時,預先從本地儲存空間中讀取當前使用者與特定使用者間的歷史聊天記錄,將讀取的該聊天記錄保存在快取中。 In some embodiments, the method further includes: when it is determined that the trigger condition is satisfied, previously reading a historical chat record between the current user and a specific user from a local storage space, and saving the read chat record in a cache in.

在一些實施方式中,該確定滿足觸發條件包括:當接收到特定使用者發送給當前使用者的即時消息時,確定滿足觸發條件;或者,當接收到使用者觸發顯示當前使用者與特定使用者的聊天窗口的操作時,確定滿足觸發條件。 In some implementations, the determining that the trigger condition is satisfied includes: determining that the trigger condition is satisfied when an instant message sent by a specific user to the current user is received; or, when receiving the user trigger, displaying the current user and the specific user is triggered When the operation of the chat window is determined, the trigger condition is satisfied.

在一些實施方式中,該方法還包括:當確定該歷史聊天記錄包含圖片時,根據該圖片的標識判斷快取中是否儲存有與該圖片的標識對應的圖片;若判斷結果為是,從快取中獲取與該圖片標識對應的圖片。 In some embodiments, the method further includes: when determining that the historical chat record contains a picture, determining whether a picture corresponding to the picture identifier is stored in the cache according to the picture identifier; if the determination result is yes, starting from the fast Take the picture to get the picture corresponding to the picture ID.

在一些實施方式中,該方法還包括:若判斷結果為否,從本地儲存空間中獲取該圖片,在快取中儲存該圖片以及圖片與圖片標識的對應關係。 In some embodiments, the method further includes: if the determination result is no, obtaining the picture from a local storage space, storing the picture in a cache, and the correspondence between the picture and the picture identifier.

在一些實施方式中,該方法還包括:保存從快取中獲取歷史聊天記錄的存取時間;當滿足觸發條件時,根據該存取時間確定最近最少使用的歷史聊天記錄,從快取中刪除該歷史聊天記錄。 In some embodiments, the method further includes: saving an access time for obtaining historical chat records from the cache; when a trigger condition is satisfied, determining the least recently used historical chat records according to the access time, and deleting from the cache The history chat.

在一些實施方式中,該方法還包括:當接收到特定使用者向當前使用者發送的即時消息時,判斷該即時消息的數量或者容量是否小於設定閾值;若判斷結果為是,發送獲取當前使用者與特定使用者間的歷史聊天記錄的請求。 In some embodiments, the method further includes: when receiving an instant message sent by a specific user to the current user, determining whether the quantity or capacity of the instant message is less than a set threshold; if the determination result is yes, sending and obtaining the current use Request for historical chat history between a user and a specific user.

在一些實施方式中,該展示歷史聊天記錄包括:響應於使用者觸發顯示該即時消息的請求,將該即時消息與該歷史聊天記錄合併顯示。 In some implementations, displaying the historical chat record includes: in response to a user triggering a request to display the instant message, displaying the instant message in combination with the historical chat record.

在一些實施方式中,該從快取中讀取當前使用者與特定使用者間的歷史聊天記錄包括:從快取中讀取當前使用 者與特定使用者間符合特定條件的部分歷史聊天記錄;該特定條件包括符合特定時間條件、特定地點條件或者符合特定關鍵詞的歷史聊天記錄;該展示該當前使用者與特定使用者間的歷史聊天記錄包括:展示該部分歷史聊天記錄,其中,該部分歷史聊天記錄中的各條聊天記錄之間不具有時間連續關係或者該歷史聊天記錄與當前即時聊天工具最近展示的聊天記錄不具有時間連續關係。 In some implementation manners, the reading the historical chat records between the current user and the specific user from the cache includes: reading from the cache a part of the historical chat records between the current user and the specific user that meets specific conditions; The specific condition includes a historical chat record that meets a specific time condition, a specific location condition, or a specific keyword; the display of the historical chat record between the current user and the specific user includes: a display of the part of the historical chat record, wherein the part Each chat record in the historical chat record does not have a time-continuous relationship or the historical chat record does not have a time-continuous relationship with the recently displayed chat record of the current instant chat tool.

在一些實施方式中,該從快取中讀取當前使用者與特定使用者間的歷史聊天記錄包括:判斷快取中儲存的當前使用者與特定使用者間的歷史聊天記錄的數量或者容量是否大於設定閾值;若判斷結果為是,直接從快取中讀取數量或者容量與設定閾值相等的歷史聊天記錄;若判斷為否,從本地儲存空間中讀取部分歷史聊天記錄,並儲存到快取中,使得快取中的歷史聊天記錄的數量或者容量大於或者等於設定閾值。 In some implementations, reading the historical chat records between the current user and the specific user from the cache includes: determining whether the number or capacity of historical chat records between the current user and the specific user stored in the cache is Is greater than the set threshold; if the result of the judgment is yes, historical chat records with a quantity or capacity equal to the set threshold are directly read from the cache; if no, the historical chat records are read from the local storage space and stored in the cache Picking, so that the number or capacity of historical chat records in the cache is greater than or equal to a set threshold.

第二方面,本發明實施例提供了一種即時聊天工具的聊天記錄處理方法,包括:接收使用者觸發第一控件的操作;響應於使用者觸發第一控件的操作,顯示當前使用者與特定使用者間的至少部分歷史聊天記錄;其中,該至少部分歷史聊天記錄中的各條聊天記錄之間不具有時間連續關係或者該至少部分歷史聊天記錄與當前即時聊天工具最近展示的聊天記錄之間不具有時間連續關係。 In a second aspect, an embodiment of the present invention provides a method for processing a chat record of an instant chat tool, including: receiving an operation triggered by a user to trigger a first control; and in response to the user triggering an operation of the first control, displaying a current user and a specific use At least part of the historical chat records between the users; wherein each of the chat records in the at least part of the historical chat records does not have a continuous relationship in time or there is no relationship between the at least part of the historical chat records and the chat records recently displayed by the current instant chat tool Has a time-continuous relationship.

在一些實施方式中,該方法還包括:接收使用者觸發第二控件的操作;響應於使用者觸發第二控件的操作,顯 示當前使用者與特定使用者間的至少部分歷史聊天記錄;其中,該至少部分歷史聊天記錄中的各條聊天記錄之間具有時間連續關係或者該至少部分歷史聊天記錄與當前即時聊天工具最近展示的聊天記錄之間具有時間連續關係。 In some implementations, the method further includes: receiving an operation triggered by the user to trigger the second control; and in response to the user triggering the operation of the second control, displaying at least part of the historical chat record between the current user and the specific user; wherein, There is a time-continuous relationship between the chat records in the at least part of the historical chat record or a time-continuous relationship between the at least part of the historical chat record and the chat record recently displayed by the current instant chat tool.

在一些實施方式中,在顯示當前使用者與特定使用者間的至少部分歷史聊天記錄之前,該方法還包括:從快取中讀取前使用者與特定使用者間的至少部分歷史聊天記錄;其中,該快取中保存有預先從本地儲存空間中讀取的歷史聊天記錄以及直接儲存在該快取的歷史聊天記錄。 In some embodiments, before displaying at least part of the historical chat history between the current user and the specific user, the method further includes: reading at least part of the historical chat history between the previous user and the specific user from the cache; The cache stores historical chat records read in advance from a local storage space and historical chat records stored directly in the cache.

第三方面,本發明實施例提供了一種即時聊天工具的聊天記錄處理裝置,包括:獲取單元,用於響應於獲取當前使用者與特定使用者間的歷史聊天記錄的請求,從快取中讀取當前使用者與特定使用者間的歷史聊天記錄;其中,該快取中保存有預先從本地儲存空間中讀取的歷史聊天記錄以及直接儲存在該快取的歷史聊天記錄;展示單元,用於展示該歷史聊天記錄。 According to a third aspect, an embodiment of the present invention provides a chat record processing device for an instant chat tool, including: an obtaining unit, configured to read from a cache in response to a request for obtaining a historical chat record between a current user and a specific user. Fetch the historical chat history between the current user and the specific user; wherein the cache stores the historical chat history read in advance from the local storage space and the historical chat history stored directly in the cache; the display unit is used to Show the history chat history.

在一些實施方式中,該獲取單元包括:第一判斷單元,用於判斷是否從本地儲存空間讀取過該當前使用者與特定使用者間的歷史聊天記錄;第一讀取單元,用於若判斷已從本地儲存空間讀取過該當前使用者與特定使用者間的歷史聊天記錄時,從快取中讀取當前使用者與特定使用者間的歷史聊天記錄。 In some embodiments, the obtaining unit includes: a first determining unit for determining whether a historical chat record between the current user and a specific user has been read from a local storage space; a first reading unit for When it is determined that the historical chat records between the current user and the specific user have been read from the local storage space, the historical chat records between the current user and the specific user are read from the cache.

在一些實施方式中,該裝置還包括:第二讀取單元,用於若判斷未從本地儲存空間讀取過該當前使用者與特定 使用者間的歷史聊天記錄時,從本地儲存空間讀取該當前使用者與特定使用者間的歷史聊天記錄;第一儲存單元,用於將讀取的該聊天記錄儲存在快取中,記錄已從本地儲存空間讀取過該當前使用者與特定使用者間的歷史聊天記錄。 In some embodiments, the device further includes: a second reading unit, configured to read from the local storage space if it is determined that the historical chat history between the current user and the specific user has not been read from the local storage space. A historical chat record between the current user and a specific user; a first storage unit for storing the read chat record in a cache, and the record has read the current user and a specific use from a local storage space History chat history.

在一些實施方式中,該裝置還包括:第三讀取單元,用於當確定滿足觸發條件時,預先從本地儲存空間中讀取當前使用者與特定使用者間的歷史聊天記錄;第二儲存單元,用於將讀取的該聊天記錄保存在快取中。 In some implementations, the device further includes: a third reading unit, configured to read a historical chat record between the current user and a specific user from a local storage space in advance when it is determined that the trigger condition is satisfied; the second storage A unit for saving the read chat record in a cache.

在一些實施方式中,該裝置還包括:第二判斷單元,用於當確定該歷史聊天記錄包含圖片時,根據該圖片的標識判斷快取中是否儲存有與該圖片的標識對應的圖片;第四讀取單元,用於若判斷結果為是,從快取中獲取與該圖片標識對應的圖片。第五讀取單元,用於若判斷結果為否,從本地儲存空間中獲取該圖片;第三儲存單元,用於在快取中儲存該圖片以及圖片與圖片標識的對應關係。 In some implementations, the device further includes: a second judgment unit, configured to determine whether a picture corresponding to the picture identifier is stored in the cache according to the identifier of the picture when it is determined that the historical chat record contains a picture; Four reading units are configured to obtain a picture corresponding to the picture identifier from the cache if the determination result is yes. The fifth reading unit is configured to obtain the picture from the local storage space if the determination result is no; the third storage unit is configured to store the picture and the correspondence between the picture and the picture identifier in the cache.

在一些實施方式中,該裝置還包括:第四儲存單元,用於保存從快取中獲取歷史聊天記錄的存取時間;刪除單元,用於當滿足觸發條件時,根據該存取時間確定最近最少使用的歷史聊天記錄,從快取中刪除該歷史聊天記錄。 In some implementations, the device further includes: a fourth storage unit configured to store an access time for obtaining historical chat records from the cache; and a delete unit configured to determine a latest time according to the access time when a trigger condition is satisfied. Least used history chat, delete this history chat from cache.

在一些實施方式中,該裝置還包括:發送單元,用於當接收到特定使用者向當前使用者發送的即時消息時,判斷該即時消息的數量或者容量是否小於設定閾值;若判斷結果為是,發送獲取當前使用者與特定使用者間的歷史聊 天記錄的請求。 In some embodiments, the device further includes: a sending unit, configured to determine whether the quantity or capacity of the instant message is less than a set threshold when the instant message sent by the specific user to the current user is received; if the determination result is yes To send a request to get the historical chat history between the current user and a specific user.

在一些實施方式中,該展示單元具體用於:響應於使用者觸發顯示該即時消息的請求,將該即時消息與該歷史聊天記錄合併顯示。 In some embodiments, the display unit is specifically configured to: in response to a user triggering a request to display the instant message, display the instant message in combination with the historical chat record.

在一些實施方式中,該獲取單元包括:第三判斷單元,用於判斷快取中儲存的當前使用者與特定使用者間的歷史聊天記錄的數量或者容量是否大於設定閾值;第六讀取單元,用於若判斷結果為是,直接從快取中讀取數量或者容量與設定閾值相等的歷史聊天記錄;第七讀取單元,用於從本地儲存空間中讀取部分歷史聊天記錄,並儲存到快取中,使得快取中的歷史聊天記錄的數量或者容量大於或者等於設定閾值。 In some embodiments, the obtaining unit includes: a third determining unit, configured to determine whether the number or capacity of historical chat records stored in the cache between the current user and a specific user is greater than a set threshold; a sixth reading unit , If the judgment result is yes, directly read the history chat records with the same amount or capacity as the set threshold from the cache; the seventh reading unit is used to read part of the historical chat records from the local storage space and store In the cache, the number or capacity of historical chat records in the cache is greater than or equal to a set threshold.

第四方面,本發明實施例還提供了一種即時聊天工具的聊天記錄處理裝置,包括:接收單元,用於接收使用者觸發第一控件的操作;顯示單元,用於應於使用者觸發第一控件的操作,顯示當前使用者與特定使用者間的至少部分歷史聊天記錄;其中,該至少部分歷史聊天記錄中的各條聊天記錄之間不具有時間連續關係或者該至少部分歷史聊天記錄與當前即時聊天工具最近展示的聊天記錄之間不具有時間連續關係。 According to a fourth aspect, an embodiment of the present invention further provides a chat record processing device for an instant chat tool, including: a receiving unit for receiving an operation of triggering a first control by a user; and a display unit for triggering the first trigger when the user triggers the first control The operation of the control displays at least part of the historical chat record between the current user and the specific user; wherein, each chat record in the at least part of the historical chat record does not have a continuous relationship in time or the at least part of the historical chat record and the current user There is no time continuous relationship between the chat records recently displayed by the instant chat tool.

第五方面,本發明實施例還提供了一種用於即時聊天工具的聊天記錄處理的裝置,包括有記憶體,以及一個或者一個以上的程式,其中一個或者一個以上程式儲存於記憶體中,且經配置以由一個或者一個以上處理器執行該一 個或者一個以上程式包含用於進行以下操作的指令:響應於獲取當前使用者與特定使用者間的歷史聊天記錄的請求,從快取中讀取當前使用者與特定使用者間的歷史聊天記錄;其中,該快取中保存有預先從本地儲存空間中讀取的歷史聊天記錄以及直接儲存在該快取的歷史聊天記錄;展示該當前使用者與特定使用者間的歷史聊天記錄。 According to a fifth aspect, an embodiment of the present invention further provides a device for processing a chat record of an instant chat tool, which includes a memory and one or more programs, where one or more programs are stored in the memory, and Configured to be executed by one or more processors, the one or more programs include instructions for reading from a cache in response to a request to obtain a historical chat history between the current user and a particular user Historical chat records between the current user and a specific user; wherein the cache stores historical chat records read from the local storage space in advance and historical chat records directly stored in the cache; displaying the current user History of chats with specific users.

第六方面,本發明實施例還提供了一種用於即時聊天工具的聊天記錄處理的裝置,包括有記憶體,以及一個或者一個以上的程式,其中一個或者一個以上程式儲存於記憶體中,且經配置以由一個或者一個以上處理器執行該一個或者一個以上程式包含用於進行以下操作的指令:接收使用者觸發第一控件的操作;響應於使用者觸發第一控件的操作,顯示當前使用者與特定使用者間的至少部分歷史聊天記錄;其中,該至少部分歷史聊天記錄中的各條聊天記錄之間不具有時間連續關係或者該至少部分歷史聊天記錄與當前即時聊天工具最近展示的聊天記錄之間不具有時間連續關係。 According to a sixth aspect, an embodiment of the present invention further provides a device for processing a chat record of an instant chat tool, which includes a memory and one or more programs, where one or more programs are stored in the memory, and Configured to be executed by one or more processors, the one or more programs include instructions for: receiving an operation of the user to trigger the first control; and responding to the operation of the user to trigger the first control, displaying the current use At least part of the historical chat record between the user and the specific user; wherein each chat record in the at least part of the historical chat record does not have a continuous relationship in time or the at least part of the historical chat record and the chat recently displayed by the current real-time chat tool There is no time-continuous relationship between records.

本發明實施例提供的即時聊天工具的聊天記錄處理方法及裝置,可以預先從本地儲存空間中讀取當前使用者與特定使用者間的歷史聊天記錄,並將其保存在快取中,當接收到獲取當前使用者與特定使用者間的歷史聊天記錄的請求時,直接從快取中讀取歷史聊天記錄,大大提高了獲取聊天記錄的速度。此外,由於只需要從磁碟中讀取一次資料,並將其儲存在快取中供使用者存取,降低了對磁碟 的損耗,提高了資料處理和響應速度。 The chat record processing method and device of the instant chat tool provided by the embodiments of the present invention can read the historical chat record between the current user and a specific user from the local storage space in advance, and save it in the cache. When a request for obtaining the historical chat record between the current user and a specific user is made, the historical chat record is directly read from the cache, which greatly improves the speed of obtaining the chat record. In addition, since the data needs to be read from the disk only once and stored in the cache for user access, the loss of the disk is reduced and the data processing and response speed is improved.

100‧‧‧顯示界面 100‧‧‧display interface

101~104‧‧‧消息 101 ~ 104‧‧‧ news

105‧‧‧第二控件 105‧‧‧Second Control

106‧‧‧第一控件 106‧‧‧The first control

107‧‧‧聊天記錄 107‧‧‧ chat history

200‧‧‧快取 200‧‧‧cache

700、800‧‧‧聊天記錄處理裝置 700, 800‧‧‧ chat record processing device

701‧‧‧獲取單元 701‧‧‧ Acquisition Unit

702‧‧‧展示單元 702‧‧‧Display Unit

801‧‧‧接收單元 801‧‧‧Receiving unit

802‧‧‧顯示單元 802‧‧‧display unit

901‧‧‧處理器 901‧‧‧ processor

902‧‧‧記憶體 902‧‧‧Memory

903‧‧‧通信匯流排 903‧‧‧communication bus

S201、S202‧‧‧步驟 Steps S201, S202‧‧‧‧

S301~S307‧‧‧步驟 S301 ~ S307‧‧‧ steps

S401~S407‧‧‧步驟 S401 ~ S407‧‧‧step

S501、S502‧‧‧步驟 S501, S502‧‧‧ steps

為了更清楚地說明本發明實施例或現有技術中的技術方案,下面將對實施例或現有技術描述中所需要使用的圖式作簡單地介紹,顯而易見地,下面描述中的圖式僅僅是本發明中記載的一些實施例,對於本領域普通技術人員來講,在不付出創造性勞動的前提下,還可以根據這些圖式獲得其他的圖式。 In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings in the following description are only For some ordinary people skilled in the art, some embodiments described in the invention can also obtain other drawings based on these drawings without paying creative labor.

圖1為本發明實施例可以應用的一個示意性應用場景;圖2為本發明一實施例提供的即時聊天工具的聊天記錄處理方法流程圖;圖3為本發明另一實施例提供的即時聊天工具的聊天記錄處理方法流程圖;圖4為本發明再一實施例提供的即時聊天工具的聊天記錄處理方法流程圖;圖5為本發明又一實施例提供的即時聊天工具的聊天記錄處理方法流程圖;圖6A、圖6B、圖6C為本發明實施例的效果示意圖;圖7為本發明一實施例提供的即時聊天工具的聊天記錄處理裝置示意圖;圖8為本發明另一實施例提供的即時聊天工具的聊天記錄處理裝置示意圖 圖9是根據一示例性實施例示出的一種用於即時聊天工具的聊天記錄處理裝置的示意圖。 FIG. 1 is a schematic application scenario applicable to an embodiment of the present invention; FIG. 2 is a flowchart of a method for processing a chat record of an instant chat tool provided by an embodiment of the present invention; FIG. 3 is an instant chat provided by another embodiment of the present invention A flowchart of a method for processing a chat record of a tool; FIG. 4 is a flowchart of a method for processing a chat record of an instant chat tool provided by another embodiment of the present invention; FIG. 5 is a method of processing a chat record of an instant chat tool provided by another embodiment of the present invention FIG. 6A, FIG. 6B, and FIG. 6C are schematic diagrams of effects of the embodiment of the present invention; FIG. 7 is a schematic diagram of a chat record processing device of an instant chat tool provided by an embodiment of the present invention; and FIG. 8 is provided by another embodiment of the present invention FIG. 9 is a schematic diagram of a chat record processing device for an instant chat tool according to an exemplary embodiment. FIG. 9 is a schematic diagram of a chat record processing device for an instant chat tool according to an exemplary embodiment.

本發明實施例提供了一種即時聊天工具的聊天記錄處理方法及裝置,可以從快取中快速讀取歷史聊天記錄,減少磁碟資源的消耗,提高了獲取聊天記錄的效率。 Embodiments of the present invention provide a method and a device for processing a chat record of an instant chat tool, which can quickly read historical chat records from a cache, reduce the consumption of magnetic disk resources, and improve the efficiency of obtaining chat records.

為了使本技術領域的人員更好地理解本發明中的技術方案,下面將結合本發明實施例中的圖式,對本發明實施例中的技術方案進行清楚、完整地描述,顯然,所描述的實施例僅僅是本發明一部分實施例,而不是全部的實施例。基於本發明中的實施例,本領域普通技術人員在沒有做出創造性勞動前提下所獲得的所有其他實施例,都應當屬於本發明保護的範圍。 In order to enable those skilled in the art to better understand the technical solutions in the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described in combination with the drawings in the embodiments of the present invention. Obviously, the described The embodiments are only a part of the embodiments of the present invention, but not all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by a person of ordinary skill in the art without creative efforts should fall within the protection scope of the present invention.

參見圖1,為本發明實施例的示例性應用場景。本發明實施例提供的方法和裝置可以應用於如圖1所示的場景,其中,即時聊天工具可以在顯示界面100中展示從當前使用者從特定使用者收到的新消息103、104,還可以同時展示歷史聊天記錄中的消息101、消息102。其中,本發明實施例提供的方法和裝置可以從快取200中讀取當前使用者與特定使用者間的歷史聊天記錄,提高資料的獲取速度,減少對本地磁碟的損耗。需要注意的是,上述應用場景僅是為了便於理解本發明而示出,本發明的實施方式在此方面不受任何限制。相反,本發明的實施方式可以應用 於適用的任何場景。 Refer to FIG. 1, which is an exemplary application scenario of an embodiment of the present invention. The method and device provided by the embodiment of the present invention can be applied to the scenario shown in FIG. 1, where the instant chat tool can display the new message 103, 104 received from the current user from the specific user in the display interface 100, and also Messages 101 and 102 in the historical chat history can be displayed at the same time. The method and device provided by the embodiments of the present invention can read the historical chat records between the current user and a specific user from the cache 200, improve the speed of data acquisition, and reduce the loss of the local magnetic disk. It should be noted that the above application scenarios are shown only for the convenience of understanding the present invention, and the embodiments of the present invention are not limited in this regard. Rather, the embodiments of the invention can be applied to any scenario where applicable.

需要說明的是,本發明涉及的技術術語“即時聊天工具”一般是指可以在兩名或多名使用者之間傳遞即時消息的應用程式,例如阿里旺旺、QQ、微信、MSN等。 It should be noted that the technical term "instant chat tool" in the present invention generally refers to an application program that can transfer instant messages between two or more users, such as Ali Wangwang, QQ, WeChat, MSN, and so on.

本發明涉及的技術術語“當前使用者”一般是指登錄當前即時聊天工具客戶端、與當前即時聊天工具客戶端的賬號對應的使用者,“特定使用者”是指與當前使用者進行即時通訊的另一使用者。舉例說明,當前使用者為使用者A,特定使用者可以是與其使用即時聊天工具聊天的另一使用者B。 The technical term "current user" referred to in the present invention generally refers to a user who logs in to the current instant chat tool client and corresponds to an account of the current instant chat tool client, and "specific user" refers to an instant communication with the current user. Another user. For example, the current user is user A, and the specific user may be another user B with whom the real-time chat tool is used for chatting.

本發明涉及的技術術語“歷史聊天記錄”一般是指使用者查看過的聊天記錄,“新即時消息”或者“未讀即時消息”一般是指另一使用者發送的、當前使用者未查看或者閱讀的即時消息。 The technical term "historical chat record" referred to in the present invention generally refers to a chat record that a user has viewed, and "new instant message" or "unread instant message" generally refers to a message sent by another user that the current user has not viewed or Read the instant message.

本發明涉及的技術術語“快取”(cache)一般是指儲存在計算設備中可以進行高速資料交換的記憶體,一般區別於磁碟等記憶體。 The technical term “cache” referred to in the present invention generally refers to a memory stored in a computing device that can perform high-speed data exchange, and is generally different from a memory such as a magnetic disk.

本發明涉及的技術術語“LRU”的英文全稱為Least Recently Used,中文全稱為最近最少使用。 The technical term "LRU" in the present invention is called Least Recently Used in English, and it is called Least Recently Used in Chinese.

本發明涉及的技術術語“圖片標識”是指圖片的唯一標識ID。在本發明實施例中,可以使用圖片內容的MD5值作為圖片ID,在聊天記錄中使用圖片ID標識圖片。 The technical term "picture identification" according to the present invention refers to a unique identification ID of a picture. In the embodiment of the present invention, the MD5 value of the picture content can be used as the picture ID, and the picture ID is used to identify the picture in the chat record.

本發明涉及的技術術語“MD5”的英文全稱為Message Digest Algorithm 5,中文全稱為資訊摘要算法 5,又可以稱之為摘要算法、哈希算法,是一種確保資訊傳輸完整一致的雜湊算法。 The technical term "MD5" in the present invention is called Message Digest Algorithm 5 in English, and it is also called Digest Algorithm 5 in Chinese. It can also be called a digest algorithm and a hash algorithm. It is a hash algorithm that ensures the integrity and consistency of information transmission.

當然,以上術語僅為解釋性說明,不視為對本發明的限制。 Of course, the above terms are merely explanatory descriptions, and are not to be considered as limiting the present invention.

下面將結合圖式2至圖式6對本發明示例性實施例示出的即時聊天工具的聊天記錄處理方法進行介紹。 The following describes the chat record processing method of the instant chat tool according to the exemplary embodiment of the present invention with reference to FIG. 2 to FIG. 6.

參見圖2,為本發明一實施例提供的即時聊天工具的聊天記錄處理方法流程圖。如圖2所示,可以包括: S201,響應於獲取當前使用者與特定使用者間的歷史聊天記錄的請求,從快取中讀取當前使用者與特定使用者間的歷史聊天記錄。 2 is a flowchart of a method for processing a chat record of an instant chat tool according to an embodiment of the present invention. As shown in FIG. 2, it may include: S201. In response to a request for obtaining a historical chat record between a current user and a specific user, read a historical chat record between the current user and a specific user from a cache.

在一些實施方式中,該獲取當前使用者與特定使用者間的歷史聊天記錄的請求具體可以是觸發顯示當前使用者與特定使用者間的歷史聊天記錄的請求。舉例說明,當使用者點擊“顯示更多消息”或者“獲取歷史聊天記錄”等控件或者按鈕時,則發送了觸發顯示當前使用者與特定使用者間的歷史聊天記錄的請求。又舉例說明,當使用者在當前使用者與特定使用者的聊天窗口中,使用鼠標向下滾動屏幕時,也可以發送觸發顯示當前使用者與特定使用者間的歷史聊天記錄的請求。需要說明的是,使用者可以通過多種操作發送觸發顯示當前使用者與特定使用者間的歷史聊天記錄的請求,具體實現方式可以是靈活多樣的,在此不進行限制。 In some implementations, the request for obtaining a historical chat record between the current user and a specific user may specifically be a request for triggering the display of the historical chat record between the current user and a specific user. For example, when a user clicks on a control or button such as "Show more messages" or "Get historical chat history", a request is triggered to display the historical chat history between the current user and a specific user. As another example, when the user scrolls down the screen with the mouse in the chat window between the current user and the specific user, a request to trigger the display of the historical chat history between the current user and the specific user can also be sent. It should be noted that the user may send a request to trigger the display of the historical chat record between the current user and the specific user through various operations. The specific implementation manner may be flexible and diverse, and is not limited herein.

在一些實施方式中,該獲取當前使用者與特定使用者 間的歷史聊天記錄的請求還可以是觸發顯示當前使用者與特定使用者間的未讀即時消息的請求。舉例說明,當使用者通過打開聊天工具中與特定使用者的聊天窗口的操作,觸發顯示未讀即時消息時,可以確定發送了獲取當前使用者與特定使用者間的歷史聊天記錄的請求。又舉例說明,若使用者關閉了與特定使用者的聊天窗口,當接收到特定使用者發送到向當前使用者發送的即時消息時,即時聊天工具可以顯示提示資訊,提示使用者存在未讀消息。當使用者點擊該提示消息以觸發顯示該未讀消息時,可以確定發送了獲取當前使用者與特定使用者間的歷史聊天記錄的請求。需要說明的是,在一些實施方式中,在接收到觸發顯示當前使用者與特定使用者間的未讀即時消息的請求後,還可以判斷該未讀即時消息的數量或者容量是否小於設定閾值;若判斷結果為是,則確定發送獲取當前使用者與特定使用者間的歷史聊天記錄的請求。其中,該設定閾值可以根據需要設定,例如該設定閾值可以是即時聊天工具的顯示界面顯示消息的數量或者容量的上限。其中,消息的容量可以是指消息包含的資訊的字數、行數或者所占空間等。舉例說明,假設當前使用者A關閉了與使用者B的聊天窗口,當接收到使用者B發送給使用者A的新消息時,可以判斷新消息的數量或者容量是否大於顯示界面顯示消息的上限;若判斷結果為否,則獲取歷史聊天記錄,以便將新消息與歷史聊天記錄合併展示,方便使用者快速地獲取上下文資訊,方便使用者交流。 In some implementations, the request for obtaining a historical chat record between the current user and the specific user may also be a request for triggering the display of unread instant messages between the current user and the specific user. For example, when a user opens a chat window with a specific user in a chat tool and triggers the display of an unread instant message, it can be determined that a request for obtaining a historical chat record between the current user and the specific user is sent. As another example, if the user closes the chat window with a specific user, when receiving an instant message sent by the specific user to the current user, the instant chat tool can display prompt information to remind the user that there are unread messages . When the user clicks the prompt message to trigger the display of the unread message, it can be determined that a request for obtaining a historical chat record between the current user and a specific user is sent. It should be noted that, in some implementations, after receiving a request to trigger the display of unread instant messages between the current user and a specific user, it may also be determined whether the number or capacity of the unread instant messages is less than a set threshold; If the determination result is yes, it is determined to send a request for obtaining a historical chat record between the current user and a specific user. The setting threshold may be set according to requirements. For example, the setting threshold may be an upper limit of the number or capacity of messages displayed on a display interface of the instant chat tool. The capacity of a message may refer to the number of words, lines, or space occupied by the information contained in the message. For example, suppose the current user A closes the chat window with user B. When receiving a new message from user B to user A, you can determine whether the number or capacity of the new message is greater than the upper limit of the message displayed on the display interface. ; If the judgment result is no, obtain historical chat records, so that new messages and historical chat records can be combined and displayed, so that users can quickly obtain contextual information and facilitate user communication.

在一些實施方式中,該獲取當前使用者與特定使用者間的歷史聊天記錄的請求還可以是接收到特定使用者發送到向當前使用者發送的即時消息且判斷該即時消息的數量或者容量小於設定閾值時,則發送獲取當前使用者與特定使用者間的歷史聊天記錄的請求。舉例說明,不同於響應於使用者觸發顯示未讀消息的請求來獲取歷史聊天記錄,在這一實施方式中,是獲取到新的未讀消息時且判斷該消息符合預設條件時,則觸發獲取歷史聊天記錄的請求。 In some implementations, the request for obtaining historical chat records between the current user and a specific user may also be receiving an instant message sent by the specific user to the current user and determining that the quantity or capacity of the instant message is less When the threshold is set, a request is sent to obtain the historical chat history between the current user and a specific user. For example, it is different from acquiring historical chat records in response to a user triggering a request to display an unread message. In this embodiment, when a new unread message is obtained and it is determined that the message meets a preset condition, it is triggered. Request to get historical chat history.

在一些實施方式中,該從快取中讀取當前使用者與特定使用者間的歷史聊天記錄包括:判斷是否從本地儲存空間讀取過該當前使用者與特定使用者間的歷史聊天記錄;若判斷結果為是,從快取中讀取當前使用者與特定使用者間的歷史聊天記錄。進一步地,該方法還包括:若判斷結果為否,從本地儲存空間讀取該當前使用者與特定使用者間的歷史聊天記錄,將讀取的該聊天記錄儲存在快取中,記錄已從本地儲存空間讀取過該當前使用者與特定使用者間的歷史聊天記錄。舉例說明,當接收到獲取歷史聊天記錄的請求時,可以判斷是否從本地儲存空間中讀取過該聊天記錄。例如,可以設置標識用於區分是否從本地讀取過聊天記錄。若根據設置的標識判斷從本地儲存空間讀取過該聊天記錄,則直接從快取中讀取聊天記錄。若根據設置的標識判斷未從本地儲存空間讀取過聊天記錄,則可以從本地儲存空間讀取聊天記錄並將其儲存到快取中。進一步地,設置標識用於表明已從本地儲存空間讀取過聊天記 錄。當再次接收到獲取聊天記錄的請求時,則可以直接從快取中獲取聊天記錄。由於僅僅在標識未從本地儲存空間讀取聊天記錄時存取本地儲存空間,其他場景均從快取中讀取聊天記錄,大大提高了獲取聊天記錄的速度,並降低了對本地儲存空間的損耗。 In some embodiments, the reading the historical chat records between the current user and the specific user from the cache includes: determining whether the historical chat records between the current user and the specific user have been read from the local storage space; If the determination result is yes, the historical chat history between the current user and the specific user is read from the cache. Further, the method further includes: if the determination result is no, reading the historical chat record between the current user and the specific user from a local storage space, storing the read chat record in a cache, and recording the record from The local storage space has read the historical chat records between the current user and the specific user. For example, when receiving a request for obtaining historical chat records, it can be determined whether the chat records have been read from the local storage space. For example, an identifier can be set to distinguish whether the chat history has been read locally. If it is judged that the chat record has been read from the local storage space according to the set identifier, the chat record is directly read from the cache. If it is determined according to the set identifier that the chat history has not been read from the local storage space, the chat history may be read from the local storage space and stored in the cache. Further, the setting identifier is used to indicate that the chat record has been read from the local storage space. When the request for obtaining the chat history is received again, the chat history can be obtained directly from the cache. Since the local storage space is accessed only when the identity is not read from the local storage space, the chat history is read from the cache in other scenarios, which greatly improves the speed of obtaining chat records and reduces the loss of local storage space. .

在一些實施方式中,該方法還包括:當確定滿足觸發條件時,預先從本地儲存空間中讀取當前使用者與特定使用者間的歷史聊天記錄,將讀取的該聊天記錄保存在快取中。在這一實現方式中,可以預先從本地儲存空間中讀取歷史聊天記錄,並將其保存在快取中。當接收到獲取聊天記錄的請求時,每次均從快取中獲取聊天記錄。其中,預先獲取歷史聊天記錄的時機可以是滿足觸發條件,具體的觸發條件可以是非常靈活的,只要是在接收到獲取聊天記錄請求之前,從本地儲存空間一次性獲取歷史聊天記錄即可。舉例說明,當接收到特定使用者發送給當前使用者的即時消息時,可以確定滿足觸發條件。又舉例說明,當接收到使用者觸發顯示當前使用者與特定使用者的聊天窗口的操作時,確定滿足觸發條件。當然以上僅為示例性說明,具體的觸發條件可以是靈活多樣的,只要是在接收到獲取聊天記錄請求之前,從本地儲存空間一次性獲取歷史聊天記錄即可。 In some embodiments, the method further includes: when it is determined that the trigger condition is satisfied, previously reading a historical chat record between the current user and a specific user from a local storage space, and saving the read chat record in a cache in. In this implementation, historical chat records can be read from the local storage space in advance and saved in the cache. When receiving a request to obtain a chat history, the chat history is obtained from the cache every time. The timing for pre-acquiring the historical chat record may be a trigger condition, and the specific trigger condition may be very flexible, as long as the historical chat record is obtained from the local storage space at one time before receiving the request for acquiring the chat record. For example, when receiving an instant message sent by a specific user to the current user, it can be determined that the trigger condition is satisfied. By way of example, when a user triggers an operation to display a chat window between the current user and a specific user, it is determined that the trigger condition is satisfied. Of course, the above is only an exemplary description, and the specific triggering conditions may be flexible and diverse, as long as the historical chat records are obtained from the local storage space at one time before receiving the request for obtaining the chat records.

在一些實施方式中,該從快取中讀取當前使用者與特定使用者間的歷史聊天記錄包括:判斷快取中儲存的當前使用者與特定使用者間的歷史聊天記錄的數量或者容量是 否大於設定閾值;若判斷結果為是,直接從快取中讀取數量或者容量與設定閾值相等的歷史聊天記錄;若判斷為否,從本地儲存空間中讀取部分歷史聊天記錄,並儲存到快取中,使得快取中的歷史聊天記錄的數量或者容量大於或者等於設定閾值。舉例說明,當使用者點擊“查看更多”時,可以觸發加載N條歷史消息。其中,N的設置可以根據需要進行。這時,找到聊天會話的最上面的一條消息(一般距離當前時間最長的一條消息),然後以這條消息為邊界,從快取中向前讀取N條歷史消息記錄。具體地,若快取中歷史消息記錄足夠,即大於或者等於N,則直接將讀取的歷史聊天記錄顯示到聊天會話的最上面。若判斷快取中保存的歷史消息記錄小於N條,假設符合條件的快取中消息為M條,從本地歷史紀錄中,以快取中第一條消息記錄為邊界,向前讀取(N-M)條,並存入快取中。而後,找到聊天會話的最上面的一條消息,然後以這條消息為邊界,從快取中向前讀取N條消息記錄並展示。 In some implementations, reading the historical chat records between the current user and the specific user from the cache includes: determining whether the number or capacity of historical chat records between the current user and the specific user stored in the cache is Is greater than the set threshold; if the result of the judgment is yes, historical chat records with a quantity or capacity equal to the set threshold are directly read from the cache; if no, the historical chat records are read from the local storage space and stored in the cache Picking, so that the number or capacity of historical chat records in the cache is greater than or equal to a set threshold. For example, when the user clicks "View more", it can trigger loading of N historical messages. The setting of N can be performed as required. At this time, find the top message of the chat session (the message that is generally the longest from the current time), and then use this message as the boundary to read N historical message records forward from the cache. Specifically, if the history message record in the cache is sufficient, that is, greater than or equal to N, the read historical chat record is directly displayed on the top of the chat session. If it is judged that the history message record saved in the cache is less than N, it is assumed that the eligible cache message is M, and from the local history record, the first message record in the cache is used as the boundary and read forward (NM ), And stored in the cache. Then, find the top message of the chat session, and then use this message as the boundary to read N message records forward from the cache and display them.

在一些實施方式中,該方法還包括:當確定該歷史聊天記錄包含圖片時,根據該圖片的標識判斷快取中是否儲存有與該圖片的標識對應的圖片;若判斷結果為是,從快取中獲取與該圖片標識對應的圖片。進一步地,若判斷結果為否,從本地儲存空間中獲取該圖片,在快取中儲存該圖片以及圖片與圖片標識的對應關係。舉例說明,在本發明具體實現時,在保存聊天記錄時,若該聊天記錄包含圖片,則僅在聊天記錄中保存圖片的標識,用於標識圖片。 進一步地,本發明可以設置圖片快取,用於儲存圖片ID對應的圖片資料。在獲取歷史聊天記錄時,若判斷該聊天記錄包含圖片,例如聊天記錄包含圖片ID時,則可以根據圖片ID判斷圖片快取中是否儲存有與該圖片ID對應的圖片;若判斷結果為是,則直接獲取圖片內容進行展示,由此大大提高了獲取圖片的速度,而無需每次均從本地儲存空間下載該圖片。若不存在,則從本地儲存空間中讀取該圖片,並將其保存在圖片快取中。由於即時聊天工具的聊天記錄中的圖片經常是重複的,例如各種表情圖片,因此,只需要在圖片快取中保存圖片以及圖片標識與圖片的對應關係,即可以在獲取相同圖片時,從快取中直接讀取該圖片,並且相同圖片標識的圖片僅在快取中保存一次,減少了儲存空間的浪費。其中,圖片的標識可以通過獲取圖片的MD5值獲取。需要說明的是,通過上述處理,可以單獨提高圖片資訊的獲取和展示速度,而無需每次均從本地磁碟中讀取圖片。 In some embodiments, the method further includes: when determining that the historical chat record contains a picture, determining whether a picture corresponding to the picture identifier is stored in the cache according to the picture identifier; if the determination result is yes, starting from the fast Take the picture to get the picture corresponding to the picture ID. Further, if the determination result is no, the picture is obtained from the local storage space, and the picture and the correspondence between the picture and the picture identifier are stored in the cache. For example, when the present invention is specifically implemented, when the chat record is saved, if the chat record contains a picture, only the picture identifier is saved in the chat record for identifying the picture. Further, the present invention may set a picture cache for storing picture data corresponding to the picture ID. When obtaining the historical chat record, if it is determined that the chat record contains a picture, for example, when the chat record contains a picture ID, it can be determined whether the picture corresponding to the picture ID is stored in the picture cache according to the picture ID; if the determination result is yes, The content of the picture is directly obtained for display, thereby greatly improving the speed of obtaining the picture without having to download the picture from the local storage space each time. If it does not exist, read the picture from local storage and save it in the picture cache. Because the pictures in the chat history of the instant chat tool are often duplicated, such as various emoticon pictures, you only need to save the picture in the picture cache and the corresponding relationship between the picture ID and the picture, that is, when you obtain the same picture, you can quickly The picture is directly read in the selection, and the picture with the same picture ID is saved only once in the cache, which reduces the waste of storage space. The picture ID can be obtained by obtaining the MD5 value of the picture. It should be noted that, through the above processing, the speed of obtaining and displaying picture information can be increased independently, without having to read pictures from the local disk each time.

S202,展示該當前使用者與特定使用者間的歷史聊天記錄。 S202: Display historical chat records between the current user and a specific user.

需要說明的是,具體實現時,可以將歷史聊天記錄單獨展示。也可以是將其與未讀即時消息合併展示。例如,可以響應於使用者觸發顯示該即時消息的請求,將該即時消息與該歷史聊天記錄合併顯示。 It should be noted that, during specific implementation, the historical chat records can be displayed separately. It can also be combined with unread instant messages. For example, in response to a user triggering a request to display the instant message, the instant message and the historical chat record are combined and displayed.

在一些實施方式中,該方法還包括:保存從快取中獲取歷史聊天記錄的存取時間;當滿足觸發條件時,根據該 存取時間確定最近最少使用的歷史聊天記錄,從快取中刪除該歷史聊天記錄。舉例說明,若當前使用者的聊天記錄較多時,會造成快取中儲存的聊天記錄和圖片較多,佔用計算機記憶體,為了減少記憶體佔用,可以在每次存取快取時,標識當前使用者獲取特定使用者的聊天記錄的存取時間;並可以觸發判斷當前快取資料是否超出快取上限且該快取中不存在未讀新消息,若是,則根據該存取時間確定最近最少使用的聊天記錄,從快取中刪除該聊天記錄。該最近最少使用的聊天記錄可以是存取時間距離當前時間超過設定閾值的記錄,也可以是在預設時間內存取次數最少的聊天記錄。通過上述處理,可以有效減少記憶體佔用、降低記憶體開銷。 In some embodiments, the method further includes: saving an access time for obtaining historical chat records from the cache; when a trigger condition is satisfied, determining the least recently used historical chat records according to the access time, and deleting from the cache The history chat. For example, if the current user has a lot of chat records, it will cause more chat records and pictures stored in the cache, occupying computer memory. In order to reduce the memory occupation, you can identify the The access time for the current user to obtain the chat history of a specific user; and it can trigger to determine whether the current cache data exceeds the cache limit and there are no unread new messages in the cache. If so, the latest time is determined based on the access time Least used chat history, delete it from cache. The least recently used chat record may be a record whose access time exceeds a set threshold from the current time, or may be a chat record with the least number of accesses within a preset time. Through the above processing, memory occupation and memory overhead can be effectively reduced.

在一些實施方式中,該從快取中讀取當前使用者與特定使用者間的歷史聊天記錄包括:從快取中讀取當前使用者與特定使用者間符合特定條件的部分歷史聊天記錄;該特定條件包括符合特定時間條件、特定地點條件或者符合特定關鍵詞的歷史聊天記錄;該展示該當前使用者與特定使用者間的歷史聊天記錄包括:展示該部分歷史聊天記錄,其中,該部分歷史聊天記錄中的各條聊天記錄之間不具有時間連續關係或者該歷史聊天記錄與當前即時聊天工具最近展示的聊天記錄不具有時間連續關係。具體實現時,取代獲取當前使用者與特定使用者間全部聊天記錄並按照時間先後順序連續展示聊天記錄的方式,可以僅獲取並展示符合特定條件的部分歷史聊天記錄。舉例說明,例 如符合特定時間條件的歷史聊天記錄。假設當前時間是週五,當前使用者A與特定使用者B正在通過即時聊天工具聊天。使用者B提到:“咱們週二提到的事情處理的怎麼樣了”,這時使用者A很有可能想要看看週二的聊天記錄,這時可以將“週二”確定為關鍵詞,僅從快取中獲取週二對應的歷史聊天記錄,並在聊天界面中展示週二的聊天記錄。這樣,週二的聊天記錄和當前窗口展示的最近聊天記錄(週五)即不具有時間連續關係。通過這樣的方式,不僅可以獲取更少的資料,而且方便使用者直觀地查看感興趣的內容,而無需在大量的聊天記錄(例如週五至週二這一連續時間段內的所有聊天記錄)中查找感興趣的內容。又舉例說明,該聊天記錄還可以是符合特定地點條件的聊天記錄。假設當前使用者頻繁出差會改變登錄地點,也可以根據使用者的輸入獲取特定地點的聊天記錄。再舉例說明,該部分歷史聊天記錄還可以是與特定關鍵詞匹配的聊天記錄。其中,在對關鍵詞匹配時可以是完全匹配也可以是部分匹配,可以是精確匹配也可以是模糊匹配。進一步地,還可以使用機器學習算法進行人工智慧自動匹配。舉例說明,使用者B提到“請問XX事宜處理得如何”,這時可以確定關鍵詞“XX”,查找到與之匹配的聊天記錄。若針對關鍵詞“XX”,存在多條聊天記錄,可以將其合併顯示。例如當前時間是週五,分別在週二、週三都存在相關聯的聊天記錄,則可以以時間的倒序,展示週三、週二的聊天記錄。這時,展示的該部分歷史聊天 記錄中的各條聊天記錄之間不具有時間連續關係。 In some implementation manners, the reading the historical chat records between the current user and the specific user from the cache includes: reading from the cache a part of the historical chat records between the current user and the specific user that meets specific conditions; The specific condition includes a historical chat record that meets a specific time condition, a specific location condition, or a specific keyword; the display of the historical chat record between the current user and the specific user includes: a display of the part of the historical chat record, wherein the part Each chat record in the historical chat record does not have a time-continuous relationship or the historical chat record does not have a time-continuous relationship with the recently displayed chat record of the current instant chat tool. In specific implementation, instead of obtaining all chat records between the current user and a specific user and continuously displaying the chat records in chronological order, only part of the historical chat records that meet specific conditions can be obtained and displayed. Examples are historical chats that meet certain time conditions. Assume that the current time is Friday, and the current user A and the specific user B are chatting through the instant chat tool. User B mentioned: "How are we doing on Tuesday?" At this time, User A is likely to want to see Tuesday ’s chat history. At this time, "Tuesday" can be identified as a keyword. Only get the historical chat history corresponding to Tuesday from the cache, and display the chat history of Tuesday in the chat interface. In this way, the chat history on Tuesday and the most recent chat history (Friday) displayed in the current window do not have a time continuous relationship. In this way, not only can you get less information, but also it is convenient for users to intuitively view the content of interest without having to have a large number of chat records (such as all chat records in the continuous time period from Friday to Tuesday) Find what you ’re interested in. As another example, the chat record may also be a chat record that meets the conditions of a specific place. Assuming that the current user frequently travels on a business trip, the login location may be changed, and the chat history of a specific place may be obtained according to the user's input. By way of example, this part of the historical chat record can also be a chat record that matches a specific keyword. Among them, the keyword match may be an exact match or a partial match, and may be an exact match or a fuzzy match. Further, artificial intelligence can be automatically matched using a machine learning algorithm. For example, user B mentioned "How is XX handled?" At this time, the keyword "XX" can be determined, and a matching chat history can be found. If there are multiple chat records for the keyword "XX", they can be combined and displayed. For example, if the current time is Friday and there are associated chat records on Tuesday and Wednesday, the chat records on Wednesday and Tuesday can be displayed in reverse order of time. At this time, there is no time-continuous relationship between the chat records in this part of the historical chat records displayed.

為了便於本領域技術人員更清楚地理解本發明在具體場景下的實施方式,下面以兩個具體示例對本發明實施方式進行介紹。需要說明的是,該具體示例僅為使得本領域技術人員更清楚地瞭解本發明,但本發明的實施方式不限於該具體示例。 In order to facilitate a person skilled in the art to more clearly understand the implementation manner of the present invention in a specific scenario, the following describes the implementation manner of the present invention by using two specific examples. It should be noted that this specific example is only to enable those skilled in the art to understand the present invention more clearly, but the embodiments of the present invention are not limited to this specific example.

參見圖3,為本發明另一實施例提供的即時聊天工具的聊天記錄處理方法流程圖。如圖3所示,可以包括: S301,即時聊天工具接收特定使用者發送給當前使用者的新消息。 3 is a flowchart of a method for processing a chat record of an instant chat tool according to another embodiment of the present invention. As shown in FIG. 3, the method may include: S301. The instant chat tool receives a new message sent by a specific user to a current user.

舉例說明,假設使用者A在即時聊天工具登錄後,收到使用者B發送的新消息。 For example, suppose that user A receives a new message sent by user B after logging in to the instant chat tool.

S302,即時聊天工具將該新消息保存在快取中以及本地磁碟文件中。 S302. The instant messaging tool saves the new message in a cache and a local disk file.

需要說明的是,新消息可以保存在快取中較後面的儲存位置,並標記為新消息,同時將其保存在本地磁碟文件中。從本地磁碟文件中讀取的歷史消息保存在快取的較前面的儲存位置。 It should be noted that new messages can be saved in a later storage location in the cache, marked as new messages, and saved in a local disk file at the same time. Historical messages read from a local disk file are stored in the cache's earlier storage location.

S303,響應於使用者觸發顯示新消息的請求,從該快取中讀取該新消息,判斷該新消息的數量或者容量是否小於設定閾值;若判斷結果為是,執行S304;若判斷結果為否,直接展示該新消息,並將展示的該消息保存在於該特定使用者對應的歷史聊天記錄快取中。 S303: In response to a user triggering a request to display a new message, read the new message from the cache, and determine whether the number or capacity of the new message is less than a set threshold; if the determination result is yes, execute S304; if the determination result is No, directly display the new message, and save the displayed message in the historical chat history cache corresponding to the specific user.

S304,根據設定的存取標識判斷是否從本地儲存空間 讀取過該當前使用者與特定使用者間的歷史聊天記錄。若判斷結果為是,執行S305;若判斷結果為否,執行S306;S305,從快取中讀取當前使用者與特定使用者的歷史聊天記錄,而後執行S307。 S304. Determine whether the historical chat record between the current user and the specific user has been read from the local storage space according to the set access identifier. If the determination result is yes, execute S305; if the determination result is no, execute S306; S305, read the historical chat records of the current user and the specific user from the cache, and then execute S307.

需要說明的是,快取中保存了預先從本地磁碟文件讀取的歷史聊天記錄以及直接儲存在快取中的歷史聊天記錄,例如S303中展示的該新消息,在使用者查看過該新消息後,即可以將展示的消息保存在於該特定使用者對應的歷史聊天記錄快取中。 It should be noted that the cache stores historical chat records read in advance from the local disk file and historical chat records directly stored in the cache, such as the new message shown in S303, and the user has viewed the new After the message is displayed, the displayed message can be saved in the historical chat history cache corresponding to the specific user.

S306,從本地磁碟文件中讀取與該特定使用者對應的歷史聊天記錄,將該聊天記錄儲存到快取中,設置存取標識,用於表明已從本地儲存空間讀取過該當前使用者與特定使用者間的歷史聊天記錄,而後執行S307。 S306. Read the historical chat record corresponding to the specific user from the local disk file, store the chat record in the cache, and set an access flag to indicate that the current use has been read from the local storage space. The historical chat record between the user and the specific user, and then execute S307.

S307,將該新消息與該歷史聊天記錄合併展示。 S307. Combine the new message with the historical chat record.

在本發明具體實現時,可以為使用者展示新消息的同時,還可以將歷史聊天記錄一起顯示。當使用者打開的聊天會話較多時,可以方便地知道上下文資訊。由於可以從快取中直接讀取歷史聊天記錄,大大提高了獲取聊天記錄的速度以及展示消息的效率,為使用者帶來更好體驗。 When the present invention is specifically implemented, while displaying new messages to users, historical chat records can also be displayed together. When users have more chat sessions, they can easily know the context information. Since the historical chat history can be read directly from the cache, the speed of obtaining the chat history and the efficiency of displaying messages are greatly improved, which brings a better experience for users.

參見圖4,為本發明再一實施例提供的即時聊天工具的聊天記錄處理方法流程圖。如圖4所示,可以包括:S401,即時聊天工具接收特定使用者發送給當前使用者的新消息。 4 is a flowchart of a method for processing a chat record of an instant chat tool according to another embodiment of the present invention. As shown in FIG. 4, it may include: S401. The instant chat tool receives a new message sent by a specific user to a current user.

舉例說明,假設使用者A在即時聊天工具登錄後,收 到使用者B發送的新消息。 For example, suppose that user A receives a new message from user B after logging in to the instant chat tool.

S402,即時聊天工具將該新消息保存在快取中以及本地磁碟文件中。 S402. The instant messaging tool saves the new message in a cache and a local disk file.

需要說明的是,新消息可以保存在快取中較後面的儲存位置,並標記為新消息,同時將其保存在本地磁碟文件中。從本地磁碟文件中讀取的歷史消息保存在快取的較前面的儲存位置。 It should be noted that new messages can be saved in a later storage location in the cache, marked as new messages, and saved in a local disk file at the same time. Historical messages read from a local disk file are stored in the cache's earlier storage location.

S403,響應於使用者觸發顯示新消息的請求,從該快取中讀取該新消息,並展示該新消息。 S403. In response to a user triggering a request to display a new message, read the new message from the cache and display the new message.

舉例說明,當使用者A打開與使用者B的聊天會話時,可以響應於該觸發操作,從快取中找到使用者A與使用者B聊天消息的快取,從快取中讀取標記為新消息的快取資料,並清除新消息標記。然後,將讀取的新消息在當前聊天會話的最下面展示。 For example, when user A opens a chat session with user B, in response to the trigger operation, a cache of chat messages between user A and user B can be found from the cache, and the tag marked as read from the cache is Cache information for new messages and clear new message tags. The new message read is then displayed at the bottom of the current chat session.

S404,響應於使用者觸發獲取歷史聊天記錄的請求,判斷快取中保存的歷史聊天記錄的數量或者容量是否大於N。若判斷結果為是,執行S405;若判斷結果為否,執行S406。 S404: In response to a user triggering a request for acquiring historical chat records, determine whether the number or capacity of historical chat records saved in the cache is greater than N. If the determination result is yes, execute S405; if the determination result is no, execute S406.

S405,直接從快取中讀取數量或者容量等於N的歷史聊天記錄。 S405. Read historical chat records with a quantity or capacity equal to N directly from the cache.

S406,從本地磁碟文件中讀取部分歷史聊天記錄並保存在快取中,使得快取中的歷史聊天記錄的數量或者容量大於N,從快取中讀取數量或者容量等於N的歷史聊天記錄。 S406. Read part of the historical chat records from the local disk file and save them in the cache, so that the number or capacity of the historical chat records in the cache is greater than N, and read the historical chats with the number or capacity equal to N recording.

舉例說明,當使用者點擊“查看更多”時,可以觸發加載N條歷史消息。其中,N的設置可以根據需要進行。這時,找到當前會話窗口中最上面的一條消息,即當前會話窗口中顯示的、距離當前時間最遠的一條消息,以這條消息為邊界,從快取中向前讀取N條歷史消息記錄。若判斷快取中保存的歷史消息記錄大於N條,則直接顯示讀取的N條歷史記錄。若判斷快取中保存的歷史消息記錄小於N條,例如當前快取中保存的歷史消息為M條,則以快取中第一條消息記錄為邊界(例如快取中保存的距離當前時間最遠的一條記錄),從本地歷史消息記錄中,以快取中保存的距離當前時間最遠的一條記錄為界,向前讀取(N-M)條消息記錄,並將其儲存至快取中。然後,以當前會話窗口展示的最上面一條消息為界,從快取中向前讀取N條消息記錄。 For example, when the user clicks "View more", it can trigger loading of N historical messages. The setting of N can be performed as required. At this time, find the top message in the current session window, that is, the message displayed in the current session window that is furthest from the current time. With this message as the boundary, read N historical message records forward from the cache. . If it is determined that the history message records saved in the cache are greater than N, then the read N history records are directly displayed. If it is judged that the history message record saved in the cache is less than N, for example, the history message saved in the current cache is M, then the first message record in the cache is used as the boundary A remote record), from the local historical message record, to the record stored in the cache farthest from the current time as the boundary, read (NM) message record forward and store it in the cache. Then, taking the top message displayed in the current session window as the boundary, read N message records forward from the cache.

S407,展示從快取中獲取的該N條歷史聊天記錄。 S407: Display the N historical chat records obtained from the cache.

參見圖5,為本發明又一實施例提供的即時聊天工具的聊天記錄處理方法流程圖。如圖5所示,可以包括:S501,接收使用者觸發第一控件的操作。 5 is a flowchart of a method for processing a chat record of an instant chat tool according to another embodiment of the present invention. As shown in FIG. 5, it may include: S501, receiving an operation of a user to trigger a first control.

S502,響應於使用者觸發第一控件的操作,顯示當前使用者與特定使用者間的至少部分歷史聊天記錄;其中,該至少部分歷史聊天記錄中的各條聊天記錄之間不具有時間連續關係或者該至少部分歷史聊天記錄與當前即時聊天工具最近展示的聊天記錄之間不具有時間連續關係。 S502. In response to the user triggering the operation of the first control, displaying at least part of the historical chat record between the current user and the specific user; wherein each chat record in the at least part of the historical chat record does not have a time continuous relationship. Or there is no time-continuous relationship between the at least part of the historical chat record and the chat record recently displayed by the current instant chat tool.

在一些實施方式中,該方法還包括:接收使用者觸發 第二控件的操作;響應於使用者觸發第二控件的操作,顯示當前使用者與特定使用者間的至少部分歷史聊天記錄;其中,該至少部分歷史聊天記錄中的各條聊天記錄之間具有時間連續關係或者該至少部分歷史聊天記錄與當前即時聊天工具最近展示的聊天記錄之間具有時間連續關係。進一步地,在顯示當前使用者與特定使用者間的至少部分歷史聊天記錄之前,該方法還包括:從快取中讀取前使用者與特定使用者間的至少部分歷史聊天記錄;其中,該快取中保存有預先從本地儲存空間中讀取的歷史聊天記錄以及直接儲存在該快取的歷史聊天記錄。 In some implementations, the method further includes: receiving an operation triggered by the user to trigger the second control; and in response to the user triggering the operation of the second control, displaying at least part of the historical chat record between the current user and the specific user; wherein, There is a time-continuous relationship between the chat records in the at least part of the historical chat record or a time-continuous relationship between the at least part of the historical chat record and the chat record recently displayed by the current instant chat tool. Further, before displaying at least part of the historical chat record between the current user and the specific user, the method further includes: reading at least part of the historical chat record between the previous user and the specific user from the cache; wherein, the The cache stores historical chat records previously read from the local storage space and historical chat records stored directly in the cache.

在本發明實施例中,可以取代現有技術中獲取使用者全部聊天記錄並按照時間先後順序連續展示聊天記錄的方式,可以僅獲取並展示符合特定條件的部分歷史聊天記錄,所展示的歷史聊天記錄中的各條聊天記錄之間不具有時間連續關係或者該至少部分歷史聊天記錄與當前即時聊天工具最近展示的聊天記錄之間不具有時間連續關係,以方便使用者獲取特定聊天記錄。由於僅獲取部分歷史聊天記錄,獲取資料量少,讀取速度快,並顯著地提高了使用者獲取資訊的效率,提升了使用者體驗。 In the embodiment of the present invention, it is possible to replace the method of obtaining all chat records of users in the prior art and continuously displaying the chat records in chronological order, and it is possible to obtain and display only part of the historical chat records that meet specific conditions. There is no time-continuous relationship between the chat records in the table, or there is no time-continuous relationship between the at least part of the historical chat record and the chat record recently displayed by the current instant chat tool, so as to facilitate users to obtain specific chat records. Because only a part of the historical chat history is acquired, the amount of acquired data is small, the reading speed is fast, and the efficiency of obtaining information by the user is significantly improved, and the user experience is improved.

下面對具體的實現方式進行詳細地說明。 The specific implementation manners are described in detail below.

具體實現時,可以在即時聊天工具的使用者界面上展示第二控件和第一控件。其中,第二控件用於響應於使用者的觸發展示當前使用者與特定使用者間的至少部分歷史聊天記錄,該至少部分歷史聊天記錄中的各條聊天記錄之 間具有時間連續關係或者該歷史聊天記錄與當前即時聊天工具最近展示的聊天記錄具有時間連續關係。該第一控件用於響應於使用者的觸發展示當前使用者與特定使用者間符合特定條件的至少部分歷史聊天記錄,該部分歷史聊天記錄中的各條聊天記錄之間不具有時間連續關係或者該歷史聊天記錄與當前即時聊天工具最近展示的聊天記錄之間不具有時間連續關係。 In specific implementation, the second control and the first control can be displayed on the user interface of the instant chat tool. The second control is used to display at least part of the historical chat record between the current user and the specific user in response to the user's trigger. Each of the chat records in the at least part of the historical chat record has a time-continuous relationship or the history. The chat history has a time-continuous relationship with the recently displayed chat history of the current instant chat tool. The first control is used to display at least a part of the historical chat records that meet certain conditions between the current user and the specific user in response to the user's trigger. There is no time-continuous relationship between the chat records in the part of the historical chat records or There is no time-continuous relationship between the historical chat record and the recently displayed chat record of the current instant chat tool.

舉例說明,第二控件可以是顯示最近N條聊天記錄或者顯示全部歷史聊天記錄,第一控件可以是顯示相關聊天記錄。例如,使用者若想要看時間連續的歷史聊天記錄,例如週二到週五間的聊天記錄時,可以點擊第二控件。若使用者想要查看部分相關的聊天記錄時,可以觸發第一控件。具體可以參見圖6A。 For example, the second control may be to display the latest N chat records or to display all historical chat records, and the first control may be to display related chat records. For example, if the user wants to see the historical chat history with continuous time, such as the chat history from Tuesday to Friday, he can click the second control. If the user wants to view some related chat records, the first control may be triggered. For details, see FIG. 6A.

需要特別說明的是,響應於使用者觸發第一控件的操作,從快取中讀取當前使用者與特定使用者間符合特定條件的部分歷史聊天記錄可以是符合特定條件的部分歷史聊天記錄。該特定條件包括符合特定時間條件、特定地點條件或者符合特定關鍵詞的歷史聊天記錄。具體實現時,取代獲取當前使用者與特定使用者間全部聊天記錄並按照時間先後順序連續展示聊天記錄的方式,可以僅獲取並展示符合特定條件的部分歷史聊天記錄。舉例說明,例如符合特定時間條件的歷史聊天記錄。假設當前時間是週五,當前使用者A與特定使用者B正在通過即時聊天工具聊天。使用者B提到:“咱們週二提到的事情處理的怎麼樣 了”,這時使用者A很有可能想要看看週二的聊天記錄,這時可以將“週二”確定為關鍵詞,僅從快取中獲取週二對應的歷史聊天記錄,並在聊天界面中展示週二的聊天記錄。這樣,週二的聊天記錄和當前窗口展示的最近聊天記錄(週五)即不具有時間連續關係。通過這樣的方式,不僅可以獲取更少的資料,而且方便使用者直觀地查看感興趣的內容,而無需在大量的聊天記錄(例如週五至週二這一連續時間段內的所有聊天記錄)中查找感興趣的內容。又舉例說明,該聊天記錄還可以是符合特定地點條件的聊天記錄。假設當前使用者頻繁出差會改變登錄地點,也可以根據使用者的輸入獲取特定地點的聊天記錄。再舉例說明,該部分歷史聊天記錄還可以是與特定關鍵詞匹配的聊天記錄。其中,在對關鍵詞匹配時可以是完全匹配也可以是部分匹配,可以是精確匹配也可以是模糊匹配。進一步地,還可以使用機器學習算法進行人工智慧自動匹配。舉例說明,使用者B提到“請問XX事宜處理得如何”,這時可以確定關鍵詞“XX”,查找到與之匹配的聊天記錄。若針對關鍵詞“XX”,存在多條聊天記錄,可以將其合併顯示。例如當前時間是週五,分別在週二、週三都存在相關聯的聊天記錄,則可以以時間的倒序,展示週三、週二的聊天記錄。這時,展示的該部分歷史聊天記錄中的各條聊天記錄之間不具有時間連續關係。 It should be particularly noted that, in response to the user triggering the operation of the first control, reading from the cache a part of the historical chat record that meets specific conditions between the current user and the specific user may be a part of the historical chat record that meets specific conditions. The specific condition includes a history chat record that meets a specific time condition, a specific location condition, or a specific keyword. In specific implementation, instead of obtaining all chat records between the current user and a specific user and continuously displaying the chat records in chronological order, only part of the historical chat records that meet specific conditions can be obtained and displayed. For example, historical chats that meet certain time conditions. Assume that the current time is Friday, and the current user A and the specific user B are chatting through the instant chat tool. User B mentioned: "How are we doing on Tuesday?" At this time, User A is likely to want to see Tuesday ’s chat history. At this time, "Tuesday" can be identified as a keyword. Only get the historical chat history corresponding to Tuesday from the cache, and display the chat history of Tuesday in the chat interface. In this way, the chat history on Tuesday and the most recent chat history (Friday) displayed in the current window do not have a time continuous relationship. In this way, not only can you get less information, but also it is convenient for users to intuitively view the content of interest without having to have a large number of chat records (such as all chat records in the continuous time period from Friday to Tuesday) Find what you ’re interested in. As another example, the chat record may also be a chat record that meets the conditions of a specific place. Assuming that the current user frequently travels on a business trip, the login location may be changed, and the chat history of a specific place may be obtained according to the user's input. By way of example, this part of the historical chat record can also be a chat record that matches a specific keyword. Among them, the keyword match may be an exact match or a partial match, and may be an exact match or a fuzzy match. Further, artificial intelligence can be automatically matched using a machine learning algorithm. For example, user B mentioned "How is XX handled?" At this time, the keyword "XX" can be determined, and a matching chat history can be found. If there are multiple chat records for the keyword "XX", they can be combined and displayed. For example, if the current time is Friday and there are associated chat records on Tuesday and Wednesday, the chat records on Wednesday and Tuesday can be displayed in reverse order of time. At this time, there is no time continuous relationship between the chat records in the part of the historical chat records displayed.

在本發明這一實施例中,可以在使用者界面中顯示多個控件,根據使用者對控件的觸發操作,進入不同的顯示 模式。一種顯示模式是按照時間連續的方式展示全部或者部分聊天記錄。一種顯示模式是按照非時間連續的方式展示部分聊天記錄。參見圖6B和圖6C為本發明實施例的效果示意圖。圖6B為時間連續的顯示方式,圖6C為非時間連續的顯示方式,其中,虛線用於分隔新聊天記錄和歷史聊天記錄。舉例說明,假設當前使用者A與使用者B正在通過即時聊天工具聊天,當前最近展示的聊天記錄為新消息103和104,消息104的產生時間為2016年1月8日9時31分,消息103的產生時間為2016年1月8日9時28分。具體實現時,可以在即時聊天工具的顯示界面上展示第二控件105,例如顯示全部聊天記錄的控件;以及,展示第一控件106,例如顯示相關聊天記錄的控件。 In this embodiment of the present invention, multiple controls can be displayed in the user interface, and different display modes can be entered according to the user's trigger operation on the controls. One display mode is to display all or part of the chat history in a continuous time manner. One display mode is to display part of the chat history in a non-time continuous manner. 6B and 6C are schematic diagrams showing effects of the embodiment of the present invention. FIG. 6B is a time-continuous display mode, and FIG. 6C is a non-time-continuous display mode. The dashed line is used to separate the new chat history and the historical chat history. For example, suppose that the current user A and user B are chatting through the instant chat tool. The currently displayed chat records are new messages 103 and 104. The generation time of the message 104 is 9:31 on January 8, 2016. The message The generation time of 103 was 9:28 on January 8, 2016. In specific implementation, the second control 105 may be displayed on the display interface of the instant chat tool, such as a control that displays all chat records; and the first control 106, such as a control that displays related chat records, may be displayed.

參見圖6B,若使用者觸發第二控件105,將會從快取中讀取前使用者A與使用者B的在一個連續時間段內的歷史聊天記錄,並按照時間先後順序依次展示各聊天記錄。如圖6B所示,如使用者觸發第二控件,除了展示消息103和消息104,還進一步展示歷史聊天記錄消息101、102……107。其中,消息101、102、107的產生時間是連續的,即獲取的是使用者在當前時間往前追溯連續產生的聊天記錄,展示也是按照時間順序依次展示的。對應圖6B的顯示方式,若使用者想要查看週二(即2016年1月4日)的聊天記錄,則需要在從當前時間往前追溯的連續聊天記錄中查找。 Referring to FIG. 6B, if the user triggers the second control 105, the historical chat records of the previous user A and the user B within a continuous period of time will be read from the cache, and the chats will be displayed in sequence in chronological order. recording. As shown in FIG. 6B, if the user triggers the second control, in addition to displaying the message 103 and the message 104, the historical chat record messages 101, 102, ... 107 are further displayed. The generation time of the messages 101, 102, and 107 is continuous, that is, the chat records generated by the user retrospectively and continuously from the current time are acquired, and the display is also displayed in chronological order. Corresponding to the display method of FIG. 6B, if the user wants to view the chat history on Tuesday (ie, January 4, 2016), he needs to search in the continuous chat history traced back from the current time.

參見圖6C,若使用者觸發第一控件106,即使用者選 擇展示相關聊天記錄,則會從快取中讀取前使用者A與使用者B的符合特定條件的歷史聊天記錄。如圖6C所示,如使用者觸發第二控件,除了展示消息103和消息104,僅會展示與當前消息相關的聊天記錄107,即僅展示週二(2016年1月4日)的聊天記錄。而不會展示消息101、102等。對應圖6C的顯示方式,若使用者可以方便地查看週二(即2016年1月4日)的聊天記錄,無需在從當前時間往前追溯的大量連續聊天記錄中查找。 Referring to FIG. 6C, if the user triggers the first control 106, that is, the user chooses to display related chat records, the historical chat records of the former user A and the user B that meet specific conditions will be read from the cache. As shown in FIG. 6C, if the user triggers the second control, in addition to displaying message 103 and message 104, only the chat history 107 related to the current message will be displayed, that is, only the chat history of Tuesday (January 4, 2016) will be displayed. . Messages 101, 102, etc. are not displayed. Corresponding to the display manner of FIG. 6C, if the user can conveniently view the chat history of Tuesday (ie, January 4, 2016), there is no need to search for a large number of continuous chat records traced back from the current time.

參見圖7,為本發明一實施例提供的即時聊天工具的聊天記錄處理裝置示意圖。 Referring to FIG. 7, it is a schematic diagram of a chat record processing device of an instant chat tool according to an embodiment of the present invention.

一種即時聊天工具的聊天記錄處理裝置700,包括:獲取單元701,用於響應於獲取當前使用者與特定使用者間的歷史聊天記錄的請求,從快取中讀取當前使用者與特定使用者間的歷史聊天記錄;其中,該快取中保存有預先從本地儲存空間中讀取的歷史聊天記錄以及直接儲存在該快取的歷史聊天記錄;展示單元702,用於展示該歷史聊天記錄。 A chat record processing device 700 of an instant chat tool includes: an obtaining unit 701, configured to read a current user and a specific user from a cache in response to a request for obtaining a historical chat record between the current user and a specific user Historical chat records; among them, historical cache records read from a local storage space in advance and historical chat records stored directly in the cache are stored in the cache; and a display unit 702 is configured to display the historical chat records.

在一些實施方式中,該獲取單元包括:第一判斷單元,用於判斷是否從本地儲存空間讀取過該當前使用者與特定使用者間的歷史聊天記錄;第一讀取單元,用於若判斷已從本地儲存空間讀取過該當前使用者與特定使用者間的歷史聊天記錄時,從快取中讀取當前使用者與特定使用者間的歷史聊天記錄。 In some embodiments, the obtaining unit includes: a first determining unit for determining whether a historical chat record between the current user and a specific user has been read from a local storage space; a first reading unit for When it is determined that the historical chat records between the current user and the specific user have been read from the local storage space, the historical chat records between the current user and the specific user are read from the cache.

在一些實施方式中,該裝置還包括: 第二讀取單元,用於若判斷未從本地儲存空間讀取過該當前使用者與特定使用者間的歷史聊天記錄時,從本地儲存空間讀取該當前使用者與特定使用者間的歷史聊天記錄;第一儲存單元,用於將讀取的該聊天記錄儲存在快取中,記錄已從本地儲存空間讀取過該當前使用者與特定使用者間的歷史聊天記錄。 In some embodiments, the device further includes: a second reading unit, configured to read from the local storage space if it is determined that the historical chat history between the current user and the specific user has not been read from the local storage space. A historical chat record between the current user and a specific user; a first storage unit for storing the read chat record in a cache, and the record has read the current user and a specific use from a local storage space History chat history.

在一些實施方式中,該裝置還包括:第三讀取單元,用於當確定滿足觸發條件時,預先從本地儲存空間中讀取當前使用者與特定使用者間的歷史聊天記錄;第二儲存單元,用於將讀取的該聊天記錄保存在快取中。 In some implementations, the device further includes: a third reading unit, configured to read a historical chat record between the current user and a specific user from a local storage space in advance when it is determined that the trigger condition is satisfied; the second storage A unit for saving the read chat record in a cache.

在一些實施方式中,該裝置還包括:第二判斷單元,用於當確定該歷史聊天記錄包含圖片時,根據該圖片的標識判斷快取中是否儲存有與該圖片的標識對應的圖片;第四讀取單元,用於若判斷結果為是,從快取中獲取與該圖片標識對應的圖片。 In some implementations, the device further includes: a second judgment unit, configured to determine whether a picture corresponding to the picture identifier is stored in the cache according to the identifier of the picture when it is determined that the historical chat record contains a picture; Four reading units are configured to obtain a picture corresponding to the picture identifier from the cache if the determination result is yes.

第五讀取單元,用於若判斷結果為否,從本地儲存空間中獲取該圖片;第三儲存單元,用於在快取中儲存該圖片以及圖片與圖片標識的對應關係。 The fifth reading unit is configured to obtain the picture from the local storage space if the determination result is no; the third storage unit is configured to store the picture and the correspondence between the picture and the picture identifier in the cache.

在一些實施方式中,該裝置還包括: 第四儲存單元,用於保存從快取中獲取歷史聊天記錄的存取時間;刪除單元,用於當滿足觸發條件時,根據該存取時間確定最近最少使用的歷史聊天記錄,從快取中刪除該歷史聊天記錄。 In some implementations, the device further includes: a fourth storage unit configured to store an access time for obtaining historical chat records from a cache; and a deletion unit configured to determine a latest time according to the access time when a trigger condition is satisfied. Least used history chat, delete this history chat from cache.

在一些實施方式中,該裝置還包括:發送單元,用於當接收到特定使用者向當前使用者發送的即時消息時,判斷該即時消息的數量或者容量是否小於設定閾值;若判斷結果為是,發送獲取當前使用者與特定使用者間的歷史聊天記錄的請求。 In some embodiments, the device further includes: a sending unit, configured to determine whether the quantity or capacity of the instant message is less than a set threshold when the instant message sent by the specific user to the current user is received; if the determination result is yes To send a request to get the historical chat history between the current user and a specific user.

在一些實施方式中,該展示單元具體用於:響應於使用者觸發顯示該即時消息的請求,將該即時消息與該歷史聊天記錄合併顯示。 In some embodiments, the display unit is specifically configured to: in response to a user triggering a request to display the instant message, display the instant message in combination with the historical chat record.

在一些實施方式中,該獲取單元包括:第三判斷單元,用於判斷快取中儲存的當前使用者與特定使用者間的歷史聊天記錄的數量或者容量是否大於設定閾值;第六讀取單元,用於若判斷結果為是,直接從快取中讀取數量或者容量與設定閾值相等的歷史聊天記錄;第七讀取單元,用於從本地儲存空間中讀取部分歷史聊天記錄,並儲存到快取中,使得快取中的歷史聊天記錄的數量或者容量大於或者等於設定閾值。 In some embodiments, the obtaining unit includes: a third determining unit, configured to determine whether the number or capacity of historical chat records stored in the cache between the current user and a specific user is greater than a set threshold; a sixth reading unit , If the judgment result is yes, directly read the history chat records with the same amount or capacity as the set threshold from the cache; the seventh reading unit is used to read part of the historical chat records from the local storage space and store In the cache, the number or capacity of historical chat records in the cache is greater than or equal to a set threshold.

在一些實施方式中,該獲取單元具體用於從快取中讀取當前使用者與特定使用者間符合特定條件的部分歷史聊天記錄;該特定條件包括符合特定時間條件、特定地點條 件或者符合特定關鍵詞的歷史聊天記錄;該展示單元具體用於展示該部分歷史聊天記錄,其中,該部分歷史聊天記錄中的各條聊天記錄之間不具有時間連續關係或者該歷史聊天記錄與當前即時聊天工具最近展示的聊天記錄不具有時間連續關係。 In some implementations, the obtaining unit is specifically configured to read from the cache part of the historical chat records between the current user and a specific user that meet specific conditions; the specific conditions include meeting specific time conditions, specific location conditions, or meeting specific conditions Keywords historical chat records; this display unit is specifically used to display this part of the historical chat records, where each of the chat records in this part of the historical chat records does not have a continuous relationship in time or the historical chat records and the current instant chat tool Recently displayed chats are not time-continuous.

參見圖8,為本發明又一實施例提供的即時聊天工具的聊天記錄處理裝置示意圖。 Referring to FIG. 8, it is a schematic diagram of a chat record processing device of an instant chat tool according to another embodiment of the present invention.

一種即時聊天工具的聊天記錄處理裝置800,包括:接收單元801,用於接收使用者觸發第一控件的操作。 A chat record processing device 800 of an instant chat tool includes a receiving unit 801 for receiving an operation of a user to trigger a first control.

顯示單元802,用於應於使用者觸發第一控件的操作,顯示當前使用者與特定使用者間的至少部分歷史聊天記錄;其中,該至少部分歷史聊天記錄中的各條聊天記錄之間不具有時間連續關係或者該至少部分歷史聊天記錄與當前即時聊天工具最近展示的聊天記錄之間不具有時間連續關係。 The display unit 802 is configured to display at least a part of the historical chat records between the current user and a specific user when the user triggers the operation of the first control; among the chat records in the at least part of the historical chat records, There is a time-continuous relationship or there is no time-continuous relationship between the at least part of the historical chat record and the chat record recently displayed by the current instant chat tool.

在一些實施方式中,該接收單元801還用於:接收使用者觸發第二控件的操作。 In some implementations, the receiving unit 801 is further configured to receive an operation of triggering the second control by a user.

在一些實施方式中,該顯示單元802還用於:響應於使用者觸發第二控件的操作,顯示當前使用者與特定使用者間的至少部分歷史聊天記錄;其中,該至少部分歷史聊天記錄中的各條聊天記錄之間具有時間連續關係或者該至少部分歷史聊天記錄與當前即時聊天工具最近展示的聊天記錄之間具有時間連續關係。 In some embodiments, the display unit 802 is further configured to display at least a part of the historical chat record between the current user and the specific user in response to the user triggering the operation of the second control; wherein the at least part of the historical chat record is Each of the chat records has a time-continuous relationship or there is a time-continuous relationship between the at least part of the historical chat record and the chat record recently displayed by the current instant chat tool.

在一些實施方式中,該裝置還包括:讀取單元,用於從快取中讀取前使用者與特定使用者間的至少部分歷史聊天記錄;其中,該快取中保存有預先從本地儲存空間中讀取的歷史聊天記錄以及直接儲存在該快取的歷史聊天記錄。 In some implementations, the device further includes: a reading unit, configured to read at least a part of the historical chat records between the previous user and the specific user from the cache; wherein, the cache stores a local storage in advance from a local storage. The historical chat records read in the space and the historical chat records stored directly in the cache.

其中,本發明裝置各單元或模組的設置可以參照圖2至圖6所示的方法而實現,在此不贅述。 The setting of each unit or module of the device of the present invention may be implemented with reference to the methods shown in FIG. 2 to FIG. 6, and details are not described herein.

參見圖9,是本發明另一實施例提供的用於即時聊天工具的聊天記錄處理的裝置的圖式。包括:至少一個處理器901(例如CPU),記憶體902和至少一個通信匯流排903,用於實現這些設備之間的連接通信。處理器901用於執行記憶體902中儲存的可執行模組,例如計算機程式。記憶體902可能包含高速隨機存取記憶體(RAM:Random Access Memory),也可能還包括不變性記憶體(non-volatile memory),例如至少一個磁碟記憶體。一個或者一個以上程式儲存於記憶體中,且經配置以由一個或者一個以上處理器901執行該一個或者一個以上程式包含用於進行以下操作的指令:響應於獲取當前使用者與特定使用者間的歷史聊天記錄的請求,從快取中讀取當前使用者與特定使用者間的歷史聊天記錄;其中,該快取中保存有預先從本地儲存空間中讀取的歷史聊天記錄以及直接儲存在該快取的歷史聊天記錄;展示該當前使用者與特定使用者間的歷史聊天記錄。 Referring to FIG. 9, it is a diagram of a device for processing a chat record of an instant chat tool according to another embodiment of the present invention. It includes: at least one processor 901 (such as a CPU), a memory 902, and at least one communication bus 903, which are used to implement connection and communication between these devices. The processor 901 is configured to execute an executable module, such as a computer program, stored in the memory 902. The memory 902 may include a high-speed random access memory (RAM: Random Access Memory), and may also include a non-volatile memory (non-volatile memory), such as at least one magnetic disk memory. One or more programs are stored in memory, and are configured to be executed by one or more processors 901. The one or more programs include instructions for: Request for historical chat records, read the historical chat records between the current user and a specific user from the cache; the cache stores the historical chat records read in advance from the local storage space and directly stores them in The cached historical chat record; displays the historical chat record between the current user and a specific user.

在一些實施方式中,處理器901具體用於執行該一個 或者一個以上程式包含用於進行以下操作的指令:判斷是否從本地儲存空間讀取過該當前使用者與特定使用者間的歷史聊天記錄;若判斷結果為是,從快取中讀取當前使用者與特定使用者間的歷史聊天記錄。 In some implementations, the processor 901 is specifically configured to execute the one or more programs including instructions for performing the following operations: determining whether a historical chat record between the current user and a specific user has been read from a local storage space ; If the determination result is yes, read the historical chat history between the current user and the specific user from the cache.

在一些實施方式中,處理器901具體用於執行該一個或者一個以上程式包含用於進行以下操作的指令:若判斷結果為否,從本地儲存空間讀取該當前使用者與特定使用者間的歷史聊天記錄,將讀取的該聊天記錄儲存在快取中,記錄已從本地儲存空間讀取過該當前使用者與特定使用者間的歷史聊天記錄。 In some implementations, the processor 901 is specifically configured to execute the one or more programs including instructions for performing the following operations: if the determination result is no, reading from the local storage space between the current user and the specific user The historical chat record stores the read chat record in a cache, and records that the historical chat record between the current user and a specific user has been read from the local storage space.

在一些實施方式中,處理器901具體用於執行該一個或者一個以上程式包含用於進行以下操作的指令:當確定滿足觸發條件時,預先從本地儲存空間中讀取當前使用者與特定使用者間的歷史聊天記錄,將讀取的該聊天記錄保存在快取中。 In some implementations, the processor 901 is specifically configured to execute the one or more programs including instructions for performing the following operations: when it is determined that the trigger condition is met, the current user and the specific user are read from the local storage space in advance. Historical chat histories, save the read chat transcript in the cache.

在一些實施方式中,處理器901具體用於執行該一個或者一個以上程式包含用於進行以下操作的指令:當確定該歷史聊天記錄包含圖片時,根據該圖片的標識判斷快取中是否儲存有與該圖片的標識對應的圖片;若判斷結果為是,從快取中獲取與該圖片標識對應的圖片。 In some implementations, the processor 901 is specifically configured to execute the one or more programs including instructions for performing the following operations: When determining that the historical chat record contains a picture, determine whether a cache is stored in the cache according to an identifier of the picture A picture corresponding to the picture identifier; if the determination result is yes, obtaining a picture corresponding to the picture identifier from the cache.

在一些實施方式中,處理器901具體用於執行該一個或者一個以上程式包含用於進行以下操作的指令:若判斷結果為否,從本地儲存空間中獲取該圖片,在快取中儲存該圖片以及圖片與圖片標識的對應關係。 In some implementations, the processor 901 is specifically configured to execute the one or more programs including instructions for performing the following operations: if the determination result is no, obtain the picture from the local storage space and store the picture in the cache And the correspondence between the picture and the picture logo.

在一些實施方式中,處理器901具體用於執行該一個或者一個以上程式包含用於進行以下操作的指令:保存從快取中獲取歷史聊天記錄的存取時間;當滿足觸發條件時,根據該存取時間確定最近最少使用的歷史聊天記錄,從快取中刪除該歷史聊天記錄。 In some embodiments, the processor 901 is specifically configured to execute the one or more programs including instructions for performing the following operations: saving the access time for obtaining historical chat records from the cache; when the trigger condition is met, according to the The access time determines the least recently used history chat history and deletes it from the cache.

在一些實施方式中,處理器901具體用於執行該一個或者一個以上程式包含用於進行以下操作的指令:當接收到特定使用者向當前使用者發送的即時消息時,判斷該即時消息的數量或者容量是否小於設定閾值;若判斷結果為是,發送獲取當前使用者與特定使用者間的歷史聊天記錄的請求。 In some implementations, the processor 901 is specifically configured to execute the one or more programs including instructions for performing the following operations: when receiving an instant message sent by a specific user to the current user, determining the quantity of the instant message Or whether the capacity is less than a set threshold; if the determination result is yes, a request for obtaining a historical chat record between the current user and a specific user is sent.

在一些實施方式中,處理器901具體用於執行該一個或者一個以上程式包含用於進行以下操作的指令:響應於使用者觸發顯示該即時消息的請求,將該即時消息與該歷史聊天記錄合併顯示。 In some embodiments, the processor 901 is specifically configured to execute the one or more programs including instructions for performing the following operations: in response to a user triggering a request to display the instant message, merging the instant message with the historical chat record display.

在一些實施方式中,處理器901具體用於執行該一個或者一個以上程式包含用於進行以下操作的指令:判斷快取中儲存的當前使用者與特定使用者間的歷史聊天記錄的數量或者容量是否大於設定閾值;若判斷結果為是,直接從快取中讀取數量或者容量與設定閾值相等的歷史聊天記錄;若判斷為否,從本地儲存空間中讀取部分歷史聊天記錄,並儲存到快取中,使得快取中的歷史聊天記錄的數量或者容量大於或者等於設定閾值。 In some implementations, the processor 901 is specifically configured to execute the one or more programs including instructions for performing the following operations: determining the number or capacity of historical chat records stored in the cache between the current user and a specific user Whether it is greater than the set threshold; if the result of the judgment is yes, directly read the historical chat records with the same amount or capacity as the set threshold from the cache; if the determination is no, read a part of the historical chat records from the local storage space and save it to In the cache, the number or capacity of historical chat records in the cache is greater than or equal to a set threshold.

本發明實施例還提供了一種用於即時聊天工具的聊天 記錄處理的裝置,包括:至少一個處理器(例如CPU),記憶體和至少一個通信匯流排,用於實現這些設備之間的連接通信。處理器用於執行記憶體中儲存的可執行模組,例如計算機程式。記憶體可能包含高速隨機存取記憶體(RAM:Random Access Memory),也可能還包括不變性記憶體(non-volatile memory),例如至少一個磁碟記憶體。一個或者一個以上程式儲存於記憶體中,且經配置以由一個或者一個以上處理器執行該一個或者一個以上程式包含用於進行以下操作的指令:接收使用者觸發第一控件的操作;響應於使用者觸發第一控件的操作,顯示當前使用者與特定使用者間的至少部分歷史聊天記錄;其中,該至少部分歷史聊天記錄中的各條聊天記錄之間不具有時間連續關係或者該至少部分歷史聊天記錄與當前即時聊天工具最近展示的聊天記錄之間不具有時間連續關係。 An embodiment of the present invention further provides a device for processing a chat record of an instant chat tool, including: at least one processor (for example, a CPU), a memory, and at least one communication bus, for implementing connection and communication between these devices. . The processor is used to execute executable modules, such as computer programs, stored in the memory. The memory may include high-speed random access memory (RAM: Random Access Memory), and may also include non-volatile memory (non-volatile memory), such as at least one magnetic disk memory. One or more programs are stored in the memory, and are configured to be executed by one or more processors. The one or more programs include instructions for: receiving an operation of the user to trigger the first control; responding to The user triggers the operation of the first control to display at least part of the historical chat record between the current user and the specific user; wherein each chat record in the at least part of the historical chat record does not have a time continuous relationship or the at least part of There is no time-continuous relationship between the historical chat history and the recently displayed chat history of the current instant chat tool.

在一些實施方式中,該一個或者一個以上處理器具體用於執行該一個或者一個以上程式包含用於進行以下操作的指令:接收使用者觸發第二控件的操作;響應於使用者觸發第二控件的操作,顯示當前使用者與特定使用者間的至少部分歷史聊天記錄;其中,該至少部分歷史聊天記錄中的各條聊天記錄之間具有時間連續關係或者該至少部分歷史聊天記錄與當前即時聊天工具最近展示的聊天記錄之間具有時間連續關係。 In some embodiments, the one or more processors are specifically configured to execute the one or more programs including instructions for performing the following operations: receiving an operation of the user to trigger the second control; and responding to the user triggering the second control Operation to display at least part of the historical chat history between the current user and a specific user; wherein each chat record in the at least part of the historical chat history has a time-continuous relationship or the at least part of the historical chat history and the current live chat The chat history recently displayed by the tool has a time-continuous relationship.

在一些實施方式中,該一個或者一個以上處理器具體用於執行該一個或者一個以上程式包含用於進行以下操作 的指令:從快取中讀取前使用者與特定使用者間的至少部分歷史聊天記錄;其中,該快取中保存有預先從本地儲存空間中讀取的歷史聊天記錄以及直接儲存在該快取的歷史聊天記錄。 In some implementations, the one or more processors are specifically configured to execute the one or more programs including instructions for performing the following operations: reading at least part of the history between the previous user and the specific user from the cache. Chat records; the cache stores historical chat records read from a local storage space in advance and historical chat records stored directly in the cache.

本領域技術人員在考慮說明書及實踐這裡公開的發明後,將容易想到本發明的其它實施方案。本發明旨在涵蓋本發明的任何變型、用途或者適應性變化,這些變型、用途或者適應性變化遵循本發明的一般性原理並包括本公開未公開的本技術領域中的公知常識或慣用技術手段。說明書和實施例僅被視為示例性的,本發明的真正範圍和精神由下面的申請專利範圍指出。 Those skilled in the art will readily think of other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. The present invention is intended to cover any variation, use, or adaptive change of the present invention. These variations, uses, or adaptive changes follow the general principles of the present invention and include common general knowledge or conventional technical means in the technical field not disclosed in this disclosure. . It is intended that the specification and examples be considered as exemplary only, with the true scope and spirit of the present invention being indicated by the following patent application scope.

應當理解的是,本發明並不局限於上面已經描述並在圖式中示出的精確結構,並且可以在不脫離其範圍進行各種修改和改變。本發明的範圍僅由所附的申請專利範圍來限制 It should be understood that the present invention is not limited to the precise structure that has been described above and shown in the drawings, and various modifications and changes can be made without departing from the scope thereof. The scope of the invention is limited only by the scope of the attached patent applications

以上所述僅為本發明的較佳實施例,並不用以限制本發明,凡在本發明的精神和原則之內,所作的任何修改、等同替換、改進等,均應包含在本發明的保護範圍之內。 The above are only preferred embodiments of the present invention and are not intended to limit the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall be included in the protection of the present invention. Within range.

需要說明的是,在本文中,諸如第一和第二等之類的關係術語僅僅用來將一個實體或者操作與另一個實體或操作區分開來,而不一定要求或者暗示這些實體或操作之間存在任何這種實際的關係或者順序。而且,術語“包括”、“包含”或者其任何其他變體意在涵蓋非排他性的包含,從而使得包括一系列要素的過程、方法、物品或者設備不僅 包括那些要素,而且還包括沒有明確列出的其他要素,或者是還包括為這種過程、方法、物品或者設備所固有的要素。在沒有更多限制的情況下,由語句“包括一個......”限定的要素,並不排除在包括該要素的過程、方法、物品或者設備中還存在另外的相同要素。本發明可以在由計算機執行的計算機可執行指令的一般上下文中描述,例如程式模組。一般地,程式模組包括執行特定任務或實現特定抽象資料類型的例程、程式、對象、組件、資料結構等等。也可以在分布式計算環境中實踐本發明,在這些分布式計算環境中,由通過通信網絡而被連接的遠程處理設備來執行任務。在分布式計算環境中,程式模組可以位於包括儲存設備在內的本地和遠程計算機儲存介質中。 It should be noted that in this article, relational terms such as first and second are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply that these entities or operations There is any such actual relationship or order among them. Moreover, the terms "including", "comprising", or any other variation thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or device that includes a series of elements includes not only those elements but also those that are not explicitly listed Or other elements inherent to such a process, method, article, or device. Without more restrictions, an element limited by the sentence "including a ..." does not exclude that there are other identical elements in the process, method, article, or equipment that includes the element. The invention can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The invention can also be practiced in distributed computing environments in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media, including storage devices.

本說明書中的各個實施例均採用遞進的方式描述,各個實施例之間相同相似的部分互相參見即可,每個實施例重點說明的都是與其他實施例的不同之處。尤其,對於裝置實施例而言,由於其基本相似於方法實施例,所以描述得比較簡單,相關之處參見方法實施例的部分說明即可。以上所描述的裝置實施例僅僅是示意性的,其中該作為分離部件說明的單元可以是或者也可以不是物理上分開的,作為單元顯示的部件可以是或者也可以不是物理單元,即可以位於一個地方,或者也可以分佈到多個網絡單元上。可以根據實際的需要選擇其中的部分或者全部模組來實現本實施例方案的目的。本領域普通技術人員在不付出創造性勞動的情況下,即可以理解並實施。以上所述僅是本發 明的具體實施方式,應當指出,對於本技術領域的普通技術人員來說,在不脫離本發明原理的前提下,還可以做出若干改進和潤飾,這些改進和潤飾也應視為本發明的保護範圍。 Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the various embodiments can be referred to each other. Each embodiment focuses on the differences from other embodiments. In particular, as for the device embodiment, since it is basically similar to the method embodiment, it is described relatively simply. For the relevant part, refer to the description of the method embodiment. The device embodiments described above are only schematic, in which the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one Place, or can be distributed across multiple network elements. Some or all of the modules may be selected according to actual needs to achieve the objective of the solution of this embodiment. Those of ordinary skill in the art can understand and implement without creative efforts. The above is only a specific embodiment of the present invention. It should be noted that for those of ordinary skill in the art, without departing from the principles of the present invention, several improvements and retouching can be made. These improvements and retouching also It should be regarded as the protection scope of the present invention.

Claims (18)

一種即時聊天工具的聊天記錄處理方法,其特徵在於,包括:響應於獲取當前使用者與特定使用者間的歷史聊天記錄的請求,從快取中讀取當前使用者與特定使用者間的歷史聊天記錄;其中,該快取中保存有預先從本地儲存空間中讀取的歷史聊天記錄以及直接儲存在該快取的歷史聊天記錄;展示該當前使用者與特定使用者間的歷史聊天記錄。     A method for processing a chat record of an instant chat tool, comprising: in response to a request for obtaining a historical chat record between a current user and a specific user, reading a history between the current user and a specific user from a cache; Chat history; wherein the cache stores historical chat records previously read from the local storage space and historical chat records directly stored in the cache; and displays historical chat records between the current user and a specific user.     根據請求項1所述的方法,其中,該從快取中讀取當前使用者與特定使用者間的歷史聊天記錄包括:判斷是否從本地儲存空間讀取過該當前使用者與特定使用者間的歷史聊天記錄;若判斷結果為是,從快取中讀取當前使用者與特定使用者間的歷史聊天記錄。     The method according to claim 1, wherein the reading the historical chat records between the current user and the specific user from the cache comprises: determining whether the current user and the specific user have been read from the local storage space. Historical chat history of; if the determination result is yes, read the historical chat history between the current user and the specific user from the cache.     根據請求項2所述的方法,其中,該方法還包括:若判斷結果為否,從本地儲存空間讀取該當前使用者與特定使用者間的歷史聊天記錄,將讀取的該聊天記錄儲存在快取中,記錄已從本地儲存空間讀取過該當前使用者與特定使用者間的歷史聊天記錄。     The method according to claim 2, further comprising: if the determination result is no, reading the historical chat record between the current user and the specific user from a local storage space, and storing the read chat record In the cache, the history has read the historical chat history between the current user and the specific user from the local storage space.     根據請求項1所述的方法,其中,該方法還包括:當確定滿足觸發條件時,預先從本地儲存空間中讀取當前使用者與特定使用者間的歷史聊天記錄,將讀取的該聊天記錄保存在快取中。     The method according to claim 1, wherein the method further comprises: when it is determined that the triggering condition is satisfied, previously reading a historical chat record between the current user and a specific user from the local storage space, and reading the chat Records are kept in the cache.     根據請求項4所述的方法,其中,該確定滿足觸發條件包括:當接收到特定使用者發送給當前使用者的即時消息時,確定滿足觸發條件;或者,當接收到使用者觸發顯示當前使用者與特定使用者的聊天窗口的操作時,確定滿足觸發條件。     The method according to claim 4, wherein the determining that the triggering condition is satisfied includes: determining that the triggering condition is satisfied when receiving an instant message sent by the specific user to the current user; or, when receiving the user triggering to display the current use When a user operates a chat window with a specific user, it is determined that a trigger condition is satisfied.     根據請求項1所述的方法,其中,該方法還包括:當確定該歷史聊天記錄包含圖片時,根據該圖片的標識判斷快取中是否儲存有與該圖片的標識對應的圖片;若判斷結果為是,從快取中獲取與該圖片標識對應的圖片。     The method according to claim 1, further comprising: when determining that the historical chat record contains a picture, determining whether a picture corresponding to the picture identifier is stored in the cache according to the picture identifier; if the result of the judgment is If so, a picture corresponding to the picture identifier is obtained from the cache.     根據請求項6所述的方法,其中,該方法還包括:若判斷結果為否,從本地儲存空間中獲取該圖片,在快取中儲存該圖片以及圖片與圖片標識的對應關係。     The method according to claim 6, wherein the method further comprises: if the determination result is no, obtaining the picture from the local storage space, storing the picture and the correspondence between the picture and the picture identifier in the cache.     根據請求項1所述的方法,其中,該方法還包括:保存從快取中獲取歷史聊天記錄的存取時間; 當滿足觸發條件時,根據該存取時間確定最近最少使用的歷史聊天記錄,從快取中刪除該歷史聊天記錄。     The method according to claim 1, wherein the method further comprises: saving an access time for obtaining historical chat records from a cache; and when a trigger condition is satisfied, determining the least recently used historical chat records according to the access time, Delete this historical chat history from the cache.     根據請求項1所述的方法,其中,該方法還包括:當接收到特定使用者向當前使用者發送的即時消息時,判斷該即時消息的數量或者容量是否小於設定閾值;若判斷結果為是,發送獲取當前使用者與特定使用者間的歷史聊天記錄的請求。     The method according to claim 1, further comprising: when receiving an instant message sent by a specific user to the current user, determining whether the quantity or capacity of the instant message is less than a set threshold; if the determination result is yes To send a request to get the historical chat history between the current user and a specific user.     根據請求項9所述的方法,其中,該展示歷史聊天記錄包括:響應於使用者觸發顯示該即時消息的請求,將該即時消息與該歷史聊天記錄合併顯示。     The method according to claim 9, wherein displaying the historical chat record comprises: in response to a user triggering a request to display the instant message, displaying the instant message in combination with the historical chat record.     根據請求項1、9或10所述的方法,其中,該從快取中讀取當前使用者與特定使用者間的歷史聊天記錄包括:從快取中讀取當前使用者與特定使用者間符合特定條件的部分歷史聊天記錄;該特定條件包括符合特定時間條件、特定地點條件或者符合特定關鍵詞的歷史聊天記錄;該展示該當前使用者與特定使用者間的歷史聊天記錄包括:展示該部分歷史聊天記錄,其中,該部分歷史聊天記錄中的各條聊天記錄之間不具有時間連續關係或者該歷史聊天記錄與當前即時聊天工具最近展示的聊天記錄不具有 時間連續關係。     The method according to claim 1, 9, or 10, wherein the reading historical chat records between the current user and the specific user from the cache comprises: reading the current user and the specific user from the cache. Part of the historical chat records that meet specific conditions; the specific conditions include historical chat records that meet specific time conditions, specific location conditions, or specific keywords; the display of historical chat records between the current user and specific users includes: displaying the Part of the historical chat record, wherein each of the chat records in the part of the historical chat record does not have a time-continuous relationship or the historical chat record does not have a time-continuous relationship with the chat record recently displayed by the current instant chat tool.     根據請求項1所述的方法,其中,該從快取中讀取當前使用者與特定使用者間的歷史聊天記錄包括:判斷快取中儲存的當前使用者與特定使用者間的歷史聊天記錄的數量或者容量是否大於設定閾值;若判斷結果為是,直接從快取中讀取數量或者容量與設定閾值相等的歷史聊天記錄;若判斷為否,從本地儲存空間中讀取部分歷史聊天記錄,並儲存到快取中,使得快取中的歷史聊天記錄的數量或者容量大於或者等於設定閾值。     The method according to claim 1, wherein the reading the historical chat records between the current user and the specific user from the cache comprises: judging the historical chat records between the current user and the specific user stored in the cache. Whether the number or capacity is greater than the set threshold; if the result of the judgment is yes, directly read the historical chat records with the quantity or capacity equal to the set threshold from the cache; if the determination is no, read a part of the historical chat records from the local storage space And store it in the cache so that the number or capacity of historical chat records in the cache is greater than or equal to a set threshold.     一種即時聊天工具的聊天記錄處理方法,其特徵在於,包括:接收使用者觸發第一控件的操作;響應於使用者觸發第一控件的操作,顯示當前使用者與特定使用者間的至少部分歷史聊天記錄;其中,該至少部分歷史聊天記錄中的各條聊天記錄之間不具有時間連續關係或者該至少部分歷史聊天記錄與當前即時聊天工具最近展示的聊天記錄之間不具有時間連續關係。     A method for processing a chat record of an instant chat tool, comprising: receiving an operation triggered by a user to trigger a first control; and displaying at least a part of a history between a current user and a specific user in response to the user triggering an operation of the first control. Chat records; wherein, there is no time-continuous relationship between the chat records in the at least part of the historical chat records or there is no time-continuous relationship between the at least part of the historical chat records and the chat records recently displayed by the current instant chat tool.     根據請求項13所述的方法,其中,該方法還包括:接收使用者觸發第二控件的操作;響應於使用者觸發第二控件的操作,顯示當前使用者與特定使用者間的至少部分歷史聊天記錄;其中,該至少 部分歷史聊天記錄中的各條聊天記錄之間具有時間連續關係或者該至少部分歷史聊天記錄與當前即時聊天工具最近展示的聊天記錄之間具有時間連續關係。     The method according to claim 13, wherein the method further comprises: receiving an operation triggered by the user to trigger the second control; and in response to the user triggering the operation of the second control, displaying at least part of the history between the current user and the specific user Chat records; wherein each of the chat records in the at least part of the historical chat records has a time-continuous relationship, or there is a time-continuous relationship between the at least part of the historical chat records and the chat records recently displayed by the current instant chat tool.     根據請求項13或14所述的方法,其中,在顯示當前使用者與特定使用者間的至少部分歷史聊天記錄之前,該方法還包括:從快取中讀取前使用者與特定使用者間的至少部分歷史聊天記錄;其中,該快取中保存有預先從本地儲存空間中讀取的歷史聊天記錄以及直接儲存在該快取的歷史聊天記錄。     The method according to claim 13 or 14, wherein before displaying at least a part of the historical chat history between the current user and the specific user, the method further comprises: reading the cache between the previous user and the specific user from the cache. At least part of the historical chat record; wherein, the cache stores the historical chat record previously read from the local storage space and the historical chat record directly stored in the cache.     一種即時聊天工具的聊天記錄處理裝置,其特徵在於,包括:獲取單元,用於響應於獲取當前使用者與特定使用者間的歷史聊天記錄的請求,從快取中讀取當前使用者與特定使用者間的歷史聊天記錄;其中,該快取中保存有預先從本地儲存空間中讀取的歷史聊天記錄以及直接儲存在該快取的歷史聊天記錄;展示單元,用於展示該歷史聊天記錄。     A chat record processing device for an instant chat tool, comprising: an obtaining unit, configured to read a current user and a specific user from a cache in response to a request for obtaining a historical chat record between the current user and a specific user; Historical chat records among users; wherein, the cache stores historical chat records read in advance from local storage space and historical chat records directly stored in the cache; a display unit for displaying the historical chat records .     一種即時聊天工具的聊天記錄處理裝置,其特徵在於,包括:接收單元,用於接收使用者觸發第一控件的操作; 顯示單元,用於響應於使用者觸發第一控件的操作,顯示當前使用者與特定使用者間的至少部分歷史聊天記錄;其中,該至少部分歷史聊天記錄中的各條聊天記錄之間不具有時間連續關係或者該至少部分歷史聊天記錄與當前即時聊天工具最近展示的聊天記錄之間不具有時間連續關係。     A chat record processing device for an instant chat tool, comprising: a receiving unit for receiving an operation of a user to trigger a first control; a display unit for displaying a current use in response to the user's operation of triggering a first control At least part of the historical chat record between the user and the specific user; wherein each chat record in the at least part of the historical chat record does not have a continuous relationship in time or the at least part of the historical chat record and the chat recently displayed by the current instant chat tool There is no time-continuous relationship between records.     一種用於即時聊天工具的聊天記錄處理的裝置,其特徵在於,包括有記憶體,以及一個或者一個以上的程式,其中一個或者一個以上程式儲存於記憶體中,且經配置以由一個或者一個以上處理器執行該一個或者一個以上程式包含用於進行以下操作的指令:響應於該獲取當前使用者與特定使用者間的歷史聊天記錄的請求,從快取中讀取當前使用者與特定使用者間的歷史聊天記錄;其中,該快取中保存有預先從本地儲存空間中讀取的歷史聊天記錄以及直接儲存在該快取的歷史聊天記錄;展示該當前使用者與特定使用者間的歷史聊天記錄。     A device for processing a chat record of an instant chat tool, comprising a memory and one or more programs, wherein one or more programs are stored in the memory and configured to be processed by one or one The above processor executes the one or more programs including instructions for performing the following operations: in response to the request for obtaining a historical chat history between the current user and the specific user, reading the current user and the specific use from the cache Historical chat records among users; among them, the cache stores historical chat records read from the local storage space in advance and historical chat records directly stored in the cache; showing the current user and specific users History chat history.    
TW106127146A 2016-11-22 2017-08-10 Chat record processing method and device of instant chat tool TWI743163B (en)

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
CN201611036740.6 2016-11-22
CN201611036740.6A CN108090079B (en) 2016-11-22 2016-11-22 Chat record processing method and device of instant chat tool
??201611036740.6 2016-11-22

Publications (2)

Publication Number Publication Date
TW201820903A true TW201820903A (en) 2018-06-01
TWI743163B TWI743163B (en) 2021-10-21

Family

ID=62168642

Family Applications (1)

Application Number Title Priority Date Filing Date
TW106127146A TWI743163B (en) 2016-11-22 2017-08-10 Chat record processing method and device of instant chat tool

Country Status (3)

Country Link
CN (1) CN108090079B (en)
TW (1) TWI743163B (en)
WO (1) WO2018095223A1 (en)

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108932143A (en) * 2018-06-01 2018-12-04 国电南瑞科技股份有限公司 A kind of warning information Dynamic Display method based on Dispatching Control System
CN109242479A (en) * 2018-09-04 2019-01-18 深圳市百宝廊珠宝首饰有限公司 A kind of method and apparatus that red packet is got based on integrating system
CN110943904A (en) * 2018-09-25 2020-03-31 北京国双科技有限公司 Message processing method and device, storage medium and processor
CN109495643B (en) * 2018-10-29 2021-01-01 努比亚技术有限公司 Object multi-chat frame setting method and terminal
CN109766462B (en) * 2018-12-27 2020-12-15 山东信通电子股份有限公司 Image file reading method, device and system in power transmission line monitoring system
CN110365739A (en) * 2019-06-05 2019-10-22 平安科技(深圳)有限公司 Message synchronization method, apparatus, computer installation and computer readable storage medium
CN111600789A (en) * 2020-05-11 2020-08-28 百度在线网络技术(北京)有限公司 Instant messaging method, system, device, electronic equipment and storage medium
CN112866272B (en) * 2021-01-27 2022-11-01 天翼数字生活科技有限公司 Anti-theft chain management and control method of cloud platform, downloading platform and equipment
CN116450635B8 (en) * 2023-06-15 2024-03-22 中免日上互联科技有限公司 Data cleaning method and system based on artificial intelligence

Family Cites Families (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0340046A (en) * 1989-07-06 1991-02-20 Hitachi Ltd Cache memory control system and information processor
US7243163B1 (en) * 2001-08-07 2007-07-10 Good Technology, Inc. System and method for full wireless synchronization of a data processing apparatus with a messaging system
CN101221585A (en) * 2008-02-03 2008-07-16 华为技术有限公司 Data storage method and device
CN101425081A (en) * 2008-12-05 2009-05-06 深圳华为通信技术有限公司 Character association information cuing method and terminal
CN102223313A (en) * 2011-06-07 2011-10-19 盛乐信息技术(上海)有限公司 Method and system for processing Internet video chat logs
US9300621B2 (en) * 2012-02-05 2016-03-29 Apple Inc. Communication history aggregation and presentation
CN105429846B (en) * 2014-09-18 2020-03-31 中兴通讯股份有限公司 Instant chat tool chat record synchronization method and terminal equipment
CN104348713A (en) * 2014-10-17 2015-02-11 国家电网公司 Instant messaging method based on comet of network platform under B/S (Browser/Server) architecture
CN106797336B (en) * 2015-01-29 2020-06-16 华为技术有限公司 Method and device for displaying historical chat records
CN105608100A (en) * 2015-08-31 2016-05-25 南京酷派软件技术有限公司 Information extraction method and information extraction device
CN105208212B (en) * 2015-09-30 2019-04-16 努比亚技术有限公司 Chat record display device and method
CN105260451A (en) * 2015-10-13 2016-01-20 Tcl移动通信科技(宁波)有限公司 Chat history information processing method and system based on mobile terminal

Also Published As

Publication number Publication date
CN108090079B (en) 2021-03-02
WO2018095223A1 (en) 2018-05-31
CN108090079A (en) 2018-05-29
TWI743163B (en) 2021-10-21

Similar Documents

Publication Publication Date Title
TWI743163B (en) Chat record processing method and device of instant chat tool
US11449206B2 (en) Machine learning method of managing conversations in a messaging interface
US11134046B2 (en) Apparatus and method for maintaining a message thread with opt-in permanence for entries
JP6416806B2 (en) Content item template
KR102450303B1 (en) Apparatus and method for maintaining a message thread with opt-in permanence for entries
US9253130B2 (en) Systems and methods for supporting social productivity using a dashboard
JP6178928B2 (en) Dynamic filter generation for message management systems
CN110168537B (en) Context and social distance aware fast active personnel card
JP6542929B2 (en) Enabling Dynamic Filter Generation for Message Management Systems via Gesture-Based Input
US20110307569A1 (en) System and method for collaborative short messaging and discussion
US11240188B2 (en) Large data management in communication applications through multiple mailboxes
US11714522B2 (en) Controlling a graphical user interface using a presentation of messages based upon predicted interactions with the messages
US11115351B2 (en) Managing email content in an activity stream
CN113805864A (en) Project engineering generation method and device, electronic equipment and storage medium
US11553015B2 (en) Progressive instantiation of workspaces for a group-based communication system
US11023260B2 (en) Systems and methods for transforming operation of applications
CN117459489A (en) Mail processing method, mail processing device, computer equipment and storage medium