CN113098781B - Session list processing method, device, server and storage medium - Google Patents

Session list processing method, device, server and storage medium Download PDF

Info

Publication number
CN113098781B
CN113098781B CN202110296070.6A CN202110296070A CN113098781B CN 113098781 B CN113098781 B CN 113098781B CN 202110296070 A CN202110296070 A CN 202110296070A CN 113098781 B CN113098781 B CN 113098781B
Authority
CN
China
Prior art keywords
session
list
account
message
client
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.)
Active
Application number
CN202110296070.6A
Other languages
Chinese (zh)
Other versions
CN113098781A (en
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 CN202110296070.6A priority Critical patent/CN113098781B/en
Publication of CN113098781A publication Critical patent/CN113098781A/en
Application granted granted Critical
Publication of CN113098781B publication Critical patent/CN113098781B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/29Flow control; Congestion control using a combination of thresholds
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/32Flow control; Congestion control by discarding or delaying data units, e.g. packets or frames

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer And Data Communications (AREA)

Abstract

The disclosure relates to a session list processing method, a session list processing device, a server and a storage medium, and belongs to the technical field of internet. The session list processing method comprises the following steps: determining the number of session entries in a session list corresponding to an account logged in by a client, wherein the session entries are message records corresponding to session messages, and the session messages are messages sent to the client; in response to the number of session entries being greater than a first threshold, generating a session squeeze event for the session list that includes the account number; acquiring a session list corresponding to the account; according to the session extrusion event, the first number of session entries are deleted from the session list, so that the phenomenon that the server load is high due to too many session entries in some session lists is avoided, and the stability of the server is improved.

Description

Session list processing method, device, server and storage medium
Technical Field
The present disclosure relates to the field of internet technologies, and in particular, to a method and an apparatus for processing a session list, a server, and a storage medium.
Background
With the continuous development of internet technology, more and more clients are configured with session functions, and communication among different users can be realized. And the client also displays a session list for the user so that the user can know the session condition with other users.
In the related art, a server locally stores a session list of a user, where the session list includes a plurality of session entries, and each session entry is used to store information corresponding to a session message sent by another user to the user. Each time the server receives a session message sent to the user, the server updates the user's session list.
However, if a plurality of users send session messages to the users, the number of session entries in the session list is huge, which causes a high load on the server and a reduction in stability.
Disclosure of Invention
The disclosure provides a session list processing method, a session list processing device, a server and a storage medium, which reduce the load of the server and ensure the stability of the server.
According to an aspect of the embodiments of the present disclosure, there is provided a session list processing method applied to a server, the session list processing method including:
determining the number of session entries in a session list corresponding to an account logged in by a client, wherein the session entries are message records corresponding to session messages, and the session messages are messages sent to the client;
in response to the number of session entries being greater than a first threshold, generating a session extrusion event for the session list that includes the account number;
acquiring a session list corresponding to the account;
deleting a first number of session entries from the session list based on the session squeeze event.
The session list processing method provided by the embodiment of the disclosure is a method capable of controlling the number of session entries in a session list, a server monitors the number of session entries in a stored session list, and when too many session entries are in a certain session list, a session extrusion event corresponding to the session list is generated, so that a certain number of session entries in the session list are deleted, the number of session entries in the session list stored by the server is controlled, the phenomenon that the load of the server is excessively high due to too many session entries in some session lists is avoided, and the stability of the server is improved.
In some embodiments, each of the session entries includes a timestamp indicating a sending time of a last session message between the client and a corresponding sender client, the plurality of session entries in the session list are arranged in order according to the timestamp, and deleting a first number of session entries from the session list according to the session extrusion event includes:
and deleting the first number of session entries according to the session extrusion events and the sequence of the plurality of session entries, starting from the session entry with the earliest time stamp.
Since the user rarely flips to the particularly lower session entries in the session list, the impact on the end user viewing the session is reduced by deleting session entries with earlier timestamps in the session list.
In some embodiments, after the generating a session extrusion event containing the account number for the session list in response to the number of session entries being greater than the first threshold, the session list processing method further includes:
updating the session list in response to receiving a session message sent to the client;
after the session list is updated, the number of the session entries in the updated session list is determined again;
in response to the number of session entries in the updated session list being greater than the first threshold, continuing to generate another session extrusion event including the account number for the updated session list;
deleting a first number of session entries from the session list according to the session extrusion event, including:
and in response to the number of session extrusion events comprising the account reaching a second threshold, deleting the first number of session entries from a session list corresponding to the account.
The embodiment of the disclosure further provides a method for aggregating session extrusion events, which triggers a process of deleting session entries in a session list only after the session extrusion events are accumulated to a second threshold, so as to avoid the waste of server resources caused by executing a process of deleting session entries in the session list for multiple times when a large number of session extrusion events are generated due to the fact that a large number of session messages sent by other users are received in a short time.
In some embodiments, the deleting the first number of session entries from the session list corresponding to the account in response to the session extrusion event including the account satisfying an extrusion condition includes:
and in response to that the time-to-live duration of the first generated session extrusion event in the session extrusion events containing the account reaches a first time length, deleting the first number of session entries from the session list corresponding to the account.
The embodiment of the disclosure further provides another method for aggregating session extrusion events, and only after the lifetime of the first session extrusion event product containing the account reaches the first duration, the method triggers the process of deleting the session entries in the session list of the account once, so that the waste of server resources caused by executing the process of deleting the session entries in the session list for many times when a large number of session extrusion events are received in a short time is avoided.
In some embodiments, after the deleting the first number of session entries from the session list according to the session extrusion event, the session list processing method further includes:
deleting the session extrusion event including the account number.
The session extrusion event including the account may be generated within the lifetime of the session extrusion event, and since the number of session entries in the session list of the account is already in a controllable state after the first number of session entries is deleted in the session list of the account, it is not necessary to continue to delete the first number of session entries, the session extrusion event including the account may be completely deleted, and the first number of session entries in the session list may be prevented from being deleted again.
In some embodiments, the server runs a first thread and a second thread;
the first thread is used for determining the number of session entries in a session list corresponding to the account number logged in by the client, and generating a session extrusion event containing the account number for the session list in response to the number of the session entries being greater than the first threshold;
the second thread is configured to delete the first number of session entries from the session list corresponding to the account in response to the time-to-live duration of the first generated session extrusion event in the session extrusion events including the account reaching the first time duration.
Different threads run in the server, different functions are realized through the different threads, so that the functions in the server are not interfered with each other, and the normal operation of the server is ensured.
In some embodiments, before deleting the first number of session entries from the session list according to the session extrusion event, the session list processing method further comprises:
taking the difference between the number of the session entries and a reference number as the first number, wherein the reference number indicates the number of the session entries which need to be reserved after the session entries are deleted from any session list; or,
taking the product of the number of the session entries and a reference ratio as the first number; or,
obtaining the first amount of local storage.
The embodiment of the disclosure also provides various methods for determining the number of the deleted session entries in the session list, and the deletion effect is ensured by determining the number of the deleted session entries and then deleting the session entries in the session list.
In some embodiments, each session entry includes a sender account and a timestamp, the sender account is an account logged in by a sender client that sends a session message to the client, and the timestamp indicates a sending time of a last session message between the client and the sender client;
before determining the number of session entries in a session list corresponding to an account logged in by a client, the session list processing method further includes:
receiving a first session request sent by a first sender client, wherein the first session request comprises a first sender account, the account, a first session message and a first timestamp for logging in the first sender client, and the first timestamp indicates the sending time of the first session message;
if the first sender account is not included in the session list, adding a session entry including the first sender account and the first timestamp in the session list;
if the first sender account is already included in the session list, updating a timestamp in a session entry including the first sender account to the first timestamp.
When the session list is updated, adaptive updating can be performed according to whether the session list comprises the corresponding session entries, so that the updating accuracy is ensured.
In some embodiments, after obtaining the first session request sent by the first sender client, the session list processing method further includes:
correspondingly storing the first session message and the first timestamp into a first message list, wherein the first message list is used for storing the session message sent between the account and the first sender account and the timestamp of the session message.
In the embodiment of the disclosure, the session message is stored in the corresponding message list, so that when the session entry is deleted, the session message is not deleted together, and the client can be ensured to receive the session message smoothly.
In some embodiments, after the storing the first session message and the first timestamp correspondence in a first message list, the session list processing method further includes:
receiving a session list synchronization request sent by the client, wherein the session list synchronization request comprises a reference timestamp and the account, and the reference timestamp is a timestamp of the last session message in a local session list of the client;
determining a target session entry with a timestamp later than the reference timestamp from a session list corresponding to the account based on the reference timestamp;
based on the account number of the sender in the target session entry, acquiring the last session message from a message list corresponding to the account number of the sender;
and sending the target session entry and the acquired session message to the client so that the client adds a session entry comprising a timestamp in the target session entry, the sender account and the acquired session message in a local session list.
In the embodiment of the present disclosure, when the client synchronizes the local session list, data are respectively obtained from the session list and the message list in the server, so that an update effect in the local session list of the client is ensured.
In some embodiments, after sending the target session entry and the obtained session message to the client, the session list processing method further includes:
receiving a session message synchronization request corresponding to a second session entry sent by the client, where the session message synchronization request is sent by the client in response to a viewing operation on the second session entry in the local session list, and the session message synchronization request includes a second timestamp of a previous session message of a last session message in the second session entry and a second sender account;
acquiring other session messages which are later than the second timestamp and timestamps of the acquired session messages from a second message list based on the session message synchronization request, wherein the second message list is used for storing the session messages sent between the account and the second sender account and the timestamps of the session messages;
and sending the acquired session message and the timestamp of the acquired session message to the client, so that the client displays the acquired session message based on the timestamp of the acquired session message.
In the embodiment of the disclosure, when the session list is synchronized, the messages which are not viewed in each session entry are not sent to the client together, but the latest session message is sent first, and when the terminal user views the session entry, other unread messages in the session entry are sent to the client together, so that the pressure of the server on synchronizing data is reduced.
In some embodiments, after adding a session entry including the first sender account and the first timestamp in the session list if the first sender account is not included in the session list, the session list processing method further includes:
sending a push message to the client, where the push message includes the first session message, the first sender account, and the first timestamp, so that the client adds a session entry including the first session message, the first sender account, and the first timestamp in a local session list.
Because the session list corresponding to the account in the server does not include the first sender account, the session list does not include the session entry corresponding to the first sender, and the session list in the client is obtained from the server in a synchronous manner, so that the client does not include the session entry corresponding to the first sender.
According to still another aspect of the embodiments of the present disclosure, there is provided a session list processing apparatus including:
the device comprises a quantity determining unit, a judging unit and a judging unit, wherein the quantity determining unit is configured to execute the step of determining the quantity of session entries in a session list corresponding to an account logged in by a client, the session entries are message records corresponding to session messages, and the session messages are messages sent to the client;
an event generating unit configured to perform generating a session extrusion event containing the account number for the session list in response to the number of the session entries being greater than a first threshold;
the list acquisition unit is configured to acquire a session list corresponding to the account;
an entry deletion unit configured to perform deletion of a first number of session entries from the session list according to the session squeeze event.
In some embodiments, each of the session entries includes a timestamp indicating a sending time of a last session message between the client and a corresponding sender client, and the plurality of session entries in the session list are sequentially arranged according to the timestamps;
the entry deleting unit is configured to delete the first number of session entries according to the session extrusion event, starting from the session entry with the earliest timestamp, in the sequence order of the plurality of session entries.
In some embodiments, the session list processing apparatus further comprises:
a list updating unit configured to perform updating of the session list in response to receiving a session message sent to the client;
the number determining unit is further configured to perform, after updating the session list, reacquire the updated session list, and determine the number of session entries in the updated session list;
the event generating unit is further configured to continue to generate another session extrusion event including the account in response to the number of session entries in the updated session list being greater than the first threshold;
the entry deleting unit is configured to delete the first number of session entries from a session list corresponding to the account in response to the number of session extrusion events including the account reaching a second threshold.
In some embodiments, the entry deleting unit is configured to delete the first number of session entries from the session list corresponding to the account in response to a duration of a first generated session extrusion event in the session extrusion events including the account reaching a first duration.
In some embodiments, the session list processing apparatus further comprises:
an event deletion unit configured to delete a session extrusion event including the account number.
In some embodiments, the number determining unit is configured to perform determining, by a first thread, a number of session entries in a session list corresponding to the account to which the client logs in;
the event generating unit is configured to execute generating a session extrusion event containing the account number for the session list in response to the number of the session entries being greater than the first threshold value through the first thread;
the entry deleting unit is configured to delete the first number of session entries from the session list corresponding to the account in response to the time-to-live duration of the first generated session extrusion event in the session extrusion events including the account reaching the first time duration.
In some embodiments, the entry deletion unit further includes:
a first determining subunit configured to perform, as the first number, a difference between the number of session entries and a reference number indicating the number of session entries that need to be retained after the deletion processing of the session entries in any of the session lists; or,
the first determining subunit is configured to perform multiplication of the number of session entries by a reference ratio as the first number; or,
the first determining subunit is configured to perform obtaining the first amount of local storage.
In some embodiments, each session entry includes a sender account and a timestamp, the sender account is an account logged in by a sender client that sends a session message to the client, and the timestamp indicates a sending time of a last session message between the client and the sender client;
the session list processing apparatus further includes:
a request receiving unit configured to perform receiving a first session request sent by a first sender client, where the first session request includes a first sender account, the account, a first session message, and a first timestamp, where the first sender account, the first session message, and the first timestamp indicate a sending time of the first session message;
a list updating unit configured to add a session entry including the first sender account and the first timestamp in the session list if the first sender account is not included in the session list;
the list updating unit is configured to update a timestamp in a session entry including the first sender account to the first timestamp if the first sender account is already included in the session list.
In some embodiments, the session list processing means further comprises:
a storage unit configured to perform corresponding storage of the first session message and the first timestamp in a first message list, where the first message list is used to store a session message sent between the account and the first sender account and a timestamp of the session message.
In some embodiments, the session list processing means further comprises:
the request receiving unit is configured to execute receiving of a session list synchronization request sent by the client, where the session list synchronization request includes a reference timestamp and the account, and the reference timestamp is a timestamp of a last session message in a session list local to the client;
an entry determining unit configured to perform determining, based on the reference timestamp, a target session entry with a timestamp later than the reference timestamp from a session list corresponding to the account;
a message obtaining unit configured to perform obtaining, based on a sender account in the target session entry, a last session message from a message list corresponding to the account and the sender account;
a sending unit configured to execute sending the target session entry and the obtained session message to the client, so that the client adds a session entry including a timestamp in the target session entry, the sender account, and the obtained session message in a local session list.
In some embodiments, the request receiving unit is further configured to perform receiving a session message synchronization request corresponding to a second session entry sent by the client, where the session message synchronization request is sent by the client in response to a viewing operation on the second session entry in the local session list, and the session message synchronization request includes a second timestamp of a last session message in the second session entry and a second sender account;
the message acquiring unit is further configured to perform, based on the session message synchronization request, acquiring, from a second message list, the session messages that are later than the second timestamp and timestamps of the acquired session messages, except for a last session message, where the second message list is used for storing the session messages sent between the account and the second sender account and the timestamps of the session messages;
the sending unit is further configured to execute sending the acquired session message and the timestamp of the acquired session message to the client, so that the client displays the acquired session message based on the timestamp of the acquired session message.
In some embodiments, the session list processing means further comprises:
a sending unit configured to execute sending a push message to the client, where the push message includes the first session message, the first sender account, and the first timestamp, so that the client adds a session entry including the first session message, the first sender account, and the first timestamp in a local session list.
According to still another aspect of the embodiments of the present disclosure, there is provided a server including:
one or more processors;
volatile or non-volatile memory for storing the one or more processor-executable instructions;
wherein the one or more processors are configured to perform the session list processing method of the above aspect.
According to yet another aspect of the embodiments of the present disclosure, there is provided a non-transitory computer-readable storage medium, wherein instructions of the storage medium, when executed by a processor of a server, enable the server to perform the session list processing method of the above aspect.
According to yet another aspect of the embodiments of the present disclosure, there is provided a computer program product, wherein instructions of the computer program product, when executed by a processor of a server, enable the server to perform the session list processing method of the above aspect.
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 present disclosure and together with the description, serve to explain the principles of the disclosure.
FIG. 1 is a schematic diagram illustrating one implementation environment in accordance with an example embodiment.
Fig. 2 is a flowchart illustrating a session list processing method according to an example embodiment.
Fig. 3 is a flow diagram illustrating a session list processing method in accordance with an exemplary embodiment.
Fig. 4 is a flow diagram illustrating a server processing a session list in accordance with an exemplary embodiment.
Fig. 5 is a block diagram illustrating a session list processing apparatus according to an example embodiment.
Fig. 6 is a block diagram illustrating another session list processing apparatus according to an example embodiment.
Fig. 7 is a block diagram illustrating a terminal according to an example embodiment.
FIG. 8 is a block diagram illustrating a server in accordance with an exemplary embodiment.
Detailed Description
In order to make the technical solutions of the present disclosure better understood, the technical solutions in 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 and claims of the present disclosure and in the description of the above-described figures are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the disclosure described herein are capable of operation in sequences other than those illustrated or otherwise described herein. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the disclosure, as detailed in the appended claims.
As used in this disclosure, the terms "at least one," "a plurality," "each," "any," at least one includes one, two, or more than two, and a plurality includes two or more than two, each referring to each of the corresponding plurality, and any referring to any one of the plurality. For example, the plurality of session entries includes 3 session entries, each of which refers to each of the 3 session entries, and any one of which refers to any one of the 3 session entries, which may be the first one, the second one, or the third one.
It should be noted that the user information (including but not limited to user device information, user personal information, etc.) referred to in the present disclosure is information authorized by the user or sufficiently authorized by each party.
The session list processing method provided by the embodiment of the disclosure is applied to a server, and the server is a server, or a server cluster composed of a plurality of servers, or a cloud computing service center.
FIG. 1 is a schematic illustration of an implementation environment provided in accordance with an example embodiment, the implementation environment comprising: the system comprises a first terminal 101, a second terminal 102 and a server 103, wherein the first terminal 101 and the second terminal 102 are connected with the server 103 through a wireless or wired network.
The first terminal 101 is installed with a first client, the second terminal 102 is installed with a second client, and the server 103 is a server that provides services for the first client and the second client. In some embodiments, the first client and the second client are the same type of client.
The first terminal 101 and the second terminal 102 can implement functions such as data transmission, message interaction, and the like through installed clients. For example, the client installed in the first terminal 101 and the second terminal 102 is a content sharing client having a content sharing function, and of course, the content sharing application may also have other functions, such as a comment function, a shopping function, a navigation function, a game function, and a live broadcast function.
In some embodiments, the first terminal 101 and the second terminal 102 are computers, cell phones, tablet computers, or other terminals. In some embodiments, the server 103 is a background server of a client or a cloud server serving cloud computing, cloud storage, and the like.
The first terminal 101 is configured to log in to a first client based on a first account, and the second terminal 102 is configured to log in to a second client based on a second account. The second terminal 102 sends a session request to the server 103 through the second client, where the session request carries a second account, a first account, a session message, and a timestamp for logging in the second client, where the first account is used to indicate that the session message is sent to the first client logging in the first account, and the timestamp indicates a sending time of the session message. The server 103 updates the session list corresponding to the first account according to the session request, and synchronizes the updated session list to the first client of the first terminal 101.
The method provided by the embodiment of the disclosure can be applied to any communication scene.
For example, the method is applied to a scene that a seller plays order receiving information:
in the live stock selling, after purchasing commodities or other services in the live stock selling room, the audience sends order messages to the anchor, so that order messages sent to the same anchor may be received by hundreds of thousands or more of audiences within one hundred minutes, 10 thousands or more session entries are correspondingly added to the session list of the anchor stored in the server, and if the session list processing method provided by the embodiment of the disclosure is adopted, the number of session entries in the session list in the server can be controlled, the phenomenon that the server load is excessively high due to too many session entries in some session lists is avoided, and the stability of the server is improved.
As another example, the method is applied to a scene that a popular user receives private letters:
the user can send private letters to the concerned user, and some popular users are concerned by a great number of users, so that the popular users may receive the private letters sent by the great number of users, and the number of session entries in the session list of the popular users stored in the server is huge.
It should be noted that, in the embodiment of the present disclosure, the communication scenario is exemplarily illustrated only by taking a scenario in which the order information is received by the vendor and the private letter is received by the popular user as an example, and the communication scenario is not limited in the embodiment of the present disclosure.
Fig. 2 is a flowchart illustrating a session list processing method according to an exemplary embodiment, and referring to fig. 2, the method is applied in a server, and includes the following steps:
201. the server determines the number of session entries in a session list corresponding to an account logged in by the client, wherein the session entries are message records corresponding to session messages, and the session messages are messages sent to the client.
The server is a server providing services for the client, the client in step 201 is any client providing services for the server, the client is installed on the terminal, the terminal user logs in the client through an account, and the service provided by the server is used through the client.
The server stores a session list corresponding to each account of the login client, updates the corresponding session list according to the acquired session request, and synchronizes the updated session list to the corresponding client. For example, when the server acquires a session request sent to an account, the server updates a session list corresponding to the account, and synchronizes the updated session list to the client that logs in the account.
In step 201, the server obtains the session list corresponding to the account from the local storage, and then determines the number of session entries in the session list.
The contents of the session list are explained below:
the session list corresponding to the account includes at least one session entry, the session entry is a message record corresponding to a session message, and the session message is a session message sent to the client. In some embodiments, each session entry includes a sender account that is an account logged in by a sender client that sends a session message to a client, and a timestamp that indicates a sending time of a last session message between the client and the sender client.
Because the session entries in the session list include the sender account and the timestamp, the number of the session entries in the session list is the number of the sender account in the session list, that is, the number of other users who send messages to the user, and if the number of other users who send messages to the user is large, the number of the session entries in the session list corresponding to the account is also large.
202. The server generates a session squeeze event for the session list that includes the account number in response to the number of session entries being greater than a first threshold.
The first threshold is a value stored in the server, for example, the first threshold is any one of 1 ten thousand, 2 ten thousand, 3 ten thousand, and the like. The first threshold may be regarded as a security number threshold of the session entry, and if the number of the session entries in the session list is greater than the first threshold, it indicates that the number of the session entries in the session list is large, which may cause a server load to be high and reduce the stability of the server; if the number of the session entries in the session list is less than or equal to the first threshold, it indicates that the session list does not have a large impact on the load of the server.
Wherein generating a session extrusion event for the session list means: an event is generated that can indicate the extrusion of a session entry in the session list.
203. And the server acquires a session list corresponding to the account.
A session squeeze event is used to delete a certain number of session entries in the session list. If the server generates a session extrusion event containing a certain account, it indicates that the number of session entries in the session list of the account is large, and a certain number of session entries in the session list need to be deleted. Therefore, the server obtains a session list corresponding to the account in the session extrusion event.
204. The server deletes the first number of session entries from the session list based on the session squeeze event.
The first number is any number greater than 0, and the first number may be one number stored in the server or a number calculated in real time. The deleted first number of session entries may be the first number of session entries selected at random, or the first number of session entries screened according to a certain screening rule.
The session list processing method provided by the embodiment of the disclosure is a method capable of controlling the number of session entries in a session list, a server monitors the number of session entries in a stored session list, and when too many session entries are in a certain session list, a session extrusion event corresponding to the session list is generated, so that a certain number of session entries in the session list are deleted, the number of session entries in the session list stored by the server is controlled, the phenomenon that the load of the server is excessively high due to too many session entries in some session lists is avoided, and the stability of the server is improved.
The session list processing method provided by the embodiment of the present disclosure is suitable for processing a session list corresponding to any account stored in a server, and the server may process a session list corresponding to each account stored according to the session list processing method, and a process of processing a session list corresponding to each account stored is exemplarily described below by taking a process of processing a session list corresponding to any account as an example through the embodiment shown in fig. 3.
Fig. 3 is a flowchart illustrating a session list processing method according to an exemplary embodiment, and referring to fig. 3, the method is applied in a server, and includes the following steps:
301. the server receives a session request sent by a sender client, wherein the session request comprises a sender account for logging in the sender client, an account for logging in a client for receiving a session message, the session message and a timestamp, and the timestamp indicates the sending time of the session message.
The client of the sending party is any client, and the client of the sending party is only a role played by the client in a session process of a certain time, for example, a first client sends a session message to a second client, and in the session process of the time, the first client is the client of the sending party, and the second client is the client of a receiving party; in another example, the second client sends the session message to the first client, and then the second client is the sender client and the first client is the receiver client.
The account of the sending party is an account for logging in the client of the sending party, the account in step 301 is an account for logging in the client of the receiving party, the session request indicates that the client of the sending party requests to perform a session with the client, and the account carried by the session request is used for indicating that a session message is sent to the client for logging in the account.
The sending party account and the account are related or not related, and the relationship between the sending party account and the account is not limited in the embodiment of the disclosure. In some embodiments, an association relationship is established between the sender account and the account, e.g., the association relationship is a friend relationship, a focus relationship, or the like. For example, the user sends a private message to the user of interest. In other embodiments, there is no association established between the sending account and the account, e.g., a viewer in a live room sends a message to the anchor.
In some embodiments, after receiving the session request, the server updates the corresponding session list according to the received session request, and the receiving, by the server in step 301, the session request sent by the sender client includes: the server receives a first session request sent by a first sender client, wherein the first session request comprises a sender account, an account, a first session message and a first timestamp, and the first timestamp indicates the sending time of the session message. And, immediately after the server receives the first session request, the server performs the step of updating the session list corresponding to the account, such as performing step 302.
Since in some cases there will be multiple sending clients sending messages to the same client in a short time, the server will update the session list multiple times in a short time, thereby spending more resources on the server. For example, in a live broadcast scene, after a product a is introduced by a main broadcast, 10 ten thousand viewers purchase the product a and send order information to the main broadcast, a server receives session requests carrying the order information sent by 10 ten thousand sender clients to the main broadcast client within a few minutes, and if the server updates a session list corresponding to a main broadcast identifier after receiving a session request, the server needs to update the session list 10 ten thousand times within a few minutes, which causes a large burden to the server.
In other embodiments, to ensure the stability of the server, an embodiment of the present disclosure further provides a processing method of delay + aggregation, where after receiving a session request sent by a client of a sender, the server does not directly update a session list according to the session request, but updates the session list corresponding to an account number at intervals of a second time length according to the received session request for instructing a session with the client.
For example, the server receives a first session request which is sent by a first sender client and used for indicating a session with the client, and adds the first session request to a first task queue; the server receives a second session request which is sent by a second sender client and used for indicating a session with the client, and continuously adds the second session request to the first task queue; after the time length from the last time of updating the session list corresponding to the account reaches a second time length, the server extracts all session requests from the first task queue, and updates the session list corresponding to the account according to the extracted session requests.
302. If the session list corresponding to the account does not include the sender account carried in the session request, the server adds a session entry including the sender account and the timestamp in the session list.
In the embodiment of the present disclosure, the session list stored in the server includes at least one session entry, each session entry is a message record corresponding to a session message, and the session message is a session message sent to the client. In some embodiments, each session entry includes a sender account number corresponding to the session message and a sending time of the session message. The sending account is an account logged in by a sending client side which sends the session message to the client side, and in addition, the session message is the latest session message, so the sending time of the session message is the sending time of the last session message between the sending client side and the client side. As shown in table 1, each session entry includes an account (Uid, user identity) of another User and a Timestamp (Ts, timestamp) indicating a transmission time of a last session message between the User and the another User.
TABLE 1
Figure BDA0002984398450000141
The account included in the session list corresponding to the account represents another user performing a session with the user corresponding to the account, and when the session list is updated according to the session request, two situations are included. In the first case: if the session list corresponding to the account does not include the sender account carried in the session request, adding a corresponding session entry in the session list according to the sender account carried in the session request; in the second case: the session list corresponding to the account already includes the account of the sender carried in the session request, that is, the session list already has a session entry corresponding to the sender, and thus, it is not necessary to add a new session entry in the session list, and it is only necessary to change the timestamp in the session entry corresponding to the sender.
The following steps 302 are explained with the session request as the first session request: if the session list corresponding to the account does not include the first sender account, adding a session entry including the first sender account and the first timestamp in the session list.
It should be noted that, in this step 302, only the account of the sender that is not included in the session request in the session list is used for explanation, but in another embodiment, the account of the sender that is included in the session request is included in the session list, and the session request is taken as the first session request as an example, a process of updating the session list according to the session request is explained: if the session list already includes the first sender account, the timestamp in the session entry including the first sender account is updated to the first timestamp.
It should be noted that, when the session list is updated by using the delay + aggregation method, the server may update the session list according to each received session request. For example, when the server receives a first session request and a second session request, and a session list corresponding to an account does not include a first sending party account and includes a second sending party account, a session entry including the first sending party account and a first timestamp is added to the session list, and a timestamp in the session entry including the second sending party account is modified to a second timestamp.
The second session request comprises a second sending party account number, an account number, a second session message and a second timestamp, wherein the second sending party account number, the second session message and the second timestamp are used for logging in a second sending party client, and the second timestamp indicates the sending time of the second session message.
In some embodiments, the session list stored in the server is an ordered queue, for example, the session list is a Redis-based zset (sorted set) queue, and the zset queue is an ordered set, which can automatically sort the members (session entries) in the queue. And the zset queue automatically orders the session entries by the timestamps in the session entries. Where Redis is a database and zset is the storage type of the Redis database.
After adding a new session entry to the session list, the zset queue will automatically place the session entry at the head of the queue; the zset queue will also automatically place the session entry at the head of the queue after updating the timestamp in the session entry.
303. The server sends a push message to the client, wherein the push message comprises a sending party account number, a session message and a first timestamp, so that the client adds a session entry comprising the sending party account number, the session message and the timestamp in a local session list.
Wherein the push message is used to cause the client to create a corresponding session entry.
Taking the session request as the first session request as an example for explanation, since the session list corresponding to the account in the server does not include the first sender account, the session list does not include the session entry corresponding to the first sender account, and the session list in the client is obtained from the server in a synchronous manner, the client does not include the session entry corresponding to the first sender account, so that the push message is sent to the client, and the client can also add the session entry correspondingly.
In other embodiments, in response to a trigger operation on a session list display interface in a client, a session synchronization request is sent to a server, where the session synchronization request carries an account and a timestamp of a local latest session of the client, and the server obtains, according to the account and the timestamp in the session synchronization request, a session entry updated with the timestamp from a session list corresponding to the account and synchronizes the session entry to the client.
If a plurality of users send session messages to the user of the client in a short time, when the session list in the client is synchronized, the problem of client deadlock is possibly caused due to more content of synchronization.
The session list display interface is used for displaying a session list of the account, and different from the session list stored in the server, the session list may further include a last session message between the target account and the sender account.
It should be noted that, in some embodiments, the session list in the server is stored separately from the session message, and the following takes the first message list as an example to be updated based on the first session request, and an update process of the message list is exemplarily described as follows:
in some embodiments, after the server obtains the first session request sent by the first sender client, the session list processing method further includes: and correspondingly storing the first session message and the first timestamp into a first message list, wherein the first message list is used for storing the session message sent between the account and the first sender account and the timestamp of the session message.
It should be noted that the session message sent between the account and the first sender account may be sent by the account to the first sender account, or may be sent by the first sender account to the account. Therefore, when the session message is stored in the message list, not only the timestamp of the session message but also the sending account and the receiving account of the session message are stored, so that the sending client and the receiving client can both obtain the session message from the message list.
Since the session list and the session message are stored separately in the embodiment of the present disclosure, when the client synchronizes the local session list, data can be further acquired from the session list and the message list in the server, respectively.
The following illustrates the process of the client synchronizing the local session list:
when the client synchronizes the local session list, in order to avoid the problem that the client is stuck due to receiving too much data, the client may synchronize only the session entry and the last session message corresponding to the session entry.
In some embodiments, the server receives a session list synchronization request sent by the client, where the session list synchronization request includes a reference timestamp and the account number, and the reference timestamp is a timestamp of a last session message in a session list local to the client; determining a target session entry with a timestamp later than the reference timestamp from a session list corresponding to the account based on the reference timestamp; based on the account number of the sender in the target session entry, acquiring the last session message from a message list corresponding to the account number of the sender; and sending the target session entry and the acquired session message to the client, so that the client adds the session entry comprising the timestamp in the target session entry, the sender account and the acquired session message in a local session list.
For example, if the timestamp of the last session message in the local session list of the client is 10 o ' clock 35 m/1/5/2020, then the 10 o ' clock 35 m/1/5/10 o ' clock 2020 is taken as a reference timestamp, the session entry of which the timestamp is later than the reference timestamp in the session list corresponding to the account registered by the client is obtained from the server, and the last session message corresponding to the session entry is obtained from the session list according to the timestamp in the session entry, so that after the obtained session entry and the obtained session message are returned to the client, the client can add the corresponding session entry in the local session list or update the corresponding session entry.
Since the client terminal may send a plurality of session messages to the client terminal corresponding to a certain session entry in the session list as far as the last time the session list is synchronized by the client terminal, and only the last session message sent to the client terminal by the sender client terminal is obtained in the process of synchronizing the session list, the embodiment of the present disclosure further provides a method for obtaining a complete session message.
In some embodiments, after sending the target session entry and the obtained session message to the client, the session list processing method further includes: the server receives a session message synchronization request corresponding to a second session entry sent by the client, wherein the session message synchronization request is sent by the client in response to a viewing operation of the second session entry in the local session list, and the session message synchronization request comprises a second timestamp of a last session message in the second session entry and a second sender account; the server acquires other session messages which are later than the second timestamp and timestamps of the acquired session messages from a second message list based on the session message synchronization request, wherein the second message list is used for storing the session messages sent between the account and the second sender account and the timestamps of the session messages; the server sends the obtained session message and the timestamp of the obtained session message to the client, so that the client displays the obtained session message based on the timestamp of the obtained session message.
That is, when a user of the client wants to check a session corresponding to a certain session entry, the client obtains a complete session message from the server, so that the data volume of each time of data synchronization is reduced, and the pressure of the client and the server is reduced.
It should be noted that the step 303 is an optional execution step, and the step 303 is selectively executed or not executed according to actual needs.
304. The server determines the number of session entries in the session list.
In some embodiments, the session list is an ordered queue, and the server determines a number of session entries in the session list, including: and calling a statistical command to determine the current number of the session entries in the session list, wherein the statistical command is used for determining the number of the members in the ordered queue, and the number of the members in the ordered queue is the number of the session entries because the session list is the ordered queue.
For example, the session list is a Redis-based zset queue, the statistic command is a zcard command (a command for statistics), and the zcard command is invoked to determine the current number of session entries in the session list. Where the zcard command is used to calculate the number of members in the zset queue of the ordered set, whereas in the embodiments of the present disclosure, the members in the zset queue are session entries, and thus, the zcard command is used to calculate the number of session entries in the zset queue.
It should be noted that the step 304 is executed after the session list is updated, that is, in response to the completion of the update of the session list of the account, the number of session entries in the updated session list is determined; alternatively, step 304 is executed once every third duration, and the execution condition of step 304 is not limited by the embodiment of the present disclosure. Wherein the third time period is any time period, e.g., 10 seconds, 20 seconds, etc.
The server generally has a plurality of functions, and a plurality of threads are used to execute the functions so as not to interfere with each other. In some embodiments, the server runs a third thread and a first thread, where the third thread is used for the server to obtain a session request sent by a sender client, and update the session list according to the session request; the first thread is used for acquiring the updated session list and determining the number of session entries in the updated session list.
That is, the server updates the session list by one thread and supervises the length of the session list (the number of session entries) by another thread. That is, the server executes two asynchronous events, one asynchronous event is used for updating the session list, and the other asynchronous event is used for judging whether the number of session entries in the session list is larger than the first threshold value after the session list is updated.
305. The server generates a session squeeze event for the session list that includes the account number in response to the number of session entries being greater than the first threshold.
If the number of session entries in any session list is greater than the first threshold, it indicates that the number of session entries in the session list is greater, and the server updates the session list, or the resources consumed for querying data from the session list are greater, which results in greater load and reduced stability of the server.
306. The server adds the generated session extrusion event to the second task queue.
The second task queue is used for storing the session extrusion events generated by the server, and in some embodiments, the second task queue not only includes the session extrusion events, but also includes the generation time or the existence duration of the session extrusion events.
After the server adds the generated session extrusion event to the second task queue, the server may also receive a session request for requesting a session with the client sent by another sender client, and update the session list corresponding to the account according to the session request, after the session list is updated, the server may re-acquire the updated session list, determine the number of session entries in the updated session list, and in response to that the number of session entries in the updated session list is greater than a first threshold, continue to generate another session extrusion event including the account for the updated session list.
That is, after each update to the session list, the number of session entries in the updated session list is determined, and in response to the number of session entries in the updated session list being greater than the first threshold, a session squeeze event is generated for the updated session list that includes the account.
307. And the server acquires a session list corresponding to the account.
In a live broadcast scene, after purchasing commodities, audiences send order information to a main broadcast, if thousands of audiences send order information to the main broadcast at the same time, and the number of session entries in a session list of the main broadcast is greater than a first threshold value, thousands of session extrusion events are generated and added into a second task queue, and if a server executes thousands of times of processing according to the thousands of session extrusion events, server resources are greatly wasted, so that the method for aggregation and delay processing is provided.
Therefore, the session extrusion event in the embodiment of the present disclosure is not processed in real time, and therefore, the session list may have been updated again when the session extrusion event is processed, and the number determined in step 304 may no longer be accurate, so that the session list needs to be obtained again to determine the current number of session entries in the session list.
The method for determining the number of session entries in the session list is the same as the method for determining the number of session entries in the session list in step 304, and is not described in detail here.
308. The server determines a first number, which is the number of deleted session entries in the session list.
The server needs to determine the number of deleted session entries before deleting the session entries in the session list. In some embodiments, the first amount is a fixed value, the first amount may be a value stored locally by the server, and the server determines the first amount, including: the server obtains a first amount of local storage.
In other embodiments, the first number is associated with a current number of the session list. For example, the server stores a reference number indicating the number of session entries that need to be reserved after any session list is subjected to the session entry deletion process, that is, regardless of the number of session entries in the session list, only the reference number of session entries may be reserved in the session list after the session list is processed according to the session extrusion event, and the server determines the first number, including: the server knows the number of session entries and the reference number as the first number.
It should be noted that the reference number is smaller than the first threshold, and there is a certain difference. This can appropriately reduce the deletion processing of the session entry in the session list.
In other embodiments, the server may delete a percentage of the session entries. The server determines a first number comprising: the server takes the first number as the product of the number of session entries and the reference ratio. For example, the reference ratio is 50%, then when the number of session entries in the session list is 10 ten thousand, then the first number is 5 ten thousand.
It should be noted that, in the embodiment of the present disclosure, the manner of determining the first number is only exemplified in the above three manners, and the manner of determining the first number is not limited, and the server may determine the first number in any manner.
309. The server deletes the first number of session entries from the session list based on the session squeeze event.
In some embodiments, the deleted first number of session entries is a first number of session entries randomly chosen from a session list.
The first number of session entries may be session entries with earlier timestamps because the session entries with earlier timestamps may have already been synchronized into the corresponding clients. In some embodiments, the plurality of session entries in the session list are arranged in order according to the timestamp, and the server deletes the first number of session entries from the session list, including: the first number of session entries are deleted in the order of the arrangement of the session entries, starting with the session entry with the earliest timestamp.
It should be noted that even if the session entry with the earlier timestamp is not synchronized to the corresponding client, after the session entry is synchronized to the corresponding client, the session entry is displayed at the end of the session list and can be viewed only by sliding the user to the bottom of the session list, and the user usually does not browse the bottom of the session list for viewing, so deleting the session entry with the earlier timestamp does not affect the viewing of the session list by the user.
In some embodiments, the step of deleting the first number of session entries by the server according to the ranking order of the session entries, starting from the session entry with the earliest timestamp, comprises: deleting the first number of the previous session entries according to the arrangement sequence of the session entries; in some embodiments, the step of deleting the first number of session entries by the server according to the ranking order of the session entries, starting with the session entry with the earliest timestamp, includes: and deleting the first number of session entries according to the arrangement sequence of the session entries.
It should be noted that, if the server executes thousands of times of processing according to the thousands of session extrusion events, server resources are greatly wasted, and therefore, the present disclosure provides a method of aggregation + delay processing, and in some embodiments, the deleting a first number of session entries from the session list according to the session extrusion events includes: and deleting the first number of session entries from a session list corresponding to the account in response to the session extrusion event containing the account satisfying an extrusion condition, wherein the extrusion condition is a condition for executing an operation of deleting session entries according to the generated session extrusion event.
In some embodiments, the delay condition is a quantity delay condition, and after a session extrusion event including the account is generated for the session list in response to the number of the session entries being greater than the first threshold, the session list processing method further includes: updating the session list according to the received session message sent to the client by any sender client; after the session list is updated, the number of the session entries in the updated session list is determined again; and in response to the number of session entries in the updated session list being greater than the first threshold, continuing to generate another session extrusion event including the account number for the updated session list.
Deleting the first number of session entries from the session list corresponding to the account according to the session extrusion event, including: in response to the number of session squeeze events comprising the account number reaching a second threshold, deleting the first number of session entries from the session list corresponding to the account number. That is, as the server continuously receives new session messages, the server continuously updates the session list and generates a plurality of session extrusion events, and in order to avoid performing deletion processing of a session entry for each session extrusion event, in the embodiment of the present disclosure, the session extrusion events are subjected to delayed aggregation processing, and only one session extrusion processing is performed according to the plurality of session extrusion events.
In addition, since the session squeeze events are all stored in the second task queue, the number of generated session squeeze events can be determined based on the second task queue.
In other embodiments, the extrusion condition is a time delay condition, for example, the server deletes the first number of session entries from the session list corresponding to the account according to a session extrusion event, including: and the server responds that the time-to-live duration of the first generated session extrusion event in the session extrusion events containing the account reaches a first time length, and deletes the first number of session entries from the session list corresponding to the account.
The first time period may be any time period, for example, 10 seconds, 30 seconds, and the like.
It should be noted that, in the embodiment of the present disclosure, when a session list corresponding to an account in a session extrusion event is acquired and a first number of session entries are deleted from the session list, the server may have already generated a plurality of session extrusion events including the account, and therefore, after the session list corresponding to the account in the session extrusion event is acquired and the first number of session entries are deleted from the session list, the session extrusion event including the account needs to be deleted, so that the server is prevented from repeatedly executing an operation of deleting the session entries in the session list corresponding to the account according to other session extrusion events including the account.
In some embodiments, the session list is an ordered queue, and removing a first number of session entries from the session list comprises: a delete command is invoked to delete the first number of session entries from the session list, the delete command for deleting members in the ordered queue. The session entries are members in the session list, and the session list is an ordered queue, so the delete command is used to delete the session entries in the session list.
For example, the session list is a zset queue based on Redis, and the delete command is a zrem command.
In some embodiments, the maximum number of session entries that the delete command allows to delete at a time is a second number, and if the first number is greater than the second number, the delete command needs to be invoked multiple times to delete the first number of session entries in the session list. Invoking a delete command to delete the first number of session entries from the session list, comprising: and rounding the ratio of the first quantity to the second quantity, taking the rounded ratio as the reference times of calling the deletion command, calling the deletion command of the reference times, and deleting the first quantity of session entries from the session list.
Wherein, the rounding processing of the ratio is as follows: the integer number of the ratio is added with 1, and the decimal number of the ratio is removed.
For example, if the first number is 24000 and the second number is 5000, the ratio of the first number to the second number is 4.8, rounding the ratio to 5 calls a delete command 5 times, and when the delete command is called from the first time to the fourth time, 5000 session entries are deleted each time, and when the delete command is called 5 times, 4000 session entries are deleted.
In some embodiments, the server further runs a second thread, and the second thread is configured to acquire a session list corresponding to the account in the session extrusion event, and delete the first number of session entries from the acquired session list. In one possible implementation manner, the second thread is configured to, in response to that the lifetime of the session extrusion event reaches a first duration, obtain a session list corresponding to an account in the session extrusion event, and delete a first number of session entries from the obtained session list; or, the second thread is configured to, in response to that the number of the generated session extrusion events reaches a second threshold, obtain a session list corresponding to an account in the session extrusion events, and delete the first number of session entries from the obtained session list.
It should be noted that, the embodiment of the present disclosure only exemplifies the generation of the session extrusion event, and the processing procedure of the session list is exemplarily described, and in another embodiment, the server directly obtains the session list in response to that the number of session entries is greater than the first threshold, and deletes the first number of session entries from the session list without generating the session extrusion event.
The conversation list processing method provided by the embodiment of the disclosure provides a method for controlling the number of conversation entries in a conversation list, when the number of conversation entries in a certain conversation list is too large, the conversation entries with earlier time stamps in the conversation list are deleted, so that the viewing of a user to the conversation list is not influenced, the number of conversation entries in the conversation list stored in a server is also controlled, the phenomenon that the load of the server is excessively high due to too many conversation entries in some conversation lists is avoided, and the stability of the server is improved. And the storage space of the server is saved.
It should be noted that, a plurality of services, for example, a message service, a session update service, a session extrusion service, etc., are provided in the server, and the following describes an exemplary flow of the session list processing method shown in the embodiment of the present disclosure where the plurality of services cooperate with each other in the server through the embodiment shown in fig. 4:
fig. 4 is a flowchart illustrating a server processing a session list according to an exemplary embodiment, where as shown in fig. 4, a message service in the server receives a session request sent by a sending client, adds the session request to a first task queue, and a session update server extracts the session request from the first task queue, updates a corresponding session list, and determines whether the number of session entries in the session list is greater than a first threshold, and generates a session extrusion event to add to a second task queue when the number of session entries is greater than the first threshold; and the session extrusion service carries out aggregation processing on the session extrusion events in the second task queue and triggers a flow for deleting the session entries in the session list at regular time.
Fig. 5 is a block diagram illustrating a session list processing apparatus according to an example embodiment. Referring to fig. 5, the session list processing apparatus includes:
a quantity determining unit 501, configured to perform determining the quantity of session entries in a session list corresponding to an account logged in by a client, where the session entries are message records corresponding to session messages, and the session messages are messages sent to the client;
an event generating unit 502 configured to perform generating a session extrusion event containing the account number for the session list in response to the number of the session entries being greater than a first threshold;
a list acquisition unit 503 configured to perform acquisition of a session list corresponding to the account;
an entry deletion unit 504 configured to perform a deletion of a first number of session entries from the session list according to the session squeeze event.
As shown in fig. 6, in some embodiments, each session entry includes a timestamp indicating a sending time of a last session message between the client and a corresponding sending client, and a plurality of session entries in the session list are sequentially arranged according to the timestamp;
the entry deleting unit 504 is configured to delete the first number of session entries according to the session extrusion event, starting from the session entry with the earliest timestamp in the order of the plurality of session entries.
In some embodiments, the session list processing apparatus further comprises:
a list updating unit 505 configured to perform updating of the session list in response to receiving a session message sent to the client;
the number determining unit 501 is further configured to perform, after updating the session list, acquiring the updated session list again, and determining the number of session entries in the updated session list;
the event generating unit 502 is further configured to execute, in response to the number of session entries in the updated session list being greater than the first threshold, continuing to generate another session extrusion event including the account;
the entry deleting unit 504 is configured to execute, in response to that the number of session extrusion events including the account reaches a second threshold, acquiring a session list corresponding to the account in the session extrusion events.
In some embodiments, the entry deleting unit 504 is configured to delete the first number of session entries from the session list corresponding to the account in response to the lifetime of the first generated session extrusion event in the session extrusion events including the account reaching a first duration.
In some embodiments, the session list processing means further comprises:
an event deletion unit 506 configured to delete the session extrusion event including the account number.
In some embodiments, the number determining unit 501 is configured to perform determining, by a first thread, the number of session entries in a session list corresponding to the account where the client logs in;
the event generating unit 502 is configured to execute generating, by the first thread, a session extrusion event including the account for the session list in response to the number of the session entries being greater than the first threshold;
the entry deleting unit 504 is configured to delete the first number of session entries from the session list corresponding to the account in response to the lifetime of the first generated session extrusion event in the session extrusion events including the account reaching the first duration.
In some embodiments, the entry deleting unit 504 further includes:
a first determination subunit 5041 configured to perform, as the first number, a difference between the number of session entries and a reference number indicating the number of session entries that need to be retained after deletion processing of a session entry has been performed on any of the session lists; or,
the first determining sub-unit 5041, configured to perform multiplying the number of the session entries by a reference ratio as the first number; or,
the first determining subunit 5041 is configured to perform obtaining the first amount of local storage.
In some embodiments, each session entry includes a sender account and a timestamp, the sender account is an account logged in by a sender client that sends a session message to the client, and the timestamp indicates a sending time of a last session message between the client and the sender client;
the session list processing apparatus further includes:
a request receiving unit 507 configured to perform receiving a first session request sent by a first sender client, where the first session request includes a first sender account, the account, a first session message and a first timestamp, where the first sender account, the first session message and the first timestamp are logged in the first sender client, and the first timestamp indicates a sending time of the first session message;
a list updating unit 505 configured to add a session entry including the first sender account and the first timestamp in the session list if the first sender account is not included in the session list;
the list updating unit 505 is configured to update the timestamp in the session entry including the first sender account to the first timestamp if the first sender account is already included in the session list.
In some embodiments, the session list processing means further comprises:
a storage unit 508 configured to perform corresponding storage of the first session message and the first timestamp in a first message list, where the first message list is used for storing a session message sent between the account and the first sender account and a timestamp of the session message.
In some embodiments, the session list processing means further comprises:
the request receiving unit 507 is configured to perform receiving a session list synchronization request sent by the client, where the session list synchronization request includes a reference timestamp and the account number, and the reference timestamp is a timestamp of a last session message in a session list local to the client;
an entry determining unit 509 configured to perform determining, based on the reference timestamp, a target session entry having a timestamp later than the reference timestamp from the session list corresponding to the account;
a message obtaining unit 510, configured to perform obtaining, based on the account of the sending party in the target session entry, a last session message from a message list corresponding to the account of the sending party and the account of the sending party;
a sending unit 511, configured to execute sending the target session entry and the obtained session message to the client, so that the client adds a session entry including the timestamp in the target session entry, the sender account, and the obtained session message in a local session list.
In some embodiments, the request receiving unit 507 is further configured to perform receiving a session message synchronization request corresponding to a second session entry sent by the client, where the session message synchronization request is sent by the client in response to a viewing operation on the second session entry in the local session list, and the session message synchronization request includes a second timestamp of a previous session message of a last session message in the second session entry and a second sending-side account number;
the message acquiring unit 510 is further configured to perform, based on the session message synchronization request, acquiring, from a second message list, a session message that is later than the second timestamp and a timestamp of the acquired session message, except for a last session message, where the second message list is used to store the session message sent between the account and the second sender account and the timestamp of the session message;
the sending unit 511 is further configured to execute sending the obtained session message and the timestamp of the obtained session message to the client, so that the client exposes the obtained session message based on the timestamp of the obtained session message.
In some embodiments, the session list processing means further comprises:
a sending unit 511, configured to perform sending a push message to the client, where the push message includes the first session message, the first sender account, and the first timestamp, so that the client adds a session entry including the first session message, the first sender account, and the first timestamp in a local session list.
With regard to the apparatus in the above-described embodiment, the specific manner in which each unit performs the operation has been described in detail in the embodiment related to the method, and will not be described in detail here.
Fig. 7 is a block diagram illustrating a structure of a terminal 700 according to an example embodiment. The terminal 700 may be a portable mobile terminal such as: a smart phone, a tablet computer, an MP3 player (Moving Picture Experts Group Audio Layer III, motion video Experts compression standard Audio Layer 3), an MP4 player (Moving Picture Experts Group Audio Layer IV, motion video Experts compression standard Audio Layer 4), a notebook computer, or a desktop computer. Terminal 700 may also be referred to by other names such as user equipment, portable terminal, laptop terminal, desktop terminal, and so on.
The terminal 700 includes: a processor 701 and a memory 702.
The processor 701 may include one or more processing cores, such as a 4-core processor, an 8-core processor, and so on. The processor 701 may be implemented in at least one hardware form of a DSP (Digital Signal Processing), an FPGA (Field-Programmable Gate Array), and a PLA (Programmable Logic Array). The processor 701 may also include a main processor and a coprocessor, where the main processor is a processor for Processing data in an awake state, and is also called a Central Processing Unit (CPU); a coprocessor is a low power processor for processing data in a standby state. In some embodiments, the processor 701 may be integrated with a GPU (Graphics Processing Unit) that is responsible for rendering and drawing content that the display screen needs to display. In some embodiments, the processor 701 may further include an AI (Artificial Intelligence) processor for processing computing operations related to machine learning.
Memory 702 may include one or more computer-readable storage media, which may be non-transitory. Memory 702 may also include high-speed random access memory, as well as non-volatile memory, such as one or more magnetic disk storage devices, flash memory storage devices. In some embodiments, a non-transitory computer readable storage medium in the memory 702 is used to store at least one program code for execution by the processor 701 to implement the session list processing method provided by the method embodiments in the present disclosure.
In some embodiments, the terminal 700 may further optionally include: a peripheral interface 703 and at least one peripheral. The processor 701, the memory 702, and the peripheral interface 703 may be connected by buses or signal lines. Various peripheral devices may be connected to the peripheral interface 703 via a bus, signal line, or circuit board. Specifically, the peripheral device includes: at least one of a radio frequency circuit 704, a display screen 705, a camera assembly 706, an audio circuit 707, a positioning component 708, and a power source 709.
The peripheral interface 703 may be used to connect at least one peripheral related to I/O (Input/Output) to the processor 701 and the memory 702. In some embodiments, processor 701, memory 702, and peripheral interface 703 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 701, the memory 702, and the peripheral interface 703 may be implemented on a separate chip or circuit board, which is not limited in this embodiment.
The Radio Frequency circuit 704 is used for receiving and transmitting RF (Radio Frequency) signals, also called electromagnetic signals. The radio frequency circuitry 704 communicates with communication networks and other communication devices via electromagnetic signals. The rf circuit 704 converts an electrical signal into an electromagnetic signal to transmit, or converts a received electromagnetic signal into an electrical signal. Optionally, the radio frequency circuit 704 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a subscriber identity module card, and so forth. The radio frequency circuitry 704 may communicate with other terminals via at least one wireless communication protocol. The wireless communication protocols include, but are not limited to: the world wide web, metropolitan area networks, intranets, generations of mobile communication networks (2G, 3G, 4G, and 5G), wireless local area networks, and/or WiFi (Wireless Fidelity) networks. In some embodiments, the radio frequency circuit 704 may also include NFC (Near Field Communication) related circuits, which are not limited by this disclosure.
The display screen 705 is used to display a UI (User Interface). The UI may include graphics, text, icons, video, and any combination thereof. When the display screen 705 is a touch display screen, the display screen 705 also has the ability to capture touch signals on or over the surface of the display screen 705. The touch signal may be input to the processor 701 as a control signal for processing. At this point, the display screen 705 may also be used to provide virtual buttons and/or a virtual keyboard, also referred to as soft buttons and/or a soft keyboard. In some embodiments, the display 705 may be one, disposed on a front panel of the terminal 700; in other embodiments, the display 705 can be at least two, respectively disposed on different surfaces of the terminal 700 or in a folded design; in other embodiments, the display 705 may be a flexible display disposed on a curved surface or on a folded surface of the terminal 700. Even more, the display 705 may be arranged in a non-rectangular irregular pattern, i.e. a shaped screen. The Display 705 may be made of LCD (Liquid Crystal Display), OLED (Organic Light-Emitting Diode), or the like.
The camera assembly 706 is used to capture images or video. Optionally, camera assembly 706 includes a front camera and a rear camera. The front camera is arranged on the front panel of the terminal, and the rear camera is arranged on the back of the terminal. In some embodiments, the number of the rear cameras is at least two, and each rear camera is any one of a main camera, a depth-of-field camera, a wide-angle camera and a telephoto camera, so that the main camera and the depth-of-field camera are fused to realize a background blurring function, the main camera and the wide-angle camera are fused to realize panoramic shooting and a VR (Virtual Reality) shooting function or other fusion shooting functions. In some embodiments, camera assembly 706 may also include a flash. The flash lamp can be a monochrome temperature flash lamp or a bicolor temperature flash lamp. The double-color-temperature flash lamp is a combination of a warm-light flash lamp and a cold-light flash lamp, and can be used for light compensation at different color temperatures.
The audio circuitry 707 may include a microphone and a speaker. The microphone is used for collecting sound waves of a user and the environment, converting the sound waves into electric signals, and inputting the electric signals to the processor 701 for processing or inputting the electric signals to the radio frequency circuit 704 to realize voice communication. For the purpose of stereo sound collection or noise reduction, a plurality of microphones may be provided at different portions of the terminal 700. The microphone may also be an array microphone or an omni-directional pick-up microphone. The speaker is used to convert electrical signals from the processor 701 or the radio frequency circuit 704 into sound waves. The loudspeaker can be a traditional film loudspeaker or a piezoelectric ceramic loudspeaker. When the speaker is a piezoelectric ceramic speaker, the speaker can be used for purposes such as converting an electric signal into a sound wave audible to a human being, or converting an electric signal into a sound wave inaudible to a human being to measure a distance. In some embodiments, the audio circuitry 707 can also include a headphone jack.
The positioning component 708 is used to locate the current geographic Location of the terminal 700 for navigation or LBS (Location Based Service). The Positioning component 708 can be a Positioning component based on the Global Positioning System (GPS) in the united states, the beidou System in china, or the galileo System in russia.
Power supply 709 is provided to supply power to various components of terminal 700. The power source 709 may be alternating current, direct current, disposable batteries, or rechargeable batteries. When the power source 709 includes a rechargeable battery, the rechargeable battery may be a wired rechargeable battery or a wireless rechargeable battery. The wired rechargeable battery is a battery charged through a wired line, and the wireless rechargeable battery is a battery charged through a wireless coil. The rechargeable battery may also be used to support fast charge technology.
In some embodiments, terminal 700 also includes one or more sensors 710. The one or more sensors 710 include, but are not limited to: acceleration sensor 711, gyro sensor 712, pressure sensor 713, fingerprint sensor 714, optical sensor 715, and proximity sensor 716.
The acceleration sensor 711 can detect the magnitude of acceleration in three coordinate axes of a coordinate system established with the terminal 700. For example, the acceleration sensor 711 may be used to detect components of the gravitational acceleration in three coordinate axes. The processor 701 may control the display screen 705 to display the user interface in a landscape view or a portrait view according to the gravitational acceleration signal collected by the acceleration sensor 711. The acceleration sensor 711 may also be used for acquisition of motion data of a game or a user.
The gyro sensor 712 may detect a body direction and a rotation angle of the terminal 700, and the gyro sensor 712 may cooperate with the acceleration sensor 711 to acquire a 3D motion of the terminal 700 by the user. From the data collected by the gyro sensor 712, the processor 701 may implement the following functions: motion sensing (such as changing the UI according to a user's tilting operation), image stabilization at the time of photographing, game control, and inertial navigation.
Pressure sensors 713 may be disposed on a side frame of terminal 700 and/or underneath display 705. When the pressure sensor 713 is disposed on the side frame of the terminal 700, a user's grip signal on the terminal 700 may be detected, and the processor 701 may perform right-left hand recognition or shortcut operation according to the grip signal collected by the pressure sensor 713. When the pressure sensor 713 is disposed at a lower layer of the display screen 705, the processor 701 controls the operability control on the UI interface according to the pressure operation of the user on the display screen 705. The operability control comprises at least one of a button control, a scroll bar control, an icon control and a menu control.
The fingerprint sensor 714 is used for collecting a fingerprint of the user, and the processor 701 identifies the identity of the user according to the fingerprint collected by the fingerprint sensor 714, or the fingerprint sensor 714 identifies the identity of the user according to the collected fingerprint. When the user identity is identified as a trusted identity, the processor 701 authorizes the user to perform relevant sensitive operations, including unlocking a screen, viewing encrypted information, downloading software, paying, changing settings, and the like. The fingerprint sensor 714 may be disposed on the front, back, or side of the terminal 700. When a physical button or a vendor Logo is provided on the terminal 700, the fingerprint sensor 714 may be integrated with the physical button or the vendor Logo.
The optical sensor 715 is used to collect the ambient light intensity. In one embodiment, processor 701 may control the display brightness of display screen 705 based on the ambient light intensity collected by optical sensor 715. Specifically, when the ambient light intensity is high, the display brightness of the display screen 705 is increased; when the ambient light intensity is low, the display brightness of the display screen 705 is adjusted down. In another embodiment, processor 701 may also dynamically adjust the shooting parameters of camera assembly 706 based on the ambient light intensity collected by optical sensor 715.
A proximity sensor 716, also referred to as a distance sensor, is disposed on a front panel of the terminal 700. The proximity sensor 716 is used to collect a distance between the user and the front surface of the terminal 700. In one embodiment, when the proximity sensor 716 detects that the distance between the user and the front surface of the terminal 700 gradually decreases, the processor 701 controls the display 705 to switch from the bright screen state to the dark screen state; when the proximity sensor 716 detects that the distance between the user and the front surface of the terminal 700 is gradually increased, the processor 701 controls the display 705 to switch from the breath-screen state to the bright-screen state.
Those skilled in the art will appreciate that the configuration shown in fig. 7 is not intended to be limiting of terminal 700 and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components may be used.
Fig. 8 is a schematic structural diagram of a server according to an exemplary embodiment, where the server 800 may generate a relatively large difference due to different configurations or performances, and may include one or more processors (CPUs) 801 and one or more memories 802, where the memory 802 stores at least one program code, and the at least one program code is loaded and executed by the processors 801 to implement the methods provided by the method embodiments. Of course, the server may also have components such as a wired or wireless network interface, a keyboard, and an input/output interface, so as to perform input/output, and the server may also include other components for implementing the functions of the device, which are not described herein again.
The server 800 may be configured to perform the steps performed by the server in the session list processing method described above.
In an exemplary embodiment, there is also provided a non-transitory computer readable storage medium, which when program code in the storage medium is executed by a processor of a server, enables the server to perform the steps performed by the server in the above-described session list processing method. Alternatively, the storage medium may be a non-transitory computer readable storage medium, which may be, for example, a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
In an exemplary embodiment, there is also provided a server, including:
one or more processors;
volatile or non-volatile memory for storing one or more processor-executable instructions;
wherein the one or more processors are configured to perform the steps performed by the server in the above-mentioned session list processing method.
In an exemplary embodiment, there is also provided a computer program product, wherein instructions of the computer program product, when executed by a processor of a server, enable the server to perform the steps performed by the server in the above-mentioned session list processing method.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure herein. This disclosure is intended to cover any variations, 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 will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (22)

1. A session list processing method is applied to a server, and comprises the following steps:
determining the number of session entries in a session list corresponding to an account logged in by a client, wherein the session entries are message records corresponding to session messages, and the session messages are messages sent to the client;
in response to the number of session entries being greater than a first threshold, generating a session squeeze event for the session list that includes the account number;
updating the session list in response to receiving a session message sent to the client;
after the session list is updated, the number of session entries in the updated session list is determined again;
in response to the number of session entries in the updated session list being greater than the first threshold, continuing to generate another session extrusion event including the account number for the updated session list;
acquiring a session list corresponding to the account;
responding to that the session extrusion events containing the account number meet extrusion conditions, calling a deletion command, and deleting a first number of session entries from the session list, wherein the extrusion conditions comprise that the number of the session extrusion events containing the account number reaches a second threshold value, or the time-to-live length of the first generated session extrusion event in the session extrusion events containing the account number reaches a first time length, and the maximum number of the session entries allowed to be deleted by the deletion command at each time is a second number;
when the first number is larger than the second number, rounding the ratio of the first number to the second number, and taking the rounded ratio as the reference number of times for calling the deletion command; and calling the deletion command of the reference times to delete the first number of session entries from the session list.
2. The method according to claim 1, wherein each session entry includes a timestamp indicating a transmission time of a last session message between the client and a corresponding sender client, the plurality of session entries in the session list are sequentially arranged according to the timestamp, and the deleting the first number of session entries from the session list includes:
and deleting the first number of session entries according to the session extrusion events and the sequence of the plurality of session entries, starting from the session entry with the earliest time stamp.
3. The method of claim 1, wherein after removing the first number of session entries from the session list, the method further comprises:
deleting the session extrusion event including the account number.
4. The session list processing method according to claim 1, wherein the server runs a first thread and a second thread;
the first thread is used for determining the number of session entries in a session list corresponding to the account number logged in by the client, and generating a session extrusion event containing the account number for the session list in response to the number of the session entries being greater than the first threshold;
the second thread is configured to delete the first number of session entries from the session list corresponding to the account in response to the time-to-live duration of the first generated session extrusion event in the session extrusion events including the account reaching the first time duration.
5. The method according to claim 1, wherein the method further comprises, before the step of invoking a delete command to delete the first number of session entries from the session list in response to the session extrusion event including the account satisfying an extrusion condition, the method further comprising:
taking the difference between the number of the session entries and a reference number as the first number, wherein the reference number indicates the number of the session entries which need to be reserved after the session entries are deleted from any session list; or,
taking the product of the number of the session entries and a reference ratio as the first number; or,
obtaining the first amount of local storage.
6. The session list processing method according to claim 1, wherein each session entry includes a sender account and a timestamp, the sender account is an account registered by a sender client that sends a session message to the client, and the timestamp indicates a sending time of a last session message between the client and the sender client;
before determining the number of session entries in a session list corresponding to an account logged in by a client, the session list processing method further includes:
receiving a first session request sent by a first sender client, wherein the first session request comprises a first sender account, the account, a first session message and a first timestamp for logging in the first sender client, and the first timestamp indicates the sending time of the first session message;
if the first sender account is not included in the session list, adding a session entry including the first sender account and the first timestamp in the session list;
if the first sender account is already included in the session list, the timestamp in the session entry including the first sender account is updated to the first timestamp.
7. The session list processing method according to claim 6, wherein after receiving the first session request sent by the first sender client, the session list processing method further comprises:
correspondingly storing the first session message and the first timestamp into a first message list, wherein the first message list is used for storing the session message sent between the account and the first sender account and the timestamp of the session message.
8. The method of claim 7, wherein after storing the first session message and the first timestamp correspondence in a first message list, the method further comprises:
receiving a session list synchronization request sent by the client, wherein the session list synchronization request comprises a reference timestamp and the account, and the reference timestamp is a timestamp of the last session message in a session list local to the client;
determining a target session entry with a timestamp later than the reference timestamp from a session list corresponding to the account based on the reference timestamp;
based on the account number of the sender in the target session entry, acquiring the last session message from a message list corresponding to the account number of the sender;
and sending the target session entry and the acquired session message to the client so that the client adds a session entry comprising a timestamp in the target session entry, the sender account and the acquired session message in a local session list.
9. The session list processing method according to claim 8, wherein after sending the target session entry and the obtained session message to the client, the session list processing method further comprises:
receiving a session message synchronization request corresponding to a second session entry sent by the client, where the session message synchronization request is sent by the client in response to a viewing operation on the second session entry in the local session list, and the session message synchronization request includes a second timestamp of a previous session message of a last session message in the second session entry and a second sender account;
acquiring other session messages which are later than the second timestamp and timestamps of the acquired session messages from a second message list based on the session message synchronization request, wherein the second message list is used for storing the session messages sent between the account and the second sender account and the timestamps of the session messages;
and sending the acquired session message and the timestamp of the acquired session message to the client, so that the client displays the acquired session message based on the timestamp of the acquired session message.
10. The method according to claim 6, wherein if the session list does not include the first sender account, after adding a session entry including the first sender account and the first timestamp in the session list, the method further comprises:
sending a push message to the client, where the push message includes the first session message, the first sender account, and the first timestamp, so that the client adds a session entry including the first session message, the first sender account, and the first timestamp in a local session list.
11. A session list processing apparatus applied to a server, the session list processing apparatus comprising:
the number determining unit is configured to determine the number of session entries in a session list corresponding to an account logged in by a client, wherein the session entries are message records corresponding to session messages, and the session messages are messages sent to the client;
an event generating unit configured to perform generating a session extrusion event containing the account number for the session list in response to the number of the session entries being greater than a first threshold;
a list updating unit configured to perform updating of the session list in response to receiving a session message sent to the client;
the number determination unit is further configured to perform re-determining the number of session entries in the updated session list after updating the session list;
the event generating unit is further configured to execute, in response to the number of session entries in the updated session list being greater than the first threshold, continuing to generate another session extrusion event including the account number for the updated session list;
the list acquisition unit is configured to acquire a session list corresponding to the account;
an entry deleting unit, configured to execute, in response to that a session extrusion event including the account satisfies an extrusion condition, invoking a delete command, and deleting a first number of session entries from the session list, where the extrusion condition includes that the number of session extrusion events including the account reaches a second threshold, or a lifetime of a first generated session extrusion event in the session extrusion events including the account reaches a first duration, and a maximum number of session entries that the delete command allows to delete at each time is a second number;
the entry deleting unit is further configured to, when the first number is greater than the second number, round a ratio of the first number to the second number, and use the rounded ratio as a reference number of times for calling the deleting command; and calling the deletion command of the reference times to delete the first number of session entries from the session list.
12. The apparatus according to claim 11, wherein each session entry includes a timestamp indicating a transmission time of a last session message between the client and a corresponding sender client, and a plurality of session entries in the session list are sequentially arranged according to the timestamps;
the entry deleting unit is configured to delete the first number of session entries according to the session extrusion event, starting from the session entry with the earliest timestamp, in the order of the plurality of session entries.
13. The session list processing apparatus according to claim 11, wherein said session list processing apparatus further comprises:
an event deletion unit configured to delete a session extrusion event including the account number.
14. The session list processing apparatus according to claim 11, wherein the number determining unit is configured to perform determining, by a first thread, a number of session entries in a session list corresponding to the account number in which the client logs in;
the event generating unit is configured to execute generating a session extrusion event containing the account number for the session list in response to the number of the session entries being greater than the first threshold value through the first thread;
the entry deleting unit is configured to execute, by a second thread, in response to that the lifetime of a first generated session extrusion event in the session extrusion events including the account reaches the first duration, deleting the first number of session entries from the session list corresponding to the account.
15. The session list processing apparatus according to claim 11, wherein said entry deletion unit further includes:
a first determining subunit configured to perform, as the first number, a difference between the number of session entries and a reference number indicating the number of session entries that need to be retained after the deletion processing of the session entries in any of the session lists; or,
the first determining subunit is configured to perform multiplication of the number of session entries by a reference ratio as the first number; or,
the first determining subunit is configured to perform obtaining the first amount of local storage.
16. The session list processing apparatus according to claim 11, wherein each session entry includes a sender account and a timestamp, the sender account being an account registered by a sender client that sends a session message to the client, and the timestamp indicating a sending time of a last session message between the client and the sender client;
the session list processing apparatus further includes:
a request receiving unit configured to perform receiving a first session request sent by a first sender client, where the first session request includes a first sender account, the account, a first session message, and a first timestamp, where the first sender account, the first session message, and the first timestamp indicate a sending time of the first session message;
a list updating unit configured to add a session entry including the first sender account and the first timestamp in the session list if the first sender account is not included in the session list;
the list updating unit is configured to update a timestamp in a session entry including the first sender account to the first timestamp if the first sender account is already included in the session list.
17. The session list processing apparatus according to claim 16, wherein said session list processing apparatus further comprises:
a storage unit configured to perform corresponding storage of the first session message and the first timestamp in a first message list, where the first message list is used to store a session message sent between the account and the first sender account and a timestamp of the session message.
18. The session list processing apparatus according to claim 17, wherein said session list processing apparatus further comprises:
the request receiving unit is configured to execute receiving of a session list synchronization request sent by the client, where the session list synchronization request includes a reference timestamp and the account, and the reference timestamp is a timestamp of a last session message in a session list local to the client;
an entry determining unit configured to perform determining, based on the reference timestamp, a target session entry with a timestamp later than the reference timestamp from a session list corresponding to the account;
a message obtaining unit configured to perform obtaining, based on a sender account in the target session entry, a last session message from a message list corresponding to the account and the sender account;
a sending unit, configured to execute sending the target session entry and the obtained session message to the client, so that the client adds a session entry including a timestamp in the target session entry, the sender account, and the obtained session message in a local session list.
19. The session list processing apparatus according to claim 18,
the request receiving unit is further configured to execute receiving a session message synchronization request corresponding to a second session entry sent by the client, where the session message synchronization request is sent by the client in response to a viewing operation on the second session entry in the local session list, and the session message synchronization request includes a second timestamp of a last session message in the second session entry and a second sender account;
the message acquiring unit is further configured to perform, based on the session message synchronization request, acquiring, from a second message list, the session messages that are later than the second timestamp and timestamps of the acquired session messages, except for a last session message, where the second message list is used for storing the session messages sent between the account and the second sender account and the timestamps of the session messages;
the sending unit is further configured to execute sending the acquired session message and the timestamp of the acquired session message to the client, so that the client displays the acquired session message based on the timestamp of the acquired session message.
20. The session list processing apparatus according to claim 16, wherein said session list processing apparatus further comprises:
a sending unit configured to execute sending a push message to the client, where the push message includes the first session message, the first sender account, and the first timestamp, so that the client adds a session entry including the first session message, the first sender account, and the first timestamp in a local session list.
21. A server, characterized in that the server comprises:
one or more processors;
volatile or non-volatile memory for storing the one or more processor-executable instructions;
wherein the one or more processors are configured to perform the session list processing method of any one of claim 1 to claim 10.
22. A non-transitory computer-readable storage medium, wherein instructions in the storage medium, when executed by a processor of a server, enable the server to perform the session list processing method of any one of claims 1 to 10.
CN202110296070.6A 2021-03-19 2021-03-19 Session list processing method, device, server and storage medium Active CN113098781B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110296070.6A CN113098781B (en) 2021-03-19 2021-03-19 Session list processing method, device, server and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110296070.6A CN113098781B (en) 2021-03-19 2021-03-19 Session list processing method, device, server and storage medium

Publications (2)

Publication Number Publication Date
CN113098781A CN113098781A (en) 2021-07-09
CN113098781B true CN113098781B (en) 2023-01-20

Family

ID=76668481

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110296070.6A Active CN113098781B (en) 2021-03-19 2021-03-19 Session list processing method, device, server and storage medium

Country Status (1)

Country Link
CN (1) CN113098781B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115378991B (en) * 2022-08-18 2024-04-19 中国建设银行股份有限公司 Message processing method, device, equipment and computer storage medium

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105763535A (en) * 2016-01-29 2016-07-13 网易(杭州)网络有限公司 Method, device and system for processing session message list
CN106254615A (en) * 2016-08-11 2016-12-21 江苏中威科技软件***有限公司 A kind of session list synchronizes system and synchronous method
CN108174305A (en) * 2016-12-07 2018-06-15 北京云中融信网络科技有限公司 The message treatment method and device of chatroom is broadcast live
CN108600772A (en) * 2018-04-24 2018-09-28 北京奇艺世纪科技有限公司 A kind of filter method and device of direct broadcasting room message
CN108650334A (en) * 2018-08-02 2018-10-12 东软集团股份有限公司 A kind of setting method and device of session failed
CN110138652A (en) * 2019-05-21 2019-08-16 北京达佳互联信息技术有限公司 A kind of session updates method, apparatus and client device
CN110198263A (en) * 2019-05-29 2019-09-03 北京达佳互联信息技术有限公司 Conversation processing method, device, equipment and system
CN110417876A (en) * 2019-07-17 2019-11-05 中移(杭州)信息技术有限公司 Node server and main control device in session method, distributed system
CN110968279A (en) * 2018-09-30 2020-04-07 武汉斗鱼网络科技有限公司 Message degradation method and related device
CN112087364A (en) * 2019-06-13 2020-12-15 腾讯科技(深圳)有限公司 Session list display method, device and storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106209744B (en) * 2015-05-07 2019-08-06 阿里巴巴集团控股有限公司 Subscriber sign-in conversation management-control method, device and server

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105763535A (en) * 2016-01-29 2016-07-13 网易(杭州)网络有限公司 Method, device and system for processing session message list
CN106254615A (en) * 2016-08-11 2016-12-21 江苏中威科技软件***有限公司 A kind of session list synchronizes system and synchronous method
CN108174305A (en) * 2016-12-07 2018-06-15 北京云中融信网络科技有限公司 The message treatment method and device of chatroom is broadcast live
CN108600772A (en) * 2018-04-24 2018-09-28 北京奇艺世纪科技有限公司 A kind of filter method and device of direct broadcasting room message
CN108650334A (en) * 2018-08-02 2018-10-12 东软集团股份有限公司 A kind of setting method and device of session failed
CN110968279A (en) * 2018-09-30 2020-04-07 武汉斗鱼网络科技有限公司 Message degradation method and related device
CN110138652A (en) * 2019-05-21 2019-08-16 北京达佳互联信息技术有限公司 A kind of session updates method, apparatus and client device
CN110198263A (en) * 2019-05-29 2019-09-03 北京达佳互联信息技术有限公司 Conversation processing method, device, equipment and system
CN112087364A (en) * 2019-06-13 2020-12-15 腾讯科技(深圳)有限公司 Session list display method, device and storage medium
CN110417876A (en) * 2019-07-17 2019-11-05 中移(杭州)信息技术有限公司 Node server and main control device in session method, distributed system

Also Published As

Publication number Publication date
CN113098781A (en) 2021-07-09

Similar Documents

Publication Publication Date Title
CN110674022B (en) Behavior data acquisition method and device and storage medium
CN110868626B (en) Method and device for preloading content data
CN110278464B (en) Method and device for displaying list
CN110213153B (en) Display method, acquisition method, device, terminal and storage medium of unread messages
CN110248236B (en) Video playing method, device, terminal and storage medium
CN111479120A (en) Method, device, equipment and storage medium for issuing virtual red packet in live broadcast room
CN110569220B (en) Game resource file display method and device, terminal and storage medium
CN110147503B (en) Information issuing method and device, computer equipment and storage medium
CN113411680B (en) Multimedia resource playing method, device, terminal and storage medium
CN113490010B (en) Interaction method, device and equipment based on live video and storage medium
CN107896337B (en) Information popularization method and device and storage medium
CN112995759A (en) Interactive service processing method, system, device, equipment and storage medium
CN111836069A (en) Virtual gift presenting method, device, terminal, server and storage medium
CN111031391A (en) Video dubbing method, device, server, terminal and storage medium
CN112969093A (en) Interactive service processing method, device, equipment and storage medium
CN110890969B (en) Method and device for mass-sending message, electronic equipment and storage medium
CN112423011B (en) Message reply method, device, equipment and storage medium
CN112770177B (en) Multimedia file generation method, multimedia file release method and device
CN113098781B (en) Session list processing method, device, server and storage medium
CN111399796B (en) Voice message aggregation method and device, electronic equipment and storage medium
CN112559795A (en) Song playing method, song recommending method, device and system
CN114254183A (en) Content recommendation method, device, terminal, server and storage medium
CN114143280B (en) Session display method and device, electronic equipment and storage medium
CN112492331B (en) Live broadcast method, device, system and storage medium
CN111726697B (en) Multimedia data playing method

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
GR01 Patent grant
GR01 Patent grant