CN115314457B - Offline message processing method and device - Google Patents

Offline message processing method and device Download PDF

Info

Publication number
CN115314457B
CN115314457B CN202210951280.9A CN202210951280A CN115314457B CN 115314457 B CN115314457 B CN 115314457B CN 202210951280 A CN202210951280 A CN 202210951280A CN 115314457 B CN115314457 B CN 115314457B
Authority
CN
China
Prior art keywords
offline
message
offline message
queue
current
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
CN202210951280.9A
Other languages
Chinese (zh)
Other versions
CN115314457A (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.)
Hunan Happly Sunshine Interactive Entertainment Media Co Ltd
Original Assignee
Hunan Happly Sunshine Interactive Entertainment Media 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 Hunan Happly Sunshine Interactive Entertainment Media Co Ltd filed Critical Hunan Happly Sunshine Interactive Entertainment Media Co Ltd
Priority to CN202210951280.9A priority Critical patent/CN115314457B/en
Publication of CN115314457A publication Critical patent/CN115314457A/en
Application granted granted Critical
Publication of CN115314457B publication Critical patent/CN115314457B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L51/00User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail
    • H04L51/04Real-time or near real-time messaging, e.g. instant messaging [IM]
    • H04L51/043Real-time or near real-time messaging, e.g. instant messaging [IM] using or handling presence information
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L51/00User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail
    • H04L51/07User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail characterised by the inclusion of specific contents
    • H04L51/18Commands or executable codes

Abstract

The invention provides a method and a device for processing offline messages, which are applied to a server, wherein an offline message list in the server stores offline messages sent from a sending end to a receiving end, and the method comprises the following steps: when the receiving end is switched to an on-line state, the server receives an off-line message request sent by the receiving end and executes off-line message operation corresponding to the request; the offline message operation process comprises the following steps: creating a current message sub-queue corresponding to the current offline message request; determining whether it is a first offline message request; if yes, copying a target offline message from the offline message list to a current message sub-queue and sending the target offline message to a receiving end; if not, deleting the offline message belonging to the last message sub-queue in the last message sub-queue and the offline message list, and copying the target offline message from the offline message list to the current message sub-queue and sending the target offline message to the receiving end. By applying the method, the client can be subjected to offline message processing without updating the message id in real time, so that the disorder of offline messages is avoided.

Description

Offline message processing method and device
Technical Field
The present invention relates to the field of message processing technologies, and in particular, to a method and an apparatus for offline message processing.
Background
With the popularization of various communication software, users usually use clients to perform online communication, and when two clients of the users are simultaneously online, the users can realize online communication, so that when one end is disconnected, the other end can only send offline messages to the party who is disconnected.
An offline message is typically a client sending a local latest message id to a server, which returns a list of messages that are more updated than the message id. In the prior art, a server and a client are required to maintain update of a message id in the processing process of the offline message, and the offline message is acquired by using the message id, but the message id is updated by the real-time chat message, so that the offline message is easily disordered due to the real-time update of the message id in the prior art.
Disclosure of Invention
In view of this, the present invention provides an offline message processing method, by which offline message processing can be performed on a client, without updating a message id in real time, and avoiding confusion of offline messages.
The invention also provides an offline message processing device for ensuring the realization and application of the method in practice.
An offline message processing method, the method is applied to a server, the server includes an offline message list corresponding to a receiving end, the offline message list is used for storing at least one offline message sent by a sending end to the receiving end in an offline state, the method includes:
when the receiving end is switched from an offline state to an online state, receiving at least one offline message request sent by the receiving end, and executing offline message operation corresponding to each offline message request;
Wherein, the executing the offline message operation process includes: creating a current message sub-queue corresponding to the current offline message request; determining whether the current offline message request is a first offline message request; if the current offline message request is a first offline message request, copying target offline messages corresponding to the preset message sending quantity from the offline message list to the current message sub-queue, and sending the current message sub-queue to the receiving end; and if the current offline message request is not the first offline message request, deleting the last message sub-queue corresponding to the last offline message request and the offline messages included in the last message sub-queue in the offline message list, copying the target offline messages corresponding to the message sending quantity from the offline message list to the current message sub-queue, and then sending the current message sub-queue to the receiving end.
The above method, optionally, the determining whether the current offline message request is a first offline message request, includes:
Acquiring a queue identification bit contained in the current offline message request;
detecting whether the queue identification bit contains a queue number;
If the queue identification bit does not contain a queue number, determining that the queue identification bit is empty and the current offline message request is a first offline message request;
and if the queue identification bit contains a queue number, determining that the current offline message request is not the first offline message request.
In the above method, optionally, the copying, from the offline message list, the target offline message corresponding to the number of message transmissions to the current message sub-queue includes:
determining a preset copy rule corresponding to each offline message in the offline message list;
And copying the target offline messages corresponding to the message sending quantity from the offline message list to the current message sub-queue according to the copying rule.
The method, optionally, deletes the last message sub-queue corresponding to the last offline message request and the offline message belonging to the last message sub-queue in the offline message list, further includes:
determining whether the offline message list is an empty offline message list;
And when the offline message list is an empty offline message list, sending a current message sub-queue with the offline message empty to the receiving end.
The method, optionally, after sending the current message sub-queue to the receiving end, further includes:
monitoring whether the receiving end sends a next offline message request in a preset waiting time period in real time;
And deleting the current message sub-queue when the receiving end does not send the next offline message request within a preset waiting time period.
An offline message processing apparatus, the apparatus being applied to a server, the server including an offline message list corresponding to a receiving end, the offline message list being used for storing at least one offline message sent by a sending end to a receiving end in an offline state, the apparatus comprising:
The receiving unit is used for receiving at least one offline message request sent by the receiving end when the receiving end is switched from an offline state to an online state, and executing offline message operation corresponding to each offline message request;
An operation unit, configured to perform the offline message operation procedure, including: creating a current message sub-queue corresponding to the current offline message request; determining whether the current offline message request is a first offline message request; if the current offline message request is a first offline message request, copying target offline messages corresponding to the preset message sending quantity from the offline message list to the current message sub-queue, and sending the current message sub-queue to the receiving end; and if the current offline message request is not the first offline message request, deleting the last message sub-queue corresponding to the last offline message request and the offline messages included in the last message sub-queue in the offline message list, copying the target offline messages corresponding to the message sending quantity from the offline message list to the current message sub-queue, and then sending the current message sub-queue to the receiving end.
The above device, optionally, the operation unit includes:
A first obtaining subunit, configured to obtain a queue identifier bit included in the current offline message request;
a detection subunit, configured to detect whether the queue identifier bit includes a queue number;
A first determining subunit, configured to determine that the queue identifier bit is empty and the current offline message request is a first offline message request if the queue identifier bit does not include a queue number;
and the second determining subunit is configured to determine that the current offline message request is not the first offline message request if the queue identification bit contains a queue number.
The above device, optionally, the operation unit includes:
a third determining subunit, configured to determine a copy rule corresponding to each offline message in the preset offline message list;
And the copying subunit is used for copying the target offline messages corresponding to the message sending quantity from the offline message list to the current message sub-queue according to the copying rule.
The above device, optionally, further comprises:
a fourth determining unit, configured to determine whether the offline message list is an empty offline message list;
and the sending subunit is used for sending the current message sub-queue with the empty offline message to the receiving end when the offline message list is the empty offline message list.
The above device, optionally, further comprises:
the monitoring subunit is used for monitoring whether the receiving end sends a next offline message request in a preset waiting time period in real time;
And the deleting subunit is used for deleting the current message sub-queue when the receiving end does not send the next offline message request within a preset waiting time period.
A storage medium comprising stored instructions that, when executed, control a device on which the storage medium resides to perform the offline message processing method described above.
An electronic device comprising a memory, and one or more instructions, wherein the one or more instructions are stored in the memory and configured to perform the offline message processing method described above by one or more processors.
Compared with the prior art, the invention has the following advantages:
The invention provides an offline message processing method, which is applied to a server, wherein the server comprises an offline message list corresponding to a receiving end, and the offline message list is used for storing at least one offline message sent by a sending end to the receiving end in an offline state, and the method comprises the following steps: when the receiving end is switched from an offline state to an online state, receiving at least one offline message request sent by the receiving end, and executing offline message operation corresponding to each offline message request; wherein, the executing the offline message operation process includes: creating a current message sub-queue corresponding to the current offline message request; determining whether the current offline message request is a first offline message request; if the current offline message request is a first offline message request, copying target offline messages corresponding to the preset message sending quantity from the offline message list to the current message sub-queue, and sending the current message sub-queue to the receiving end; and if the current offline message request is not the first offline message request, deleting the last message sub-queue corresponding to the last offline message request and the offline messages included in the last message sub-queue in the offline message list, copying the target offline messages corresponding to the message sending quantity from the offline message list to the current message sub-queue, and then sending the current message sub-queue to the receiving end. By applying the method provided by the invention, the client can be subjected to offline message processing without updating the message id in real time, so that the disorder of offline messages is avoided.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings that are required to be used in the embodiments or the description of the prior art will be briefly described below, and it is obvious that the drawings in the following description are only embodiments of the present invention, and that other drawings can be obtained according to the provided drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a method for offline message processing according to an embodiment of the present invention;
FIG. 2 is a flowchart of another method for offline message processing according to an embodiment of the present invention;
FIG. 3 is a flowchart of another method for offline message processing according to an embodiment of the present invention;
FIG. 4 is a block diagram of an offline message processing apparatus according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
In the present disclosure, relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions, and the terms "comprise," "include," or any other variation thereof, are intended to cover a non-exclusive inclusion such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The invention is operational with numerous general purpose or special purpose computing device environments or configurations. For example: personal computers, server computers, hand-held or portable devices, tablet devices, multiprocessor devices, distributed computing environments that include any of the above devices or devices, and the like.
The embodiment of the invention provides an offline message processing method, which is applied to a server, wherein the server comprises an offline message list corresponding to a receiving end, the offline message list is used for storing at least one offline message sent by a sending end to the receiving end in an offline state, and a flow chart of the method is shown in fig. 1 and specifically comprises the following steps:
s101: and when the receiving end is switched from the offline state to the online state, receiving at least one offline message request sent by the receiving end.
And after receiving the offline message request sent by the receiving end each time, executing the offline message operation corresponding to the offline message request each time.
It should be noted that, the receiving end cannot receive the offline message sent by the sending end in the offline state, and the server stores the offline message sent by the sending end in the offline message list corresponding to the receiving end. The offline message list stores offline messages sent by the sender in the order from early to late. And after the receiving end is switched from the offline state to the online state, actively sending an offline message request to the server so as to pull the offline message in the offline state.
Optionally, after the receiving end switches from the offline state to the online state, if the offline message list has the offline message sent by the sending end, the server may send an offline message instruction to the receiving end, and the receiving end sends at least one offline message request according to the instruction.
For each offline message request, the executing the offline message operation process corresponding to the current offline message request sent by the receiving end may include the following steps S102 to S105:
s102: and creating a current message sub-queue corresponding to the current offline message request.
It will be appreciated that the server creates a message sub-queue every time the receiving end sends an offline message request.
S103: determining whether the current offline message request is a first offline message request.
If the current offline message request is the first offline message request, S104 is executed; if the current offline message request is not the first offline message request, S105 is executed.
S104: copying target offline messages corresponding to the preset message sending quantity from the offline message list to the current message sub-queue, and sending the current message sub-queue to the receiving end.
It will be appreciated that when the offline message list includes a plurality of offline messages to be sent, the offline messages may be split into a plurality of offline messages for sending. And each time the receiving end sends an offline message request, the server sends partial messages in the offline message list, wherein the number of the offline messages of the partial messages is not more than the number of the messages sent in the step S104.
In the present invention, the copying the target offline message corresponding to the message sending number from the offline message list to the current message sub-queue includes:
determining a preset copy rule corresponding to each offline message in the offline message list;
And copying the target offline messages corresponding to the message sending quantity from the offline message list to the current message sub-queue according to the copying rule.
It should be noted that the replication rule may be to replicate the offline message in the order from early to late in the offline message list, or to replicate the offline message in the order from late to early in the offline message list, or to replicate the offline message in the random offline message list. The specific replication rules may be set according to specific requirements of the server or the receiving end, which will not be limited herein.
In the present invention, after deleting the last message sub-queue corresponding to the last offline message request and the offline messages belonging to the last message sub-queue in the offline message list, the method further includes:
determining whether the offline message list is an empty offline message list;
And when the offline message list is an empty offline message list, sending a current message sub-queue with the offline message empty to the receiving end.
It should be noted that, if there is no offline message in the offline message list and an offline message request is received, an empty message sub-queue is sent to the receiving end.
It should be noted that, after receiving the empty message sub-queue, the receiving end will not send the offline message request to the server any more, and if the message sub-queue received by the receiving end contains the offline message, the receiving end will continue to send the offline message request to the server.
S105: and deleting the last message sub-queue corresponding to the last offline message request and the offline messages belonging to the last message sub-queue in the offline message list, and executing S104.
It can be understood that after deleting the last message sub-queue, the offline message copied to the last message sub-queue in the offline message list is also deleted, then the target offline message corresponding to the number of message transmissions is copied from the offline message list after deleting part of the offline message to the current message sub-queue, and then the message sub-queue is transmitted to the receiving end.
According to the method provided by the embodiment of the invention, when the server receives the offline message sent by the sending end to the sending end, the offline message is stored in the offline message list. When the receiving end is switched from the offline state to the online state, the server receives at least one offline message request sent by the receiving end, creates a current message sub-queue corresponding to the request after receiving the current offline message request, and determines whether the request is the first offline message request. If yes, copying at least one offline message from the offline message list according to the message sending quantity, storing the offline message as a target offline message to a current message sub-queue, sending the current message sub-queue to a receiving end, and acquiring the offline message from the current message sub-queue by the receiving end. If the offline message request is not the first time, deleting the last message sub-queue corresponding to the last request, deleting the offline message stored in the last message sub-queue in the offline message list, acquiring the unsent offline message from the offline message list again to the current message sub-queue according to the message sending number, and sending the message sub-queue storing the offline message to the receiving end.
By applying the method provided by the embodiment of the invention, the offline message is sent in a queue form after the offline message request is received each time, so that the disorder of the message is avoided.
In the method provided by the embodiment of the present invention, the process of determining whether the current offline message request is the first offline message request is shown in fig. 2, and includes:
s201: and acquiring a queue identification bit contained in the current offline message request.
S202: detecting whether the queue identification bit contains a queue number.
If the queue identification bit does not contain a queue number, S203 is executed; if the queue identification bit contains a queue number, S204 is performed.
It should be noted that, the queue number may be a queue sequence number of the message sub-queue.
S203: and determining that the queue identification bit is empty and the current offline message request is a first offline message request.
It can be understood that if the queue identification bit has no queue number, the current offline message request is represented as the offline message request sent for the first time after the receiving end is restored to the online state, that is, the offline message request is the first time.
S204: and determining that the current offline message request is not a first offline message request.
It should be noted that, after receiving the message sub-queue, the receiving end may issue a new offline message request again, where the offline message request carries the queue number of the message sub-queue that the receiving end has received last time.
In the method provided by the embodiment of the invention, the processing mode of the server for receiving the first offline message request is different from that of the non-first offline message request, wherein the judgment is mainly carried out through the queue identification bit in the offline message request, if the queue identification bit is empty, i.e. no queue number exists on the queue identification bit, the current offline message request is marked as the first offline message request, and otherwise, the current offline message request is not the first offline message request.
It should be noted that, after the receiving end receives the message sub-queue, if the message sub-queue is an empty message sub-queue, it indicates that all offline messages in the offline state have been acquired, so the receiving end will not send the offline message request to the server again.
In the method provided by the embodiment of the present invention, after the current message sub-queue is sent to the receiving end, a process as shown in fig. 3 may be performed:
s301: and monitoring whether the receiving end sends a next offline message request within a preset waiting time period in real time.
After the message sub-queue is sent to the receiving end, if the receiving end is suddenly interrupted with the server again (switched from the online state to the offline state), or the offline message in the offline message list is received, the offline message request will not be sent to the server any more in the waiting period.
It should be noted that if the receiving end is interrupted with the server, even if the receiving end is connected with the server quickly after interruption, the network needs to be waited for recovery in the connection process, so that a certain time is required, and the receiving end can quickly issue the offline message request again after acquiring the message sub-queue in the online state, so that the waiting time can be set according to the time interval of the receiving end for historically sending the offline message request.
S302: and deleting the current message sub-queue when the receiving end does not send the next offline message request within a preset waiting time period.
It can be understood that if the receiving end and the server are disconnected, the receiving end enters the offline state next time, and then the message sub-queue which has been sent to the receiving end can be deleted after the waiting time arrives, and if the offline message request is received again after the waiting time, the offline message request can be used as the first offline message request after the offline is restored to the online state next time.
Based on the method provided in the above embodiment, taking the client a and the client B as examples, when the client a and the client B communicate, the message is forwarded through the server. When the connection between A and the server is disconnected, B sends a plurality of messages to A, and the server stores the messages into an offline message list of A. When the connection is established with the server again next time, the server sends a request offline message to the server, and the server receives the request and has the following processing modes:
1) The offline message request sent by a will enter the message queue management module of the server.
2) The server triggers 2 processes after receiving the offline message request: create queues and delete queues. If the offline message request is the first offline message request, the queue deleting process is not triggered.
3) Creating a queue: the call sub-queue module generates 1 message sub-queue. The message sub-queue may include the data of the head of the offline message acquired from the offline message list and put into the sub-queue.
4) Delete queue: the offline message request has the sequence number or name of the last acquired message sub-queue, and the sub-queue module is called to delete the sub-queue. The sub-queue module simultaneously deletes the offline messages belonging to the part of the message sub-queues in the offline message list while deleting the message sub-queues.
5) The sub-queue module returns the newly created message sub-queue to a.
6) And if the sub-queue module finds that all the offline messages of the user are empty, returning to the empty message sub-queue.
The specific implementation process and derivative manner of the above embodiments are all within the protection scope of the present invention.
Corresponding to the method shown in fig. 1, the embodiment of the present invention further provides an offline message processing apparatus, which is configured to implement the method shown in fig. 1, where the offline message processing apparatus provided in the embodiment of the present invention is applied to a server, and the server includes an offline message list corresponding to a receiving end, and the offline message list is configured to store at least one offline message sent by a sending end to a receiving end in an offline state, and the structure schematic diagram of the offline message processing apparatus is shown in fig. 4, and specifically includes:
a receiving unit 401, configured to receive at least one offline message request sent by the receiving end when the receiving end switches from an offline state to an online state, and perform an offline message operation corresponding to each offline message request;
An operation unit 402, configured to perform the offline message operation procedure, including: creating a current message sub-queue corresponding to the current offline message request; determining whether the current offline message request is a first offline message request; if the current offline message request is a first offline message request, copying target offline messages corresponding to the preset message sending quantity from the offline message list to the current message sub-queue, and sending the current message sub-queue to the receiving end; and if the current offline message request is not the first offline message request, deleting the last message sub-queue corresponding to the last offline message request and the offline messages included in the last message sub-queue in the offline message list, copying the target offline messages corresponding to the message sending quantity from the offline message list to the current message sub-queue, and then sending the current message sub-queue to the receiving end.
According to the method provided by the embodiment of the invention, when the server receives the offline message sent by the sending end to the sending end, the offline message is stored in the offline message list. When the receiving end is switched from the offline state to the online state, the server receives at least one offline message request sent by the receiving end, creates a current message sub-queue corresponding to the request after receiving the current offline message request, and determines whether the request is the first offline message request. If yes, copying at least one offline message from the offline message list according to the message sending quantity, storing the offline message as a target offline message to a current message sub-queue, sending the current message sub-queue to a receiving end, and acquiring the offline message from the current message sub-queue by the receiving end. If the offline message request is not the first time, deleting the last message sub-queue corresponding to the last request, deleting the offline message stored in the last message sub-queue in the offline message list, acquiring the unsent offline message from the offline message list again to the current message sub-queue according to the message sending number, and sending the message sub-queue storing the offline message to the receiving end.
By applying the method provided by the embodiment of the invention, the offline message is sent in a queue form after the offline message request is received each time, so that the disorder of the message is avoided.
In the apparatus provided by the embodiment of the present invention, the operation unit 402 includes:
A first obtaining subunit, configured to obtain a queue identifier bit included in the current offline message request;
a detection subunit, configured to detect whether the queue identifier bit includes a queue number;
A first determining subunit, configured to determine that the queue identifier bit is empty and the current offline message request is a first offline message request if the queue identifier bit does not include a queue number;
and the second determining subunit is configured to determine that the current offline message request is not the first offline message request if the queue identification bit contains a queue number.
In the apparatus provided by the embodiment of the present invention, the operation unit 402 includes:
a third determining subunit, configured to determine a copy rule corresponding to each offline message in the preset offline message list;
And the copying subunit is used for copying the target offline messages corresponding to the message sending quantity from the offline message list to the current message sub-queue according to the copying rule.
The device provided by the embodiment of the invention further comprises:
a fourth determining unit, configured to determine whether the offline message list is an empty offline message list;
and the sending subunit is used for sending the current message sub-queue with the empty offline message to the receiving end when the offline message list is the empty offline message list.
The device provided by the embodiment of the invention further comprises:
the monitoring subunit is used for monitoring whether the receiving end sends a next offline message request in a preset waiting time period in real time;
And the deleting subunit is used for deleting the current message sub-queue when the receiving end does not send the next offline message request within a preset waiting time period.
The specific working process of each unit and subunit in the offline message processing device disclosed in the above embodiment of the present invention may refer to the corresponding content in the offline message processing method disclosed in the above embodiment of the present invention, and will not be described herein again.
The embodiment of the invention also provides a storage medium, which comprises stored instructions, wherein the equipment where the storage medium is located is controlled to execute the offline message processing method when the instructions run.
The embodiment of the present invention further provides an electronic device, whose structural schematic diagram is shown in fig. 5, specifically including a memory 501, and one or more instructions 502, where the one or more instructions 502 are stored in the memory 501, and configured to be executed by the one or more processors 503, where the one or more instructions 502 perform the following operations:
when the receiving end is switched from an offline state to an online state, receiving at least one offline message request sent by the receiving end, and executing offline message operation corresponding to each offline message request;
Wherein, the executing the offline message operation process includes: creating a current message sub-queue corresponding to the current offline message request; determining whether the current offline message request is a first offline message request; if the current offline message request is a first offline message request, copying target offline messages corresponding to the preset message sending quantity from the offline message list to the current message sub-queue, and sending the current message sub-queue to the receiving end; and if the current offline message request is not the first offline message request, deleting the last message sub-queue corresponding to the last offline message request and the offline messages included in the last message sub-queue in the offline message list, copying the target offline messages corresponding to the message sending quantity from the offline message list to the current message sub-queue, and then sending the current message sub-queue to the receiving end.
In this specification, each embodiment is described in a progressive manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for a system or system embodiment, since it is substantially similar to a method embodiment, the description is relatively simple, with reference to the description of the method embodiment being made in part. The systems and system embodiments described above are merely illustrative, wherein the elements illustrated as separate elements may or may not be physically separate, and the elements shown as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
Those of skill would further appreciate that the elements and algorithm steps of the examples described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both.
To clearly illustrate this interchangeability of hardware and software, various illustrative components and steps have been described above generally in terms of their functionality. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (8)

1. The method for processing the offline message is characterized in that the method is applied to a server, the server comprises an offline message list corresponding to a receiving end, and the offline message list is used for storing at least one offline message sent by a sending end to the receiving end in an offline state, and the method comprises the following steps:
when the receiving end is switched from an offline state to an online state, receiving at least one offline message request sent by the receiving end, and executing offline message operation corresponding to each offline message request;
Wherein, the executing the offline message operation process includes: creating a current message sub-queue corresponding to the current offline message request; determining whether the current offline message request is a first offline message request; if the current offline message request is a first offline message request, copying target offline messages corresponding to the preset message sending quantity from the offline message list to the current message sub-queue, and sending the current message sub-queue to the receiving end; if the current offline message request is not the first offline message request, deleting the last message sub-queue corresponding to the last offline message request and offline messages included in the last message sub-queue in the offline message list, copying target offline messages corresponding to the message sending number from the offline message list to the current message sub-queue, and then sending the current message sub-queue to the receiving end;
Copying the target offline messages corresponding to the message sending quantity from the offline message list to the current message sub-queue, wherein the method comprises the following steps: determining a preset copy rule corresponding to each offline message in the offline message list; copying target offline messages corresponding to the message sending quantity from the offline message list to the current message sub-queue according to the copying rule; the replication rule includes: copying the offline message according to the sequence from the early to the late of the offline message stored in the offline message list, or copying the offline message according to the sequence from the late to the early of the offline message stored in the offline message list, or copying the offline message from the offline message list randomly.
2. The method of claim 1, wherein determining whether the current offline message request is a first offline message request comprises:
Acquiring a queue identification bit contained in the current offline message request;
detecting whether the queue identification bit contains a queue number;
If the queue identification bit does not contain a queue number, determining that the queue identification bit is empty and the current offline message request is a first offline message request;
and if the queue identification bit contains a queue number, determining that the current offline message request is not the first offline message request.
3. The method of claim 1, wherein after deleting the last message sub-queue corresponding to the last offline message request and the offline messages belonging to the last message sub-queue in the offline message list, further comprising:
determining whether the offline message list is an empty offline message list;
And when the offline message list is an empty offline message list, sending a current message sub-queue with the offline message empty to the receiving end.
4. The method of claim 1, further comprising, after sending the current message sub-queue to the receiving end:
monitoring whether the receiving end sends a next offline message request in a preset waiting time period in real time;
And deleting the current message sub-queue when the receiving end does not send the next offline message request within a preset waiting time period.
5. An offline message processing apparatus, wherein the apparatus is applied to a server, the server includes an offline message list corresponding to a receiving end, the offline message list is used for storing at least one offline message sent by a sending end to a receiving end in an offline state, and the apparatus includes:
The receiving unit is used for receiving at least one offline message request sent by the receiving end when the receiving end is switched from an offline state to an online state, and executing offline message operation corresponding to each offline message request;
an operation unit, configured to perform the offline message operation procedure, including: creating a current message sub-queue corresponding to the current offline message request; determining whether the current offline message request is a first offline message request; if the current offline message request is a first offline message request, copying target offline messages corresponding to the preset message sending quantity from the offline message list to the current message sub-queue, and sending the current message sub-queue to the receiving end; if the current offline message request is not the first offline message request, deleting the last message sub-queue corresponding to the last offline message request and offline messages included in the last message sub-queue in the offline message list, copying target offline messages corresponding to the message sending number from the offline message list to the current message sub-queue, and then sending the current message sub-queue to the receiving end;
The operation unit includes: a third determining subunit and a copying subunit;
The third determining subunit is configured to determine a copy rule corresponding to each offline message in the preset offline message list; the replication rule includes: copying the offline message according to the sequence from the early to the late of the offline message stored in the offline message list, or copying the offline message according to the sequence from the late to the early of the offline message stored in the offline message list, or copying the offline message from the offline message list randomly;
And the copying subunit is configured to copy, according to the copying rule, the target offline message corresponding to the number of message transmissions from the offline message list to the current message sub-queue.
6. The apparatus according to claim 5, wherein the operation unit includes:
A first obtaining subunit, configured to obtain a queue identifier bit included in the current offline message request;
a detection subunit, configured to detect whether the queue identifier bit includes a queue number;
A first determining subunit, configured to determine that the queue identifier bit is empty and the current offline message request is a first offline message request if the queue identifier bit does not include a queue number;
and the second determining subunit is configured to determine that the current offline message request is not the first offline message request if the queue identification bit contains a queue number.
7. The apparatus as recited in claim 5, further comprising:
a fourth determining unit, configured to determine whether the offline message list is an empty offline message list;
and the sending subunit is used for sending the current message sub-queue with the empty offline message to the receiving end when the offline message list is the empty offline message list.
8. The apparatus as recited in claim 5, further comprising:
the monitoring subunit is used for monitoring whether the receiving end sends a next offline message request in a preset waiting time period in real time;
And the deleting subunit is used for deleting the current message sub-queue when the receiving end does not send the next offline message request within a preset waiting time period.
CN202210951280.9A 2022-08-09 2022-08-09 Offline message processing method and device Active CN115314457B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210951280.9A CN115314457B (en) 2022-08-09 2022-08-09 Offline message processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210951280.9A CN115314457B (en) 2022-08-09 2022-08-09 Offline message processing method and device

Publications (2)

Publication Number Publication Date
CN115314457A CN115314457A (en) 2022-11-08
CN115314457B true CN115314457B (en) 2024-04-19

Family

ID=83861204

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210951280.9A Active CN115314457B (en) 2022-08-09 2022-08-09 Offline message processing method and device

Country Status (1)

Country Link
CN (1) CN115314457B (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106130883A (en) * 2016-07-14 2016-11-16 北京元心科技有限公司 Instant messaging message pushing method and pushing device
CN106656763A (en) * 2016-12-29 2017-05-10 北京奇虎科技有限公司 Method and device for sending offline message
CN106790454A (en) * 2016-12-07 2017-05-31 努比亚技术有限公司 Deferred information method for pushing and device
CN107491356A (en) * 2017-08-28 2017-12-19 广州市百果园信息技术有限公司 Message treatment method, terminal device and server based on sequence number
CN107786425A (en) * 2016-09-12 2018-03-09 平安科技(深圳)有限公司 Information off-line treating method and apparatus
CN109462545A (en) * 2018-12-26 2019-03-12 北京云中融信网络科技有限公司 Message delet method and device
CN109639564A (en) * 2018-12-12 2019-04-16 金瓜子科技发展(北京)有限公司 A kind of method, apparatus and computer readable storage medium obtaining offline message
CN111654428A (en) * 2020-06-05 2020-09-11 天津卓朗科技发展有限公司 Offline message processing method and device and server
CN111884843A (en) * 2020-07-20 2020-11-03 北京字节跳动网络技术有限公司 Message processing method and device, electronic equipment and storage medium

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106130883A (en) * 2016-07-14 2016-11-16 北京元心科技有限公司 Instant messaging message pushing method and pushing device
CN107786425A (en) * 2016-09-12 2018-03-09 平安科技(深圳)有限公司 Information off-line treating method and apparatus
CN106790454A (en) * 2016-12-07 2017-05-31 努比亚技术有限公司 Deferred information method for pushing and device
CN106656763A (en) * 2016-12-29 2017-05-10 北京奇虎科技有限公司 Method and device for sending offline message
CN107491356A (en) * 2017-08-28 2017-12-19 广州市百果园信息技术有限公司 Message treatment method, terminal device and server based on sequence number
CN109639564A (en) * 2018-12-12 2019-04-16 金瓜子科技发展(北京)有限公司 A kind of method, apparatus and computer readable storage medium obtaining offline message
CN109462545A (en) * 2018-12-26 2019-03-12 北京云中融信网络科技有限公司 Message delet method and device
CN111654428A (en) * 2020-06-05 2020-09-11 天津卓朗科技发展有限公司 Offline message processing method and device and server
CN111884843A (en) * 2020-07-20 2020-11-03 北京字节跳动网络技术有限公司 Message processing method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN115314457A (en) 2022-11-08

Similar Documents

Publication Publication Date Title
US8285267B2 (en) Synchronization in unified messaging systems
US7693958B2 (en) Instant messaging with data sharing
US20050132009A1 (en) Instant message awareness and migration allowing for multiple simultaneous client logins
US11119828B2 (en) Digital processing system for event and/or time based triggering management, and control of tasks
US9608831B2 (en) Migrating a chat message service provided by a chat server to a new chat server
JP2005509979A (en) Asynchronous synchronization system and method
JP6918116B2 (en) Instant messaging group management methods and equipment
CN106506490A (en) A kind of Distributed Calculation control method and distributed computing system
CN112395259A (en) File operating system, operating method, computer equipment and medium
JP4612714B2 (en) Data processing method, cluster system, and data processing program
CN110661851A (en) Data exchange method and device
CN115314457B (en) Offline message processing method and device
US20140164523A1 (en) Automated enabling of instant messaging communications in a client system
JPH09294139A (en) Electronic mail system and registration management method for electronic mail
CN113612735B (en) Secure storage system
CN117043760A (en) Media storage for online conferences in edge network storage
CN116940936A (en) Asynchronous replication of linked parent and child records across data storage areas
JP2016018222A (en) Queue server
EP1941356B1 (en) Electronic apparatus with server device for managing setting data
CN1846411B (en) Update of presence data allocated to the user of a communication service
JP2016118837A (en) Thin client system, and document file control method of thin client
KR0169037B1 (en) Method of message control in agent of electric communication control network
CN115454683A (en) Message processing method, system, electronic device and computer readable storage medium
CN106790168B (en) Communication preprocessing method, client and server
WO2018184509A1 (en) Data processing method and apparatus

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