Session record query method, device and related equipment
By querying the session index on the server side of the instant messaging tool, the problem of cumbersome operations and equipment burden when searching for chat group chat records is solved, and the function of quickly searching chat records is realized.
Patent Information
- Application Number
- CN202011580314.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-28
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2040-12-28
AI Technical Summary
In instant messaging tools, users need to manually select each group chat when searching for the chat history of a chat group, which results in cumbersome operations and a high operating burden on electronic devices.
By receiving the current account's session record query request for the target group chat session, querying the session index based on the current account's identifier and the session information of the target group chat session, and responding to the query request, a quick search for the session record of the target group chat session is achieved.
There is no need to manually search for chat groups in sequence. Users can only enter the conversation participating accounts to find relevant chat records, which reduces operation time and the operating burden of electronic devices.
Smart Images

Figure CN112685537B
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of data query, and in particular to a method, apparatus, and related devices for querying session records. Background Art
[0002] With the popularization of the Internet and smart electronic devices, more and more people communicate through various communication tools (such as chat software).
[0003] Among the aforementioned communication tools, instant messaging (IM) technology is widely used due to its ability to instantly send and receive internet messages. Through IM technology, users can conveniently communicate with one another, and multiple users can also establish chat groups for group chats. A user may be a member of numerous chat groups, each with a large number of users. To query chat logs within a chat group, the user must first select a chat group and then search for chat logs within the group by date or keyword.
[0004] If the user forgets which chat group the chat record he wants to find belongs to, he needs to search in each chat group separately.This search method is cumbersome and time-consuming on the one hand, and also brings a high operating burden to the electronic device that performs the chat record search process on the other hand. Summary of the Invention
[0005] The present disclosure provides a method, apparatus, and related devices for querying conversation records to at least address the issues in related technologies such as cumbersome and time-consuming operations and the high operational burden placed on electronic devices. The technical solutions of the present disclosure are as follows:
[0006] According to a first aspect of an embodiment of the present disclosure, a session record query method is provided, which is applied to a server and includes:
[0007] Receiving a session record query request for a target group chat session from a current account, the session record query request including at least: an identifier of the current account and session information of the target group chat session, wherein the session information of the target group chat session includes at least: identifiers of at least two session participant accounts in the target group chat session, excluding the current account;
[0008] Querying a session index of the target group chat session according to the identifier of the current account and the session information of the target group chat session;
[0009] The session record corresponding to the session index of the target group chat session is used as a response to the session record query request.
[0010] In a possible implementation of the first aspect, querying the session index of the target group chat session according to the identifier of the current account and the session information of the target group chat session includes:
[0011] querying each first session index whose user account identifier is the identifier of the current account, and determining the session identifier in each of the queried first session indexes as the target identifier;
[0012] Using the identifiers of the at least two session participating accounts, querying in each session index containing the target identifier to obtain the session identifier of the target group chat session;
[0013] The first session index including the session identifier of the target group chat session is determined as the session index of the target group chat session.
[0014] In a possible implementation of the first aspect, using the identifiers of the at least two session participating accounts to query each session index that includes the target identifier to obtain the session identifier of the target group chat session includes:
[0015] Searching, in each session index containing the target identifier, for a second session index containing the identifier of at least one of the session participating accounts;
[0016] Determine the second session index that includes identifiers of all the session participating accounts, and determine the session identifier in the determined second session index as the session identifier of the target group chat session.
[0017] In a possible implementation of the first aspect, determining the second session index that includes identifiers of all the session participating accounts, and determining the session identifier in the determined second session index as the session identifier of the target group chat session includes:
[0018] Dividing the second session indexes including the same session identifier into an index group;
[0019] Determining a target index group from each of the index groups, wherein the identifier group formed by the user account identifiers of each second session index in the target index group includes: the identifiers of each account included in the session record query request;
[0020] The session identifier included in the second session index in the target index group is determined as the session identifier of the target group chat session.
[0021] In a possible implementation of the first aspect, querying the session index of the target group chat session according to the identifier of the current account and the session information of the target group chat session includes:
[0022] Querying each first session index whose user account identifier is the identifier of the current account;
[0023] Querying the first session index for a third session index including identifiers of the respective session participating accounts;
[0024] The third session index is determined as the session index of the target group chat session.
[0025] In a possible implementation of the first aspect, the method further includes:
[0026] If condition one or condition two is met, creating a session index of the target group chat session for the current account;
[0027] The first condition is that the target group chat session is a newly created group chat session;
[0028] The second condition is: the current account is an account that has newly joined the target group chat session.
[0029] In a possible implementation of the first aspect, the method further includes:
[0030] If condition three or condition four is met, deleting the session index of the target group chat session created for the current account;
[0031] The third condition is that: the target group chat session is a disbanded group chat session;
[0032] The fourth condition is: the current account exits the target group chat session.
[0033] According to a second aspect of an embodiment of the present disclosure, a session record query device is provided, which is applied to a server. The session record query device includes:
[0034] a request receiving unit configured to execute and receive a session record query request for a target group chat session from a current account, the session record query request including at least: an identifier of the current account and session information of the target group chat session, wherein the session information of the target group chat session includes at least: identifiers of at least two session participating accounts in the target group chat session, excluding the current account;
[0035] an index query unit, configured to query a session index of the target group chat session based on the identifier of the current account and the session information of the target group chat session;
[0036] The response determination unit is configured to execute the session record corresponding to the session index of the target group chat session as a response to the session record query request.
[0037] In a possible implementation of the second aspect, the index query unit includes:
[0038] a first query subunit configured to query each first session index whose user account identifier is the identifier of the current account, and determine the session identifier in each of the queried first session indexes as a target identifier;
[0039] A second query subunit is configured to use the identifiers of the at least two session participating accounts to query in each session index containing the target identifier to obtain the session identifier of the target group chat session;
[0040] The first determining subunit is configured to determine the first session index including the session identifier of the target group chat session as the session index of the target group chat session.
[0041] In a possible implementation of the second aspect, the second query subunit includes:
[0042] a search subunit configured to search for a second session index containing an identifier of at least one of the session participating accounts in each session index containing the target identifier;
[0043] The second determining subunit is configured to determine the second session index including identifiers of all the session participating accounts, and determine the session identifier in the determined second session index as the session identifier of the target group chat session.
[0044] In a possible implementation manner of the second aspect, the second determining subunit includes:
[0045] a dividing subunit, configured to divide the second session indexes including the same session identifier into an index group;
[0046] an index group determining subunit configured to determine a target index group from each of the index groups, wherein the identifier group consisting of the user account identifiers of each second session index in the target index group includes: identifiers of each account included in the session record query request;
[0047] The third determining subunit is configured to determine the session identifier included in the second session index in the target index group as the session identifier of the target group chat session.
[0048] In a possible implementation of the second aspect, the index query unit includes:
[0049] a third query subunit, configured to query each first session index whose user account identifier is the identifier of the current account;
[0050] a fourth query subunit, configured to query the first session index for a third session index including identifiers of the respective session participating accounts;
[0051] The index determining subunit is configured to determine the third session index as the session index of the target group chat session.
[0052] In a possible implementation of the second aspect, the conversation record query apparatus further includes: an index creation unit configured to create a conversation index of the target group chat conversation for the current account when condition one or condition two is met;
[0053] The first condition is that the target group chat session is a newly created group chat session;
[0054] The second condition is: the current account is an account that has newly joined the target group chat session.
[0055] In a possible implementation of the second aspect, the conversation record query apparatus further includes: an index deleting unit configured to delete the conversation index of the target group chat conversation created for the current account when condition three or condition four is satisfied;
[0056] The third condition is that: the target group chat session is a disbanded group chat session;
[0057] The fourth condition is: the current account exits the target group chat session.
[0058] According to a third aspect of an embodiment of the present disclosure, a server is provided, including:
[0059] processor;
[0060] a memory for storing instructions executable by the processor;
[0061] The processor is configured to execute the instructions to implement any one of the conversation record query methods provided in the first aspect.
[0062] According to a fourth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided. When instructions in the computer-readable storage medium are executed by a processor of a server, the server is enabled to execute any one of the session record query methods provided in the first aspect.
[0063] According to a fifth aspect of an embodiment of the present disclosure, a computer program product is provided, including a computer program, which, when executed by a processor, implements any one of the conversation record query methods provided in the first aspect.
[0064] The technical solutions provided by the embodiments of the present disclosure bring at least the following beneficial effects:
[0065] The present invention only requires entering the conversation participant account in the chat group to which the chat record to be found belongs, and the conversation records of the chat group including the current account and these conversation participant accounts can be found without manual searching one by one, which saves time and effort and reduces the operating burden of the electronic device that performs the chat record search processing.
[0066] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0067] The accompanying drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute an improper limitation of the present disclosure.
[0068] Figure 1 is a flowchart of a method for querying a conversation record according to an exemplary embodiment;
[0069] Figure 2 is a flowchart illustrating another method for querying conversation records according to an exemplary embodiment;
[0070] Figure 3 is a flowchart illustrating another method for querying conversation records according to an exemplary embodiment;
[0071] Figure 4 is a flowchart illustrating another method for querying conversation records according to an exemplary embodiment;
[0072] Figure 5 This is a schematic diagram of an operation interface of an application program capable of performing instant messaging according to an exemplary embodiment;
[0073] Figure 6 This is a schematic diagram of another operation interface of an application capable of performing instant messaging according to an exemplary embodiment;
[0074] Figure 7 is a block diagram of a conversation record query device according to an exemplary embodiment;
[0075] Figure 8 The figure is a block diagram of a server according to an exemplary embodiment. DETAILED DESCRIPTION
[0076] In order to enable ordinary persons in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.
[0077] It should be noted that the terms "first," "second," and the like in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or precedence. It should be understood that the numbers used in this manner are interchangeable where appropriate so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure as detailed in the appended claims.
[0078] Figure 1 FIG. 1 is a flow chart showing a method for querying a session record according to an exemplary embodiment. Figure 1 As shown, the following steps may be included.
[0079] In step S11, a session record query request for a target group chat session from a current account is received. The session record query request includes at least an identifier of the current account and session information of the target group chat session. The session information of the target group chat session includes at least identifiers of at least two accounts participating in the target group chat session, excluding the current account.
[0080] Optionally, the current account may be an account of a user using a session function provided by the server through a client device. The present disclosure may first verify the legitimacy of the input account authentication information. After the legitimacy verification passes, the current account may use the session function provided by the server normally. The above-mentioned account authentication information may include at least one of: account number, mobile phone number, email address, name, ID number, facial image, fingerprint, voice, touch screen sliding trajectory, password, etc.
[0081] Once the legitimacy verification is passed, the current account can be in the "logged in" or "online" state and use the session function provided by the server normally.
[0082] The present disclosure can determine each account that has passed the legality verification as the current account and perform Figure 1 The processing included in the method shown.
[0083] Optionally, the conversation content of the present disclosure may include at least one of text, hyperlinks, emoticons, and files. The files may include at least one of images, audio, video, and documents. The present disclosure may store at least one of the above conversation contents as a conversation record.
[0084] A group chat session is a type of session. Session types include private and group chat sessions. A private chat session is a conversation between two accounts and is invisible to other accounts. A group chat session can involve more accounts, for example, a group chat session with 100 accounts. Any content entered by one account in a group chat is visible to all accounts in the group chat.
[0085] Optional, Figure 1 The method shown can be applied to the server. Figure 1 When the method is applied to a server, the present disclosure can utilize the server's strong storage capacity to save more session records, and utilize the server's strong processing capacity to quickly process session record query requests.
[0086] when Figure 1 When the method shown is applied to the server, the present disclosure can obtain the session content uploaded by the client device after the user participating in the group chat session enters the session content in the client device, and can also obtain the session content entered by the user from the client device regularly or irregularly.
[0087] Optionally, the current account can issue a session record query request via a client device. The client device may have an application with instant messaging functionality installed. The current account can issue a session record query request via at least one operating interface of the application. The user with the current account can input session information, such as session information, used for querying session records, into the instant messaging application through operations such as character input, sliding, dragging, and clicking in the operating interface, thereby issuing a session record query request.
[0088] Figure 5 FIG. 1 is a schematic diagram of an operation interface of an application with an instant messaging function according to an exemplary embodiment. A user with a current account can Figure 5 In the input box 001 of the operation interface shown, the identifiers of at least two conversation participating accounts are input, and then a query button is clicked, thereby causing the application with instant messaging function to issue a conversation record query request.
[0089] In other optional embodiments of the present disclosure, the user may also input other session information, such as session establishment time, etc., through the operation interface.
[0090] In other optional embodiments of the present disclosure, the user may also input other information besides the session information through the operation interface, such as keywords for querying session content, time range of the session content, etc.
[0091] Figure 6FIG. 1 is a schematic diagram of another operation interface of an application with an instant messaging function according to an exemplary embodiment. A user with a current account can Figure 6 In the input box to the right of "Group Members" on the operation interface shown, enter the IDs of at least two conversation participating accounts other than the current account, such as Figure 6 The user can Figure 6 Enter the keywords used to query the conversation content in the input box to the right of "Keywords" on the operation interface shown, such as Figure 6 The user can Figure 6 Enter the start time of the session you want to query in the input box to the right of "Start Time" on the operation interface shown. Figure 6 The user can Figure 6 Enter the end time of the session you want to query in the input box to the right of "End Time" on the operation interface shown. Figure 6 After entering the above information, the user clicks the query button, and the instant messaging application can send a conversation record query request containing the above information.
[0092] In step S12, the session index of the target group chat session is queried according to the identifier of the current account and the session information of the target group chat session.
[0093] Optionally, the present disclosure can query a session index in an index library. The index library can include at least one session index, and each session index provided by the present disclosure can include a variety of different data. For example, a session index includes multiple fields. In this way, the present disclosure can query the index library for each session index that meets the query criteria based on the values of each field in the session index.
[0094] The identifier of the current account may be: account number, mobile phone number, ID card number, etc.
[0095] Similar to the identifier of the current account, the identifier of each session participating account can be: account number, mobile phone number, ID number, etc.
[0096] The present disclosure can set a unique session identifier for each group chat session.
[0097] The session index disclosed herein may include: the current account identifier and session information. In addition to the identifiers of each participating account other than the current account, the session information may also include: at least one of the session type, session identifier, session establishment time, and the time when each participating account entered the session.
[0098] Optionally, some or all of the session type, session identifier, session establishment time, and session entry time of a participating account can be used as fields for the session index in this disclosure. This allows queries to be performed using multiple fields. In practical applications, logical relationships (AND or NOT) can be set for the fields to be queried, and queries can be performed based on the set logical relationships.
[0099] For example, you can query sessions by using only a session identifier, or you can query by using both a session type and a session establishment time range. Optionally, the logical relationship between the session type and the session establishment time range can be set to one of "and", "or", and "not".
[0100] The session information may include multiple fields. When querying, only some of the fields may be selected together with the identifier of the current account and the identifiers of at least two other session participating accounts to query the session record.
[0101] The present disclosure can create a session index for each account, corresponding to each group chat session in which the account participates. Optionally, in the session index created for the current account, the identifier of the current account can be the value of the user account identifier field of the created session index. Optionally, the user account identifier field can be "userid" or "uid", etc.
[0102] The user account ID field can reflect the ownership of the session index. That is, when the value of the user account ID field in a session index is the ID of account A, it means that the session index is the session index of account A, not the session index of another account.
[0103] For a group chat session, the present disclosure can create a session index for each participant account, using its ID as the value of the user account ID field. For example, in Example A, a group chat session has three participant accounts, whose IDs are Zhang San, Li Si, and Wang Wu, respectively. The session ID of the session is Q01. The present disclosure can then create the following three session indexes for the session:
[0104] A session index whose user account ID field value is Zhang San and whose session ID is Q01;
[0105] A session index with the user account ID field value being Li Si and the session ID being Q01;
[0106] A session index whose user account ID field value is Wang Wu and whose session ID is Q01.
[0107] When Zhang San queries the session record of the group chat session he participated in, the present disclosure can search for a session index that meets the query conditions in the session index with Zhang San's identifier as the value of the user account identifier field, and then determine the corresponding session record.
[0108] Optionally, when the identifiers of each session participant account in the same group chat session are respectively used as the value of the user account identifier field in the session index containing the session identifier of the group chat session, the session records corresponding to each session index containing the session identifier are the same session record or different session records.
[0109] When session records corresponding to session indexes containing the same session identifier are identical, the present disclosure can store only one session record for a session and simultaneously satisfy the query requirements of all participating accounts by corresponding to multiple session indexes. This approach effectively reduces data storage while still satisfying the query requirements of all participating accounts.
[0110] When the session records corresponding to the session indexes containing the same session identifier are different session records, the present disclosure can save the session records matching each session participant account for one session, that is, each session participant account in the same session can query different session records.
[0111] Optionally, the server may store session records.
[0112] Optionally, at least one attribute of the session records corresponding to each session index containing the same session identifier is different or not completely identical. Such attributes may include time range, type of session content, publisher of the included session content, etc. This approach allows for diversity in the session records of each participating account. The current account can configure its own session records so that the present disclosure only stores a portion of the session's session records corresponding to the current account's session index.
[0113] Optionally, the time ranges of the session records corresponding to each session index containing the same session identifier are different. Using Example A above, Zhang San can set his session records for this session to cover the most recent month. Then, the session records corresponding to the session index with the user account identifier field set to Zhang San and the session identifier Q01 will be the most recent month's session records for this group chat session.
[0114] Optionally, the types of session content in the session records corresponding to the session indexes with the same session identifier may not be exactly the same. Using Example A above, we can illustrate that Li Si can set his session record for this session to contain text-type content. Then, the session record corresponding to the session index with the user account identifier field set to Li Si and the session identifier Q01 will contain text-type content in the group chat session. This prevents Li Si from querying other types of session content (such as images).
[0115] Optionally, the session records corresponding to different session indexes with the same session identifier may not all contain the same publishers of the session content. Using Example A above, Wang Wu can set his session record for the session to exclude messages sent by Zhang San. Then, the session record corresponding to the session index with the user account identifier field set to "Wang Wu" and the session identifier "Q01" will contain the session content sent by all participating accounts in the group chat except Zhang San. Therefore, Wang Wu will not be able to query the session content sent by Zhang San.
[0116] The identifier of the current account and the identifiers of each account participating in the session other than the current account can be set differently in the session index to distinguish the identifier of the current account from the identifiers of each account participating in the session other than the current account. For example, the identifier of the current account is located at the head of the session index, while the identifiers of each account participating in the session other than the current account are located outside the head of the session index. In this way, the present disclosure can determine the identifier of the account in the head of the session index as the identifier of the current account.
[0117] Optionally, the present disclosure may arrange the current account identifier and the position of each session information in the session index according to a preset order. The preset order may be: arranging the current account identifier, session type, session identifier, identifiers of accounts participating in the session other than the current account, the time when the accounts participating in the session other than the current account entered the session, and the time when the session was established, in order from the beginning of the session index to the end of the session index. Optionally, separators, such as commas, may be used between the various pieces of information in the session index.
[0118] The following is an exemplary data structure of a session index:
[0119] {"mappings":{"session":{"properties1":{"uid","chatType","targetId","groupSnapshot":{"properties2":{"member","timestamp1"}},"timestamp2"}}}}.
[0120] In this data structure, uid is the identifier of the current account, chatType is the session type, targetId is the session identifier, member is the identifier of each account participating in the session other than the current account, timestamp1 is the time when each account participating in the session other than the current account enters the session, and timestamp2 is the time when the session is established. Mappings is used to represent the mapping relationship of the above data structure, session is used to indicate that this data structure is related to the session, properties1 represents the properties of the session, and the content within {} to the right of properties are all session properties. groupSnapshot is used to indicate that multiple groups of information are included, and properties2 is used to indicate the specific properties contained in each group of information. The identifier of each account participating in the session and the time when they entered the session constitute a group of information. When there are multiple accounts participating in the session other than the current account, the session index can include multiple groups of information.
[0121] Optionally, the data structure of the conversation index disclosed herein may include multiple key-value pairs. The disclosure may also set data types for various values in the data structure, including keyword, long, and so on. Long is a data type representing a long integer. For example, a time can be represented by a long to facilitate sorting of the time. Keyword is a data type in ES (Elasticsearch) and is a string type.
[0122] The following provides an exemplary data structure of a session index with a set data type:
[0123] {"mappings":{"session":{"properties":{"uid":{"type":"keyword"},"chatType":{"type":"keyword"},"targetId":{"type":"keyword"} ,"groupSnapshot":{"properties":{"member":{"type":"keyword"},"timestamp":{"type":"long"}}},"timestamp":{"type":"long"}}}}}.
[0124] For ease of understanding, the following is an example of a data structure of a session index with a set data type provided by the present disclosure:
[0125] Assume: the current account is identified as zhangsan123; the session type is a group chat session (Q may be used to identify a group chat session in this disclosure); the session identifier is the group chat session ID: ss541; the identifiers of the accounts participating in the session other than the current account include lisi3 and wangwu6; the times when the accounts participating in the session other than the current account entered the session include: March 1, 2010, 12:00:00 and March 2, 2010, 12:00:00; and the session establishment time is March 1, 2010, 11:00:00. Based on this information, the session index is:
[0126] {"mappings":{"session":{"properties1":{"zhangsan123","Q","ss541","groupSnapshot":{"properties2 ":{"lisi3","2010.03.01;12:00:00"},{"wangwu6","2010.03.02;12:00:00"}},"2010.03.01;11:00:00"}}}}.
[0127] Of course, when the data structure of the session index includes multiple key-value pairs, the session index established based on this information is:
[0128] {"mappings":{"session":{"properties1":{"uid":"zhangsan123","chatType":"Q","targetId""ss541","groupSnapshot":{"properties2":{"member":"li si3","timestamp1":"2010.03.01;12:00:00"},{"member":"wangwu6","timestamp1":"2010.03.02;12:00:00"}},"timestamp2":"2010.03.01;11:00:00"}}}}.
[0129] In step S13, the session record corresponding to the session index of the target group chat session is used as a response to the session record query request.
[0130] Specifically, the present disclosure may set a unique identifier for a session record and then store the unique identifier in association with the session index. The unique identifier may be the file name of the session record, the storage address of the session record, or other identifiers, which are not limited by the present disclosure. Using the unique identifier, the present disclosure can find the corresponding session record.
[0131] After obtaining a session record query request, the present disclosure can query the session index of the target group chat session based on the information in the session record query request, and then use the session record corresponding to the session index of the target group chat session as a response to the session record query request, for example: sending the session record corresponding to the session index of the target group chat session to the display screen of the client device for display.
[0132] Optionally, step S13 may output the session record corresponding to the session index of the target group chat session to a display screen of the client device for display. Specifically, all or part of the session content of the session record corresponding to the session index of the target group chat session may be output to an operating interface of an application with instant messaging functionality. Optionally, the operating interface for displaying the session content and the interface for inputting the identifiers of the at least two session participating accounts may be the same or different operating interfaces.
[0133] like Figure 6 As shown, it can be Figure 6 The query result is displayed in the operation interface, and the query result includes part of the conversation content (which may be part or all of the conversation content including the keyword) of the conversation record corresponding to the conversation index of the target group chat conversation. Figure 6 As shown, the query result may also include: the session identifier of the group chat session to which the displayed session content belongs (such as "Group A", "Group B", "Group C"), and the identifiers of the queried session participant accounts "Li Si" and "Wang Wu".
[0134] The present disclosure sets a session index containing the identifiers of the session participating accounts for the session record, and stores the session record and the session index in correspondence. In this way, when the server receives a session record query request containing the identifier of the current account and the identifiers of the session participating accounts, the server can search for the session index including the identifier of the current account and the identifiers of the session participating accounts in the session record query request, and then find the session record corresponding to the index. It can be seen that the server of the present disclosure can find the session record of the group chat session containing the current account and these session participating accounts based on the session record query request, without the need for manual search one by one, saving time and effort and reducing the operating burden of the client device.
[0135] Optional, such as Figure 2 As shown, in other embodiments, Figure 1 Step S12 may specifically include:
[0136] In step S121, each first session index whose user account identifier is the identifier of the current account is queried, and the session identifier in each queried first session index is determined as the target identifier.
[0137] For example: There are three target identifiers, namely Q0001, Q0002, and Q0003.
[0138] In step S122, the identifiers of at least two session participating accounts are used to search in each session index containing the target identifier to obtain the session identifier of the target group chat session.
[0139] The session index of the target group chat session includes the identifier of each session participant account in the session record query request.
[0140] In step S123, the first session index including the session identifier of the target group chat session is determined as the session index of the target group chat session.
[0141] Because session indexes exist for different accounts, the present disclosure can first search for the session index of the current account, that is, query each first session index whose user account identifier is the identifier of the current account. For example, for the session index data structure provided by the present disclosure, the present disclosure can query each first session index whose "uid" is the identifier of the current account. After querying each first session index, the session identifier of each group chat session in which the current account is located can be obtained based on the session identifier in each first session index. Next, the present disclosure can query the session index of these group chat sessions for the session index of the target group chat session that also contains the identifiers of each session participating account in the session record query request.
[0142] visible, Figure 2 The method shown implements step-by-step querying. Through this step-by-step querying approach, the present disclosure can effectively reduce the amount of data to be queried and increase the query speed.
[0143] Optionally, in addition to querying the session index of the target group chat session according to the identifiers of the at least two session participating accounts, the present disclosure may also query the session index of the target group chat session according to other session information (such as session establishment time).
[0144] Optionally, in addition to querying the session index of the target group chat session through session information, the present disclosure can also query the session index of the target group chat session based on other information besides session information, such as keywords for querying session content, time range of session content, etc.
[0145] Optional, such as Figure 3 As shown, in other embodiments, Figure 2 Step S122 may specifically include:
[0146] In step S1221 , a second session index including an identifier of at least one session participating account is searched in each session index including a target identifier.
[0147] Optionally, since some query instructions only need to meet one query condition to be considered as the query result, in actual application, the present disclosure can search for a second session index containing the identifier of at least one session participating account in each session index containing the target identifier; and then determine the second session index containing the identifiers of all session participating accounts.
[0148] For example, in step S1221 , the second session index including the identifier of at least one session participating account may be searched through the query command “Select * from tb where uid in (B, C) and groupId in (Q0001, Q0002, Q0003)”.
[0149] In the above query command, "tb" represents the index library name, "uid" is the field for user account identification, B and C in "(B,C)" are the identifiers of the session participating accounts in the session record query request, "groupId" is the field for session identification, and Q0001, Q0002, and Q0003 in "(Q0001, Q0002, Q0003)" are the target identifiers (i.e., the session identifiers in each first session index). The meaning of the above query command is: query the index from the index library tb for the session index whose field uid value is one of B and C and whose field groupId value is one of Q0001, Q0002, and Q0003.
[0150] In step S1222, a second session index including identifiers of all session participating accounts is determined, and the session identifier in the determined second session index is determined as the session identifier of the target group chat session.
[0151] pass Figure 3 In the method shown, the present disclosure may first search for a second session index including the identifier of at least one session participating account, and then determine a second session index including the identifiers of all session participating accounts. Figure 3 Steps S1221 and S1222 implement step-by-step and precise query of the conversation index, and can effectively utilize the query characteristics of the query instruction.
[0152] Optionally, in other embodiments, step S1222 may specifically include:
[0153] Dividing the second session indexes including the same session identifier into an index group;
[0154] Determine a target index group from each index group, wherein the identifier group formed by the user account identifiers of each second session index in the target index group includes: the identifiers of each account included in the session record query request;
[0155] The session identifier included in the second session index in the target index group is determined as the session identifier of the target group chat session.
[0156] By dividing the index groups as described above, the second session indexes corresponding to the same group chat session can be divided into one index group. If the user account identifier in a session index can only correspond to one value, then when the user account identifiers of each session index in an index group are respectively the identifiers of each account included in the session record query request, it means that the group chat session corresponding to the index group includes each account included in the session record query request (the current account and at least two session participating accounts). At this point, it can be determined that the group chat session corresponding to the index group is the target group chat session. The present disclosure can determine the session identifier included in the session index in the index group as the session identifier of the target group chat session. It can be seen that through the above grouping and processing process, the present disclosure can accurately determine the target group chat session.
[0157] Optional, such as Figure 4 As shown, in other embodiments, Figure 1 Step S12 may specifically include:
[0158] In step S124, each first session index whose user account identifier is the identifier of the current account is queried.
[0159] In an optional embodiment, the process of querying the first session indexes of the user account identifier as the identifier of the current account in step S124 may be the same as the process of querying the first session indexes of the user account identifier as the identifier of the current account in step S121, and will not be repeated herein.
[0160] In step S125 , the first session index is searched for a third session index including identifiers of the respective session participating accounts.
[0161] Optionally, the fields for identifying each session participant account in the session index are fields other than the user account identifier. That is, the fields corresponding to the current account and the fields corresponding to each session participant account are different. For example, the field corresponding to the current account is uid, and the field corresponding to each session participant account is member. In this case, steps S124 and S125 of the present disclosure can be implemented by querying the session index using one or more query instructions. For example, the present disclosure can implement the processing of steps S124 and S125 using a single query instruction, such as "Select * from tb where uid in (A) and member in (B, C)." In this query instruction, "tb" represents the index library name, "uid" is the user account identifier field, "A" in "(A)" is the identifier of the current account, "member" is the identifier field of the session participant account, and "B" and "C" in "(B, C)" are the identifiers of the session participant accounts in the session record query request. Therefore, the query instruction means: to query the index library tb for session indexes where the uid field is A and the member field is either B or C.
[0162] In step S126, the third session index is determined as the session index of the target group chat session.
[0163] pass Figure 4 The method shown in the present disclosure can obtain the session index of the target group chat session through fewer query instructions, and can be applicable to an application environment where the field of the identification of the session participating account can be directly queried through a query instruction.
[0164] Optionally, the present disclosure can create a new session index for each participant in a session when the session is established. Specifically, the present disclosure can create a session index for the current account when the session is established, including the current account identifier and session information. However, in some cases, the session index may be deleted or lost for some reason. In such cases, the present disclosure can create a new session index to ensure that the session records can be properly stored.
[0165] In other embodiments, when someone joins a group chat session, the present disclosure may create a new session index for the newly joined person.
[0166] Optionally, in other embodiments, any of the conversation record query methods provided by the embodiments of the present disclosure may further include:
[0167] If condition 1 or condition 2 is met, create a session index for the target group chat session for the current account;
[0168] The first condition is: the target group chat session is a newly created group chat session;
[0169] Condition 2 is: the current account is an account that has newly joined the target group chat session.
[0170] The created session index can include the current account identifier and the session information of the group chat session. After the session index is created, subsequent session content in the group chat session can be saved in correspondence with the session index. Optionally, the session index and corresponding session records before the session content can continue to be retained. By creating the above-mentioned session index, the present disclosure can promptly create corresponding session indexes for newly added accounts and each account in a newly created group chat session, so that the session index can be subsequently queried and used.
[0171] Optionally, in other embodiments, any of the conversation record query methods provided by the embodiments of the present disclosure may further include:
[0172] If conditions 3 or 4 are met, delete the session index of the target group chat session created for the current account;
[0173] Condition three is: the target group chat session is a disbanded group chat session;
[0174] Condition 4: The current account exits the target group chat session.
[0175] Optionally, the deleted session index is a session index corresponding to a session record of a group chat session in which the current account participates.
[0176] By deleting the above session index, the present disclosure can promptly clear redundant session indexes, effectively saving the computational effort of storage controls and session record queries.
[0177] Figure 7 This is a block diagram of a conversation record query device according to an exemplary embodiment. Figure 7 The device includes a request receiving unit 121, an index query unit 122 and a response determining unit 123.
[0178] The request receiving unit 121 is configured to receive a session record query request for a target group chat session from a current account, where the session record query request includes at least: an identifier of the current account and session information of the target group chat session, where the session information of the target group chat session includes at least: identifiers of at least two participating accounts in the target group chat session, excluding the current account;
[0179] The index query unit 122 is configured to query the session index of the target group chat session based on the identifier of the current account and the session information of the target group chat session;
[0180] The response determination unit 123 is configured to execute the session record corresponding to the session index of the target group chat session as a response to the session record query request.
[0181] In an optional embodiment, the index query unit 122 may include:
[0182] The first query subunit is configured to query each first session index whose user account identifier is the identifier of the current account, and determine the session identifier in each queried first session index as the target identifier;
[0183] The second query subunit is configured to use the identifiers of at least two session participating accounts to query in each session index containing the target identifier to obtain the session identifier of the target group chat session;
[0184] The first determining subunit is configured to determine the first session index including the session identifier of the target group chat session as the session index of the target group chat session.
[0185] In an optional embodiment, the second query subunit includes:
[0186] a search subunit configured to search for a second session index containing an identifier of at least one session participating account in each session index containing a target identifier;
[0187] The second determining subunit is configured to determine a second session index including identifiers of all session participating accounts, and determine the session identifier in the determined second session index as the session identifier of the target group chat session.
[0188] In an optional embodiment, the second determining subunit includes:
[0189] a dividing subunit, configured to divide the second session indexes having the same session identifier into an index group;
[0190] The index group determination subunit is configured to determine a target index group from each index group, wherein the identifier group consisting of the user account identifiers of each second session index in the target index group includes: the identifiers of each account included in the session record query request;
[0191] The third determining subunit is configured to determine the session identifier included in the second session index in the target index group as the session identifier of the target group chat session.
[0192] In an optional embodiment, the index query unit 122 includes:
[0193] A third query subunit is configured to query each first session index whose user account identifier is the identifier of the current account;
[0194] a fourth query subunit, configured to query the first session index for a third session index including identifiers of each session participating account;
[0195] The index determining subunit is configured to determine the third session index as the session index of the target group chat session.
[0196] In an optional embodiment, the conversation record query device provided by the embodiment of the present disclosure further includes: an index creation unit, configured to create a conversation index of the target group chat conversation for the current account when the first condition or the second condition is met;
[0197] The first condition is: the target group chat session is a newly created group chat session;
[0198] Condition 2 is: the current account is an account that has newly joined the target group chat session.
[0199] In an optional embodiment, the conversation record query apparatus provided by the embodiment of the present disclosure further includes: an index deletion unit configured to delete the conversation index of the target group chat conversation created for the current account when the third condition or the fourth condition is met;
[0200] Condition three is: the target group chat session is a disbanded group chat session;
[0201] Condition 4: The current account exits the target group chat session.
[0202] Regarding the apparatus in the above embodiment, the specific manner in which each unit performs operations has been described in detail in the embodiment of the method, and will not be elaborated on here.
[0203] Figure 8 FIG. 1 is a block diagram of a server according to an exemplary embodiment. Figure 8 As shown, the server 800 may include:
[0204] Processor 820;
[0205] a memory 804 for storing instructions executable by the processor 820;
[0206] The processor 820 is configured to execute instructions to implement any one of the conversation record query methods provided in the embodiments of the present disclosure.
[0207] In an exemplary embodiment, a computer-readable storage medium is also provided. When the instructions in the computer-readable storage medium are executed by the processor 820 of the server 800, the server 800 can perform any of the conversation record query methods provided in the embodiments of the present disclosure. Alternatively, the computer-readable storage medium can be a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, etc.
[0208] In an exemplary embodiment, a computer program product is further provided, including a computer program. When the computer program is executed by a processor, any one of the conversation record query methods provided in the embodiments of the present disclosure is implemented.
[0209] Other embodiments of the present disclosure will readily occur to those skilled in the art after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art not disclosed herein. The description and examples are to be considered as exemplary only, with the true scope and spirit of the present disclosure being indicated by the following claims.
[0210] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes can be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A session record query method, applied to a server, characterized in that: include: Receive a session record query request for a target group chat session from a current account, wherein the session record query request includes at least: an identifier of the current account and session information of the target group chat session, wherein the session information of the target group chat session includes at least: identifiers of at least two session participating accounts in the target group chat session except the current account; Querying a session index of the target group chat session according to the identifier of the current account and the session information of the target group chat session; Using a session record corresponding to the session index of the target group chat session as a response to the session record query request; The querying of the session index of the target group chat session according to the identifier of the current account and the session information of the target group chat session includes: Querying each first session index whose user account identifier is the identifier of the current account, and determining the session identifier in each of the queried first session indexes as the target identifier; Using the identifiers of the at least two session participating accounts, querying in each session index including the target identifier to obtain the session identifier of the target group chat session; Determine the first session index including the session identifier of the target group chat session as the session index of the target group chat session; or, The querying the session index of the target group chat session according to the identifier of the current account and the session information of the target group chat session includes: Querying each first session index whose user account identifier is the identifier of the current account; Querying the first session index for a third session index including identifiers of each of the session participating accounts; The third session index is determined as the session index of the target group chat session.
2. The method according to claim 1, characterized in that The step of using the identifiers of the at least two session participating accounts to query in each session index including the target identifier to obtain the session identifier of the target group chat session includes: In each session index including the target identifier, searching for a second session index including the identifier of at least one of the session participating accounts; Determine the second session index that includes identifiers of all the session participating accounts, and determine the session identifier in the determined second session index as the session identifier of the target group chat session.
3. The method according to claim 2, characterized in that The determining the second session index including the identifiers of all the session participating accounts, and determining the session identifier in the determined second session index as the session identifier of the target group chat session, includes: Dividing the second session indexes including the same session identifier into an index group; Determine a target index group from each of the index groups, wherein the identification group formed by the user account identifications of each second session index in the target index group includes: identifications of each account included in the session record query request; The session identifier included in the second session index in the target index group is determined as the session identifier of the target group chat session.
4. The method according to claim 1, characterized in that: The method further comprises: When condition one or condition two is met, creating a session index of the target group chat session for the current account; The first condition is: the target group chat session is a newly created group chat session; The second condition is: the current account is an account that newly joins the target group chat session.
5. The method according to claim 1 or 4, characterized in that: The method further comprises: If condition three or condition four is met, deleting the session index of the target group chat session created for the current account; The third condition is: the target group chat session is a dissolved group chat session; The fourth condition is: the current account exits the target group chat session.
6. A session record query device, applied to a server, characterized in that: include: a request receiving unit, configured to execute receiving a session record query request of a current account for a target group chat session, wherein the session record query request at least includes: an identifier of the current account and session information of the target group chat session, wherein the session information of the target group chat session at least includes: identifiers of at least two session participating accounts in the target group chat session except the current account; an index query unit, configured to query a session index of the target group chat session according to the identifier of the current account and the session information of the target group chat session; a response determination unit, configured to execute a session record corresponding to the session index of the target group chat session as a response to the session record query request; Wherein, the index query unit includes: A first query subunit is configured to query each first session index whose user account identifier is the identifier of the current account, and determine the session identifier in each of the queried first session indexes as a target identifier; A second query subunit is configured to use the identifiers of the at least two session participating accounts to query in each session index including the target identifier to obtain the session identifier of the target group chat session; A first determining subunit is configured to determine the first session index including the session identifier of the target group chat session as the session index of the target group chat session; or, The index query unit includes: A third query subunit is configured to query each first session index whose user account identifier is the identifier of the current account; a fourth query subunit, configured to query the first session index for a third session index including identifiers of the respective session participating accounts; The index determination subunit is configured to determine the third session index as the session index of the target group chat session.
7. The conversation record query device according to claim 6, characterized in that: The second query subunit includes: a search subunit configured to search for a second session index including an identifier of at least one of the session participating accounts in each session index including the target identifier; The second determining subunit is configured to determine the second session index including identifiers of all the session participating accounts, and determine the session identifier in the determined second session index as the session identifier of the target group chat session.
8. The conversation record query device according to claim 7, characterized in that: The second determining subunit includes: a dividing subunit, configured to divide the second session indexes including the same session identifier into an index group; The index group determination subunit is configured to determine a target index group from each of the index groups, wherein the identification group formed by the user account identifications of each second session index in the target index group includes: identifications of each account included in the session record query request; The third determining subunit is configured to determine the session identifier included in the second session index in the target index group as the session identifier of the target group chat session.
9. The conversation record query device according to claim 6, characterized in that: The session record query device further includes: an index creation unit configured to create a session index of the target group chat session for the current account when condition one or condition two is met; The first condition is: the target group chat session is a newly created group chat session; The second condition is: the current account is an account that newly joins the target group chat session.
10. The conversation record query device according to claim 6 or 9, characterized in that: The session record query device further includes: an index deletion unit configured to delete the session index of the target group chat session created for the current account when condition three or condition four is met; The third condition is: the target group chat session is a dissolved group chat session; The fourth condition is: the current account exits the target group chat session.
11. A server, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the session record query method according to any one of claims 1 to 5.
12. A computer-readable storage medium, when instructions in the computer-readable storage medium are executed by a processor of a server, the server is enabled to execute the conversation record query method according to any one of claims 1 to 5.
