Session message display method and device, computer equipment and storage medium
By pre-storing multiple message data segments and matching the message identification of unread session messages, the problem of long wait time for jumping to @ messages in instant messaging applications is solved, and faster message content display is achieved and user experience is improved.
Patent Information
- Application Number
- CN202510191793.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-20
- Publication Date
- 2025-05-30
AI Technical Summary
After the user triggers the @My prompt message, existing instant messaging applications need to load multiple batches of session messages in reverse order, resulting in a long wait time for jumping to the @ message, affecting the user experience.
By pre-storing multiple message data segments, each data segment contains the message identification and content of multiple session messages, obtain the message identification of the unread session message and match it with the message identification in each message data segment, determine the target message data segment, and display the content of the unread session message.
The process of loading session messages in batches in reverse order is avoided, reducing the waiting time for jumping to unread session messages, and improving the user experience.
Smart Images

Figure CN120075181A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of instant messaging technology, and in particular, to a method, apparatus, computer device, and storage medium for displaying session messages. Background Art
[0002] With the development of technology, more and more users communicate through instant messaging (IM) applications on electronic devices. For example, multiple users can send session messages to each other through the IM application on their mobile phones.
[0003] In the IM application, in order to facilitate users to view session messages with a higher degree of relevance to themselves, the function of "@ message" is usually added. Through this function, for example, user A can send an "@ message" to user B by @-mentioning user B. In this way, in the session interface of user B, a prompt message of "someone @-mentioned me" can be displayed. At this time, user B can trigger this prompt message to jump to the "@ message" sent by user A to user B, and then view this "@ message" (subsequently referred to as user-related message).
[0004] However, since the IM application loads new session messages in batches in reverse order, and the total number of session messages loaded in each batch is usually about 50. If the "@ message" received by the user is not in the latest batch of session messages, after the user triggers the prompt message of "@-mentioned me", the IM application may need to continuously load multiple batches of session messages in reverse order to jump to the "@ message" for viewing. Therefore, this way of continuously loading multiple batches of session messages in reverse order will result in a long waiting time to jump to the "@ message", which is likely to affect the user experience. Summary of the Invention
[0005] The purpose of the embodiments of this application is to provide a method, apparatus, computer device, and storage medium for displaying session messages to solve the problem of long waiting time in the prior art.
[0006] The embodiments of this application provide a method for displaying session messages, including:
[0007] Obtain the message identifiers of unread session messages;
[0008] Obtain at least one stored message data segment, where the message data segment includes the message identifiers and corresponding message contents of at least one session message;
[0009] Match the message identifiers of the unread session messages with the message identifiers of the session messages in each message data segment respectively to determine the target message data segment corresponding to the unread session messages;
[0010] Display the message content of at least one session message including the unread session message in the target message data segment.
[0011] Correspondingly, an embodiment of the present application further provides a display device for session messages, including:
[0012] A first acquisition unit for acquiring the message identifier of the unread session message;
[0013] A second acquisition unit for acquiring at least one stored message data segment, where the message data segment includes the message identifiers and corresponding message contents of at least one session message;
[0014] A matching unit for matching the message identifier of the unread session message with the message identifiers of the session messages in each message data segment respectively to determine the target message data segment corresponding to the unread session message;
[0015] A display unit for displaying the message content of at least one session message including the unread session message in the target message data segment.
[0016] Correspondingly, an embodiment of the present application further provides a computer device, including a memory and a processor. A computer-readable instruction is stored in the memory, and when the processor executes the computer-readable instruction, the steps of the above method are implemented.
[0017] Correspondingly, an embodiment of the present application further provides a computer-readable storage medium, on which a computer-readable instruction is stored. When the computer-readable instruction is executed by a processor, the steps of the above method are implemented.
[0018] The present application provides a display method for session messages provided by the embodiments of the present application. By acquiring the message identifier of the unread session message; acquiring at least one stored message data segment, where the message data segment includes the message identifiers and corresponding message contents of at least one session message; matching the message identifier of the unread session message with the message identifiers of the session messages in each message data segment respectively to determine the target message data segment corresponding to the unread session message; and displaying the message content of at least one session message including the unread session message in the target message data segment. Since multiple message data segments are pre-stored, and each message data segment respectively includes the message identifiers and corresponding message contents of multiple session messages, during the process of displaying the message content of the unread session message, it is not necessary to load the session messages in batches in reverse order, so the waiting time for jumping to the unread session message can be reduced, and the user experience can be improved. Description of the Drawings
[0019] To more clearly illustrate the solutions in this application, the following will give a brief introduction to the accompanying drawings required for the description of the embodiments of this application. Obviously, the accompanying drawings in the following description are some embodiments of this application. For those of ordinary skill in the art, without creative efforts, other accompanying drawings can also be obtained based on these drawings.
[0020] Figure 1 Schematic diagram of a display system for instant communication information provided by an embodiment of this application;
[0021] Figure 2 Flowchart of a method for displaying session messages provided by an embodiment of this application;
[0022] Figure 3 Schematic diagram of an application scenario of a method for displaying session messages provided by an embodiment of this application;
[0023] Figure 4 Flowchart of another method for displaying session messages provided by an embodiment of this application;
[0024] Figure 5 Block diagram of a device for displaying session messages provided by an embodiment of this application;
[0025] Figure 6 Schematic diagram of the structure of a computer device provided by an embodiment of this application. Detailed implementation manners
[0026] The following will clearly and completely describe the technical solutions in the embodiments of this application with reference to the accompanying drawings in the embodiments of this application. Obviously, the described embodiments are only some embodiments of this application, rather than all embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative efforts belong to the scope of protection of this application.
[0027] The embodiments of the present application provide a method, apparatus, storage medium, and computer device for displaying session messages. Specifically, the method for displaying session messages in the embodiments of the present application can be executed by a computer device, where the computer device can be a terminal or a server, etc. The terminal can be a smart phone, a tablet computer, a laptop computer, a touch screen, a personal computer (PC), a personal digital assistant (PDA), or other terminal devices. The server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms.
[0028] For example, the computer device can be a terminal, and the terminal can obtain the message identifiers of unread session messages; obtain at least one stored message data segment, where the message data segment includes the message identifiers and corresponding message contents of at least one session message; match the message identifiers of the unread session messages with the message identifiers of the session messages in each message data segment respectively to determine the target message data segment corresponding to the unread session messages; and display the message contents of at least one session message including the unread session messages in the target message data segment.
[0029] In order to enable those skilled in the art to better understand the solutions of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings.
[0030] As Figure 1 shown, Figure 1 FIG. 1 is a schematic diagram of a display system for instant communication information provided by an embodiment of the present application. The system architecture 100 may include a terminal device 101, a network 102, and a server 103. The terminal device 101 may be a laptop computer 1011, a tablet computer 1012, or a mobile phone 1013. The network 102 is a medium for providing a communication link between the terminal device 101 and the server 103. The network 102 may include various connection types, such as wired, wireless communication links, or fiber optic cables, etc.
[0031] Users can use the terminal device 101 to interact with the server 103 through the network 102 to receive or send session messages, etc. Various instant messaging applications (i.e., IM applications) may be installed on the terminal device 101, such as IM applications based on web browsers, clients of instant messaging applications, etc.
[0032] In practical applications, a user can send a session message to another user through the IM application installed on their own terminal device 101. Specifically, the user first sends the session message to the server 103 through the IM application installed on their own terminal device 101, and then the server 103 forwards the session message to the IM application installed on the terminal device 101 of another user. In this way, another user can view the session message on the IM application installed on their terminal device 101. Of course, when a user sends the session message to another user in this way, they can also use the "@ message" function on the IM application to @ another user, thereby sending an "@ message" to them.
[0033] Among them, the terminal device 101 can be various electronic devices with a display screen and supporting web browsing. In addition to the laptop 1011, tablet computer 1012 or mobile phone 1013, the terminal device 101 can also be an e-book reader, an MP3 player (Moving Picture Experts Group Audio Layer III), an MP4 (Moving Picture Experts Group Audio Layer IV) player, a laptop computer, a desktop computer, and so on.
[0034] The server 103 can be a server that provides various services, such as a background server that supports the pages displayed on the terminal device 101.
[0035] It should be noted that the method provided by the embodiments of the present application is generally executed by the server and / or the terminal device. Correspondingly, the device is generally arranged in the server and / or the terminal device.
[0036] It should be understood that Figure 1 the numbers of the terminal devices, networks, and servers are merely illustrative. According to the implementation requirements, there can be any number of terminal devices, networks, and servers.
[0037] Continue to refer to Figure 2 , Figure 2 which is a schematic flowchart of a method for displaying session messages provided by the embodiments of the present application. Figure 2 It shows a flowchart of an embodiment of the method for displaying session messages provided by the embodiments of the present application. For ease of understanding, the basic principle of this method can be briefly described here.
[0038] The above-mentioned " @ message" function in the current IM application, and the current IM application loads new session messages in batches in a reverse order (this reverse order means that the latest session messages are loaded first, and then the previous session messages are loaded). Among them, a certain number of session messages (this number is called the total number of messages) are loaded in each batch. It is precisely because of the combination of the "@ message" function and this batch-by-batch reverse loading of session messages that when the "@ message" received by the user is not in the latest batch of session messages, after the user triggers the reminder message for "@ me" (abbreviated as the reminder message), the IM application may need to continuously load multiple batches of session messages in reverse order to jump to the "@ message" for viewing, which in turn makes the waiting time for jumping to the "@ message" relatively long and easily affects the user experience.
[0039] Based on this, in the method provided in the embodiments of the present application, for each session message sent by the server, it is pre-downloaded and stored in multiple message data segments. That is to say, in the terminal device of the present application, multiple message data segments are pre-stored, and each message data segment respectively includes the message identifiers (such as msgID) of multiple session messages and the corresponding message contents.
[0040] For example, for each session message sent by the server, the IM application installed on the terminal device can be pre-downloaded and stored in a certain message data segment. For example, it can be set that the number of session messages stored in each message data segment is a preset value (this preset value can be, for example, 100). In this way, for each session message sent by the server, after the IM application receives a certain session message forwarded by the server, it can first determine whether the number of session messages in the latest message data segment is less than the preset value. If so, the session message is added to the latest message data segment. Specifically, for example, the message identifier and message content of the session message can be added to the latest message data segment; otherwise, if not, a new message data segment is created, and the session message is stored in the newly created message data segment. Specifically, for example, the message identifier and message content of the session message can be added to the newly created message data segment. In this way, through this method, in the IM application, each session message sent by the server has been pre-downloaded and stored in multiple message data segments.
[0041] In Figure 2 the method shown, some or all of the steps of this method can be executed by Figure 1 the server 103 or the terminal device 101 shown. For example, here the execution of this method by the terminal device 101 can be used as an example to illustrate this method. This method includes the following steps:
[0042] Step S21: Obtain the message identifier of the unread session message.
[0043] It should be noted that the unread session message can be the session message that needs to be located and displayed. For example, when the user triggers the "mention me" prompt message in the session interface of the IM application, the session message that needs to be located and displayed at this time is the "mention message" sent by other users to this user through the "mention message" function in the IM application. Subsequently, this "mention message" is also referred to as the user-related message. At this time, this "mention message" is the unread session message in step S21.
[0044] Specifically, when the user triggers the "mention me" prompt message, the terminal device can obtain the message identifier of the unread session message in response to the message viewing event for the session interface (that is, the event when the user triggers the "mention me" prompt message). At this time, the unread session message is the "mention message" with a relatively high degree of association with this user, that is, the user-related message.
[0045] It should be noted that each session message includes its corresponding message identifier. Among them, the message identifier can be, for example, msgID, which is usually assigned by the IM application to facilitate uniquely representing the session message through this message identifier. Among them, the message identifier can be a string composed of numbers, letters, or other characters; of course, each instant communication message can also include its corresponding message content. For example, when a user needs to send a greeting to another user through a session message, this greeting is the message content of this session message. In actual applications, what needs to be displayed in the session interface of the IM application is mainly the message content of this session message.
[0046] Therefore, for the specific implementation method of this step S21, for example, it can be that after receiving the user's trigger of the "mention me" prompt message in the session interface of the IM application, obtain the message identifier of the unread session message (that is, the "mention message").
[0047] In addition, in the case where the user receives multiple "mention messages", there are multiple "mention messages" at this time.
[0048] For example, please refer to Figure 3 , Figure 3 which is a schematic diagram of the application scenario of a method for displaying session messages provided by an embodiment of the present application. As Figure 3In the session interface of the IM application shown, there are 70 "@ messages" displayed in the "@ me" prompt message. At this time, the unread session message can be any one of these "@ messages", or a specified "@ message". For example, according to the function of the "@ message" in the IM application, each time the user triggers the "@ me" prompt message, the latest "@ message" can be used as the unread session message for display. Of course, the unread session message can also be the earliest "@ message". And each time the user triggers the "@ me" prompt message, since one of the "@ messages" (such as the latest "@ message", the earliest "@ message", or any "@ message") is displayed, the number of "@ messages" displayed in the "@ me" prompt message is correspondingly reduced by 1.
[0049] And when the user triggers the "@ me" prompt message again, the latest "@ message" among the remaining "@ messages" can continue to be used as the unread session message, or the earliest "@ message" among the remaining "@ messages" can continue to be used as the unread session message, or any "@ message" among the remaining "@ messages" can continue to be used as the unread session message. And so on, the user can view these "@ messages" by triggering the "@ me" prompt message multiple times.
[0050] Step S22: Obtain at least one stored message data segment, where the message data segment includes the message identifiers and corresponding message contents of at least one session message.
[0051] As mentioned above, in the embodiments of the present application, since multiple message data segments are pre-stored, in this step S22, at least one message data segment can be obtained from the multiple pre-stored message data segments. For example, it can be obtained in the order of the message data segments, or randomly, or by other acquisition methods to obtain the at least one message data segment from the multiple pre-stored message data segments. The specific acquisition method is not limited here.
[0052] Step S23: Match the message identifier of the unread session message with the message identifiers of the session messages in each message data segment to determine the target message data segment corresponding to the unread session message.
[0053] As mentioned above, since multiple message data segments are pre-stored in the terminal device in the present application, and each message data segment respectively includes the message identifiers of multiple session messages and the corresponding message contents, therefore, after obtaining the message identifiers of the unread session messages through the above step S21 and obtaining at least one message data segment through the above step S22, in this step S23, the message identifiers of the unread session messages can be respectively matched with the message identifiers of the session messages in each of the at least one obtained message data segments until the message identifier of the session message in a certain message data segment is successfully matched (i.e., the two match), so as to determine this message data segment as the target message data segment.
[0054] Obviously, in this target message data segment, since the message identifier of a certain session message matches the message identifier of the unread session message, therefore, this session message in this target message data segment is the unread session message that needs to be displayed.
[0055] For the specific implementation manner of this step S23, for example, each message data segment can be respectively used as the current message data segment, and then the message identifiers of the session messages in this current message data segment can be respectively matched with the message identifiers of the unread session messages until the matching is successful to obtain this target message data segment.
[0056] Of course, in order to improve the matching efficiency, a record table can also be created in advance. The record table records the message identifiers of each session message and the corresponding message data segments. For example, after obtaining the session message sent by the server, the message identifier and the corresponding message data segment of this session message can be stored in this record table. In this way, the implementation manner of this step S23 can be to respectively match the message identifier of the unread session message with the message identifiers of each session message recorded in this record table, so as to obtain the session message that is successfully matched in this record table, and then obtain the message data segment to which this successfully matched session message belongs, and determine it as this target message data segment.
[0057] In addition, before performing this step S23 to respectively match the message identifier of the unread session message with the message identifiers of the session messages in each message data segment, this method usually can also include: generating a query request based on the message identifier of the unread session message. In this way, this step S23 can be to respectively match the message identifier of the unread session message with the message identifiers of each session message recorded in this record table based on this query request, so as to determine this target message data segment. At this time, since this query request is generated, this query request can be triggered periodically or through a scheduled task, so as to further execute this step S23.
[0058] Step S24: Display the message content of at least one session message in the target message data segment, including the unread session message.
[0059] After determining the target message data segment through the above Step S23, obviously the message content of the unread session message is included in the target message data segment. Therefore, in this Step S24, the message content of at least one session message in the target message data segment can be displayed, where the at least one session message to be displayed includes the unread session message, thus realizing the display of the message content of the unread session message.
[0060] In addition, for the specific implementation manner of this Step S24, for example, it can be directly processed in the background. For example, first locate the position of the unread session message in the target message data segment in the background, and then directly display the message content of at least one session message including the unread session message. For example, the message content of the unread session message and several adjacent session messages can be displayed.
[0061] For another implementation manner of this Step S24, for example, the message content of each session message in the target message data segment can be displayed first, and then jump to display the message content of at least one session message including the unread session message. For example, jump to display the unread session message and several adjacent session messages.
[0062] Adopting the session message display method provided by the embodiments of the present application, multiple message data segments are pre-stored, and each message data segment respectively includes the message identifiers of multiple session messages and the corresponding message content. In this way, the method can obtain the message identifiers of the unread session messages, and then match the message identifiers of the unread session messages with the message identifiers of the session messages in each message data segment respectively, so as to determine the target message data segment corresponding to the unread session message, and further display the message content of at least one session message including the modified unread session message in the target message data segment, thus realizing the display of the message content of the unread session message. Since multiple message data segments are pre-stored, and each message data segment respectively includes the message identifiers of multiple session messages and the corresponding message content, during the process of displaying the message content of the unread session message, this method does not need to load the session messages in batches in reverse order, so the waiting time for jumping to the unread session message can be reduced, and the user experience can be improved.
[0063] Those of ordinary skill in the art can understand that all or part of the processes of implementing the methods in the above embodiments can be completed by instructing relevant hardware through computer-readable instructions. These computer-readable instructions can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above methods. Among them, the aforementioned storage medium can be a non-volatile storage medium such as a magnetic disk, an optical disc, a read-only memory (ROM), etc., or a random access memory (RAM), etc.
[0064] It should be understood that although the steps in the flowchart of the accompanying drawings are shown in sequence according to the indication of the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless there is a clear indication in this article, the execution of these steps has no strict order limit, and they can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same moment, but can be executed at different moments, and their execution order is not necessarily sequential, but can be executed alternately or alternately with at least a part of other steps or sub-steps or stages of other steps.
[0065] The above is an explanation of the method for displaying session messages provided by the embodiments of the present application. For the convenience of understanding, specific examples can be further combined here to further explain this method.
[0066] Please refer to Figure 4 , Figure 4 which is a schematic flowchart of another method for displaying session messages provided by the embodiments of the present application. As Figure 4 shown, in this example, the first user sends an "@ message" to the second user through the "@ message" function in the IM application. Among them, the terminal device of the first user is the first terminal device, the terminal device of the second user is the second terminal device, and the server forwards the "@ message". At this time, the method includes the following steps:
[0067] Step S31: The server receives the "@ message" sent by the first terminal device.
[0068] Specifically, the first user can @ the second user through the IM application installed on the first terminal device, so as to send the "@ message" to the second user, so that the server can receive the "@ message".
[0069] Step S32: The server forwards the "@ message" to the second terminal device.
[0070] Step S33: The second terminal device determines whether the number of session messages in the latest message data segment is less than a preset value. If so, step S34 is executed; if not, step S35 is executed.
[0071] Wherein, the preset value can be, for example, 50, 100 or other values.
[0072] Step S34: Add the message identifier and message content of the "@ message" to the latest message data segment.
[0073] Step S35: Create a new message data segment, and add the message identifier and message content of the "@ message" to the newly created message data segment.
[0074] Step S36: After receiving the "@ me" prompt message triggered by the second user in the session interface of the IM application installed on the second terminal device, obtain the message identifier of the "@ message".
[0075] Step S37: Match the message identifier of the "@ message" with the message identifiers of the session messages in each message data segment respectively to determine the target message data segment.
[0076] Step S38: Display the message content of each session message in the target message data segment.
[0077] Step S39: Jump to display the message content of at least one session message including the "@ message".
[0078] Step S310: Highlight the message content of the "@ message".
[0079] Obviously, this method can also solve the problems in the prior art, which will not be elaborated here.
[0080] Based on the same inventive concept as the session message display method provided in the embodiments of the present application, the embodiments of the present application further provide a session message display device. For the content in the embodiments of this device, if there is anything unclear, reference can be made to the corresponding content in the method embodiments. Among them, multiple message data segments are pre-stored, and each message data segment respectively includes the message identifiers of multiple session messages and the corresponding message content.
[0081] For example, please refer to Figure 5 , Figure 5 which is a structural block diagram of a session message display device provided in the embodiments of the present application. As Figure 5 shown in the specific structural schematic diagram of this device, the device includes:
[0082] The first acquisition unit 401 is used to acquire the message identifiers of unread session messages;
[0083] A second acquisition unit 402, configured to acquire at least one stored message data segment, where the message data segment includes a message identifier of at least one session message and a corresponding message content;
[0084] A matching unit 403, configured to match the message identifier of the unread session message with the message identifiers of the session messages in each message data segment respectively, and determine a target message data segment corresponding to the unread session message;
[0085] A display unit 404, configured to display the message content of at least one session message including the unread session message in the target message data segment.
[0086] The apparatus may further include a highlighting unit, configured to perform highlighting on the message content of the unread session message.
[0087] Wherein, the displaying the message content of at least one session message including the unread session message in the target message data segment may include:
[0088] Displaying the message content of each session message in the target message data segment;
[0089] Jumping to display the message content of at least one session message including the unread session message.
[0090] Wherein, the acquiring the message identifier of the unread session message may include:
[0091] In response to a message viewing event for the session interface, acquiring the message identifier of the unread session message, where the unread session message is a user-related message.
[0092] Wherein, in the case of including multiple user-related messages, the unread session message is the latest user-related message.
[0093] Wherein, the record table records the message identifier of each session message and the corresponding message data segment;
[0094] The matching the message identifier of the unread session message with the message identifiers of the session messages in each message data segment respectively, and determining a target message data segment corresponding to the unread session message includes:
[0095] Matching the message identifier of the unread session message with the message identifiers of the session messages recorded in the record table respectively, to obtain the session messages that are successfully matched in the record table;
[0096] Determining the message data segment to which the successfully matched session message belongs as the target message data segment.
[0097] Among them, the step of matching the message identifiers of the unread session messages with the message identifiers of the session messages in each message data segment respectively to determine the target message data segment corresponding to the unread session messages may include:
[0098] Taking each message data segment as the current message data segment respectively, and matching the message identifiers of the session messages in the current message data segment with the message identifier of the unread session message respectively. Until a match is successful, the message data segment of the session message with a successful match is determined as the target message data segment.
[0099] Among them, before matching the message identifier of the unread session message with the message identifiers of the session messages in each message data segment respectively, the method further includes:
[0100] Generating a query request based on the message identifier of the unread session message; and,
[0101] Matching the message identifier of the unread session message with the message identifiers of the session messages recorded in the record table respectively, specifically including:
[0102] Based on the query request, matching the message identifier of the unread session message with the message identifiers of the session messages recorded in the record table respectively.
[0103] Among them, for each session message sent by the server respectively, the method further includes:
[0104] Judging whether the number of session messages in the latest message data segment is less than a preset value;
[0105] If so, adding the message identifier and message content of the session message to the latest message data segment; or,
[0106] If not, creating a new message data segment, and adding the message identifier and message content of the session message to the newly created message data segment.
[0107] Since this device adopts the same inventive concept as the method for displaying session messages provided in the embodiments of the present application, it can also solve the problems in the prior art. Specifically, since multiple message data segments are pre-stored, and each message data segment respectively includes the message identifiers of multiple session messages and the corresponding message contents, during the process of displaying the message contents of unread session messages, this method does not need to load session messages in batches in reverse order, so it can reduce the long waiting time for jumping to unread session messages and improve the user experience.
[0108] Correspondingly, an embodiment of the present application further provides a computer device, which may be a server. As Figure 6 shown, Figure 6 is a schematic structural diagram of the computer device provided by the embodiment of the present application. The computer device 500 includes a processor 501 with one or more processing cores, a memory 502 with one or more computer-readable storage media, and a computer program stored in the memory 502 and executable on the processor. Among them, the processor 501 is electrically connected to the memory 502. Those skilled in the art can understand that the structural diagram of the computer device shown in the figure does not limit the computer device, and it may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0109] The processor 501 is the control center of the computer device 500, connecting various interfaces and circuits to all parts of the entire computer device 500. By running or loading software programs and / or modules stored in the memory 502, and calling data stored in the memory 502, it executes various functions of the computer device 500 and processes data, thereby monitoring the entire computer device 500.
[0110] In the embodiment of the present application, the processor 501 in the computer device 500 will load the instructions corresponding to the processes of one or more application programs into the memory 502 according to the following steps, and the processor 501 will run the application programs stored in the memory 502 to implement various functions:
[0111] Obtain the message identifier of the unread session message;
[0112] Obtain at least one stored message data segment, where the message data segment includes the message identifier and the corresponding message content of at least one session message;
[0113] Match the message identifier of the unread session message with the message identifiers of the session messages in each message data segment respectively to determine the target message data segment corresponding to the unread session message;
[0114] Display the message content of at least one session message including the unread session message in the target message data segment.
[0115] The present application provides a method for displaying session messages provided by the embodiments of the present application. By obtaining the message identifiers of unread session messages; obtaining at least one stored message data segment, where the message data segment includes the message identifiers and corresponding message contents of at least one session message; matching the message identifiers of the unread session messages with the message identifiers of the session messages in each message data segment respectively to determine the target message data segment corresponding to the unread session messages; and displaying the message contents of at least one session message including the unread session messages in the target message data segment. Since multiple message data segments are pre-stored, and each message data segment includes the message identifiers and corresponding message contents of multiple session messages, during the process of displaying the message contents of the unread session messages, it is not necessary to load the session messages in batches in reverse order. Therefore, the waiting time for jumping to the unread session messages can be reduced, and the user experience can be improved.
[0116] For the specific implementation of each of the above operations, reference may be made to the previous embodiments and will not be elaborated here.
[0117] Optionally, as Figure 6 shown, the computer device 500 further includes: a touch display screen 503, a radio frequency circuit 504, an audio circuit 505, an input unit 506, and a power supply 507. Among them, the processor 501 is electrically connected to the touch display screen 503, the radio frequency circuit 504, the audio circuit 505, the input unit 506, and the power supply 507 respectively. Those skilled in the art can understand that Figure 6 the computer device structure shown in
[0118] The touch display screen 503 can be used to display a graphical user interface and receive operation instructions generated by a user acting on the graphical user interface. The touch display screen 503 may include a display panel and a touch panel. Among them, the display panel can be used to display information input by the user or information provided to the user, as well as various graphical user interfaces of the computer device. These graphical user interfaces can be composed of graphics, guiding information, icons, videos, and any combination thereof. Optionally, the display panel can be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), etc. The touch panel can be used to collect touch operations of the user on or near it (such as operations of the user using a finger, a stylus, or any suitable object or accessory on or near the touch panel), and generate corresponding operation instructions, and the operation instructions execute corresponding programs. Optionally, the touch panel may include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the touch orientation of the user, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into contact coordinates, and then sends it to the processor 501, and can receive commands sent by the processor 501 and execute them. The touch panel can cover the display panel. When the touch panel detects a touch operation on or near it, it is transmitted to the processor 501 to determine the type of touch event. Subsequently, the processor 501 provides corresponding visual output on the display panel according to the type of touch event. In the embodiment of the present application, the touch panel and the display panel can be integrated into the touch display screen 503 to implement input and output functions. However, in some embodiments, the touch panel and the display panel can be implemented as two independent components to implement input and output functions. That is, the touch display screen 503 can also be used as part of the input unit 506 to implement the input function.
[0119] The radio frequency circuit 504 can be used to transmit and receive radio frequency signals to establish wireless communication with a network device or other computer devices through wireless communication, and transmit and receive signals with the network device or other computer devices.
[0120] The audio circuit 505 can be used to provide an audio interface between the user and the computer device through a speaker and a microphone. The audio circuit 505 can transmit the electrical signal converted from the received audio data to the speaker, and the speaker converts it into a sound signal for output; on the other hand, the microphone converts the collected sound signal into an electrical signal, which is received by the audio circuit 505 and then converted into audio data. After the audio data is output to the processor 501 for processing, it is transmitted through the radio frequency circuit 504 to, for example, another computer device, or the audio data is output to the memory 502 for further processing. The audio circuit 505 may also include an earphone jack to provide communication between a peripheral earphone and the computer device.
[0121] The input unit 506 can be used to receive input numerical, character information or user feature information (such as fingerprint, iris, face information, etc.), and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.
[0122] The power supply 507 is used to supply power to each component of the computer device 500. Optionally, the power supply 507 can be logically connected to the processor 501 through a power management system, so as to realize functions such as management of charging, discharging, and power consumption management through the power management system. The power supply 507 can also include any components such as one or more DC or AC power supplies, a recharge system, a power failure detection circuit, a power converter or inverter, and a power status indicator.
[0123] Although Figure 6 not shown in the figure, the computer device 500 may also include a camera, a sensor, a Wi-Fi module, a Bluetooth module, etc., which will not be elaborated here.
[0124] In the above embodiments, the descriptions of each embodiment have their own emphases. For the parts not detailed in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0125] As can be seen from the above, the computer device provided in this embodiment obtains the message identifier of the unread session message; obtains at least one stored message data segment, where the message data segment includes the message identifier and the corresponding message content of at least one session message; matches the message identifier of the unread session message with the message identifiers of the session messages in each message data segment respectively to determine the target message data segment corresponding to the unread session message; and displays the message content of at least one session message including the unread session message in the target message data segment.
[0126] Those of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructions or by controlling relevant hardware through instructions. The instructions can be stored in a computer-readable storage medium and loaded and executed by a processor.
[0127] For this reason, an embodiment of the present application provides a computer-readable storage medium, in which multiple computer programs are stored. The computer programs can be loaded by a processor to execute the steps in any method for displaying instant communication messages provided in the embodiments of the present application. For example, the computer program can execute the following steps:
[0128] Obtain the message identifier of the unread session message;
[0129] Obtain at least one stored message data segment, where the message data segment includes the message identifier of at least one session message and the corresponding message content;
[0130] Match the message identifiers of the unread session messages with the message identifiers of the session messages in each message data segment respectively to determine the target message data segment corresponding to the unread session messages;
[0131] Display the message content of at least one session message including the unread session message in the target message data segment.
[0132] This application provides a method for displaying session messages provided by the embodiments of this application. By obtaining the message identifiers of unread session messages; obtaining at least one stored message data segment, where the message data segment includes the message identifiers of at least one session message and the corresponding message content; matching the message identifiers of the unread session messages with the message identifiers of the session messages in each message data segment respectively to determine the target message data segment corresponding to the unread session messages; and displaying the message content of at least one session message including the unread session message in the target message data segment. Since multiple message data segments are pre-stored, and each message data segment includes the message identifiers of multiple session messages and the corresponding message content, during the process of displaying the message content of unread session messages, it is not necessary to load session messages in batches in reverse order. Therefore, the waiting time for jumping to unread session messages can be reduced, and the user experience can be improved.
[0133] For the specific implementation of each of the above operations, reference can be made to the previous embodiments and will not be elaborated here.
[0134] Among them, the storage medium may include: read-only memory (ROM, Read Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disk, etc.
[0135] Since the computer program stored in the storage medium can execute the steps in any of the methods for displaying instant communication messages provided by the embodiments of this application, the beneficial effects that can be achieved by any of the methods for displaying instant communication messages provided by the embodiments of this application can be realized. For details, reference can be made to the previous embodiments and will not be elaborated here.
[0136] The above has introduced in detail a method, device, storage medium, and computer device for displaying instant communication messages provided by embodiments of the present application. Specific examples are used in this article to elaborate on the principle and implementation manner of the present application. The description of the above embodiments is only used to help understand the method and its core idea of the present application; at the same time, for those skilled in the art, according to the idea of the present application, there will be changes in the specific implementation manner and application scope. In summary, the content of this specification should not be construed as a limitation on the present application.
Claims
1. A method for displaying a conversation message, characterized in that: The method comprises: Get the message ID of unread conversation messages; Acquire at least one stored message data segment, wherein the message data segment includes a message identifier of at least one conversation message and corresponding message content; Matching the message identifiers of the unread conversation messages with the message identifiers of the conversation messages in each message data segment, respectively, to determine the target message data segment corresponding to the unread conversation message; The message content of at least one conversation message including the unread conversation message in the target message data segment is displayed.
2. The method according to claim 1, characterized in that The method further includes: highlighting the message content of the unread conversation message.
3. The method according to claim 1, characterized in that The displaying of the message content of at least one conversation message including the unread conversation message in the target message data segment includes: Displaying the message content of each conversation message in the target message data segment; Jump to displaying the message content of at least one conversation message including the unread conversation message.
4. The method according to claim 1, characterized in that: The step of obtaining the message identifiers of unread conversation messages includes: In response to a message viewing event for a conversation interface, a message identifier of an unread conversation message is obtained, wherein the unread conversation message is a user-associated message.
5. The method according to claim 4, characterized in that In the case where multiple user-related messages are included, the unread conversation message is the latest user-related message.
6. The method according to claim 1, characterized in that The step of matching the message identifiers of the unread conversation messages with the message identifiers of the conversation messages in the respective message data segments to determine the target message data segment corresponding to the unread conversation messages includes: Obtaining a preset record table, wherein the record table records the message identifier of each session message and the corresponding message data segment; Matching the message identifiers of the unread conversation messages with the message identifiers of the conversation messages recorded in the record table respectively, so as to obtain the conversation messages successfully matched in the record table; The message data segment to which the successfully matched session message belongs is determined as the target message data segment.
7. The method according to claim 1, characterized in that The step of matching the message identifiers of the unread conversation messages with the message identifiers of the conversation messages in the respective message data segments to determine the target message data segment corresponding to the unread conversation messages includes: Each message data segment is used as the current message data segment, and the message identifier of each conversation message in the current message data segment is matched with the message identifier of the unread conversation message, until a match is successful, and the message data segment of the successfully matched conversation message is determined as the target message data segment.
8. The method according to claim 1, characterized in that Before matching the message identifiers of the unread conversation messages with the message identifiers of the conversation messages in the respective message data segments, the method further includes: generating a query request based on the message identifier of the unread conversation message; and, The matching of the message identifiers of the unread conversation messages with the message identifiers of the conversation messages recorded in the record table respectively includes: Based on the query request, the message identifiers of the unread conversation messages are matched with the message identifiers of the conversation messages recorded in the record table.
9. The method according to claim 1, characterized in that: For each session message sent by the server, the method further includes: Determine whether the number of conversation messages in the latest message data segment is less than a preset value; If yes, then adding the message identifier and message content of the session message to the latest message data segment; or, If not, a new message data segment is created, and the message identifier and message content of the session message are added to the newly created message data segment.
10. A device for displaying conversation messages, characterized in that: The device comprises: A first acquiring unit, used to acquire message identifiers of unread conversation messages; A second acquisition unit, configured to acquire at least one stored message data segment, wherein the message data segment includes a message identifier and corresponding message content of at least one conversation message; A matching unit, configured to match the message identifiers of the unread conversation messages with the message identifiers of the conversation messages in each message data segment, respectively, to determine a target message data segment corresponding to the unread conversation messages; The display unit displays the message content of at least one conversation message including the unread conversation message in the target message data segment.
11. A computer device comprising a memory and a processor, characterized in that: The memory stores computer-readable instructions, and the processor implements the steps of the method according to any one of claims 1 to 9 when executing the computer-readable instructions.
12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by a processor, the steps of the method according to any one of claims 1 to 9 are implemented.