Group member snapshot storage method and device, equipment and storage medium

By updating the change version number and mapping table of group members in the instant messaging system, and determining the snapshot data type based on the number of group members, the problems of high storage cost and low query efficiency in group chat business are solved, and efficient storage and Query operation.

CN118964436APending Publication Date: 2024-11-15SHENZHEN LEAPFROG NEW TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311836418.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-12-28
Publication Date
2024-11-15

AI Technical Summary

Technical Problem

In the instant messaging system, group member snapshots are stored at high cost and query efficiency in group chat services. Especially in the hyper-large group member scenario, traditional methods directly store all member snapshots one by one, resulting in high storage costs and high query operation efficiency. Low.

Method used

By updating the group member change version number and mapping table when group members change, determine the snapshot data type based on the number of valid and invalid group members, build the content data of the group member snapshot, including group member indexes of valid and invalid types, and update the group Member snapshots, reducing storage costs and improving query efficiency.

Benefits of technology

It reduces the storage cost of group member snapshots, improves the efficiency of query operations, and builds a data structure with high compression ratio and supports efficient queries.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118964436A_ABST
    Figure CN118964436A_ABST
Patent Text Reader

Abstract

The invention discloses a group member snapshot storage method, device and equipment and a storage medium, and the method comprises the steps: when a group member of a group changes, updating a group member change version number of the group and a group member mapping table, the group member mapping table comprising group member IDs and group member indexes which have a mapping relation; taking the group member change version number as the version number of the group member snapshot; according to the number of valid group members and the number of invalid group members of the current group, determining data types of the group member snapshots, and according to the group member mapping table and the data types, determining content data of the group member snapshots, the data types including valid types and invalid types, and the content data including group member indexes corresponding to the data types; and updating the group member snapshots according to the version numbers, the content data and the data types of the group member snapshots. By utilizing the group member snapshot storage method disclosed by the invention, the storage cost can be reduced, and the efficiency of query operation can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of instant messaging, and in particular to a group member snapshot storage method, device, equipment and storage medium. Background Art

[0002] In instant messaging systems, group chat services are a very common business form, which needs to support the immediate reading of messages sent by group users in the group by all valid group members. One of the most common architectures of group chat systems that support large-scale group members is based on read diffusion. This architecture starts to determine whether the message is readable to group members when the group synchronizes the message from the server, that is, it determines whether the message is readable by group members who are valid at the time of message sending. For example, before member A joins the group, a group member sends a message M. After member A joins the group, member A still cannot read message M. Therefore, it is necessary to take a snapshot of the group members when the message is sent, and to build an association between the message and the group member snapshot. In ultra-large-scale scenarios, such as scenarios with more than 100,000 group members, the traditional method directly stores all member snapshots one by one, which has high storage costs and low query operation efficiency. Summary of the invention

[0003] The present invention provides a group member snapshot storage method, device, equipment and storage medium, which are used to solve the technical problems of high storage cost and low query operation efficiency of group member snapshots in the prior art.

[0004] In order to solve the above technical problems, in a first aspect, the present invention provides a group member snapshot storage method, the method comprising:

[0005] When a group member of a group changes, the group member change version number and the group member mapping table of the group are updated, wherein the group member mapping table includes the group member ID and the group member index having a mapping relationship;

[0006] Using the group member change version number as the version number of the group member snapshot;

[0007] Determine the data type of the group member snapshot according to the number of valid group members and the number of invalid group members of the current group, and determine content data of the group member snapshot according to the group member mapping table and the data type, the data type including a valid type and an invalid type, and the content data including the group member index corresponding to the data type;

[0008] The group member snapshot is updated according to the version number of the group member snapshot, the content data and the data type.

[0009] Optionally, determining the data type of the group member snapshot according to the current number of valid group members and the number of invalid group members of the group includes:

[0010] If the number of valid group members of the current group is greater than or equal to the number of invalid group members, the data type of the group member snapshot is an invalid type; otherwise, the data type of the group member snapshot is a valid type.

[0011] Optionally, when a group member of a group changes, updating the group member mapping table of the group includes:

[0012] When a group member is deleted by the group, the group member mapping table is maintained unchanged;

[0013] When a group member deleted by the group rejoins the group, the group member mapping table is maintained unchanged;

[0014] When a new member who has never joined the group joins the group, the group member ID and group member index of the new member are added to the group member mapping table.

[0015] Optionally, the storage structure of the group member mapping table includes a magic value of the data structure, a group ID, the number of group member indexes, and an array constructed according to the group member IDs and group member indexes having a mapping relationship.

[0016] Optionally, the array is a key-value pair composed of group member IDs and group member indexes that have a mapping relationship and are arranged in ascending order.

[0017] Optionally, the storage structure of the group member snapshot includes header data and the content data, and the header data includes a magic value of a data structure, the data type, the version number, a group ID, and the number of group member indexes.

[0018] Optionally, after updating the group member snapshot, the group member snapshot storage method further includes:

[0019] In response to a request to send a group message in the group, the group member change version number is returned as metadata of the group message, and the group message is associated with the group member snapshot through the metadata.

[0020] In a second aspect, the present invention provides a group member snapshot storage device, including a mapping table update module, a version number determination module, a content data determination module, and a group member snapshot update module;

[0021] The mapping table updating module is used to update the group member change version number and the group member mapping table of the group when the group members of the group are changed. The group member mapping table includes the group member ID and the group member index with a mapping relationship.

[0022] The version number determination module is used to use the group member change version number as the version number of the group member snapshot;

[0023] The content data determination module is used to determine the data type of the group member snapshot according to the number of valid group members and the number of invalid group members of the current group, and determine the content data of the group member snapshot according to the group member mapping table and the data type, the data type includes a valid type and an invalid type, and the content data includes the group member index corresponding to the data type;

[0024] The group member snapshot updating module is used to update the group member snapshot according to the version number of the group member snapshot, the content data and the data type.

[0025] In a third aspect, the present invention provides a group member snapshot storage device, including a memory and a processor, wherein:

[0026] The memory is used to store computer programs;

[0027] The processor is used to read the program in the memory and execute the steps of the group member snapshot storage method provided in the first aspect.

[0028] In a fourth aspect, the present invention provides a computer-readable storage medium having a readable computer program stored thereon, which, when executed by a processor, implements the steps of the group member snapshot storage method provided in the first aspect above.

[0029] Compared with the prior art, the group member snapshot storage method, device, equipment and storage medium provided by the present invention have the following beneficial effects:

[0030] When a group member of a group changes, the group member change version number and the group member mapping table of the group are updated, the group member mapping table includes a group member ID and a group member index with a mapping relationship, and the group member ID of a discrete group member corresponds to the group member index to reduce storage costs; the group member change version number is used as the version number of the group member snapshot; the data type of the group member snapshot is determined according to the current number of valid group members and the number of invalid group members of the group, and the content data of the group member snapshot is determined according to the group member mapping table and the data type, the data type includes a valid type and an invalid type, and the content data includes the group member index corresponding to the data type; the group member snapshot is updated according to the version number of the group member snapshot, the content data and the data type; a group member snapshot with a high compression ratio and supporting an efficient query operation data structure is constructed, which can reduce storage costs and improve the efficiency of query operations. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only part of the embodiments of the present invention, rather than all of the embodiments. For ordinary technicians in this field, without paying creative work, other drawings obtained based on these drawings all fall within the scope of protection of this application.

[0032] Figure 1 is a flow chart of a group member snapshot storage method provided by an embodiment of the present invention;

[0033] Figure 2 is a first structural diagram of a group member mapping table provided by an embodiment of the present invention;

[0034] Figure 3 is a second structural diagram of a group member mapping table provided in an embodiment of the present invention;

[0035] Figure 4 is a schematic diagram of a first storage structure of a group member snapshot provided by an embodiment of the present invention;

[0036] Figure 5 is a schematic diagram of the structure of an array provided by an embodiment of the present invention;

[0037] Figure 6 is a schematic diagram of a first storage structure of a group member mapping table provided in an embodiment of the present invention;

[0038] Figure 7 Schematic diagram of a second storage structure of a group member mapping table provided in an embodiment of the present invention

[0039] Figure 8 is a third structural diagram of a group member mapping table provided in an embodiment of the present invention;

[0040] Fig. 9 is a schematic diagram of a third storage structure of a group member mapping table provided in an embodiment of the present invention;

[0041] Fig.10 is a schematic diagram of a second storage structure of group member snapshots provided by an embodiment of the present invention;

[0042] Fig.11 is a schematic diagram of a fourth storage structure of a group member mapping table provided in an embodiment of the present invention;

[0043] Fig.12 is a schematic diagram of a third storage structure of group member snapshots provided by an embodiment of the present invention;

[0044] Fig.13 is a schematic diagram of a fourth storage structure of a group member snapshot provided by an embodiment of the present invention;

[0045] Fig.14 is a schematic diagram of a bitmap of a valid group member list provided by an embodiment of the present invention;

[0046] Fig.15 is a schematic diagram of a bitmap of a read list provided by an embodiment of the present invention;

[0047] Fig.16 It is a structural schematic diagram of a group member snapshot storage device provided by an embodiment of the present invention;

[0048] Fig.17 It is a structural schematic diagram of a group member snapshot storage device provided by an embodiment of the present invention;

[0049] Fig.18 It is a schematic diagram of the structure of a computer-readable storage medium provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0050] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0051] In order to make the description of the disclosed content more detailed and complete, the following is an illustrative description of the implementation mode and specific examples of the present invention; however, this is not the only form of implementing or applying the specific embodiments of the present invention. The implementation mode covers the features of multiple specific embodiments and the method steps and their sequence for constructing and operating these specific embodiments. However, other specific embodiments can also be used to achieve the same or equal functions and step sequences. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0052] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein.

[0053] In the description of the embodiments of the present application, "multiple" refers to two or more than two, and other quantifiers are similar and should be understood. The preferred embodiments described herein are only used to illustrate and explain the present invention, and are not used to limit the present invention. In addition, the embodiments of the present application and the features therein may be combined with each other if there is no conflict.

[0054] Example 1

[0055] like Figure 1 , which is a flow chart of a group member snapshot storage method provided by an embodiment of the present invention. The group member snapshot storage method includes the following steps.

[0056] Step S101, when a group member of a group is changed, the group member change version number and the group member mapping table of the group are updated, wherein the group member mapping table includes group member IDs and group member indexes having a mapping relationship;

[0057] In a specific embodiment, the group member index is an ID number that is assigned to the group member when the user joins the group and that increases monotonically continuously starting from 0, and forms a relationship table mapping between the group member ID and the group member index, i.e., a group member mapping table. For example, in the initial state, a user with a group member ID of 0x65c4744e creates a group and adds two users with group member IDs of 0x11712c76 and 0x06b749334 to the group. At this time, the first structural diagram of the corresponding group member mapping table is as follows: Figure 2 As shown, a new member with a group member ID of 0x3995b621 is then invited to join the group. At this time, the second structural diagram of the corresponding group member mapping table is as follows: Figure 3 As shown; Figure 2 , Figure 3 Here, userId represents the group member ID, and idx represents the group member index.

[0058] As an optional implementation, when a group member of a group changes, updating the group member mapping table of the group includes:

[0059] When a group member is deleted by the group, the group member mapping table is maintained unchanged;

[0060] When a group member deleted by the group rejoins the group, the group member mapping table is maintained unchanged;

[0061] When a new member who has never joined the group joins the group, the group member ID and group member index of the new member are added to the group member mapping table.

[0062] It should be noted that when a group member leaves the group, the group member mapping table is not updated. After a group member leaves and rejoins the group, the corresponding group member index remains unchanged. For example, when a group member with a group member ID of 0x11712c76 leaves the group, the corresponding group member mapping table remains unchanged. Figure 3 As shown, when a group member with a group member ID of 0x11712c76 rejoins the group, the corresponding group member mapping table remains unchanged.

[0063] In some embodiments, the above-mentioned group member change version number can be a monotonically increasing number, which can be used to indicate the order of group member change operations. All group member change operations, including group creation, group member joining the group and group member leaving the group, will result in the update of the above-mentioned group member change version number. Then, when the group members of the group change, the group member change version number of the group is updated, including, when the group is created, updating the group member change version number of the group, that is, initializing the group member change version number, when the group member is deleted from the group, updating the group member change version number of the group, when the group member deleted from the group re-joins the group, updating the group member change version number of the group, and when a new member who has not joined the group joins the group, the group member change version number of the group is updated.

[0064] In a specific implementation, when a group is created, several members are added to the group. At this time, the group member change version number is initialized to 0. If several members subsequently join the group at one time, the group member change version number is set to 1. If a member joins or leaves the group, the group member change version number is set to 2, and so on.

[0065] Continue to Figure 1 In step S102, the group member change version number is used as the version number of the group member snapshot;

[0066] Step S103, determining the data type of the group member snapshot according to the number of valid group members and the number of invalid group members of the current group, and determining content data of the group member snapshot according to the group member mapping table and the data type, wherein the data type includes a valid type and an invalid type, and the content data includes the group member index corresponding to the data type;

[0067] As an optional implementation manner, determining the data type of the group member snapshot according to the current number of valid group members and the number of invalid group members of the group includes:

[0068] If the number of valid group members of the current group is greater than or equal to the number of invalid group members, the data type of the group member snapshot is an invalid type; otherwise, the data type of the group member snapshot is a valid type.

[0069] In some embodiments, taking into account the characteristics of group services, for example, in the early stage of group chat creation, all members are valid members. As time goes by, group members gradually leave and new members join, and eventually a large number of invalid members may appear. Therefore, the data storage structure can be divided into two categories. When there are relatively few invalid group members, invalid group member indexes are stored. At this time, the minimum storage space is required to obtain the maximum compression ratio. When the number of invalid group members is greater than the valid members, the group member indexes of the valid group members are stored conversely.

[0070] Step S104: updating the group member snapshot according to the version number of the group member snapshot, the content data and the data type.

[0071] As an optional implementation, the storage structure of the group member snapshot includes header data and the content data, and the header data includes a magic value of the data structure, the data type, the version number, the group ID, and the number of group member indexes.

[0072] In some embodiments, the group member snapshot combined with the group member mapping table can be used to quickly infer whether the group member is a valid member of the current group. The storage structure of the group member snapshot includes header data and content data.

[0073] A schematic diagram of a first storage structure of a group member snapshot provided by an embodiment of the present invention is shown in FIG. Figure 4 As shown, Figure 4 The first line is the header data, and the second line is the content data. Figure 4 In the above, magic indicates the magic value of the data structure, which can be a 24-bit integer data; type indicates the data type, which can be an 8-bit integer data, indicating the data type of the content data data; version indicates the group member change version number, which can be a 32-bit integer data; group id indicates the group ID; max index indicates the maximum group member index value of the current snapshot plus 1, that is, the length of the current group member mapping table. Figure 4 The content data data in is used to store a list of group member indexes; when type is 0, data stores a list of group member indexes of invalid group members, and when type is 1, data stores a list of group member indexes of valid members.

[0074] As an optional implementation manner, after updating the group member snapshot, the group member snapshot storage method further includes:

[0075] In response to a request to send a group message in the group, the group member change version number is returned as metadata of the group message, and the group message is associated with the group member snapshot through the metadata.

[0076] In some embodiments, whenever there is a change in group members, a new group member version snapshot is created for the current group member list, that is, the group member snapshot is updated, and the group member change version number is used as the ID of the group member version snapshot. When a group message is sent, in response to a request to send a group message in the group, the group member change version number at that time is obtained as the metadata of the group message, so that the group message and the group member snapshot can be associated through the group member change version number.

[0077] As an optional implementation, the storage structure of the group member mapping table includes a magic value of the data structure, a group ID, the number of group member indexes, and an array constructed according to the group member IDs and group member indexes having a mapping relationship.

[0078] As an optional implementation, the array is composed of key-value pairs arranged in ascending order based on group member IDs and group member indexes that have a mapping relationship.

[0079] In some embodiments, the array may be a key-value pair with the group member ID as the key and the group member index as the value. For example, taking the group member ID and the group member index of the integer Int 32 bits as an example, the two together are 64 bits, so a 64-bit long integer can be used to represent the array, where the group member ID is the high 32 bits of the integer Int 64 bits, and the group member index is the low 32 bits of the integer Int 64 bits. Therefore, each record of the group member mapping table can be merged into a 64-bit long integer and converted into an integer Int 64-bit array. The schematic diagram of its structure is shown as follows: Figure 5 shown. Figure 5 In the group member mapping table, the group member ID is a hexadecimal number, wherein each record of the group member mapping table includes a group member ID and a corresponding group member index.

[0080] It should be noted that the data format of the group member ID and the group member index can also be a 64-bit integer value, or even a sortable byte array.

[0081] It should be noted that the above array may also use the group member ID as the low-order data and the group member index as the high-order data, and the embodiment of the present invention does not impose any limitation on this.

[0082] In a specific embodiment, the first storage structure diagram of the group member mapping table is as follows: Figure 6 As shown, Figure 6 Here, magic, group id, and length represent the magic value, group ID, and number of group member indexes of the data structure, respectively. The number of group member indexes is the length of the group member mapping table. Figure 6The data in the table is array data. When storing the group member mapping table, the group member mapping table can be serialized, each record of the group member mapping table can be merged into a 64-bit long integer, and then converted into an Int 64-bit array, and the array can be written in ascending order according to the size of the array. Figure 6 The location of data in the table can be used to obtain the second storage structure diagram of the group member mapping table, as shown in Figure 7 As shown, Figure 7 Here, length(4) indicates that the number of group member indexes is 4.

[0083] As an example, when a new member with a group member ID of 0x52a1caba joins the group, its corresponding group member index is 4, and the corresponding group member ID and group member index are added to the original group member mapping table to obtain a third structural diagram of the group member mapping table, as shown in FIG. Figure 8 As shown, during serialization, the group member mapping table needs to be re-sorted according to the rule of ascending array size to obtain the third storage structure diagram of the group member mapping table, as shown in Fig. 9 As shown, Fig. 9 Here, length(5) indicates that the number of group member indexes is 5.

[0084] It should be noted that if the group member mapping table is kept in order when updated, it will always be in order when querying the group member mapping table. The query efficiency of the group member mapping table can be guaranteed by modifying the binary search algorithm. In specific implementation, the group member index can be placed in the high-order part to use the VInt (Variable-Length Integer) encoding algorithm, and it can also occupy less storage space.

[0085] In a specific embodiment, a user with a group member ID of 0x65c4744e creates a group, and the group also includes three group members with group member IDs of 0x11712c76, 0x3995b621, and 0x06b749334, corresponding to Figure 7 The storage structure of the group member mapping table shown in FIG. 1 is a schematic diagram of the second storage structure of the group member snapshot, and the group member change version number is 0. Fig.10 As shown, Fig.10 The content data of the group member snapshot is empty, that is, users with group member index less than 4 in the group member mapping table are all valid group members. Before there is a member change in the group, the group member change version number remains unchanged at 0.

[0086] After the group is created, two group members are invited to join the group again. The group member IDs of the two group members are 0x52a1caba and 0x73d80f6f respectively. At this time, the group member change version number is 1. The fourth storage structure diagram of the group member mapping table is as follows: Fig.11As shown; a schematic diagram of the third storage structure of the group member snapshot, as shown Fig.12 As shown, no member has left the group so far, that is, all are valid members and there are no invalid members. Since there are fewer invalid members than valid members, the cost of storing a list of group member indexes of invalid members is lower.

[0087] If the administrator kicks four group members with group member IDs of 0x11712c76, 0x3995b621, 0x73d80f6f, and 0x06b749334 out of the group at the same time, there are still two valid members in the group, and the corresponding group member change version number is changed to 2, and the group member mapping table remains unchanged. At this time, the fourth storage structure diagram of the group member snapshot is as follows: Fig.13 As shown. Because there are 4 invalid members in the group, which is greater than the number of valid members, the data type is updated to 1, which represents the group member index of the valid members. This storage method can reduce storage costs; Fig.13 This indicates that only users with group member indexes 0 and 4 in the corresponding group member snapshot are valid group members, that is, group members with group member IDs 0x52a1caba and 0x65c4744e are valid group members.

[0088] In a specific embodiment, through the above group member mapping table and group member snapshot, the group message can be read and counted, and the group message read receipt and statistics include a reporting process and a statistical process:

[0089] The reporting process involves the user reading a group message and generating an event to report to the server. The user's group member index is stored as metadata on the client side. When the group message is reported, the group ID, group member index, and a list of messages marked as read are reported to the server. When the server sends the message, it prepares a bitmap structure in advance. When the group message is reported, the corresponding bitmap index of the message is set to 1, indicating that it has been read, otherwise it is set to 0, indicating that it has not been read. Here, the bitmap index corresponds to the user's group member index.

[0090] In the statistical process, the group member snapshot is combined with the group member mapping table to construct a bitmap of valid group members as the read list. The valid member bitmap and the read bitmap are XORed to obtain the read unread list. The schematic diagram of the bitmap of the valid group member list is as follows: Fig.14 As shown, Fig.14 In the example, versionm represents a bitmap of the valid group member list with group member change version number m. Group members with group member indexes 1, 5, and 10 are invalid members and are therefore not included in the list. Fig.14 A schematic diagram of the bitmap of the read list is shown in Fig.15 As shown, Fig.15In the message x, the message corresponding to the group member change version number m is a bitmap of the read report list. Group members with indexes 0, 1, 2, 5, 10, 11, and 13 have not read the message, so they are not in the Fig.15 As shown in FIG. 1 , the XOR operation can be used to obtain the unread messages of group members with group member indexes of 0, 2, 11, and 13, thereby determining the list of unread members to be read, and the corresponding group member ID can be obtained through the group member mapping table.

[0091] The group member snapshot storage method provided by the embodiment of the present invention updates the group member change version number and the group member mapping table of the group when the group members of the group change, the group member mapping table includes the group member ID and the group member index with a mapping relationship, and the group member ID of the discrete group member corresponds to the group member index to reduce the storage cost; the group member change version number is used as the version number of the group member snapshot; the data type of the group member snapshot is determined according to the current number of valid group members and the number of invalid group members of the group, and the content data of the group member snapshot is determined according to the group member mapping table and the data type, the data type includes a valid type and an invalid type, and the content data includes the group member index corresponding to the data type; the group member snapshot is updated according to the version number of the group member snapshot, the content data and the data type; a group member snapshot with a high compression ratio and supporting an efficient query operation data structure is constructed, which can reduce the storage cost and improve the efficiency of the query operation.

[0092] The group member snapshot of the embodiment of the present invention includes a group member change version number, that is, a serial number of the group member change operation, and a group member mapping table that records all group members who have been in the group and the order in which they joined the group. Each group has only one of these two contents. The group member change version number can be used to establish a corresponding relationship between group messages and group member snapshots, and the group member mapping table can be used to convert the group member IDs of discrete group members into relatively continuous numbers, that is, group member indexes, thereby reducing the storage cost of the read report bitmap.

[0093] The embodiments of the present invention construct a data structure with an ultra-high compression ratio and supporting efficient query according to the business characteristics of the group, which can solve the readability problem of messages to group members in read diffusion and the performance problem of the read and unread statistics of group messages with very low storage cost and ultra-high query efficiency.

[0094] The group member snapshot storage method provided by the embodiment of the present invention is applied to a group chat service system based on read diffusion in instant messaging, which can effectively solve the visibility problem of group messages and the member statistics problem of read receipts and read but unread messages of group messages.

[0095] In addition, the above-mentioned group member snapshot storage method of the embodiment of the present invention is also applicable to any business system that relies on member version backtracking.

[0096] Example 2

[0097] Based on the above group member snapshot storage method, an embodiment of the present invention provides a group member snapshot storage device, as shown in FIG. Fig.16 As shown, the group member snapshot storage device 160 includes a mapping table updating module 161, a version number determining module 162, a content data determining module 163 and a group member snapshot updating module 164;

[0098] The mapping table updating module 161 is used to update the group member change version number and the group member mapping table of the group when the group members of the group are changed. The group member mapping table includes the group member ID and the group member index with a mapping relationship.

[0099] The version number determination module 162 is used to use the group member change version number as the version number of the group member snapshot;

[0100] The content data determination module 163 is used to determine the data type of the group member snapshot according to the number of valid group members and the number of invalid group members of the current group, and determine the content data of the group member snapshot according to the group member mapping table and the data type, the data type includes a valid type and an invalid type, and the content data includes the group member index corresponding to the data type;

[0101] The group member snapshot updating module 164 is used to update the group member snapshot according to the version number of the group member snapshot, the content data and the data type.

[0102] For other details about how the modules in the above-mentioned group member snapshot storage device implement the above-mentioned technical solution, reference may be made to the description of the group member snapshot storage method provided in the above-mentioned invention embodiment, which will not be repeated here.

[0103] Based on the above group member snapshot storage method, the embodiment of the present invention further provides a group member snapshot storage device, as shown in the structural diagram. Fig.17 As shown, the group member snapshot storage device 170 includes a processor 171 and a memory 172 coupled to the processor 171. The memory 172 stores a computer program, and when the computer program is executed by the processor 171, the processor 171 executes the steps of the group member snapshot storage method in the above embodiment.

[0104] For other details about the implementation of the above technical solution by the processor 171 in the above group member snapshot storage device, reference may be made to the description of the group member snapshot storage method provided in the above invention embodiment, which will not be repeated here.

[0105] Among them, the processor 171 can also be called a CPU (Central Processing Unit), and the processor 171 may be an integrated circuit chip with signal processing capabilities; the processor 171 can also be a general-purpose processor, DSP (Digital Signal Process), ASIC (Application Specific Integrated Circuit), FPGA (Field Programmable Gate Array) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, among which the general-purpose processor can be a microprocessor or the processor 171 can also be any conventional processor, etc.

[0106] The embodiment of the present invention further provides a computer-readable storage medium, a schematic diagram of which is shown in FIG. Fig.18 As shown, a readable computer program 181 is stored on the storage medium 180; wherein, the computer program 181 can be stored in the above storage medium in the form of a software product, including several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) or a processor to execute all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, magnetic disk or optical disk, ROM (Read-Only Memory), RAM (Random Access Memory) and other media that can store program codes, or terminal devices such as computers, servers, mobile phones, and tablets.

[0107] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the modules is only a logical function division. There may be other division methods in actual implementation, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.

[0108] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical modules, that is, they may be located in one place or distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0109] In addition, each functional module in each embodiment of the present application can be integrated into a processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The above-mentioned integrated module can be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it can be stored in a computer-readable storage medium.

[0110] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of the embodiments may be implemented in the form of a computer program product.

[0111] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website site, a computer, a server, or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server, or data center. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a server or a data center that includes one or more available media integrations. The available medium may be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)), etc.

[0112] The technical solution provided by the present application is introduced in detail above. The principles and implementation methods of the present application are explained by using specific examples in the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for those skilled in the art, according to the idea of ​​the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

[0113] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0114] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices and computer program products according to the present application. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0115] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0116] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0117] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. A group member snapshot storage method, characterized in that: include: When a group member of a group changes, the group member change version number and the group member mapping table of the group are updated, wherein the group member mapping table includes the group member ID and the group member index having a mapping relationship; Using the group member change version number as the version number of the group member snapshot; Determine the data type of the group member snapshot according to the number of valid group members and the number of invalid group members of the current group, and determine content data of the group member snapshot according to the group member mapping table and the data type, the data type including a valid type and an invalid type, and the content data including the group member index corresponding to the data type; The group member snapshot is updated according to the version number of the group member snapshot, the content data and the data type.

2. The group member snapshot storage method according to claim 1, characterized in that: Determining the data type of the group member snapshot according to the current number of valid group members and the number of invalid group members of the group includes: If the number of valid group members of the current group is greater than or equal to the number of invalid group members, the data type of the group member snapshot is an invalid type; otherwise, the data type of the group member snapshot is a valid type.

3. The group member snapshot storage method according to claim 1, characterized in that: When a group member of a group changes, the group member mapping table of the group is updated, including: When a group member is deleted by the group, the group member mapping table is maintained unchanged; When a group member deleted by the group rejoins the group, the group member mapping table is maintained unchanged; When a new member who has never joined the group joins the group, the group member ID and group member index of the new member are added to the group member mapping table.

4. The group member snapshot storage method according to claim 1, characterized in that: The storage structure of the group member mapping table includes a magic value of a data structure, a group ID, the number of group member indexes, and an array constructed according to the group member IDs and group member indexes having a mapping relationship.

5. The group member snapshot storage method according to claim 4, characterized in that: The array is composed of key-value pairs arranged in ascending order based on the group member IDs and group member indexes that have a mapping relationship.

6. The group member snapshot storage method according to claim 1, characterized in that: The storage structure of the group member snapshot includes header data and the content data, wherein the header data includes a magic value of a data structure, the data type, the version number, a group ID, and the number of group member indexes.

7. The group member snapshot storage method according to any one of claims 1 to 6, characterized in that: After updating the group member snapshot, the group member snapshot storage method further includes: In response to a request to send a group message in the group, the group member change version number is returned as metadata of the group message, and the group message is associated with the group member snapshot through the metadata.

8. A group member snapshot storage device, characterized in that: It includes a mapping table update module, a version number determination module, a content data determination module and a group member snapshot update module; The mapping table updating module is used to update the group member change version number and the group member mapping table of the group when the group members of the group are changed. The group member mapping table includes the group member ID and the group member index with a mapping relationship. The version number determination module is used to use the group member change version number as the version number of the group member snapshot; The content data determination module is used to determine the data type of the group member snapshot according to the number of valid group members and the number of invalid group members of the current group, and determine the content data of the group member snapshot according to the group member mapping table and the data type, the data type includes a valid type and an invalid type, and the content data includes the group member index corresponding to the data type; The group member snapshot updating module is used to update the group member snapshot according to the version number of the group member snapshot, the content data and the data type.

9. A group member snapshot storage device, characterized in that: comprising a memory and a processor, wherein: The memory is used to store computer programs; The processor is used to read the computer program in the memory and execute the steps of the group member snapshot storage method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: A readable computer program is stored thereon, and when the program is executed by a processor, the steps of the group member snapshot storage method as claimed in any one of claims 1 to 7 are implemented.