WO2018095223A1 - 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
WO2018095223A1
WO2018095223A1 PCT/CN2017/110333 CN2017110333W WO2018095223A1 WO 2018095223 A1 WO2018095223 A1 WO 2018095223A1 CN 2017110333 W CN2017110333 W CN 2017110333W WO 2018095223 A1 WO2018095223 A1 WO 2018095223A1
Authority
WO
WIPO (PCT)
Prior art keywords
user
chat
cache
historical
chat record
Prior art date
Application number
PCT/CN2017/110333
Other languages
French (fr)
Chinese (zh)
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 WO2018095223A1 publication Critical patent/WO2018095223A1/en

Links

Images

Classifications

    • 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
    • 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

Definitions

  • the embodiments of the present invention relate to the field of computer technologies, and in particular, to a chat recording processing method and apparatus for an instant chat tool.
  • Instant Messenger (English called Instant Messaging, English abbreviated as IM) is an application that can deliver instant messages between users, which is convenient for users to communicate.
  • IM Instant Messaging
  • a user can receive new messages and view historical chat records through a live chat tool. For example, the user can trigger the display of historical chats by scrolling the screen or by clicking the "View More Messages" option.
  • chat records between users and other users are generally stored on a local disk. When a user needs to view a historical chat history, the historical chat history is also read from the local disk. Since the prior art reads from the local disk every time the chat record is read, not only the disk resource is consumed, but also the data reading from the disk takes a long time, and the shortcoming of the chat record cannot be displayed in time.
  • the embodiment of the invention provides a chat recording processing method and device for a real-time chat tool, which can quickly read historical chat records from the cache, reduce the consumption of disk resources, and improve the efficiency of obtaining chat records.
  • an embodiment of the present invention provides a method for processing a chat record of a live chat tool, comprising: reading a request between a current user and a specific user from a cache in response to a request for obtaining a historical chat record between a current user and a specific user.
  • Historical chat record wherein the cache stores historical chat records read in advance from the local storage space and historical chat records directly stored in the cache; displaying historical chat records between the current user and a specific user .
  • the reading, by the cache, the historical chat record between the current user and the specific user includes: determining whether the historical chat record between the current user and the specific user is read from the local storage space; If so, the historical chat history between the current user and the specific user is read from the cache.
  • the method further includes: if the determination result is no, reading a historical chat record between the current user and the specific user from the local storage space, and storing the read chat record in a cache, The history chat record between the current user and a specific user has been read from the local storage space.
  • the method further includes: when determining that the trigger condition is met, reading a historical chat record between the current user and the specific user from the local storage space, and saving the read chat record in the cache. .
  • the determining that the trigger condition is met comprises: determining that a trigger condition is met when receiving an instant message sent by the specific user to the current user; or, when receiving the user triggering displaying a chat window of the current user and the specific user When operating, it is determined that the trigger condition is met.
  • the method further includes: when determining that the historical chat record includes a picture, determining, according to the identifier of the picture, whether a picture corresponding to the identifier of the picture is stored in the cache; if the determination result is yes And acquiring a picture corresponding to the picture identifier from the cache.
  • the method further includes: if the determination result is no, acquiring the picture from the local storage space, and storing, in the cache, the picture and the correspondence between the picture and the picture identifier.
  • the method further includes: saving an access time of the historical chat record from the cache; determining the least recently used historical chat record according to the access time when the trigger condition is met, deleting the cached from the cache Historical chat history.
  • the method further includes: when receiving an instant message sent by the 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 the current A request for a historical chat record between a user and a specific user.
  • the presenting the history chat record comprises: displaying the instant message in combination with the historical chat record in response to a user triggering a request to display the instant message.
  • the reading, by the cache, the historical chat record between the current user and the specific user includes: reading, from the cache, a partial historical chat record that meets a specific condition between the current user and the specific user; the specific condition includes a historical chat record that meets a specific time condition, a specific location condition, or a specific keyword; the historical chat record between the current user and the specific user is displayed: displaying the partial historical chat record, wherein the partial historical chat There is no time continuous relationship between each chat record in the record or the historical chat record does not have a time continuous relationship with the chat record recently displayed by the current instant chat tool.
  • the reading the historical chat record between the current user and the specific user from the cache includes:
  • an embodiment of the present invention provides a method for processing a chat record of a live chat tool, including: receiving an operation of triggering a first control by a user; and displaying an operation between the current user and a specific user in response to the user triggering an operation of the first control At least part of the historical chat record; wherein, the at least part of the historical chat records do not have a time continuous relationship between the chat records or the at least part of the historical chat records do not have a chat record recently displayed with the current instant chat tool Time continuous relationship.
  • the method further includes: receiving an operation of the user triggering the second control; displaying at least 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 There is a time continuous relationship between each of the chat records in the partial history 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.
  • the method before displaying at least a portion of the historical chat record between the current user and the particular user, the method further comprising: reading at least a portion of the historical chat record between the previous user and the particular user from the cache; wherein The history cache record previously read from the local storage space and the historical chat record directly stored in the cache are stored in the cache.
  • an embodiment of the present invention provides a chat recording processing apparatus for a live chat tool, including: an obtaining unit, configured to read a current request from a cache in response to a request for acquiring a historical chat record between a current user and a specific user. a historical chat record between the user and the specific user; wherein the cache stores a historical chat record read in advance from the local storage space and a historical chat record directly stored in the cache; and a display unit for displaying the Historical chat history.
  • the obtaining unit includes: a first determining unit, configured to determine whether a historical chat record between the current user and a specific user is read from a local storage space; and the first reading unit is configured to: When it is judged that the historical chat record between the current user and the specific user has been read from the local storage space, the historical chat record between the current user and the specific user is read from the cache.
  • the apparatus further includes: a second reading unit, configured to read from the local storage space if the historical chat record between the current user and the specific user is not read from the local storage space a historical chat record between the current user and the specific user; the first storage unit is configured to store the read chat record in a cache, and the record has been read between the current user and the specific user from the local storage space Historical chat history.
  • a second reading unit configured to read from the local storage space if the historical chat record between the current user and the specific user is not read from the local storage space a historical chat record between the current user and the specific user
  • the first storage unit is configured to store the read chat record in a cache, and the record has been read between the current user and the specific user from the local storage space Historical chat history.
  • the apparatus further includes: a third reading unit, when it is determined that the trigger condition is met, The historical chat record between the current user and the specific user is read in advance from the local storage space; the second storage unit is configured to save the read chat record in the cache.
  • the apparatus further includes: a second determining unit, configured to determine, according to the identifier of the picture, whether a cache corresponding to the identifier of the picture is stored, when determining that the historical chat record includes a picture a fourth reading unit, configured to: if the determination result is yes, obtain a picture corresponding to the picture identifier from the cache.
  • the fifth reading unit is configured to: obtain the image from the local storage space if the determination result is no; and the third storage unit is configured to store, in the cache, the corresponding relationship between the image and the image and the image identifier.
  • the apparatus further includes: a fourth storage unit, configured to save an access time of acquiring a historical chat record from the cache; and a deleting unit, configured to determine the least recently according to the access time when the trigger condition is met The historical chat history used to delete the historical chat history from the cache.
  • the apparatus further includes: a sending unit, configured to determine, when receiving an instant message sent by the specific user to the current user, whether the quantity or capacity of the instant message is less than a set threshold; Yes, a request to obtain a historical chat record between the current user and a specific user is sent.
  • a sending unit configured to determine, when receiving an instant message sent by the specific user to the current user, whether the quantity or capacity of the instant message is less than a set threshold; Yes, a request to obtain a historical chat record between the current user and a specific user is sent.
  • the displaying unit is specifically configured to: display the instant message and the historical chat record in combination in response to a user triggering a request to display the instant message.
  • the obtaining unit includes: a third determining unit, configured to determine whether the quantity or capacity of the historical chat record between the current user and the specific user stored in the cache is greater than a set threshold; the sixth reading unit, If the result of the determination is yes, the historical chat record whose quantity or capacity is equal to the set threshold is directly read from the cache; the seventh reading unit is configured to read part of the historical chat record from the local storage space, and store the In the cache, the number or capacity of historical chat records in the cache is greater than or equal to a set threshold.
  • the embodiment of the present invention further provides a chat recording processing apparatus for a live chat tool, comprising: a receiving unit, configured to receive an operation of triggering a first control by a user; and a display unit, configured to trigger the first control by the user And displaying at least part of the historical chat record between the current user and the specific user; wherein, the at least part of the historical chat records do not have a time continuous relationship or the at least part of the historical chat record and the current instant There is no time continuous relationship between the chats recently displayed by the chat tool.
  • the embodiment of the present invention further provides an apparatus for chat recording processing of a live chat tool, including a memory, and one or more programs, wherein one or more programs are stored in the memory, and Configuring to execute the one or more programs by one or more processors includes instructions for: reading a current user from a cache in response to a request to retrieve a historical chat record between a current user and a particular user a historical chat record between specific users; wherein the cache is pre-stored locally A historical chat record read in the storage space and a historical chat record directly stored in the cache; displaying a historical chat record between the current user and a specific user.
  • the embodiment of the present invention further provides an apparatus for chat recording processing of a live chat tool, including a memory, and one or more programs, wherein one or more programs are stored in the memory, and Configuring to execute the one or more programs by one or more processors includes instructions for: receiving an operation by a user to trigger a first control; in response to a user triggering an operation of the first control, displaying the current user with a particular At least part of the historical chat record between the users; wherein, the at least part of the historical chat records do not have a time continuous relationship between the chat records or the at least part of the historical chat record and the chat record recently displayed by the current instant chat tool There is no time continuous relationship between them.
  • the chat recording processing method and device of the instant chat tool provided by the embodiment of the present invention can read the historical chat record between the current user and the specific user in advance from the local storage space, and save it in the cache, when receiving the current acquisition
  • the historical chat record is directly read from the cache, which greatly improves the speed of obtaining the chat record.
  • the loss of the disk is reduced, and the data processing and response speed is improved.
  • FIG. 1 is a schematic application scenario that can be applied to an embodiment of the present application
  • FIG. 2 is a flowchart of a method for processing a chat log of a live chat tool according to an embodiment of the present invention
  • FIG. 3 is a flowchart of a method for processing a chat log of a live chat tool according to another embodiment of the present invention.
  • FIG. 4 is a flowchart of a method for processing a chat log of a live chat tool according to still another embodiment of the present invention.
  • FIG. 5 is a flowchart of a method for processing a chat log of a live chat tool according to another embodiment of the present invention.
  • 6A, 6B, and 6C are schematic diagrams of effects according to an embodiment of the present invention.
  • FIG. 7 is a schematic diagram of a chat record processing apparatus of a live chat tool according to an embodiment of the present invention.
  • FIG. 8 is a schematic diagram of a chat recording processing apparatus of a live chat tool according to another embodiment of the present invention.
  • FIG. 9 is a schematic diagram of a chat recording processing apparatus for a live chat tool according to an exemplary embodiment.
  • the embodiment of the invention provides a chat recording processing method and device for a real-time chat tool, which can quickly read historical chat records from the cache, reduce the consumption of disk resources, and improve the efficiency of obtaining chat records.
  • FIG. 1 is an exemplary application scenario of an embodiment of the present application.
  • the method and apparatus provided by the embodiments of the present application may be applied to the scenario shown in FIG. 1 , where the instant chat tool may display new messages 103 , 104 received from a specific user from a current user in the display interface 100, and may simultaneously The message 101 and the message 102 in the history chat record are displayed.
  • the method and the device provided by the embodiment of the present application can read the historical chat record between the current user and the specific user from the cache 200, improve the data acquisition speed, and reduce the loss on the local disk.
  • the foregoing application scenarios are only for the purpose of facilitating understanding of the present application, and the embodiments of the present application are not limited in this respect. Rather, embodiments of the present application can be applied to any scenario that is applicable.
  • live chat tool generally refers to an application that can transmit instant messages between two or more users, such as Ali Wangwang, QQ, WeChat, MSN, and the like.
  • current user in the present invention generally refers to a user who logs in to the current instant chat tool client and corresponds to the current instant messenger client account
  • specific user refers to another user who performs instant communication with the current user.
  • the current user is user A
  • the specific user may be another user B who is chatting with the instant chat tool.
  • history chat record refers to a chat record viewed by a user.
  • “New instant message” or “unread instant message” generally refers to an instant sent by another user that is not viewed or read by the current user. Message.
  • cache generally refers to a memory that can be stored in a computing device for high-speed data exchange, and is generally distinguished from a memory such as a disk.
  • LRU Least Recently Used
  • Chinese name is recently least used.
  • picture identification refers to a unique identification ID of a picture.
  • 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 in the present invention is called Message Digest Algorithm 5, and the Chinese name is the information digest algorithm 5, which can also be called the digest algorithm and the hash algorithm. It is a hash algorithm that ensures complete and consistent information transmission.
  • a chat recording processing method of the live chat tool shown in the exemplary embodiment of the present invention will be described below with reference to FIGS. 2 to 6.
  • FIG. 2 is a flowchart of a method for processing a chat log of a live chat tool according to an embodiment of the present invention. As shown in FIG. 2, it may include:
  • the request to obtain a historical chat record between the current user and the specific user may specifically be a request to trigger a historical chat record between the current user and the specific user.
  • a request is sent to trigger a history chat record between the current user and a specific user.
  • a request to trigger a historical chat record between the current user and the specific user may also be sent.
  • the user may send a request for triggering the display of the historical chat record between the current user and the specific user through multiple operations.
  • the specific implementation manner may be flexible and diverse, and is not limited herein.
  • the request to obtain a historical chat record between the current user and the specific user may also be a request to trigger an unread instant message between the current user and the particular user. For example, when the user triggers the display of the unread instant message by opening the chat window with the specific user in the chat tool, it may be determined that the request for obtaining the historical chat record between the current user and the specific user is sent. For example, if the user closes the chat window with the specific user, when receiving the instant message sent by the specific user to the current user, the instant chat tool can display the prompt information to prompt the user that there is an unread message.
  • the setting threshold may be set according to requirements.
  • the setting threshold may be an upper limit of the number of displays or the capacity of the display interface of the instant messaging tool.
  • the capacity of the message may refer to the number of words and the number of rows of the information contained in the message. Or the space occupied. For example, if the current user A closes the chat window with user B, when receiving a new message sent by user B to user A, it can be determined whether the number or capacity of the new message is greater than the upper limit of the display interface display message; If no, the historical chat record is obtained, so that the new message and the historical chat record are combined and displayed, so that the user can quickly obtain the context information and facilitate the user to communicate.
  • the request to obtain a historical chat record between the current user and the specific user may also be that the specific user is sent to the instant message sent to the current user and the number or capacity of the instant message is determined to be less than the setting.
  • a request to obtain a historical chat record between the current user and a specific user is sent. For example, instead of obtaining a historical chat record in response to a user triggering a request to display an unread message, in this embodiment, when a new unread message is acquired and the message is determined to meet a preset condition, the trigger is triggered. Get a request for a history chat.
  • the reading, by the cache, the historical chat record between the current user and the specific user includes: determining whether the historical chat record between the current user and the specific user is read from the local storage space; As a result, 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 a historical chat record between the current user and a specific user from the local storage space, storing the read chat record in a cache, and recording has been The local storage space reads historical chat records between the current user and a specific user. For example, when receiving a request to obtain a historical chat record, it may be determined whether the chat record has been read from the local storage space.
  • an identifier can be set to distinguish whether a chat record has been read locally. If the chat record is read from the local storage space according to the set identifier, the chat record is directly read from the cache. If it is judged that the chat record has not been read from the local storage space according to the set identifier, the chat record can 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 to obtain the chat record is received again, the chat record can be obtained directly from the cache. Since the local storage space is accessed only when the logo is not read from the local storage space, other scenes read the chat record from the cache, which greatly improves the speed of obtaining the chat record and reduces the loss of the local storage space.
  • the method further includes: when determining that the trigger condition is met, reading a historical chat record between the current user and the specific user from the local storage space, and saving the read chat record in the cache.
  • historical chat records can be read from the local storage space in advance and saved in the cache.
  • the chat record is obtained from the cache each time.
  • the timing of obtaining the historical chat record in advance may be that the trigger condition is met, 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 obtaining the chat record.
  • Example is stated that when an instant message sent by a specific user to the current user is received, it may be determined that the trigger condition is met.
  • the trigger condition is satisfied.
  • the specific trigger condition may be flexible and diverse, as long as the historical chat record is obtained from the local storage space at one time before receiving the request to obtain the chat record.
  • the reading, by the cache, the historical chat record between the current user and the specific user includes: determining whether the quantity or capacity of the historical chat record between the current user and the specific user stored in the cache is greater than a set threshold; If the judgment result is yes, the historical chat record whose quantity or capacity is equal to the set threshold is directly read from the cache; if the judgment is no, some historical chat records are read from the local storage space and stored in the cache, so that the cache is cached.
  • the number or capacity of historical chat records in the middle is greater than or equal to the set threshold. For example, when the user clicks "View More", it can trigger the loading of N history messages. Among them, the setting of N can be performed as needed.
  • the top message of the chat session (generally the one that is the longest from the current time) is found, and then N messages of the history are read forward from the cache with this message as the boundary.
  • the history message record in the cache is sufficient, that is, greater than or equal to N, the read history chat record is directly displayed to the top of the chat session. If it is determined that the history message record saved in the cache is less than N, it is assumed that the message in the cache that meets the condition is M. From the local history record, the first message record in the cache is used as a boundary, and the (NM) item is read forward. 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 from the cache and display them.
  • the method further includes: when determining that the historical chat record includes a picture, determining, according to the identifier of the picture, whether a picture corresponding to the identifier of the picture is stored in the cache; if the determination result is yes And acquiring a picture corresponding to the picture identifier from the cache. Further, if the determination result is no, the picture is obtained from the local storage space, and the corresponding relationship between the picture and the picture and the picture identifier is stored in the cache. For example, in the specific implementation of the present invention, when the chat record is saved, if the chat record includes a picture, the identifier of the picture is saved only in the chat record, and is used to identify the picture.
  • the present invention may set a picture cache for storing picture data corresponding to the picture ID.
  • the chat record includes a picture
  • whether the picture corresponding to the picture ID is stored in the picture cache may be determined according to the picture ID; , the image content is directly displayed for display, thereby greatly improving the speed of obtaining the image without downloading the image from the local storage space every time. If it does not exist, the picture is read from the local storage space and saved in the picture cache.
  • the cache is obtained from the cache.
  • the identified image is only saved once in the cache, reducing the waste of storage space.
  • the identifier of the image can be obtained by obtaining the MD5 value of the image. It should be noted that, through the above processing, the speed of acquiring and displaying the picture information can be separately improved without having to read the picture from the local disk every time.
  • the historical chat record can be displayed separately. It can also be combined with an unread instant message.
  • the instant message may be displayed in combination with the historical chat record in response to a user triggering a request to display the instant message.
  • the method further includes: saving an access time of the historical chat record from the cache; determining the least recently used historical chat record according to the access time when the trigger condition is met, deleting the cached from the cache Historical chat history. For example, if there are more chat records in the current user, the chat records and pictures stored in the cache are more, and the computer memory is occupied. In order to reduce the memory occupation, the current user can be used to obtain the chat of the specific user every time the cache is accessed. Recording the access time; and may trigger to determine whether the current cached data exceeds the upper limit of the cache and there is no unread new message in the cache, and if so, determine the least recently used chat record according to the access time, and delete the cached record from the cache chat record.
  • the least recently used chat record may be a record whose access time exceeds a set time from the current time, or may be a chat record with the least number of visits within a preset time.
  • the reading, by the cache, the historical chat record between the current user and the specific user includes: reading, from the cache, a partial historical chat record that meets a specific condition between the current user and the specific user; the specific condition includes a historical chat record that meets a specific time condition, a specific location condition, or a specific keyword; the historical chat record between the current user and the specific user is displayed: displaying the partial historical chat record, wherein the partial historical chat There is no time continuous relationship between each chat record in the record or the historical chat record does not have a time continuous relationship with the chat record recently displayed by the current instant chat tool.
  • a historical chat record that meets certain time conditions. Assuming that the current time is Friday, the current user A and the specific user B are chatting through the live chat tool. User B mentioned: "How are we going to deal with things mentioned on Tuesday?" At this time, User A is likely to want to check the chat history on Tuesday. At this time, "Tuesday" can be identified as a keyword, only from the cache. Get the historical chat history corresponding to Tuesday and show the chat history on Tuesday in the chat interface.
  • 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 data, but also it is convenient for users to visually view the content of interest without having to write a lot of chats. Look for interesting content in the recording (for example, all chats in this continuous time period from Friday to Tuesday).
  • the chat record may also be a chat record that meets a specific location condition. It is assumed that the frequent travel of the current user will change the login location, and the chat history of the specific location may also be obtained according to the input of the user.
  • the partial history chat record may also be a chat record that matches a specific keyword.
  • chat record when matching the keywords, it may be an exact match or a partial match, and may be an exact match or a fuzzy match.
  • artificial intelligence automatic matching can also be performed using a machine learning algorithm. For example, User B mentioned "How is the XX matter handled?", then you can determine the keyword "XX" and find the matching chat record. If there are multiple chat records for the keyword "XX", they can be combined and displayed. For example, the current time is Friday, and there are associated chat records on Tuesday and Wednesday respectively, and 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 each chat record in the partial historical chat record displayed.
  • FIG. 3 is a flowchart of a method for processing a chat log of a live chat tool according to another embodiment of the present invention. As shown in FIG. 3, it may include:
  • the instant messenger tool receives a new message sent by a specific user to the current user.
  • the instant chat tool saves the new message in a cache and in a local disk file.
  • new messages can be saved in a later storage location in the cache and marked as new messages, while being saved in a local disk file.
  • Historical messages read from local disk files are saved in the cache's earlier storage location.
  • S303 in response to the user triggering the request to display a new message, reading the new message from the cache, determining whether the quantity or capacity of the new message is less than a set threshold; if the determination result is yes, executing S304; If the result is no, the new message is directly displayed, and the displayed message is saved in the historical chat record cache corresponding to the specific user.
  • the cache stores historical chat records read from local disk files and directly stores them.
  • the historical chat record stored in the cache for example, the new message displayed in S303, after the user views the new message, may save the displayed message in the historical chat record cache corresponding to the specific user.
  • the historical chat record corresponding to the specific user is read from the local disk file, the chat record is stored in the cache, and the access identifier is set to indicate that the current user has been read from the local storage space.
  • a history chat record between specific users, and then S307 is executed.
  • the new chat message can be displayed for the user, and the historical chat record can also be displayed together.
  • the context information can be easily known. Since the historical chat record can be directly read from the cache, the speed of obtaining the chat record and the efficiency of displaying the message are greatly improved, and the user is provided with a better experience.
  • FIG. 4 is a flowchart of a method for processing a chat log of a live chat tool according to still another embodiment of the present invention. As shown in FIG. 4, it may include:
  • the instant messenger tool receives a new message sent by a specific user to the current user.
  • the instant chat tool saves the new message in a cache and in a local disk file.
  • new messages can be saved in a later storage location in the cache and marked as new messages, while being saved in a local disk file.
  • Historical messages read from local disk files are saved in the cache's earlier storage location.
  • a cache of user A and user B chat messages may be found from the cache, and cached data marked as a new message is read from the cache. And clear the new message tag. The new message that is read is then displayed at the bottom of the current chat session.
  • S404 Determine, according to the user triggering the request for acquiring the historical chat record, whether the number or capacity of the historical chat records saved in the cache is greater than N. If the result of the determination is YES, S405 is performed; if the result of the determination is No, S406 is executed.
  • N Settings can be made as needed.
  • find the top message in the current session window that is, the message displayed in the current session window that is farthest from the current time. With this message as the boundary, read N history message records from the cache forward. . If it is determined that the history message record saved in the cache is greater than N, the read N history records are directly displayed.
  • the first message record in the cache is used as a boundary (for example, a record stored in the cache that is the farthest from the current time) ), from the local history message record, read the (NM) message record forward and store it in the cache, bounded by a record in the cache that is farthest from the current time. Then, N messages are read forward from the cache, bounded by the top message displayed in the current session window.
  • FIG. 5 is a flowchart of a method for processing a chat log of a live chat tool according to another embodiment of the present invention. As shown in FIG. 5, it may include:
  • S501 Receive an operation of triggering a first control by a user.
  • the method further includes: receiving an operation of the user triggering the second control; displaying at least 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 There is a time continuous relationship between each of the chat records in the partial history 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.
  • the method further includes: reading at least part of the historical chat record between the former user and the specific user from the cache; wherein the cache is saved There are historical chat records previously read from the local storage space and historical chat records stored directly in the cache.
  • the second control and the first control may be displayed on a user interface of the instant messenger tool.
  • the second control is configured to display at least part of a historical chat record between the current user and the specific user in response to the trigger of the user, where each of the at least partial historical chat records has a time continuous relationship or the historical chat Record a time-continuous relationship with the chat history recently shown by the current live chat tool.
  • the first control is configured to display at least part of a historical chat record that meets a specific condition between a current user and a specific user in response to a trigger of the user, where each piece of the chat record does not have a time continuous relationship or There is no time continuous relationship between the historical chat record and the chat record recently displayed by the current instant chat tool.
  • the second control may be displaying the latest N chat records or displaying all historical chat records
  • the first control may be displaying related chat records. For example, if a user wants to see a continuous history chat record, such as a chat record between Tuesday and Friday, the second control can be clicked. The first control can be triggered if the user wants to view some of the relevant chat records. See Figure 6A for details.
  • a partial historical chat record that reads a specific condition between the current user and the specific user from the cache may be a partial historical chat record that meets certain conditions.
  • the specific conditions include historical chat records that meet certain time conditions, specific location conditions, or that match a particular keyword.
  • only part of the historical chat records meeting the specific conditions may be obtained and displayed. For example, a historical chat record that meets certain time conditions. Assuming that the current time is Friday, the current user A and the specific user B are chatting through the live chat tool.
  • chat record may also be a chat record that meets a specific location condition.
  • the chat history chat record may also be a chat record that matches a specific keyword.
  • the keywords when matching the keywords, it may be an exact match or a partial match, and may be an exact match or a fuzzy match.
  • artificial intelligence automatic matching can also be performed using a machine learning algorithm. For example, User B mentioned "How is the XX matter handled?", then you can determine the keyword "XX" and find the matching chat record. If there are multiple chat records for the keyword "XX", they can be combined and displayed. For example, the current time is Friday, and there are associated chat records on Tuesday and Wednesday respectively, and 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 each chat record in the partial historical chat record displayed.
  • multiple controls can be displayed in the user interface, and different display modes are entered according to the user's triggering operation on the control.
  • One display mode is to display all or part of the chat history in a time-continuous manner.
  • One display mode is to display partial chat records in a non-time-continuous manner.
  • 6B and 6C are schematic diagrams of effects according to an embodiment of the present invention. 6B is a time-continuous display mode, and FIG. 6C is a non-time continuous display mode in which a dotted line is used to separate new chat history and historical chat history.
  • the second control 105 may be displayed on the display interface of the instant chat tool, for example, a control for displaying all the chat records; and the first control 106 is displayed, for example, a control for displaying the related chat record.
  • the historical chat records of the former user A and the user B in a continuous time period are read from the cache, and the chat records are sequentially displayed in chronological order.
  • the user triggers the second control in addition to displaying the message 103 and the message 104, the historical chat log messages 101, 102, ... 107 are further displayed.
  • the generation time of the messages 101, 102, and 107 is continuous, that is, the chat records that are continuously generated by the user in the current time are obtained, and the display is also displayed in chronological order.
  • the display mode of FIG. 6B if the user wants to view the chat history on Tuesday (ie, January 4, 2016), it is necessary to search in the continuous chat record traced from the current time.
  • the user triggers the first control 106 that is, the user selects to display the related chat record
  • the historical chat record of the former user A and the user B that meets the specific conditions is read from the cache.
  • the user triggers the second control in addition to displaying the message 103 and the message 104, only the chat record 107 associated with the current message is displayed, ie, only the chat record on Tuesday (January 4, 2016) is displayed. Instead of displaying messages 101, 102, etc.
  • the user can conveniently view the chat history on Tuesday (ie, January 4, 2016) it is not necessary to search in a large number of consecutive chat records traced from the current time.
  • FIG. 7 is a schematic diagram of a chat record processing apparatus of a live chat tool according to an embodiment of the present invention.
  • a chat record processing apparatus 700 for a live chat tool includes:
  • the obtaining unit 701 is configured to respond to the request for acquiring a historical chat record between the current user and the specific user, Reading, in the cache, a historical chat record between the current user and the specific user; wherein the cache stores a historical chat record read in advance from the local storage space and a historical chat record directly stored in the cache;
  • the display unit 702 is configured to display the historical chat record.
  • the obtaining unit comprises:
  • a first determining unit configured to determine whether a historical chat record between the current user and a specific user is read from a local storage space
  • the first reading unit is configured to: when the historical chat record between the current user and the specific user has been read from the local storage space, read the historical chat record between the current user and the specific user from the cache.
  • the device further comprises:
  • a second reading unit configured to: when the historical chat record between the current user and the specific user is not read from the local storage space, read the historical chat record between the current user and the specific user from the local storage space ;
  • the first storage unit is configured to store the read chat record in a cache, and record a history chat record between the current user and a specific user that has been read from the local storage space.
  • the device further comprises:
  • a third reading unit configured to read, in advance, a historical chat record between the current user and the specific user from the local storage space when it is determined that the trigger condition is met;
  • a second storage unit configured to save the read chat record in a cache.
  • the device further comprises:
  • a second determining unit configured to determine, according to the identifier of the picture, whether a picture corresponding to the identifier of the picture is stored in the cache, when determining that the historical chat record includes a picture;
  • the fourth reading unit is configured to: if the determination result is yes, obtain a picture corresponding to the picture identifier from the cache.
  • a fifth reading unit configured to: if the determination result is no, obtain the picture from a local storage space;
  • a third storage unit configured to store, in the cache, the corresponding relationship between the picture and the picture and the picture identifier.
  • the device further comprises:
  • a fourth storage unit configured to save an access time for obtaining a historical chat record from the cache
  • a deleting unit configured to determine a least recently used historical chat record according to the access time when the trigger condition is met, and delete the historical chat record from the cache.
  • the device further comprises:
  • the sending unit is configured to: when receiving an instant message sent by the specific user to the current user, determine whether the quantity or capacity of the instant message is less than a set threshold; if the determination result is yes, send the current user and the specific user A request for a history chat between records.
  • the display unit is specifically configured to:
  • the instant message is displayed in combination with the historical chat record in response to the user triggering a request to display the instant message.
  • the obtaining unit includes: a third determining unit, configured to determine whether the quantity or capacity of the historical chat record between the current user and the specific user stored in the cache is greater than a set threshold; the sixth reading unit, If the result of the determination is yes, the historical chat record whose quantity or capacity is equal to the set threshold is directly read from the cache; the seventh reading unit is configured to read part of the historical chat record from the local storage space, and store the In the cache, the number or capacity of historical chat records in the cache is greater than or equal to a set threshold.
  • the obtaining unit is specifically configured to read, from the cache, a partial historical chat record that meets a specific condition between the current user and the specific user; the specific condition includes meeting a specific time condition, a specific location condition, or meeting a specific key. Historical chat history of words;
  • the display unit is specifically configured to display the partial historical chat record, wherein each of the partial chat chat records does not have a time continuous relationship or the historical chat record is recently displayed by the current instant chat tool. Chat records do not have a time continuous relationship.
  • FIG. 8 is a schematic diagram of a chat record processing apparatus of a live chat tool according to another embodiment of the present invention.
  • a chat record processing apparatus 800 for a live chat tool comprising:
  • the receiving unit 801 is configured to receive an operation of the user triggering the first control.
  • the display unit 802 is 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 first control; wherein, there is no time between each of the chat records in the at least part of the historical chat record There is no time-continuous relationship between the continuous relationship or the at least partial historical chat record and the chat record recently displayed by the current instant messenger.
  • the receiving unit 801 is further configured to: receive an operation of the user triggering the second control.
  • the display unit 802 is further configured to: display at least part of a historical chat record between the current user and the specific user in response to the user triggering the operation of the second control; wherein, in the at least part of the historical chat record There is a time continuous relationship between each 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.
  • the device further comprises:
  • a reading unit configured to read at least part of a historical chat record between the former user and the specific user from the cache; wherein the cache stores a historical chat record read in advance from the local storage space and directly stored in the cache Cache Historical chat history.
  • each unit or module of the device of the present invention can be implemented by referring to the methods shown in FIG. 2 to FIG. 6 , and details are not described herein.
  • FIG. 9 is a diagram of an apparatus for chat recording processing of a live chat tool according to another embodiment of the present application.
  • 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), and may also include a non-volatile memory such as at least one disk memory.
  • One or more programs are stored in the memory, and are configured to be executed by one or more processors 901.
  • the one or more programs include instructions for: in response to obtaining a history between a current user and a particular user
  • the request of the chat record reads a historical chat record between the current user and the specific user from the cache; wherein the cache stores a historical chat record read in advance from the local storage space and a history directly stored in the cache Chat history; shows historical chat history between the current user and a specific user.
  • the processor 901 is specifically configured to execute the one or more programs including instructions for: determining whether a historical chat record between the current user and a specific user is read from a local storage space If the result of the determination is yes, the historical chat record between the current user and the specific user is read from the cache.
  • the processor 901 is specifically configured to execute, by the one or more programs, an instruction for: if the determination result is no, reading between the current user and a specific user from a local storage space
  • the history chat record stores the read chat record in a cache, and records the history chat record between the current user and the specific user that has been read from the local storage space.
  • the processor 901 is specifically configured to execute the one or more programs including instructions for: reading, between the current user and the specific user, from the local storage space when it is determined that the trigger condition is met Historical chat history, the read chat record is saved in the cache.
  • the processor 901 is specifically configured to execute, by the one or more programs, an instruction for: when determining that the historical chat record includes a picture, determining whether the cache is determined according to the identifier of the picture A picture corresponding to the identifier of the picture is stored; if the result of the determination is yes, the picture corresponding to the picture identifier is obtained from the cache.
  • the processor 901 is specifically configured to execute, by the one or more programs, an instruction for: if the determination result is no, the image is obtained from a local storage space, and the storage is stored in the cache. The picture and the correspondence between the picture and the picture identifier.
  • the processor 901 is specifically configured to execute the one or more programs including instructions for: saving an access time of acquiring a historical chat record from a cache; when the trigger condition is met, according to the The access time determines the least recently used historical chat history and deletes the historical chat history from the cache.
  • the processor 901 is specifically configured to execute the one or more programs including instructions for: determining an amount of the instant message when receiving an instant message sent by a specific user to a current user Or whether the capacity is less than a set threshold; if the judgment result is yes, a request for obtaining a historical chat record between the current user and the specific user is sent.
  • the processor 901 is specifically configured to execute the one or more programs including instructions for: in response to a user triggering a request to display the instant message, the instant message and the history The chat history is merged and displayed.
  • the processor 901 is specifically configured to execute the one or more programs including instructions for determining whether the number or capacity of historical chat records between the current user and the specific user stored in the cache is greater than Set the threshold; if the judgment result is yes, directly read the historical chat record whose quantity or capacity is equal to the set threshold; if the judgment is no, read some historical chat records from the local storage space and store them in the cache The number or capacity of historical chat records in the cache is made greater than or equal to a set threshold.
  • the embodiment of the invention further provides an apparatus for chat recording processing of a live chat tool, comprising: at least one processor (for example, a CPU), a memory and at least one communication bus for implementing connection communication between the devices.
  • the processor is for executing an executable module, such as a computer program, stored in the memory.
  • the memory may include a high speed random access memory (RAM), and may also include a non-volatile memory such as at least one disk memory.
  • 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 by a user to trigger the first control; responsive to the user Triggering an operation of the first control, displaying at least part of a historical chat record between the current user and the specific user; wherein, the at least part of the historical chat records do not have a time continuous relationship or the at least part of the historical chat There is no time continuous relationship between the record and the chat history recently displayed by the current instant messenger.
  • the one or more processors are specifically configured to execute the one or more programs including instructions for: receiving an operation of a user triggering a second control; triggering a second control in response to a user And displaying at least part of a historical chat record between the current user and the specific user; wherein, at least part of the historical chat records have a time continuous relationship between the respective chat records or the at least part of the historical chat records and the current live chat There is a time-continuous relationship between the chat records recently displayed by the tool.
  • the one or more processors are specifically configured to execute the one or more programs to include instructions for: reading at least a portion of historical chats between a pre-user and a particular user from a cache Recording; wherein the cache stores historical chat records read in advance from the local storage space and historical chat records directly stored in the cache.
  • the invention may be described in the general context of computer-executable instructions executed by a computer, such as a program module.
  • program modules include routines, programs, objects, components, data structures, and the like that perform particular tasks or implement particular abstract data types.
  • the invention may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are connected through a communication network.
  • program modules can be located in both local and remote computer storage media including storage devices.
  • the various embodiments in the specification are described in a progressive manner, and the same or similar parts between the various embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments.
  • the description is relatively simple, and the relevant parts can be referred to the description of the method embodiment.
  • the device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separate, and the components displayed as units may be or It may not be a physical unit, that is, it may be located in one place, or it may be distributed to multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the embodiment.

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 (S201); and displaying the chat log history of the chat between the current user and the specific user (S202). 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

一种即时聊天工具的聊天记录处理方法及装置Chat recording processing method and device for instant chat tool
本申请要求2016年11月22日递交的申请号为201611036740.6、发明名称为“一种即时聊天工具的聊天记录处理方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。The present application claims priority to Chinese Patent Application No. 201611036740.6, entitled "Chat Record Processing Method and Apparatus for Instant Chat Tools", filed on November 22, 2016, the entire contents of in.
技术领域Technical field
本发明实施例涉及计算机技术领域,具体涉及一种即时聊天工具的聊天记录处理方法及装置。The embodiments of the present invention relate to the field of computer technologies, and in particular, to a chat recording processing method and apparatus for an instant chat tool.
背景技术Background technique
即时聊天工具(英文全称为Instant Messaging,英文简称为IM)是一种可以在用户之间传递即时消息的应用程序,可以方便用户进行交流。现有技术中,用户可以通过即时聊天工具接收新消息以及查看历史聊天记录。举例说明,用户可以通过滚动屏幕或点击“查看更多消息”选项触发历史聊天记录的显示。现有技术中,用户与其他用户之间的聊天记录一般是在本地磁盘中存储。当用户需要查看历史聊天记录时,也是从本地磁盘中读取历史聊天记录。由于现有技术每次读取聊天记录时均从本地磁盘中读取,不仅会造成磁盘资源的消耗,而且从磁盘读取数据存在耗时长、无法及时快速展示聊天记录的缺陷。Instant Messenger (English called Instant Messaging, English abbreviated as IM) is an application that can deliver instant messages between users, which is convenient for users to communicate. In the prior art, a user can receive new messages and view historical chat records through a live chat tool. For example, the user can trigger the display of historical chats by scrolling the screen or by 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 a user needs to view a historical chat history, the historical chat history is also read from the local disk. Since the prior art reads from the local disk every time the chat record is read, not only the disk resource is consumed, but also the data reading from the disk takes a long time, and the shortcoming of the chat record cannot be displayed in time.
发明内容Summary of the invention
本发明实施例提供了一种即时聊天工具的聊天记录处理方法及装置,可以从缓存中快速读取历史聊天记录,减少磁盘资源的消耗,提高了获取聊天记录的效率。The embodiment of the invention provides a chat recording processing method and device for a real-time chat tool, which can quickly read historical chat records from the cache, reduce the consumption of disk resources, and improve the efficiency of obtaining chat records.
为此,本发明实施例提供如下技术方案:To this end, the embodiments of the present invention provide the following technical solutions:
第一方面,本发明实施例提供了一种即时聊天工具的聊天记录处理方法,包括:响应于获取当前用户与特定用户间的历史聊天记录的请求,从缓存中读取当前用户与特定用户间的历史聊天记录;其中,所述缓存中保存有预先从本地存储空间中读取的历史聊天记录以及直接存储在所述缓存的历史聊天记录;展示所述当前用户与特定用户间的历史聊天记录。In a first aspect, an embodiment of the present invention provides a method for processing a chat record of a live chat tool, comprising: reading a request between a current user and a specific user from a cache in response to a request for obtaining a historical chat record between a current user and a specific user. Historical chat record; wherein the cache stores historical chat records read in advance from the local storage space and historical chat records directly stored in the cache; displaying historical chat records between the current user and a specific user .
在一些实施方式中,所述从缓存中读取当前用户与特定用户间的历史聊天记录包括:判断是否从本地存储空间读取过所述当前用户与特定用户间的历史聊天记录;若判断结 果为是,从缓存中读取当前用户与特定用户间的历史聊天记录。In some implementations, the reading, by the cache, the historical chat record between the current user and the specific user includes: determining whether the historical chat record between the current user and the specific user is read from the local storage space; If so, 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 a historical chat record between the current user and the specific user from the local storage space, and storing the read chat record in a cache, The history chat record between the current user and a specific user has been read from the local storage space.
在一些实施方式中,所述方法还包括:当确定满足触发条件时,预先从本地存储空间中读取当前用户与特定用户间的历史聊天记录,将读取的所述聊天记录保存在缓存中。In some embodiments, the method further includes: when determining that the trigger condition is met, reading a historical chat record between the current user and the specific user from the local storage space, and saving the read chat record in the cache. .
在一些实施方式中,所述确定满足触发条件包括:当接收到特定用户发送给当前用户的即时消息时,确定满足触发条件;或者,当接收到用户触发显示当前用户与特定用户的聊天窗口的操作时,确定满足触发条件。In some implementations, the determining that the trigger condition is met comprises: determining that a trigger condition is met when receiving an instant message sent by the specific user to the current user; or, when receiving the user triggering displaying a chat window of the current user and the specific user When operating, it is determined that the trigger condition is met.
在一些实施方式中,所述方法还包括:当确定所述历史聊天记录包含图片时,根据所述图片的标识判断缓存中是否存储有与所述图片的标识对应的图片;若判断结果为是,从缓存中获取与所述图片标识对应的图片。In some embodiments, the method further includes: when determining that the historical chat record includes a picture, determining, according to the identifier of the picture, whether a picture corresponding to the identifier of the picture is stored in the cache; if the determination result is yes And acquiring a picture corresponding to the picture identifier from the cache.
在一些实施方式中,所述方法还包括:若判断结果为否,从本地存储空间中获取所述图片,在缓存中存储所述图片以及图片与图片标识的对应关系。In some embodiments, the method further includes: if the determination result is no, acquiring the picture from the local storage space, and storing, in the cache, the picture and the correspondence between the picture and the picture identifier.
在一些实施方式中,所述方法还包括:保存从缓存中获取历史聊天记录的访问时间;当满足触发条件时,根据所述访问时间确定最近最少使用的历史聊天记录,从缓存中删除所述历史聊天记录。In some embodiments, the method further includes: saving an access time of the historical chat record from the cache; determining the least recently used historical chat record according to the access time when the trigger condition is met, deleting the cached from the cache Historical chat history.
在一些实施方式中,所述方法还包括:当接收到特定用户向当前用户发送的即时消息时,判断所述即时消息的数量或者容量是否小于设定阈值;若判断结果为是,发送获取当前用户与特定用户间的历史聊天记录的请求。In some embodiments, the method further includes: when receiving an instant message sent by the 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 the current A request for a historical chat record between a user and a specific user.
在一些实施方式中,所述展示历史聊天记录包括:响应于用户触发显示所述即时消息的请求,将所述即时消息与所述历史聊天记录合并显示。In some embodiments, the presenting the history chat record comprises: displaying the instant message in combination with the historical chat record in response to a user triggering a request to display the instant message.
在一些实施方式中,所述从缓存中读取当前用户与特定用户间的历史聊天记录包括:从缓存中读取当前用户与特定用户间符合特定条件的部分历史聊天记录;所述特定条件包括符合特定时间条件、特定地点条件或者符合特定关键词的历史聊天记录;所述展示所述当前用户与特定用户间的历史聊天记录包括:展示所述部分历史聊天记录,其中,所述部分历史聊天记录中的各条聊天记录之间不具有时间连续关系或者所述历史聊天记录与当前即时聊天工具最近展示的聊天记录不具有时间连续关系。In some implementations, the reading, by the cache, the historical chat record between the current user and the specific user includes: reading, from the cache, a partial historical chat record that meets a specific condition between the current user and the specific user; the specific condition includes a historical chat record that meets a specific time condition, a specific location condition, or a specific keyword; the historical chat record between the current user and the specific user is displayed: displaying the partial historical chat record, wherein the partial historical chat There is no time continuous relationship between each chat record in the record or the historical chat record does not have a time continuous relationship with the chat record recently displayed by the current instant chat tool.
在一些实施方式中,所述从缓存中读取当前用户与特定用户间的历史聊天记录包括:In some embodiments, the reading the historical chat record 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 greater than Set the threshold; if the judgment result is yes, directly read the historical chat record whose quantity or capacity is equal to the set threshold; if the judgment is no, read some historical chat records from the local storage space and store them in the cache The number or capacity of historical chat records in the cache is made 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 a live chat tool, including: receiving an operation of triggering a first control by a user; and displaying an operation between the current user and a specific user in response to the user triggering an operation of the first control At least part of the historical chat record; wherein, the at least part of the historical chat records do not have a time continuous relationship between the chat records or the at least part of the historical chat records do not have a chat record recently displayed with the current instant chat tool Time continuous relationship.
在一些实施方式中,所述方法还包括:接收用户触发第二控件的操作;响应于用户触发第二控件的操作,显示当前用户与特定用户间的至少部分历史聊天记录;其中,所述至少部分历史聊天记录中的各条聊天记录之间具有时间连续关系或者所述至少部分历史聊天记录与当前即时聊天工具最近展示的聊天记录之间具有时间连续关系。In some embodiments, the method further includes: receiving an operation of the user triggering the second control; displaying at least 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 There is a time continuous relationship between each of the chat records in the partial history 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 a portion of the historical chat record between the current user and the particular user, the method further comprising: reading at least a portion of the historical chat record between the previous user and the particular user from the cache; wherein The history cache record previously read from the local storage space and the historical chat record directly stored in the cache are stored in the cache.
第三方面,本发明实施例提供了一种即时聊天工具的聊天记录处理装置,包括:获取单元,用于响应于获取当前用户与特定用户间的历史聊天记录的请求,从缓存中读取当前用户与特定用户间的历史聊天记录;其中,所述缓存中保存有预先从本地存储空间中读取的历史聊天记录以及直接存储在所述缓存的历史聊天记录;展示单元,用于展示所述历史聊天记录。In a third aspect, an embodiment of the present invention provides a chat recording processing apparatus for a live chat tool, including: an obtaining unit, configured to read a current request from a cache in response to a request for acquiring a historical chat record between a current user and a specific user. a historical chat record between the user and the specific user; wherein the cache stores a historical chat record read in advance from the local storage space and a historical chat record directly stored in the cache; and a display unit for displaying the Historical chat history.
在一些实施方式中,所述获取单元包括:第一判断单元,用于判断是否从本地存储空间读取过所述当前用户与特定用户间的历史聊天记录;第一读取单元,用于若判断已从本地存储空间读取过所述当前用户与特定用户间的历史聊天记录时,从缓存中读取当前用户与特定用户间的历史聊天记录。In some embodiments, the obtaining unit includes: a first determining unit, configured to determine whether a historical chat record between the current user and a specific user is read from a local storage space; and the first reading unit is configured to: When it is judged that the historical chat record between the current user and the specific user has been read from the local storage space, the historical chat record between the current user and the specific user is read from the cache.
在一些实施方式中,所述装置还包括:第二读取单元,用于若判断未从本地存储空间读取过所述当前用户与特定用户间的历史聊天记录时,从本地存储空间读取所述当前用户与特定用户间的历史聊天记录;第一存储单元,用于将读取的所述聊天记录存储在缓存中,记录已从本地存储空间读取过所述当前用户与特定用户间的历史聊天记录。In some embodiments, the apparatus further includes: a second reading unit, configured to read from the local storage space if the historical chat record between the current user and the specific user is not read from the local storage space a historical chat record between the current user and the specific user; the first storage unit is configured to store the read chat record in a cache, and the record has been read between the current user and the specific user from the local storage space Historical chat history.
在一些实施方式中,所述装置还包括:第三读取单元,用于当确定满足触发条件时, 预先从本地存储空间中读取当前用户与特定用户间的历史聊天记录;第二存储单元,用于将读取的所述聊天记录保存在缓存中。In some embodiments, the apparatus further includes: a third reading unit, when it is determined that the trigger condition is met, The historical chat record between the current user and the specific user is read in advance from the local storage space; the second storage unit is configured to save the read chat record in the cache.
在一些实施方式中,所述装置还包括:第二判断单元,用于当确定所述历史聊天记录包含图片时,根据所述图片的标识判断缓存中是否存储有与所述图片的标识对应的图片;第四读取单元,用于若判断结果为是,从缓存中获取与所述图片标识对应的图片。第五读取单元,用于若判断结果为否,从本地存储空间中获取所述图片;第三存储单元,用于在缓存中存储所述图片以及图片与图片标识的对应关系。In some embodiments, the apparatus further includes: a second determining unit, configured to determine, according to the identifier of the picture, whether a cache corresponding to the identifier of the picture is stored, when determining that the historical chat record includes a picture a fourth reading unit, configured to: if the determination result is yes, obtain a picture corresponding to the picture identifier from the cache. The fifth reading unit is configured to: obtain the image from the local storage space if the determination result is no; and the third storage unit is configured to store, in the cache, the corresponding relationship between the image and the image and the image identifier.
在一些实施方式中,所述装置还包括:第四存储单元,用于保存从缓存中获取历史聊天记录的访问时间;删除单元,用于当满足触发条件时,根据所述访问时间确定最近最少使用的历史聊天记录,从缓存中删除所述历史聊天记录。In some embodiments, the apparatus further includes: a fourth storage unit, configured to save an access time of acquiring a historical chat record from the cache; and a deleting unit, configured to determine the least recently according to the access time when the trigger condition is met The historical chat history used to delete the historical chat history from the cache.
在一些实施方式中,所述装置还包括:发送单元,用于当接收到特定用户向当前用户发送的即时消息时,判断所述即时消息的数量或者容量是否小于设定阈值;若判断结果为是,发送获取当前用户与特定用户间的历史聊天记录的请求。In some embodiments, the apparatus further includes: a sending unit, configured to determine, when receiving an instant message sent by the specific user to the current user, whether the quantity or capacity of the instant message is less than a set threshold; Yes, a request to obtain a historical chat record between the current user and a specific user is sent.
在一些实施方式中,所述展示单元具体用于:响应于用户触发显示所述即时消息的请求,将所述即时消息与所述历史聊天记录合并显示。In some embodiments, the displaying unit is specifically configured to: display the instant message and the historical chat record in combination in response to a user triggering a request to display the instant message.
在一些实施方式中,所述获取单元包括:第三判断单元,用于判断缓存中存储的当前用户与特定用户间的历史聊天记录的数量或者容量是否大于设定阈值;第六读取单元,用于若判断结果为是,直接从缓存中读取数量或者容量与设定阈值相等的历史聊天记录;第七读取单元,用于从本地存储空间中读取部分历史聊天记录,并存储到缓存中,使得缓存中的历史聊天记录的数量或者容量大于或者等于设定阈值。In some embodiments, the obtaining unit includes: a third determining unit, configured to determine whether the quantity or capacity of the historical chat record between the current user and the specific user stored in the cache is greater than a set threshold; the sixth reading unit, If the result of the determination is yes, the historical chat record whose quantity or capacity is equal to the set threshold is directly read from the cache; the seventh reading unit is configured to read part of the historical chat record from the local storage space, and store the In the cache, the number or capacity of historical chat records in the cache is greater than or equal to a set threshold.
第四方面,本发明实施例还提供了一种即时聊天工具的聊天记录处理装置,包括:接收单元,用于接收用户触发第一控件的操作;显示单元,用于应于用户触发第一控件的操作,显示当前用户与特定用户间的至少部分历史聊天记录;其中,所述至少部分历史聊天记录中的各条聊天记录之间不具有时间连续关系或者所述至少部分历史聊天记录与当前即时聊天工具最近展示的聊天记录之间不具有时间连续关系。In a fourth aspect, the embodiment of the present invention further provides a chat recording processing apparatus for a live chat tool, comprising: a receiving unit, configured to receive an operation of triggering a first control by a user; and a display unit, configured to trigger the first control by the user And displaying at least part of the historical chat record between the current user and the specific user; wherein, the at least part of the historical chat records do not have a time continuous relationship or the at least part of the historical chat record and the current instant There is no time continuous relationship between the chats recently displayed by the chat tool.
第五方面,本发明实施例还提供了一种用于即时聊天工具的聊天记录处理的装置,包括有存储器,以及一个或者一个以上的程序,其中一个或者一个以上程序存储于存储器中,且经配置以由一个或者一个以上处理器执行所述一个或者一个以上程序包含用于进行以下操作的指令:响应于获取当前用户与特定用户间的历史聊天记录的请求,从缓存中读取当前用户与特定用户间的历史聊天记录;其中,所述缓存中保存有预先从本地 存储空间中读取的历史聊天记录以及直接存储在所述缓存的历史聊天记录;展示所述当前用户与特定用户间的历史聊天记录。In a fifth aspect, the embodiment of the present invention further provides an apparatus for chat recording processing of a live chat tool, including a memory, and one or more programs, wherein one or more programs are stored in the memory, and Configuring to execute the one or more programs by one or more processors includes instructions for: reading a current user from a cache in response to a request to retrieve a historical chat record between a current user and a particular user a historical chat record between specific users; wherein the cache is pre-stored locally A historical chat record read in the storage space and a historical chat record directly stored in the cache; displaying a historical chat record between the current user and a specific user.
第六方面,本发明实施例还提供了一种用于即时聊天工具的聊天记录处理的装置,包括有存储器,以及一个或者一个以上的程序,其中一个或者一个以上程序存储于存储器中,且经配置以由一个或者一个以上处理器执行所述一个或者一个以上程序包含用于进行以下操作的指令:接收用户触发第一控件的操作;响应于用户触发第一控件的操作,显示当前用户与特定用户间的至少部分历史聊天记录;其中,所述至少部分历史聊天记录中的各条聊天记录之间不具有时间连续关系或者所述至少部分历史聊天记录与当前即时聊天工具最近展示的聊天记录之间不具有时间连续关系。In a sixth aspect, the embodiment of the present invention further provides an apparatus for chat recording processing of a live chat tool, including a memory, and one or more programs, wherein one or more programs are stored in the memory, and Configuring to execute the one or more programs by one or more processors includes instructions for: receiving an operation by a user to trigger a first control; in response to a user triggering an operation of the first control, displaying the current user with a particular At least part of the historical chat record between the users; wherein, the at least part of the historical chat records do not have a time continuous relationship between the chat records or the at least part of the historical chat record and the chat record recently displayed by the current instant chat tool There is no time continuous relationship between them.
本发明实施例提供的即时聊天工具的聊天记录处理方法及装置,可以预先从本地存储空间中读取当前用户与特定用户间的历史聊天记录,并将其保存在缓存中,当接收到获取当前用户与特定用户间的历史聊天记录的请求时,直接从缓存中读取历史聊天记录,大大提高了获取聊天记录的速度。此外,由于只需要从磁盘中读取一次数据,并将其存储在缓存中供用户访问,降低了对磁盘的损耗,提高了数据处理和响应速度。The chat recording processing method and device of the instant chat tool provided by the embodiment of the present invention can read the historical chat record between the current user and the specific user in advance from the local storage space, and save it in the cache, when receiving the current acquisition When a request for a historical chat record between a 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 only data needs to be read from the disk and stored in the cache for user access, the loss of the disk is reduced, and the data processing and response speed is improved.
附图说明DRAWINGS
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明中记载的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。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 embodiments or the description of the prior art will be briefly described below. Obviously, the drawings in the following description are only It is a few embodiments described in the present invention, and other drawings can be obtained from those skilled in the art without any inventive effort.
图1为本申请实施例可以应用的一个示意性应用场景;FIG. 1 is a schematic application scenario that can be applied to an embodiment of the present application;
图2为本发明一实施例提供的即时聊天工具的聊天记录处理方法流程图;2 is a flowchart of a method for processing a chat log of a live chat tool according to an embodiment of the present invention;
图3为本发明另一实施例提供的即时聊天工具的聊天记录处理方法流程图;3 is a flowchart of a method for processing a chat log of a live chat tool according to another embodiment of the present invention;
图4为本发明再一实施例提供的即时聊天工具的聊天记录处理方法流程图;4 is a flowchart of a method for processing a chat log of a live chat tool according to still another embodiment of the present invention;
图5为本发明又一实施例提供的即时聊天工具的聊天记录处理方法流程图;FIG. 5 is a flowchart of a method for processing a chat log of a live chat tool according to another embodiment of the present invention; FIG.
图6A、图6B、图6C为本发明实施例的效果示意图;6A, 6B, and 6C are schematic diagrams of effects according to an embodiment of the present invention;
图7为本发明一实施例提供的即时聊天工具的聊天记录处理装置示意图;FIG. 7 is a schematic diagram of a chat record processing apparatus of a live chat tool according to an embodiment of the present invention; FIG.
图8为本发明另一实施例提供的即时聊天工具的聊天记录处理装置示意图FIG. 8 is a schematic diagram of a chat recording processing apparatus of a live chat tool according to another embodiment of the present invention;
图9是根据一示例性实施例示出的一种用于即时聊天工具的聊天记录处理装置的示意图。 FIG. 9 is a schematic diagram of a chat recording processing apparatus for a live chat tool according to an exemplary embodiment.
具体实施方式detailed description
本发明实施例提供了一种即时聊天工具的聊天记录处理方法及装置,可以从缓存中快速读取历史聊天记录,减少磁盘资源的消耗,提高了获取聊天记录的效率。The embodiment of the invention provides a chat recording processing method and device for a real-time chat tool, which can quickly read historical chat records from the cache, reduce the consumption of disk resources, and improve the efficiency of obtaining chat records.
为了使本技术领域的人员更好地理解本发明中的技术方案,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都应当属于本发明保护的范围。In order to make those skilled in the art 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 conjunction with the accompanying drawings in the embodiments of the present invention. The embodiments are only a part of the embodiments of the invention, and not all of the embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative efforts shall fall within the scope of the present invention.
参见图1,为本申请实施例的示例性应用场景。本申请实施例提供的方法和装置可以应用于如图1所示的场景,其中,即时聊天工具可以在显示界面100中展示从当前用户从特定用户收到的新消息103、104,还可以同时展示历史聊天记录中的消息101、消息102。其中,本申请实施例提供的方法和装置可以从缓存200中读取当前用户与特定用户间的历史聊天记录,提高数据的获取速度,减少对本地磁盘的损耗。需要注意的是,上述应用场景仅是为了便于理解本申请而示出,本申请的实施方式在此方面不受任何限制。相反,本申请的实施方式可以应用于适用的任何场景。FIG. 1 is an exemplary application scenario of an embodiment of the present application. The method and apparatus provided by the embodiments of the present application may be applied to the scenario shown in FIG. 1 , where the instant chat tool may display new messages 103 , 104 received from a specific user from a current user in the display interface 100, and may simultaneously The message 101 and the message 102 in the history chat record are displayed. The method and the device provided by the embodiment of the present application can read the historical chat record between the current user and the specific user from the cache 200, improve the data acquisition speed, and reduce the loss on the local disk. It should be noted that the foregoing application scenarios are only for the purpose of facilitating understanding of the present application, and the embodiments of the present application are not limited in this respect. Rather, embodiments of the present application can be applied to any scenario that is applicable.
需要说明的是,本发明涉及的技术术语“即时聊天工具”一般是指可以在两名或多名用户之间传递即时消息的应用程序,例如阿里旺旺、QQ、微信、MSN等。It should be noted that the technical term “live chat tool” according to the present invention generally refers to an application that can transmit instant messages between two or more users, such as Ali Wangwang, QQ, WeChat, MSN, and the like.
本发明涉及的技术术语“当前用户”一般是指登录当前即时聊天工具客户端、与当前即时聊天工具客户端的账号对应的用户,“特定用户”是指与当前用户进行即时通讯的另一用户。举例说明,当前用户为用户A,特定用户可以是与其使用即时聊天工具聊天的另一用户B。The technical term “current user” in the present invention generally refers to a user who logs in to the current instant chat tool client and corresponds to the current instant messenger client account, and “specific user” refers to another user who performs instant communication with the current user. For example, the current user is user A, and the specific user may be another user B who is chatting with the instant chat tool.
本发明涉及的技术术语“历史聊天记录”一般是指用户查看过的聊天记录,“新即时消息”或者“未读即时消息”一般是指另一用户发送的、当前用户未查看或者阅读的即时消息。The technical term “history chat record” refers to a chat record viewed by a user. “New instant message” or “unread instant message” generally refers to an instant sent by another user that is not viewed or read by the current user. Message.
本发明涉及的技术术语“缓存”(cache)一般是指存储在计算设备中可以进行高速数据交换的存储器,一般区别于磁盘等存储器。The technical term "cache" as used in the present invention generally refers to a memory that can be stored in a computing device for high-speed data exchange, and is generally distinguished from a memory such as a disk.
本发明涉及的技术术语“LRU”的英文全称为Least Recently Used,中文全称为最近最少使用。The technical term "LRU" of the present invention is referred to as Least Recently Used, and the Chinese name is recently least used.
本发明涉及的技术术语“图片标识”是指图片的唯一标识ID。在本发明实施例中, 可以使用图片内容的MD5值作为图片ID,在聊天记录中使用图片ID标识图片。The technical term "picture identification" as used in 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, and the Chinese name is the information digest algorithm 5, which can also be called the digest algorithm and the hash algorithm. It is a hash algorithm that ensures complete and consistent information transmission.
当然,以上术语仅为解释性说明,不视为对本发明的限制。The above terms are, of course, only illustrative and are not to be construed as limiting the invention.
下面将结合附图2至附图6对本发明示例性实施例示出的即时聊天工具的聊天记录处理方法进行介绍。A chat recording processing method of the live chat tool shown in the exemplary embodiment of the present invention will be described below with reference to FIGS. 2 to 6.
参见图2,为本发明一实施例提供的即时聊天工具的聊天记录处理方法流程图。如图2所示,可以包括:FIG. 2 is a flowchart of a method for processing a chat log of a live chat tool according to an embodiment of the present invention. As shown in FIG. 2, it may include:
S201,响应于获取当前用户与特定用户间的历史聊天记录的请求,从缓存中读取当前用户与特定用户间的历史聊天记录。S201. Read a historical chat record between the current user and the specific user from the cache in response to the request for acquiring the historical chat record between the current user and the specific user.
在一些实施方式中,所述获取当前用户与特定用户间的历史聊天记录的请求具体可以是触发显示当前用户与特定用户间的历史聊天记录的请求。举例说明,当用户点击“显示更多消息”或者“获取历史聊天记录”等控件或者按钮时,则发送了触发显示当前用户与特定用户间的历史聊天记录的请求。又举例说明,当用户在当前用户与特定用户的聊天窗口中,使用鼠标向下滚动屏幕时,也可以发送触发显示当前用户与特定用户间的历史聊天记录的请求。需要说明的是,用户可以通过多种操作发送触发显示当前用户与特定用户间的历史聊天记录的请求,具体实现方式可以是灵活多样的,在此不进行限制。In some embodiments, the request to obtain a historical chat record between the current user and the specific user may specifically be a request to trigger a historical chat record between the current user and the specific user. For example, when the user clicks a control or button such as "display more messages" or "acquire history chats", a request is sent to trigger a history chat record between the current user and a specific user. For example, when the user scrolls down the screen using the mouse in the chat window of the current user and the specific user, a request to trigger a historical chat record between the current user and the specific user may also be sent. It should be noted that the user may send a request for triggering the display of the historical chat record between the current user and the specific user through multiple operations. The specific implementation manner may be flexible and diverse, and is not limited herein.
在一些实施方式中,所述获取当前用户与特定用户间的历史聊天记录的请求还可以是触发显示当前用户与特定用户间的未读即时消息的请求。举例说明,当用户通过打开聊天工具中与特定用户的聊天窗口的操作,触发显示未读即时消息时,可以确定发送了获取当前用户与特定用户间的历史聊天记录的请求。又举例说明,若用户关闭了与特定用户的聊天窗口,当接收到特定用户发送到向当前用户发送的即时消息时,即时聊天工具可以显示提示信息,提示用户存在未读消息。当用户点击所述提示消息以触发显示所述未读消息时,可以确定发送了获取当前用户与特定用户间的历史聊天记录的请求。需要说明的是,在一些实施方式中,在接收到触发显示当前用户与特定用户间的未读即时消息的请求后,还可以判断所述未读即时消息的数量或者容量是否小于设定阈值;若判断结果为是,则确定发送获取当前用户与特定用户间的历史聊天记录的请求。其中,所述设定阈值可以根据需要设定,例如所述设定阈值可以是即时聊天工具的显示界面显示消息的数量或者容量的上限。其中,消息的容量可以是指消息包含的信息的字数、行数 或者所占空间等。举例说明,假设当前用户A关闭了与用户B的聊天窗口,当接收到用户B发送给用户A的新消息时,可以判断新消息的数量或者容量是否大于显示界面显示消息的上限;若判断结果为否,则获取历史聊天记录,以便将新消息与历史聊天记录合并展示,方便用户快速地获取上下文信息,方便用户交流。In some embodiments, the request to obtain a historical chat record between the current user and the specific user may also be a request to trigger an unread instant message between the current user and the particular user. For example, when the user triggers the display of the unread instant message by opening the chat window with the specific user in the chat tool, it may be determined that the request for obtaining the historical chat record between the current user and the specific user is sent. For example, if the user closes the chat window with the specific user, when receiving the instant message sent by the specific user to the current user, the instant chat tool can display the prompt information to prompt the user that there is an unread message. When the user clicks on the prompt message to trigger the display of the unread message, it may be determined that a request to obtain a historical chat record between the current user and the specific user is sent. It should be noted that, in some implementations, after receiving the request to trigger the display of the unread instant message between the current user and the specific user, it may further be determined whether the quantity or capacity of the unread instant message is less than a set threshold; If the result of the determination is yes, it is determined to send a request to obtain a historical chat record between the current user and the specific user. The setting threshold may be set according to requirements. For example, the setting threshold may be an upper limit of the number of displays or the capacity of the display interface of the instant messaging tool. The capacity of the message may refer to the number of words and the number of rows of the information contained in the message. Or the space occupied. For example, if the current user A closes the chat window with user B, when receiving a new message sent by user B to user A, it can be determined whether the number or capacity of the new message is greater than the upper limit of the display interface display message; If no, the historical chat record is obtained, so that the new message and the historical chat record are combined and displayed, so that the user can quickly obtain the context information and facilitate the user to communicate.
在一些实施方式中,所述获取当前用户与特定用户间的历史聊天记录的请求还可以是接收到特定用户发送到向当前用户发送的即时消息且判断所述即时消息的数量或者容量小于设定阈值时,则发送获取当前用户与特定用户间的历史聊天记录的请求。举例说明,不同于响应于用户触发显示未读消息的请求来获取历史聊天记录,在这一实施方式中,是获取到新的未读消息时且判断所述消息符合预设条件时,则触发获取历史聊天记录的请求。In some embodiments, the request to obtain a historical chat record between the current user and the specific user may also be that the specific user is sent to the instant message sent to the current user and the number or capacity of the instant message is determined to be less than the setting. At the threshold, a request to obtain a historical chat record between the current user and a specific user is sent. For example, instead of obtaining a historical chat record in response to a user triggering a request to display an unread message, in this embodiment, when a new unread message is acquired and the message is determined to meet a preset condition, the trigger is triggered. Get a request for a history chat.
在一些实施方式中,所述从缓存中读取当前用户与特定用户间的历史聊天记录包括:判断是否从本地存储空间读取过所述当前用户与特定用户间的历史聊天记录;若判断结果为是,从缓存中读取当前用户与特定用户间的历史聊天记录。进一步地,所述方法还包括:若判断结果为否,从本地存储空间读取所述当前用户与特定用户间的历史聊天记录,将读取的所述聊天记录存储在缓存中,记录已从本地存储空间读取过所述当前用户与特定用户间的历史聊天记录。举例说明,当接收到获取历史聊天记录的请求时,可以判断是否从本地存储空间中读取过所述聊天记录。例如,可以设置标识用于区分是否从本地读取过聊天记录。若根据设置的标识判断从本地存储空间读取过所述聊天记录,则直接从缓存中读取聊天记录。若根据设置的标识判断未从本地存储空间读取过聊天记录,则可以从本地存储空间读取聊天记录并将其存储到缓存中。进一步地,设置标识用于表明已从本地存储空间读取过聊天记录。当再次接收到获取聊天记录的请求时,则可以直接从缓存中获取聊天记录。由于仅仅在标识未从本地存储空间读取聊天记录时访问本地存储空间,其他场景均从缓存中读取聊天记录,大大提高了获取聊天记录的速度,并降低了对本地存储空间的损耗。In some implementations, the reading, by the cache, the historical chat record between the current user and the specific user includes: determining whether the historical chat record between the current user and the specific user is read from the local storage space; As a result, 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 a historical chat record between the current user and a specific user from the local storage space, storing the read chat record in a cache, and recording has been The local storage space reads historical chat records between the current user and a specific user. For example, when receiving a request to obtain a historical chat record, it may be determined whether the chat record has been read from the local storage space. For example, an identifier can be set to distinguish whether a chat record has been read locally. If the chat record is read from the local storage space according to the set identifier, the chat record is directly read from the cache. If it is judged that the chat record has not been read from the local storage space according to the set identifier, the chat record can 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 to obtain the chat record is received again, the chat record can be obtained directly from the cache. Since the local storage space is accessed only when the logo is not read from the local storage space, other scenes read the chat record from the cache, which greatly improves the speed of obtaining the chat record and reduces the loss of the local storage space.
在一些实施方式中,所述方法还包括:当确定满足触发条件时,预先从本地存储空间中读取当前用户与特定用户间的历史聊天记录,将读取的所述聊天记录保存在缓存中。在这一实现方式中,可以预先从本地存储空间中读取历史聊天记录,并将其保存在缓存中。当接收到获取聊天记录的请求时,每次均从缓存中获取聊天记录。其中,预先获取历史聊天记录的时机可以是满足触发条件,具体的触发条件可以是非常灵活的,只要是在接收到获取聊天记录请求之前,从本地存储空间一次性获取历史聊天记录即可。举例 说明,当接收到特定用户发送给当前用户的即时消息时,可以确定满足触发条件。又举例说明,当接收到用户触发显示当前用户与特定用户的聊天窗口的操作时,确定满足触发条件。当然以上仅为示例性说明,具体的触发条件可以是灵活多样的,只要是在接收到获取聊天记录请求之前,从本地存储空间一次性获取历史聊天记录即可。In some embodiments, the method further includes: when determining that the trigger condition is met, reading a historical chat record between the current user and the specific user from the local storage space, and saving the read chat record in the cache. . In this implementation, historical chat records can be read from the local storage space in advance and saved in the cache. When a request to get a chat record is received, the chat record is obtained from the cache each time. The timing of obtaining the historical chat record in advance may be that the trigger condition is met, 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 obtaining the chat record. Example It is stated that when an instant message sent by a specific user to the current user is received, it may be determined that the trigger condition is met. For example, when the user is triggered to display an operation of displaying a chat window of 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 trigger condition may be flexible and diverse, as long as the historical chat record is obtained from the local storage space at one time before receiving the request to obtain the chat record.
在一些实施方式中,所述从缓存中读取当前用户与特定用户间的历史聊天记录包括:判断缓存中存储的当前用户与特定用户间的历史聊天记录的数量或者容量是否大于设定阈值;若判断结果为是,直接从缓存中读取数量或者容量与设定阈值相等的历史聊天记录;若判断为否,从本地存储空间中读取部分历史聊天记录,并存储到缓存中,使得缓存中的历史聊天记录的数量或者容量大于或者等于设定阈值。举例说明,当用户点击“查看更多”时,可以触发加载N条历史消息。其中,N的设置可以根据需要进行。这时,找到聊天会话的最上面的一条消息(一般距离当前时间最长的一条消息),然后以这条消息为边界,从缓存中向前读取N条历史消息记录。具体地,若缓存中历史消息记录足够,即大于或者等于N,则直接将读取的历史聊天记录显示到聊天会话的最上面。若判断缓存中保存的历史消息记录小于N条,假设符合条件的缓存中消息为M条,从本地历史纪录中,以缓存中第一条消息记录为边界,向前读取(N-M)条,并存入缓存中。而后,找到聊天会话的最上面的一条消息,然后以这条消息为边界,从缓存中向前读取N条消息记录并展示。In some implementations, the reading, by the cache, the historical chat record between the current user and the specific user includes: determining whether the quantity or capacity of the historical chat record between the current user and the specific user stored in the cache is greater than a set threshold; If the judgment result is yes, the historical chat record whose quantity or capacity is equal to the set threshold is directly read from the cache; if the judgment is no, some historical chat records are read from the local storage space and stored in the cache, so that the cache is cached. The number or capacity of historical chat records in the middle is greater than or equal to the set threshold. For example, when the user clicks "View More", it can trigger the loading of N history messages. Among them, the setting of N can be performed as needed. At this time, the top message of the chat session (generally the one that is the longest from the current time) is found, and then N messages of the history are read forward from the cache with this message as the boundary. Specifically, if the history message record in the cache is sufficient, that is, greater than or equal to N, the read history chat record is directly displayed to the top of the chat session. If it is determined that the history message record saved in the cache is less than N, it is assumed that the message in the cache that meets the condition is M. From the local history record, the first message record in the cache is used as a boundary, and the (NM) item is read forward. 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 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 includes a picture, determining, according to the identifier of the picture, whether a picture corresponding to the identifier of the picture is stored in the cache; if the determination result is yes And acquiring a picture corresponding to the picture identifier from the cache. Further, if the determination result is no, the picture is obtained from the local storage space, and the corresponding relationship between the picture and the picture and the picture identifier is stored in the cache. For example, in the specific implementation of the present invention, when the chat record is saved, if the chat record includes a picture, the identifier of the picture is saved only in the chat record, and is used to identify the picture. Further, the present invention may set a picture cache for storing picture data corresponding to the picture ID. When the history chat record is obtained, if it is determined that the chat record includes a picture, for example, the chat record includes a picture ID, whether the picture corresponding to the picture ID is stored in the picture cache may be determined according to the picture ID; , the image content is directly displayed for display, thereby greatly improving the speed of obtaining the image without downloading the image from the local storage space every time. If it does not exist, the picture is read from the local storage space and saved in the picture cache. Since the pictures in the chat log of the instant chat tool are often repeated, for example, various expression pictures, it is only necessary to save the picture and the correspondence between the picture identifier and the picture in the picture cache, that is, when the same picture is obtained, the cache is obtained from the cache. Directly reading the picture and the same picture The identified image is only saved once in the cache, reducing the waste of storage space. The identifier of the image can be obtained by obtaining the MD5 value of the image. It should be noted that, through the above processing, the speed of acquiring and displaying the picture information can be separately improved without having to read the picture from the local disk every time.
S202,展示所述当前用户与特定用户间的历史聊天记录。S202. Display a historical chat record between the current user and a specific user.
需要说明的是,具体实现时,可以将历史聊天记录单独展示。也可以是将其与未读即时消息合并展示。例如,可以响应于用户触发显示所述即时消息的请求,将所述即时消息与所述历史聊天记录合并显示。It should be noted that, in the specific implementation, the historical chat record can be displayed separately. It can also be combined with an unread instant message. For example, the instant message may be displayed in combination with the historical chat record in response to a user triggering a request to display the instant message.
在一些实施方式中,所述方法还包括:保存从缓存中获取历史聊天记录的访问时间;当满足触发条件时,根据所述访问时间确定最近最少使用的历史聊天记录,从缓存中删除所述历史聊天记录。举例说明,若当前用户的聊天记录较多时,会造成缓存中存储的聊天记录和图片较多,占用计算机内存,为了减少内存占用,可以在每次访问缓存时,标识当前用户获取特定用户的聊天记录的访问时间;并可以触发判断当前缓存数据是否超出缓存上限且所述缓存中不存在未读新消息,若是,则根据所述访问时间确定最近最少使用的聊天记录,从缓存中删除所述聊天记录。所述最近最少使用的聊天记录可以是访问时间距离当前时间超过设定阈值的记录,也可以是在预设时间内访问次数最少的聊天记录。通过上述处理,可以有效减少内存占用、降低内存开销。In some embodiments, the method further includes: saving an access time of the historical chat record from the cache; determining the least recently used historical chat record according to the access time when the trigger condition is met, deleting the cached from the cache Historical chat history. For example, if there are more chat records in the current user, the chat records and pictures stored in the cache are more, and the computer memory is occupied. In order to reduce the memory occupation, the current user can be used to obtain the chat of the specific user every time the cache is accessed. Recording the access time; and may trigger to determine whether the current cached data exceeds the upper limit of the cache and there is no unread new message in the cache, and if so, determine the least recently used chat record according to the access time, and delete the cached record from the cache chat record. The least recently used chat record may be a record whose access time exceeds a set time from the current time, or may be a chat record with the least number of visits within a preset time. Through the above processing, memory usage can be effectively reduced and memory overhead can be reduced.
在一些实施方式中,所述从缓存中读取当前用户与特定用户间的历史聊天记录包括:从缓存中读取当前用户与特定用户间符合特定条件的部分历史聊天记录;所述特定条件包括符合特定时间条件、特定地点条件或者符合特定关键词的历史聊天记录;所述展示所述当前用户与特定用户间的历史聊天记录包括:展示所述部分历史聊天记录,其中,所述部分历史聊天记录中的各条聊天记录之间不具有时间连续关系或者所述历史聊天记录与当前即时聊天工具最近展示的聊天记录不具有时间连续关系。具体实现时,取代获取当前用户与特定用户间全部聊天记录并按照时间先后顺序连续展示聊天记录的方式,可以仅获取并展示符合特定条件的部分历史聊天记录。举例说明,例如符合特定时间条件的历史聊天记录。假设当前时间是周五,当前用户A与特定用户B正在通过即时聊天工具聊天。用户B提到:“咱们周二提到的事情处理的怎么样了”,这时用户A很有可能想要看看周二的聊天记录,这时可以将“周二”确定为关键词,仅从缓存中获取周二对应的历史聊天记录,并在聊天界面中展示周二的聊天记录。这样,周二的聊天记录和当前窗口展示的最近聊天记录(周五)即不具有时间连续关系。通过这样的方式,不仅可以获取更少的数据,而且方便用户直观地查看感兴趣的内容,而无需在大量的聊天记 录(例如周五至周二这一连续时间段内的所有聊天记录)中查找感兴趣的内容。又举例说明,所述聊天记录还可以是符合特定地点条件的聊天记录。假设当前用户频繁出差会改变登录地点,也可以根据用户的输入获取特定地点的聊天记录。再举例说明,所述部分历史聊天记录还可以是与特定关键词匹配的聊天记录。其中,在对关键词匹配时可以是完全匹配也可以是部分匹配,可以是精确匹配也可以是模糊匹配。进一步地,还可以使用机器学习算法进行人工智能自动匹配。举例说明,用户B提到“请问XX事宜处理得如何”,这时可以确定关键词“XX”,查找到与之匹配的聊天记录。若针对关键词“XX”,存在多条聊天记录,可以将其合并显示。例如当前时间是周五,分别在周二、周三都存在相关联的聊天记录,则可以以时间的倒序,展示周三、周二的聊天记录。这时,展示的所述部分历史聊天记录中的各条聊天记录之间不具有时间连续关系。In some implementations, the reading, by the cache, the historical chat record between the current user and the specific user includes: reading, from the cache, a partial historical chat record that meets a specific condition between the current user and the specific user; the specific condition includes a historical chat record that meets a specific time condition, a specific location condition, or a specific keyword; the historical chat record between the current user and the specific user is displayed: displaying the partial historical chat record, wherein the partial historical chat There is no time continuous relationship between each chat record in the record or the historical chat record does not have a time continuous relationship with the chat record recently displayed by the current instant chat tool. In the specific implementation, instead of obtaining all the chat records between the current user and the specific user and continuously displaying the chat records in chronological order, only part of the historical chat records meeting the specific conditions may be obtained and displayed. For example, a historical chat record that meets certain time conditions. Assuming that the current time is Friday, the current user A and the specific user B are chatting through the live chat tool. User B mentioned: "How are we going to deal with things mentioned on Tuesday?" At this time, User A is likely to want to check the chat history on Tuesday. At this time, "Tuesday" can be identified as a keyword, only from the cache. Get the historical chat history corresponding to Tuesday and show the chat history on Tuesday in the chat interface. Thus, 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 data, but also it is convenient for users to visually view the content of interest without having to write a lot of chats. Look for interesting content in the recording (for example, all chats in this continuous time period from Friday to Tuesday). For example, the chat record may also be a chat record that meets a specific location condition. It is assumed that the frequent travel of the current user will change the login location, and the chat history of the specific location may also be obtained according to the input of the user. For example, the partial history chat record may also be a chat record that matches a specific keyword. Wherein, when matching the keywords, it may be an exact match or a partial match, and may be an exact match or a fuzzy match. Further, artificial intelligence automatic matching can also be performed using a machine learning algorithm. For example, User B mentioned "How is the XX matter handled?", then you can determine the keyword "XX" and find the matching chat record. If there are multiple chat records for the keyword "XX", they can be combined and displayed. For example, the current time is Friday, and there are associated chat records on Tuesday and Wednesday respectively, and 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 each chat record in the partial historical chat record displayed.
为了便于本领域技术人员更清楚地理解本申请在具体场景下的实施方式,下面以两个具体示例对本申请实施方式进行介绍。需要说明的是,该具体示例仅为使得本领域技术人员更清楚地了解本发明,但本发明的实施方式不限于该具体示例。To facilitate a clear understanding of the embodiments of the present application in a specific scenario, the embodiments of the present application are described below with two specific examples. It should be noted that the specific examples are only for those skilled in the art to more clearly understand the present invention, but the embodiments of the present invention are not limited to the specific examples.
参见图3,为本发明另一实施例提供的即时聊天工具的聊天记录处理方法流程图。如图3所示,可以包括:FIG. 3 is a flowchart of a method for processing a chat log of a live chat tool according to another embodiment of the present invention. As shown in FIG. 3, it may include:
S301,即时聊天工具接收特定用户发送给当前用户的新消息。S301. The instant messenger tool receives a new message sent by a specific user to the current user.
举例说明,假设用户A在即时聊天工具登录后,收到用户B发送的新消息。For example, suppose user A receives a new message sent by user B after the instant messenger logs in.
S302,即时聊天工具将所述新消息保存在缓存中以及本地磁盘文件中。S302. The instant chat tool saves the new message in a cache and in a local disk file.
需要说明的是,新消息可以保存在缓存中较后面的存储位置,并标记为新消息,同时将其保存在本地磁盘文件中。从本地磁盘文件中读取的历史消息保存在缓存的较前面的存储位置。It should be noted that new messages can be saved in a later storage location in the cache and marked as new messages, while being saved in a local disk file. Historical messages read from local disk files are saved in the cache's earlier storage location.
S303,响应于用户触发显示新消息的请求,从所述缓存中读取所述新消息,判断所述新消息的数量或者容量是否小于设定阈值;若判断结果为是,执行S304;若判断结果为否,直接展示所述新消息,并将展示的所述消息保存在于所述特定用户对应的历史聊天记录缓存中。S303, in response to the user triggering the request to display a new message, reading the new message from the cache, determining whether the quantity or capacity of the new message is less than a set threshold; if the determination result is yes, executing S304; If the result is no, the new message is directly displayed, and the displayed message is saved in the historical chat record cache corresponding to the specific user.
S304,根据设定的访问标识判断是否从本地存储空间读取过所述当前用户与特定用户间的历史聊天记录。若判断结果为是,执行S305;若判断结果为否,执行S306;S304. Determine, according to the set access identifier, whether the historical chat record between the current user and the specific user is read from the local storage space. If the result of the determination is yes, execute S305; if the result of the determination is no, execute S306;
S305,从缓存中读取当前用户与特定用户的历史聊天记录,而后执行S307。S305. The historical chat record of the current user and the specific user is read from the cache, and then S307 is performed.
需要说明的是,缓存中保存了预先从本地磁盘文件读取的历史聊天记录以及直接存 储在缓存中的历史聊天记录,例如S303中展示的所述新消息,在用户查看过所述新消息后,即可以将展示的消息保存在于所述特定用户对应的历史聊天记录缓存中。It should be noted that the cache stores historical chat records read from local disk files and directly stores them. The historical chat record stored in the cache, for example, the new message displayed in S303, after the user views the new message, may save the displayed message in the historical chat record cache corresponding to the specific user.
S306,从本地磁盘文件中读取与所述特定用户对应的历史聊天记录,将所述聊天记录存储到缓存中,设置访问标识,用于表明已从本地存储空间读取过所述当前用户与特定用户间的历史聊天记录,而后执行S307。S306. The historical chat record corresponding to the specific user is read from the local disk file, the chat record is stored in the cache, and the access identifier is set to indicate that the current user has been read from the local storage space. A history chat record between specific users, and then S307 is executed.
S307,将所述新消息与所述历史聊天记录合并展示。S307. Combine the new message with the historical chat record.
在本发明具体实现时,可以为用户展示新消息的同时,还可以将历史聊天记录一起显示。当用户打开的聊天会话较多时,可以方便地知道上下文信息。由于可以从缓存中直接读取历史聊天记录,大大提高了获取聊天记录的速度以及展示消息的效率,为用户带来更好体验。In the specific implementation of the present invention, the new chat message can be displayed for the user, and the historical chat record can also be displayed together. When the user opens more chat sessions, the context information can be easily known. Since the historical chat record can be directly read from the cache, the speed of obtaining the chat record and the efficiency of displaying the message are greatly improved, and the user is provided with a better experience.
参见图4,为本发明再一实施例提供的即时聊天工具的聊天记录处理方法流程图。如图4所示,可以包括:FIG. 4 is a flowchart of a method for processing a chat log of a live chat tool according to still another embodiment of the present invention. As shown in FIG. 4, it may include:
S401,即时聊天工具接收特定用户发送给当前用户的新消息。S401. The instant messenger tool receives a new message sent by a specific user to the current user.
举例说明,假设用户A在即时聊天工具登录后,收到用户B发送的新消息。For example, suppose user A receives a new message sent by user B after the instant messenger logs in.
S402,即时聊天工具将所述新消息保存在缓存中以及本地磁盘文件中。S402. The instant chat tool saves the new message in a cache and in a local disk file.
需要说明的是,新消息可以保存在缓存中较后面的存储位置,并标记为新消息,同时将其保存在本地磁盘文件中。从本地磁盘文件中读取的历史消息保存在缓存的较前面的存储位置。It should be noted that new messages can be saved in a later storage location in the cache and marked as new messages, while being saved in a local disk file. Historical messages read from local disk files are saved in the cache's earlier storage location.
S403,响应于用户触发显示新消息的请求,从所述缓存中读取所述新消息,并展示所述新消息。S403. Read the new message from the cache and display the new message in response to the user triggering a request to display a new message.
举例说明,当用户A打开与用户B的聊天会话时,可以响应于所述触发操作,从缓存中找到用户A与用户B聊天消息的缓存,从缓存中读取标记为新消息的缓存数据,并清除新消息标记。然后,将读取的新消息在当前聊天会话的最下面展示。For example, when user A opens a chat session with user B, in response to the triggering operation, a cache of user A and user B chat messages may be found from the cache, and cached data marked as a new message is read from the cache. And clear the new message tag. The new message that is read is then displayed at the bottom of the current chat session.
S404,响应于用户触发获取历史聊天记录的请求,判断缓存中保存的历史聊天记录的数量或者容量是否大于N。若判断结果为是,执行S405;若判断结果为否,执行S406。S404. Determine, according to the user triggering the request for acquiring the historical chat record, whether the number or capacity of the historical chat records saved in the cache is greater than N. If the result of the determination is YES, S405 is performed; if the result of the determination is No, S406 is executed.
S405,直接从缓存中读取数量或者容量等于N的历史聊天记录。S405. Read a historical chat record whose quantity or capacity is equal to N directly from the cache.
S406,从本地磁盘文件中读取部分历史聊天记录并保存在缓存中,使得缓存中的历史聊天记录的数量或者容量大于N,从缓存中读取数量或者容量等于N的历史聊天记录。S406. Read a part of the historical chat record from the local disk file and save it in the cache, so that the number or capacity of the historical chat records in the cache is greater than N, and the historical chat record whose quantity or capacity is equal to N is read from the cache.
举例说明,当用户点击“查看更多”时,可以触发加载N条历史消息。其中,N的 设置可以根据需要进行。这时,找到当前会话窗口中最上面的一条消息,即当前会话窗口中显示的、距离当前时间最远的一条消息,以这条消息为边界,从缓存中向前读取N条历史消息记录。若判断缓存中保存的历史消息记录大于N条,则直接显示读取的N条历史记录。若判断缓存中保存的历史消息记录小于N条,例如当前缓存中保存的历史消息为M条,则以缓存中第一条消息记录为边界(例如缓存中保存的距离当前时间最远的一条记录),从本地历史消息记录中,以缓存中保存的距离当前时间最远的一条记录为界,向前读取(N-M)条消息记录,并将其存储至缓存中。然后,以当前会话窗口展示的最上面一条消息为界,从缓存中向前读取N条消息记录。For example, when the user clicks "View More", it can trigger the loading of N history messages. Among them, N Settings can be made as needed. At this time, find the top message in the current session window, that is, the message displayed in the current session window that is farthest from the current time. With this message as the boundary, read N history message records from the cache forward. . If it is determined that the history message record saved in the cache is greater than N, the read N history records are directly displayed. If it is determined 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, the first message record in the cache is used as a boundary (for example, a record stored in the cache that is the farthest from the current time) ), from the local history message record, read the (NM) message record forward and store it in the cache, bounded by a record in the cache that is farthest from the current time. Then, N messages are read forward from the cache, bounded by the top message displayed in the current session window.
S407,展示从缓存中获取的所述N条历史聊天记录。S407. Display the N historical chat records obtained from the cache.
参见图5,为本发明又一实施例提供的即时聊天工具的聊天记录处理方法流程图。如图5所示,可以包括:FIG. 5 is a flowchart of a method for processing a chat log of a live chat tool according to another embodiment of the present invention. As shown in FIG. 5, it may include:
S501,接收用户触发第一控件的操作。S501. Receive an operation of triggering a first control by a user.
S502,响应于用户触发第一控件的操作,显示当前用户与特定用户间的至少部分历史聊天记录;其中,所述至少部分历史聊天记录中的各条聊天记录之间不具有时间连续关系或者所述至少部分历史聊天记录与当前即时聊天工具最近展示的聊天记录之间不具有时间连续关系。S502. Display at least part of a historical chat record between the current user and the specific user in response to the user triggering the operation of the first control; wherein, the chat records in the at least part of the historical chat records do not have a time continuous relationship or There is no time continuous relationship between at least some of the historical chat records and the chat records recently displayed by the current instant messenger.
在一些实施方式中,所述方法还包括:接收用户触发第二控件的操作;响应于用户触发第二控件的操作,显示当前用户与特定用户间的至少部分历史聊天记录;其中,所述至少部分历史聊天记录中的各条聊天记录之间具有时间连续关系或者所述至少部分历史聊天记录与当前即时聊天工具最近展示的聊天记录之间具有时间连续关系。进一步地,在显示当前用户与特定用户间的至少部分历史聊天记录之前,所述方法还包括:从缓存中读取前用户与特定用户间的至少部分历史聊天记录;其中,所述缓存中保存有预先从本地存储空间中读取的历史聊天记录以及直接存储在所述缓存的历史聊天记录。In some embodiments, the method further includes: receiving an operation of the user triggering the second control; displaying at least 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 There is a time continuous relationship between each of the chat records in the partial history 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 former user and the specific user from the cache; wherein the cache is saved There are 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, instead of obtaining all the chat records of the user in the prior art and continuously displaying the chat records in chronological order, only part of the historical chat records meeting the specific conditions may be obtained and displayed, and the historical chat records displayed are displayed. There is no time continuous relationship between each of the chat records in the record, 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 the user to obtain a specific chat record. Since only a part of the historical chat record is acquired, the amount of acquired data is small, the reading speed is fast, and the efficiency of the user to obtain information is significantly improved, and the user experience is improved.
下面对具体的实现方式进行详细地说明。The specific implementation will be described in detail below.
具体实现时,可以在即时聊天工具的用户界面上展示第二控件和第一控件。其中,第二控件用于响应于用户的触发展示当前用户与特定用户间的至少部分历史聊天记录,所述至少部分历史聊天记录中的各条聊天记录之间具有时间连续关系或者所述历史聊天记录与当前即时聊天工具最近展示的聊天记录具有时间连续关系。所述第一控件用于响应于用户的触发展示当前用户与特定用户间符合特定条件的至少部分历史聊天记录,所述部分历史聊天记录中的各条聊天记录之间不具有时间连续关系或者所述历史聊天记录与当前即时聊天工具最近展示的聊天记录之间不具有时间连续关系.In a specific implementation, the second control and the first control may be displayed on a user interface of the instant messenger tool. The second control is configured to display at least part of a historical chat record between the current user and the specific user in response to the trigger of the user, where each of the at least partial historical chat records has a time continuous relationship or the historical chat Record a time-continuous relationship with the chat history recently shown by the current live chat tool. The first control is configured to display at least part of a historical chat record that meets a specific condition between a current user and a specific user in response to a trigger of the user, where each piece of the chat record does not have a time continuous relationship or There is no time continuous relationship between the historical chat record and the chat record recently displayed by the current instant chat tool.
举例说明,第二控件可以是显示最近N条聊天记录或者显示全部历史聊天记录,第一控件可以是显示相关聊天记录。例如,用户若想要看时间连续的历史聊天记录,例如周二到周五间的聊天记录时,可以点击第二控件。若用户想要查看部分相关的聊天记录时,可以触发第一控件。具体可以参见图6A。For example, the second control may be displaying the latest N chat records or displaying all historical chat records, and the first control may be displaying related chat records. For example, if a user wants to see a continuous history chat record, such as a chat record between Tuesday and Friday, the second control can be clicked. The first control can be triggered if the user wants to view some of the relevant chat records. See Figure 6A for details.
需要特别说明的是,响应于用户触发第一控件的操作,从缓存中读取当前用户与特定用户间符合特定条件的部分历史聊天记录可以是符合特定条件的部分历史聊天记录。所述特定条件包括符合特定时间条件、特定地点条件或者符合特定关键词的历史聊天记录。具体实现时,取代获取当前用户与特定用户间全部聊天记录并按照时间先后顺序连续展示聊天记录的方式,可以仅获取并展示符合特定条件的部分历史聊天记录。举例说明,例如符合特定时间条件的历史聊天记录。假设当前时间是周五,当前用户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, a partial historical chat record that reads a specific condition between the current user and the specific user from the cache may be a partial historical chat record that meets certain conditions. The specific conditions include historical chat records that meet certain time conditions, specific location conditions, or that match a particular keyword. In the specific implementation, instead of obtaining all the chat records between the current user and the specific user and continuously displaying the chat records in chronological order, only part of the historical chat records meeting the specific conditions may be obtained and displayed. For example, a historical chat record that meets certain time conditions. Assuming that the current time is Friday, the current user A and the specific user B are chatting through the live chat tool. User B mentioned: "How are we going to deal with things mentioned on Tuesday?" At this time, User A is likely to want to check the chat history on Tuesday. At this time, "Tuesday" can be identified as a keyword, only from the cache. Get the historical chat history corresponding to Tuesday and show the chat history on Tuesday in the chat interface. Thus, 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 data, but also the user can intuitively view the content of interest without having to search through a large number of chat records (such as all chat records in the continuous time period from Friday to Tuesday). Interested in content. For example, the chat record may also be a chat record that meets a specific location condition. It is assumed that the frequent travel of the current user will change the login location, and the chat history of the specific location may also be obtained according to the input of the user. For example, the partial history chat record may also be a chat record that matches a specific keyword. Wherein, when matching the keywords, it may be an exact match or a partial match, and may be an exact match or a fuzzy match. Further, artificial intelligence automatic matching can also be performed using a machine learning algorithm. For example, User B mentioned "How is the XX matter handled?", then you can determine the keyword "XX" and find the matching chat record. If there are multiple chat records for the keyword "XX", they can be combined and displayed. For example, the current time is Friday, and there are associated chat records on Tuesday and Wednesday respectively, and 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 each chat record in the partial historical chat record 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 invention, multiple controls can be displayed in the user interface, and different display modes are entered according to the user's triggering operation on the control. One display mode is to display all or part of the chat history in a time-continuous manner. One display mode is to display partial chat records in a non-time-continuous manner. 6B and 6C are schematic diagrams of effects according to an embodiment of the present invention. 6B is a time-continuous display mode, and FIG. 6C is a non-time continuous display mode in which a dotted line is used to separate new chat history and historical chat history. For example, suppose the current user A and user B are chatting through the instant chat tool, and the currently recently displayed chat record is the new messages 103 and 104, and the message 104 is generated at 9:31 on January 8, 2016, the message 103 The build time is 9:28 on January 8, 2016. In a specific implementation, the second control 105 may be displayed on the display interface of the instant chat tool, for example, a control for displaying all the chat records; and the first control 106 is displayed, for example, a control for displaying the related chat record.
参见图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 former user A and the user B in a continuous time period are read from the cache, and the chat records are sequentially displayed in chronological order. 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 log messages 101, 102, ... 107 are further displayed. The generation time of the messages 101, 102, and 107 is continuous, that is, the chat records that are continuously generated by the user in the current time are obtained, and the display is also displayed in chronological order. Corresponding to the display mode of FIG. 6B, if the user wants to view the chat history on Tuesday (ie, January 4, 2016), it is necessary to search in the continuous chat record traced 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 selects to display the related chat record, the historical chat record of the former user A and the user B that meets the specific conditions is read from the cache. As shown in FIG. 6C, if the user triggers the second control, in addition to displaying the message 103 and the message 104, only the chat record 107 associated with the current message is displayed, ie, only the chat record on Tuesday (January 4, 2016) is displayed. Instead of displaying messages 101, 102, etc. Corresponding to the display mode of FIG. 6C, if the user can conveniently view the chat history on Tuesday (ie, January 4, 2016), it is not necessary to search in a large number of consecutive chat records traced from the current time.
参见图7,为本发明一实施例提供的即时聊天工具的聊天记录处理装置示意图。FIG. 7 is a schematic diagram of a chat record processing apparatus of a live chat tool according to an embodiment of the present invention.
一种即时聊天工具的聊天记录处理装置700,包括:A chat record processing apparatus 700 for a live chat tool includes:
获取单元701,用于响应于获取当前用户与特定用户间的历史聊天记录的请求,从 缓存中读取当前用户与特定用户间的历史聊天记录;其中,所述缓存中保存有预先从本地存储空间中读取的历史聊天记录以及直接存储在所述缓存的历史聊天记录;The obtaining unit 701 is configured to respond to the request for acquiring a historical chat record between the current user and the specific user, Reading, in the cache, a historical chat record between the current user and the specific user; wherein the cache stores a historical chat record read in advance from the local storage space and a historical chat record directly stored in the cache;
展示单元702,用于展示所述历史聊天记录。The display unit 702 is configured to display the historical chat record.
在一些实施方式中,所述获取单元包括:In some embodiments, the obtaining unit comprises:
第一判断单元,用于判断是否从本地存储空间读取过所述当前用户与特定用户间的历史聊天记录;a first determining unit, configured to determine whether a historical chat record between the current user and a specific user is read from a local storage space;
第一读取单元,用于若判断已从本地存储空间读取过所述当前用户与特定用户间的历史聊天记录时,从缓存中读取当前用户与特定用户间的历史聊天记录。The first reading unit is configured to: when the historical chat record between the current user and the specific user has been read from the local storage space, read the historical chat record between the current user and the specific user from the cache.
在一些实施方式中,所述装置还包括:In some embodiments, the device further comprises:
第二读取单元,用于若判断未从本地存储空间读取过所述当前用户与特定用户间的历史聊天记录时,从本地存储空间读取所述当前用户与特定用户间的历史聊天记录;a second reading unit, configured to: when the historical chat record between the current user and the specific user is not read from the local storage space, read the historical chat record between the current user and the specific user from the local storage space ;
第一存储单元,用于将读取的所述聊天记录存储在缓存中,记录已从本地存储空间读取过所述当前用户与特定用户间的历史聊天记录。The first storage unit is configured to store the read chat record in a cache, and record a history chat record between the current user and a specific user that has been read from the local storage space.
在一些实施方式中,所述装置还包括:In some embodiments, the device further comprises:
第三读取单元,用于当确定满足触发条件时,预先从本地存储空间中读取当前用户与特定用户间的历史聊天记录;a third reading unit, configured to read, in advance, a historical chat record between the current user and the specific user from the local storage space when it is determined that the trigger condition is met;
第二存储单元,用于将读取的所述聊天记录保存在缓存中。a second storage unit, configured to save the read chat record in a cache.
在一些实施方式中,所述装置还包括:In some embodiments, the device further comprises:
第二判断单元,用于当确定所述历史聊天记录包含图片时,根据所述图片的标识判断缓存中是否存储有与所述图片的标识对应的图片;a second determining unit, configured to determine, according to the identifier of the picture, whether a picture corresponding to the identifier of the picture is stored in the cache, when determining that the historical chat record includes a picture;
第四读取单元,用于若判断结果为是,从缓存中获取与所述图片标识对应的图片。The fourth reading unit is configured to: if the determination result is yes, obtain a picture corresponding to the picture identifier from the cache.
第五读取单元,用于若判断结果为否,从本地存储空间中获取所述图片;a fifth reading unit, configured to: if the determination result is no, obtain the picture from a local storage space;
第三存储单元,用于在缓存中存储所述图片以及图片与图片标识的对应关系。And a third storage unit, configured to store, in the cache, the corresponding relationship between the picture and the picture and the picture identifier.
在一些实施方式中,所述装置还包括:In some embodiments, the device further comprises:
第四存储单元,用于保存从缓存中获取历史聊天记录的访问时间;a fourth storage unit, configured to save an access time for obtaining a historical chat record from the cache;
删除单元,用于当满足触发条件时,根据所述访问时间确定最近最少使用的历史聊天记录,从缓存中删除所述历史聊天记录。And a deleting unit, configured to determine a least recently used historical chat record according to the access time when the trigger condition is met, and delete the historical chat record from the cache.
在一些实施方式中,所述装置还包括:In some embodiments, the device further comprises:
发送单元,用于当接收到特定用户向当前用户发送的即时消息时,判断所述即时消息的数量或者容量是否小于设定阈值;若判断结果为是,发送获取当前用户与特定用户 间的历史聊天记录的请求。The sending unit is configured to: when receiving an instant message sent by the specific user to the current user, determine whether the quantity or capacity of the instant message is less than a set threshold; if the determination result is yes, send the current user and the specific user A request for a history chat between records.
在一些实施方式中,所述展示单元具体用于:In some embodiments, the display unit is specifically configured to:
响应于用户触发显示所述即时消息的请求,将所述即时消息与所述历史聊天记录合并显示。The instant message is displayed in combination with the historical chat record in response to the user triggering a request to display the instant message.
在一些实施方式中,所述获取单元包括:第三判断单元,用于判断缓存中存储的当前用户与特定用户间的历史聊天记录的数量或者容量是否大于设定阈值;第六读取单元,用于若判断结果为是,直接从缓存中读取数量或者容量与设定阈值相等的历史聊天记录;第七读取单元,用于从本地存储空间中读取部分历史聊天记录,并存储到缓存中,使得缓存中的历史聊天记录的数量或者容量大于或者等于设定阈值。In some embodiments, the obtaining unit includes: a third determining unit, configured to determine whether the quantity or capacity of the historical chat record between the current user and the specific user stored in the cache is greater than a set threshold; the sixth reading unit, If the result of the determination is yes, the historical chat record whose quantity or capacity is equal to the set threshold is directly read from the cache; the seventh reading unit is configured to read part of the historical chat record from the local storage space, and store the 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 embodiments, the obtaining unit is specifically configured to read, from the cache, a partial historical chat record that meets a specific condition between the current user and the specific user; the specific condition includes meeting a specific time condition, a specific location condition, or meeting a specific key. Historical chat history of words;
所述展示单元具体用于展示所述部分历史聊天记录,其中,所述部分历史聊天记录中的各条聊天记录之间不具有时间连续关系或者所述历史聊天记录与当前即时聊天工具最近展示的聊天记录不具有时间连续关系。The display unit is specifically configured to display the partial historical chat record, wherein each of the partial chat chat records does not have a time continuous relationship or the historical chat record is recently displayed by the current instant chat tool. Chat records do not have a time continuous relationship.
参见图8,为本发明又一实施例提供的即时聊天工具的聊天记录处理装置示意图。FIG. 8 is a schematic diagram of a chat record processing apparatus of a live chat tool according to another embodiment of the present invention.
一种即时聊天工具的聊天记录处理装置800,包括:A chat record processing apparatus 800 for a live chat tool, comprising:
接收单元801,用于接收用户触发第一控件的操作。The receiving unit 801 is configured to receive an operation of the user triggering the first control.
显示单元802,用于应于用户触发第一控件的操作,显示当前用户与特定用户间的至少部分历史聊天记录;其中,所述至少部分历史聊天记录中的各条聊天记录之间不具有时间连续关系或者所述至少部分历史聊天记录与当前即时聊天工具最近展示的聊天记录之间不具有时间连续关系。The display unit 802 is 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 first control; wherein, there is no time between each of the chat records in the at least part of the historical chat record There is no time-continuous relationship between the continuous relationship or the at least partial historical chat record and the chat record recently displayed by the current instant messenger.
在一些实施方式中,所述接收单元801还用于:接收用户触发第二控件的操作。In some embodiments, the receiving unit 801 is further configured to: receive an operation of the user triggering the second control.
在一些实施方式中,所述显示单元802还用于:响应于用户触发第二控件的操作,显示当前用户与特定用户间的至少部分历史聊天记录;其中,所述至少部分历史聊天记录中的各条聊天记录之间具有时间连续关系或者所述至少部分历史聊天记录与当前即时聊天工具最近展示的聊天记录之间具有时间连续关系。In some embodiments, the display unit 802 is further configured to: display at least part of a historical chat record between the current user and the specific user in response to the user triggering the operation of the second control; wherein, in the at least part of the historical chat record There is a time continuous relationship between each 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, the device further comprises:
读取单元,用于从缓存中读取前用户与特定用户间的至少部分历史聊天记录;其中,所述缓存中保存有预先从本地存储空间中读取的历史聊天记录以及直接存储在所述缓存 的历史聊天记录。a reading unit, configured to read at least part of a historical chat record between the former user and the specific user from the cache; wherein the cache stores a historical chat record read in advance from the local storage space and directly stored in the cache Cache Historical chat history.
其中,本发明装置各单元或模块的设置可以参照图2至图6所示的方法而实现,在此不赘述。The arrangement of each unit or module of the device of the present invention can be implemented by referring 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执行所述一个或者一个以上程序包含用于进行以下操作的指令:响应于获取当前用户与特定用户间的历史聊天记录的请求,从缓存中读取当前用户与特定用户间的历史聊天记录;其中,所述缓存中保存有预先从本地存储空间中读取的历史聊天记录以及直接存储在所述缓存的历史聊天记录;展示所述当前用户与特定用户间的历史聊天记录。FIG. 9 is a diagram of an apparatus for chat recording processing of a live chat tool according to another embodiment of the present application. Including: at least one processor 901 (eg, a CPU), a memory 902, and at least one communication bus 903 for enabling connection 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), and may also include a non-volatile memory such as at least one disk memory. One or more programs are stored in the memory, and are configured to be executed by one or more processors 901. The one or more programs include instructions for: in response to obtaining a history between a current user and a particular user The request of the chat record reads a historical chat record between the current user and the specific user from the cache; wherein the cache stores a historical chat record read in advance from the local storage space and a history directly stored in the cache Chat history; shows historical chat history between the current user and a specific user.
在一些实施方式中,处理器901具体用于执行所述一个或者一个以上程序包含用于进行以下操作的指令:判断是否从本地存储空间读取过所述当前用户与特定用户间的历史聊天记录;若判断结果为是,从缓存中读取当前用户与特定用户间的历史聊天记录。In some embodiments, the processor 901 is specifically configured to execute the one or more programs including instructions for: determining whether a historical chat record between the current user and a specific user is read from a local storage space If the result of the determination is yes, the historical chat record between the current user and the specific user is read from the cache.
在一些实施方式中,处理器901具体用于执行所述一个或者一个以上程序包含用于进行以下操作的指令:若判断结果为否,从本地存储空间读取所述当前用户与特定用户间的历史聊天记录,将读取的所述聊天记录存储在缓存中,记录已从本地存储空间读取过所述当前用户与特定用户间的历史聊天记录。In some embodiments, the processor 901 is specifically configured to execute, by the one or more programs, an instruction for: if the determination result is no, reading between the current user and a specific user from a local storage space The history chat record stores the read chat record in a cache, and records the history chat record between the current user and the specific user that has been read from the local storage space.
在一些实施方式中,处理器901具体用于执行所述一个或者一个以上程序包含用于进行以下操作的指令:当确定满足触发条件时,预先从本地存储空间中读取当前用户与特定用户间的历史聊天记录,将读取的所述聊天记录保存在缓存中。In some embodiments, the processor 901 is specifically configured to execute the one or more programs including instructions for: reading, between the current user and the specific user, from the local storage space when it is determined that the trigger condition is met Historical chat history, the read chat record is saved in the cache.
在一些实施方式中,处理器901具体用于执行所述一个或者一个以上程序包含用于进行以下操作的指令:当确定所述历史聊天记录包含图片时,根据所述图片的标识判断缓存中是否存储有与所述图片的标识对应的图片;若判断结果为是,从缓存中获取与所述图片标识对应的图片。In some embodiments, the processor 901 is specifically configured to execute, by the one or more programs, an instruction for: when determining that the historical chat record includes a picture, determining whether the cache is determined according to the identifier of the picture A picture corresponding to the identifier of the picture is stored; if the result of the determination is yes, the picture corresponding to the picture identifier is obtained from the cache.
在一些实施方式中,处理器901具体用于执行所述一个或者一个以上程序包含用于进行以下操作的指令:若判断结果为否,从本地存储空间中获取所述图片,在缓存中存储所述图片以及图片与图片标识的对应关系。 In some embodiments, the processor 901 is specifically configured to execute, by the one or more programs, an instruction for: if the determination result is no, the image is obtained from a local storage space, and the storage is stored in the cache. The picture and the correspondence between the picture and the picture identifier.
在一些实施方式中,处理器901具体用于执行所述一个或者一个以上程序包含用于进行以下操作的指令:保存从缓存中获取历史聊天记录的访问时间;当满足触发条件时,根据所述访问时间确定最近最少使用的历史聊天记录,从缓存中删除所述历史聊天记录。In some embodiments, the processor 901 is specifically configured to execute the one or more programs including instructions for: saving an access time of acquiring a historical chat record from a cache; when the trigger condition is met, according to the The access time determines the least recently used historical chat history and deletes the historical chat history from the cache.
在一些实施方式中,处理器901具体用于执行所述一个或者一个以上程序包含用于进行以下操作的指令:当接收到特定用户向当前用户发送的即时消息时,判断所述即时消息的数量或者容量是否小于设定阈值;若判断结果为是,发送获取当前用户与特定用户间的历史聊天记录的请求。In some embodiments, the processor 901 is specifically configured to execute the one or more programs including instructions for: determining an amount of the instant message when receiving an instant message sent by a specific user to a current user Or whether the capacity is less than a set threshold; if the judgment result is yes, a request for obtaining a historical chat record between the current user and the specific user is sent.
在一些实施方式中,处理器901具体用于执行所述一个或者一个以上程序包含用于进行以下操作的指令:响应于用户触发显示所述即时消息的请求,将所述即时消息与所述历史聊天记录合并显示。In some embodiments, the processor 901 is specifically configured to execute the one or more programs including instructions for: in response to a user triggering a request to display the instant message, the instant message and the history The chat history is merged and displayed.
在一些实施方式中,处理器901具体用于执行所述一个或者一个以上程序包含用于进行以下操作的指令:判断缓存中存储的当前用户与特定用户间的历史聊天记录的数量或者容量是否大于设定阈值;若判断结果为是,直接从缓存中读取数量或者容量与设定阈值相等的历史聊天记录;若判断为否,从本地存储空间中读取部分历史聊天记录,并存储到缓存中,使得缓存中的历史聊天记录的数量或者容量大于或者等于设定阈值。In some embodiments, the processor 901 is specifically configured to execute the one or more programs including instructions for determining whether the number or capacity of historical chat records between the current user and the specific user stored in the cache is greater than Set the threshold; if the judgment result is yes, directly read the historical chat record whose quantity or capacity is equal to the set threshold; if the judgment is no, read some historical chat records from the local storage space and store them in the cache The number or capacity of historical chat records in the cache is made greater than or equal to a set threshold.
本发明实施例还提供了一种用于即时聊天工具的聊天记录处理的装置,包括:至少一个处理器(例如CPU),存储器和至少一个通信总线,用于实现这些设备之间的连接通信。处理器用于执行存储器中存储的可执行模块,例如计算机程序。存储器可能包含高速随机存取存储器(RAM:Random Access Memory),也可能还包括非不稳定的存储器(non-volatile memory),例如至少一个磁盘存储器。一个或者一个以上程序存储于存储器中,且经配置以由一个或者一个以上处理器执行所述一个或者一个以上程序包含用于进行以下操作的指令:接收用户触发第一控件的操作;响应于用户触发第一控件的操作,显示当前用户与特定用户间的至少部分历史聊天记录;其中,所述至少部分历史聊天记录中的各条聊天记录之间不具有时间连续关系或者所述至少部分历史聊天记录与当前即时聊天工具最近展示的聊天记录之间不具有时间连续关系。The embodiment of the invention further provides an apparatus for chat recording processing of a live chat tool, comprising: at least one processor (for example, a CPU), a memory and at least one communication bus for implementing connection communication between the devices. The processor is for executing an executable module, such as a computer program, stored in the memory. The memory may include a high speed random access memory (RAM), and may also include a non-volatile memory such as at least one disk memory. 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 by a user to trigger the first control; responsive to the user Triggering an operation of the first control, displaying at least part of a historical chat record between the current user and the specific user; wherein, the at least part of the historical chat records do not have a time continuous relationship or the at least part of the historical chat There is no time continuous relationship between the record and the chat history recently displayed by the current instant messenger.
在一些实施方式中,所述一个或者一个以上处理器具体用于执行所述一个或者一个以上程序包含用于进行以下操作的指令:接收用户触发第二控件的操作;响应于用户触发第二控件的操作,显示当前用户与特定用户间的至少部分历史聊天记录;其中,所述至少部分历史聊天记录中的各条聊天记录之间具有时间连续关系或者所述至少部分历史聊天记录与当前即时聊天工具最近展示的聊天记录之间具有时间连续关系。 In some embodiments, the one or more processors are specifically configured to execute the one or more programs including instructions for: receiving an operation of a user triggering a second control; triggering a second control in response to a user And displaying at least part of a historical chat record between the current user and the specific user; wherein, at least part of the historical chat records have a time continuous relationship between the respective chat records or the at least part of the historical chat records and the current live chat There is a time-continuous relationship between the chat records recently displayed by the tool.
在一些实施方式中,所述一个或者一个以上处理器具体用于执行所述一个或者一个以上程序包含用于进行以下操作的指令:从缓存中读取前用户与特定用户间的至少部分历史聊天记录;其中,所述缓存中保存有预先从本地存储空间中读取的历史聊天记录以及直接存储在所述缓存的历史聊天记录。In some embodiments, the one or more processors are specifically configured to execute the one or more programs to include instructions for: reading at least a portion of historical chats between a pre-user and a particular user from a cache Recording; wherein the cache stores historical chat records read in advance from the local storage space and historical chat records directly stored in the cache.
本领域技术人员在考虑说明书及实践这里公开的发明后,将容易想到本发明的其它实施方案。本发明旨在涵盖本发明的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本发明的一般性原理并包括本公开未公开的本技术领域中的公知常识或惯用技术手段。说明书和实施例仅被视为示例性的,本发明的真正范围和精神由下面的权利要求指出。Other embodiments of the invention will be apparent to those skilled in the <RTIgt; The present invention is intended to cover any variations, uses, or adaptations of the present invention, which are in accordance with the general principles of the invention and include common general knowledge or common technical means in the art that are not disclosed in the present disclosure. . The specification and examples are to be considered as illustrative only,
应当理解的是,本发明并不局限于上面已经描述并在附图中示出的精确结构,并且可以在不脱离其范围进行各种修改和改变。本发明的范围仅由所附的权利要求来限制It is to be understood that the invention is not limited to the details of the details of The scope of the invention is limited only by the appended claims
以上所述仅为本发明的较佳实施例,并不用以限制本发明,凡在本发明的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。The above are only the preferred embodiments of the present invention, and are not intended to limit the present invention. Any modifications, equivalents, improvements, etc., which are within the spirit and scope of the present invention, should be included in the protection of the present invention. Within the scope.
需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。本发明可以在由计算机执行的计算机可执行指令的一般上下文中描述,例如程序模块。一般地,程序模块包括执行特定任务或实现特定抽象数据类型的例程、程序、对象、组件、数据结构等等。也可以在分布式计算环境中实践本发明,在这些分布式计算环境中,由通过通信网络而被连接的远程处理设备来执行任务。在分布式计算环境中,程序模块可以位于包括存储设备在内的本地和远程计算机存储介质中。It should be noted that, in this context, relational terms such as first and second are used merely to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply such entities or operations. There is any such actual relationship or order between them. Furthermore, the term "comprises" or "comprises" or "comprises" or any other variations thereof is intended to encompass a non-exclusive inclusion, such that a process, method, article, or device that comprises a plurality of elements includes not only those elements but also Other elements, or elements that are inherent to such a process, method, item, or device. An element that is defined by the phrase "comprising a ..." does not exclude the presence of additional equivalent elements in the process, method, item, or device that comprises the element. The invention may be described in the general context of computer-executable instructions executed by a computer, such as a program module. Generally, program modules include routines, programs, objects, components, data structures, and the like that perform particular tasks or implement particular abstract data types. The invention may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are connected through a communication network. In a distributed computing environment, program modules can be located in both local and remote computer storage media including storage devices.
本说明书中的各个实施例均采用递进的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于装置实施例而言,由于其基本相似于方法实施例,所以描述得比较简单,相关之处参见方法实施例的部分说明即可。以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者 也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。本领域普通技术人员在不付出创造性劳动的情况下,即可以理解并实施。以上所述仅是本发明的具体实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本发明原理的前提下,还可以做出若干改进和润饰,这些改进和润饰也应视为本发明的保护范围。 The various embodiments in the specification are described in a progressive manner, and the same or similar parts between the various embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the description of the method embodiment. The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separate, and the components displayed as units may be or It may not be a physical unit, that is, it may be located in one place, or it may be distributed to multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the embodiment. Those of ordinary skill in the art can understand and implement without any creative effort. The above is only a specific embodiment of the present invention, and it should be noted that those skilled in the art can also make several improvements and retouchings without departing from the principles of the present invention. It should be considered as the scope of protection of the present invention.

Claims (18)

  1. 一种即时聊天工具的聊天记录处理方法,其特征在于,包括:A chat record processing method for a live chat tool, comprising:
    响应于获取当前用户与特定用户间的历史聊天记录的请求,从缓存中读取当前用户与特定用户间的历史聊天记录;其中,所述缓存中保存有预先从本地存储空间中读取的历史聊天记录以及直接存储在所述缓存的历史聊天记录;Reading a historical chat record between the current user and the specific user from the cache in response to the request to obtain a historical chat record between the current user and the specific user; wherein the cache stores a history read from the local storage space in advance Chat history and historical chat records stored directly in the cache;
    展示所述当前用户与特定用户间的历史聊天记录。A historical chat record between the current user and a specific user is displayed.
  2. 根据权利要求1所述的方法,其特征在于,所述从缓存中读取当前用户与特定用户间的历史聊天记录包括:The method according to claim 1, wherein the reading the historical chat record between the current user and the specific user from the cache comprises:
    判断是否从本地存储空间读取过所述当前用户与特定用户间的历史聊天记录;Determining whether a historical chat record between the current user and a specific user is read from a local storage space;
    若判断结果为是,从缓存中读取当前用户与特定用户间的历史聊天记录。If the judgment result is yes, the historical chat record between the current user and the specific user is read from the cache.
  3. 根据权利要求2所述的方法,其特征在于,所述方法还包括:The method of claim 2, wherein the method further comprises:
    若判断结果为否,从本地存储空间读取所述当前用户与特定用户间的历史聊天记录,将读取的所述聊天记录存储在缓存中,记录已从本地存储空间读取过所述当前用户与特定用户间的历史聊天记录。If the judgment result is no, the historical chat record between the current user and the specific user is read from the local storage space, and the read chat record is stored in the cache, and the record has been read from the local storage space. Historical chat history between the user and a specific user.
  4. 根据权利要求1所述的方法,其特征在于,所述方法还包括:The method of claim 1 further comprising:
    当确定满足触发条件时,预先从本地存储空间中读取当前用户与特定用户间的历史聊天记录,将读取的所述聊天记录保存在缓存中。When it is determined that the trigger condition is met, the historical chat record between the current user and the specific user is read in advance from the local storage space, and the read chat record is saved in the cache.
  5. 根据权利要求4所述的方法,其特征在于,所述确定满足触发条件包括:The method according to claim 4, wherein said determining that the trigger condition is met comprises:
    当接收到特定用户发送给当前用户的即时消息时,确定满足触发条件;或者,When receiving an instant message sent by a specific user to the current user, it is determined that the trigger condition is met; or,
    当接收到用户触发显示当前用户与特定用户的聊天窗口的操作时,确定满足触发条件。When it is received that the user triggers an operation of displaying a chat window of the current user and a specific user, it is determined that the trigger condition is satisfied.
  6. 根据权利要求1所述的方法,其特征在于,所述方法还包括:The method of claim 1 further comprising:
    当确定所述历史聊天记录包含图片时,根据所述图片的标识判断缓存中是否存储有与所述图片的标识对应的图片;When it is determined that the historical chat record includes a picture, determining, according to the identifier of the picture, whether a picture corresponding to the identifier of the picture is stored in the cache;
    若判断结果为是,从缓存中获取与所述图片标识对应的图片。If the determination result is yes, the picture corresponding to the picture identifier is obtained from the cache.
  7. 根据权利要求6所述的方法,其特征在于,所述方法还包括:The method of claim 6 wherein the method further comprises:
    若判断结果为否,从本地存储空间中获取所述图片,在缓存中存储所述图片以及图片与图片标识的对应关系。If the judgment result is no, the picture is obtained from the local storage space, and the corresponding relationship between the picture and the picture and the picture identifier is stored in the cache.
  8. 根据权利要求1所述的方法,其特征在于,所述方法还包括:The method of claim 1 further comprising:
    保存从缓存中获取历史聊天记录的访问时间; Save the access time of the historical chat history from the cache;
    当满足触发条件时,根据所述访问时间确定最近最少使用的历史聊天记录,从缓存中删除所述历史聊天记录。When the trigger condition is met, the least recently used historical chat record is determined according to the access time, and the historical chat record is deleted from the cache.
  9. 根据权利要求1所述的方法,其特征在于,所述方法还包括:The method of claim 1 further comprising:
    当接收到特定用户向当前用户发送的即时消息时,判断所述即时消息的数量或者容量是否小于设定阈值;若判断结果为是,发送获取当前用户与特定用户间的历史聊天记录的请求。When the instant message sent by the specific user to the current user is received, it is determined whether the quantity or capacity of the instant message 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 the specific user is sent.
  10. 根据权利要求9所述的方法,其特征在于,所述展示历史聊天记录包括:The method of claim 9 wherein said displaying a history chat record comprises:
    响应于用户触发显示所述即时消息的请求,将所述即时消息与所述历史聊天记录合并显示。The instant message is displayed in combination with the historical chat record in response to the user triggering a request to display the instant message.
  11. 根据权利要求1、9或10所述的方法,其特征在于,所述从缓存中读取当前用户与特定用户间的历史聊天记录包括:The method according to claim 1, 9 or 10, wherein the reading the historical chat record between the current user and the specific user from the cache comprises:
    从缓存中读取当前用户与特定用户间符合特定条件的部分历史聊天记录;所述特定条件包括符合特定时间条件、特定地点条件或者符合特定关键词的历史聊天记录;所述展示所述当前用户与特定用户间的历史聊天记录包括:Reading, from the cache, a partial historical chat record that meets certain conditions between the current user and the specific user; the specific condition includes a historical chat record that meets a specific time condition, a specific location condition, or a specific keyword; the present user is displayed Historical chats with specific users include:
    展示所述部分历史聊天记录,其中,所述部分历史聊天记录中的各条聊天记录之间不具有时间连续关系或者所述历史聊天记录与当前即时聊天工具最近展示的聊天记录不具有时间连续关系。The part of the historical chat record is displayed, wherein each of the chat records in the partial history 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. .
  12. 根据权利要求1所述的方法,其特征在于,所述从缓存中读取当前用户与特定用户间的历史聊天记录包括:The method according to claim 1, wherein the reading the historical chat record between the current user and the specific user from the cache comprises:
    判断缓存中存储的当前用户与特定用户间的历史聊天记录的数量或者容量是否大于设定阈值;若判断结果为是,直接从缓存中读取数量或者容量与设定阈值相等的历史聊天记录;若判断为否,从本地存储空间中读取部分历史聊天记录,并存储到缓存中,使得缓存中的历史聊天记录的数量或者容量大于或者等于设定阈值。Determining whether the number or capacity of historical chat records between the current user and the specific user stored in the cache is greater than a set threshold; if the determination result is yes, directly reading the historical chat record whose quantity or capacity is equal to the set threshold; If the determination is no, a part of the historical chat record is read from the local storage space and stored in the cache, so that the number or capacity of the historical chat records in the cache is greater than or equal to the set threshold.
  13. 一种即时聊天工具的聊天记录处理方法,其特征在于,包括:A chat record processing method for a live chat tool, comprising:
    接收用户触发第一控件的操作;Receiving an operation of triggering a first control by a user;
    响应于用户触发第一控件的操作,显示当前用户与特定用户间的至少部分历史聊天记录;其中,所述至少部分历史聊天记录中的各条聊天记录之间不具有时间连续关系或者所述至少部分历史聊天记录与当前即时聊天工具最近展示的聊天记录之间不具有时间连续关系。Displaying at least part of a historical chat record between the current user and the specific user in response to the user triggering the operation of the first control; wherein, at least some of the chat records in the at least part of the historical chat record do not have a time continuous relationship or the at least There is no time-continuous relationship between some historical chats and the chats recently shown by the current instant messenger.
  14. 根据权利要求13所述的方法,其特征在于,所述方法还包括:接收用户触发第 二控件的操作;The method of claim 13 further comprising: receiving a user trigger The operation of the second control;
    响应于用户触发第二控件的操作,显示当前用户与特定用户间的至少部分历史聊天记录;其中,所述至少部分历史聊天记录中的各条聊天记录之间具有时间连续关系或者所述至少部分历史聊天记录与当前即时聊天工具最近展示的聊天记录之间具有时间连续关系。Displaying at least part of a historical chat record between the current user and the specific user in response to the user triggering the operation of the second control; wherein each of the at least partial historical chat records has a time continuous relationship or at least a portion The historical chat history has a time-continuous relationship with the chat history recently displayed by the current instant messenger.
  15. 根据权利要求13或14所述的方法,其特征在于,在显示当前用户与特定用户间的至少部分历史聊天记录之前,所述方法还包括:The method according to claim 13 or 14, wherein before the displaying at least part of the historical chat record between the current user and the specific user, the method further comprises:
    从缓存中读取前用户与特定用户间的至少部分历史聊天记录;其中,所述缓存中保存有预先从本地存储空间中读取的历史聊天记录以及直接存储在所述缓存的历史聊天记录。At least part of the historical chat record between the former user and the specific user is read from the cache; wherein the cache stores historical chat records read in advance from the local storage space and historical chat records directly stored in the cache.
  16. 一种即时聊天工具的聊天记录处理装置,其特征在于,包括:A chat record processing device for a live chat tool, comprising:
    获取单元,用于响应于获取当前用户与特定用户间的历史聊天记录的请求,从缓存中读取当前用户与特定用户间的历史聊天记录;其中,所述缓存中保存有预先从本地存储空间中读取的历史聊天记录以及直接存储在所述缓存的历史聊天记录;An obtaining unit, configured to read, from the cache, a historical chat record between the current user and the specific user in response to the request for acquiring the historical chat record between the current user and the specific user; wherein the cache stores the pre-local storage space Historical chat records read in and historical chat records stored directly in the cache;
    展示单元,用于展示所述历史聊天记录。a display unit for displaying the historical chat record.
  17. 一种即时聊天工具的聊天记录处理装置,其特征在于,包括:A chat record processing device for a live chat tool, comprising:
    接收单元,用于接收用户触发第一控件的操作;a receiving unit, configured to receive an operation of triggering a first control by a user;
    显示单元,用于应于用户触发第一控件的操作,显示当前用户与特定用户间的至少部分历史聊天记录;其中,所述至少部分历史聊天记录中的各条聊天记录之间不具有时间连续关系或者所述至少部分历史聊天记录与当前即时聊天工具最近展示的聊天记录之间不具有时间连续关系。a display unit, configured to display at least part of a historical chat record between the current user and the specific user in response to the user triggering the operation of the first control; wherein, the chat records in the at least part of the historical chat record do not have time continuity There is no time-continuous relationship between the relationship or the at least part of the historical chat record and the chat record recently displayed by the current instant messenger.
  18. 一种用于即时聊天工具的聊天记录处理的装置,其特征在于,包括有存储器,以及一个或者一个以上的程序,其中一个或者一个以上程序存储于存储器中,且经配置以由一个或者一个以上处理器执行所述一个或者一个以上程序包含用于进行以下操作的指令:An apparatus for chat recording processing of a live chat tool, comprising: a memory, and one or more programs, wherein one or more programs are stored in the memory and configured to be comprised of one or more The processor executing the one or more programs includes instructions for performing the following operations:
    响应于获取当前用户与特定用户间的历史聊天记录的请求,从缓存中读取当前用户与特定用户间的历史聊天记录;其中,所述缓存中保存有预先从本地存储空间中读取的历史聊天记录以及直接存储在所述缓存的历史聊天记录;Reading a historical chat record between the current user and the specific user from the cache in response to the request to obtain a historical chat record between the current user and the specific user; wherein the cache stores a history read from the local storage space in advance Chat history and historical chat records stored directly in the cache;
    展示所述当前用户与特定用户间的历史聊天记录。 A historical chat record between the current user and a specific user is displayed.
PCT/CN2017/110333 2016-11-22 2017-11-10 Method and device for processing chat log of real-time chat tool WO2018095223A1 (en)

Applications Claiming Priority (2)

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

Publications (1)

Publication Number Publication Date
WO2018095223A1 true WO2018095223A1 (en) 2018-05-31

Family

ID=62168642

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/110333 WO2018095223A1 (en) 2016-11-22 2017-11-10 Method and device for processing chat log of real-time chat tool

Country Status (3)

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

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112866272A (en) * 2021-01-27 2021-05-28 世纪龙信息网络有限责任公司 Anti-theft chain management and control method of cloud platform, downloading platform and equipment

Families Citing this family (8)

* 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 深圳市百宝廊珠宝首饰有限公司 Method and device for getting red envelope based on point 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
CN116450635B8 (en) * 2023-06-15 2024-03-22 中免日上互联科技有限公司 Data cleaning method and system based on artificial intelligence

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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
CN104348713A (en) * 2014-10-17 2015-02-11 国家电网公司 Instant messaging method based on comet of network platform under B/S (Browser/Server) architecture
CN105608100A (en) * 2015-08-31 2016-05-25 南京酷派软件技术有限公司 Information extraction method and information extraction device

Family Cites Families (7)

* 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
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
WO2016119165A1 (en) * 2015-01-29 2016-08-04 华为技术有限公司 Chat history display method and apparatus
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

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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
CN104348713A (en) * 2014-10-17 2015-02-11 国家电网公司 Instant messaging method based on comet of network platform under B/S (Browser/Server) architecture
CN105608100A (en) * 2015-08-31 2016-05-25 南京酷派软件技术有限公司 Information extraction method and information extraction device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112866272A (en) * 2021-01-27 2021-05-28 世纪龙信息网络有限责任公司 Anti-theft chain management and control method of cloud platform, downloading platform and equipment
CN112866272B (en) * 2021-01-27 2022-11-01 天翼数字生活科技有限公司 Anti-theft chain management and control method of cloud platform, downloading platform and equipment

Also Published As

Publication number Publication date
CN108090079B (en) 2021-03-02
TWI743163B (en) 2021-10-21
TW201820903A (en) 2018-06-01
CN108090079A (en) 2018-05-29

Similar Documents

Publication Publication Date Title
WO2018095223A1 (en) Method and device for processing chat log of real-time chat tool
US10284509B1 (en) Storage and processing of ephemeral messages
US10667109B2 (en) Forwarding activity-related information from source electronic devices to companion electronic devices
KR102450303B1 (en) Apparatus and method for maintaining a message thread with opt-in permanence for entries
KR101647071B1 (en) Architectural pattern for persistent web application design
US20160352839A1 (en) Activity continuation between electronic devices
CN103019770B (en) A kind of application program quick launch management system and method
US20210258394A1 (en) Synchronized console data and user interface playback
US7661036B1 (en) Cache for collecting events on a monitored computer
RU2595533C2 (en) System for displaying mail attachments on web mail page
US20130024526A1 (en) Method of managing feeds based on classifications
US11681766B2 (en) Preserving contextual relevance of content
US20160180560A1 (en) Image insertion in a message
US10873552B2 (en) Large data management in communication applications through multiple mailboxes
US11855940B2 (en) Methods, systems, and media for generating contextually relevant messages
WO2023016536A1 (en) Interaction method, apparatus and device, and storage medium
US8909715B2 (en) References to history points in a chat history
US20090094368A1 (en) Instant messaging general queue depth management
WO2021031941A1 (en) Session data processing method, device, user terminal, and storage medium
KR102097931B1 (en) Forwarding activity-related information from source electronic devices to companion electronic devices
US11115351B2 (en) Managing email content in an activity stream
US20220321615A1 (en) Progressive instantiation of workspaces for a group-based communication system
CN113805864A (en) Project engineering generation method and device, electronic equipment and storage medium
CN110622135B (en) System and method for providing content items in situations involving suboptimal network conditions
US20240098054A1 (en) Method for processing interest message and apparatus for implementing the same

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17873372

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 17873372

Country of ref document: EP

Kind code of ref document: A1