A conversation message management method, system, device and storage medium
By storing the session data and message data of ordered arrays in the database and building a hierarchical session list, the problem of large storage resource occupancy in traditional session message management is solved, flexible session message display and transfer is realized, and user experience is improved .
Patent Information
- Application Number
- CN202211538866.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-01
- Publication Date
- 2024-12-10
- Estimated Expiration
- 2042-12-01
AI Technical Summary
Traditional session message management methods require the construction of session lists according to different session types, resulting in large storage resources occupancy and lack of flexibility, and the inability to effectively manage multi-type session messages.
By storing an ordered array of session data and message data in the database, a hierarchical session list is constructed. The session data contains the identification relationship of the session type, and the message data contains the identification relationship of the session data to which it belongs. Based on the service layer request, data is loaded from the database to the cache for loading data from the database for processing exhibit.
Saves the storage space of session messages, improves the flexibility of session message management, improves user experience, and supports flexible session type display and transfer.
Smart Images

Figure CN115955449B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of data processing technology, and in particular to a session message management method, system, device and storage medium. Background Art
[0002] At present, with the widespread use of instant messaging applications, the types of application sessions are becoming more and more complex and diverse. When users have chat relationships and content with different objects for different reasons, a large number of different types of chat sessions will be generated. When managing multiple types of sessions, both session data and message data will be stored in the session list of the database. When the corresponding data needs to be displayed, the session list is queried, and the queried data is stored in the cached ordered list, and then displayed in the session list of the application interface in order.
[0003] However, the traditional session message management method requires building a session list according to different session types to store session data and message data separately, and querying the database for the corresponding type of session list and loading the data into the cache according to the sessions and messages that the business layer needs to display, so as to display the corresponding session messages. Managing session messages by type requires a large amount of storage resources, and the storage and display methods of session messages are relatively simple and lack flexibility. Summary of the invention
[0004] The embodiments of the present application provide a session message management method, system, device and storage medium, which can save storage space for session messages, improve the flexibility of session message management, and solve the technical problem of large memory usage of session messages.
[0005] In a first aspect, an embodiment of the present application provides a session message management method, including:
[0006] A hierarchical session list is constructed in the cache based on the session data stored in the database. The hierarchical session list is used to store the hierarchical relationship between different session types and corresponding session data. The database stores the session data and message data in an ordered array respectively. The session data includes a first identification relationship between itself and the session type, and the message data includes message content and a second identification relationship between itself and the corresponding session data.
[0007] In response to a session message request of a corresponding session type at the business layer, a hierarchical session list is queried based on the session message request, and corresponding session data and message data are sequentially loaded from the database to the cache according to the query result to display the session message of the corresponding session type.
[0008] In a second aspect, an embodiment of the present application provides a conversation message management system, including:
[0009] A construction module is configured to construct a hierarchical session list in a cache based on the session data stored in the database, wherein the hierarchical session list is used to store the hierarchical relationship between different session types and corresponding session data, wherein the database stores the session data and the message data in an ordered array, respectively, wherein the session data includes a first identification relationship between itself and the session type, and the message data includes message content and a second identification relationship between itself and the corresponding session data;
[0010] The loading module is configured to respond to a session message request of a corresponding session type at the business layer, query the hierarchical session list based on the session message request, and load the corresponding session data and message data from the database to the cache in sequence according to the query results to display the session message of the corresponding session type.
[0011] In a third aspect, an embodiment of the present application provides a session message management device, including:
[0012] memory and one or more processors;
[0013] The memory is configured to store one or more programs;
[0014] When the one or more programs are executed by the one or more processors, the one or more processors implement the session message management method as described in the first aspect.
[0015] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a computer processor, the computer-executable instructions are configured to execute the session message management method as described in the first aspect.
[0016] In a fifth aspect, an embodiment of the present application provides a computer program product, which includes instructions. When the instructions are executed on a computer or a processor, the computer or the processor executes the session message management method as described in the first aspect.
[0017] The embodiment of the present application constructs a hierarchical session list in a cache based on session data stored in a database. The hierarchical session list is used to store the hierarchical relationship between different session types and corresponding session data. The database stores session data and message data in an ordered array, respectively. The session data includes a first identification relationship between itself and the session type, and the message data includes message content and a second identification relationship between itself and the session data to which it belongs. Then, in response to a session message request corresponding to the session type at the business layer, the hierarchical session list is queried based on the session message request, and the corresponding session data and message data are sequentially loaded from the database to the cache according to the query results to display the session messages of the corresponding session type. By adopting the above technical means, the construction of the session list in the database can be reduced by storing the identification relationship between the session data itself and the session type. And by constructing a hierarchical session list in the cache, it is convenient to load and display session messages of different session types, thereby saving storage space for session messages, improving the flexibility of session message management, and improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 It is a flow chart of a conversation message management method provided by an embodiment of the present application;
[0019] Figure 2 It is a schematic diagram of the storage structure of the session message in the embodiment of the present application;
[0020] Figure 3 This is a schematic diagram of updating the hierarchical relationship in an embodiment of the present application;
[0021] Figure 4 This is a flow chart of session transfer in an embodiment of the present application;
[0022] Figure 5 This is a first schematic diagram of the hierarchical relationship of session types in an embodiment of the present application;
[0023] Figure 6 This is a second schematic diagram of the hierarchical relationship of session types in an embodiment of the present application;
[0024] Figure 7 It is a structural diagram of a conversation message management system provided by an embodiment of the present application;
[0025] Figure 8 It is a structural diagram of a session message management device provided in an embodiment of the present application; DETAILED DESCRIPTION
[0026] In order to make the purpose, technical scheme and advantages of the present application clearer, the specific embodiments of the present application are further described in detail below in conjunction with the accompanying drawings. It is understood that the specific embodiments described herein are only used to explain the present application, rather than to limit the present application. It should also be noted that, for the convenience of description, only the part related to the present application but not all the contents are shown in the accompanying drawings. Before discussing the exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flow charts. Although the flow chart describes each operation (or step) as a sequential process, many of the operations therein can be implemented in parallel, concurrently or simultaneously. In addition, the order of each operation can be rearranged. The process can be terminated when its operation is completed, but it can also have additional steps not included in the accompanying drawings. The process can correspond to a method, a function, a procedure, a subroutine, a subprogram, etc.
[0027] The session message management method provided by the present application aims to store the identification relationship between the session data itself and the session type, and to build a hierarchical session list in the cache. The business layer loads the session data and message data from the database according to the hierarchical session list for display. In this way, the construction of the session list of different session types in the database can be reduced, saving the storage space of the session message.
[0028] For the traditional session message management solution, when storing, managing and displaying multiple types of sessions, the traditional approach is to store session data and message data in different session lists in the database according to the session type, and then extract the data by querying the session list and store it in the cached ordered list, so as to display it in sequence in the session list of the application interface. In addition, due to the limitations of storage space and session storage structure, although session messages are displayed in a categorized session list, the number of displays is limited. Moreover, the link relationship between session lists is fixed and single, and cannot be modified according to specific business needs and nature. The standard for classifying session categories is also relatively fixed and cannot be modified in the online cloud control. In the case of multiple session lists, sessions cannot be transferred. Based on this, a session message management method of an embodiment of the present application is provided to solve the technical problem that the existing session message memory usage is large and to improve the flexibility of session message management.
[0029] Example:
[0030] Figure 1 A flow chart of a session message management method provided in an embodiment of the present application is given. The session message management method provided in this embodiment can be executed by a session message management device, which can be implemented by software and / or hardware. The session message management device can be composed of two or more physical entities, or can be composed of one physical entity. Generally speaking, the session message management device can be a data processing device such as a computer, a mobile phone, or a tablet.
[0031] The following description is made by taking the session message management device as the subject of executing the session message management method as an example. Figure 1 , the session message management method specifically includes:
[0032] S110: construct a hierarchical session list in a cache based on the session data stored in the database, the hierarchical session list being used to store the hierarchical relationship between different session types and corresponding session data, the database storing the session data and the message data in an ordered array respectively, the session data including a first identification relationship between itself and the session type, the message data including the message content and a second identification relationship between itself and the corresponding session data;
[0033] S120, in response to a session message request of a corresponding session type at the business layer, query a hierarchical session list based on the session message request, and load corresponding session data and message data from a database to a cache in sequence according to the query result to display a session message of the corresponding session type.
[0034] In the session message management method of the embodiment of the present application, when performing session message management, Figure 2 As shown, two ordered arrays are constructed in the database to store session data and message data respectively, wherein the session data stores the identification relationship between the session and the session type to which it belongs. Then, based on the data stored in the database, a hierarchical session list is constructed in the cache to record the hierarchical relationship between different session types and corresponding sessions. With limited device storage space, the device can store a large number of session messages and the association relationship between the session and the corresponding session type, so that the session list of different session types and the same type of sessions therein can be smoothly displayed on the device application interface.
[0035] Specifically, due to the hardware limitations of the session message management device (such as mobile phones, computers, etc.), its hard disk capacity and running memory are small, which requires that the storage space occupied by the session message should be as small as possible, while also meeting business requirements. Therefore, the embodiment of the present application uses two ordered arrays to store the session data and message data generated by the instant messaging application in order.
[0036] Among them, the message is the chat message generated by the instant messaging application user and the specific object. The session is a collection of chat messages between the instant messaging application user and the specific object, including one-to-one chat, multi-person group chat, etc. The session data includes the identification relationship between itself and the session type to which it belongs, and the identification relationship is defined as the first identification relationship. The first identification relationship specifically includes a unique identifier for identifying the session data and a unique identifier for the session type to which the session belongs. Through the first identification relationship, the association relationship between each session data and the session type to which it belongs can be determined. The message data includes the message content (i.e., the chat message) and the identification relationship between itself and the session data to which it belongs, and the identification relationship is defined as the second identification relationship. The second identification relationship includes a unique identifier for identifying the message and a unique identifier for identifying the session data to which the message belongs. Through the second identification relationship, the association relationship between each chat message and the session to which it belongs can be determined.
[0037] It should be noted that the message data and session data are stored in the database in the form of an ordered array, and when they are loaded into the cache, they are also cached in the form of an ordered array. Only two arrays are needed to cache the message and session data, saving a lot of memory space. This makes it easy to load and display session messages in sequence, ensuring the reliability of session message storage. Since the session data contains a first identification relationship that identifies the session type to which the session points, through this information storage method, no additional storage space is required to save the session list to store the association relationship between different session types and corresponding sessions. The association relationship itself is stored in the session, which can save a lot of storage space in the database.
[0038] Furthermore, based on the message data and session data stored in the database, a hierarchical session list will be constructed in the cache to store the hierarchical relationship between different session types and the corresponding session data. It is understandable that when displaying session messages, the cache needs to display session messages of the session types corresponding to the application interface requirements, load the corresponding session data and message data from the database, and then display the session messages according to the session data and message data in the cache. Based on this, according to the first identification relationship of the session data stored in the database, the embodiment of the present application corresponds to constructing a hierarchical session list in the cache, recording the hierarchical relationship between different session types and the corresponding session data, and the hierarchical relationship corresponds to the first identification relationship, so as to facilitate subsequent session data queries.
[0039] The hierarchical conversation list contains unique identifiers of different conversation types, and each conversation type stores a hierarchical conversation list of one level. In the hierarchical conversation list of the corresponding level, the top conversation data and normal conversation data are saved. That is, each conversation type saves the conversation data to which it is linked. By adopting a chain storage structure to save the conversation list information of each level, the time consumed by the business to obtain the conversation data and message data of the corresponding conversation list is greatly reduced, thereby improving the user experience.
[0040] According to actual needs, the order of each conversation in the hierarchical conversation list can be customized according to user needs, or can be sorted according to attributes such as message receiving time. By sorting the conversations according to the message receiving time, the interference of irrelevant conversations to the user can be reduced, and the user can be reminded of the message content in a timely manner.
[0041] Optionally, the hierarchical conversation list is also used to store the hierarchical relationship between different conversation types, and the conversation type of the next level is stored in the specified position of the hierarchical conversation list of the corresponding conversation type. It can be understood that, corresponding to different conversation types, conversation message management can also be performed by building a hierarchical relationship. That is, in the hierarchical conversation list of a conversation type, its subclasses not only contain conversation data, but also can contain another conversation type. In this way, a chain storage structure of the conversation list can be constructed to expand the user's display requirements for the conversation list. After the user clicks on a conversation type on the application interface to enter the conversation list of that conversation type, he can click on another conversation type in the conversation list, and then click on the sublist of the next level, that is, the conversation list of another conversation type.
[0042] For example, the list entry of session type 1 is displayed in the session list of session type 0, and the list entry of session type 3 is displayed in session type 1. In this way, the hierarchical relationship is stored in the hierarchical session list according to the chain storage structure of 0-1-3. In the database, the session data is stored corresponding to session type 1 and session type 3. In the first identification relationship, session type 1 points to session type 0, and session type 3 points to session type 1. In this way, chain relationship storage between different session types can be realized, meeting the user's storage requirements for different session lists and improving the flexibility of session message management.
[0043] Furthermore, based on the hierarchical conversation list constructed as above, when subsequently displaying conversation messages, the business layer first displays each conversation type information on the application interface according to the different conversation types recorded in the hierarchical conversation list. Then, according to a conversation type selected by the user, the business layer generates a conversation message request of the corresponding conversation type. Based on the conversation message of the corresponding conversation type requested by the conversation message request, the identification information of the conversation data associated with the conversation type is determined by querying the hierarchical conversation list. Then, according to the identification information of the conversation data, the database is queried to find the conversation data and message data containing the corresponding identification information, and the conversation data and message data are loaded into the cache. The cache can generally load a set amount of conversation data and corresponding message data in sequence, and display them on the application interface. When the user pulls down the application interface, the cache continues to load the conversation data and corresponding message data in sequence, and is applied to the conversation message display.
[0044] At this point, through a simple data structure color matching hierarchical conversation list, efficient and flexible conversation message display is achieved, database storage space is saved, and the conversation message management effect is improved.
[0045] Optionally, based on the constructed hierarchical relationship, the session type defined at the business layer and the hierarchical structure of the corresponding session data are obtained to compare whether the hierarchical structure is consistent with the hierarchical relationship stored in the hierarchical session list; if the hierarchical structure and the hierarchical relationship are inconsistent, the first identification relationship of the corresponding session data in the database is updated based on the hierarchical structure, and the hierarchical relationship stored in the hierarchical session list is updated based on the updated first identification relationship.
[0046] Reference Figure 3 In steps a1-a4, the embodiment of the present application continuously updates the first identification relationship and the corresponding hierarchical relationship to ensure that the session entrances of each session are consistent, the session messages are displayed accurately, and the display disorder is avoided. For example, after the cache is initialized, the session type pointed to by each session is determined by querying the first identification relationship of all session data in the database. At the same time, the session type defined by the business layer and the hierarchical structure of the corresponding session data are obtained. By comparing the hierarchical structure with the first identification relationship, it can be understood that if the hierarchical structure of a session data is inconsistent with the first identification relationship, in order to indicate that the session message is disordered. At this time, the hierarchical structure set by the business layer shall prevail, and the first identification relationship of the session data in the database shall be updated according to the session type pointed to by the session data in the hierarchical structure. Then, based on the updated first identification relationship, the corresponding hierarchical relationship of the hierarchical session list in the cache is updated, and the session data and message data are loaded into the cache based on the updated session list. Otherwise, the session data and message data are directly loaded into the cache.
[0047] Optionally, session data can be transferred hierarchically based on user settings. Figure 4In steps b1-b6, the hierarchical setting information of the session data is received by the business layer, where the hierarchical setting information is used to set a first identification relationship; the hierarchical setting information is compared with the corresponding first identification relationship in the database to see if they are consistent, and if the hierarchical setting information is inconsistent with the corresponding first identification relationship, the corresponding first identification relationship is updated based on the hierarchical setting information.
[0048] Based on the above-mentioned efficient session data storage mechanism, the business layer can adaptively transfer the session list to which the session belongs according to user needs to meet the user's personalized settings for different session types. According to the session that the user needs to transfer, the business layer generates the hierarchical setting information of the session. The hierarchical setting information records the session type pointed to by a session data, that is, the corresponding session list to which the user needs to transfer the current session. The device then queries the first identification relationship of the corresponding session data stored in the database according to the hierarchical setting information. If the two are consistent, no modification is required; if the two are inconsistent, the first identification relationship needs to be updated according to the hierarchical setting information. In addition, the first identification relationship needs to be updated to the hierarchical relationship in the hierarchical session list to ensure the consistency of the display of session messages.
[0049] Based on this, the business layer only needs to call the interface tools provided by the system SDK (such as UpdateShowLevel) according to the customized rules, such as classifying the session type according to the chat user ID, or classifying the session type according to whether the session is a one-to-one chat or a group chat, to change the first identification relationship of the session data stored in the database, and modify the unique identifier attribute of the session type to which the session belongs in the first identification relationship. Then update the cached hierarchical session list, and the session can be transferred to the corresponding session list to meet the user's personalized session classification needs. In addition, the SDK can also automatically detect the classification standards set by the business. If the classification standards are updated, the first identification relationship of the corresponding session data will be automatically updated to achieve automatic session transfer.
[0050] For example, refer to Figure 5 , the next level of session type 0 includes session type 1 and session type 5, and the next level of session type 5 includes session type 3. Based on the chain storage relationship of session types 0-5-3, when transferring a session, if you need to point session type 3 to session type 1, refer to Figure 6 , then modify the first identification relationship of session type 3 to point to session type 1. And adaptively update the cache hierarchy relationship. In turn, session type 3 can be transferred to the session list of session type 1 on the application interface.
[0051] Furthermore, after completing the session transfer, it is also necessary to determine whether the session data corresponding to the updated first identification relationship is the latest session of the original session type. If the corresponding session data is the latest session of the original session type, the corresponding session data is queried from the database and loaded into the cache. It is understandable that if the session data is the latest session in the original session list, then in order to facilitate the user to view the latest session in the new session list, the latest session needs to be loaded into the cache and displayed on the new session list through the cache.
[0052] Afterwards, the hierarchical relationship stored in the hierarchical conversation list is updated based on the updated first identification relationship, and the unread messages and the number of unread messages of the corresponding conversation type are updated. It can be understood that since the conversation type to which the conversation data belongs has changed, that is, the conversation list where the conversation is located on the application interface has changed, and it has been transferred from one conversation list to another. Then on the application interface, the unread messages and the number of unread messages of these two conversation lists have changed, and the unread messages and the number of unread messages need to be updated. Correspondingly, the unread messages and the number of unread messages of the corresponding conversation type in the database, cache and business layer are updated in sequence to ensure the consistency and accuracy of the information display.
[0053] Based on the convenient conversation classification standards and conversation transfer capabilities provided by the above conversation message management method, users can easily set different conversation classification standards on the application, such as dividing according to attributes such as user ID, user type, or chat type. This improves the efficiency of users finding specific conversations and obtaining chat messages. At the same time, it supports users to flexibly define the link relationship between conversation type classification standards and conversation lists as needed. Applications can also set corresponding classification standards by themselves to reduce expansion costs. Finally, based on an efficient conversation data storage structure and conversation management method, it provides flexible combinations of different types of conversation lists, convenient conversation classification standards, and conversation transfer capabilities, which facilitates users to manage their numerous conversation messages and increase reading efficiency and experience.
[0054] In one embodiment, based on the convenient session classification standards and session transfer capabilities provided by the above-mentioned session message management method, the client's session classification standards can also be set on the cloud, such as dividing the session type according to the user ID. It is understandable that the user ID can be simply obtained from the server, so the cloud can adaptively set and modify the classification standards of the session type according to the user ID, so that the client can classify the session according to the preset session classification standards. For another example, the operator can update the division range of the official account session ID in the cloud, and add a new session type as the official account ID. The client obtains the new official account session ID and updates the session classification standards. When the SDK tool of the session application automatically detects that this session classification standard has changed, the newly added session can be transferred to the official account session list. In this way, the flexibility of session classification management is improved to meet the personalized needs of user session classification.
[0055] In the above, a hierarchical session list is constructed in the cache based on the session data stored in the database. The hierarchical session list is used to store the hierarchical relationship between different session types and the corresponding session data. The database stores the session data and message data in an ordered array, respectively. The session data includes a first identification relationship between itself and the session type, and the message data includes the message content and a second identification relationship between itself and the session data to which it belongs. Then, in response to the session message request of the corresponding session type at the business layer, the hierarchical session list is queried based on the session message request, and the corresponding session data and message data are sequentially loaded from the database to the cache according to the query results to display the session messages of the corresponding session type. By adopting the above technical means, the construction of the session list in the database can be reduced by storing the identification relationship between the session data itself and the session type. And by constructing a hierarchical session list in the cache, it is convenient to load and display the session messages of different session types, thereby saving the storage space of the session messages, improving the flexibility of the session message management, and improving the user experience.
[0056] Based on the above embodiments, Figure 7 A structural diagram of a conversation message management system provided by this application. Figure 7 The conversation message management system provided in this embodiment specifically includes: a construction module 21 and a loading module 22.
[0057] The construction module 21 is configured to construct a hierarchical session list in the cache based on the session data stored in the database. The hierarchical session list is used to store the hierarchical relationship between different session types and corresponding session data. The database stores the session data and message data in an ordered array, respectively. The session data includes a first identification relationship between itself and the session type, and the message data includes the message content and a second identification relationship between itself and the session data to which it belongs.
[0058] The loading module 22 is configured to respond to a session message request of a corresponding session type at the business layer, query the hierarchical session list based on the session message request, and load the corresponding session data and message data from the database to the cache in sequence according to the query result to display the session message of the corresponding session type.
[0059] Specifically, before responding to the session message request corresponding to the session list of the business layer, the method further includes:
[0060] Obtain the session type defined at the business layer and the hierarchical structure of the corresponding session data, and compare whether the hierarchical structure is consistent with the first identification relationship of the session data in the database;
[0061] When the hierarchical structure is inconsistent with the first identification relationship, the first identification relationship of the corresponding session data in the database is updated based on the hierarchical structure, and the hierarchical relationship stored in the hierarchical session list is updated based on the updated first identification relationship.
[0062] Specifically, the hierarchical session list is also used to store the hierarchical relationship between different session types, and the session type of the next level is stored in a designated position of the hierarchical session list of the corresponding session type.
[0063] Specifically, after building a hierarchical session list in the cache based on the session data stored in the database, it also includes:
[0064] Receiving level setting information of the session data from the business layer, where the level setting information is used to set a first identification relationship;
[0065] The hierarchical setting information is compared with the corresponding first identification relationship in the database to see whether they are consistent. If the hierarchical setting information is inconsistent with the corresponding first identification relationship, the corresponding first identification relationship is updated based on the hierarchical setting information.
[0066] Specifically, after updating the corresponding first identification relationship based on the hierarchical setting information, the method further includes:
[0067] It is determined whether the session data corresponding to the updated first identification relationship is the latest session of the original session type. If the corresponding session data is the latest session of the original session type, the corresponding session data is queried from the database and loaded into the cache.
[0068] Specifically, after updating the corresponding first identification relationship based on the hierarchical setting information, the method further includes:
[0069] The hierarchical relationship stored in the hierarchical conversation list is updated based on the updated first identification relationship, and the unread messages and the number of unread messages of the corresponding conversation type are updated.
[0070] In the above, a hierarchical session list is constructed in the cache based on the session data stored in the database. The hierarchical session list is used to store the hierarchical relationship between different session types and the corresponding session data. The database stores the session data and message data in an ordered array, respectively. The session data includes a first identification relationship between itself and the session type, and the message data includes the message content and a second identification relationship between itself and the session data to which it belongs. Then, in response to the session message request of the corresponding session type at the business layer, the hierarchical session list is queried based on the session message request, and the corresponding session data and message data are sequentially loaded from the database to the cache according to the query results to display the session messages of the corresponding session type. By adopting the above technical means, the construction of the session list in the database can be reduced by storing the identification relationship between the session data itself and the session type. And by constructing a hierarchical session list in the cache, it is convenient to load and display the session messages of different session types, thereby saving the storage space of the session messages, improving the flexibility of the session message management, and improving the user experience.
[0071] The conversation message management system provided in the embodiment of the present application can be configured to execute the conversation message management method provided in the above embodiment, and has corresponding functions and beneficial effects.
[0072] Based on the above practical example, the present application embodiment also provides a session message management device, referring to Figure 8 , the conversation message management device includes: a processor 31, a memory 32, a communication module 33, an input device 34 and an output device 35. The memory 32, as a computer-readable storage medium, can be configured to store software programs, computer executable programs and modules, such as program instructions / modules corresponding to the conversation message management method described in any embodiment of the present application (for example, the building module and the loading module in the conversation message management system). The communication module 33 is configured to perform data transmission. The processor 31 executes various functional applications and data processing of the device by running the software programs, instructions and modules stored in the memory, that is, implements the above-mentioned conversation message management method. The input device 34 can be configured to receive input digital or character information, and generate key signal input related to the user settings and function control of the device. The output device 35 may include a display device such as a display screen. The conversation message management device provided above can be configured to execute the conversation message management method provided in the above-mentioned embodiment, and has corresponding functions and beneficial effects.
[0073] On the basis of the above embodiments, the embodiments of the present application further provide a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, wherein the computer-executable instructions are configured to execute a session message management method when executed by a computer processor, and the storage medium may be any of various types of memory devices or storage devices. Of course, the computer-executable instructions of the computer-readable storage medium provided in the embodiments of the present application are not limited to the session message management method described above, and may also execute related operations in the session message management method provided in any embodiment of the present application.
[0074] On the basis of the above embodiments, the embodiments of the present application also provide a computer program product. The technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product. The computer program product is stored in a storage medium, and includes a number of instructions for enabling a computer device, a mobile terminal or a processor therein to execute all or part of the steps of the session message management method described in each embodiment of the present application.
Claims
1. A method for managing a session message, characterized in that: include: A hierarchical session list is constructed in a cache based on session data stored in a database, wherein the hierarchical session list is used to store the hierarchical relationship between different session types and the corresponding session data, wherein the database stores the session data and message data in an ordered array, wherein the session data includes a first identification relationship between itself and the session type, and the message data includes message content and a second identification relationship between itself and the corresponding session data; the hierarchical session list includes unique identifiers of different session types, wherein each session type stores a hierarchical session list of a level, wherein the top session data and normal session data are stored in the hierarchical session list of the corresponding level, and the session list information of each level is stored by adopting a chain storage structure; the message data is a chat message generated between an instant messaging application user and a specific object, and the session data is a collection of chat messages between an instant messaging application user and a specific object; In response to a session message request of a corresponding session type at the business layer, the hierarchical session list is queried based on the session message request, and the corresponding session data and message data are sequentially loaded from the database to the cache according to the query result to display the session message of the corresponding session type.
2. The conversation message management method according to claim 1, characterized in that: Before responding to the session message request corresponding to the session list of the business layer, the method further includes: Acquire the session type defined at the business layer and the corresponding hierarchical structure of the session data, and compare whether the hierarchical structure is consistent with the first identification relationship of the session data in the database; When the hierarchical structure is inconsistent with the first identification relationship, the first identification relationship of the corresponding session data in the database is updated based on the hierarchical structure, and the hierarchical relationship stored in the hierarchical session list is updated based on the updated first identification relationship.
3. The conversation message management method according to claim 1, characterized in that: The hierarchical session list is also used to store the hierarchical relationship between different session types, and the session type of the next level is stored in a designated position of the hierarchical session list of the corresponding session type.
4. The conversation message management method according to claim 1, characterized in that: After the hierarchical session list is constructed in the cache based on the session data stored in the database, the method further includes: Receiving level setting information of the session data from the service layer, where the level setting information is used to set the first identification relationship; The hierarchical setting information is compared with the first corresponding identification relationship in a database to see whether they are consistent. If the hierarchical setting information is inconsistent with the first corresponding identification relationship, the first corresponding identification relationship is updated based on the hierarchical setting information.
5. The conversation message management method according to claim 4, characterized in that: After the first identification relationship corresponding to the updating based on the hierarchical setting information is updated, the method further includes: It is determined whether the session data corresponding to the updated first identification relationship is the latest session of the original session type. If the corresponding session data is the latest session of the original session type, the corresponding session data is queried from the database and loaded into the cache.
6. The method for managing conversational messages according to claim 4, characterized in that: After the first identification relationship corresponding to the updating based on the hierarchical setting information is updated, the method further includes: The hierarchical relationship stored in the hierarchical conversation list is updated based on the updated first identification relationship, and the unread messages and the number of unread messages of the corresponding conversation type are updated.
7. A conversation message management system, characterized in that: include: A construction module is configured to construct a hierarchical conversation list in a cache based on the conversation data stored in a database, wherein the hierarchical conversation list is used to store the hierarchical relationship between different conversation types and the corresponding conversation data, wherein the database stores the conversation data and message data in an ordered array, respectively, wherein the conversation data includes a first identification relationship between itself and the conversation type, and the message data includes message content and a second identification relationship between itself and the corresponding conversation data; the hierarchical conversation list includes unique identifiers of different conversation types, wherein each conversation type stores a hierarchical conversation list of a level, wherein the hierarchical conversation list of the corresponding level stores top conversation data and normal conversation data, and stores conversation list information of each level by adopting a chain storage structure; the message data is a chat message generated between an instant messaging application user and a specific object, and the conversation data is a collection of chat messages between an instant messaging application user and a specific object; The loading module is configured to respond to a session message request of a corresponding session type at the business layer, query the hierarchical session list based on the session message request, and load the corresponding session data and message data from the database to the cache in sequence according to the query result to display the session message of the corresponding session type.
8. A conversation message management device, characterized in that: include: memory and one or more processors; The memory is configured to store one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the session message management method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a computer processor, the computer-executable instructions are configured to execute the conversation message management method according to any one of claims 1 to 6.
10. A computer program product, characterized in that The computer program product includes instructions, and when the instructions are executed on a computer or a processor, the computer or the processor executes the conversation message management method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Message display method and device, terminal, server, system and storage medium
CN112134784A
Session display method and device, computer equipment and storage medium
CN112230821A
