CN115314457A - Offline message processing method and device - Google Patents

Offline message processing method and device Download PDF

Info

Publication number
CN115314457A
CN115314457A CN202210951280.9A CN202210951280A CN115314457A CN 115314457 A CN115314457 A CN 115314457A CN 202210951280 A CN202210951280 A CN 202210951280A CN 115314457 A CN115314457 A CN 115314457A
Authority
CN
China
Prior art keywords
message
offline
queue
current
line
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.)
Granted
Application number
CN202210951280.9A
Other languages
Chinese (zh)
Other versions
CN115314457B (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

Images

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 an off-line message processing method and device, which are applied to a server, wherein an off-line message list in the server stores off-line messages sent by a sending end to a receiving end, and the method comprises the following steps: when the receiving end is switched to the online state, the server receives an offline message request sent by the receiving end and executes offline message operation corresponding to the request; the off-line message operation process comprises the following steps: creating a current message sub-queue corresponding to the current offline message request; determining whether the request is a first off-line message request; if yes, copying the target offline message from the offline message list to the current message sub-queue and sending the target offline message to a receiving end; if not, deleting the previous message sub-queue and the off-line messages in the off-line message list belonging to the previous message sub-queue, copying the target off-line messages from the off-line message list to the current message sub-queue, and sending the target off-line messages to a receiving end. By applying the method, the client can be processed by the off-line message without updating the message id in real time, thereby avoiding disorder of the off-line message.

Description

Offline message processing method and device
Technical Field
The present invention relates to the field of message processing technologies, and in particular, to an offline message processing method and apparatus.
Background
With the popularization of various communication software, users usually use client sides to perform online communication, and when the client sides of two users are on line at the same time, the online communication can be realized between the users, so that when one end is disconnected, the other end can only send offline messages to the disconnected party.
Offline messages are typically messages that the client sends the local latest message id to the server, which returns a list of messages that are more up-to-date than the message id. In the prior art, the process of processing the offline message needs the server and the client to maintain the update of the message id, and the offline message is acquired by using the message id, but the message id is also updated by the real-time chat message, so that the messiness of the offline message is easily caused by 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, thereby avoiding confusion of offline messages.
The invention also provides an off-line message processing device which is used for ensuring the realization and the application of the method in practice.
An offline message processing 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, and the method includes:
when the receiving end is switched from an off-line state to an on-line state, receiving at least one off-line message request sent by the receiving end, and executing off-line message operation corresponding to each off-line message request;
wherein, executing the offline message operation process comprises: 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 a 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 off-line message request is not the first off-line message request, deleting the last message sub-queue corresponding to the last off-line message request and off-line messages contained in the off-line message list and belonging to the last message sub-queue, copying target off-line messages corresponding to the message sending quantity from the off-line message list to the current message sub-queue, and then sending the current message sub-queue to the receiving end.
Optionally, the method for 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.
Optionally, the method for copying, from the offline message list, the target offline messages corresponding to the message sending number to the current message sub-queue includes:
determining a preset replication 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.
Optionally, the method further includes, after deleting a previous message sub-queue corresponding to a previous offline message request and an offline message included in the offline message list and belonging to the previous message sub-queue:
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 the current message sub-queue with empty offline messages to the receiving end.
Optionally, in the method, after the sending the current message sub-queue to the receiving end, the method further includes:
monitoring whether the receiving end sends a next off-line message request within a preset waiting time period or not in real time;
and deleting the current message sub-queue when the receiving end does not send the next off-line message request within a preset waiting time period.
An offline message processing apparatus, 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 the receiving end in an offline state, the apparatus includes:
the receiving unit is used for receiving at least one off-line message request sent by the receiving end when the receiving end is switched from the off-line state to the on-line state, and executing off-line message operation corresponding to each off-line message request;
an operation unit, configured to execute the offline message operation process, 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 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 off-line message request is not the first off-line message request, deleting a previous message sub-queue corresponding to the previous off-line message request and off-line messages contained in the previous message sub-queue in the off-line message list, copying target off-line messages corresponding to the message sending quantity from the off-line message list to the current message sub-queue, and then sending the current message sub-queue to the receiving end.
The above apparatus, optionally, the operation unit includes:
a first obtaining subunit, configured to obtain a queue identification bit included in the current offline message request;
the detection subunit is used for detecting whether the queue identification bit contains a queue number;
a first determining subunit, configured to determine that the queue identification bit is empty and the current offline message request is a first offline message request if the queue identification bit does not include a queue number;
and a second determining subunit, configured to determine that the current offline message request is not a first offline message request if the queue identification bit contains a queue number.
The above apparatus, optionally, the operation unit includes:
a third determining subunit, configured to determine a preset replication rule corresponding to each offline message in the offline message list;
and the replication sub-unit is used for replicating the target offline messages corresponding to the message sending quantity from the offline message list to the current message sub-queue according to the replication rule.
The above apparatus, 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 configured to send, to the receiving end, the current message sub-queue whose offline message is empty when the offline message list is an empty offline message list.
The above apparatus, optionally, further comprises:
the monitoring subunit is used for monitoring whether the receiving end sends the next off-line message request within a preset waiting time period in real time;
and the deleting subunit is configured to delete the current message sub-queue when the receiving end does not send a next offline message request within a preset waiting time period.
A storage medium, the storage medium including stored instructions, wherein when executed, the instructions control a device on which the storage medium is located to execute the above offline message processing method.
An electronic device includes a memory, and one or more instructions, wherein the one or more instructions are stored in the memory and configured to be executed by the one or more processors to perform the offline message processing method.
Compared with the prior art, the invention has the following advantages:
the invention provides an off-line message processing method, which is applied to a server, wherein the server comprises an off-line message list corresponding to a receiving end, the off-line message list is used for storing at least one off-line message sent by a sending end to the receiving end in an off-line state, and the method comprises the following steps: when the receiving end is switched from the off-line state to the on-line state, receiving at least one off-line message request sent by the receiving end, and executing off-line message operation corresponding to each off-line message request; wherein the executing the offline message operation process comprises: 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 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 the offline messages contained in the offline message list belonging to the last message sub-queue, 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 method provided by the invention can be used for processing the off-line messages of the client without updating the message id in real time, thereby avoiding disorder of the off-line messages.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a flowchart of a method of processing an offline message according to an embodiment of the present invention;
fig. 2 is a flowchart of another method of an offline message processing method according to an embodiment of the present invention;
fig. 3 is a flowchart illustrating another method of an offline message processing method according to an embodiment of the present invention;
fig. 4 is a diagram illustrating an apparatus structure 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 technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In this application, relational terms such as first and second, and the like may be 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", "comprises", 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 also other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrases "comprising one of 8230; \8230;" 8230; "does not exclude the presence of additional 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-type devices, multi-processor apparatus, distributed computing environments that include any of the above devices or equipment, and the like.
An embodiment of the present invention provides an offline message processing method, which is applied to a server, where the server includes an offline message list corresponding to a receiving end, where the offline message list is used to store 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 includes:
s101: and when the receiving end is switched from the off-line state to the on-line state, receiving at least one off-line message request sent by the receiving end.
After receiving an offline message request sent by a receiving end, executing offline message operation corresponding to each offline message request.
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 an offline message list corresponding to the receiving end. The offline message list stores the offline messages sent by the sending terminal in the order from morning to evening. And when the receiving end is switched from the off-line state to the on-line state, actively sending an off-line message request to the server so as to pull the off-line message in the off-line state.
Optionally, after the receiving end is switched 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 operation process of executing the offline message corresponding to the current offline message request sent by the receiving end may be as follows S102 to S105, which specifically includes:
s102: and creating a current message sub-queue corresponding to the current offline message request.
It will be appreciated that the server creates a sub-queue of messages each time the receiver 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, executing S104; if the current offline message request is not the first offline message request, S105 is executed.
S104: and copying target off-line messages corresponding to the preset message sending quantity from the off-line message list to the current message sub-queue, and sending the current message sub-queue to the receiving end.
It can be understood that, when the offline message list includes a plurality of offline messages to be sent, the plurality of offline messages may be split into a plurality of offline messages to be sent. Every time the receiving end sends an offline message request, the server sends a part of messages in the offline message list, and the quantity of the offline messages of the part of messages does not exceed the message sending quantity described in S104.
In the present invention, the copying, from the offline message list, the target offline messages corresponding to the message sending number to the current message sub-queue includes:
determining a preset replication 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 messages in the order from early to late when the offline messages are stored in the offline message list, or to replicate the offline messages in the order from late to early when the offline messages are stored in the offline message list, or to replicate the offline messages in the random middle offline message list. The specific replication rule may be set according to specific requirements of the server or the receiving end, and shall 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 message included in the offline message list belonging to the last message sub-queue, 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 the current message sub-queue with empty offline messages 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 further 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 contained in the last message sub-queue in the offline message list, and executing S104.
It can be understood that after deleting the previous message sub-queue, the offline message copied to the previous message sub-queue from the offline message list is also deleted, and then the target offline messages corresponding to the message sending quantity are copied from the offline message list after deleting part of the offline messages to the current message sub-queue, and then the message sub-queue is sent to the receiving end.
According to the method provided by the embodiment of the invention, when the server receives the offline message sent to the sending end by the sending end, the offline message is stored in the offline message list. When the receiving end is switched to the online state from the offline state, the server receives at least one off-line message request sent by the receiving end, and after receiving the current off-line message request, creates a current message sub-queue corresponding to the request and determines whether the current off-line message request is the first off-line message request. If yes, copying at least one off-line message from the off-line message list according to the message sending quantity as a target off-line message, storing the target off-line message in a current message sub-queue, sending the current message sub-queue to a receiving end, and obtaining the off-line message from the current message sub-queue by the receiving end. If the offline message is not requested for the first time, the last message sub-queue corresponding to the last request is deleted, the offline messages stored in the last message sub-queue in the offline message list are deleted, the unsent offline messages are obtained from the offline message list again according to the message sending quantity to the current message sub-queue, and the message sub-queue in which the offline messages are stored is sent to the receiving end.
By applying the method provided by the embodiment of the invention, the offline message is sent according to the queue form after the offline message request is received each time, so that messiness of the message is avoided.
In the method provided in 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: and detecting whether the queue identification bit contains a queue number.
If the queue identification bit does not contain a queue number, executing S203; if the queue identification bit contains a queue number, S204 is performed.
It should be noted that the queue number may be a queue number of a message subqueue.
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 there is no queue number on the queue identification bit, the current offline message request is characterized as the offline message request that is sent for the first time after the receiving end is restored to the online state, i.e., the first offline message request.
S204: 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 is received by the receiving end last time.
In the method provided by the embodiment of the invention, the processing modes of the server for receiving the first off-line message request and the non-first off-line message request are different, wherein the judgment is mainly carried out through a queue identification bit in the off-line message request, if the queue identification bit is empty, namely, no queue number exists on the queue identification bit, the current off-line message request is identified as the first off-line message request, and otherwise, the current off-line message request is identified as the non-first off-line message request.
It should be further noted that, after receiving 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, and therefore the receiving end does not send an offline message request to the server again.
In the method provided in the embodiment of the present invention, after the current message sub-queue is sent to the receiving end, the process shown in fig. 3 may be executed:
s301: and monitoring whether the receiving end sends the next off-line message request within a preset waiting time period or not in real time.
It should be noted that, after the message sub-queue is sent to the receiving end, if the receiving end suddenly interrupts the server again (switches from the online state to the offline state), or the receiving of the offline message in the offline message list is completed, the offline message request will not be sent to the server again within the waiting time period.
It should be noted that, if the receiving end and the server are interrupted, even if the receiving end is connected to the server quickly after the interruption, the connection process needs to wait for network recovery, and therefore a certain amount of time is needed, and the receiving end can issue the offline message request again quickly after acquiring the message sub-queue in an online state, and therefore, the waiting time can be set according to the time interval of sending the offline message request by the receiving end historically.
S302: and deleting the current message sub-queue when the receiving end does not send the next off-line message request within a preset waiting time period.
It can be understood that, if the connection between the receiving end and the server is interrupted, which is equivalent to that the receiving end enters the next offline state, at this time, the message sub-queue that has been sent to the receiving end can be deleted after the waiting time is reached, and if the offline message request is received again after the waiting time is passed, the message sub-queue 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 by the embodiment, taking the client a and the client B as an example, when the client a and the client B communicate, the message is forwarded through the server. And after the connection between the A and the server is disconnected, the B sends a plurality of messages to the A, and the server stores the messages to an offline message list of the A. When A is connected with the server again, sending a request offline message to the server, wherein the server has the following processing modes after receiving the request:
1) The offline message request sent by the A enters a message queue management module of the server.
2) After receiving the offline message request, the server triggers 2 processes: creating a queue and deleting a queue. If the offline message request is the first offline message request, the queue deletion process is not triggered.
3) Creating a queue: and calling the sub-queue module to generate 1 message sub-queue. The message sub-queue may include a queue head intercepted portion of data of the offline message obtained from the offline message list, and put the data into the sub-queue.
4) And (3) deleting the queue: the off-line message request carries the serial 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 deletes the message sub-queue and simultaneously deletes the offline messages belonging to the part of the message sub-queue in the offline message list.
5) The sub-queue module will return the newly created message sub-queue to a.
6) If the sub-queue module finds that all offline messages containing the user are empty, the sub-queue module returns an empty message sub-queue.
The specific implementation procedures and derivatives thereof of the above embodiments are within the scope of the present invention.
Corresponding to the method described in fig. 1, an embodiment of the present invention further provides an offline message processing apparatus, which is used for implementing the method in fig. 1 specifically, where the offline message processing apparatus provided in the embodiment of the present invention is applied to a server, where 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, and a schematic structural 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 is switched from an offline state to an online state, and execute an offline message operation corresponding to each offline message request;
an operation unit 402, configured to execute the offline message operation process, 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 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 off-line message request is not the first off-line message request, deleting a previous message sub-queue corresponding to the previous off-line message request and off-line messages contained in the previous message sub-queue in the off-line message list, copying target off-line messages corresponding to the message sending quantity from the off-line 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 to the sending end by the sending end, the offline message is stored in the offline message list. When the receiving end is switched from the off-line state to the on-line state, the server receives at least one off-line message request sent by the receiving end, and after the current off-line message request is received, a current message sub-queue corresponding to the request is created, and whether the current off-line message request is the first off-line message request or not is determined. If yes, copying at least one off-line message from the off-line message list according to the message sending quantity as a target off-line message, storing the target off-line message in a current message sub-queue, sending the current message sub-queue to a receiving end, and obtaining the off-line message from the current message sub-queue by the receiving end. If the offline message is not requested for the first time, the last message sub-queue corresponding to the last request is deleted, the offline messages stored in the last message sub-queue in the offline message list are deleted, the unsent offline messages are obtained from the offline message list again according to the message sending quantity to the current message sub-queue, and the message sub-queue in which the offline messages are stored is sent to the receiving end.
By applying the method provided by the embodiment of the invention, the offline message is sent according to the queue form after the offline message request is received each time, so that messiness of the message is avoided.
In the apparatus provided in the embodiment of the present invention, the operation unit 402 includes:
a first obtaining subunit, configured to obtain a queue identifier included in the current offline message request;
the detection subunit is used for detecting whether the queue identification bit contains a queue number;
a first determining subunit, configured to determine that the queue identification bit is empty and the current offline message request is a first offline message request if the queue identification bit does not include a queue number;
and a second determining subunit, configured to determine that the current offline message request is not a first offline message request if the queue identification bit contains a queue number.
In the apparatus provided in 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 replication sub-unit is used for replicating the target offline messages corresponding to the message sending quantity from the offline message list to the current message sub-queue according to the replication 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 configured to send, to the receiving end, the current message sub-queue whose offline message is empty when the offline message list is an 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 the next off-line message request within a preset waiting time period in real time;
and the deleting subunit is configured to delete the current message sub-queue when the receiving end does not send a next offline message request within a preset waiting time period.
The specific working processes of each unit and sub-unit in the offline message processing apparatus disclosed in the above embodiment of the present invention may refer to corresponding contents in the offline message processing method disclosed in the above embodiment of the present invention, and are not described herein again.
The embodiment of the invention also provides a storage medium, which comprises a stored instruction, wherein when the instruction runs, the device where the storage medium is located is controlled to execute the offline message processing method.
An electronic device is provided in an embodiment of the present invention, and the structural diagram of the electronic device is shown in fig. 5, which specifically includes a memory 501 and one or more instructions 502, where the one or more instructions 502 are stored in the memory 501, and are configured to be executed by one or more processors 503 to perform the following operations according to the one or more instructions 502:
when the receiving end is switched from an off-line state to an on-line state, receiving at least one off-line message request sent by the receiving end, and executing off-line message operation corresponding to each off-line message request;
wherein, executing the offline message operation process comprises: 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 a 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 off-line message request is not the first off-line message request, deleting the last message sub-queue corresponding to the last off-line message request and off-line messages contained in the off-line message list and belonging to the last message sub-queue, copying target off-line messages corresponding to the message sending quantity from the off-line message list to the current message sub-queue, and then sending the current message sub-queue to the receiving end.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, the system or system embodiments are substantially similar to the method embodiments and therefore are described in a relatively simple manner, and reference may be made to some of the descriptions of the method embodiments for related points. The above-described system and system embodiments are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Those of skill would further appreciate that the various illustrative elements and algorithm steps 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 implementation. 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 (10)

1. An offline message processing method is applied to a server, where the server includes an offline message list corresponding to a receiving end, and the offline message list is used to store at least one offline message sent by a sending end to the receiving end in an offline state, and the method includes:
when the receiving end is switched from the off-line state to the on-line state, receiving at least one off-line message request sent by the receiving end, and executing off-line message operation corresponding to each off-line message request;
wherein the executing the offline message operation process comprises: 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 a 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 off-line message request is not the first off-line message request, deleting a previous message sub-queue corresponding to the previous off-line message request and off-line messages contained in the previous message sub-queue in the off-line message list, copying target off-line messages corresponding to the message sending quantity from the off-line message list to the current message sub-queue, and then sending the current message sub-queue to the receiving end.
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 the copying the target offline message corresponding to the message sending number from the offline message list to the current message sub-queue comprises:
determining a preset replication 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.
4. The method according to claim 3, wherein after deleting a previous message sub-queue corresponding to a previous offline message request and the offline message included in the previous message sub-queue in the offline message list, the method further comprises:
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 the current message sub-queue with empty offline messages to the receiving end.
5. The method of claim 1, wherein after sending the current message sub-queue to the receiving end, further comprising:
monitoring whether the receiving end sends a next off-line message request within a preset waiting time period or not in real time;
and when the receiving end does not send the next off-line message request within a preset waiting time period, deleting the current message sub-queue.
6. 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 the receiving end in an offline state, and the apparatus includes:
the receiving unit is used for receiving at least one off-line message request sent by the receiving end when the receiving end is switched from an off-line state to an on-line state, and executing off-line message operation corresponding to each off-line message request;
an operation unit, configured to execute the offline message operation process, 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 a 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 off-line message request is not the first off-line message request, deleting a previous message sub-queue corresponding to the previous off-line message request and off-line messages contained in the previous message sub-queue in the off-line message list, copying target off-line messages corresponding to the message sending quantity from the off-line message list to the current message sub-queue, and then sending the current message sub-queue to the receiving end.
7. The apparatus of claim 6, wherein the operation unit comprises:
a first obtaining subunit, configured to obtain a queue identification bit included in the current offline message request;
the detection subunit is used for detecting whether the queue identification bit contains a queue number;
a first determining subunit, configured to determine that the queue identification bit is empty and the current offline message request is a first offline message request if the queue identification bit does not include a queue number;
and a second determining subunit, configured to determine that the current offline message request is not a first offline message request if the queue identification bit contains a queue number.
8. The apparatus of claim 6, wherein the operation unit comprises:
a third determining subunit, configured to determine a copy rule corresponding to each offline message in the preset offline message list;
and the replication sub-unit is used for replicating the target offline messages corresponding to the message sending quantity from the offline message list to the current message sub-queue according to the replication rule.
9. The apparatus of claim 8, 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 configured to send, to the receiving end, the current message sub-queue whose offline message is empty when the offline message list is an empty offline message list.
10. The apparatus of claim 6, further comprising:
the monitoring subunit is used for monitoring whether the receiving end sends the next off-line message request within a preset waiting time period in real time;
and the deleting subunit is configured to delete the current message sub-queue when the receiving end does not send a 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 true CN115314457A (en) 2022-11-08
CN115314457B 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
CN115314457B (en) 2024-04-19

Similar Documents

Publication Publication Date Title
US8600363B2 (en) Synchronization in unified messaging systems
JP2019533235A5 (en)
CN108696581B (en) Distributed information caching method and device, computer equipment and storage medium
CN103338243A (en) Method and system for updating cache data of Web node
CN115004673B (en) Message pushing method, device, electronic equipment and computer readable medium
CN110751458B (en) Business approval method, device and system
US20190340036A1 (en) Digital Processing System for Event and/or Time Based Triggering Management, and Control of Tasks
CN112860342A (en) Method, device, equipment, system and storage medium for microservice configuration
CN112395259A (en) File operating system, operating method, computer equipment and medium
JP4612714B2 (en) Data processing method, cluster system, and data processing program
CN107818027B (en) Method and device for switching main name node and standby name node and distributed system
CN115314457B (en) Offline message processing method and device
CN109542841B (en) Method for creating data snapshot in cluster and terminal equipment
JP2007287041A (en) Download system and download method
CN115827778A (en) Data acquisition method and device, electronic equipment and storage medium
CN113472638B (en) Edge gateway control method, system, device, electronic equipment and storage medium
CN115658745A (en) Data processing method, data processing device, computer equipment and computer readable storage medium
CN113946275B (en) Cache management method and device and storage medium
CN114615263A (en) Cluster online migration method, device, equipment and storage medium
CN114449040A (en) Configuration issuing method and device based on cloud platform
CN107911356B (en) Intelligent device discovery method, device, control end and system
CN111767113A (en) Method and device for realizing container eviction
JP2016018222A (en) Queue server
CN113360689B (en) Image retrieval system, method, related device and computer program product
CN111026048B (en) Data processing method, device and storage medium

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