CN116032867A - Session processing method and device, electronic equipment and storage medium - Google Patents

Session processing method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN116032867A
CN116032867A CN202310020651.6A CN202310020651A CN116032867A CN 116032867 A CN116032867 A CN 116032867A CN 202310020651 A CN202310020651 A CN 202310020651A CN 116032867 A CN116032867 A CN 116032867A
Authority
CN
China
Prior art keywords
session
target group
client
group session
time stamp
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310020651.6A
Other languages
Chinese (zh)
Inventor
刘硕
王晶晶
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Dajia Internet Information Technology Co Ltd
Original Assignee
Beijing Dajia Internet Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Dajia Internet Information Technology Co Ltd filed Critical Beijing Dajia Internet Information Technology Co Ltd
Priority to CN202310020651.6A priority Critical patent/CN116032867A/en
Publication of CN116032867A publication Critical patent/CN116032867A/en
Pending legal-status Critical Current

Links

Images

Abstract

The disclosure provides a session processing method, a session processing device, electronic equipment and a storage medium, and relates to the technical field of computers. The method comprises the following steps: receiving a session synchronization request sent by a client, wherein the session synchronization request comprises a session timestamp of the client; if the session of the client has the target group session, acquiring the session information of the target group session, wherein the session information of the target group session comprises a group session time stamp, and the group session time stamp indicates the sending time of the last session message in the target group session; if the group session time stamp is greater than the local session time stamp of the target group session, synchronizing the session information of the target group session to the client, wherein the session time stamp of the client comprises the local session time stamp of the target group session. The method solves the problems of serious write diffusion and large server pressure in the related technology, and reduces the server pressure.

Description

Session processing method and device, electronic equipment and storage medium
Technical Field
The disclosure relates to the field of computer technology, and in particular, to a session processing method, a session processing device, electronic equipment and a storage medium.
Background
With the development of instant messaging (Instant Messaging, IM) technology, chat groups have become a common communication method, and chat groups may allow multiple users to gather together for information exchange and sharing. In the related art, if a user sends a message in a chat group, session information of each user in the group is updated, for example, the sending time of the message is written into the session information of each user. Because the session information of each user in the group needs to be updated as long as the message is sent in the group, the writing is seriously diffused, and if the number of the users in the chat group is large, a larger pressure is brought to the server, and the performance of the server is influenced.
It should be noted that the information disclosed in the above background section is only for enhancing understanding of the background of the present disclosure and thus may include information that does not constitute prior art known to those of ordinary skill in the art.
Disclosure of Invention
The present disclosure provides a session processing method, apparatus, electronic device, and computer readable storage medium to at least solve the problems of severe write-spread and high server pressure in the related art.
According to an aspect of the embodiments of the present disclosure, there is provided a session processing method, including: receiving a session synchronization request sent by a client, wherein the session synchronization request comprises a session time stamp of the client; if the session of the client has a target group session, acquiring session information of the target group session, wherein the session information of the target group session comprises a group session time stamp, and the group session time stamp indicates the sending time of the last session message in the target group session; and if the group session time stamp is greater than the local session time stamp of the target group session, synchronizing the session information of the target group session to the client, wherein the session time stamp of the client comprises the local session time stamp of the target group session.
In some embodiments of the present disclosure, the method further comprises: acquiring a target session message of the target group session according to the group session time stamp and the local session time stamp, wherein the target session message is a session message newly added in the target group session between the local session time stamp and the group session time stamp; synchronizing the target session message to the client.
In some embodiments of the present disclosure, the session information of the target group session further includes a group session message sequence number, the group session message sequence number indicating a message sequence number of a last session message in the target group session.
In some embodiments of the present disclosure, if the target group session exists for the session of the client, the session synchronization request includes a read message sequence number of the target group session; wherein the method further comprises: and determining the number of the unread messages of the target group session according to the group session message sequence number and the read message sequence number, and synchronizing the number of the unread messages of the target group session to the client.
In some embodiments of the present disclosure, the method further comprises: and if the session message is sent in the target group session, updating the group session time stamp and the group session message sequence number.
In some embodiments of the disclosure, the updating the group session timestamp and the group session message sequence number includes: updating the sending time of the session message to be the group session time stamp; determining the message sequence number of the session message in the target group session according to the increment sequence; and updating the group session message sequence number to the message sequence number of the session message in the target group session.
In some embodiments of the disclosure, synchronizing session information of the target group session to the client includes: and updating the session list of the client according to the session information of the target group session, and synchronizing the updated session list of the client to the client.
According to another aspect of the embodiments of the present disclosure, there is provided a session processing apparatus including: the request receiving module is used for receiving a session synchronization request sent by a client, wherein the session synchronization request comprises a session time stamp of the client; a session information obtaining module, configured to obtain session information of a target group session if a session of the client has the target group session, where the session information of the target group session includes a group session timestamp, and the group session timestamp indicates a sending time of a last session message in the target group session; and the session information sending module is used for synchronizing the session information of the target group session to the client if the group session time stamp is larger than the local session time stamp of the target group session, wherein the session time stamp of the client comprises the local session time stamp of the target group session.
In some embodiments of the present disclosure, the session information acquisition module is further configured to: acquiring a target session message of the target group session according to the group session time stamp and the local session time stamp, wherein the target session message is a session message newly added in the target group session between the local session time stamp and the group session time stamp; and, the session information sending module is further configured to: synchronizing the target session message to the client.
In some embodiments of the present disclosure, the session information of the target group session further includes a group session message sequence number, the group session message sequence number indicating a message sequence number of a last session message in the target group session.
In some embodiments of the present disclosure, if the target group session exists in the session of the client, the session synchronization request includes a read message sequence number of the target group session in a local session of the client. The session information acquisition module is further configured to: determining the number of unread messages of the target group session according to the group session message sequence number and the read message sequence number; and, the session information sending module is further configured to: and synchronizing the number of unread messages of the target group session to the client.
In some embodiments of the present disclosure, the apparatus further includes a session information storage module configured to: and if the session message is sent in the target group session, updating the group session time stamp and the group session message sequence number.
In some embodiments of the present disclosure, the session information storage module is further configured to: updating the sending time of the session message to be the group session time stamp; determining the message sequence number of the session message in the target group session according to the increment sequence; and updating the group session message sequence number to the message sequence number of the session message in the target group session.
In some embodiments of the present disclosure, the session information sending module is further configured to: and updating the session list of the client according to the session information of the target group session, and synchronizing the updated session list of the client to the client.
According to still another aspect of the embodiments of the present disclosure, there is provided an electronic apparatus including: a processor; a memory for storing the processor-executable instructions; wherein the processor is configured to execute the instructions to implement the session processing method described above.
According to yet another aspect of the embodiments of the present disclosure, there is provided a computer-readable storage medium, which when executed by a processor of an electronic device, enables the electronic device to perform the above-described session processing method.
The technical scheme provided by the embodiment of the disclosure at least brings the following beneficial effects: after receiving the session synchronization request sent by the client, if it is determined that the session of the client exists in the target group session and it is determined that the group session time stamp of the target group session is greater than the local session time stamp of the target group session, that is, the session in the target group is updated for the client, the session information of the target group session is synchronized to the client. Therefore, the session information of each user in the target group is updated without new session information in the group, the problems of serious write-out and high server pressure in the related technology are solved, the server pressure is reduced, and the server performance is improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the disclosure and together with the description, serve to explain the principles of the disclosure and do not constitute an undue limitation on the disclosure.
FIG. 1 is a system architecture diagram illustrating a session handling method according to an example embodiment;
FIG. 2 is a flow chart illustrating a session handling method according to an example embodiment;
FIG. 3 is a schematic diagram of a session information writing process for a target group session, shown according to an example embodiment;
FIG. 4 is a flow chart of a session processing method shown according to yet another exemplary embodiment;
FIG. 5 is a block diagram of a session processing device shown according to an example embodiment;
fig. 6 is a block diagram of a session processing device according to an exemplary embodiment.
Detailed Description
In order to enable those skilled in the art to better understand the technical solutions of the present disclosure, the technical solutions of the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.
It should be noted that the terms "first," "second," and the like in the description of the present disclosure and the claims and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the disclosure described herein may be capable of operation in sequences other than those illustrated or described herein. The implementations described in the following exemplary examples are not representative of all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with some aspects of the present disclosure as detailed in the accompanying claims.
The terms "at least one," "a plurality," "each," "any" as used herein, at least one includes one, two or more, a plurality includes two or more, and each refers to each of a corresponding plurality, any of which refers to any of the plurality.
The user information (including but not limited to user equipment information, user personal information, etc.) related to the present disclosure is information authorized by the user or sufficiently authorized by each party.
FIG. 1 is a system architecture diagram illustrating a session handling method according to an example embodiment, the system architecture comprising: the first terminal device 101, the second terminal device 102 and the server 103 are connected with each other through a wireless or wired network between the first terminal device 101 and the second terminal device 102 and the server 103.
The server may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDNs (Content Delivery Network, content delivery networks), basic cloud computing services such as big data and artificial intelligent platforms, and the like.
The terminal device may be, but is not limited to, a smart phone, a tablet computer, a notebook computer, a desktop computer, a smart speaker, a smart watch, etc.
The first terminal device 101 is installed with a first client, and the second terminal device 102 is installed with a second client. The first terminal device 101 and the second terminal device 102 can implement functions such as data transmission, message interaction, and the like through installed clients. For example, the first client installed by the first terminal apparatus 101 and the second client installed by the second terminal apparatus 102 are both application programs having an instant messaging function.
User 1 may log on to a first client installed on the first terminal device 101 based on a first account number and user 2 may log on to a second client installed on the second terminal device 101 based on a second account number. User 1 sends a session synchronization request to server 103 via the first client, the session synchronization request comprising a session timestamp of the first client. After receiving the session synchronization request sent by the first client, the server 103 synchronizes session information of the target group session to the first client if it is determined that the target group session exists in the session of the first client and the session of the target group session is updated.
The method provided by the embodiment of the disclosure can be applied to any communication scene.
For example, in the context of a group activity discussion:
for a group of campaigns, campaign suggestions may be published in the group, such as which campaigns to hold, and whether to attend the campaign may be indicated in the group. In the related art, after a member sends a message in a group campaign, the server may update session information of each member in the group campaign, such as a latest time stamp of a group session, a maximum message identifier of the group session, and the number of unread messages in the group session. For example, there are 1000 members in a group campaign, and the server needs to update the session information for these 1000 members as each message is sent out. If the messages are frequently sent in a group, for example, 100 messages are sent in a short time, 100×1000 session information needs to be updated. Therefore, in the related art, as long as there is a message to be sent in the group, session information of each user in the group needs to be updated, which results in serious write spreading, and if the number of users in the chat group is large, a large pressure is brought to the server, which affects the performance of the server.
If the session processing method provided by the embodiment of the disclosure is adopted, after receiving the session synchronization request sent by the client, if the client is judged to have the target group session and the session of the target group session is updated, the session information of the target group session is synchronized to the client, and the session information of each user in the target group is updated without message sending in the group, so that the problems of serious write-out and high server pressure in the related art are solved, the server pressure is reduced, and the server performance is improved.
It should be noted that, in the embodiment of the present disclosure, only the scenario discussed in the group construction activity is taken as an example to describe the communication scenario, and the embodiment of the present disclosure does not limit the communication scenario.
Fig. 2 is a flow chart of a session processing method according to an exemplary embodiment, and referring to fig. 2, the method is applied to a server, and includes the following steps:
step S201: and receiving a session synchronization request sent by the client, wherein the session synchronization request comprises a session timestamp of the client.
The client may be an application running on the terminal device. In the embodiment of the disclosure, the client may provide a single chat and group chat function for an application program with an instant messaging function, where the single chat is a one-to-one chat mode and the group chat is a multi-person chat mode. The server is a server that provides services for clients. The user can log in the client installed on the terminal device by using the account number, and the service provided by the server is used by the client.
The session synchronization request is a request from a server to synchronize session information. The session synchronization request includes a session timestamp of the client, that is, a sending time of a last session message in each session locally stored by the client and related to the client.
Step S202: if the session of the client has the target group session, the session information of the target group session is acquired, wherein the session information of the target group session comprises a group session time stamp of the target group, and the group session time stamp indicates the sending time of the last session message in the target group session.
The target group may be understood as a group with a number of group members greater than a preset number, which is also called an oversized group. After receiving the session synchronization request sent by the client, the server can determine whether the session of the client stores the target group session, i.e. whether the group in which the user logged into the client participates has an oversized group. For example, the preset number is 100, and the number of group members of the group campaign is greater than 100, so the group campaign is the target group. User 1 is a group member of the group building activity group, and user 1 logs in to a first client installed on the first terminal device 101 based on a first account, and the first client sends a session synchronization request to the server, so that the server can determine that a target group session exists in a session of the first client.
After determining that the session of the client stores the target group session, the server may acquire stored session information of the target group session. The session information of the target group session includes a group session time stamp of the target group, that is, a sending time of the last session message in the target group session.
Step S203: if the group session time stamp is greater than the local session time stamp of the target group session, synchronizing the session information of the target group session to the client.
The session time stamp of the client, that is, the transmission time of the last session message of each session stored by the client, is obtained through step S201. If the session of the client has the target group session, the session entry stored by the client includes the target group session, so the session timestamp of the client includes the local session timestamp of the target group session, that is, the sending time of the last session message in the target group session stored by the client.
In step S203, the server determines whether the group session timestamp of the target group session is greater than the local session timestamp of the target group session, that is, the server determines whether the sending time of the last session message in the target group session stored in the server is greater than the sending time of the last session message in the target group session stored in the client. If the session information is larger than the target group session, the server can synchronize the session information of the target group session to the client.
According to the session processing method provided by the embodiment of the disclosure, after receiving a session synchronization request sent by a client, if it is determined that a target group session exists in a session of the client, and it is determined that a group session time stamp of the target group session is greater than a local session time stamp of the target group session, that is, for the client, a session in the target group is updated, session information of the target group session is synchronized to the client. Therefore, the session information of each user in the target group is updated without new session information in the group, the problems of serious write-out and high server pressure in the related technology are solved, the server pressure is reduced, and the server performance is improved.
In some embodiments of the present disclosure, the session information of the target group session may further include a group session message sequence number indicating a message sequence number of a last session message in the target group session. In the embodiment of the disclosure, the message sequence number of the session message may be set according to an increasing sequence, where the group session message sequence number refers to the message sequence number of the last session message in the target group session. It can be seen that the sequence number of the last session message in the target group session is the largest, so the group session message sequence number may also be the largest message sequence number in the target group session.
In the embodiment of the disclosure, the session information of the target group session includes a group session message sequence number, and the number of the messages of the target group session can be directly determined through the group session message, so that the number of the messages in the target group session can be counted conveniently.
In some embodiments of the present disclosure, the session processing method may further include writing session information of the target group session. Fig. 3 is a schematic diagram illustrating a session information writing procedure of a target group session according to an exemplary embodiment. As shown in fig. 3, the session information writing process of the target group session may include:
step S301, after a session message is sent in a target group, storing the session message;
Step S302, updating the sending time of the session message as a group session time stamp;
step S303, according to the increasing sequence, determining the message sequence number of the session message in the target group session, and updating the group session message sequence number to be the message sequence number of the session message in the target group session.
For the target group session, a mode of writing session information singly is adopted. Specifically, if the client included in the target group session sends a session message in the target group, the server maintains a session information GroupSessionItem of the target group session, and its fields include: group session timestamp, i.e. the sending time of the last session message in the target group session; group session message sequence number seqIdMax, i.e., the session message sequence number of the last session message in the target group session.
According to the session processing method, the session information of the target group session is written in a single writing mode, namely after the session information is sent in the target group, the server maintains the session information of the target group session, and the session information of each user in the target group does not need to be updated, so that write diffusion can be avoided, and the cost of updating the session information by the server is reduced.
In some embodiments of the present disclosure, synchronizing session information of a target group session to a client may include: and updating the session list of the client according to the session information of the target group session, and synchronizing the updated session list of the client to the client.
The server may maintain a session list for the client that includes session information for each session corresponding to the client, which may include a session timestamp and a session message sequence number. The session time stamp is the sending time of the last session message in the session, and the session message sequence number is the message sequence number of the last session message in the session. The respective sessions corresponding to the clients may include single chat sessions, non-target group sessions, and target group sessions. The single chat session corresponding to the client is a session in which the client chat one to one with other clients, the non-target group session corresponding to the client is a session of a non-target group (group with the number of group members being less than or equal to the preset number) in which the client participates, and the target group session corresponding to the client is a session of a target group (group with the number of group members being greater than the preset number, namely, an oversized group) in which the client participates.
For single chat sessions and non-target group sessions, the server may update session information in the client's session list if there is a new session message in the session. For example, the session corresponding to the first client includes a single chat session with the second client, and the session list L1 of the first client maintained by the server includes a single chat session C1 between the first client and the second client, and after the second client sends a session message to the first client, the server updates session information of the single chat session C1 in the session list L1 of the first client. For another example, if the group member of the non-target group includes a first client, a second client and a third client, the session list L1 of the first client, the session list L2 of the second client and the session list L3 of the third client maintained by the server all include session information of the group chat session D1 of the non-target group. After the third client sends the session message in the non-target group, the server updates the session information of the group chat session D1 of the non-target group in L1, L2 and L3.
For the target group session, after the client sends a session synchronization request to the server, the server determines that the session of the first client segment has the target group session, and the server determines that the group session timestamp of the target group session is greater than the local session timestamp of the target group session, then the server may update the session list of the client according to the session information of the target group, and then synchronize the updated session list to the client. For example, the group members of the target group include a first client, a second client, and other 998 clients. The session list L1 of the first client maintained by the server includes session information of the group chat session D2 of the target group. After the second client sends the session message in the target group, the server does not directly update the session information of the group chat session D2 of the target group in L1. After the first client sends a session synchronization request to the server, the server determines that the first client has the target group session and that the target group session is updated (the second client sends a session message in the target group), in which case the server updates the session information of the group chat session D2 of the target group in L1.
According to the session processing method provided by the embodiment of the disclosure, for the single chat session and the non-target group session corresponding to the client, if a new session message exists in the session, the server can directly update the session information of the session in the session list of the client; for a target group session corresponding to the client, if a new session message exists in the session, the server does not directly update the session list of the client, but after receiving the session synchronization request of the first client section, the server determines that the target group session exists in the client and updates the session information of the target group session in the session list of the client. Therefore, the problems of serious write diffusion and large server pressure in the related technology can be solved, the server pressure is reduced, and the server performance is improved.
In some embodiments of the present disclosure, the session processing method may further include: acquiring a target session message of a target group session according to the group session time stamp and the local session time stamp; the target session message is synchronized to the client.
The server may synchronize the target session message of the target group session to the client in addition to synchronizing the session information of the target group session to the client. The target session message is a session message newly added in the target group session between the local session timestamp of the target group session and the group session timestamp. The above has already described that the local session timestamp of the target group session is the sending time of the last session message in the target group session stored by the client, that is, the sending time of the last session message in the target group session acquired by the client. The group session time stamp of the target group session is the sending time of the last session message in the target group session, namely the sending time of the last session message in the target group session. If the group session time stamp is greater than the local session time stamp, it indicates that there is a new session message in the target group session, in which case the new session message may be obtained according to the time stamp difference and then synchronized to the client.
In some embodiments of the present disclosure, if the session of the client has a target group session, the session synchronization request includes a read message sequence number of the target group session. The read message sequence number of the target group session refers to the message sequence number of the target group session that the client has read. Further, the session processing method may further include: and determining the number of the unread messages of the target group session according to the group session message sequence number and the read message sequence number, and synchronizing the number of the unread messages of the target group session to the client.
The group session message sequence number refers to the message sequence number of the last session message in the target group session, and the read message sequence number refers to the message sequence number of the target group session that the client has read. The number of the session messages of the target group session which is not read by the client can be obtained by subtracting the read message sequence number from the group session message sequence number, and the number is synchronized to the client. Thus, the client can intuitively display the unread message quantity of the target group session to the user.
Fig. 4 is a flowchart illustrating a session processing method according to still another exemplary embodiment. As shown in fig. 4, the session processing method may include the steps of:
step S401, receiving a session synchronization request sent by a client.
Wherein the session synchronization request includes a transmission time of a last session message of each session (session corresponding to the client) stored by the client, and a read message sequence number of each session.
Step S402, if it is determined that the session of the client has the target group session, session information of the target group session is obtained.
The session information of the target group session comprises a group session time stamp and a group session message sequence number. The group session time stamp indicates the sending time of the last session message in the target group session, and the group session message sequence number indicates the message sequence number of the last session message in the target group session, i.e. the maximum message sequence number in the target group session.
Step S403, if the group session timestamp of the target group session is greater than the local session timestamp of the target group session stored in the client, acquiring the session information of the target group session, and synchronizing the session information of the target group session to the client.
It should be noted that, if the session of the client exists in the target group session, the session synchronization request sent by the client includes a local session timestamp of the target group session and a read message sequence number of the target group session.
In step S404, if the group session timestamp of the target group session is greater than the local session timestamp of the target group session stored in the client, the session list of the client may be updated according to the session information of the target group session, and the updated session list of the client may be synchronized to the client.
Step S404, the newly added session message in the target group session between the group session time stamp and the local session time stamp is obtained, and the obtained session message is synchronized to the client.
Step S405, calculating the difference between the group session message sequence number of the target group session and the read message sequence number of the target group session, determining the difference as the unread message number of the target group session, and synchronizing the unread message number to the client.
The session processing method shown in step S401 to step S405 explains in detail the process that after the server receives the session synchronization request sent by the client, if the server determines that the client has the target group session and the session message of the target group session is changed, the server synchronizes the session information of the target group session of the client, the changed session message, and the number of unread session messages to the client.
According to the session processing method provided by the embodiment of the disclosure, after receiving a session synchronization request sent by a client, a server judges whether a session of the client stores a target group session. If so, judging whether the target group session is updated according to the group session time stamp of the target group session and the local session time stamp of the target group session. If the session is updated, the group session time stamp and the group session message sequence number of the target group session are sent to the client so that the client can update the local session information stored by the client. And, the server may synchronize the update session message of the target group session to the client so that the client may obtain the session message. And the server can obtain the unread message number of the target group session according to the group session message sequence number of the target group session and the read message sequence number of the target group session, and synchronize the unread message number to the client so that the client can clearly determine the specific unread message number.
Fig. 5 is a block diagram of a session processing apparatus according to an exemplary embodiment. Referring to fig. 5, the session processing apparatus 500 includes: a request receiving module 510, a session information acquiring module 520, and a session information transmitting module 530.
Wherein, request receiving module 510 is configured to: receiving a session synchronization request sent by a client, wherein the session synchronization request comprises a session timestamp of the client; the session information acquisition module 520 is configured to: if the session of the client has the target group session, acquiring the session information of the target group session, wherein the session information of the target group session comprises a group session time stamp, and the group session time stamp indicates the sending time of the last session message in the target group session; the session information sending module 530 is configured to: if the group session time stamp is greater than the local session time stamp of the target group session, synchronizing the session information of the target group session to the client, wherein the session time stamp of the client comprises the local session time stamp of the target group session.
In some embodiments of the present disclosure, the session information acquisition module 520 is further configured to: acquiring a target session message of a target group session according to the group session time stamp and the local session time stamp, wherein the target session message is a newly added session message in the target group session between the local session time stamp and the group session time stamp; and, the session information sending module 530 is further configured to: the target session message is synchronized to the client.
In some embodiments of the present disclosure, the session information of the target group session further includes a group session message sequence number, the group session message sequence number indicating a message sequence number of a last session message in the target group session.
In some embodiments of the present disclosure, if the session of the client has a target group session, the session synchronization request includes a read message sequence number of the target group session. The session information obtaining module 520 is further configured to: determining the number of unread messages of the target group session according to the group session message sequence number and the read message sequence number; and, the session information sending module 530 is further configured to: the number of unread messages for the target group session is synchronized to the client.
In some embodiments of the present disclosure, the session processing apparatus 500 further includes a session information storage module 540 for: if the session message is sent in the target group session, the group session time stamp and the group session message sequence number are updated.
In some embodiments of the present disclosure, the session information storage module 540 is further configured to: updating the sending time of the session message to be a group session time stamp; determining the message sequence number of the session message in the target group session according to the increment sequence; the updated group session message sequence number is the message sequence number of the session message in the target group session.
In some embodiments of the present disclosure, the session information sending module 530 is further configured to: and updating the session list of the client according to the session information of the target group session, and synchronizing the updated session list of the client to the client.
The specific manner in which the various modules perform the operations in the apparatus of the above embodiments have been described in detail in connection with the embodiments of the method, and will not be described in detail herein.
Fig. 6 is a block diagram of a session processing device according to an exemplary embodiment. It should be noted that the illustrated electronic device is only an example, and should not impose any limitation on the functions and application scope of the embodiments of the present invention.
An electronic device 600 according to this embodiment of the invention is described below with reference to fig. 6. The electronic device 600 shown in fig. 6 is merely an example, and should not be construed as limiting the functionality and scope of use of embodiments of the present invention.
As shown in fig. 6, the electronic device 600 is in the form of a general purpose computing device. Components of electronic device 600 may include, but are not limited to: the at least one processing unit 610, the at least one memory unit 620, and a bus 630 that connects the various system components, including the memory unit 620 and the processing unit 610.
Wherein the storage unit stores program code that is executable by the processing unit 610 such that the processing unit 610 performs steps according to various exemplary embodiments of the present invention described in the above-described "exemplary methods" section of the present specification. For example, the processing unit 610 may perform step S201 shown in fig. 2, and receive a session synchronization request sent by a client, where the session synchronization request includes a session timestamp of the client; step S202, if the session of the client has a target group session, acquiring the session information of the target group session, wherein the session information of the target group session comprises a group session time stamp of the target group, and the group session time stamp indicates the sending time of the last session message in the target group session; in step S203, if the group session timestamp is greater than the local session timestamp of the target group session, the session information of the target group session is synchronized to the client, and the session timestamp of the client includes the local session timestamp of the target group session.
The storage unit 620 may include readable media in the form of volatile storage units, such as Random Access Memory (RAM) 6201 and/or cache memory unit 6202, and may further include Read Only Memory (ROM) 6203.
The storage unit 620 may also include a program/utility 6204 having a set (at least one) of program modules 6205, such program modules 6205 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each or some combination of which may include an implementation of a network environment.
Bus 630 may be a local bus representing one or more of several types of bus structures including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or using any of a variety of bus architectures.
The electronic device 600 may also communicate with one or more external devices 660 (e.g., keyboard, pointing device, bluetooth device, etc.), one or more devices that enable a user to interact with the electronic device 600, and/or any device (e.g., router, modem, etc.) that enables the electronic device 600 to communicate with one or more other computing devices. Such communication may occur through an input/output (I/O) interface 650. Also, the electronic device 600 may communicate with one or more networks such as a Local Area Network (LAN), a Wide Area Network (WAN) and/or a public network, such as the Internet, through the network adapter 640. As shown, the network adapter 640 communicates with other modules of the electronic device 600 over the bus 630. It should be appreciated that although not shown, other hardware and/or software modules may be used in connection with electronic device 600, including, but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, data backup storage systems, and the like.
In an exemplary embodiment of the present disclosure, a computer-readable storage medium having stored thereon a program product capable of implementing the method described above in the present specification is also provided. In some possible embodiments, the various aspects of the invention may also be implemented in the form of a program product comprising program code for causing a terminal device to carry out the steps according to the various exemplary embodiments of the invention as described in the "exemplary methods" section of this specification, when said program product is run on the terminal device.
A program product for implementing the above-described method according to an embodiment of the present invention may employ a portable compact disc read-only memory (CD-ROM) and include program code, and may be run on a terminal device such as a personal computer. However, the program product of the present invention is not limited thereto, and in this document, a readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium can be, for example, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium would include the following: an electrical connection having one or more wires, a portable disk, a hard disk, random Access Memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The computer readable signal medium may include a data signal propagated in baseband or as part of a carrier wave with readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A readable signal medium may also be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Program code for carrying out operations of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C++ or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device, partly on a remote computing device, or entirely on the remote computing device or server. In the case of remote computing devices, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., connected via the Internet using an Internet service provider).
It should be noted that although in the above detailed description several modules or units of a device for action execution are mentioned, such a division is not mandatory. Indeed, the features and functionality of two or more modules or units described above may be embodied in one module or unit in accordance with embodiments of the present disclosure. Conversely, the features and functions of one module or unit described above may be further divided into a plurality of modules or units to be embodied.
Furthermore, although the steps of the methods in the present disclosure are depicted in a particular order in the drawings, this does not require or imply that the steps must be performed in that particular order or that all illustrated steps be performed in order to achieve desirable results. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step to perform, and/or one step decomposed into multiple steps to perform, etc.
From the above description of embodiments, those skilled in the art will readily appreciate that the example embodiments described herein may be implemented in software, or may be implemented in software in combination with the necessary hardware. Thus, the technical solution according to the embodiments of the present disclosure may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (may be a CD-ROM, a U-disk, a mobile hard disk, etc.) or on a network, including several instructions to cause a computing device (may be a personal computer, a server, a mobile terminal, or a network device, etc.) to perform the method according to the embodiments of the present disclosure.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any adaptations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It is to be understood that the present disclosure is not limited to the precise arrangements and instrumentalities shown in the drawings, and that various modifications and changes may be effected without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (10)

1. A session processing method, comprising:
receiving a session synchronization request sent by a client, wherein the session synchronization request comprises a session time stamp of the client;
if the session of the client has a target group session, acquiring session information of the target group session, wherein the session information of the target group session comprises a group session time stamp, and the group session time stamp indicates the sending time of the last session message in the target group session;
And if the group session time stamp is greater than the local session time stamp of the target group session, synchronizing the session information of the target group session to the client, wherein the session time stamp of the client comprises the local session time stamp of the target group session.
2. The method according to claim 1, wherein the method further comprises:
acquiring a target session message of the target group session according to the group session time stamp and the local session time stamp, wherein the target session message is a session message newly added in the target group session between the local session time stamp and the group session time stamp;
synchronizing the target session message to the client.
3. The method of claim 1, wherein the session information for the target group session further comprises a group session message sequence number indicating a message sequence number of a last session message in the target group session.
4. The method of claim 3, wherein if the target group session exists for the client's session, the session synchronization request includes a read message sequence number for the target group session;
Wherein the method further comprises:
and determining the number of the unread messages of the target group session according to the group session message sequence number and the read message sequence number, and synchronizing the number of the unread messages of the target group session to the client.
5. A method according to claim 3, characterized in that the method further comprises:
and if the session message is sent in the target group session, updating the group session time stamp and the group session message sequence number.
6. The method of claim 5, wherein the updating the group session timestamp and the group session message sequence number comprises:
updating the sending time of the session message to be the group session time stamp;
determining the message sequence number of the session message in the target group session according to the increment sequence;
and updating the group session message sequence number to the message sequence number of the session message in the target group session.
7. The method of claim 1, wherein synchronizing session information of the target group session to the client comprises:
and updating the session list of the client according to the session information of the target group session, and synchronizing the updated session list of the client to the client.
8. A session processing apparatus, comprising:
the request receiving module is used for receiving a session synchronization request sent by a client, wherein the session synchronization request comprises a session time stamp of the client;
a session information obtaining module, configured to obtain session information of a target group session if a session of the client has the target group session, where the session information of the target group session includes a group session timestamp, and the group session timestamp indicates a sending time of a last session message in the target group session;
and the session information sending module is used for synchronizing the session information of the target group session to the client if the group session time stamp is larger than the local session time stamp of the target group session, wherein the session time stamp of the client comprises the local session time stamp of the target group session.
9. An electronic device, comprising:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the session handling method of any of claims 1 to 7.
10. A computer readable storage medium, which when executed by a processor of an electronic device, causes the electronic device to perform the session processing method according to any of claims 1 to 7.
CN202310020651.6A 2023-01-06 2023-01-06 Session processing method and device, electronic equipment and storage medium Pending CN116032867A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310020651.6A CN116032867A (en) 2023-01-06 2023-01-06 Session processing method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310020651.6A CN116032867A (en) 2023-01-06 2023-01-06 Session processing method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116032867A true CN116032867A (en) 2023-04-28

Family

ID=86070249

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310020651.6A Pending CN116032867A (en) 2023-01-06 2023-01-06 Session processing method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116032867A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116527617A (en) * 2023-06-29 2023-08-01 北京华龙通科技有限公司 Instant messaging method, system, equipment and medium for delay-tolerant and break-tolerant network

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116527617A (en) * 2023-06-29 2023-08-01 北京华龙通科技有限公司 Instant messaging method, system, equipment and medium for delay-tolerant and break-tolerant network
CN116527617B (en) * 2023-06-29 2023-10-03 北京华龙通科技有限公司 Instant messaging method, system, equipment and medium for delay-tolerant and break-tolerant network

Similar Documents

Publication Publication Date Title
CN110113407B (en) Applet state synchronization method, apparatus and computer storage medium
CN112860451A (en) Multi-tenant data processing method and device based on SaaS
CN110909521B (en) Online document information synchronous processing method and device and electronic equipment
CN109245908B (en) Method and device for switching master cluster and slave cluster
CN116032867A (en) Session processing method and device, electronic equipment and storage medium
CN111259022A (en) Information synchronization method, synchronization system, computer equipment and medium
CN111290861B (en) Message processing method and device and electronic equipment
CN113821352A (en) Remote service calling method and device
CN112069137A (en) Method and device for generating information, electronic equipment and computer readable storage medium
CN115629909A (en) Service data processing method and device, electronic equipment and storage medium
CN114513552B (en) Data processing method, device, equipment and storage medium
US11277300B2 (en) Method and apparatus for outputting information
CN110661857B (en) Data synchronization method and device
CN115373831A (en) Data processing method, device and computer readable storage medium
CN112612806A (en) House resource information processing method and device, electronic equipment and computer readable medium
CN108471375B (en) Message processing method, device and terminal
CN113766437B (en) Short message sending method and device
US10516767B2 (en) Unifying realtime and static data for presenting over a web service
CN114978786B (en) Method and device for converting third party interface into system standard interface
CN115086408B (en) Data processing method, system, device, electronic equipment and storage medium
CN112669015B (en) Power dispatching micro-service construction system and method
US11842077B2 (en) Method, device, and computer program product for transmitting data for object storage
CN114615025B (en) Key synchronization processing method and device
US11743218B2 (en) Message capture in a multi channel communication environment
CN108712476B (en) Method and system for updating data based on push technology

Legal Events

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