CN114338255A - Group management method and device - Google Patents

Group management method and device Download PDF

Info

Publication number
CN114338255A
CN114338255A CN202210051268.2A CN202210051268A CN114338255A CN 114338255 A CN114338255 A CN 114338255A CN 202210051268 A CN202210051268 A CN 202210051268A CN 114338255 A CN114338255 A CN 114338255A
Authority
CN
China
Prior art keywords
group
target
message
term
record
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202210051268.2A
Other languages
Chinese (zh)
Other versions
CN114338255B (en
Inventor
林皓
高曦
朱亮
陈龙
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing VRV Software Corp Ltd
Original Assignee
Beijing VRV Software Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing VRV Software Corp Ltd filed Critical Beijing VRV Software Corp Ltd
Priority to CN202210051268.2A priority Critical patent/CN114338255B/en
Publication of CN114338255A publication Critical patent/CN114338255A/en
Application granted granted Critical
Publication of CN114338255B publication Critical patent/CN114338255B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The application provides a group management method and a device, and the method comprises the following steps: receiving cursor information of group members sent by a server; the group member cursor information is used for indicating the maximum read message ID of the target group member in the target group; based on the group member cursor information, marking a target message in the target group as the target group member has read; the target message is a group message which is sent by the electronic equipment and has a message ID smaller than or equal to the maximum read message ID. The group management method and device provided by the application are used for managing the group members locally at the client and calculating the read unread state and the number of the group messages, so that the calculation pressure of the server is reduced.

Description

Group management method and device
Technical Field
The present application relates to the field of group message notification management, and in particular, to a group management method and apparatus.
Background
With the development of the internet technology, the multi-person online chat is carried out with other group members through the group chat function, so that the working efficiency can be greatly improved. Aiming at the update of the read unread state of the message sent by the group members in the group, in the related technology, after other group members read the message, the server can calculate the number of the currently read group members and the total number of the visible group members of the message, and display the number on the group chat interface of the group members. The group members may also trigger the electronic device to query the server for a list of people who have read and unread messages by clicking on the corner marks of the messages.
However, in the message state updating method, all data calculation is performed by the server, which brings great calculation pressure to the server, so that the performance of the server is reduced under high concurrency, the message state is not updated timely, and the information display is wrong.
Disclosure of Invention
The application aims to provide a group management method and a group management device, which are used for locally managing group members at a client and calculating the read unread state and the number of group messages, so that the calculation pressure of a server is reduced.
The application provides a group management method, which is applied to electronic equipment and comprises the following steps: receiving cursor information of group members sent by a server; the group member cursor information is used for indicating the maximum read message ID of the target group member in the target group; based on the group member cursor information, marking a target message in the target group as the target group member has read; the target message is a group message which is sent by the electronic equipment and has a message ID smaller than or equal to the maximum read message ID.
Optionally, before the receiving the group member cursor information sent by the server, the method further includes: sending the target message to the server; receiving the sending success information fed back by the server; the sending success information includes: a first group termID; the first group termID is the group termID of the target group when the server sends the target message to the group members of the target group; the group termID of the target group increases with changes to group members in the target group.
Optionally, the method further comprises: sending a group term acquisition request of the target group to the server under the condition that the group members of the target group are changed; the group term acquiring request carries the local group term ID of the target group; receiving a group term acquisition response of the target group sent by a server; updating the group member information and the local group term record of the target group according to the first group term record in the group term acquisition response, and updating the local group term ID of the target group to the maximum value of the group term ID in the first group term record; wherein the first group term record is a record of the server, and the group member of the target group has a record with a group termID larger than the local group termID; the group term record comprises an entering group term ID and an exiting group term ID of the group members; when the group members enter the group, generating a group entering record; the entering group termID of the entering group record is the current group termID of the target group, and the exiting group termID of the entering group record is a preset numerical value; generating a group quitting record when the group members quit the group; the group entry termID and the group exit termID of the group exit record are the current group termID of the target group.
Optionally, said marking target messages in the target group as read by the target group member based on the group member cursor information comprises: acquiring a second group term record in the local group term records based on the first group term ID; determining the total number of group members receiving the target message based on the second group term record, and determining the total number of read members in the target group members according to the cursor information of the group members; wherein the second group term record is a record in which an entry group term ID is less than or equal to the first group term ID in the local group term record.
The application also provides a group management method, which is applied to a server and comprises the following steps:
receiving a read message of a target group member aiming at an unread message in a target group; sending group member cursor information of the target group member to the electronic equipment; wherein the group member cursor information is used to indicate a maximum read message ID of the target group members in the target group; and the maximum read message ID is the message ID of the unread message which is sent by the electronic equipment and has the maximum message ID.
Optionally, before receiving a read message of a target group member for an unread message in a target group, the method further includes: receiving a target message sent by the electronic equipment; the target message is a group message with a message ID less than or equal to the maximum read message ID; sending successful sending information containing a first group termID to the electronic equipment, and sending the target message to group members in the target group; wherein the first group termID is a group termID of the target group when the electronic device sends the target message; the group termID of the target group increases with changes to group members in the target group.
Optionally, the method further comprises: receiving a group term acquisition request of the target group sent by the electronic equipment; acquiring a first group term record based on the local group term ID of the target group carried in the group term acquisition request, and sending a group term acquisition response to the electronic equipment; wherein the group term acquisition response comprises: a first group term record for the target group; the first group term record is a record of the server, and the group member of the target group has a record with a group termID larger than the local group termID; the group term record comprises an entering group term ID and an exiting group term ID of the group members; when the group members enter the group, generating a group entering record; the entering group termID of the entering group record is the current group termID of the target group, and the exiting group termID of the entering group record is a preset numerical value; generating a group quitting record when the group members quit the group; the group entry termID and the group exit termID of the group exit record are the current group termID of the target group.
Optionally, before the receiving the group term acquisition request of the target group sent by the electronic device, the method further includes: and when the group members of the target group are changed, sending a group member change notification to the electronic equipment, so that the electronic equipment updates the group member information of the target group in the electronic equipment by sending the group term acquisition request to the server after receiving the group member change notification.
The present application further provides a group management device, including:
the receiving module is used for receiving the cursor information of the group members sent by the server; the group member cursor information is used for indicating the maximum read message ID of the target group member in the target group; a marking module for marking the target message in the target group as read by the target group member based on the group member cursor information; the target message is a group message which is sent by the electronic equipment and has a message ID smaller than or equal to the maximum read message ID.
Optionally, the apparatus further comprises: a sending module; the sending module is used for sending the target message to the server; the receiving module is further configured to receive the sending success information fed back by the server; the sending success information includes: a first group termID; the first group termID is the group termID of the target group when the server sends the target message to the group members of the target group; the group termID of the target group increases with changes to group members in the target group.
Optionally, the apparatus further comprises: a data update module; the sending module is further configured to send a group term acquisition request of the target group to the server when the group member of the target group is changed; the group term acquiring request carries the local group term ID of the target group; the receiving module is further configured to receive a group term acquisition response of the target group sent by the server; the data updating module is configured to update the group member information and the local group term record of the target group according to the first group term record in the group term acquisition response, and update the local group term id of the target group to the maximum value of the group entry term id in the first group term record; wherein the first group term record is a record of the server, and the group member of the target group has a record with a group termID larger than the local group termID; the group term record comprises an entering group term ID and an exiting group term ID of the group members; when the group members enter the group, generating a group entering record; the entering group termID of the entering group record is the current group termID of the target group, and the exiting group termID of the entering group record is a preset numerical value; generating a group quitting record when the group members quit the group; the group entry termID and the group exit termID of the group exit record are the current group termID of the target group.
Optionally, the apparatus further comprises: the device comprises an acquisition module and a determination module; the acquisition module is configured to acquire a second group term record in the local group term records based on the first group term id; the determining module is used for determining the total number of the group members receiving the target message based on the second group term record and determining the total number of the read members in the target group members according to the cursor information of the group members; wherein the second group term record is a record in which an entry group term ID is less than or equal to the first group term ID in the local group term record.
The embodiment of the present application also provides a group management device, including:
the receiving module is used for receiving the read message of the target group member aiming at the unread message in the target group; the sending module is used for sending the group member cursor information of the target group member to the electronic equipment; wherein the group member cursor information is used to indicate a maximum read message ID of the target group members in the target group; and the maximum read message ID is the message ID of the unread message which is sent by the electronic equipment and has the maximum message ID.
Optionally, the receiving module is further configured to receive a target message sent by the electronic device; the target message is a group message with a message ID less than or equal to the maximum read message ID; the sending module is further configured to send, to the electronic device, sending success information including a first group termID, and send the target message to group members in the target group; wherein the first group termID is a group termID of the target group; the group termID of the target group increases with changes to group members in the target group.
Optionally, the receiving module is further configured to receive a group term acquisition request of the target group sent by the electronic device; an obtaining module, configured to obtain a first group term record based on the local group term id of the target group carried in the group term obtaining request; the sending module is further configured to send a group term acquisition response to the electronic device; wherein the group term acquisition response comprises: a first group term record for the target group; the first group term record is a record of the server, and the group member of the target group has a record with a group termID larger than the local group termID; the group term record comprises an entering group term ID and an exiting group term ID of the group members; when the group members enter the group, generating a group entering record; the entering group termID of the entering group record is the current group termID of the target group, and the exiting group termID of the entering group record is a preset numerical value; generating a group quitting record when the group members quit the group; the group entry termID and the group exit termID of the group exit record are the current group termID of the target group.
Optionally, the sending module is further configured to send a group member change notification to the electronic device when the group member of the target group changes, so that the electronic device updates the group member information of the target group in the electronic device by sending the group term obtaining request to the server after receiving the group member change notification.
The present application also provides a computer program product comprising computer programs/instructions which, when executed by a processor, implement the steps of the group management method as described in any of the above.
The present application further 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 implements the steps of the group management method as described in any of the above when executing the program.
The present application also provides a computer-readable storage medium having stored thereon a computer program which, when being executed by a processor, carries out the steps of the group management method as set forth in any of the above.
According to the group management method and device, the group members send the group messages on the electronic equipment, and can receive the group member cursor information sent by the server after being read by the group members, wherein the group member cursor information is used for indicating the maximum read message ID of the target group members in the target group. Then, based on the cursor information of the group members, marking the target information in the target group as the read of the target group members; the target message is a group message which is sent by the electronic equipment and has a message ID smaller than or equal to the maximum read message ID. The calculation related to the update of the read and unread state of the message is performed locally, so that the calculation pressure of the server is reduced.
Drawings
In order to more clearly illustrate the technical solutions in the present application or the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a schematic diagram of a system architecture applied to a group management method provided in the present application;
fig. 2 is a schematic flowchart of a group management method provided in the present application;
FIG. 3 is a schematic structural diagram of a group management device according to the present application;
fig. 4 is a second schematic structural diagram of the group management device provided in the present application;
fig. 5 is a schematic structural diagram of an electronic device provided in the present application.
Detailed Description
To make the purpose, technical solutions and advantages of the present application clearer, the technical solutions in the present application will be clearly and completely described below with reference to the drawings in the present application, and it is obvious that the described embodiments are some, but not all embodiments of the present application. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The terms first, second and the like in the description and in the claims of the present application are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It will be appreciated that the data so used may be interchanged under appropriate circumstances such that embodiments of the application may be practiced in sequences other than those illustrated or described herein, and that the terms "first," "second," and the like are generally used herein in a generic sense and do not limit the number of terms, e.g., the first term can be one or more than one. In addition, "and/or" in the specification and claims means at least one of connected objects, a character "/" generally means that a preceding and succeeding related objects are in an "or" relationship.
In the related art, for the unread messages in the group chat, a group snapshot of the sent messages is stored through the server, and the group snapshot stores the related information of the current group members when the group messages are sent. When the group A member in the group sends a message, the group B member in the group checks the message, the electronic equipment used by the group B member pushes the pushed read message to the server, the server sets the maximum read message cursor (message ID) of the group B member in the group, the server calculates the current message read quantity and the total quantity of the group members and pushes the current message read quantity and the total quantity of the group members to the group A member, and the group chat interface of the group A member displays the read unread quantity. When the group member A clicks the corner of the message status (including the message read and the message unread), the electronic equipment queries the read and unread personnel list in real time through the server.
However, the read unread numbers are calculated by the server, the server pressure is high, especially under high concurrency, the performance of the server is seriously reduced, and the read unread numbers are not pushed to the client of the sender timely, so that the read unread numbers are displayed mistakenly, and the experience of group members is influenced.
Based on the above technical problems, embodiments of the present application provide a group management method, which is used for locally managing group members and group messages at a client and reducing the computing pressure of a server.
As shown in fig. 1, a system architecture provided for the embodiment of the present application is used to execute the group management method provided by the embodiment of the present application, and includes: a server S1, and electronic devices M1 to M4 connected to the server S1 through a network. The electronic devices M1 to M4 communicate with the server S1 through the network, respectively.
The group management method provided by the embodiment of the present application is described in detail below with reference to the accompanying drawings through specific embodiments and application scenarios thereof.
As shown in fig. 2, a group management method provided in an embodiment of the present application may include the following steps 201 and 204:
step 201, the server receives the read message of the target group member aiming at the unread message in the target group.
Step 202, the server sends the group member cursor information of the target group member to the electronic device.
Wherein the group member cursor information is used to indicate a maximum read message ID of the target group members in the target group; and the maximum read message ID is the message ID of the unread message which is sent by the electronic equipment and has the maximum message ID.
For example, after the electronic device of the target group member views the unread message, the electronic device of the target group member may send a read message to the server, so that the server can notify the sender of the message of performing a status change on the read message.
It will be appreciated that the messages sent by the group members of the target group within the group all have a corresponding message ID, and the ID of the most recently sent message is the largest. The maximum read message ID is the group message which is read by the target user and has the maximum message ID in all the messages of the target group.
Step 203, the electronic device receives the cursor information of the group members sent by the server.
The group member cursor information is used to indicate the maximum read cursor of the target group member in the target group, i.e. the maximum read message ID.
Illustratively, the group member cursor information may include: the group member Identification (ID) of the target group member, the group ID of the target group, the maximum read message ID of the target group member.
Illustratively, the group ID of the target group is used for the electronic device to determine the target group associated with the group member cursor information after receiving the group member cursor information; the maximum read message ID is used to indicate the message with the maximum message ID among all the messages read by the target group members in the target group.
It can be understood that, for all the read messages of the target group member, only the message with the largest message ID needs to be recorded, which can indicate that all the messages with message IDs smaller than or equal to the largest read message ID in the target group member have been viewed by the target group member.
For example, for the message 4, the message 5, the message 6 and the message 7 which are unread by the target group member in the target group, after the target group member views the message 4, the message 5 and the message 6, the server sends the message ID of the message 6 to the electronic device, which indicates that the target group member has read the message 4, the message 5 and the message 6, and the unread message 7.
It should be noted that the group member cursor information may include a plurality of group members and a maximum read message ID for each of the plurality of group members. That is, when the server sends the maximum read message ID of the group member to the electronic device, the group members may be aggregated and sent, so as to reduce the load of multiple sending by the server.
Step 204, the electronic device marks the target message in the target group as read by the target group member based on the group member cursor information.
The target message is a group message which is sent by the electronic equipment and has a message ID smaller than or equal to the maximum read message ID.
Illustratively, the read message of the unread message received by the server may include the read message of the target message.
For example, after the server sends the group member cursor information to the electronic device, the electronic device may receive the group member cursor information and change the state of the read message of the target group member based on the group member cursor information.
For example, after receiving the group member cursor information sent by the server, the electronic device may update the message with the message ID in the target group smaller than or equal to the maximum read message ID in the electronic device as the read of the target group member.
Thus, the group member sends the group message on the electronic device, and after being read by the group member, the group member cursor information sent by the server can be received, and the group member cursor information is used for indicating the maximum read message ID of the target group member in the target group. Then, based on the cursor information of the group members, marking the target information in the target group as the read of the target group members; the target message is a group message which is sent by the electronic equipment and has a message ID smaller than or equal to the maximum read message ID. The calculation related to the update of the read and unread state of the message is performed locally, so that the calculation pressure of the server is reduced.
Optionally, in this embodiment of the application, in order to conveniently calculate the total number of group members that can receive the target message in the target group by the electronic device and the total number of group members that can read the target message, the electronic device needs to save a snapshot of the group members when the target message is sent.
For example, before the step 201, the group management method provided in the embodiment of the present application may further include the following steps 205 to 208:
step 205, the electronic device sends the target message to the server.
It should be noted that the target message may be one or more messages, and for convenience of description, the target message is described as an example in the embodiment of the present application.
Step 206, the server receives the target message sent by the electronic device.
Illustratively, after the electronic device sends the target Message to the server, the server sends the target Message to the group members in the target group through a Message Queue (MQ).
Step 207, the server sends the sending success information containing the first group termID to the electronic device, and sends the target message to the group members in the target group.
Wherein the first group termID is a group termID of the target group when the electronic device sends the target message; the group termID of the target group increases with changes to group members in the target group.
Illustratively, after acquiring the first group termID, the server sends the first group termID to the electronic device by sending success information.
And step 208, the electronic equipment receives the sending success information fed back by the server.
Wherein the sending success information includes: a first group termID; the first group termID is the group termID of the target group when the server sends the target message to the group members of the target group; the group termID of the target group increases with changes to group members in the target group.
Illustratively, after the electronic device sends the target message to the server, the server returns a snapshot of the group members of the target group when sending the target message. The group member snapshot is obtained by the first group epoch identity termID.
Exemplarily, after the server receives the target message, a current termID of the target group, that is, the termID of the first group is obtained, and a group member corresponding to the termID of the first group indicates a snapshot of a group member of the target group when the target message is sent.
For example, after the group members of the target group are updated, the electronic device may also obtain member information of all the group members receiving the target message and member information of read members therein according to the first group termID.
Optionally, in this embodiment of the present application, a term record table of the target group is set in the server, and the term record table includes a group member change record of the target group. When the group member of the target group is changed, the electronic device can synchronize the term record in the database to the local for storage, and after receiving the cursor information of the group member, the electronic device locally changes the message state and calculates the number of the unread messages.
For example, the group management method provided in the embodiment of the present application may further include the following steps 209 to 213:
step 209, the electronic device sends a request for acquiring the group term of the target group to the server when the group member of the target group changes.
Wherein the group term obtaining request carries the local group term id of the target group.
Step 210, the server receives the group term obtaining request of the target group sent by the electronic device.
Step 211, the server acquires the first group term record based on the local group term id of the target group carried in the group term acquisition request, and sends a group term acquisition response to the electronic device.
Wherein the group term acquisition response comprises: a first group term record for the target group; the first group term record is a record of the server, and the group member of the target group has a record with a group termID larger than the local group termID; the group term record comprises an entering group term ID and an exiting group term ID of the group members; when the group members enter the group, generating a group entering record; the entering group termID of the entering group record is the current group termID of the target group, and the exiting group termID of the entering group record is a preset numerical value; generating a group quitting record when the group members quit the group; the group entry termID and the group exit termID of the group exit record are the current group termID of the target group.
Illustratively, based on the value of the out-group termID in the queried term record, it can be determined whether the corresponding group member has already exited the group. For example, if the query result shows that the out-group termID of a group member is the same as the in-group termID, it indicates that the group member has exited the group.
Step 212, the electronic device receives a group term acquisition response of the target group sent by the server.
Step 213, the electronic device updates the group member information and the local group term record of the target group according to the first group term record in the group term acquisition response, and updates the local group term id of the target group to the maximum value in the group term id in the first group term record.
Illustratively, the local group term record is a cache record of the term record of the target group in the server in the electronic device. When the electronic device updates the group member information of the target group, the term record of the target group in the server is synchronized into the local group term record.
In a possible implementation manner, the triggering manner of the group member updating step of the electronic device may be that the server actively sends a group member change notification to the electronic device after the group member of the target group is changed, or that the electronic device triggers after logging in again or networking again.
Before the step 206, the group management method applied to the server according to the embodiment of the present application may further include the following step 214:
step 214, when the group member of the target group changes, sending a group member change notification to the electronic device, so that after receiving the group member change notification, the electronic device updates the group member information of the target group in the electronic device by sending the group term acquisition request to the server.
It should be noted that, in the embodiment of the present application, the server sets a term record table for the term record described above. The term record table includes: group ID, member ID, termID, etc. When the number of group members increases or decreases, a member change record needs to be generated. Specifically, the group member change record shown in the following table 1 may be referred to:
Figure BDA0003474460780000141
TABLE 1
As can be seen from table 1, when members enter a group, an entry group record is generated, the entry group termID of the entry group record is set as the current termID of the group, and the exit group termID of the entry group record is set as the preset VALUE long.max _ VALUE, i.e., the maximum positive integer. When the member quits the group, a quit record is generated, and the entering group termID and the quit group termID of the quit record are set as the current termID of the group. Wherein the termID of the group is self-increasing when the members of the group change.
For example, the electronic device may obtain, from the server, an incremental record in the group term record of the target group, that is, a term record whose group entry term id is greater than the local group term id, based on the local group term id of the electronic device when the group member of the target group changes. The local group termID is the largest termID in the group entry termIDs recorded by the local group term.
Therefore, the electronic equipment can determine the current group member of the target group according to the locally stored group term record and determine the group snapshot corresponding to the term ID according to any group term ID, so that the calculation amount of the server is greatly reduced.
Further, in this embodiment of the application, after acquiring the first group termID, the electronic device may locally change the message status and calculate the number of unread messages that have been read based on the first group termID and the local group term record.
Specifically, the number of read members and the number of unread members of the target message may be calculated by the following steps, and the step 202 may include the following steps 202a1 and 202a 2:
step 202a1, obtaining a second group term record of the local group term records based on the first group term id.
Step 202a2, determining the total number of group members receiving the target message based on the second group term record, and determining the total number of read members in the target group members based on the group member vernier information.
Wherein the second group term record is a record in which an entry group term id is smaller than or equal to the first group term id in the local group term record.
It should be noted that the local group term record has the same format and content as the term record in the server.
Based on the design of the term record table, when the local group term record queries the group member information of the target group when sending the target message based on the group snapshot of the target group, i.e. the first group term id, the group member included in the target group when sending the target message can be obtained according to all records in the local group term record of the target group, in which the group entering term id is less than or equal to the term id of the first group.
For example, the electronic device may count the number of group members included in the target group when the target message is sent, and calculate the number of group members that have read the target message from the group members included in the target group when the target message is sent according to the group member cursor information received in step 203.
It is understood that a read quantity identifier is displayed in a preset area of the sent target message, and the read quantity identifier is used for indicating the total number of group members in the group capable of receiving the target message and the total number of group members reading the message. The read quantity identification is determined based on a maximum read cursor for each group member within the target group member. In order to reduce the pushing pressure of the server, the server will only push the maximum read cursor if the group member sending the target message pays attention to the target group. When the session interface of the target group is in the display state on the electronic device, the target group is in the concerned state, and at this time, the server will push the maximum read cursor of the group member of the target group to the electronic device.
In the case that the number of target group members is large, i.e. exceeds the preset threshold, in order to further reduce the pushing pressure of the server, the server does not actively push the maximum read cursor of the group member of the target group. At this time, the electronic device may obtain the maximum read cursor of the group member of the target group from the server when the user clicks the read quantity identifier.
Therefore, the total number of the group members capable of viewing the target message and the number of the group members having read the target message can be calculated on the electronic equipment without calculating on a server, and the calculation pressure of the service is greatly reduced.
According to the group management method provided by the embodiment of the application, the group term record table is designed on the server, the member change records of the group are recorded, and the group snapshot corresponding to any term ID is determined according to the term record. And when the group members change, the term records can be synchronously updated to the local of the electronic equipment, so that the state change of the group messages and the calculation of the read unread messages are calculated in the local of the electronic equipment, and the server only keeps necessary message notification and data updating, thereby greatly reducing the calculation amount of the server.
It should be noted that, in the group management method provided in the embodiment of the present application, the execution subject may be a group management device, or a control module in the group management device for executing the group management method. The group management device provided in the embodiment of the present application is described by taking the example of the group management device executing the group management method.
In the embodiments of the present application, the above-described methods are illustrated in the drawings. The group management method is exemplarily described with reference to one of the drawings in the embodiments of the present application. In specific implementation, the group management method shown in each method drawing may also be implemented by combining any other drawing that may be combined, which is illustrated in the foregoing embodiments, and is not described herein again.
The group management device provided in the present application is described below, and the group management methods described below and described above may be referred to correspondingly.
Fig. 3 is a schematic structural diagram of a group management device according to an embodiment of the present application, as shown in fig. 3, specifically including:
a receiving module 301, configured to receive group member cursor information sent by a server; the group member cursor information is used for indicating the maximum read message ID of the target group member in the target group; a marking module 302 for marking the target message in the target group as read by the target group member based on the group member cursor information; the target message is a group message which is sent by the electronic equipment and has a message ID smaller than or equal to the maximum read message ID.
Optionally, the apparatus further comprises: a sending module; the sending module is used for sending the target message to the server; the receiving module 301 is further configured to receive the sending success information fed back by the server; the sending success information includes: a first group termID; the first group termID is the group termID of the target group when the server sends the target message to the group members of the target group; the group termID of the target group increases with changes to group members in the target group.
Optionally, the apparatus further comprises: a data update module; the sending module is further configured to send a group term acquisition request of the target group to the server when the group member of the target group is changed; the group term acquiring request carries the local group term ID of the target group; the receiving module 301 is further configured to receive a group term acquisition response of the target group sent by the server; the data updating module is configured to update the group member information and the local group term record of the target group according to the first group term record in the group term acquisition response, and update the local group term id of the target group to the maximum value of the group entry term id in the first group term record; wherein the first group term record is a record of the server, and the group member of the target group has a record with a group termID larger than the local group termID; the group term record comprises an entering group term ID and an exiting group term ID of the group members; when the group members enter the group, generating a group entering record; the entering group termID of the entering group record is the current group termID of the target group, and the exiting group termID of the entering group record is a preset numerical value; generating a group quitting record when the group members quit the group; the group entry termID and the group exit termID of the group exit record are the current group termID of the target group.
Optionally, the apparatus further comprises: the device comprises an acquisition module and a determination module; the acquisition module is configured to acquire a second group term record in the local group term records based on the first group term id; the determining module is used for determining the total number of the group members receiving the target message based on the second group term record and determining the total number of the read members in the target group members according to the cursor information of the group members; wherein the second group term record is a record in which an entry group term ID is less than or equal to the first group term ID in the local group term record.
The group management apparatus shown in fig. 3 may be an electronic device in the group management method.
Fig. 4 is a schematic structural diagram of a group management device according to an embodiment of the present application, as shown in fig. 4, specifically including:
a receiving module 401, configured to receive a read message of a target group member for an unread message in a target group; a sending module 402, configured to send group member cursor information of the target group member to an electronic device; wherein the group member cursor information is used to indicate a maximum read message ID of the target group members in the target group; and the maximum read message ID is the message ID of the unread message which is sent by the electronic equipment and has the maximum message ID.
Optionally, the receiving module 401 is further configured to receive a target message sent by the electronic device; the target message is a group message with a message ID less than or equal to the maximum read message ID; the sending module 402 is further configured to send, to the electronic device, sending success information that includes a first group termID, and send the target message to a group member in the target group; wherein the first group termID is a group termID of the target group when the electronic device sends the target message; the group termID of the target group increases with changes to group members in the target group.
Optionally, the receiving module 401 is further configured to receive a group term obtaining request of the target group sent by the electronic device; an obtaining module, configured to obtain a first group term record based on the local group term id of the target group carried in the group term obtaining request; the sending module 402 is further configured to send a group term obtaining response to the electronic device; wherein the group term acquisition response comprises: a first group term record for the target group; the first group term record is a record of the server, and the group member of the target group has a record with a group termID larger than the local group termID; the group term record comprises an entering group term ID and an exiting group term ID of the group members; when the group members enter the group, generating a group entering record; the entering group termID of the entering group record is the current group termID of the target group, and the exiting group termID of the entering group record is a preset numerical value; generating a group quitting record when the group members quit the group; the group entry termID and the group exit termID of the group exit record are the current group termID of the target group.
Optionally, the sending module 402 is further configured to send a group member change notification to the electronic device when a group member of the target group changes, so that the electronic device updates the group member information of the target group in the electronic device by sending the group term obtaining request to the server after receiving the group member change notification.
The group management apparatus shown in fig. 4 may be a server in the group management method.
According to the group management device, the group term record table is designed on the server, the member change records of the group are recorded, and the group snapshot corresponding to any term ID is determined according to the term record. And when the group members change, the term records can be synchronously updated to the local of the electronic equipment, so that the state change of the group messages and the calculation of the read unread messages are calculated in the local of the electronic equipment, and the server only keeps necessary message notification and data updating, thereby greatly reducing the calculation amount of the server.
Fig. 5 illustrates a physical structure diagram of an electronic device, which may include, as shown in fig. 5: a processor (processor)510, a communication Interface (Communications Interface)520, a memory (memory)530 and a communication bus 540, wherein the processor 510, the communication Interface 520 and the memory 530 communicate with each other via the communication bus 540. Processor 510 may call logic instructions in memory 530 to perform a group management method comprising: receiving cursor information of group members sent by a server; the group member cursor information is used for indicating the maximum read message ID of the target group member in the target group; based on the group member cursor information, marking a target message in the target group as the target group member has read; the target message is a group message which is sent by the electronic equipment and has a message ID smaller than or equal to the maximum read message ID.
Furthermore, the logic instructions in the memory 530 may be implemented in the form of software functional units and stored in a computer readable storage medium when the software functional units are sold or used as independent products. Based on such understanding, the technical solution of the present application or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
In another aspect, the present application further provides a computer program product, the computer program product comprising a computer program stored on a computer-readable storage medium, the computer program comprising program instructions, which when executed by a computer, enable the computer to perform the group management method provided by the above methods, the method comprising: receiving cursor information of group members sent by a server; the group member cursor information is used for indicating the maximum read message ID of the target group member in the target group; based on the group member cursor information, marking a target message in the target group as the target group member has read; the target message is a group message which is sent by the electronic equipment and has a message ID smaller than or equal to the maximum read message ID.
In yet another aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, the computer program being implemented by a processor to perform the group management method provided by the above aspects, the method comprising: receiving cursor information of group members sent by a server; the group member cursor information is used for indicating the maximum read message ID of the target group member in the target group; based on the group member cursor information, marking a target message in the target group as the target group member has read; the target message is a group message which is sent by the electronic equipment and has a message ID smaller than or equal to the maximum read message ID.
The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in the embodiments or some parts of the embodiments.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions in the embodiments of the present application.

Claims (10)

1. A group management method applied to electronic equipment is characterized by comprising the following steps:
receiving cursor information of group members sent by a server; the group member cursor information is used for indicating the maximum read message ID of the target group member in the target group;
based on the group member cursor information, marking a target message in the target group as the target group member has read;
the target message is a group message which is sent by the electronic equipment and has a message ID smaller than or equal to the maximum read message ID.
2. The method according to claim 1, wherein before receiving the group member cursor information sent by the server, the method further comprises:
sending the target message to the server;
receiving the sending success information fed back by the server;
the sending success information includes: a first group termID; the first group termID is the group termID of the target group when the server sends the target message to the group members of the target group; the group termID of the target group increases with changes to group members in the target group.
3. The method of claim 2, further comprising:
sending a group term acquisition request of the target group to the server under the condition that the group members of the target group are changed; the group term acquiring request carries the local group term ID of the target group;
receiving a group term acquisition response of the target group sent by a server;
updating the group member information and the local group term record of the target group according to the first group term record in the group term acquisition response, and updating the local group term ID of the target group to the maximum value of the group term ID in the first group term record;
wherein the first group term record is a record of the server, and the group member of the target group has a record with a group termID larger than the local group termID; the group term record comprises an entering group term ID and an exiting group term ID of the group members; when the group members enter the group, generating a group entering record; the entering group termID of the entering group record is the current group termID of the target group, and the exiting group termID of the entering group record is a preset numerical value; generating a group quitting record when the group members quit the group; the group entry termID and the group exit termID of the group exit record are the current group termID of the target group.
4. The method of claim 2 or 3, wherein said marking target messages in the target group as read by the target group member based on the group member cursor information comprises:
acquiring a second group term record in the local group term records based on the first group term ID;
determining the total number of group members receiving the target message based on the second group term record, and determining the total number of read members in the target group members according to the cursor information of the group members;
wherein the second group term record is a record in which an entry group term ID is less than or equal to the first group term ID in the local group term record.
5. A group management method is applied to a server and is characterized by comprising the following steps:
receiving a read message of a target group member aiming at an unread message in a target group;
sending group member cursor information of the target group member to the electronic equipment;
wherein the group member cursor information is used to indicate a maximum read message ID of the target group members in the target group; and the maximum read message ID is the message ID of the unread message which is sent by the electronic equipment and has the maximum message ID.
6. The method of claim 5, wherein before receiving the read message of the target group member for the unread message in the target group, the method further comprises:
receiving a target message sent by the electronic equipment; the target message is a group message with a message ID less than or equal to the maximum read message ID;
sending successful sending information containing a first group termID to the electronic equipment, and sending the target message to group members in the target group;
wherein the first group termID is a group termID of the target group when the electronic device sends the target message; the group termID of the target group increases with changes to group members in the target group.
7. The method of claim 5, further comprising:
receiving a group term acquisition request of the target group sent by the electronic equipment;
acquiring a first group term record based on the local group term ID of the target group carried in the group term acquisition request, and sending a group term acquisition response to the electronic equipment;
wherein the group term acquisition response comprises: a first group term record for the target group; the first group term record is a record of the server, and the group member of the target group has a record with a group termID larger than the local group termID; the group term record comprises an entering group term ID and an exiting group term ID of the group members; when the group members enter the group, generating a group entering record; the entering group termID of the entering group record is the current group termID of the target group, and the exiting group termID of the entering group record is a preset numerical value; generating a group quitting record when the group members quit the group; the group entry termID and the group exit termID of the group exit record are the current group termID of the target group.
8. A group management apparatus, the apparatus comprising:
the receiving module is used for receiving the cursor information of the group members sent by the server; the group member cursor information is used for indicating the maximum read message ID of the target group member in the target group;
a marking module for marking the target message in the target group as read by the target group member based on the group member cursor information;
the target message is a group message which is sent by the electronic equipment and has a message ID smaller than or equal to the maximum read message ID.
9. A group management apparatus, the apparatus comprising:
the receiving module is used for receiving the read message of the target group member aiming at the unread message in the target group;
the sending module is used for sending the group member cursor information of the target group member to the electronic equipment;
wherein the group member cursor information is used to indicate a maximum read message ID of the target group members in the target group; and the maximum read message ID is the message ID of the unread message which is sent by the electronic equipment and has the maximum message ID.
10. A computer program product comprising computer program/instructions, characterized in that the computer program/instructions, when executed by a processor, implement the steps of the group management method according to any of claims 1 to 4 or 5 to 7.
CN202210051268.2A 2022-01-17 2022-01-17 Group management method and device Active CN114338255B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210051268.2A CN114338255B (en) 2022-01-17 2022-01-17 Group management method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210051268.2A CN114338255B (en) 2022-01-17 2022-01-17 Group management method and device

Publications (2)

Publication Number Publication Date
CN114338255A true CN114338255A (en) 2022-04-12
CN114338255B CN114338255B (en) 2023-09-05

Family

ID=81028212

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210051268.2A Active CN114338255B (en) 2022-01-17 2022-01-17 Group management method and device

Country Status (1)

Country Link
CN (1) CN114338255B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105577530A (en) * 2016-01-07 2016-05-11 天脉聚源(北京)科技有限公司 Group chat information overviewing method and apparatus
US20160364368A1 (en) * 2015-06-11 2016-12-15 International Business Machines Corporation Organizing messages in a hierarchical chat room framework based on topics
US20170054664A1 (en) * 2015-08-17 2017-02-23 Naver Corporation Method, system, and recording medium for managing group message
CN106503061A (en) * 2016-09-27 2017-03-15 维沃移动通信有限公司 One population message display method and mobile terminal
CN107948050A (en) * 2017-11-08 2018-04-20 用友网络科技股份有限公司 A kind of device and method that group message read states are provided
CN108400924A (en) * 2017-02-06 2018-08-14 阿里巴巴集团控股有限公司 Read state methods of exhibiting, instant communication client and the server-side of group message
CN110113489A (en) * 2019-04-30 2019-08-09 上海掌门科技有限公司 Message group sort method, device, electronic equipment and medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160364368A1 (en) * 2015-06-11 2016-12-15 International Business Machines Corporation Organizing messages in a hierarchical chat room framework based on topics
US20170054664A1 (en) * 2015-08-17 2017-02-23 Naver Corporation Method, system, and recording medium for managing group message
CN105577530A (en) * 2016-01-07 2016-05-11 天脉聚源(北京)科技有限公司 Group chat information overviewing method and apparatus
CN106503061A (en) * 2016-09-27 2017-03-15 维沃移动通信有限公司 One population message display method and mobile terminal
CN108400924A (en) * 2017-02-06 2018-08-14 阿里巴巴集团控股有限公司 Read state methods of exhibiting, instant communication client and the server-side of group message
CN107948050A (en) * 2017-11-08 2018-04-20 用友网络科技股份有限公司 A kind of device and method that group message read states are provided
CN110113489A (en) * 2019-04-30 2019-08-09 上海掌门科技有限公司 Message group sort method, device, electronic equipment and medium

Also Published As

Publication number Publication date
CN114338255B (en) 2023-09-05

Similar Documents

Publication Publication Date Title
CN102449628A (en) Architectural pattern for persistent web application design
CN108744504B (en) Game data processing method and device, game server and game system
CN110188307B (en) Multi-tenant data isolation method, server and system
CN111130986B (en) Message sending method, device, equipment and storage medium
CN111277483B (en) Multi-terminal message synchronization method, server and storage medium
CN106453593B (en) Message pushing method and device
CN112367345A (en) Data processing method, server device and computer readable storage medium
CN109560951B (en) Configuration method, alarm real-time statistical method, server and system
CN110445667B (en) Link delay detection method, device, storage medium and terminal
CN111884843B (en) Message processing method and device, electronic equipment and storage medium
CN110544136A (en) Method, device, equipment and storage medium for calculating synchronous putting probability
CN111737443B (en) Answer text processing method and device and key text determining method
CN112910987A (en) Message pushing method, system, device, equipment and storage medium
CN114338255A (en) Group management method and device
CN112016009A (en) Data processing method, balance obtaining method, device, equipment and storage medium
CN113467718B (en) Data processing method and device, electronic equipment and storage medium
CN114356970B (en) Storage system resource caching method and device
CN113222408A (en) Online inquiry service monitoring method, device, equipment and storage medium
CN114945036B (en) Processing method of shared data, related equipment and medium
CN112968933B (en) Data transmission method, device, server and storage medium
CN113018852B (en) Data processing method and data processing device
CN117061310A (en) Device image generation method, device, storage medium and electronic device
CN117880236A (en) Information updating method, device, terminal equipment and storage medium
CN114339440A (en) Live broadcast information management method and related equipment
CN113360526A (en) Game data query method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant