Group database sub-library and sub-table and group information query method and device
Through the combination of database partitioning and table division and redis cache, the problem of excessive database access pressure in group services is solved, reliability and group information query efficiency are improved, and single chat and group chat messages are quickly arrived.
Patent Information
- Application Number
- CN202111449393.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-30
- Publication Date
- 2025-07-11
- Estimated Expiration
- 2041-11-30
AI Technical Summary
In group services, with the rapid growth of the number of groups and the number of group users, the database becomes a bottleneck, resulting in excessive access pressure and reducing reliability.
The database library partitioning method is used to determine the characteristic values of the target application and group through hash value conversion, find the corresponding library and group partitioning, query group information, and save the results to the redis cache to reduce the access frequency.
It reduces the pressure to access a single database and subtable, improves the reliability of the database and the efficiency of group information query, especially in the field of IM instant messaging, and improves the ability to quickly reach single and group chat messages.
Smart Images

Figure CN114238313B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communication technologies, and particularly to a method and device for database sharding and table partitioning of group databases and group information querying. Background Art
[0002] Since group services need to maintain a list of group members and member information, they highly rely on the high reliability of the database.
[0003] However, with the rapid growth of the number of groups and the number of group users within groups, the database has gradually become a bottleneck in the group service system.
[0004] In group services, every time group information is queried, the database needs to be accessed. Excessive access pressure on the database may lead to a reduction in reliability. Summary of the Invention
[0005] The purpose of the embodiments of the present invention is to provide a method and device for database sharding and table partitioning and group information querying, so as to achieve database sharding and table partitioning of group databases, reduce the access pressure on a single data shard and a single data sub-table, and improve the reliability. The specific technical solutions are as follows:
[0006] To achieve the above purpose, an embodiment of the present application provides a method for querying group information based on database sharding and table partitioning. The method includes:
[0007] Determine the target application to which the target group belongs, and convert the identifier of the target application into a first characteristic value;
[0008] Search for the target application shard corresponding to the target application according to the first characteristic value; wherein, the application shard is used to store the group information of the groups included in the application corresponding to the application shard;
[0009] Convert the identifier of the target application and the identifier of the target group into a second characteristic value together;
[0010] Search for the target group sub-table corresponding to the target group from the target application shard according to the second characteristic value; wherein, the group sub-table is used to store the group information of the group corresponding to the group sub-table; the application shard and the group sub-table are obtained by pre-sharding and partitioning the group database according to the application identifier and the group identifier;
[0011] Query the group information of the target group from the target group sub-table.
[0012] Optionally, the step of converting the identifier of the target application into a first characteristic value includes:
[0013] Convert the identifier of the target application into a hash value as the first characteristic value;
[0014] The step of jointly converting the identifier of the target application and the identifier of the target group into a second eigenvalue includes:
[0015] Concatenate the identifier of the target application and the identifier of the target group, and convert the concatenation result into a hash value as the second eigenvalue.
[0016] Optionally, the method further includes:
[0017] Save the group information of the target group queried to the redis cache;
[0018] When a group information query request for the target group is received, search for the group information of the target group from the redis cache.
[0019] To achieve the above object, an embodiment of the present application further provides a method for partitioning and sub - tabling a group database. The method includes:
[0020] Partition the group database based on the application identifier to obtain an application - specific sub - database for each application. The application - specific sub - database is used to store the group information of the groups included in the application corresponding to the application - specific sub - database;
[0021] For each application - specific sub - database, determine the application corresponding to the application - specific sub - database, and based on the group identifiers of the groups included in the application, partition the application - specific sub - database into sub - tables for each group to obtain a group - specific sub - table for each group. The group - specific sub - table is used to store the group information of the group corresponding to the group - specific sub - table;
[0022] To achieve the above object, an embodiment of the present application further provides a group information query device based on database partitioning and sub - tabling. The device includes:
[0023] A first conversion module, configured to determine the target application to which the target group belongs, and convert the identifier of the target application into a first eigenvalue;
[0024] A first search module, configured to search for the target application - specific sub - database corresponding to the target application according to the first eigenvalue; wherein, the application - specific sub - database is used to store the group information of the groups included in the application corresponding to the application - specific sub - database;
[0025] A second conversion module, configured to jointly convert the identifier of the target application and the identifier of the target group into a second eigenvalue;
[0026] A second search module, configured to search for the target group - specific sub - table corresponding to the target group from the target application - specific sub - database according to the second eigenvalue; wherein, the group - specific sub - table is used to store the group information of the group corresponding to the group - specific sub - table; the application - specific sub - database and the group - specific sub - table are obtained by partitioning and sub - tabling the group database in advance according to the application identifier and the group identifier;
[0027] A query module, configured to find the group information of the target group from the target group sub-table.
[0028] Optionally, the first conversion module is specifically configured to:
[0029] Convert the identifier of the target application into a hash value as the first feature value;
[0030] The second conversion module is specifically configured to:
[0031] Concatenate the identifier of the target application and the identifier of the target group, and convert the concatenation result into a hash value as the second feature value.
[0032] Optionally, the device further includes:
[0033] A cache module, configured to save the queried group information of the target group to the redis cache; when receiving a query request for the group information of the target group, find the group information of the target group from the redis cache.
[0034] To achieve the above object, an embodiment of the present application provides a device for partitioning a group database into sub-databases and sub-tables. The device includes:
[0035] A sub-database module, configured to partition the group database based on the application identifier to obtain an application sub-database corresponding to each application, and the application sub-database is used to store the group information of the groups included in the application corresponding to the application sub-database;
[0036] A sub-table module, configured to, for each application sub-database, determine the application corresponding to the application sub-database, and partition the application sub-database based on the group identifiers of the groups included in the application to obtain a group sub-table corresponding to each group, and the group sub-table is used to store the group information of the group corresponding to the group sub-table.
[0037] To achieve the above object, an embodiment of the present application further provides an electronic device, including a processor, a communication interface, a memory, and a communication bus. Among them, the processor, the communication interface, and the memory complete mutual communication through the communication bus;
[0038] The memory is used to store a computer program;
[0039] The processor is configured to implement the method steps described in any one of the above when executing the program stored in the memory.
[0040] To achieve the above object, an embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, and the computer program implements the method steps described in any one of the above when executed by a processor.
[0041] Advantages of the embodiments of the present application:
[0042] By applying the group information query method and device provided by the embodiments of the present application, determine the target application to which the target group belongs, and convert the identifier of the target application into a first feature value; search for the target application sub-database corresponding to the target application according to the first feature value; wherein, the application sub-database is used to store the group information of the groups included in the application corresponding to the application sub-database; convert the identifier of the target application and the identifier of the target group into a second feature value together; search for the target group sub-table corresponding to the target group from the target application sub-database according to the second feature value; wherein, the group sub-table is used to store the group information of the group corresponding to the group sub-table; the application sub-database and the group sub-table are obtained by pre-partitioning and sub-tabulating the group database according to the application identifier and the group identifier; query the group information of the target group from the target group sub-table.
[0043] It can be seen that, since the group data is pre-partitioned and sub-tabulated to obtain the application sub-database and the group sub-table; when searching for group information, first determine the target application sub-database corresponding to the application to which the target group belongs and the target group sub-table corresponding to the target group, and only access the target group sub-table in the target application sub-database to search for the group information of the target group. It can reduce the access pressure on a single data sub-database and a single data sub-table and improve the reliability.
[0044] Of course, it is not necessary for any product or method implementing the present invention to achieve all the above advantages simultaneously. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the following drawings are only some embodiments of the present invention, and those of ordinary skill in the art can also obtain other embodiments based on these drawings without creative efforts.
[0046] Figure 1 It is a schematic flowchart of a group information query method provided by an embodiment of the present application;
[0047] Figure 2 It is a schematic flowchart of a method for partitioning and sub-tabulating a group database provided by an embodiment of the present application;
[0048] Figure 3 It is a schematic structural diagram of a group information query device provided by an embodiment of the present application;
[0049] Figure 4 It is a schematic structural diagram of a device for partitioning and sub-tabulating group data provided by an embodiment of the present application;
[0050] Figure 5 A structural schematic diagram of an electronic device provided by an embodiment of the present application. Specific embodiments
[0051] The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art based on this application belong to the scope of protection of the present invention.
[0052] In order to solve the technical problems of excessive access pressure on the group database and reduced reliability in the existing technology group service, an embodiment of the present application provides a method and device for sharding and table partitioning of a group database and querying group information.
[0053] See Figure 1 , Figure 1 A flowchart of a method for querying group information provided by an embodiment of the present application. As Figure 1 shown, the method may include the following steps:
[0054] S101: Determine the target application to which the target group belongs, and convert the identifier of the target application into a first feature value.
[0055] In an embodiment of the present application, an application usually includes multiple groups. When querying group information, the target application to which the target group to be queried belongs can be determined first, and the identifier of the target application, that is, the ID (Identity) of the target application, such as the name of the target application, can be determined.
[0056] Among them, the application is an application program (Application, APP). For example, instant messaging software, etc.
[0057] In an embodiment of the present application, the identifier of the target application can be converted into a first feature value, where the feature value can be a hash value. Specifically, the identifier of the target application is converted into a hash value as the first feature value.
[0058] S102: Find the target application sub-database corresponding to the target application according to the first feature value, where the application sub-database is used to store the group information of the groups included in the application corresponding to the application sub-database.
[0059] In an embodiment of the present application, the group database can be pre-processed by sharding and table partitioning. The group database represents a database for storing the group information of multiple groups of each application.
[0060] As an example, before database sharding and table partitioning, the group database stores group information of groups of Application A, Application B, and Application C. Among them, Application A contains 100 groups, Application B contains 200 groups, and Application C contains 300 groups.
[0061] In the embodiments of the present application, the group database can be pre-sharded according to the application identifier to obtain application sub-databases. Then, continuing with the above example, the application sub-database corresponding to Application A, the application sub-database corresponding to Application B, and the application sub-database corresponding to Application C can be obtained.
[0062] Among them, the application sub-database corresponding to Application A stores the group information of the above 100 groups, the application sub-database corresponding to Application B stores the group information of the above 200 groups, and the application sub-database corresponding to Application C stores the group information of the above 300 groups.
[0063] Furthermore, based on the group identifier, each application sub-database is partitioned into tables to obtain group sub-tables corresponding to each group. Continuing with the above example, 100 group sub-tables of the application sub-database corresponding to Application A can be obtained, and each group sub-table stores the group information of one group.
[0064] In the embodiments of the present application, the corresponding relationship between the first eigenvalue and the application sub-database can be pre-stored.
[0065] Furthermore, according to the first eigenvalue of the target application, the target application sub-database corresponding to the target application is searched.
[0066] S103: Convert the identifier of the target application and the identifier of the target group into a second eigenvalue.
[0067] In the embodiments of the present application, the identifier of the target application and the identifier of the target group can be concatenated, and the concatenation result is converted into a hash value as the second eigenvalue.
[0068] The group identifier can also be information such as the name of the group.
[0069] S104: Search for the target group sub-table corresponding to the target group from the target application sub-database; among them, the group sub-table is used to store the group information of the group corresponding to the group sub-table; the application sub-database and the group sub-table are obtained by pre-sharding and partitioning the group database according to the application identifier and the group identifier.
[0070] In the embodiments of the present application, the corresponding relationship between the second eigenvalue and the group sub-table can be pre-stored.
[0071] Furthermore, the target group sub-table corresponding to the target group can be searched according to the second eigenvalue.
[0072] S105: Query the group information of the target group from the target group sub-table.
[0073] In the embodiment of the present application, after determining the target group sub-table, the group information of the target group can be directly queried from the target group sub-table.
[0074] Apply the group information query method provided by the embodiment of the present application, determine the target application to which the target group belongs, convert the identifier of the target application into a first eigenvalue; find the target application sub-database corresponding to the target application according to the first eigenvalue; wherein, the application sub-database is used to store the group information of the groups included in the application corresponding to the application sub-database; convert the identifier of the target application and the identifier of the target group into a second eigenvalue together; find the target group sub-table corresponding to the target group from the target application sub-database according to the second eigenvalue; wherein, the group sub-table is used to store the group information of the groups corresponding to the group sub-table; the application sub-database and the group sub-table are obtained by partitioning the group database according to the application identifier and the group identifier in advance; query the group information of the target group from the target group sub-table.
[0075] It can be seen that since the group data is pre-processed by database partitioning and table partitioning to obtain the application sub-database and the group sub-table; when querying group information, the target application sub-database corresponding to the target application and the target group sub-table corresponding to the target group are determined in sequence, and only the target group sub-table in the target application sub-database needs to be accessed to query the group information of the target group. It can reduce the access pressure on a single database and a single table, and improve the reliability.
[0076] In addition, the group information query method provided by the embodiment of the present application can be applied in the field of IM - instant messaging to solve the problem of fast arrival of single - chat and group - chat messages, and improve the speed of pulling user offline messages.
[0077] Specifically, if the data volume in a single database or a single database table is large, it is not conducive to retrieval, and if a single database table is damaged, the affected range is too large, that is, the reliability is low.
[0078] In the prior art, the data volume of the group information stored in a single database and a single database table is large, which is not conducive to retrieval and has low reliability. In the field of IM - instant messaging, it is necessary to query group information to achieve the fast arrival of single - chat and group - chat messages. Therefore, in the prior art, the retrieval of group messages is slow, which is not conducive to the fast arrival of single - chat and group - chat messages, and the reliability of database partitioning and table partitioning is improved.
[0079] In an embodiment of the present application, in order to further reduce the access pressure on a single database and a single table, after each group information query is completed, the queried group information of the target group can be saved to the redis cache. When a group information query request for the target group is received again, the group information of the target group is found from the redis cache.
[0080] It can be seen that in the embodiments of the present application, by storing the group information in the redis cache, the database access frequency can be further reduced and the database reliability can be improved.
[0081] See Figure 2 , the embodiments of the present application also provide a method for partitioning a group database into sub-databases and sub-tables. As shown in Figure 2 , the method may include the following steps:
[0082] S201: Partition the group database based on the application identifier to obtain an application sub-database corresponding to each application. The application sub-database is used to store the group information of the groups included in the application corresponding to the application sub-database.
[0083] Among them, the group database is a database for storing the group information of multiple groups of each application.
[0084] In the embodiments of the present application, the group database can be partitioned based on the application identifier to obtain an application sub-database corresponding to each application. The application sub-database is used to store the group information of the groups included in the application corresponding to the application sub-database.
[0085] S202: For each application sub-database, determine the application corresponding to the application sub-database, and based on the group identifier of the groups included in the application, partition the application sub-database into sub-tables corresponding to each group. The sub-table corresponding to each group is used to store the group information of the group corresponding to the sub-table.
[0086] As an example, for a platform supporting millions of group users, the group database can be horizontally or vertically split. It can be first split into multiple application sub-databases according to different application IDs. Then each application sub-database is split into multiple sub-tables corresponding to each group according to different group IDs. This can reduce the access pressure on a single database and a single data table and ensure the high reliability of the service.
[0087] It can be seen that since the group data is pre-processed by partitioning into sub-databases and sub-tables to obtain application sub-databases and sub-tables corresponding to each group; when looking up group information, first determine the target application sub-database corresponding to the application to which the target group belongs and the target sub-table corresponding to the target group, and only access the target sub-table in the target application sub-database to look up the group information of the target group. This can reduce the access pressure on a single data sub-database and a single data sub-table and improve the reliability.
[0088] See Figure 3 , the embodiments of the present application also provide a group information query device. As shown in Figure 3 , it may include the following modules:
[0089] The first conversion module 301 is configured to determine the target application to which the target group belongs, and convert the identifier of the target application into a first eigenvalue;
[0090] The first lookup module 302 is configured to look up the target application sub-database corresponding to the target application according to the first eigenvalue; wherein, the application sub-database is used to store the group information of the groups included in the application corresponding to the application sub-database;
[0091] The second conversion module 303 is configured to jointly convert the identifier of the target application and the identifier of the target group into a second eigenvalue;
[0092] The second lookup module 304 is configured to look up the target group sub-table corresponding to the target group from the target application sub-database according to the second eigenvalue; wherein, the group sub-table is used to store the group information of the group corresponding to the group sub-table; the application sub-database and the group sub-table are obtained by partitioning the group database according to the application identifier and the group identifier in advance;
[0093] The query module 305 is configured to look up the group information of the target group from the target group sub-table.
[0094] Applying the group information query device provided by the embodiments of the present application, determine the target application to which the target group belongs, convert the identifier of the target application into a first eigenvalue; look up the target application sub-database corresponding to the target application according to the first eigenvalue; wherein, the application sub-database is used to store the group information of the groups included in the application corresponding to the application sub-database; jointly convert the identifier of the target application and the identifier of the target group into a second eigenvalue; look up the target group sub-table corresponding to the target group from the target application sub-database according to the second eigenvalue; wherein, the group sub-table is used to store the group information of the group corresponding to the group sub-table; the application sub-database and the group sub-table are obtained by partitioning the group database according to the application identifier and the group identifier in advance; query the group information of the target group from the target group sub-table.
[0095] It can be seen that, since the group data is pre-processed by partitioning the database and the table to obtain the application sub-database and the group sub-table; when looking up the group information, the target application sub-database corresponding to the application to which the target group belongs and the target group sub-table corresponding to the target group are determined in sequence, and only the target group sub-table in the target application sub-database needs to be accessed to look up the group information of the target group. It can reduce the access pressure on a single data sub-database and a single data sub-table, and improve the reliability.
[0096] See Figure 4 , the embodiments of the present application also provide a device for partitioning the group database into sub-databases and sub-tables, as Figure 4 shown, which may include the following modules:
[0097] The sub-database module 401 is used to partition the group database based on the application identifier to obtain an application sub-database corresponding to each application, and the application sub-database is used to store the group information of the groups included in the application corresponding to the application sub-database;
[0098] The sub-table module 402 is used to, for each application sub-database, determine the application corresponding to the application sub-database, and partition the application sub-database based on the group identifier of the groups included in the application to obtain a group sub-table corresponding to each group, and the group sub-table is used to store the group information of the group corresponding to the group sub-table.
[0099] It can be seen that since the group data is pre-processed by partitioning the database and the table, the application sub-database and the group sub-tables are obtained; when searching for group information, the target application sub-database corresponding to the target application to which the target group belongs and the target group sub-table corresponding to the target group are determined in sequence, and only the target group sub-table in the target application sub-database is accessed to search for the group information of the target group. It can reduce the access pressure on a single data database and a single data table and improve the reliability.
[0100] An embodiment of the present invention further provides an electronic device, as Figure 5 shown, including a processor 501, a communication interface 502, a memory 503, and a communication bus 504. Among them, the processor 501, the communication interface 502, and the memory 503 complete mutual communication through the communication bus 504.
[0101] The memory 503 is used to store a computer program;
[0102] When the processor 501 is used to execute the program stored on the memory 503, the following steps are implemented:
[0103] Determine the target application to which the target group belongs, and convert the identifier of the target application into a first feature value;
[0104] Search for the target application sub-database corresponding to the target application according to the first feature value; wherein, the application sub-database is used to store the group information of the groups included in the application corresponding to the application sub-database;
[0105] Convert the identifier of the target application and the identifier of the target group into a second feature value together;
[0106] Search for the target group sub-table corresponding to the target group from the target application sub-database according to the second feature value; wherein, the group sub-table is used to store the group information of the group corresponding to the group sub-table; the application sub-database and the group sub-tables are pre-obtained by partitioning the database and the table of the group database according to the application identifier and the group identifier;
[0107] Query the group information of the target group from the target group sub-table.
[0108] The communication bus mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into an address bus, a data bus, a control bus, etc. For the sake of simplicity in representation, only a thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0109] The communication interface is used for communication between the above electronic device and other devices.
[0110] The memory can include a Random Access Memory (RAM), and can also include a Non-Volatile Memory (NVM), such as at least one disk memory. Optionally, the memory can also be at least one storage device located far from the aforementioned processor.
[0111] The above-mentioned processor can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0112] In another embodiment provided by the present invention, there is also provided a computer-readable storage medium, in which a computer program is stored, and when the computer program is executed by a processor, the steps of any of the above group information query methods are implemented.
[0113] In another embodiment provided by the present invention, there is also provided a computer program product containing instructions, which when run on a computer, causes the computer to execute any of the group information query methods in the above embodiments.
[0114] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions described in the embodiments of the present invention are generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can 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 can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that can be accessed by a computer, or a data storage device such as a server or data center that includes one or more integrated available media. The available medium can be a magnetic medium (such as a floppy disk, hard disk, magnetic tape), an optical medium (such as a DVD), or a semiconductor medium (such as a solid state disk (SSD)).
[0115] It should be noted that in this document, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including", or any other variant thereof is intended to cover non-exclusive inclusion, such that a process, method, article, or device that includes a series of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or device. Without further limitation, an element defined by the statement "including a..." does not exclude the existence of additional identical elements in the process, method, article, or device that includes the element.
[0116] Each embodiment in this specification is described in a related manner. For the same or similar parts among the embodiments, reference can be made to each other. Each embodiment focuses on the differences from other embodiments. In particular, for the embodiments of the device, electronic device, and storage medium, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.
[0117] The above are only the preferred embodiments of the present invention and are not intended to limit the protection scope of the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present invention are all included within the protection scope of the present invention.
Claims
1. A method for querying group information, characterized in that The method includes: Determine the target application to which the target group belongs, and convert the identifier of the target application into a first eigenvalue, where the target application is an instant messaging software; Find the target application sub-library corresponding to the target application according to the first eigenvalue; wherein, the application sub-library is used to store the group information of the groups included in the application corresponding to the application sub-library; Convert the identifier of the target application and the identifier of the target group into a second eigenvalue together; Find the target group sub-table corresponding to the target group from the target application sub-library according to the second eigenvalue; wherein, the group sub-table is used to store the group information of the group corresponding to the group sub-table; the application sub-library and the group sub-table are obtained by pre-partitioning and sub-tabling the group database according to the application identifier and the group identifier; Query the group information of the target group from the target group sub-table; Save the queried group information of the target group to the redis cache; When a query request for the group information of the target group is received, find the group information of the target group from the redis cache.
2. The method according to claim 1, wherein The step of converting the identifier of the target application into a first eigenvalue includes: Convert the identifier of the target application into a hash value as the first eigenvalue; The step of converting the identifier of the target application and the identifier of the target group into a second eigenvalue together includes: Concatenate the identifier of the target application and the identifier of the target group, and convert the concatenation result into a hash value as the second eigenvalue.
3. A group information query device, characterized in that, The device includes: A first conversion module, configured to determine the target application to which the target group belongs, and convert the identifier of the target application into a first eigenvalue, where the target application is an instant messaging software; A first search module, configured to find the target application sub-library corresponding to the target application according to the first eigenvalue; wherein, the application sub-library is used to store the group information of the groups included in the application corresponding to the application sub-library; A second conversion module, configured to convert the identifier of the target application and the identifier of the target group into a second eigenvalue together; A second search module, configured to find the target group sub-table corresponding to the target group from the target application sub-library according to the second eigenvalue; wherein, the group sub-table is used to store the group information of the group corresponding to the group sub-table; the application sub-library and the group sub-table are obtained by pre-partitioning and sub-tabling the group database according to the application identifier and the group identifier; A query module, configured to query the group information of the target group from the target group sub-table; A cache module, configured to save the queried group information of the target group to the redis cache; when a query request for the group information of the target group is received, find the group information of the target group from the redis cache.
4. The device according to claim 3, characterized in that, The first conversion module is specifically configured to: Convert the identifier of the target application into a hash value as the first eigenvalue; The second conversion module is specifically configured to: Concatenate the identifier of the target application and the identifier of the target group, and convert the concatenation result into a hash value as the second eigenvalue.
5. An electronic device, characterized in that, It includes a processor, a communication interface, a memory, and a communication bus. Among them, the processor, the communication interface, and the memory complete mutual communication through the communication bus; The memory is used to store computer programs; The processor is used to implement the method steps described in any one of claims 1-2 when executing the programs stored on the memory.
6. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, and when the computer program is executed by the processor, the method steps described in any one of claims 1-2 are implemented.
Citation Information
Patent Citations
Database sub-library and sub-table method and device
CN111737228A