Method and device for updating chat message status in instant messaging
By using group member change schedules and read schedules in instant messaging systems to determine the read status of chat messages, the problem of excessive server resource consumption for chat message read/unread information is solved, improving the efficiency of chat message status updates and user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-01
- Publication Date
- 2026-03-10
AI Technical Summary
In existing instant messaging systems, the read and unread information records of chat messages consume excessive database server resources, and this consumption increases dramatically with the number of historical messages, resulting in excessive resource consumption.
By iterating through multiple chat messages in an instant messaging group, and using a pre-generated group member change schedule and group message read schedule, the system determines the read status of each group member, counts the number of read and unread members, and displays the results on the chat group page, thereby reducing server resource consumption.
It reduces the resource consumption on the server during the recording and updating of read and unread messages, improves the efficiency and timeliness of chat message status updates, and enhances the user experience.
Smart Images

Figure CN116800703B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of instant messaging, and in particular to a chat message state updating method and device in instant messaging. BACKGROUND
[0002] In instant messaging systems, in order to facilitate users to know the read status of their sent messages, a set of read and unread statistics and multi-terminal synchronization mechanism of chat messages is generally designed.
[0003] The existing technical implementation scheme generally includes: S1: establishing a read table to record the read status of each message of each chat member; S2: querying the read and unread personnel of the message according to the message ID in the background; and S3: displaying the read and unread information according to the read and unread personnel in the foreground.
[0004] In the existing technology, the read and unread information recorded by each chat group generally occupies a large amount of resources of the database server, and the resource consumption will increase sharply with the increase of historical messages. SUMMARY
[0005] In view of this, the embodiments of the present application provide a chat message state updating method and device in instant messaging to eliminate or improve one or more defects in the prior art.
[0006] A first aspect of the present application provides a chat message state updating method in instant messaging, which comprises:
[0007] traversing each chat group in instant messaging to obtain a plurality of chat messages corresponding to the current page of each chat group, taking each chat message as a target chat message in turn and performing a preset state updating step until the read member number and the unread member number of each chat message corresponding to the current page are obtained, so as to display the read member number and the unread member number of each chat message in the page corresponding to each chat group respectively;
[0008] The state updating step comprises:
[0009] According to the chat group name of the current target chat message and the sending time of the target chat message, a chat group ID and a change time that respectively match the chat group name and the sending time are found from a group member change time table corresponding to the target chat message, so as to obtain a group member set corresponding to the chat group ID and the change time; wherein the group member change time table is a data table pre-generated to store the corresponding relationship among the chat group ID, the change time of the group member and the group member set in each chat group;
[0010] obtaining, from the group message read time table corresponding to the target chat message, a read time of each group member in the group member set for a last read chat message in the target chat group according to a chat group name in which the target chat message is located and the group member set, wherein the group message read time table is a data table pre-generated to store a correspondence among a chat group ID of each chat group, a unique identifier of each group member, and the read time of each group member;
[0011] traversing each read time, if the read time is greater than a sending time of the target chat message, a group member corresponding to the read time is classified as a read member; otherwise, the group member is classified as an unread member;
[0012] counting a number of read members and a number of unread members corresponding to the target chat message.
[0013] In some embodiments of the present application, before the step of traversing each chat group in the instant messaging and each plurality of chat messages corresponding to a current page of each chat group in sequence as a target chat message and performing a preset state updating step, the method further comprises:
[0014] receiving an updated group message read time table and a group member change time record table sent by a server;
[0015] storing the group message read time table and the group member change time record table corresponding to each chat group to a chat cache.
[0016] In some embodiments of the present application, after the step of storing the group message read time table and the group member change time record table corresponding to each chat group to the chat cache, the method further comprises:
[0017] if it is detected that the group member enters the corresponding chat group to read the plurality of chat messages of the current page, the server is notified to update the read time of the group member in the group message read time table.
[0018] In some embodiments of the present application, if it is detected that the group member enters the corresponding chat group to read the plurality of chat messages of the current page, the server is notified to update the read time of the group member in the group message read time table, comprising:
[0019] if there is an unread message in the current group chat page or a new chat message is received, a read time modification message is sent to the server to make the server update the read time of the group member in the group message read time table.
[0020] In some embodiments of the present application, after the server updates the read time of the group member in the read time table of the group message, the method further comprises:
[0021] receiving the read time modification message of the other group members in the chat group forwarded by the server;
[0022] updating the read time table of the group message in the chat cache according to the read time modification message.
[0023] In some embodiments of the present application, after the server updates the read time of the group member in the read time table of the group message, the method further comprises:
[0024] receiving the group member change message sent by the server if the server detects that the number of group members in the chat group has changed;
[0025] adding corresponding change data in the group member change time record table in the chat cache according to the group member change message.
[0026] In some embodiments of the present application, after the server updates the read time of the group member in the read time table of the group message, the method further comprises:
[0027] if it is detected that the group member exits the chat group, the read member number and the unread member number of each chat message before the group member exits the chat group remain unchanged;
[0028] if it is detected that the group member exits the chat group and then joins the chat group again, the read member number and the unread member number of each chat message sent by the other group members in the chat group during this period remain unchanged.
[0029] The second aspect of the present application provides a chat message state updating device in instant messaging, which comprises:
[0030] a traversal updating module, configured to traverse a plurality of chat messages corresponding to each chat group in the current page in instant messaging, take each chat message as a target chat message in turn and perform a preset state updating step, until the read member number and the unread member number corresponding to each chat message are obtained, so as to display the read member number and the unread member number of each chat message in the page corresponding to each chat group respectively; wherein the state updating step comprises:
[0031] The group member set searching module is configured to search, according to a chat group name in which a target chat message is located and a sending time of the target chat message, a chat group ID and a change time that respectively match the chat group name and the sending time from a group member change time table corresponding to the target chat message, so as to obtain a group member set corresponding to the chat group ID and the change time; the group member change time table is a data table pre-generated to store a corresponding relationship among a chat group ID, a change time of a group member and a group member set in each chat group;
[0032] The read time searching module is configured to obtain, according to a chat group name in which a target chat message is located and a group member set, a read time of each group member in the group member set for a last read chat message in the target chat group from a group message read time table corresponding to the target chat message; the group message read time table is a data table pre-generated to store a corresponding relationship among a chat group ID, a unique identifier of each group member and the read time of each group member in each chat group;
[0033] The message state judging module is configured to traverse each read time, and if the read time is greater than a sending time of the target chat message, a group member corresponding to the read time is classified as a read member; otherwise, the group member is classified as an unread member.
[0034] The message state number counting module is configured to count a number of read members and a number of unread members corresponding to the target chat message.
[0035] A third aspect of the present application provides an electronic device, comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the chat message state updating method in instant messaging of the first aspect.
[0036] A fourth aspect of the present application provides a computer readable storage medium, which stores a computer program, wherein the computer program is executed by a processor to implement the chat message state updating method in instant messaging of the first aspect.
[0037] The application provides a chat message state updating method and device in instant messaging, the method comprises the following steps: traversing each chat group in instant messaging, and searching for a plurality of group members corresponding to the chat message and the read time of each group member in a group member change time table and a group message read time table, so as to determine whether each group member corresponding to the chat message is in a read state, until the read member number and the unread member number corresponding to each chat message are obtained. The application can reduce the resource occupation rate of the read and unread message recording and updating process in the server, and improve the efficiency and timeliness of the chat message state updating in instant messaging, so as to improve the user experience of the chat user in instant messaging.
[0038] Additional advantages, objects, and features of the application will be set forth in part in the description which follows, and in part will become apparent to those having ordinary skill in the art upon examination of the following or can be learned from practice of the application. The objects and other advantages of the application can be realized and attained by the structure particularly pointed out in the specification and drawings.
[0039] It will be appreciated by persons of ordinary skill in the art that the objects and advantages of the application can be realized and attained by means summarized in the detailed description which follows, and particularly pointed out in the appended claims. Understanding that these and other objects and advantages of the application can be achieved by the detailed description which follows, the application will be described in terms of preferred embodiments. BRIEF DESCRIPTION OF DRAWINGS
[0040] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments of the application and together with the description, serve to explain the principles of the application. The components in the drawings are not necessarily to scale, emphasis instead being placed upon illustrating the principles of the application. For purposes of clarity and understanding, it is to be understood that certain portions of the drawings can be exaggerated, and others omitted, in order to demonstrate certain aspects of the application. In the drawings:
[0041] Figure 1 A flowchart of a chat message state updating method in instant messaging in an embodiment of the application.
[0042] Figure 2 A structural diagram of a chat message state updating device in instant messaging in another embodiment of the application.
[0043] Figure 3 A read information display diagram of a client sending a message in another embodiment of the application.
[0044] Figure 4 A front and back read time data interaction diagram in another embodiment of the application.
[0045] Figure 5This is a schematic diagram illustrating the update of client read information in another embodiment of this application.
[0046] Figure 6 This is a schematic diagram of the data interaction for recording changes in the time of front-end and back-end members, as shown in another embodiment of this application. Detailed Implementation
[0047] To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the embodiments and accompanying drawings. Here, the illustrative embodiments and their descriptions are used to explain this application, but are not intended to limit it.
[0048] It should also be noted that, in order to avoid obscuring this application with unnecessary details, only the structures and / or processing steps closely related to the solution according to this application are shown in the accompanying drawings, while other details that are not closely related to this application are omitted.
[0049] It should be emphasized that the term "including / comprises" as used herein refers to the presence of a feature, element, step, or component, but does not exclude the presence or addition of one or more other features, elements, steps, or components.
[0050] It should also be noted that, unless otherwise specified, the term "connection" in this article can refer not only to a direct connection, but also to an indirect connection involving an intermediary.
[0051] In the following description, embodiments of the present application will be illustrated with reference to the accompanying drawings. In the drawings, the same reference numerals represent the same or similar parts, or the same or similar steps.
[0052] The following examples will provide a detailed description.
[0053] This application provides a method for updating the status of chat messages in instant messaging, which can be executed by an instant messaging chat message status update device or a client device. See [link to relevant documentation]. Figure 1 The instant messaging chat message status update method specifically includes the following:
[0054] Step 110: In instant messaging, iterate through the multiple chat messages corresponding to each chat group on the current page, and sequentially use each chat message as the target chat message and execute the preset status update steps until the current number of read members and the number of unread members corresponding to each chat message are obtained, so as to display the number of read members and the number of unread members for each chat message on the corresponding page of each chat group. The status update steps include steps 120 to 150 below.
[0055] Step 120: Based on the name of the chat group containing the current target chat message and the sending time of the target chat message, search for the chat group ID and change time that match the chat group name and the sending time respectively from the group member change time table corresponding to the target chat message, thereby obtaining the group member set corresponding to the chat group ID and the change time; wherein, the group member change time table is a pre-generated data table used to store the correspondence between the chat group ID, the change time of the group members and the group member set in each chat group.
[0056] Step 130: Based on the chat group name where the target chat message is located and the set of group members, obtain the read time of each group member in the set of group members for the last read chat message in the target chat group from the group message read time table corresponding to the target chat message; wherein, the group message read time table is a pre-generated data table used to store the correspondence between the chat group ID in each chat group, the unique identifier of each group member and the read time of each group member.
[0057] Step 140: Iterate through each read time. If there is a read time that is greater than the sending time of the target chat message, then classify the group member corresponding to the read time as a read member; otherwise, classify the group member as an unread member.
[0058] Step 150: Count the number of read members and the number of unread members corresponding to the target chat message.
[0059] In addition, to improve the data processing rate, the following steps are included before step 110:
[0060] Step 111: Receive the updated group message read time table and the group member change time record table sent by the server.
[0061] Step 112: Store the group message read time table and group member change time record table corresponding to each chat group to the chat cache.
[0062] Specifically, see Figure 3 After entering the chat page, the client device first receives an updated group message read time table and group member change time record table sent by the server; then it stores the group message read time table and group member change time record table corresponding to each chat group into the chat cache (i.e., Figure 3 (Cache read information in the middle). Then iterates through the multiple chat messages corresponding to each chat group on the current page (i.e., ... Figure 3The system loads historical messages (or sends new messages), sequentially treating each of the aforementioned chat messages as target chat messages and executing preset status update steps until the current number of read and unread members corresponding to each chat message is obtained. This allows the read and unread member counts of each chat message to be displayed on the respective pages of each chat group. The status update steps include: based on the name of the chat group containing the current target chat message and the sending time of the target chat message, searching for the chat group ID and change time that match the chat group name and sending time respectively from the group member change timetable corresponding to the target chat message, thereby obtaining the group member set corresponding to the chat group ID and change time; wherein, the group member change timetable is a pre-generated data table used to store the correspondence between chat group IDs, group member change times, and group member sets in each chat group; based on the target chat message... The system identifies the chat group name and member set of the target chat message. It then retrieves the read time of each member in the group member set for the last read chat message in the target chat group from the group message read time table. The group message read time table is a pre-generated data table storing the correspondence between the chat group ID, the unique identifier of each member, and the read time of each member. It iterates through each read time; if a read time is greater than the sending time of the target chat message, the member corresponding to that read time is classified as a read member; otherwise, the member is classified as an unread member. Finally, it counts the number of read and unread members corresponding to the target chat message. This reduces the resource consumption of recording and updating read and unread messages on the server and improves the efficiency and timeliness of chat message status updates in instant messaging, thereby enhancing the user experience for instant messaging users.
[0063] The group message read timeline includes: chat group ID, user ID (i.e., the unique identifier of each group member), and read time; the group member change timeline includes: chat group ID, change time, and group member set.
[0064] To ensure timely updates of the group message read schedule on the server, the following steps are included after step 112:
[0065] Step 113: If it is detected that a group member has entered the corresponding chat group and read multiple chat messages on the current page, then notify the server to update the read time of the group member in the group message read timetable.
[0066] Specifically, step 113 includes: Step 114: If there are unread messages on the current group chat page or a new chat message is received, a read time modification message is sent to the server so that the server updates the read time of the group member in the group message read time table.
[0067] Specifically, see Figure 4 After client A enters the chat page, if it detects unread messages or receives a new chat message in the current group chat (i.e., ... Figure 4 If there are unread new messages in the message queue, a read time modification message is sent to the server (i.e., ...). Figure 4 The server sends message A: Someone has read a chat group message) to update the group message read time in the group member's read time schedule (i.e., ...). Figure 4 (This allows for modification of the read timetable, enabling timely updates of the group message read timetable on the server.)
[0068] To ensure timely updates to the group message read schedule in the local cache, the following steps are included after step 114:
[0069] Step 115: Receive the read time modification message from other group members in the chat group, forwarded by the server;
[0070] Update the group message read time schedule in the chat cache according to the read time of each message.
[0071] Specifically, see Figure 4 Client B receives read time modification messages from other group members in the chat group, forwarded by the server (i.e., ... Figure 4 The sent message A and received message A in the middle), and then modify the message update group message read time schedule in the chat cache according to each read time (i.e., ... Figure 4 (See the client-side read information update process for details.) Figure 5 (That is, the status update step in step 110 is executed again), so that the group message read schedule in the local cache can be updated in a timely manner.
[0072] To ensure timely updates of the group member change time record table in the server and client local caches, the following steps are included after step 112:
[0073] Step 116: If the server detects a change in the number of group members in the chat group, it receives a group member change message sent by the server.
[0074] Step 117: Add the corresponding change data to the group member change time record table in the chat cache according to the group member change message.
[0075] Specifically, see Figure 6 If the server detects a change in the number of group members in the chat group (i.e. Figure 6 If the group membership relationship changes, the client device receives a group membership change message sent by the server (i.e., ...). Figure 6Add a new group member change time record in the chat cache → send message B: group member change message → receive message B); based on the group member change message, add the corresponding change data to the group member change time record table in the chat cache (i.e. Figure 6 This allows for timely updates of group member change records in the server and client local caches.
[0076] To ensure the accuracy of read and unread message statistics, after step 117, the following steps are also included:
[0077] Step 118: If it is detected that a group member has left the chat group, the number of read members and the number of unread members for each chat message before the group member left remain unchanged;
[0078] If it is detected that a group member has left the chat group and then rejoins it, the number of read members and the number of unread members for each chat message sent by other group members in the chat group during this period remain unchanged.
[0079] Specifically, if a group member is detected repeatedly joining and leaving the group, the system can accurately count the read and unread messages before and after the user leaves and rejoins the group. Assuming there are X members in the chat group before the user leaves, the total number of read and unread messages to be counted is:
[0080] a) Before the user left the group, the total number of read and unread records that need to be counted is X;
[0081] b) After the user leaves the group and before rejoining, the total number of read and unread messages that need to be counted is X-1.
[0082] c) After the user rejoins the group, the total number of read and unread messages that need to be counted is X;
[0083] In other words, by recording the time of changes in chat group members, users repeatedly joining and leaving the group will not affect the statistical results of old messages.
[0084] In addition, if a member repeatedly joins and leaves the group, when that user retrieves historical messages in the chat group, they can correctly retrieve the historical messages they should retrieve. That is, the historical messages retrieved by the user will not include messages sent by others during the period when the user is not in the group. This can effectively ensure the accuracy of the statistics of read and unread messages when a member repeatedly joins and leaves the group.
[0085] From a software perspective, this application also provides an apparatus for performing all or part of the instant messaging chat message status update method described above, see [link to app / reference]. Figure 4The instant messaging chat message status update device specifically includes the following components:
[0086] The traversal update module 10 is used to traverse multiple chat messages corresponding to each chat group on the current page in instant messaging, take each chat message as the target chat message in turn and execute preset status update steps until the number of read members and the number of unread members corresponding to each chat message are obtained, so as to display the number of read members and the number of unread members of each chat message on the page corresponding to each chat group; wherein, the status update steps include the aforementioned steps 120 to 150.
[0087] The group member set lookup module 20 is used to search for the chat group ID and change time that match the chat group name and the sending time of the target chat message from the group member change time table corresponding to the target chat message, thereby obtaining the group member set corresponding to the chat group ID and the change time; wherein, the group member change time table is a pre-generated data table used to store the correspondence between the chat group ID, the change time of the group members and the group member set in each chat group;
[0088] The read time lookup module 30 is used to obtain the read time of each group member in the group member set for the last read chat message in the target chat group from the group message read time table corresponding to the target chat message, based on the chat group name where the target chat message is located and the group member set; wherein, the group message read time table is a pre-generated data table used to store the correspondence between the chat group ID in each chat group, the unique identifier of each group member, and the read time of each group member;
[0089] The message status judgment module 40 is used to traverse each read time. If there is a read time that is greater than the sending time of the target chat message, the group member corresponding to the read time is classified as a read member; otherwise, the group member is classified as an unread member.
[0090] The message status count module 50 is used to count the number of read members and the number of unread members corresponding to the target chat message.
[0091] The embodiments of the instant messaging chat message status update device provided in this application can be used to execute the processing flow of the instant messaging chat message status update method embodiments described above. Its functions will not be repeated here, but can be referred to the detailed description of the instant messaging chat message status update method embodiments described above.
[0092] This application provides a chat message status device for instant messaging. The method executed by this device includes: traversing multiple chat messages corresponding to each chat group on the current page within the instant messaging system; determining whether each group member corresponding to the chat message is in a read state by searching for multiple group members and the read time of each group member in a group member change timetable and a group message read timetable; and continuing until the number of read and unread members corresponding to each chat message is obtained. This application can reduce the resource consumption of the record and update process of read and unread messages on the server and improve the efficiency and timeliness of chat message status updates in instant messaging, thereby improving the user experience for instant messaging users.
[0093] This application also provides an electronic device, such as a central server, which may include a processor, a memory, a receiver, and a transmitter. The processor is used to execute the instant messaging chat message status update method mentioned in the above embodiments. The processor and memory can be connected via a bus or other means, taking a bus connection as an example. The receiver can be connected to the processor and memory via wired or wireless means.
[0094] The processor can be a central processing unit (CPU). The processor can also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or combinations of the above types of chips.
[0095] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs, non-transitory computer-executable programs, and modules, such as the program instructions / modules corresponding to the chat message status update method in instant messaging in the embodiments of this application. The processor executes various functional applications and data processing of the processor by running the non-transitory software programs, instructions, and modules stored in the memory, thereby implementing the chat message status update method in instant messaging in the above method embodiments.
[0096] The memory may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created by the processor, etc. Furthermore, the memory may include high-speed random access memory and non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, the memory may optionally include memory remotely located relative to the processor, which can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0097] The one or more modules are stored in the memory, and when executed by the processor, the instant messaging status update method in the embodiment is executed.
[0098] In some embodiments of this application, the user equipment may include a processor, a memory, and a transceiver unit. The transceiver unit may include a receiver and a transmitter. The processor, memory, receiver, and transmitter may be connected via a bus system. The memory is used to store computer instructions, and the processor is used to execute the computer instructions stored in the memory to control the transceiver unit to send and receive signals.
[0099] As one implementation method, the functions of the receiver and transmitter in this application can be implemented by transceiver circuits or dedicated transceiver chips, and the processor can be implemented by dedicated processing chips, processing circuits or general-purpose chips.
[0100] As another implementation approach, the server provided in this application embodiment can be implemented using a general-purpose computer. That is, the program code implementing the processor, receiver, and transmitter functions is stored in memory, and the general-purpose processor implements the processor, receiver, and transmitter functions by executing the code in memory.
[0101] This application also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the steps of the aforementioned instant messaging chat message status update method. The computer-readable storage medium can be a tangible storage medium, such as random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, floppy disks, hard disks, removable storage disks, CD-ROMs, or any other form of storage medium known in the art.
[0102] Those skilled in the art will understand that the exemplary components, systems, and methods described in conjunction with the embodiments disclosed herein can be implemented in hardware, software, or a combination of both. Whether implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application. When implemented in hardware, it can be, for example, electronic circuits, application-specific integrated circuits (ASICs), appropriate firmware, plug-ins, function cards, etc. When implemented in software, the elements of this application are programs or code segments used to perform the required tasks. The programs or code segments can be stored in a machine-readable medium or transmitted over a transmission medium or communication link via data signals carried on a carrier wave.
[0103] It should be clarified that this application is not limited to the specific configurations and processes described above and shown in the figures. For the sake of brevity, detailed descriptions of known methods are omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of this application is not limited to the specific steps described and shown. Those skilled in the art can make various changes, modifications, and additions, or change the order of steps, after understanding the spirit of this application.
[0104] In this application, features described and / or illustrated for one embodiment may be used in the same or similar manner in one or more other embodiments, and / or combined with or in place of features of other embodiments.
[0105] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Various modifications and variations can be made to the embodiments of this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A method for updating a status of a chat message in instant messaging, characterized by, The method is executed by a client, and comprises: In instant messaging, each chat group respectively corresponds to a plurality of chat messages in a current page, each chat message is sequentially taken as a target chat message, and a preset state updating step is executed until a read member number and an unread member number of each chat message are obtained, so that the read member number and the unread member number of each chat message are respectively displayed in a page corresponding to each chat group; The state updating step comprises: According to a chat group name in which a current target chat message is located and a sending time of the target chat message, a chat group ID and a change time that respectively match the chat group name and the sending time are found from a group member change time table corresponding to the target chat message, so that a group member set corresponding to the chat group ID and the change time is obtained; the group member change time table is a data table that is generated in advance and is used to store a corresponding relationship among a chat group ID in each chat group, a change time of a group member, and a group member set; According to the chat group name in which the target chat message is located and the group member set, a read time of each group member in the group member set for a last read chat message in a target chat group is obtained from a group message read time table corresponding to the target chat message; the group message read time table is a data table that is generated in advance and is used to store a corresponding relationship among the chat group ID in each chat group, a unique identifier of each group member, and the read time of each group member; Each read time is traversed, if the read time is greater than the sending time of the target chat message, a group member corresponding to the read time is classified as a read member; otherwise, the group member is classified as an unread member; A read member number and an unread member number corresponding to the target chat message are counted. 2.The instant messaging chat message status updating method of claim 1, wherein, Before the step of, in instant messaging, each chat group respectively corresponds to a plurality of chat messages in a current page, each chat message is sequentially taken as a target chat message, and a preset state updating step is executed, the method further comprises: Receiving an updated group message read time table and a group member change time record table sent by a server; Storing the group message read time table and the group member change time record table corresponding to each chat group to a chat cache. 3.The method of claim 2, wherein, After the step of storing the group message read time table and the group member change time record table corresponding to each chat group to the chat cache, the method further comprises: If it is detected that a group member corresponding to the client enters a corresponding chat group to read a plurality of chat messages in a current page, the server is notified to update a read time of the group member in the group message read time table. 4.The method of claim 3, wherein, The step of, if it is detected that the group member enters the corresponding chat group to read the plurality of chat messages in the current page, the server is notified to update the read time of the group member in the group message read time table, comprises: If there is an unread message or a new chat message is received in the current group chat page, a read time modification message is sent to the server to update the read time of the group member in the group message read time table. 5.The method of claim 4, wherein, After the step of sending the read time modification message to the server to update the read time of the group member in the group message read time table if there is an unread message or a new chat message is received in the current group chat page, the method further comprises: receiving the read time modification message of other group members in the chat group forwarded by the server; updating the group message read time table in the chat cache according to each read time modification message. 6.The method of claim 2, wherein, After the step of storing the group message read time table and the group member change time record table corresponding to each chat group in the chat cache, the method further comprises: if the server detects that the number of group members in the chat group changes, receiving a group member change message sent by the server; adding corresponding change data in the group member change time record table in the chat cache according to the group member change message. 7.The method of claim 6, wherein, After the step of adding corresponding change data in the group member change time record table in the chat cache according to the group member change message, the method further comprises: if it is detected that the group member exits the chat group, the read member number and the unread member number of each chat message before the group member exits remain unchanged; if it is detected that the group member exits the chat group and then joins the chat group again, the read member number and the unread member number of each chat message sent by other group members in the chat group during this period remain unchanged.
8. A chat message status update device in instant messaging, characterized in that, comprises: a traversal update module, configured to traverse a plurality of chat messages corresponding to each chat group in an instant messaging application in a current page, take each chat message as a target chat message in turn, and perform a preset state update step until the read member number and the unread member number corresponding to each chat message are obtained, so that the read member number and the unread member number of each chat message are displayed in the page corresponding to each chat group respectively; wherein the state update step comprises: a group member set searching module, configured to search, according to the chat group name in which the current target chat message is located and the sending time of the target chat message, a chat group ID and a change time that match the chat group name and the sending time respectively in the group member change time table corresponding to the target chat message, so as to obtain a group member set corresponding to the chat group ID and the change time; wherein the group member change time table is a data table for storing the correspondence between the chat group ID, the change time of the group member and the group member set in each chat group. The read time searching module is configured to obtain, according to the chat group name in which the target chat message is located and the group member set, the read time of each group member in the group member set for the last read chat message in the target chat group from a group message read time table corresponding to the target chat message, wherein the group message read time table is a data table pre-generated to store the correspondence among the chat group ID of each chat group, the unique identifier of each group member and the read time of each group member. The message state judging module is configured to traverse each read time, and if the read time is greater than the sending time of the target chat message, classify the group member corresponding to the read time as a read member; otherwise, classify the group member as an unread member. The message state number counting module is configured to count the number of read members and the number of unread members corresponding to the target chat message.
9. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor executes the computer program to implement the chat message state updating method in instant messaging according to any one of claims 1 to 7.
10. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the chat message state updating method in instant messaging according to any one of claims 1 to 7.
Citation Information
Patent Citations
System and method of enterprise mobile message
CN106209941A
Device and method for providing group message read states
CN107948050A