Offline message transmission method and device, electronic equipment and readable medium
By receiving and storing message version numbers on the server side, and sending offline messages when the client goes online, it solves the problem of incomplete message synchronization across multiple terminals, enables users to view complete historical messages on any device, and improves user experience.
Patent Information
- Application Number
- CN202410879997.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-02
- Publication Date
- 2024-09-06
AI Technical Summary
During multi-terminal message roaming, message synchronization between user devices is incomplete, resulting in the loss of historical messages and affecting user experience.
By receiving and storing messages and their version numbers on the server, the client sends a synchronization request when it comes online. The server searches for and delivers target offline messages based on the version number, ensuring that messages are stored locally on the client and achieving multi-client synchronization.
Users can view complete historical messages on any client, which improves user experience and convenience.
Smart Images

Figure CN118612175A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communication technology, and in particular to an offline message transmission method, an offline message transmission device, an electronic device and a computer-readable medium. Background Art
[0002] With the rapid development of mobile Internet, people's demand for instant messaging is getting higher and higher. In today's environment where smart devices are popular, users usually use multiple terminal devices such as smartphones, tablets, computers, etc. for communication. Communication applications usually have the problem of incomplete message synchronization during multi-terminal message roaming. For example, after a user changes the device to go online, the messages generated during the use of other devices are usually not directly synchronized to the current device, resulting in the loss of historical messages and poor user experience. Summary of the invention
[0003] The embodiment of the present invention provides an offline message transmission method, device, electronic device and computer-readable storage medium to solve the problem that historical messages may be missing.
[0004] An embodiment of the present invention discloses an offline message transmission method, which is applied to a server, wherein the server is in communication connection with at least one client, and the method comprises:
[0005] Receive and store messages sent by any user through the client, as well as the version number corresponding to the message;
[0006] For any of the clients, receiving a message synchronization request sent by the client when the client goes online; the message synchronization request records a user identifier and a first version number of the latest message stored locally by the client;
[0007] In the message corresponding to the user identifier, searching, based on the version number, for a target offline message generated later than the message corresponding to the first version number;
[0008] The target offline message is sent to the client.
[0009] Optionally, the step of searching, in the message corresponding to the user identifier, based on the version number, for a target offline message generated later than the message corresponding to the first version number includes:
[0010] Searching for a second version number of the latest message corresponding to the user identifier in the messages stored in the server;
[0011] Compare the first version number and the second version number to see if they are the same;
[0012] If the first version number is different from the second version number, in the message corresponding to the user identifier, a target offline message generated later than the message corresponding to the first version number is searched based on the version number.
[0013] Optionally, the message synchronization request also records a device identifier;
[0014] The method further comprises:
[0015] Creating a device online status table; the device online status table is used to record the user ID of the user, and the device ID and online status of the client held by the user;
[0016] After the step of receiving, for any of the clients, a message synchronization request sent by the client when the client goes online, the method further includes:
[0017] Based on the device identification recorded in the message synchronization request, the online status of the client corresponding to the device identification in the device online status table is updated to online.
[0018] Optionally, the method further comprises:
[0019] When receiving a message generated for a target user, sending a version number update notification to a target online client corresponding to the target user; wherein the target online client is a client whose online status is online corresponding to the target user in the device online status table;
[0020] Receiving a message synchronization request sent by the target online client based on the version number update notification;
[0021] Based on the message synchronization request, the message generated for the target user is sent to the target online client.
[0022] Optionally, the method further comprises:
[0023] Establishing a communication connection with an online client in a long connection form; the online client is a client whose online status is online in the device online status table;
[0024] If it is detected that the client whose online status is online is disconnected from the communication connection, in the device online status table, the online status of the online client is updated to offline;
[0025] Stop sending version number update notifications to clients whose online status is offline.
[0026] Optionally, the step of sending the target offline message to the client includes:
[0027] Merging and compressing the target offline message to obtain a compressed offline message;
[0028] The compressed offline message is sent to the client.
[0029] The embodiment of the present invention further provides an offline message transmission method, which is applied to a client, the client is connected to a server for communication, and the method includes:
[0030] When the client goes online, a message synchronization request is sent to the server; the message synchronization request records the user identifier and the first version number of the latest message stored locally on the client;
[0031] A target offline message sent by a server is received; the target offline message is a message corresponding to the user identifier stored in the server and generated later than the message corresponding to the first version number.
[0032] Optionally, the message synchronization request also records a device identifier;
[0033] Optionally, the method further comprises:
[0034] When the online status of the client is online, receiving a version number update notification sent by the server; the version number update notification is sent to a target online client corresponding to a target user; the target online client is a client corresponding to the target user whose online status is online;
[0035] Based on the version number update notification, sending a message synchronization request to the server;
[0036] Obtain a message sent by the server to the target user.
[0037] Optionally, after going online, the client establishes a communication connection with the server in the form of a long connection.
[0038] Optionally, the step of receiving a target offline message sent by the server includes:
[0039] Receive the compressed offline message sent by the server;
[0040] The compressed offline message is decompressed to obtain at least one target offline message.
[0041] The embodiment of the present invention further provides an offline message transmission system, the offline message transmission system comprising a server and at least one client in communication connection with the server;
[0042] The server is used to receive and store messages sent by any user through the client, as well as version numbers corresponding to the messages;
[0043] The client is used to send a message synchronization request to the server when going online; the message synchronization request records the user identifier and the first version number of the latest message stored locally on the client;
[0044] The server is used to receive the message synchronization request sent by the client, and search for a target offline message generated later than the message corresponding to the first version number in the message corresponding to the user identifier based on the version number, and send the target offline message to the client;
[0045] The client is used to receive a target offline message sent by the server.
[0046] Optionally, the server is specifically used to search for the second version number of the latest message corresponding to the user identifier in the messages stored in the server, compare whether the first version number is the same as the second version number, and if the first version number is different from the second version number, search for a target offline message that is generated later than the message corresponding to the first version number in the message corresponding to the user identifier based on the version number.
[0047] Optionally, the message synchronization request also records a device identifier;
[0048] The server is specifically used to create a device online status table; the device online status table is used to record the user ID of the user, as well as the device ID and online status of the client held by the user, and based on the device ID recorded in the message synchronization request, update the online status of the client corresponding to the device ID in the device online status table to online.
[0049] Optionally, the server is specifically configured to send a version number update notification to a target online client corresponding to the target user when receiving a message generated for the target user; wherein the target online client is a client whose online status is online and corresponding to the target user in the device online status table;
[0050] The target online client is specifically used to receive a version number update notification sent by the server, and based on the version number update notification, send a message synchronization request to the server;
[0051] The server is specifically configured to receive a message synchronization request sent by the target online client based on the version number update notification, and based on the message synchronization request, send the message generated for the target user to the target online client.
[0052] The target online client is used to receive the message generated for the target user.
[0053] Optionally, the client is used to establish a communication connection with the server in a persistent connection form after going online;
[0054] The server is specifically used to update the online status of the online client to offline in the device online status table if it detects that the client with an online status is online disconnects the communication connection; stop sending version number update notifications to the client with an online status of offline; the online client is a client with an online status of online in the device online status table.
[0055] Optionally, the server is specifically used to merge and compress the target offline message to obtain a compressed offline message, and send the compressed offline message to the client;
[0056] The client is specifically used to receive a compressed offline message sent by a server, and decompress the compressed offline message to obtain at least one target offline message.
[0057] The embodiment of the present invention further provides an offline message transmission device, which is applied to a server, the server is communicatively connected with at least one client, and the device includes:
[0058] A message storage module, used to receive and store messages sent by any user through the client, and the version number corresponding to the message;
[0059] A first synchronization request receiving module is used to receive a message synchronization request sent by any of the clients when the client goes online; the message synchronization request records a user identifier and a first version number of the latest message stored locally by the client;
[0060] A first offline message search module, configured to search, in the messages corresponding to the user identifier, based on the version number, for a target offline message generated later than the message corresponding to the first version number;
[0061] The message sending module is used to send the target offline message to the client.
[0062] Optionally, the first offline message search module includes:
[0063] A latest version number search submodule, used to search the second version number of the latest message corresponding to the user identifier in the messages stored in the server;
[0064] A version number comparison submodule, used to compare whether the first version number is the same as the second version number;
[0065] The offline message search submodule is used to search, based on the version number, for a target offline message generated later than the message corresponding to the first version number in the message corresponding to the user identifier if the first version number is different from the second version number.
[0066] Optionally, the message synchronization request also records a device identifier;
[0067] The device also includes:
[0068] A status table creation module is used to create a device online status table; the device online status table is used to record the user ID of the user, and the device ID and online status of the client held by the user;
[0069] The online status recording module is used to update the online status of the client corresponding to the device identifier in the device online status table to online based on the device identifier recorded in the message synchronization request.
[0070] Optionally, the device further comprises:
[0071] A version number update notification module, configured to send a version number update notification to a target online client corresponding to the target user upon receiving a message generated for the target user; wherein the target online client is a client corresponding to the target user in the device online status table and whose online status is online;
[0072] A second synchronization request receiving module, configured to receive a message synchronization request sent by the target online client based on the version number update notification;
[0073] The second offline message search module sends the message generated for the target user to the target online client based on the message synchronization request.
[0074] Optionally, the device further comprises:
[0075] A long connection establishment module, used to establish a communication connection with an online client in the form of a long connection; the online client is a client whose online status is online in the device online status table;
[0076] An online status updating module, configured to update the online status of the online client to offline in the device online status table if it is detected that the client with the online status is online disconnects the communication connection;
[0077] The notification stop module is used to stop sending version number update notifications to clients whose online status is offline.
[0078] Optionally, the message sending module includes:
[0079] A message compression submodule, used for merging and compressing the target offline message to obtain a compressed offline message;
[0080] The compressed message sending submodule is used to send the compressed offline message to the client.
[0081] The embodiment of the present invention further provides an offline message transmission device, which is applied to a client, the client is connected to a server for communication, and the device includes:
[0082] A first synchronization request sending module, used to send a message synchronization request to the server when the client goes online; the message synchronization request records the user identifier and the first version number of the latest message stored locally on the client;
[0083] The first offline message receiving module is used to receive a target offline message sent by a server; the target offline message is a message corresponding to the user identifier stored in the server and generated later than the message corresponding to the first version number.
[0084] Optionally, the message synchronization request also records a device identifier;
[0085] Optionally, the device further comprises:
[0086] An update notification receiving module, used for receiving a version number update notification sent by a server when the online status of the client is online; the version number update notification is sent to a target online client corresponding to a target user; the target online client is a client corresponding to the target user whose online status is online;
[0087] A second synchronization request sending module, synchronously updating the notification based on the version number, and sending a message synchronization request to the server;
[0088] The second offline message receiving module is used to obtain the message sent by the server to the target user.
[0089] Optionally, after going online, the client establishes a communication connection with the server in the form of a long connection.
[0090] Optionally, the first offline message receiving module includes:
[0091] The compressed message receiving submodule is used to receive the compressed offline message sent by the server;
[0092] The decompression submodule is used to decompress the compressed offline message to obtain at least one target offline message.
[0093] The embodiment of the present invention further discloses an electronic device, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;
[0094] The memory is used to store computer programs;
[0095] The processor is used to implement the method described in the embodiment of the present invention when executing the program stored in the memory.
[0096] The embodiment of the present invention further discloses one or more computer-readable media on which instructions are stored. When executed by one or more processors, the processors are enabled to execute the method described in the embodiment of the present invention.
[0097] The embodiments of the present invention include the following advantages:
[0098] Through the offline message transmission method provided by the embodiment of the present invention, the message sent by any user through the client and the version number corresponding to the message are received and stored; for any of the clients, a message synchronization request sent by the client when it goes online is received; the message synchronization request records the user ID and the first version number of the latest message stored locally by the client; in the message corresponding to the user ID, the target offline message generated later than the message corresponding to the first version number is searched based on the version number; the target offline message is sent to the client. In this way, multi-client synchronization of messages can be achieved based on the version number of the message, and the information is stored locally on the client, so that the user can view the complete historical messages on any client, which improves the user's convenience. BRIEF DESCRIPTION OF THE DRAWINGS
[0099] Figure 1 is a flowchart of the steps of an offline message transmission method provided in an embodiment of the present invention;
[0100] Figure 2 is a flowchart of another offline message transmission method provided in an embodiment of the present invention;
[0101] Figure 3 It is a flowchart of an offline message transmission method provided in an embodiment of the present invention;
[0102] Figure 4 is a flow chart of another offline message transmission method provided in an embodiment of the present invention;
[0103] Figure 5 is a structural diagram of an offline message transmission system provided in an embodiment of the present invention;
[0104] Figure 6 is a structural block diagram of an offline message transmission device provided in an embodiment of the present invention;
[0105] Figure 7 is a structural block diagram of another off-line message transmission device provided in an embodiment of the present invention;
[0106] Figure 8 is a block diagram of an electronic device provided in an embodiment of the present invention;
[0107] Fig. 9 is a schematic diagram of a computer-readable medium provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0108] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0109] Reference Figure 1 , shows a flowchart of the steps of an offline message transmission method provided in an embodiment of the present invention, which is applied to a server, and the server is in communication connection with at least one client, and specifically may include the following steps:
[0110] Step 101, receiving and storing a message sent by any user through the client, and a version number corresponding to the message;
[0111] In order to realize message roaming when a user uses multiple devices, the embodiments of the present invention can store messages generated in an instant messaging service. At the same time, each message can also have a unique version number, which can be assigned to the message by the server after obtaining the message, and the version number can be stored together.
[0112] When using instant messaging services, users can send messages to other users through their own instant messaging service clients, and can also receive messages sent by other users through the client. The client can upload the message to be sent to the server, which will be forwarded to the client of the corresponding user. In this way, the server can receive messages sent by any user through the client. Afterwards, the server can generate a unique version number for each message, and store the message and the version number corresponding to the message.
[0113] Step 102: for any of the clients, receiving a message synchronization request sent by the client when the client goes online; the message synchronization request records a user identifier and a first version number of the latest message stored locally by the client;
[0114] For any client, if the user accesses the server through the client itself and obtains the instant messaging service, the client can be considered to be logged in. At this time, during the offline process between the last time the client was online and the current login, the user may have accessed the instant messaging service through other clients and received and / or sent messages, but the client did not obtain this information due to being offline, resulting in missing historical messages. In order to obtain the missing historical messages, the client can send a message synchronization request to the server when it goes online to request to obtain the messages generated during the offline process.
[0115] Specifically, the message synchronization request may record a user identifier, so that the server can search for messages generated for the user according to the user identifier, including messages sent to the user and messages sent by the user.
[0116] The message synchronization request may record the first version number of the latest message stored locally by the client, so as to inform the server of the latest message currently stored by the client, so as to facilitate the server to determine the messages missing from the client.
[0117] Step 103, searching, in the message corresponding to the user identifier, based on the version number, for a target offline message generated later than the message corresponding to the first version number;
[0118] In a specific implementation, a message may be associated with a user identifier. If a message is sent by a certain user, or is received by the user, the message may be associated with the user identifier of the user. Thus, the server may search for messages generated for the user according to the user identifier as messages corresponding to the user identifier. Messages may form a message queue arranged in chronological order based on version numbers. Thus, the server may search for messages generated later than the messages corresponding to the first version number in the messages corresponding to the user identifier based on the version number, that is, messages that were not synchronized to the client during the client offline process, thereby obtaining the target offline message.
[0119] Step 104: Send the target offline message to the client.
[0120] Afterwards, the target offline message can be sent to the client, so that the client can obtain the messages generated by the user during the offline process, realizing multi-terminal synchronization of messages. The client can store the messages locally, and even if the server deletes the stored messages later, the client can still retain the user's messages, allowing the user to view his or her historical messages on any client.
[0121] Through the offline message transmission method provided by the embodiment of the present invention, the message sent by any user through the client and the version number corresponding to the message are received and stored; for any of the clients, a message synchronization request sent by the client when it goes online is received; the message synchronization request records the user ID and the first version number of the latest message stored locally by the client; in the message corresponding to the user ID, the target offline message generated later than the message corresponding to the first version number is searched based on the version number; the target offline message is sent to the client. In this way, multi-client synchronization of messages can be achieved based on the version number of the message, and the information is stored locally on the client, so that the user can view the complete historical messages on any client, which improves the user's convenience.
[0122] In an embodiment of the present invention, the step of searching, in the message corresponding to the user identifier, based on the version number, for a target offline message generated later than the message corresponding to the first version number includes:
[0123] S11, searching the messages stored in the server for a second version number of the latest message corresponding to the user identifier;
[0124] In a specific implementation, the server can confirm whether the client has any unsynchronized offline messages. Thus, the server can first search for the second version number of the latest message corresponding to the user identifier from the stored messages.
[0125] In a specific implementation, the server may store the version numbers corresponding to the user identifiers in chronological order. For example, the version number may contain information associated with time, so that the server may directly sort the version numbers in chronological order based on the information associated with time in the version number. For another example, when storing a message, the server may further record the timestamp corresponding to the message, and then the server may sort the version numbers in chronological order based on the timestamp corresponding to the message.
[0126] Afterwards, due to the one-to-one correspondence between messages and version numbers, the latest version number generated in the chronological order is the version number of the latest message corresponding to the user identifier, and this version number is used as the second version number.
[0127] S12, comparing whether the first version number is the same as the second version number;
[0128] Afterwards, the first version and the second version numbers can be compared to see if they are the same, to confirm whether the messages stored locally on the client have been synchronized with the messages stored on the server. If the first version and the second version numbers are the same, it can be considered that the client has not generated any new messages during the offline process. At this time, the messages stored locally on the client are the same as the messages stored on the server. The client and the server are in a synchronized state, and there are no offline messages that need to be obtained. If the first version and the second version numbers are different, it can be considered that the client has generated new messages during the offline process. At this time, the messages stored locally on the client are different from the messages stored on the server, and the client needs to obtain offline messages and synchronize with the server.
[0129] S13: If the first version number is different from the second version number, searching, based on the version number, for a target offline message generated later than the message corresponding to the first version number in the message corresponding to the user identifier.
[0130] If the first version number is different from the second version number, the client needs to obtain the messages generated during the offline process. Specifically, the messages corresponding to the user identifier can also be arranged in chronological order. The server can first determine the message corresponding to the first version number, and take the messages corresponding to the first version number that are later in chronological order as the messages that need to be synchronized to obtain the target offline message. The server can determine the target version number that is later than the first version number among the version numbers arranged in chronological order, and extract the corresponding message based on the target version number to obtain the target offline message.
[0131] In addition, the message synchronization request may also include a timestamp of the time when the request was sent, so that the server can process the message synchronization request from at least one client in chronological order according to actual needs.
[0132] In one embodiment of the present invention, the message synchronization request further records a device identification;
[0133] The method further comprises:
[0134] S21, creating a device online status table; the device online status table is used to record the user ID of the user, and the device ID and online status of the client held by the user;
[0135] In a specific implementation, in order to better manage multiple clients of a user and make the synchronization of messages more real-time and accurate, it is possible to manage whether the client of the user is online. Thus, a device online status table can be generated. The device online status table can record the user ID of the user and the device ID of the client held by the user, and can also record the online status of the client.
[0136] After the step of receiving, for any of the clients, a message synchronization request sent by the client when the client goes online, the method further includes:
[0137] S31: Based on the device identifier recorded in the message synchronization request, update the online status of the client corresponding to the device identifier in the device online status table to online.
[0138] When receiving a message synchronization request sent by a client when it comes online, the server can determine that the client has changed from offline to online. As a result, the server can obtain the device identifier recorded in the message synchronization request and update the online status of the client corresponding to the device identifier in the device online status table to online, so as to facilitate the subsequent management of the online devices.
[0139] Optionally, the method further comprises:
[0140] S41, when receiving a message generated for a target user, sending a version number update notification to a target online client corresponding to the target user; wherein the target online client is a client whose online status is online corresponding to the target user in the device online status table;
[0141] Specifically, for a target user, if the server receives a message generated for the target user, that is, a message sent by the target user, or the target user receives a message sent by other users. At this time, in order to keep multiple online clients synchronized, the client corresponding to the target user can be searched in the device online status table, and the client with the online status as online can be extracted from the client corresponding to the target user as the target online client. A version number update notification is sent to the target online client to inform the current online client that there is an updated message.
[0142] S42, receiving a message synchronization request sent by the target online client based on the version number update notification;
[0143] After receiving the version number update notification, the target online client can request the server to send the latest message. Thus, the target online client can respond to the version number update notification and generate a message synchronization request. The message synchronization request can be similar to the message synchronization request sent when going online, which records the user ID and the first version number of the latest message stored locally by the client, so that the server can find the offline message that has not been synchronized with the client and send it.
[0144] S43: Based on the message synchronization request, the message generated for the target user is sent to the target online client.
[0145] The server can search for messages generated for the user according to the user ID as messages corresponding to the user ID. Messages can form a message queue arranged in chronological order based on version numbers, so that the server can search for messages generated later than the message corresponding to the first version number in the messages corresponding to the user ID based on the version number, obtain updated messages generated for the target user, and send the messages generated for the target user to the target online client, thereby achieving message synchronization.
[0146] Optionally, the message may have a reading status, which may include read and unread. When the message generated for the target user is sent to the target online client, the reading status of the message may be further sent. If the user has read the message on a certain client, the reading status of the message changes from unread to read. The client may send the read status of the message to the server, and the server may further synchronize the read status to other online clients of the user, thereby further improving the real-time nature of message synchronization.
[0147] In one embodiment of the present invention, the method further comprises:
[0148] S51, establishing a communication connection with an online client in a long connection form; the online client is a client whose online status is online in the device online status table;
[0149] Specifically, in order to transmit messages more efficiently, a communication connection is established between the server and the online client through a persistent connection. For example, a persistent connection between the server and the online client can be established through the WebSocket protocol. As a result, the client whose online status is online in the device online status table can always maintain communication with the server.
[0150] S52, if it is detected that the client whose online status is online is disconnected from the communication connection, in the device online status table, the online status of the online client is updated to offline;
[0151] If the client goes offline, that is, changes from online status to offline status, the client can disconnect from the server. Therefore, the server can detect whether there is a client whose online status is online and disconnects the communication connection to confirm whether the client has gone offline. If it is detected that the client whose online status is online disconnects the communication connection, it can be considered that the client has gone offline and the online status needs to be changed to offline. The server can update the online status of the online client to offline in the device online status table.
[0152] S53, stop sending version number update notifications to the client whose online status is offline.
[0153] Since offline clients no longer need real-time synchronization messages, the server can stop sending version number update notifications to clients whose online status is offline, avoiding wasting processing resources.
[0154] Optionally, the step of sending the target offline message to the client includes:
[0155] S61, merging and compressing the target offline message to obtain a compressed offline message;
[0156] In a specific implementation, if the client is offline for a long time, it may generate a large number of unsynchronized offline messages. If the offline messages are directly sent to the client one by one, it may cause the client to freeze and waste the processing resources of the server. Therefore, before sending the target offline message, the target offline message can be merged and compressed first, so that at least one target offline message is compressed into one data packet to obtain a compressed offline message.
[0157] S62: Send the compressed offline message to the client.
[0158] Thereafter, the server may send the compressed offline message to the client, thereby reducing network transmission time and user traffic consumption, and improving message transmission efficiency.
[0159] Reference Figure 2 , shows a flowchart of the steps of an offline message transmission method provided in an embodiment of the present invention, which is applied to a client, the client is connected to a server for communication, and the method may specifically include the following steps:
[0160] Step 201, when the client goes online, a message synchronization request is sent to the server; the message synchronization request records the user identifier and the first version number of the latest message stored locally on the client;
[0161] In order to realize message roaming when a user uses multiple devices, the embodiments of the present invention can store messages generated in an instant messaging service. At the same time, each message can also have a unique version number, which can be assigned to the message by the server after obtaining the message, and the version number can be stored together.
[0162] When using instant messaging services, users can send messages to other users through their own instant messaging service clients, and can also receive messages sent by other users through the client. The client can upload the message to be sent to the server, which will be forwarded to the client of the corresponding user. In this way, the server can receive messages sent by any user through the client. Afterwards, the server can generate a unique version number for each message, and store the message and the version number corresponding to the message.
[0163] For any client, if the user accesses the server through the client itself and obtains the instant messaging service, the client can be considered to be logged in. At this time, during the offline process between the last time the client was online and the current login, the user may have accessed the instant messaging service through other clients and received and / or sent messages, but the client did not obtain this information due to being offline, resulting in missing historical messages. In order to obtain the missing historical messages, the client can send a message synchronization request to the server when it goes online to request to obtain the messages generated during the offline process.
[0164] Specifically, the message synchronization request may record a user identifier, so that the server can search for messages generated for the user according to the user identifier, including messages sent to the user and messages sent by the user.
[0165] The message synchronization request may record the first version number of the latest message stored locally by the client, so as to inform the server of the latest message currently stored by the client, so as to facilitate the server to determine the messages missing from the client.
[0166] Step 202, receiving a target offline message sent by a server; the target offline message is a message corresponding to the user identifier stored in the server and generated later than the message corresponding to the first version number.
[0167] In a specific implementation, a message may be associated with a user identifier. If a message is sent by a certain user, or is received by the user, the message may be associated with the user identifier of the user. Thus, the server may search for messages generated for the user according to the user identifier as messages corresponding to the user identifier. Messages may form a message queue arranged in chronological order based on version numbers. Thus, the server may search for messages generated later than the messages corresponding to the first version number in the messages corresponding to the user identifier based on the version number, that is, messages that were not synchronized to the client during the client offline process, thereby obtaining the target offline message.
[0168] Afterwards, the target offline message can be sent to the client, so that the client can obtain the messages generated by the user during the offline process, realizing multi-terminal synchronization of messages. The client can store the messages locally, and even if the server deletes the stored messages later, the client can still retain the user's messages, allowing the user to view his or her historical messages on any client.
[0169] Through the offline message transmission method provided by the embodiment of the present invention, when the client goes online, a message synchronization request is sent to the server; the message synchronization request records the user identifier and the first version number of the latest message stored locally by the client; the target offline message sent by the server is received; the target offline message is a message corresponding to the user identifier stored by the server, which is generated later than the message corresponding to the first version number. In this way, multi-client synchronization of messages can be achieved based on the version number of the message, and the information is stored locally on the client, so that the user can view the complete historical messages on any client, which improves the user's convenience.
[0170] In one embodiment of the present invention, the message synchronization request also records the device identification, so that the server can update the online status of the client corresponding to the device identification in its device online status table to online, so as to facilitate the subsequent management of the device in the online state.
[0171] In one embodiment of the present invention, the method further comprises:
[0172] When the online status of the client is online, receiving a version number update notification sent by the server; the version number update notification is sent to a target online client corresponding to a target user; the target online client is a client whose online status is online corresponding to the target user; based on the version number update notification, sending a message synchronization request to the server; obtaining a message generated for the target user and sent by the server.
[0173] Specifically, for a target user, if the server receives a message generated for the target user, that is, a message sent by the target user, or the target user receives a message sent by other users. At this time, in order to keep multiple online clients synchronized, the client corresponding to the target user can be searched in the device online status table, and the client corresponding to the target user can be extracted to send a version number update notification to the client whose online status is online, so as to inform the current online client that there is an updated message.
[0174] When the client is online, it can receive the version number update notification sent by the server. Afterwards, the client can respond to the version number update notification and generate a message synchronization request. The message synchronization request can be similar to the message synchronization request sent when going online, which records the user ID and the first version number of the latest message stored locally by the client, so that the server can find the offline messages that are not synchronized by the client and send them.
[0175] The server can search for messages generated for the user according to the user ID as messages corresponding to the user ID. Messages can form a message queue arranged in chronological order based on version numbers. Thus, the server can search for messages generated later than the message corresponding to the first version number in the messages corresponding to the user ID based on the version number, obtain updated messages generated for the target user, and send the messages generated for the target user to the client, thereby achieving message synchronization.
[0176] In one embodiment of the present invention, after going online, the client establishes a communication connection with the server in the form of a long connection.
[0177] Specifically, in order to transmit messages more efficiently, the server and the online client establish a communication connection through a persistent connection. At the same time, the server can also determine whether the client is still online based on whether the communication connection is disconnected.
[0178] In one embodiment of the present invention, the step of receiving a target offline message sent by the server includes:
[0179] Receive a compressed offline message sent by a server; decompress the compressed offline message to obtain at least one target offline message.
[0180] In a specific implementation, if the client is offline for a long time, it may generate a large number of unsynchronized offline messages. If the offline messages are directly sent to the client one by one, it may cause the client to freeze and waste the processing resources of the server. To this end, before sending the target offline message, the target offline message can be merged and compressed first, so that at least one target offline message is compressed into a data packet, and a compressed offline message is obtained and sent to the client.
[0181] After obtaining the compressed offline message, the client can decompress the compressed offline message to obtain at least one unsynchronized target offline message, thereby achieving message synchronization.
[0182] As a specific example of the present invention, Figure 3 It is a flowchart of an offline message transmission method provided in an embodiment of the present invention.
[0183] Step 1: Device 4 held by user B goes online and sends a message synchronization request to the server gateway;
[0184] Step 2: The server updates the device online status table based on the device identification recorded in the message synchronization request, and updates the online status of user B's device 4 to online.
[0185] Step 3: The business logic processing module in the server searches for a message generated later than the message corresponding to the first version number in the stored offline messages based on the first version number recorded in the message synchronization request, and uses the message as the target offline message;
[0186] Step 4: The server pushes the target offline message to the client 4 of user B through the gateway, thereby completing the message synchronization of the client 4 of user B.
[0187] As a specific example of the present invention, Figure 4 It is a flowchart of another offline message transmission method provided in an embodiment of the present invention.
[0188] Step 1: User A can send a message to user B through the client, thereby sending the message to the server.
[0189] Step 2: After the server obtains the message sent by user A, it can update the version number in the user B sequence in the version number service provided by the server, and write the version number corresponding to the message sent by user A into the user B sequence.
[0190] Step 3: The server may store the offline message sent by user A to user B in the offline message storage module in the server, and store the message and the corresponding version number of the message at the same time.
[0191] Step 4: After user B goes online through the client, the client can send a message synchronization request to the server, which carries the latest version number stored locally on the client;
[0192] Step 5: The server compares the latest version number stored locally on the client with the latest version number stored in the sequence of user B to determine whether the version numbers on both ends of the server and the client are the same.
[0193] Step 6: If the version numbers between the server and the client are different, obtain the target offline message generated later than the latest version number corresponding to the message stored locally on the client from the offline message storage, as well as the version number corresponding to the target offline message.
[0194] Step 7: The server pushes the target offline message and the version number corresponding to the target offline message to the client of user B to complete the synchronization of the offline message.
[0195] It should be noted that, for the sake of simplicity, the method embodiments are described as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.
[0196] Reference Figure 5 , showing a schematic structural diagram of an offline message transmission system provided in an embodiment of the present invention, the offline message transmission system comprises a server 501 and at least one client 502 which is in communication connection with the server;
[0197] The server 501 is used to receive and store messages sent by any user through the client, and the version number corresponding to the message;
[0198] The client 502 is used to send a message synchronization request to the server when going online; the message synchronization request records the user identifier and the first version number of the latest message stored locally on the client;
[0199] The server 501 is used to receive the message synchronization request sent by the client, and search for a target offline message generated later than the message corresponding to the first version number in the message corresponding to the user identifier based on the version number, and send the target offline message to the client;
[0200] The client 502 is used to receive the target offline message sent by the server.
[0201] Optionally, the server is specifically used to search for the second version number of the latest message corresponding to the user identifier in the messages stored in the server, compare whether the first version number is the same as the second version number, and if the first version number is different from the second version number, search for a target offline message that is generated later than the message corresponding to the first version number in the message corresponding to the user identifier based on the version number.
[0202] Optionally, the message synchronization request also records a device identifier;
[0203] The server is specifically used to create a device online status table; the device online status table is used to record the user ID of the user, as well as the device ID and online status of the client held by the user, and based on the device ID recorded in the message synchronization request, update the online status of the client corresponding to the device ID in the device online status table to online.
[0204] Optionally, the server is specifically configured to send a version number update notification to a target online client corresponding to the target user when receiving a message generated for the target user; wherein the target online client is a client whose online status is online and corresponding to the target user in the device online status table;
[0205] The target online client is specifically used to receive a version number update notification sent by the server, and based on the version number update notification, send a message synchronization request to the server;
[0206] The server is specifically configured to receive a message synchronization request sent by the target online client based on the version number update notification, and based on the message synchronization request, send the message generated for the target user to the target online client.
[0207] The target online client is used to receive the message generated for the target user.
[0208] Optionally, the client is used to establish a communication connection with the server in a persistent connection form after going online;
[0209] The server is specifically used to update the online status of the online client to offline in the device online status table if it detects that the client with an online status is online disconnects the communication connection; stop sending version number update notifications to the client with an online status of offline; the online client is a client with an online status of online in the device online status table.
[0210] Optionally, the server is specifically used to merge and compress the target offline message to obtain a compressed offline message, and send the compressed offline message to the client;
[0211] The client is specifically used to receive a compressed offline message sent by a server, and decompress the compressed offline message to obtain at least one target offline message.
[0212] Reference Figure 6 , shows a structural block diagram of an offline message transmission device provided in an embodiment of the present invention, which is applied to a server, and the server is in communication connection with at least one client. The device may specifically include the following modules:
[0213] The message storage module 601 is used to receive and store messages sent by any user through the client, as well as the version number corresponding to the message;
[0214] The first synchronization request receiving module 602 is used to receive a message synchronization request sent by any of the clients when the client goes online; the message synchronization request records a user identifier and a first version number of the latest message stored locally by the client;
[0215] A first offline message search module 603, configured to search, in the messages corresponding to the user identifier, based on the version number, for a target offline message generated later than the message corresponding to the first version number;
[0216] The message sending module 604 is used to send the target offline message to the client.
[0217] Optionally, the first offline message search module includes:
[0218] A latest version number search submodule, used to search the second version number of the latest message corresponding to the user identifier in the messages stored in the server;
[0219] A version number comparison submodule, used to compare whether the first version number is the same as the second version number;
[0220] The offline message search submodule is used to search, based on the version number, for a target offline message generated later than the message corresponding to the first version number in the message corresponding to the user identifier if the first version number is different from the second version number.
[0221] Optionally, the message synchronization request also records a device identifier;
[0222] The device also includes:
[0223] A status table creation module is used to create a device online status table; the device online status table is used to record the user ID of the user, and the device ID and online status of the client held by the user;
[0224] The online status recording module is used to update the online status of the client corresponding to the device identifier in the device online status table to online based on the device identifier recorded in the message synchronization request.
[0225] Optionally, the device further comprises:
[0226] A version number update notification module, configured to send a version number update notification to a target online client corresponding to the target user upon receiving a message generated for the target user; wherein the target online client is a client corresponding to the target user in the device online status table and whose online status is online;
[0227] A second synchronization request receiving module, configured to receive a message synchronization request sent by the target online client based on the version number update notification;
[0228] The second offline message search module sends the message generated for the target user to the target online client based on the message synchronization request.
[0229] Optionally, the device further comprises:
[0230] A long connection establishment module, used to establish a communication connection with an online client in the form of a long connection; the online client is a client whose online status is online in the device online status table;
[0231] An online status updating module, configured to update the online status of the online client to offline in the device online status table if it is detected that the client with the online status is online disconnects the communication connection;
[0232] The notification stop module is used to stop sending version number update notifications to clients whose online status is offline.
[0233] Optionally, the message sending module includes:
[0234] A message compression submodule, used for merging and compressing the target offline message to obtain a compressed offline message;
[0235] The compressed message sending submodule is used to send the compressed offline message to the client.
[0236] Reference Figure 7 , shows a structural block diagram of another offline message transmission device provided in an embodiment of the present invention, which is applied to a client, and the client is connected to a server for communication. The device may specifically include the following modules:
[0237] The first synchronization request sending module 701 is used to send a message synchronization request to the server when the client goes online; the message synchronization request records the user identifier and the first version number of the latest message stored locally on the client;
[0238] The first offline message receiving module 702 is used to receive a target offline message sent by the server; the target offline message is a message corresponding to the user identifier stored in the server and generated later than the message corresponding to the first version number.
[0239] Optionally, the message synchronization request also records a device identifier;
[0240] Optionally, the device further comprises:
[0241] An update notification receiving module, used for receiving a version number update notification sent by a server when the online status of the client is online; the version number update notification is sent to a target online client corresponding to a target user; the target online client is a client corresponding to the target user whose online status is online;
[0242] A second synchronization request sending module, synchronously updating the notification based on the version number, and sending a message synchronization request to the server;
[0243] The second offline message receiving module is used to obtain the message sent by the server to the target user.
[0244] Optionally, after going online, the client establishes a communication connection with the server in the form of a long connection.
[0245] Optionally, the first offline message receiving module includes:
[0246] The compressed message receiving submodule is used to receive the compressed offline message sent by the server;
[0247] The decompression submodule is used to decompress the compressed offline message to obtain at least one target offline message.
[0248] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0249] In addition, an embodiment of the present invention further provides an electronic device, such as Figure 8 As shown, it includes a processor 801, a communication interface 802, a memory 803 and a communication bus 804, wherein the processor 801, the communication interface 802, and the memory 803 communicate with each other through the communication bus 804.
[0250] Memory 803, used for storing computer programs;
[0251] The processor 801 is used to execute the program stored in the memory 803, and implements the following steps:
[0252] Receive and store messages sent by any user through the client, as well as the version number corresponding to the message;
[0253] For any of the clients, receiving a message synchronization request sent by the client when the client goes online; the message synchronization request records a user identifier and a first version number of the latest message stored locally by the client;
[0254] In the message corresponding to the user identifier, searching, based on the version number, for a target offline message generated later than the message corresponding to the first version number;
[0255] The target offline message is sent to the client.
[0256] Optionally, the step of searching, in the message corresponding to the user identifier, based on the version number, for a target offline message generated later than the message corresponding to the first version number includes:
[0257] Searching for a second version number of the latest message corresponding to the user identifier in the messages stored in the server;
[0258] Compare the first version number and the second version number to see if they are the same;
[0259] If the first version number is different from the second version number, in the message corresponding to the user identifier, a target offline message generated later than the message corresponding to the first version number is searched based on the version number.
[0260] Optionally, the message synchronization request also records a device identifier;
[0261] The method further comprises:
[0262] Creating a device online status table; the device online status table is used to record the user ID of the user, and the device ID and online status of the client held by the user;
[0263] After the step of receiving, for any of the clients, a message synchronization request sent by the client when the client goes online, the method further includes:
[0264] Based on the device identification recorded in the message synchronization request, the online status of the client corresponding to the device identification in the device online status table is updated to online.
[0265] Optionally, the method further comprises:
[0266] When receiving a message generated for a target user, sending a version number update notification to a target online client corresponding to the target user; wherein the target online client is a client whose online status is online corresponding to the target user in the device online status table;
[0267] Receiving a message synchronization request sent by the target online client based on the version number update notification;
[0268] Based on the message synchronization request, the message generated for the target user is sent to the target online client.
[0269] Optionally, the method further comprises:
[0270] Establishing a communication connection with an online client in a long connection form; the online client is a client whose online status is online in the device online status table;
[0271] If it is detected that the client whose online status is online is disconnected from the communication connection, in the device online status table, the online status of the online client is updated to offline;
[0272] Stop sending version number update notifications to clients whose online status is offline.
[0273] Optionally, the step of sending the target offline message to the client includes:
[0274] Merging and compressing the target offline message to obtain a compressed offline message;
[0275] The compressed offline message is sent to the client.
[0276] The processor 801, when used to execute the program stored in the memory 803, further implements the following steps:
[0277] When the client goes online, a message synchronization request is sent to the server; the message synchronization request records the user identifier and the first version number of the latest message stored locally on the client;
[0278] A target offline message sent by a server is received; the target offline message is a message corresponding to the user identifier stored in the server and generated later than the message corresponding to the first version number.
[0279] Optionally, the message synchronization request also records a device identifier;
[0280] Optionally, the method further comprises:
[0281] When the online status of the client is online, receiving a version number update notification sent by the server; the version number update notification is sent to a target online client corresponding to a target user; the target online client is a client corresponding to the target user whose online status is online;
[0282] Based on the version number update notification, sending a message synchronization request to the server;
[0283] Obtain a message sent by the server to the target user.
[0284] Optionally, after going online, the client establishes a communication connection with the server in the form of a long connection.
[0285] Optionally, the step of receiving a target offline message sent by the server includes:
[0286] Receive the compressed offline message sent by the server;
[0287] The compressed offline message is decompressed to obtain at least one target offline message.
[0288] The embodiment of the present invention further provides an offline message transmission system, the offline message transmission system comprising a server and at least one client in communication connection with the server;
[0289] The server is used to receive and store messages sent by any user through the client, as well as version numbers corresponding to the messages;
[0290] The client is used to send a message synchronization request to the server when going online; the message synchronization request records the user identifier and the first version number of the latest message stored locally on the client;
[0291] The server is used to receive the message synchronization request sent by the client, and search for a target offline message generated later than the message corresponding to the first version number in the message corresponding to the user identifier based on the version number, and send the target offline message to the client;
[0292] The client is used to receive a target offline message sent by the server.
[0293] Optionally, the server is specifically used to search for the second version number of the latest message corresponding to the user identifier in the messages stored in the server, compare whether the first version number is the same as the second version number, and if the first version number is different from the second version number, search for a target offline message that is generated later than the message corresponding to the first version number in the message corresponding to the user identifier based on the version number.
[0294] Optionally, the message synchronization request also records a device identifier;
[0295] The server is specifically used to create a device online status table; the device online status table is used to record the user ID of the user, as well as the device ID and online status of the client held by the user, and based on the device ID recorded in the message synchronization request, update the online status of the client corresponding to the device ID in the device online status table to online.
[0296] Optionally, the server is specifically configured to send a version number update notification to a target online client corresponding to the target user when receiving a message generated for the target user; wherein the target online client is a client whose online status is online and corresponding to the target user in the device online status table;
[0297] The target online client is specifically used to receive a version number update notification sent by the server, and based on the version number update notification, send a message synchronization request to the server;
[0298] The server is specifically configured to receive a message synchronization request sent by the target online client based on the version number update notification, and based on the message synchronization request, send the message generated for the target user to the target online client.
[0299] The target online client is used to receive the message generated for the target user.
[0300] Optionally, the client is used to establish a communication connection with the server in a persistent connection form after going online;
[0301] The server is specifically used to update the online status of the online client to offline in the device online status table if it detects that the client with an online status is online disconnects the communication connection; stop sending version number update notifications to the client with an online status of offline; the online client is a client with an online status of online in the device online status table.
[0302] Optionally, the server is specifically used to merge and compress the target offline message to obtain a compressed offline message, and send the compressed offline message to the client;
[0303] The client is specifically used to receive a compressed offline message sent by a server, and decompress the compressed offline message to obtain at least one target offline message.
[0304] The communication bus mentioned in the above terminal can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0305] The communication interface is used for communication between the above terminal and other devices.
[0306] The memory may include a random access memory (RAM) or a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0307] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0308] like Fig. 9 As shown, in another embodiment provided by the present invention, a computer-readable storage medium 901 is further provided, in which instructions are stored. When the computer-readable storage medium is run on a computer, the computer executes the offline message transmission method described in the above embodiment.
[0309] In another embodiment of the present invention, a computer program product including instructions is provided. When the computer program product is executed on a computer, the computer executes the offline message transmission method described in the above embodiment.
[0310] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk Solid State Disk (SSD)), etc.
[0311] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0312] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0313] The above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.
Claims
1. An offline message transmission method, characterized in that: The method is applied to a server, wherein the server is in communication connection with at least one client, and the method comprises: Receive and store messages sent by any user through the client, as well as the version number corresponding to the message; For any of the clients, receiving a message synchronization request sent by the client when the client goes online; the message synchronization request records a user identifier and a first version number of the latest message stored locally by the client; In the message corresponding to the user identifier, searching, based on the version number, for a target offline message generated later than the message corresponding to the first version number; The target offline message is sent to the client.
2. The method according to claim 1, characterized in that The step of searching, in the message corresponding to the user identifier, based on the version number, for a target offline message generated later than the message corresponding to the first version number includes: Searching for a second version number of the latest message corresponding to the user identifier in the messages stored in the server; Compare the first version number and the second version number to see if they are the same; If the first version number is different from the second version number, in the message corresponding to the user identifier, a target offline message generated later than the message corresponding to the first version number is searched based on the version number.
3. The method according to claim 1, characterized in that The message synchronization request also records a device identifier; The method further comprises: Create a device online status table; the device online status table is used to record the user ID of the user, and the device ID and online status of the client held by the user; After the step of receiving, for any of the clients, a message synchronization request sent by the client when the client goes online, the method further includes: Based on the device identification recorded in the message synchronization request, the online status of the client corresponding to the device identification in the device online status table is updated to online.
4. The method according to claim 3, characterized in that The method further comprises: When receiving a message generated for a target user, sending a version number update notification to a target online client corresponding to the target user; wherein the target online client is a client whose online status is online corresponding to the target user in the device online status table; Receiving a message synchronization request sent by the target online client based on the version number update notification; Based on the message synchronization request, the message generated for the target user is sent to the target online client.
5. The method according to claim 3, characterized in that: The method further comprises: Establishing a communication connection with an online client in a long connection form; the online client is a client whose online status is online in the device online status table; If it is detected that the client whose online status is online is disconnected from the communication connection, in the device online status table, the online status of the online client is updated to offline; Stop sending version number update notifications to clients whose online status is offline.
6. The method according to claim 1, characterized in that The step of sending the target offline message to the client includes: Merging and compressing the target offline message to obtain a compressed offline message; The compressed offline message is sent to the client.
7. An offline message transmission method, characterized in that: The method is applied to a client, the client is connected to a server for communication, and the method comprises: When the client goes online, a message synchronization request is sent to the server; the message synchronization request records the user identifier and the first version number of the latest message stored locally on the client; A target offline message sent by a server is received; the target offline message is a message corresponding to the user identifier stored in the server and generated later than the message corresponding to the first version number.
8. An offline message transmission system, characterized in that: The offline message transmission system includes a server and at least one client in communication connection with the server; The server is used to receive and store messages sent by any user through the client, as well as version numbers corresponding to the messages; The client is used to send a message synchronization request to the server when going online; The message synchronization request records a user identifier and a first version number of the latest message stored locally on the client; The server is used to receive the message synchronization request sent by the client, and search for a target offline message generated later than the message corresponding to the first version number in the message corresponding to the user identifier based on the version number, and send the target offline message to the client; The client is used to receive a target offline message sent by the server.
9. An offline message transmission device, characterized in that: The device is applied to a server, the server is connected to at least one client for communication, and the device comprises: A message storage module, used to receive and store messages sent by any user through the client, and the version number corresponding to the message; A first synchronization request receiving module is used to receive a message synchronization request sent by any of the clients when the client goes online; the message synchronization request records a user identifier and a first version number of the latest message stored locally by the client; A first offline message search module, configured to search, in the messages corresponding to the user identifier, based on the version number, for a target offline message generated later than the message corresponding to the first version number; The message sending module is used to send the target offline message to the client.
10. An offline message transmission device, characterized in that: It is applied to a client, the client is connected to a server for communication, and the device comprises: A first synchronization request sending module, used to send a message synchronization request to the server when the client goes online; the message synchronization request records the user identifier and the first version number of the latest message stored locally on the client; The first offline message receiving module is used to receive a target offline message sent by a server; the target offline message is a message corresponding to the user identifier stored in the server and generated later than the message corresponding to the first version number.
11. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; The memory is used to store computer programs; The processor is used to implement the method according to any one of claims 1 to 7 when executing the program stored in the memory.
12. A computer-readable medium having instructions stored thereon, which, when executed by one or more processors, cause the processors to perform the method according to any one of claims 1 to 7.
