WO2018095175A1 - Procédé de synchronisation de message de communication, procédé de copie de sauvegarde de données, dispositif et support de stockage - Google Patents
Procédé de synchronisation de message de communication, procédé de copie de sauvegarde de données, dispositif et support de stockage Download PDFInfo
- Publication number
- WO2018095175A1 WO2018095175A1 PCT/CN2017/107471 CN2017107471W WO2018095175A1 WO 2018095175 A1 WO2018095175 A1 WO 2018095175A1 CN 2017107471 W CN2017107471 W CN 2017107471W WO 2018095175 A1 WO2018095175 A1 WO 2018095175A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- message
- data
- communication
- session
- application client
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Ceased
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L65/00—Network arrangements, protocols or services for supporting real-time applications in data packet communication
- H04L65/40—Support for services or applications
Definitions
- the embodiments of the present invention relate to the field of Internet technologies, and in particular, to a communication message synchronization method, a data backup method, a device, and a storage medium.
- a user can log in to a social account in a different social application client.
- the user can log in to the social account of the social application client of the mobile phone, or log in to the social application client of the computer.
- Social account number For example, the user can log in to the social account of the social application client of the mobile phone, or log in to the social application client of the computer.
- the first social application client may acquire the stored communication message to be synchronized, and the obtained communication message is obtained. Sync to the second social application client. In this way, the user can view the received communication message in the second social application client.
- the first social application client and the second social application client are clients running in different platforms, for example, the first social application client runs in the mobile phone of the Android system, and the second social application client runs.
- the first social application client runs in the mobile phone of the Android system
- the second social application client runs.
- the first social application client since the encapsulation format of the data is different by different platforms, after the first social application client synchronizes the communication message to the second social application client, the second social application client may not be able to parse the communication. Message.
- the embodiment of the invention provides a communication message synchronization method, a data backup method, a device and a storage medium, which can solve the problems in the related art.
- the technical solutions are as follows:
- a communication message synchronization method for a first society
- the method includes:
- n pieces of communication messages to be synchronized in the first social application client and message types of each communication message where n is an integer greater than or equal to 1;
- the second social application client stores n pieces of message data to the data file in units of message blocks, and generates and stores correspondences; each message block Corresponding to at least one piece of message data, and corresponding to at least two pieces of message data, communication messages corresponding to at least two pieces of message data belong to the same session, and the second social application client is of the same type and share the same type as the first social application client
- the social account; the correspondence includes a correspondence between the message block, the session corresponding to the message block, and the storage location of the message block, and the session corresponding to the message block is the session to which the communication message corresponding to the message data in the message block belongs.
- a communication message synchronization method for use in a second social application client, the method comprising:
- each message data is Generating a message type including a communication message and data of the message content generated by the first social application client; each message block corresponds to at least one piece of message data, and when corresponding to at least two pieces of message data, the at least two messages The communication message corresponding to the data belongs to the same session;
- the correspondence relationship includes a correspondence between a message block, a session corresponding to the message block, and a storage location of the message block, where the session corresponding to the message block is in the message block The session to which the communication message corresponding to the message data belongs.
- a communication message synchronization apparatus for use in a first social application client, the apparatus comprising:
- a first acquiring module configured to acquire n pieces of communication messages to be synchronized in the first social application client and message types of each communication message, where n is an integer greater than or equal to 1;
- Generating a module configured, for each communication message, message data including a message type of the communication message and a message content of the communication message;
- a synchronization module configured to synchronously generate n pieces of message data in a message block unit to a second social application client;
- the second social application client stores n pieces of message data to the data file in a message block unit, Generating and saving a correspondence relationship;
- each message block corresponds to at least one piece of message data, and when corresponding to at least two pieces of message data, communication messages corresponding to at least two pieces of message data belong to the same session, and the second social application client and the first
- a social application client has the same type and shares the same social account;
- the correspondence includes a correspondence between a message block, a session corresponding to the message block, and a storage location of the message block, and the session corresponding to the message block is message data in the message block.
- a communication message synchronization apparatus for use in a second social application client, the apparatus comprising:
- a first receiving module configured to receive n pieces of message data that are synchronized by the first social application client in a message block unit; the first social application client is the same type as the second social application client and shares the same social account
- Each piece of message data is a message type including a communication message generated by the first social application client and data of the message content; each message block corresponds to at least one message data, and when corresponding to at least two message data The communication message corresponding to the at least two message data belongs to the same session;
- a storage module configured to store the n pieces of message data to the data file in units of the message block
- a generating module configured to generate and save a correspondence relationship, where the corresponding relationship includes a message block, a session corresponding to the message block, and a correspondence between storage locations of the message block, where the session corresponding to the message block is The session to which the communication message corresponding to the message data in the message block belongs.
- a terminal comprising: a processor and a memory, wherein the memory stores at least one instruction, the instruction is loaded and executed by the processor to implement the following operations :
- n communication messages to be synchronized in the first social application client and message types of each communication message, where n is an integer greater than or equal to 1;
- a terminal comprising: a processor and a memory, wherein the memory stores at least one instruction, the instruction is loaded and executed by the processor to implement the following operations :
- each message data is the a message type of a communication message generated by a social application client and data of the message content; each message block corresponds to at least one piece of message data, and when corresponding to at least two pieces of message data, the at least two message data The corresponding communication message belongs to the same session;
- the correspondence relationship includes a correspondence between a message block, a session corresponding to the message block, and a storage location of the message block, where the session corresponding to the message block is in the message block The session to which the communication message corresponding to the message data belongs.
- a computer readable storage medium having stored therein at least one instruction loaded by a processor and executed to implement the first aspect The operations performed in the method.
- a computer readable storage medium having stored therein at least one instruction loaded by a processor and executed to implement the second aspect The operations performed in the method.
- message data including the message type and the message content is generated, and the generated n messages are synchronously generated in units of message blocks.
- the data is sent to the second social application client, so that the second social application client can parse the corresponding communication message according to the received message data, because the message type and the message content are included in each message data;
- the social application client in other platforms may not be able to recognize the communication message; the effect of synchronizing communication messages across platforms is achieved.
- a data backup method comprising:
- the target message record being a message record generated by the target session after the backup deadline
- the first device is configured to back up a message record of the session.
- a data backup method is provided, where the method includes:
- the second device is configured to send a target message record to the first device, where the target message is recorded as the target session after the backup deadline Generated message record;
- the target message record When the target message record is received, the target message record is stored in a message record of the target session.
- a data backup apparatus comprising:
- a first sending module configured to send a data backup request to the first device, where the data backup request is used to indicate a target session to be backed up;
- a receiving module configured to receive a backup deadline of the target session returned by the first device, where the backup deadline is used to indicate that the first device stores all the target sessions before the backup deadline Message record
- a determining module configured to determine a target message record according to the backup deadline, the target message record being a message record generated by the target session after the backup deadline;
- a second sending module configured to send the target message record to the first device, where the first device is configured to back up a message record of the session.
- a data backup apparatus comprising:
- An obtaining module configured to: when receiving a data backup request of the second device, obtain a backup deadline corresponding to the target session, where the data backup request is used to indicate a target session to be backed up;
- a sending module configured to send a backup deadline of the target session to the second device, where The second device is configured to send a target message record to the first device, where the target message record is a message record generated by the target session after the backup deadline;
- a storage module configured to store the target message record into a message record of the target session when the target message record is received.
- a data backup device comprising: a processor and a memory, wherein the memory stores at least one instruction, the instruction being loaded and executed by the processor To achieve the following operations:
- the target message record being a message record generated by the target session after the backup deadline
- the first device is configured to back up a message record of the session.
- a data backup device comprising: a processor and a memory, wherein the memory stores at least one instruction, the instruction being loaded and executed by the processor To achieve the following operations:
- the second device is configured to send a target message record to the first device, where the target message is recorded as the target session after the backup deadline Generated message record;
- the target message record When the target message record is received, the target message record is stored in a message record of the target session.
- a computer readable storage medium having stored therein at least one instruction loaded by a processor and executed to implement the ninth aspect The operations performed in the described method.
- a computer readable storage medium having stored therein at least one instruction loaded by a processor and executed The operations performed in the method as described in the tenth aspect are implemented.
- FIG. 1 is a schematic diagram of an implementation environment involved in various embodiments of the present invention.
- FIG. 2 is a flowchart of a method for synchronizing communication messages according to an embodiment of the present invention
- FIG. 3A is a flowchart of a method for synchronizing communication messages according to an embodiment of the present invention
- FIG. 3B is a schematic diagram of generated message data according to an embodiment of the present invention.
- FIG. 3C is a schematic diagram of generated message blocks according to an embodiment of the present invention.
- FIG. 3D is a schematic diagram of a data file according to an embodiment of the present invention.
- FIG. 3E is a schematic diagram of a data file and an index file according to an embodiment of the present invention.
- 4A is a flowchart of a method for synchronizing communication messages according to another embodiment of the present invention.
- 4B is a schematic diagram of generated message data according to another embodiment of the present invention.
- FIG. 5 is a schematic diagram of a communication message synchronization apparatus according to an embodiment of the present invention.
- FIG. 6 is a schematic diagram of a communication message synchronization apparatus according to an embodiment of the present invention.
- FIG. 7 is a schematic diagram of a terminal according to an embodiment of the present invention.
- FIG. 8 is a schematic diagram of device interaction for data backup according to an embodiment of the present invention.
- 9A is a flowchart of a data backup method according to an embodiment of the present invention.
- 9B is a flowchart of a data backup method according to an embodiment of the present invention.
- FIG. 10A is a flowchart of a data backup method according to an embodiment of the present invention.
- FIG. 10B is a flowchart of a data backup method according to an embodiment of the present invention.
- FIG. 11 is a block diagram of a data backup apparatus according to an embodiment of the present invention.
- FIG. 12 is a block diagram of a data backup apparatus according to an embodiment of the present invention.
- FIG. 13 is a schematic structural diagram of a terminal according to an embodiment of the present disclosure.
- FIG. 14 is a block diagram of a data backup apparatus according to an embodiment of the present invention.
- FIG. 1 is a schematic diagram of an implementation environment involved in a method for synchronizing communication messages provided by various embodiments of the present invention.
- the implementation environment may include a first social application client 110 , a server 120 , and The second social application client 130.
- the first social application client 110 and the second social application client 130 are the same type of client. For example, both an instant messaging client or a mailbox at the same time. In the various embodiments described below, the first social application client 110 and the second social application client 130 share the same social account.
- the first social application client 110 is installed in the first terminal
- the second social application client 130 is installed in the second terminal
- the first terminal and the second terminal may be, for example, a mobile phone, a tablet, an e-reader.
- a terminal such as a desktop computer or a notebook computer
- the difference between the first terminal and the second terminal is that the operating systems used by the two are different.
- the operating system used by the first terminal may be iOS
- the operating system used by the second terminal may be Windows
- the operating system used by the first terminal is Android (Android)
- the operating system used by the second terminal may be iOS. This embodiment does not limit this.
- both the first terminal and the second terminal can be connected to the server 120 through a wired or wireless network.
- the first terminal may also be connected to the second terminal by using Bluetooth, a local area network, a USB (Universal Serial Bus), or NFC (Near Field Communication).
- the server 120 may be a background server corresponding to the social application client, and the server 120 may be a server or a server cluster composed of multiple servers.
- the first social application client 110 is a client that needs to synchronize communication messages
- the second social application client 130 is a client that receives synchronization, unless otherwise specified.
- the first social application client 110 may actively synchronize the communication message to the second social application client 130, or synchronize the communication message to the second social application client after receiving the synchronization request sent by the second social application client 130.
- End 130 for example, after the user logs in to the second social application client 130, the second social application client 130 can send a synchronization request to the server 120, and the server forwards the synchronization.
- the first social application client 110 synchronizes the communication message to the second social application client 130 after receiving the synchronization request.
- the first social application client 110 may first synchronize the communication message to the server 120, and the server 120 forwards the communication message to the second Social application client 130.
- the first terminal where the first social application client 110 is located may also establish a direct connection with the second terminal where the second social application client 130 is located, and then directly The communication message is synchronized to the second social application client 130.
- the first terminal and the second terminal are connected through a local area network.
- the second social application client 130 can report the IP of the second terminal (Internet Protocol).
- Address and port to the server 120 the server 120 forwards the IP address and port to the second social application client 130, and the second terminal establishes an IP address and port received between the first terminal and the second terminal according to the second social application client 130.
- LAN connection the IP address and port received between the first terminal and the second terminal according to the second social application client 130.
- FIG. 2 is a flowchart of a method for synchronizing a communication message according to an embodiment of the present invention. This embodiment is used in the application scenario shown in FIG.
- the communication message synchronization method may include:
- Step 201 The first social application client acquires n communication messages to be synchronized in the first social application client and a message type of each communication message, where n is an integer greater than or equal to 1.
- the first social application client can save the communication message to the local database.
- the communication message includes a message sent by the friend social application client to the first social application client, and a message sent by the first social application client to the friend social application client.
- the first social application client can acquire n communication messages to be synchronized and the message type of each communication message from the local database.
- the second social application client and the first social application client are of the same type and share the same social account, and the message type is text, picture, audio or video.
- this step may include the following possible implementation manners:
- the first social application client acquires a new communication message with the last synchronization time at a predetermined time, and uses the obtained communication message as the n communication messages to be synchronized.
- the first social application client can synchronize periodically, for example, at 24:00 every day. Or synchronize at 24:00 every Sunday. In this case, the first social application client can obtain a new communication message between the current time and the last synchronization time.
- the first social application client can obtain a new communication message from 24:00 to 24:00 on the previous day, and use the obtained communication message as n communication messages.
- the first social application client receives the synchronization signal, and the synchronization signal requests to synchronize the new communication message of the target session within the preset time period; and acquires the newly added communication message of the target session within the preset time period.
- the user may actively request to synchronize the communication message of a certain session for a certain period of time to the second social application client, that is, the user may apply synchronization in the first social application client.
- the signal correspondingly, the first social application client can receive the synchronization signal, and after receiving the synchronization signal, acquire a communication message specifying the session within a specified time period.
- the user consults the teacher with the first social application client in the mobile phone, in order to be able to view the consultation record in the second social application client of the computer, the user A synchronization signal that synchronizes the communication message during the teacher's session between 10:00 and 12:00 to the second social application client may be applied.
- the synchronization signal may be applied by the user selecting the target session and the operation of the preset time period.
- the first social application client provides a synchronization option, and when the user selects the selection operation of the synchronization option, the session list is provided, and the user obtains the session list.
- the first social application client displays a plurality of communication messages in the target session and a time corresponding to each communication message, and the user determines the preset time period according to the plurality of communication messages.
- Step 202 For each communication message, the first social application client generates message data including a message type of the communication message and a message content of the communication message.
- the first social application client After acquiring the n communication messages, the first social application client extracts the fields used in each platform in each communication message, that is, extracts the message content of each communication message, and generates the message content and the message type. Message data.
- each communication message will contain the message content, and in addition to the content of the message, it may also contain some data suitable for the current platform.
- the message content can be recognized by multiple platforms, and other data than the message content may only be recognized by the current platform and cannot be recognized by other platforms, so the first social application client can be from the communication message. Extract message content for multiple platforms to generate message data.
- Step 203 The first social application client synchronizes the generated n pieces of message data to the second social application client in units of message blocks.
- Each message block corresponds to at least one piece of message data, and when corresponding to at least two pieces of message data, communication messages corresponding to at least two pieces of message data belong to the same session.
- the first social application client synchronizes the generated n pieces of message data to the server in units of message blocks, and the server forwards the n pieces of message data to the second social application in units of message blocks. Client.
- the first terminal where the first social application client is located and the second terminal where the second social application client is located may establish a direct connection, and the first social application client directly uses the message block as The unit synchronizes the n pieces of message data to the second social application client.
- the first terminal can establish a connection with the second terminal by means of a Bluetooth, an NFC, a USB, a local area network, etc., which is not limited in this embodiment.
- the second social application client if the second social application client is not online, the synchronization fails, and the first social application client generates the prompt information to prompt the user to the current second social application client. Not online, synchronization is not possible, and this is not limited.
- Step 204 The second social application client receives n pieces of message data that the first social application client synchronizes in units of message blocks.
- Step 205 The second social application client stores n pieces of message data to the data file in units of message blocks.
- Step 206 The second social application client determines a storage location of each message block in the data file.
- Step 207 The second social application client generates and saves the correspondence.
- the correspondence relationship includes a correspondence between the message block, the session corresponding to the message block, and the storage location of the message block.
- the session corresponding to the message block is the session to which the communication message corresponding to the message data in the message block belongs.
- the communication message synchronization method generates a message type and a message content for each communication message after acquiring the n communication messages to be synchronized and the message type of each communication message.
- the message data parses out the corresponding communication message; solves the problem that the social application client in other platforms may not recognize the communication message after synchronizing the communication message to other platforms in the related art; and the cross-platform communication message can be realized The effect of synchronization.
- step 202 may include the following two possible implementations:
- the first type if the message type is text, generates message data including a message type and message content; if the message type is a picture or audio and video, generates a message body including a message type and a data identifier, and generates media data including the message content.
- the data identifier is used to point to the media data, and the message body and the media data constitute the message data. Since the data volume of pictures, audio and video is generally larger than text, and the picture or audio and video are independent of the message body, and the media data is separately generated, the data volume of the message body can be prevented from being too large.
- FIG. 3A is a flowchart of a method for synchronizing a communication message according to an embodiment of the present invention.
- the method is used in the application scenario shown in FIG. 1 and is generated by using the first generation manner.
- the message data is exemplified.
- the communication message synchronization method may include:
- Step 301 The first social application client acquires n communication messages to be synchronized in the first social application client and a message type of each communication message, where n is an integer greater than or equal to 1.
- This step is similar to step 201 and will not be described here.
- Step 302 For each communication message, if the message type is text, the first social application client generates message data including a message type and message content; if the message type is a picture or audio and video, the first social application client generates The message body including the message type and the data identifier is generated, and media data including the message content is generated, the data identifier is used to point to the media data, and the message body and the media data constitute the message data.
- the data identifier uniquely points to the media data.
- the first social application client After acquiring the n communication messages, the first social application client extracts a field that is used in each platform in each communication message, that is, extracts the message content of each communication message, and generates a message according to the message content and the message type. data.
- the n communication messages include 4 chat messages chat with Xiao Ming, 18 chat messages chat with Xiaohua, and 5 chat messages chat with Xiaogang.
- 4 chat messages chat with Xiao Ming are used as an example.
- the first social application client For each chat message, the first social application client generates the message data shown in the figure.
- message data including the message type "text" and the message content "in” is generated, and the message type is audio chat.
- the day message generates a message body including the message type "audio” and the data identifier "audio ID1”, and generates media data including "audio message 1", the message body and the media data constitute message data, and the data identifier "audio ID1" Point to "Audio Message 1".
- Step 303 n communication messages are from m sessions, and for each session, the first social application client generates a message block.
- the first social application client may generate at least one message block for the session according to the total size of the message data corresponding to each piece of communication message in the session, and/or the number of communication messages in the session.
- the generating, by the first social application client, the at least one message block for the session according to the total size of the message data corresponding to each piece of the communication message in the session may include: the first social application client according to the media data in each piece of message data.
- the total size generates at least one message block.
- the maximum size of the total media data corresponding to the message block is 80M
- the total size of the media data in the message data corresponding to each communication message in the session is 200M
- the first social application client can Three message blocks are generated for the session, and the total size of the media data corresponding to each message block does not exceed 80M.
- the first social application client generates a message block according to the number of communication messages in the session, and assumes that the maximum number of communication messages that can be stored in each message block is 10, and the number of communication messages in a certain session is 35.
- the first social application client can generate 4 message blocks for the session, and no more than 10 communication messages are stored in each message block.
- Step 304 For any communication message i in any session, if the message data of the communication message i includes the message body and the media data, the first social application client stores the message body of the communication message i in a preset order to the communication. The message i belongs to the message block corresponding to the session.
- the preset order is a sequence of receiving the pieces of communication messages in the session.
- Each message block corresponds to at least one piece of message data, and when corresponding to at least two pieces of message data, communication messages corresponding to at least two pieces of message data belong to the same session.
- the first social application client stores the message data in a preset order into the message block corresponding to the session to which the communication message i belongs.
- the first social application client can obtain the message block shown in FIG. 3C.
- the method before storing the message data of the communication message i, the method further includes:
- the storage condition includes: the media data corresponding to the data identifier in the message block and the total size of the media data in the message data of the communication message i fail to reach a preset size, and the message data in the message block The number of bars does not reach the preset number or both.
- the preset size is the size set by the system or the user-defined size.
- the preset size is 80M of the system setting.
- the preset number can also be set by the system or the number of user-defined ones.
- the preset number can be 2000 items set by the system.
- the storage device includes the media data corresponding to the data identifier in the message block and the total size of the media data in the message data of the communication message i that does not reach the preset size.
- the first social application client may obtain each of the message blocks.
- the data identifier stored in the message body is used to count the total size of the media data in the message data corresponding to each data identifier and the message data in the communication message i, and whether the total size obtained by the statistics reaches a preset size. Wherein, if the media data is not included in the message data of the communication message i, the size of the media data in the message data of the communication message i is 0.
- the first social application client can count the number of communication messages corresponding to the message block in the message block, and the number of the statistics obtained in the message block is up to the limit.
- the number of presets can count the number of communication messages corresponding to the message block in the message block, and the number of the statistics obtained in the message block is up to the limit. The number of presets.
- the first social application client can perform the foregoing two types of detections at the same time, which is not limited in this embodiment.
- the message data corresponding to the communication message i includes the message type and the message content
- the message data is stored to the message block
- the message data corresponding to the communication message i includes the message body and the message.
- the message body is stored to the message block.
- the first social application client may store.
- the message data is sent to the next message block corresponding to the session; when the message data corresponding to the communication message i includes the message body and the message content, the message body is stored to the next message block corresponding to the session.
- the first social application client detects After storing the 15th message data, the total size of the media data corresponding to the message block exceeds 80M. At this time, the first social application client may store the message data corresponding to the chat message of the 15th and subsequent messages to the next.
- the message block is stored in a similar manner to the above.
- the step 304 is performed after the step 303 is performed first.
- the step 303 and the step 304 may be performed crosswise.
- the first social application client can be a message block, and when the message cannot continue to store data, a new message block is generated, and the data is stored to the newly generated message block.
- the specific implementation manner is not limited.
- Step 305 The first social application client synchronizes the media data corresponding to each message block and the data identifier in each message block to the second social application client.
- the first social application client may first synchronize each message block and the media data corresponding to the data identifier in each message block to the server, and forward it to the second social application client by the server; or, A social application client is directly synchronized to the second social application client, which is not limited in this embodiment.
- Step 306 The second social application client receives each message block synchronized by the first social application client and the media data corresponding to the data identifier in each message block.
- Step 307 The second social application client stores each message block to the message file, and stores the media data corresponding to the data identifier in the message block to the media file, where the message file and the media file constitute a data file.
- the size of the file is set by the terminal device when the file is read by the terminal device, and the size of the message file is set to a maximum of 2G.
- the media file is also set with a size threshold, such as 2G. That is to say, when storing each message block to the message file, before storing a certain message block to the message file, detecting whether the sum of the size of the message file and the size of the message block reaches a size threshold, if not, then The message block is stored in the message file; if the size threshold is reached, the message block is stored to the newly generated message file, which is not limited in this embodiment.
- the media data is not limited to the newly generated media file.
- FIG. 3D illustrates a possible schematic diagram of message files and media files obtained by the second social application client.
- the message file may have one or at least two, and the number of the message file is not limited in this embodiment; similarly, the media file may have one or at least two, which is also Not limited.
- Step 308 the second social application client determines a storage location of each message block in the data file.
- the second social application client can determine the storage location of each message block in the message file.
- the storage location may be represented by a starting storage location and a length of the message block in the message file, or by a starting storage location of the message block in the message file and an ending storage location, which is used in this embodiment. Not limited.
- Step 309 The second social application client determines a storage location of each media data in the media file.
- the storage location in the media file can be represented by the starting storage location and length of the media data in the media file, or by the initial storage location of the media data in the media file and the ending storage location. This embodiment does not limit this.
- Step 310 The second social application client generates and saves the correspondence.
- the correspondence relationship includes a correspondence between the message block, the session corresponding to the message block, and the storage location of the message block, and the correspondence between the data identifier and the storage location of the media data in the media file, and the session corresponding to the message block is a message.
- the starting position 2 the starting position 1 + the length 1
- the starting position 3 the starting position 2+ the length 2
- the starting position 4 the starting position 3 + the length 3.
- the index file is a file for storing each correspondence.
- FIG. 3E shows a schematic diagram of data files and index files stored by the second social application client in this embodiment.
- the communication message synchronization method generates a message type and a message content for each communication message after acquiring the n communication messages to be synchronized and the message type of each communication message.
- the problem of the message the effect of synchronizing the communication messages across platforms is achieved.
- the message block By detecting whether the message block satisfies the storage condition before storing the message data, if the total size of the media data corresponding to the message block is too large, or the message block is too large, the message is resynchronized after the message block synchronization fails.
- the network resources required for the block and the media data corresponding to the message block are not required.
- the above method avoids the problem that a certain network resource is required in the synchronization process due to the packet header used in the package when the message data is synchronized each time.
- FIG. 4A is a flowchart of a method for synchronizing a communication message according to an embodiment of the present invention. This embodiment is used in the application scenario shown in FIG. 1 as an example, as shown in FIG. 4A.
- the communication message synchronization method may include:
- Step 401 The first social application client acquires n communication messages to be synchronized in the first social application client and a message type of each communication message, where n is an integer greater than or equal to 1.
- This step is similar to step 201 and will not be described here.
- Step 402 For each communication message, the first social application client generates message data including a message type and message content.
- step 302 The difference between this step and step 302 is that, in this embodiment, regardless of the message type, the first social application client directly generates message data including the message type and the message content.
- the first social application client may generate the four pieces of message data shown in FIG. 4B.
- n communication messages are from m sessions, and for each session, the first social application client generates a message block.
- Step 404 For any communication message i in any session, store the message data of the communication message i in a preset order into the message block corresponding to the session to which the communication message i belongs.
- This step is similar to the step 304. The difference is that, in the step 304, the message body is stored to the message block, and the message data is directly stored in the message block in the embodiment, and details are not described herein again.
- Step 405 The first social application client synchronizes each message block to the second social application client.
- Step 406 The second social application client receives each message block of the first social application client synchronization.
- step 407 the second social application client stores each message block to the data file.
- Step 408 The second social application client determines a storage location of each message block in the data file.
- Step 409 The second social application client generates and saves the correspondence.
- the communication message synchronization method generates a message type and a message content for each communication message after acquiring the n communication messages to be synchronized and the message type of each communication message.
- the message data parses out the corresponding communication message; solves the problem that the social application client in other platforms may not recognize the communication message after synchronizing the communication message to other platforms in the related art; and the cross-platform communication message can be realized The effect of synchronization.
- the problem of requiring a certain amount of network resources in the synchronization process due to the packet header used in the encapsulation is avoided every time the message data is synchronized.
- the first social application client may perform the following steps before the first social application client synchronizes the message data corresponding to the message block to the second social application client:
- the starting time of the time information is the receiving time of the communication message corresponding to the first message data in the message block, and the ending time of the time information is the last message data in the message block.
- the receiving time of the corresponding communication message is the receiving time of the corresponding communication message.
- the time information corresponding to the message block is the time for receiving the communication message, which is not limited in this embodiment.
- the four chat messages chat with Xiao Ming are taken as an example.
- the time of the first chat message is 15:31:20
- the time of the fourth chat message is 15:33:35, then the message corresponding to the 4 chat messages.
- the time information of block 1 is 15:31:20 to 15:33:35.
- the time information corresponding to the message block is synchronized to the second social application client.
- the generated first correspondence includes a message block, a session corresponding to the message block, a storage location of the message block, and a time period corresponding to the message block. Correspondence between the two.
- the second social application client may perform the following steps:
- the second social application client determines the timestamp information of each session according to the saved correspondence, and the timestamp information is the communication corresponding to the last message data in each session determined by the second social application client according to the saved correspondence. The time the message was received.
- the second social interaction is included in the correspondence relationship stored in the second social application client, including the message block, the session corresponding to the message block, the time information corresponding to the message block, and the corresponding storage location of the message block.
- the application client can determine the timestamp information of each session according to each corresponding relationship stored.
- the second social application client determines that the timestamp information obtained is 9:30:37.
- the second social application client sends the timestamp information to the first social application client.
- the first social application client receives the timestamp information of each session sent by the second social application client.
- the first social application client acquires each piece of communication message in the session received after the timestamp information according to the timestamp information of the session, and acquires the message type of each piece of communication message.
- the user logs in to the second social application client in a PC (Personal Computer), and the second social application client reports the IP address and port of the PC to the server; the server detects the first in the mobile phone.
- the social application client is online, if online, send The IP address and port of the PC are connected to the mobile phone, and the mobile phone establishes a direct connection with the PC after receiving the IP address and port.
- the PC determines the timestamp information of each session according to the locally stored index file, and sends the timestamp information to the mobile phone through the established direct connection. After receiving the timestamp information, the mobile phone obtains the timestamp information in each session according to each timestamp information.
- the communication message is added, and the message data corresponding to each communication message is generated, and the generated n pieces of message data are synchronously generated in the message block unit to the second social application client.
- the second social application client After receiving the second social application client, the second social application client stores the data file, creates and saves the corresponding relationship. If the detection result of the server is that the first social application client is not online, the second social application client is prompted to fail the synchronization at this time.
- the first social application client may also assign a serial number to each communication message, and synchronize the message block to the second social application client. And synchronizing the sequence number range corresponding to the message block to the second social application client. That is, the sequence number of the last communication message in each message block may be saved in the second social application client, so that after the second social application client goes online, the second social application client may send the last communication message of each session.
- the serial number is sent to the first social application client, and the first social application client obtains, according to the serial number, each communication message whose sequence number is after the serial number, and the specific implementation of the embodiment is not limited.
- the second point that needs to be added is that the first social application client can also obtain session information of each session, such as a nickname, a comment, and the like of the session, and then synchronize the message data to the second social application client in units of message blocks.
- the session information corresponding to the message block is synchronized to the second social application client.
- the second social application client can receive the session message and store the session information in the index file, which is not limited in this embodiment.
- the third point that needs to be added is that before the first social application client synchronizes the n pieces of message data to the second social application client, in order to ensure the security of the data transmission, the first social application client may also first n pieces.
- the message data is encrypted.
- the first social application client may send a key acquisition request to the server, receive a key returned by the server, and encrypt the message data according to the received key. After the social application client of the different account sends the key acquisition request to the server, the obtained key may be different.
- the first social application client may further store the public key, and send a key acquisition request carrying the public key when the key acquisition request is sent, and the server acquires the key acquisition request after receiving the key acquisition request.
- the encryption method corresponding to the public key, and the obtained encryption method is fed to the A social application client, the first social application client performs encryption according to the received encryption method.
- the first social application client may encrypt the n message data in units of message blocks, which is not limited thereto. In this way, when the second social application client needs to re-establish the communication message corresponding to the message data, the second social application client also needs to obtain the decryption key from the server or obtain the decryption method in a similar manner. Not limited.
- the foregoing communication message synchronization method may further include the following steps:
- the second social application client reconstructs each communication message corresponding to each message block according to the saved correspondence.
- the second social application client may read the content in the message block corresponding to the session according to the saved correspondence, and include in the message block.
- the corresponding media data is read from the media file according to the correspondence between the data identifier and the storage location of the media data in the media file, and thereafter, each piece of communication message can be reconstructed.
- the second social application client may first read the corresponding relationship from the index file storing the corresponding relationship, and then re-establish the communication message according to the read correspondence, which is not limited in this embodiment.
- the second social application client can find the storage location of the corresponding message block 1 as the starting position 1+length 1 according to the session 'Xiaoming'. And reading the content of the message block 1 from the storage location, that is, the content shown in FIG. 3C, and thereafter, according to the correspondence between the data identifier and the storage location of the media data, the content can be read from the media file.
- the audio message 1 and the audio message 2 in Fig. 3C in this way, the chat record with Xiao Ming can be recovered.
- the correspondence also includes a correspondence between the message block and the data identifier in the message body in the message block.
- the second social application client can also generate the correspondence shown in the following table.
- the corresponding media data can be read without waiting for the individual entries in the message block to be traversed.
- the problem that the reconstruction efficiency of the communication message is low is that the data identifier can be directly read according to the stored correspondence relationship, and the corresponding media data is quickly loaded, thereby improving the reconstruction efficiency of the communication message.
- the second social application client can display the communication message corresponding to the session in the session window.
- the second social application client may sort the communication messages in a sequence from the morning to the night according to the receiving time of each communication message, and when the second social application client opens the session window, the receiving time is from early to early.
- the late sequence displays each communication message, and the user triggers the up and down sliding operation, and can also switch the displayed communication message so that the user can browse different communication messages.
- the fifth point that needs to be added is that the foregoing is only the second social application client directly storing the message data to the data file in units of message blocks.
- the second social application client may also receive the received
- the message data in the unit of the message block is divided into smaller-sized message blocks, or merged into a larger-sized message block.
- the merging into the same session corresponds to one message block, which is not limited in this embodiment.
- the sixth point of the supplementary description is that the step of the first social application client side in the foregoing embodiment may be separately implemented as the communication message synchronization method of the first social application client side, and regarding the second social application client side.
- the step may be separately implemented as a communication message synchronization method on the client side of the second social application.
- FIG. 5 is a schematic structural diagram of a communication message synchronization apparatus according to an embodiment of the present invention.
- the communication message synchronization apparatus is used in the first social application client shown in FIG. 1.
- the communication message synchronization apparatus may include: a first acquisition module 510, a generation module 520, and a synchronization module 530.
- the first obtaining module 510 is configured to acquire n pieces of communication messages to be synchronized in the first social application client and message types of each communication message, where n is an integer greater than or equal to 1;
- a generating module 520 configured to generate, for each communication message, message data including a message type of the communication message and a message content of the communication message;
- the synchronization module 530 is configured to synchronously generate the n pieces of message data to the second social application client in units of message blocks; the second social application client stores the n pieces of message data to the data file in units of message blocks, and generates and saves the corresponding a relationship; each message block corresponds to at least one piece of message data, and when corresponding to at least two pieces of message data, communication messages corresponding to at least two pieces of message data belong to the same session, and the second social application client and the first social application client
- the end types are the same and share the same social account; the correspondence includes the correspondence between the message block, the session corresponding to the message block, and the storage location of the message block.
- the session corresponding to the message block is the session to which the communication message corresponding to the message data in the message block belongs.
- the communication message synchronization apparatus generates a message type and a message content for each communication message after acquiring the n communication messages to be synchronized and the message type of each communication message.
- the message data parses out the corresponding communication message; solves the problem that the social application client in other platforms may not recognize the communication message after synchronizing the communication message to other platforms in the related art; and the cross-platform communication message can be realized The effect of synchronization.
- the generating module 520 is further configured to generate a message body including the message type and the data identifier, and generate Media data including the message content, the data identifier is used to point to the media data, and the message body and the media data constitute the message data.
- the synchronization module 530 includes:
- a synchronization unit for any communication message i in any session, if the message data of the communication message i includes a message body and media data, storing the message body of the communication message i in a preset order to the In the message block corresponding to the session to which the communication message i belongs, when synchronizing the message data of the communication message i, synchronizing the message block corresponding to the session to which the communication message i belongs and the media data of the communication message i to the second
- the preset order is a sequence of receiving communication messages.
- the synchronization module 530 includes:
- a synchronization unit configured to store the message data of the communication message i in a preset order to a message block corresponding to the session to which the communication message i belongs, for any communication message i in any session, in synchronizing the communication
- the message block corresponding to the session to which the communication message i belongs is synchronized to the second social application client, and the preset sequence is a sequence of receiving the communication message.
- the generating unit is further configured to: according to the message corresponding to each piece of communication message in the session The total size of the data, and/or the number of communication messages in the session, generates at least one message block for the session.
- the device further includes:
- a second acquiring module configured to acquire time information corresponding to each message block, where a start time of the time information is a receiving time of a communication message corresponding to the first message data in the message block, and the time information The ending time is the receiving time of the communication message corresponding to the last message data in the message block;
- the synchronization module 530 is further configured to synchronize time information corresponding to the message block to the second social application client when synchronizing each message block to the second social application client.
- the first obtaining module 510 includes:
- a receiving unit configured to receive timestamp information of each session sent by the second social application client, where the timestamp information is a last message in each session determined by the second social application client according to the saved correspondence relationship The receiving time of the communication message corresponding to the data;
- an obtaining unit configured to acquire, according to the timestamp information of the session, each piece of communication messages in the session received after the timestamp information, and obtain a message type of each piece of communication message, for each session.
- FIG. 6 is a schematic structural diagram of a communication message synchronization apparatus according to an embodiment of the present invention.
- the communication message synchronization apparatus is used in the second social application client shown in FIG. 1 .
- the communication message synchronization apparatus may include: a first receiving module 610, a storage module 620, and a generating module 630.
- the first receiving module 610 is configured to receive n pieces of message data that are synchronized by the first social application client in a message block unit; the first social application client is the same type as the second social application client and shares the same social An account number; each piece of message data is a message type including a communication message generated by the first social application client and data of the message content; each message block corresponds to at least one message data, and corresponds to at least two message data The communication message corresponding to the at least two message data belongs to the same session;
- the storage module 620 is configured to store the n pieces of message data to the data file in units of the message block;
- a generating module 630 configured to generate and save a correspondence relationship, where the correspondence relationship includes a message block, a session corresponding to the message block, and a correspondence between storage locations of the message block, the message
- the session corresponding to the block is the session to which the communication message corresponding to the message data in the message block belongs.
- the communication message synchronization apparatus generates a message type and a message content for each communication message after acquiring the n communication messages to be synchronized and the message type of each communication message.
- the message data parses out the corresponding communication message; solves the problem that the social application client in other platforms may not recognize the communication message after synchronizing the communication message to other platforms in the related art; and the cross-platform communication message can be realized The effect of synchronization.
- the communication message synchronization device provided according to the above embodiment, optionally,
- the first receiving module 610 is further configured to receive, by the first social application client, each message block that is synchronized by the first social application client and the media data corresponding to the data identifier in the message block, where the message block includes a message body, The message body includes a message type of the communication message and a data identifier, where the media data includes a message content of the communication message, and the data identifier points to the media data;
- the storage module 620 is further configured to store each message block to the message file, and store the media data corresponding to the data identifier in the message block to the media file, where the message file and the media file constitute the data file;
- the correspondence further includes a correspondence between the data identifier and a storage location of the media data in the media file.
- the correspondence further includes a correspondence between the message block and the data identifier in the message body in the message block.
- the device further includes:
- a second receiving module configured to receive time information corresponding to each message block that is synchronized by the first social application client; a start time of the time information is corresponding to a first message data in the message block a receiving time of the communication message, where the ending time of the time information is a receiving time of the communication message corresponding to the last message data in the message block;
- the correspondence further includes a correspondence between the message block and time information corresponding to the message block.
- the device further includes:
- a determining module configured to determine timestamp information of each session according to the saved correspondence, where the timestamp information is determined by the second social application client according to the saved correspondence relationship The receiving time of the communication message corresponding to the last message data in the sentence;
- a sending module configured to send the timestamp information to the first social application client.
- the communication message synchronization device provided by the foregoing embodiment is only illustrated by the division of each functional module. In an actual application, the function distribution may be completed by different functional modules as needed, that is, the social application client. The internal structure of the end is divided into different functional modules to perform all or part of the functions described above.
- the embodiment of the communication message synchronization device and the communication message synchronization method provided by the foregoing embodiments are in the same concept, and the specific implementation process is described in detail in the method embodiment, and details are not described herein again.
- the embodiment of the present invention further provides a computer readable storage medium, which may be a computer readable storage medium included in the memory in the above embodiment; or may exist separately and not assembled into the terminal.
- Computer readable storage medium stores one or more programs that are used by one or more processors to perform a communication message synchronization method.
- FIG. 7 is a block diagram of a terminal 700 according to an embodiment of the present invention.
- the terminal may include a radio frequency (RF) circuit 701, a memory 702 including one or more computer readable storage media, and an input unit 703.
- RF radio frequency
- the terminal structure shown in FIG. 7 does not constitute a limitation to the terminal, and may include more or less components than those illustrated, or a combination of certain components, or different component arrangements. among them:
- the RF circuit 701 can be used for transmitting and receiving information or during a call, and receiving and transmitting signals. Specifically, after receiving downlink information of the base station, the downlink information is processed by one or more processors 708. In addition, the data related to the uplink is sent to the base station. .
- the RF circuit 701 includes, but is not limited to, an antenna, at least one amplifier, a tuner, one or more oscillators, a Subscriber Identity Module (SIM) card, a transceiver, a coupler, and a low noise amplifier (LNA, Low Noise Amplifier), duplexer, etc. In addition, the RF circuit 701 can also communicate with the network and other devices through wireless communication.
- SIM Subscriber Identity Module
- LNA Low Noise Amplifier
- the wireless communication can use any communication standard or protocol, including but not limited to Global System of Mobile communication (GSM), General Packet Radio Service (GPRS, General Packet Radio Service), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), e-mail, short message service (SMS, Short Messaging Service), etc.
- GSM Global System of Mobile communication
- GPRS General Packet Radio Service
- CDMA Code Division Multiple Access
- WCDMA Wideband Code Division Multiple Access
- LTE Long Term Evolution
- SMS Short Messaging Service
- the memory 702 can be used to store software programs and modules, and the processor 708 executes various functional applications and data processing by running software programs and modules stored in the memory 702.
- the memory 702 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application required for at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may be stored according to Data created by the use of the terminal (such as audio data, phone book, etc.).
- memory 702 can include high speed random access memory, and can also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device. Accordingly, memory 702 may also include a memory controller to provide access to memory 702 by processor 708 and input unit 703.
- the input unit 703 can be configured to receive input numeric or character information and to generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function controls.
- input unit 703 can include a touch-sensitive surface as well as other input devices.
- Touch-sensitive surfaces also known as touch screens or trackpads, collect touch operations on or near the user (such as the user using a finger, stylus, etc., any suitable object or accessory on a touch-sensitive surface or touch-sensitive Operation near the surface), and drive the corresponding connecting device according to a preset program.
- the touch sensitive surface may include two parts of a touch detection device and a touch controller.
- the touch detection device detects the touch orientation of the user, and detects a signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts the touch information into contact coordinates, and sends the touch information.
- the processor 708 is provided and can receive commands from the processor 708 and execute them.
- touch-sensitive surfaces can be implemented in a variety of types, including resistive, capacitive, infrared, and surface acoustic waves.
- the input unit 703 can also include other input devices. Specifically, other input devices may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control buttons, switch buttons, etc.), trackballs, mice, joysticks, and the like.
- Display unit 704 can be used to display information entered by the user or information provided to the user, as well as various graphical user interfaces of the terminal, which can be composed of graphics, text, icons, video, and any combination thereof.
- the display unit 704 can include a display panel.
- a liquid crystal display (LCD) or an organic light emitting diode (OLED, Organic) can be used.
- the touch-sensitive surface can cover the display panel, and when the touch-sensitive surface detects a touch operation thereon or nearby, it is transmitted to the processor 708 to determine the type of the touch event, and then the processor 708 displays the type according to the type of the touch event.
- a corresponding visual output is provided on the panel.
- the touch-sensitive surface and display panel are implemented as two separate components to perform input and input functions, in some embodiments, the touch-sensitive surface can be integrated with the display panel to implement input and output functions.
- the terminal may also include at least one type of sensor 705, such as a light sensor, motion sensor, and other sensors.
- the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display panel according to the brightness of the ambient light, and the proximity sensor may close the display panel and/or the backlight when the terminal moves to the ear.
- the gravity acceleration sensor can detect the magnitude of acceleration in all directions (usually three axes). When it is stationary, it can detect the magnitude and direction of gravity.
- the terminal can also be configured with gyroscopes, barometers, hygrometers, thermometers, infrared sensors and other sensors, no longer Narration.
- the audio circuit 706, the speaker, and the microphone provide an audio interface between the user and the terminal.
- the audio circuit 706 can transmit the converted electrical signal of the audio data to the speaker, and convert it into a sound signal output by the speaker; on the other hand, the microphone converts the collected sound signal into an electrical signal, which is received by the audio circuit 706 and then converted.
- the audio data is then processed by the audio data output processor 708, sent via RF circuitry 701 to, for example, another terminal, or the audio data is output to memory 702 for further processing.
- the audio circuit 706 may also include an earbud jack to provide communication between the peripheral earphone and the terminal.
- WiFi is a short-range wireless transmission technology.
- the terminal can help users to send and receive emails, browse web pages, and access streaming media through the WiFi module 707. It provides wireless broadband Internet access for users.
- FIG. 7 shows the WiFi module 707, it can be understood that it does not belong to the necessary configuration of the terminal, and may be omitted as needed within the scope of not changing the essence of the invention.
- the processor 708 is the control center of the terminal, which connects various portions of the entire handset using various interfaces and lines, by executing or executing software programs and/or modules stored in the memory 702, and invoking data stored in the memory 702, executing The various functions of the terminal and processing data to monitor the mobile phone as a whole.
- the processor 709 may include one or more processing cores; preferably, the processor 708 may integrate an application processor and a modem processor, where the application processor mainly processes an operating system, a user interface, an application, and the like.
- the modem processor primarily handles wireless communications. Understand The above modem processor may also not be integrated into the processor 708.
- the terminal also includes a power source 709 (such as a battery) that supplies power to the various components.
- the power source can be logically coupled to the processor 709 through the power management system to manage functions such as charging, discharging, and power management through the power management system.
- the power supply 709 can also include any one or more of a DC or AC power source, a recharging system, a power failure detection circuit, a power converter or inverter, a power status indicator, and the like.
- the terminal may further include a camera, a Bluetooth module, and the like, and details are not described herein again.
- the processor 708 in the terminal runs one or more program instructions stored in the memory 702, thereby implementing the communication message synchronization method provided in the foregoing various method embodiments.
- FIG. 8 is a schematic diagram of device interaction for data backup according to an embodiment of the present invention.
- the device includes a first device and a second device, where the first device is a data backup target device, and the second device is data.
- the source device of the backup is a data backup target device.
- the second device may be a mobile phone, a tablet computer, a desktop computer, or the like.
- the second device is installed with an application, and the application may be a social application, a multimedia application, or the like, and the application generates various data during the use process.
- the first device may be a terminal such as a mobile phone, a tablet computer, or a desktop computer, and the first device may also be a server.
- the first device may also be installed with the same application as the second device, or the first device may be installed with an application having the application backup function.
- the operating system of the first device and the second device may be the same or different, which is not limited by the embodiment of the present invention.
- the data backup in this embodiment is used to back up the data applied on the second device.
- the application that needs to be backed up on the second device is referred to as a target application.
- the data flow required to be backed up in this embodiment may be from the terminal to the terminal, or from the terminal to the server.
- FIG. 9A For detailed data backup process, refer to the specific implementation provided in FIG. 9A below. example.
- FIG. 9A is a flowchart of a data backup method according to an embodiment of the present invention.
- an interaction entity involves a first device and a second device, where the method includes:
- the second device acquires device information of the first device, and establishes a connection with the first device according to the device information.
- the first device and the second device when both the first device and the second device are terminals, the first device and the second device may be in the same local area network, and the two may establish a connection by using a wired or wireless manner.
- the wired connection method includes a USB connection, a direct connection of a network cable, and the like.
- Wireless connection method includes WiFi (Wireless Fidelity, Wi-Fi connection, Bluetooth connection, etc.
- the first device may be installed with the target application in the same manner as the second device, or may not be installed with the target application.
- the user can trigger the data backup process by using the first device.
- a data backup option for implementing data backup can be provided on the function interface of the target application, so that the user can click the data backup.
- the first device may be installed with a specified application that provides a backup service for the target application, and the designated application has a data backup option of the target application backup, so that the user can click the data. Backup options to trigger the data backup process.
- the user can also trigger the data backup process by using the second device.
- the second device detects the triggering operation of the data backup option of the target application
- the user displays a session list of the target application, and the user can select a required list in the session list.
- the target session of the backup when the second device detects the selection confirmation operation of the target session, the data backup process is triggered.
- the user can select session 1 and session 2 as the target session in the conversation list.
- the second device may automatically trigger the backup according to the preset period.
- the preset period may be preset or changed by the server or the second device, which is not limited in this embodiment.
- the first device detects whether a connection has been established with the second device, and if the connection is not established, performs a process of establishing a connection with the second device. If the connection has been established, the backup instruction is sent to the second device, and after the backup command is received by the second device, step 902 is performed.
- the second device After the data backup process is triggered on the first device, the second device needs to establish a connection with the first device to perform data backup.
- the second device may establish a connection with the first device by acquiring the device information of the first device.
- the device information of the first device includes an IP address of the first device and a port number that provides a data backup service.
- the manner in which the second device acquires the device information of the first device may include any one of the following three types:
- the second device acquires device information of the first device by using a server.
- the server sends a backup process initiation message to the server, where the backup process initiation message carries the device information of the first device and the first account of the login target application.
- the server sends a backup process initiation indication to the second device that is logged in to the same account according to the first account, where the backup process initiation indication carries the device information of the first device, thereby making the second device Get the device information of the first device.
- the backup process initiation indication may also not carry the device information of the first device, but the device information of the first device is pulled from the server after receiving the indication of the backup process by the second device, which is used by the embodiment of the present invention. Not limited.
- the second device acquires device information of the first device by using a device information broadcast message of the first device.
- the first device may be installed with or without the target application.
- the device information is broadcasted in the local area network, and when the second device is in the same local area network as the first device, the device information can be monitored through the local area network. Broadcasting a message, thereby extracting device information of the first device from the device information broadcast message.
- the second device acquires device information of the first device by using the two-dimensional code scan.
- the first device may be installed with or without the target application.
- the two-dimensional code is generated according to the device information of the first device.
- the second device acquires device information of the first device by scanning the two-dimensional code.
- the data backup process can be regarded as a process of target application data synchronization.
- the second device may also obtain the first account of the first device login target application.
- the first device may also broadcast the first account, so that the second device obtains the first account.
- the second account generated by the first device may include the first account, and the second device obtains the first account by scanning the two-dimensional code.
- the second device After obtaining the first account, the second device compares with the second account of the local login target application, and if the two are the same, establish a connection with the first device; if not, refuse to establish a connection with the first device, and at the same time, The second device may display different prompt information of the account to prompt the user that the data backup may be at risk.
- the second device may establish a direct connection with the first device in the same local area network by using a wired or wireless manner.
- the process of establishing the connection may be: the second device is configured according to the IP address of the first device. Address, sending a data connection request to the first device. If the first device receives the data connection request, it will return a response message to the second device. If the second device receives the response message of the first device, it indicates that the two devices are in the same local area network, and the connection can be established directly, and the second device establishes a connection with the first device. If the second device does not receive the response message of the first device, it is determined that the first device is not in the same local area network, and the direct connection cannot be established.
- the second device displays the network connection prompt information, and the network connection prompt information is used to indicate that the second device is in a different local area network than the first device, for example, the network connection prompt information may be, for example, “ Please connect the two devices to the same LAN and other information.
- the first device may not receive the data of the second device because of a network failure (such as the network cable is not plugged in, or the router is faulty).
- the connection request is made, or the second device does not receive the response message that the first device has returned. Therefore, in order to reflect the true connection situation to the user, to improve the success rate of the connection, the second device may perform the following steps when the response message is not received: according to the IP address and the local IP address of the first device, Whether the two devices are on the same local area network. For example, the second device detects whether the IP address of the first device and the network number of the local IP address are the same.
- the first device is in the same local area network.
- the network number is used to indicate the local area network identifier of the device IP address.
- the device information of the first device may further include the first device.
- the second device can determine whether it is on the same local area network as the first device by comparing the SSID of the first device with the local SSID. For example, when the SSIDs of the two are different, it is determined that the two are not in the same local area network. At this time, the second device displays the network connection prompt information.
- the network connection prompt information may be used to indicate that the device is connected to the same WiFi, for example.
- Such information as "Please connect two devices to the same WiFi", such a prompt can make some users who do not understand the LAN concept, can also connect the two devices to the same LAN through prompts, improve the data backup
- the universality of the method enhances operability.
- the second device in the second manner of acquiring the device information of the first device, because the device information of the first device is broadcasted through the local area network, when the second device receives the device information of the first device, It can be determined that the first device is in the same local area network, and the connection can be established directly with the first device according to the obtained device information.
- the data transmission speed in the data backup process is greatly improved, the efficiency of data backup is improved, and the network stability is good because the local area network is not susceptible to external interference. Therefore, the reliability of data transmission is improved, and the problem of reduced backup efficiency due to packet loss is avoided.
- FIG. 9B shows a flow chart of data backup based on the above first manner, in FIG. 9B as the first
- the device detects the triggering operation of the data backup option
- the device sends a backup process initiation message to the server, where the backup process initiation message carries the device information of the first device and the first account of the login target application.
- the other flow of Figure 9B will be described in a subsequent step.
- the data exchanged between the first device and the second device is encrypted data.
- the first device detects whether the local key buffer is stored. The key, if the key is not stored locally, the first device can obtain the key from the server. The second device may also obtain the same key from the server, and the first device and the second device may use the key to encrypt data sent to the peer end, and when receiving the data of the peer end, the key may be used. Decrypt.
- the first device and the second device may also exchange a password for password verification.
- the password verification process may be: the second device sends a password authentication message (Packet Authenticate Request) to the first device.
- the password verification message carries the first password to be verified (such as a hello password).
- the first device detects that the first password is stored locally, and confirms that the password verification for the second device is successful.
- a password authentication success message (Packet Authenticate Response) to the second device, and carrying a second password (such as an ok password) to be verified in the password verification success message, after the second device receives the second password, if it detects If the second password is stored locally, it is confirmed that the password verification of the first device is successful, and the password verification success message is returned to the first device, and the password verification success message may also be carried by the Packet Authenticate Request message.
- the first device may return a password verification confirmation message to indicate that the verification process ends, and the confirmation message may also be carried by the Packet Authenticate Response message.
- the first password and the second password may be respectively configured by the server to the second device and the first device.
- the first device (or the second device) provided in this embodiment may further perform data backup based on the progress of the backup when the transmission is interrupted during the data backup process;
- data recovery can be provided, and data recovery resumes based on the progress of the interrupt recovery when a transmission interruption occurs during data recovery.
- a corresponding function option may be provided on the first device (or the second device), or a corresponding function option may be provided on the function interface of the target application, so that the user can trigger the corresponding process.
- the second device When the user triggers a certain process by using the first device, in order to make the second device clear which process is currently triggered, after the first device and the second device establish a connection, send a process type indication (Backup Command Request) to the second device, where The process type indication is used to indicate data backup, continue backup, data recovery, and resume recovery. One of the complex ones.
- the second device returns a confirmation response message (Backup Command Response) after receiving the flow type indication.
- the second device may further send a ready indication to the first device, where the ready indication may also be carried by the Backup Command Request message, and the first device returns the confirmation response message after receiving the ready indication ( Backup Command Response).
- the second device sends a data backup request to the first device, where the data backup request is used to indicate the target session to be backed up.
- the second device may perform data transmission with the first device. It should be noted that the data transmission in the step and the subsequent step are based on the connection, and the description in the subsequent steps is not repeated.
- the second device After determining that the connection with the first device is successfully established, the second device enters a data backup process. For example, the second device may display a target session selection interface, where the target session selection interface includes a session list of the target application, where the session list includes multiple Session options, each session option includes the session ID, avatar and selection box of the session, and the user can select the target session to be backed up by clicking the selection box.
- the session list displayed in the target session selection interface may include only sessions in which the message record is not zero, and further, corresponding to each, because there is no need to back up the session with the message record of zero.
- the session can also display the size of the message record contained in the session, such as 5M.
- the second device may also send a backup start message to the first device before the data backup request is sent, after the first device returns a confirmation start message (Backup Start Response). And then send a data backup request, the data backup request can be carried by the Backup Request Session message.
- the number of the target sessions may be one or more, which is not limited in this embodiment.
- the data backup request is sent to the first device, and the data backup request may include the session identifier of the target session.
- the session identifier may be a nickname, an account number, and the like of the peer end.
- the session identifier may be a group name or the like.
- the message record of the session refers to data such as text, picture, voice, and video that are exchanged between the session end and the session peer.
- Each message record includes the generation time of the message record, and the type of the message record includes a text message record and a media message record.
- media message records include pictures, voice and video.
- the media message record includes the corresponding media message itself and description information thereof, and the description information is used to describe the message identifier, media type, generation time, and media of the corresponding media message. Volume message size, etc.
- the first device receives the data backup request of the second device, obtain a backup deadline corresponding to the target session.
- the first device stores a correspondence between a backup deadline of the backup message record and the session identifier.
- the first device may query the stored correspondence according to the session identifier of the target session to obtain a backup deadline of the target session.
- the correspondence can be as shown in Table 1.
- the storage relationship of the session identifier corresponding session may be stored in the correspondence, so that the first device can directly determine the storage area of a session by using the corresponding relationship.
- the first device sends a backup deadline of the target session to the second device.
- the first device returns a backup deadline corresponding to the session for each session.
- the target session includes only one session as an example.
- the backup deadline of the target session may be carried by the backup request session (Reply Request Session Response), and the specific bearer mode is not limited in the embodiment of the present invention.
- the second device determines a target message record according to a backup deadline of the target session, where the target message records a message record generated by the target session after the backup deadline.
- the message records included in the session are arranged in order of generation time from first to last.
- the second device extracts the message record generated after the backup deadline according to the backup deadline of the target session. Specifically, the second device may compare the generation time of the message record in the target session with the backup deadline according to the generation time from the first to the last, until the first message with the generation time later than the backup deadline is obtained. The record determines the first message record and the subsequent message record as the target message record. Of course, the second device may also compare the generation time of the message record in the target session with the backup deadline according to the order of the generation time until the generation time is equal to or earlier than the backup deadline. The second message record determines the message record after the second message record as the target message record.
- the second device determines that the target session does not generate after the backup deadline
- the new message record determines that the target session has no data to be backed up.
- the second device may send a backup completion message to the first device to end the backup process. If the number of the target sessions is multiple, the second device determines that each target session does not generate a new message record after the corresponding backup deadline, and sends a backup completion message to the first device to end the backup process.
- the backup completion message may be carried by a Backup Finish Request message. If the second device acquires the target message record of the target session, the target message record is sent to the first device, the process comprising the following steps 906 to 908.
- the second device divides the target message record into at least one message set according to a generation time of the message record from first to last.
- the second device can divide the message record to be backed up into one or more message sets.
- the message set may include a text message set and a media message set.
- the text message set includes description information of the text message record and the media message record, and each description information is used to indicate the corresponding media message record.
- Media message records are included in the media message collection.
- the second device combines the description information of the text message record and the media message record in the target message into a text message set according to the generation time from the first to the last, and combines the media message records into the media message set. For example, the second device acquires each message record in the target message record in a first-to-last order according to the generation time. If the message record is a text message record, the text message record is added to the text message set, if the message record For the media message record, the description information of the media message record is added to the text message set, and the media message record is added to the media message set.
- the message set can be divided in the following two ways on the basis of chronological order:
- the first way is to divide the message set based on the preset size.
- the preset size may be configured or changed in advance, which is not limited in this embodiment.
- the preset size may be 80M, so that the second device may divide the text message record into multiple text message sets, and divide the media message record into multiple media message sets.
- the division of the message set is divided into two cases:
- the text message record is added to Before the text message set, comparing the total size of the text message set and the media message record indicated by the text message set with the preset size, if the total size is less than the preset size, adding the text message record Go to the text message collection; otherwise, add the text message record to a new text message collection.
- the second device may also record a media message as a set of media messages, which is not limited in this embodiment.
- the message set is divided based on the preset number of messages.
- the number of the preset messages may be configured or changed in advance, which is not limited in this embodiment.
- the preset number may be 2000, and the division of the message set is further divided into two cases according to different types of message records:
- the second device detects whether the number of message records included in the text message set is less than the preset message number, if If less than, the text message record is added to the text message collection; otherwise, the text message record is added to a new text message collection.
- the second device detects whether the number of message records included in the text message set is less than the preset. The number of messages, if less, the description information of the media message record is added to the text message set, and the media message record is added to the corresponding media message set; otherwise, the description information of the media message record is added to the In the new text message collection, add the media message record to a new media message collection.
- the second device may also record a media message as a set of media messages, which is not limited in this embodiment.
- the description information of the media message record in the text message set also represents a message record
- the text message is also counted when the number of message records included in the statistical text message set is counted.
- the number of descriptive information for the media message record in the collection is also counted.
- the second device may use the file as a carrier to transmit the message set, thereby Row data backup.
- the plurality of message collections may be combined into one text message file, and the plurality of media message sets may be combined into one media message file.
- the second device determines message indication information of the message set, where the message indication information is used to indicate a generation time of the last message record in the message set.
- the second device can determine the generation time of the last message record in the message set.
- the second device sends the at least one message set and its message indication information to the first device.
- the message indication information of the message set is sent to the first device.
- the second device may package each message set into multiple data packets in a sequence from the first to the last of the message record generation time, and send each data packet (Packet Backup Data Push) to the first device in sequence.
- the second device sends the packet backup information (Packet Backup Data Tag) of the message set to the first device. The second device then sends the next message set to the first device.
- the first device may also feed back the packet success or the packet failure (Packet Backup Data Push Response) to the second device.
- the second device After receiving the success message of the first device, the second device continues to send the next data packet to the first device.
- the first device may further perform data integrity verification on the received message set.
- the message indication information of the message set may further include summary information of the message set, and the first device verifies the message according to the summary information of the message set. Whether the collection is successfully received.
- the summary information of the message set may be a message identifier of all the message records included in the message set, and the first device verifies the received message record according to the message identifier in the summary information, if the summary information indication has been received.
- the second device After all the message records, it is determined that the message set is successfully received, and a Packet Backup Data Tag Response is sent to the second device. After receiving the verification success message of the message set, the second device sends the next message set to the first device. When the message set corresponding to the target message record is sent, the second device may send a Backup Finish Request to the first device, so that the first device determines that the backup process ends.
- the embodiment further provides a large media message record for the data volume.
- the verification mechanism the process may include the following steps 908a to 908f:
- Step 908a For each message set in the at least one message set, the second device detects whether the specified message record is included in the message set.
- the specified message record refers to a message record in the message set whose size exceeds a preset threshold.
- the preset threshold may be pre-configured or changed.
- the preset threshold may be 500M, which is not limited in this embodiment.
- Step 908b If the message set contains the specified message record, the second device sends a backup verification request (Packet SvrID Request) to the first device, where the backup verification request carries the message identifier of the specified message record.
- a backup verification request Packet SvrID Request
- Step 908c After receiving the backup verification request, the first device determines, according to the message identifier recorded by the specified message, whether the specified message record has been stored.
- Step 908d If the specified message record is not stored, the first device sends a non-backup indication message to the second device, and step 908e is performed. If the first device has stored the specified message record, the backup indication message is sent to the second device. Step 908f is performed.
- the unbacked message indication and the backed up message indication may be carried by the Packet Svr ID Response message.
- Step 908e If the second device receives the non-backup indication message, the second message is sent to the first device.
- Step 908f The first device stores the specified message record to a storage area corresponding to the target session in the preset backup directory, thereby completing the backup of the specified message record.
- the preset backup directory is used to store a message record of the session.
- the preset backup directory may store a default directory for the message record for the target application.
- the second device encrypts the message record that needs to be sent and then sends it to the first device, for example, encrypts each data packet sent to the first device.
- the data can be encrypted using a specified key.
- the user's application data cannot be stolen by other users, and a user's account may correspond to a unique key, which may be used by the user when logging in to the target application using his own account. Obtain the key, so that other users cannot obtain the key of the user, even after obtaining the encrypted data of the user. It is also impossible to decrypt, thus ensuring the security of the user's application data.
- the first device stores the received at least one message set and the message indication information of each message set to a storage area corresponding to the target session in the preset backup directory.
- the first device For each received message set, the first device stores the message indication information, the target session, and the message set corresponding to the message set, that is, the generation time of the last message record of the message set, the target session, and the message set.
- the storage for example, adds an entry of a storage address of the message set in Table 1 to establish the correspondence.
- the message indication information and the target session of the message set may be stored as an index of the message set.
- the index of the message set may further include a storage offset location of the message set in the message file, for example, adding a storage address table entry of the message file and a message set in Table 1. An entry of the offset address to enable the first device to accurately locate each message set.
- the first device and the second device may continue to back up the message record of the target session after the backup of the target session is interrupted.
- the process of continuing the backup may be triggered by the user on the first device, or may be triggered by the user on the second device, which may be classified into the following three cases:
- the user triggers the backup by the first device.
- the prompt information indicating whether to continue the backup is displayed. If the trigger operation for continuing the backup is detected, the second breakpoint resume command is triggered, and the first device receives the second breakpoint resume transmission.
- the command is sent, the first breakpoint resume request is sent to the second device, and the first breakpoint resume request is used to indicate the backup interruption time of the target session when the backup is interrupted.
- the backup interrupt time refers to when the data transmission is interrupted.
- the second device sends the unreviewed target message record of the target session to the first device according to the backup interruption time. For example, the second device determines, according to the backup interruption time, the unbacked message set from the at least one message set, to the first device.
- the unbacked message set is sent, and the received set of messages is stored by the first device corresponding to the target session.
- the user triggers the backup by the second device.
- the prompt information indicating whether to continue the backup is displayed. If the trigger operation for continuing the backup is detected, the first breakpoint resume command is triggered, and the second device receives the first breakpoint resume transmission.
- the second breakpoint resume request is sent to the first device, and the second breakpoint resume request is used to indicate that the target session is resumed.
- the first device determines a backup interruption time of the target session, and returns the backup interruption time to the second device.
- Second setting The device sends a target message record that is not backed up by the target session to the first device according to the backup interruption time. For example, the second device determines the unbacked message set from the at least one message set according to the backup interruption time, and sends the unreviewed message set to the first device.
- the set of backup messages is stored by the first device corresponding to the target session.
- the user triggers the backup by the second device, and the second device records the backup interruption time of the target session when the backup is interrupted.
- the prompt information indicating whether to continue the backup is displayed. If the trigger operation for continuing the backup is detected, the first breakpoint resume command is triggered, and the second device receives the first breakpoint resume transmission. And instructing, according to the recorded backup interruption time, to send, to the first device, a target message record that is not backed up by the target session, for example, the second device determines, from the at least one message set, the unbacked message set according to the backup interruption time, to the first device. The unbacked message set is sent, and the received set of messages is stored by the first device corresponding to the target session.
- the entire backup process still needs to be started from the beginning when the data transmission is interrupted, and the data to be backed up that has been transmitted needs to be retransmitted again.
- the method provided in this embodiment only needs to follow the original backup when the data connection is interrupted. The process continues to send the data that needs to be backed up, without transferring the data that has already been backed up, and realizing the breakpoint of the data.
- the backup deadline is used to distinguish the backed up message records and the unbacked message records in the target session, so that when the target session is backed up, only the unbacked message records need to be transmitted, without having to transmit Backup message records improve the efficiency of data backup.
- steps 901 to 909 are only described by taking the data backup process of backing up the data of the target application to the first device by the second device as an example.
- the data of the target application backed up on the first device may also be restored to the second device, and the process of data recovery may be regarded as the reverse process of the data backup, as shown in FIG. 10A.
- the data recovery process can include the following steps 1001 through 1009:
- the second device acquires device information of the first device, and establishes a connection with the first device according to the device information.
- FIG. 10B is a flowchart of data recovery shown in the embodiment, and in FIG. 10B, when the first device detects the data recovery option.
- a recovery process initiation message is sent to the server, where the backup process initiation message carries the device information of the first device and the first account of the login target application.
- the password verification may also be performed in the process of establishing the connection between the first device and the second device.
- the process of the password verification is the same as the step 901.
- the password verification message and the password verification success message of the second device may also be performed by the Packet Authenticate Request.
- the message is carried, and the password verification success message and the password verification confirmation message returned by the first device may be carried by the Packet Authenticate Response message.
- the process type can also be exchanged between the first device and the second device, and the process is the same as the process of interacting with the process type in step 901.
- the process type indication of the first device and the ready indication of the second device may be carried by the Backup Command Request message, and the acknowledgement response message returned by the second device and the acknowledgement response message of the first device may be carried by the Backup Command Response message.
- the first device may further send a Backup Start Request to the second device, and the second device returns a Backup Start Response message.
- the first device sends a data recovery request to the second device, where the data recovery request is used to indicate the target session to be restored.
- the data recovery request can be carried by the Backup Request Session message.
- the second device determines a recovery start time of the target session, and sends the recovery start time to the first device.
- the recovery start time can be the generation time of the first message record in the target session. It should be noted that the recovery start time of the target session may be carried by a data backup response (Backup Request Session Response), and the specific bearer mode of the embodiment of the present invention is not limited.
- the first device determines, according to the received recovery start time, a target message set from at least one message set of the backup target session, where the target message set refers to a time when the last message record is generated earlier than the recovery start. A collection of time messages.
- the first device sends the target message set to the second device.
- the first device may package the target message set into multiple data packets in chronological order, and send each data packet (Packet Backup Data Push) to the second device in turn.
- the second device can return a packet success or a packet failure (Packet Backup Data Push Response).
- the first device sends a packet backup information (Packet Backup Data Tag) of the message set to the second device.
- the message set indication includes the summary information of the message set
- the second device may further perform integrity verification on the message set, and if the verification is successful, return a verification success message (Packet Backup Data Tag Response), after receiving the verification success message by the first device, sending the next message set.
- the first device may also detect the specified message record of the larger data volume, and if the specified message record whose size exceeds the preset threshold is detected, send a resume verification request to the second device ( Packet SvrID Request), after the second device verifies the locally stored message record, returns an unrecovered message indication or a resumed message indication.
- the unrecovered message indication and the recovered message indication may be carried by the Packet Svr ID Response message.
- the first device After the first device sends all the data that needs to be restored, it sends a Backup Finish Request to the second device.
- the second device stores the received target message set to a storage area corresponding to the target session.
- the message indication information of the message set is also used to indicate the generation time of the first message record in the message set. That is, the message indication information is used to indicate the time range corresponding to the message record included in the message set.
- the first device stores the message indication information, the target session, and the message set of the message set correspondingly, that is, stores the time range, the target session, and the message set corresponding to the message set.
- the index of the message set is the time range and target session corresponding to the message set.
- the user may select the target time period of the target session to be restored in the data recovery interface during the process of triggering the data recovery process by the first device. Then, after step 1001, the data recovery process may also be:
- the first device detects the data recovery instruction of the target session, determining the target message set from the at least one target message set according to the target time period carried in the data recovery instruction and the message indication information of the at least one message set of the target session.
- the target message set refers to a message set whose time range corresponding to the message record falls within the target time period.
- the first device transmits the target message set to the second device.
- the data recovery instruction may be triggered by a click operation of the data recovery option provided by the first device by the user; when the data recovery process is triggered by the second device, the data recovery instruction may be The second device sends to the first device.
- the message collection is such that when data recovery is performed on the target session, only the message records not stored in the target device need to be transmitted, and the message records stored in the target device need not be transmitted, thereby improving the efficiency of data recovery.
- FIG. 11 is a block diagram of a data backup apparatus according to an embodiment of the present invention.
- the apparatus includes a first transmitting module 1101, a receiving module 1102, a determining module 1103, and a second transmitting module 1104.
- the first sending module 1101 is connected to the receiving module 1102, and is configured to send a data backup request to the first device, where the data backup request is used to indicate a target session to be backed up;
- the receiving module 1102 is connected to the determining module 1103, and configured to receive the data.
- a backup deadline of the target session returned by the first device the backup deadline is used to indicate that the first device stores all the message records of the target session before the backup deadline;
- the determining module 1103 is connected to the second sending module 1104.
- the target message record is determined according to the backup deadline, the target message is recorded as a message record generated by the target session after the backup deadline;
- the second sending module 1104 is configured to send the target message record to the first device.
- the first device is used to back up the message record of the session.
- the second sending module 1104 is configured to divide the target message record into at least one message set in a first-to-last order according to a generation time of the message record; for each of the at least one message set a message set, the message indication information of the message set is determined, the message indication information is used to indicate a generation time of the last message record in the message set; and the at least one message set and its message indication information are sent to the first device.
- the second sending module 1104 is configured to detect, for each message set in the at least one message set, whether the specified message record is included in the message set, where the specified message record refers to a size exceeding a preset. a message record of the threshold; if the specified message record is included in the message set, sending a backup verification request to the first device, the backup verification request carrying a message identifier of the specified message record, the first device is configured to The message identifier of the message record determines that the specified message record is not stored, and returns a non-backup indication message; if the non-backup indication message is received, the specified message record is sent to the first device.
- the message indication information is further used to indicate summary information of the message set
- the second sending module 1104 is further configured to send the message set for each message set in the at least one message set. Up to the first device; sending the message indication information of the message set to the first device, where the first device is configured to return after verifying that the message set is successfully received according to the summary information Receiving a success message; when receiving the reception success message of the message set, sending the next message set to the first device.
- the message indication information is further used to indicate a generation time of the first message record in the message set.
- the receiving module is further configured to receive a first breakpoint resuming request of the first device after the backup of the target session is interrupted, where the first breakpoint resume request is used to indicate The backup interruption time of the target session; the second sending module is further configured to send the unbacked target message record of the target session to the first device based on the backup interruption time; or the first sending module is further used for the target After the backup of the session is interrupted, if the first breakpoint resume command is received, the second breakpoint resume request is sent to the first device, and the second breakpoint resume request is used to indicate that the target session is broken.
- the second sending module is further configured to send, according to the backup interruption time of the target session returned by the first device, the unbacked target message record of the target session to the first device; or the second sending module And if, after receiving the interruption of the backup of the target session, if the first breakpoint resuming instruction is received, determining the unbacked target message record of the target session, sending the unsent to the first device Certain parts of the message record.
- the device further includes:
- An obtaining module configured to acquire device information of the first device
- connection module configured to establish a connection with the first device according to the device information.
- the acquiring module is configured to acquire device information of the first device from the server; or, by scanning the two-dimensional code, acquiring device information of the first device, where the two-dimensional code is used to indicate the device of the first device And receiving the device information broadcast message of the first device, and extracting the device information of the first device from the device information broadcast message.
- the device information includes an IP address of the first device
- the connection module is configured to send a data connection request to the first device according to the IP address of the first device, where the first device is configured to receive the data connection. If the request is received, a response message is returned; if a response message is received, a connection is established with the first device in the local area network.
- the acquiring module is further configured to acquire a first account that is logged in the first device, and if the first account is consistent with the second account that is logged in locally, perform the The step of establishing a connection by a device.
- the data that interacts with the first device is encrypted data.
- FIG. 12 is a block diagram of a data backup apparatus according to an embodiment of the present invention.
- the package The device includes an acquisition module 1201, a transmission module 1202, and a storage module 1203.
- the obtaining module 1201 is connected to the sending module 1202, and configured to: when receiving the data backup request of the second device, obtain a backup deadline corresponding to the target session, where the data backup request is used to indicate the target session to be backed up; 1202 is connected to the storage module 1203, configured to send a backup deadline of the target session to the second device, where the second device is configured to send a target message record to the first device, where the target message is recorded as the target session in the backup a message record generated after the deadline; the storage module 1203 is configured to store the target message record in the message record of the target session when the target message record is received.
- the storage module 1203 is configured to store the at least one message set of the second device and the message indication information of each message set to a storage area corresponding to the target session in the preset backup directory.
- the preset backup directory is used to store a message record of the session, and the message indication information of each message set is used to indicate the generation time of the last message record in the message set.
- the message indication information of each message set is further used to indicate summary information of the message set, and the apparatus further includes:
- a verification module configured to verify, according to the summary information of the message set, whether the message set is successfully received for each of the message sets;
- the sending module is further configured to send a receiving success message to the second device if the verification result is that the receiving is successful.
- the message indication information of each message set is further used to indicate a generation time of the first message record in the message set, and the apparatus further includes:
- a determining module configured to: when the data recovery instruction of the target session is detected, determine a target message set from the at least one message set according to the target time period and message indication information of the at least one message set, where the data recovery instruction is to be carried
- the target time segment of the recovery, the target message set refers to a message set of the first message record generation time and the last message record generation time falling within the target time period;
- the sending module is further configured to send the target message set to the first device.
- the device further includes:
- a judging module configured to: if the backup verification request is received, determine, according to the message identifier of the specified message, whether the specified message record is stored, and the backup verification request carries the message identifier of the specified message record;
- the sending module is further configured to: if the specified message record is not stored, send the message to the second device.
- the backup indication message is sent to the second device if the specified message record is stored, and the specified message record is stored in the storage area corresponding to the target session in the preset backup directory, the preset backup The directory is used to store message records for the session.
- the sending module is further configured to send a first breakpoint resuming request to the second device after receiving the second breakpoint resuming instruction after the backup of the target session is interrupted, the first disconnecting The point resume request is used to indicate the backup interruption time of the target session; the storage module is further configured to store the unbacked target message record of the received target session; or, the sending module is further configured to: after the backup of the target session is interrupted, If the second breakpoint resuming request of the target session is received, sending a backup interruption time of the target session to the second device; the storage module is further configured to store the unbacked target message record of the received target session; or, store The module is also used to store the unbacked message records of the received target session after the backup of the target session is interrupted.
- the data backup device provided by the foregoing embodiment is only illustrated by the division of each functional module. In actual applications, the function distribution may be completed by different functional modules as needed. The internal structure of the device is divided into different functional modules to perform all or part of the functions described above.
- the data backup device and the data backup method embodiment provided by the foregoing embodiments are in the same concept, and the specific implementation process is described in detail in the method embodiment, and details are not described herein again.
- FIG. 13 is a schematic structural diagram of a terminal according to an embodiment of the present invention.
- the terminal may be used to perform the data backup method provided in the foregoing embodiments.
- the terminal 1300 includes:
- the terminal 1300 may include an RF (Radio Frequency) circuit 110, a memory 120 including one or more computer readable storage media, an input unit 130, a display unit 140, a sensor 150, an audio circuit 160, and a WiFi (Wireless Fidelity, wireless).
- the fidelity module 170 includes a processor 180 having one or more processing cores, and a power supply 190 and the like. It will be understood by those skilled in the art that the terminal structure shown in FIG. 13 does not constitute a limitation to the terminal, and may include more or less components than those illustrated, or a combination of certain components, or different component arrangements. among them:
- the RF circuit 110 can be used for transmitting and receiving information or during a call, and receiving and transmitting signals. Specifically, after receiving downlink information of the base station, the downlink information is processed by one or more processors 180. In addition, the data related to the uplink is sent to the base station. .
- RF circuitry 110 includes, but is not limited to, an antenna, at least one amplifier, a tuner, one or more oscillators, a Subscriber Identity Module (SIM) card, a transceiver, Coupler, LNA (Low Noise Amplifier), duplexer, etc. In addition, RF circuitry 110 can also communicate with the network and other devices via wireless communication.
- SIM Subscriber Identity Module
- LNA Low Noise Amplifier
- the wireless communication may use any communication standard or protocol, including but not limited to GSM (Global System of Mobile communication), GPRS (General Packet Radio Service), CDMA (Code Division Multiple Access). , Code Division Multiple Access), WCDMA (Wideband Code Division Multiple Access), LTE (Long Term Evolution), e-mail, SMS (Short Messaging Service), and the like.
- GSM Global System of Mobile communication
- GPRS General Packet Radio Service
- CDMA Code Division Multiple Access
- WCDMA Wideband Code Division Multiple Access
- LTE Long Term Evolution
- e-mail Short Messaging Service
- the memory 120 can be used to store software programs and modules, and the processor 180 executes various functional applications and data processing by running software programs and modules stored in the memory 120.
- the memory 120 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application required for at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may be stored according to The data created by the use of the terminal 1300 (such as audio data, phone book, etc.) and the like.
- memory 120 can include high speed random access memory, and can also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device. Accordingly, memory 120 may also include a memory controller to provide access to memory 120 by processor 180 and input unit 130.
- the input unit 130 can be configured to receive input numeric or character information and to generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function controls.
- input unit 130 can include touch-sensitive surface 131 as well as other input devices 132.
- Touch-sensitive surface 131 also referred to as a touch display or trackpad, can collect touch operations on or near the user (such as a user using a finger, stylus, etc., on any suitable object or accessory on touch-sensitive surface 131 or The operation near the touch-sensitive surface 131) and driving the corresponding connecting device according to a preset program.
- the touch-sensitive surface 131 can include two portions of a touch detection device and a touch controller.
- the touch detection device detects the touch orientation of the user, and detects a signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts the touch information into contact coordinates, and sends the touch information.
- the processor 180 is provided and can receive commands from the processor 180 and execute them.
- the touch-sensitive surface 131 can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic waves.
- the input unit 130 can also include other input devices 132.
- other input devices 132 may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control buttons, switch buttons, etc.), trackballs, mice, joysticks, and the like.
- the display unit 140 can be used to display information input by the user or information provided to the user and various graphical user interfaces of the terminal 1300, which can be composed of graphics, text, icons, video, and any combination thereof.
- the display unit 140 may include a display panel 141.
- the display panel 141 may be configured in the form of an LCD (Liquid Crystal Display), an OLED (Organic Light-Emitting Diode), or the like.
- the touch-sensitive surface 131 may cover the display panel 141, and when the touch-sensitive surface 131 detects a touch operation thereon or nearby, it is transmitted to the processor 180 to determine the type of the touch event, and then the processor 180 according to the touch event The type provides a corresponding visual output on display panel 141.
- touch-sensitive surface 131 and display panel 141 are implemented as two separate components to implement input and input functions, in some embodiments, touch-sensitive surface 131 can be integrated with display panel 141 for input. And output function.
- Terminal 1300 can also include at least one type of sensor 150, such as a light sensor, motion sensor, and other sensors.
- the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display panel 141 according to the brightness of the ambient light, and the proximity sensor may close the display panel 141 when the terminal 1300 moves to the ear. / or backlight.
- the gravity acceleration sensor can detect the magnitude of acceleration in all directions (usually three axes). When it is stationary, it can detect the magnitude and direction of gravity.
- the terminal 1300 can also be configured with gyroscopes, barometers, hygrometers, thermometers, infrared sensors and other sensors, not here Let me repeat.
- the audio circuit 160, the speaker 161, and the microphone 162 can provide an audio interface between the user and the terminal 1300.
- the audio circuit 160 can transmit the converted electrical data of the received audio data to the speaker 161 for conversion to the sound signal output by the speaker 161; on the other hand, the microphone 162 converts the collected sound signal into an electrical signal by the audio circuit 160. After receiving, it is converted into audio data, and then processed by the audio data output processor 180, transmitted to the terminal, for example, via the RF circuit 110, or outputted to the memory 120 for further processing.
- the audio circuit 160 may also include an earbud jack to provide communication of the peripheral earphones with the terminal 1300.
- WiFi is a short-range wireless transmission technology
- the terminal 1300 can help users to send and receive emails, browse web pages, and access streaming media through the WiFi module 170, which provides wireless broadband Internet access for users.
- FIG. 13 shows the WiFi module 170, it can be understood that it does not belong to the essential configuration of the terminal 1300, and may be omitted as needed within the scope of not changing the essence of the invention.
- the processor 180 is a control center of the terminal 1300 that connects various portions of the entire handset with various interfaces and lines, by running or executing software programs and/or modules stored in the memory 120, and recalling data stored in the memory 120, The various functions and processing data of the terminal 1300 are performed to perform overall monitoring of the mobile phone.
- the processor 180 may include one or more processing cores; preferably, the processor 180 may integrate an application processor and a modem processor, where the application processor mainly processes an operating system, a user interface, an application, and the like.
- the modem processor primarily handles wireless communications. It can be understood that the above modem processor may not be integrated into the processor 180.
- the terminal 1300 also includes a power source 190 (such as a battery) for powering various components.
- the power source can be logically coupled to the processor 180 through a power management system to manage functions such as charging, discharging, and power management through the power management system.
- Power supply 190 may also include any one or more of a DC or AC power source, a recharging system, a power failure detection circuit, a power converter or inverter, a power status indicator, and the like.
- the terminal 1300 may further include a camera, a Bluetooth module, and the like, and details are not described herein again.
- the display unit of the terminal is a touch screen display
- the terminal further includes a memory, and one or more programs, wherein one or more programs are stored in the memory and configured to be processed by one or more Execution.
- the one or more programs include executable instructions, and the terminal 1300 is configured to execute instructions to perform the method performed by the terminal in the above-described call alert method embodiment.
- non-transitory computer readable storage medium comprising instructions, such as a memory comprising instructions executable by a processor in a terminal to perform the data backup method of the above embodiments.
- the non-transitory computer readable storage medium may be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, and an optical data storage device.
- FIG. 14 is a block diagram of a data backup apparatus according to an embodiment of the present invention.
- device 1400 can be provided as a server.
- apparatus 1400 includes a processing component 1422 that further includes one or more processors, and memory resources represented by memory 1432 for storing instructions executable by processing component 1422, such as an application.
- the application stored in the memory 1432 may include one or more modules each corresponding to a set of instructions.
- processing component 1422 is configured to execute instructions to perform the methods performed by the server in the data backup method embodiments described above.
- Apparatus 1400 can also include a power supply component 1426 configured to perform power management of apparatus 1400, a wired or wireless network interface 1450 configured to connect apparatus 1400 to the network, and an input/output (I/O) interface 1458.
- Apparatus 1400 may operate based on an operating system stored in the memory 1432, for example, Windows Server TM, Mac OS X TM , Unix TM, Linux TM, FreeBSD TM or the like.
- non-transitory computer readable storage medium comprising instructions, such as a memory comprising instructions executable by a processor in a server to perform the data backup method of the above embodiments.
- the non-transitory computer readable storage medium may be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, and an optical data storage device.
- a person skilled in the art may understand that all or part of the steps of implementing the above embodiments may be completed by hardware, or may be instructed by a program to execute related hardware, and the program may be stored in a computer readable storage medium.
- the storage medium mentioned may be a read only memory, a magnetic disk or an optical disk or the like.
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Information Transfer Between Computers (AREA)
Abstract
Des modes de réalisation de la présente invention concernent un procédé de synchronisation de message de communication, un procédé de copie de sauvegarde de données, un dispositif et un support de stockage, qui appartiennent au domaine technique de l'Internet. Le procédé comprend les étapes suivantes : acquérir n messages de communication à synchroniser dans un premier client d'application sociale et un type de message de chaque message de communication ; pour chaque message de communication, produire des données de message contenant le type de message du message de communication et le contenu de message du message de communication ; synchroniser les n données de message produites par unités de blocs de message sur un deuxième client d'application sociale ; chaque bloc de message correspondant à au moins une donnée de message, et lorsqu'il correspond à au moins deux données de message, des messages de communication correspondant auxdites deux données de message appartiennent à la même session, le deuxième client d'application sociale étant du même type que le premier client d'application sociale et partageant le même compte social ; ce qui résout le problème dans l'état de la technique selon lequel, après la synchronisation du message de communication sur d'autres plateformes, le client d'application sociale dans d'autres plateformes risque de ne pas pouvoir identifier le message de communication.
Applications Claiming Priority (4)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201611055670.9A CN106776124B (zh) | 2016-11-25 | 2016-11-25 | 数据备份方法及装置 |
| CN201611056492.1 | 2016-11-25 | ||
| CN201611055670.9 | 2016-11-25 | ||
| CN201611056492.1A CN106506674B (zh) | 2016-11-25 | 2016-11-25 | 通信消息同步方法及装置 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2018095175A1 true WO2018095175A1 (fr) | 2018-05-31 |
Family
ID=62194745
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2017/107471 Ceased WO2018095175A1 (fr) | 2016-11-25 | 2017-10-24 | Procédé de synchronisation de message de communication, procédé de copie de sauvegarde de données, dispositif et support de stockage |
Country Status (1)
| Country | Link |
|---|---|
| WO (1) | WO2018095175A1 (fr) |
Cited By (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN110781408A (zh) * | 2019-10-25 | 2020-02-11 | 上海连尚网络科技有限公司 | 信息显示方法和装置 |
| CN114880299A (zh) * | 2021-02-05 | 2022-08-09 | 北京字跳网络技术有限公司 | 多媒体草稿文件同步方法、装置、设备和介质 |
| CN115361356A (zh) * | 2022-08-25 | 2022-11-18 | 中国银行股份有限公司 | 一种文件控制方法、装置以及电子设备 |
| CN116723203A (zh) * | 2022-10-10 | 2023-09-08 | 荣耀终端有限公司 | 数据备份方法、数据恢复方法及电子设备 |
| WO2024159857A1 (fr) * | 2023-02-01 | 2024-08-08 | 腾讯科技(深圳)有限公司 | Procédé et appareil de synchronisation de message, dispositif et support de stockage |
Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20140172991A1 (en) * | 2012-12-14 | 2014-06-19 | International Business Machines Corporation | Low latency messaging chat server |
| CN104883292A (zh) * | 2015-04-16 | 2015-09-02 | 江苏中威科技软件系统有限公司 | 实现消息在不同终端漫游的方法及系统 |
| CN104885055A (zh) * | 2014-03-19 | 2015-09-02 | 华为终端有限公司 | 一种应用数据同步的方法及装置 |
| CN106131137A (zh) * | 2016-06-26 | 2016-11-16 | 乐视控股(北京)有限公司 | 数据同步方法、系统及用于数据同步的用户终端和服务端 |
| CN106506674A (zh) * | 2016-11-25 | 2017-03-15 | 腾讯科技(深圳)有限公司 | 通信消息同步方法及装置 |
| CN106776124A (zh) * | 2016-11-25 | 2017-05-31 | 腾讯科技(深圳)有限公司 | 数据备份方法及装置 |
-
2017
- 2017-10-24 WO PCT/CN2017/107471 patent/WO2018095175A1/fr not_active Ceased
Patent Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20140172991A1 (en) * | 2012-12-14 | 2014-06-19 | International Business Machines Corporation | Low latency messaging chat server |
| CN104885055A (zh) * | 2014-03-19 | 2015-09-02 | 华为终端有限公司 | 一种应用数据同步的方法及装置 |
| CN104883292A (zh) * | 2015-04-16 | 2015-09-02 | 江苏中威科技软件系统有限公司 | 实现消息在不同终端漫游的方法及系统 |
| CN106131137A (zh) * | 2016-06-26 | 2016-11-16 | 乐视控股(北京)有限公司 | 数据同步方法、系统及用于数据同步的用户终端和服务端 |
| CN106506674A (zh) * | 2016-11-25 | 2017-03-15 | 腾讯科技(深圳)有限公司 | 通信消息同步方法及装置 |
| CN106776124A (zh) * | 2016-11-25 | 2017-05-31 | 腾讯科技(深圳)有限公司 | 数据备份方法及装置 |
Cited By (8)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN110781408A (zh) * | 2019-10-25 | 2020-02-11 | 上海连尚网络科技有限公司 | 信息显示方法和装置 |
| CN110781408B (zh) * | 2019-10-25 | 2023-11-17 | 上海连尚网络科技有限公司 | 信息显示方法和装置 |
| CN114880299A (zh) * | 2021-02-05 | 2022-08-09 | 北京字跳网络技术有限公司 | 多媒体草稿文件同步方法、装置、设备和介质 |
| CN115361356A (zh) * | 2022-08-25 | 2022-11-18 | 中国银行股份有限公司 | 一种文件控制方法、装置以及电子设备 |
| CN115361356B (zh) * | 2022-08-25 | 2024-02-27 | 中国银行股份有限公司 | 一种文件控制方法、装置以及电子设备 |
| CN116723203A (zh) * | 2022-10-10 | 2023-09-08 | 荣耀终端有限公司 | 数据备份方法、数据恢复方法及电子设备 |
| CN116723203B (zh) * | 2022-10-10 | 2024-04-19 | 荣耀终端有限公司 | 数据备份方法、数据恢复方法及电子设备 |
| WO2024159857A1 (fr) * | 2023-02-01 | 2024-08-08 | 腾讯科技(深圳)有限公司 | Procédé et appareil de synchronisation de message, dispositif et support de stockage |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN106776124B (zh) | 数据备份方法及装置 | |
| CN106357808B (zh) | 一种数据同步方法和装置 | |
| CN106506674B (zh) | 通信消息同步方法及装置 | |
| WO2018086417A1 (fr) | Procédé, appareil et système de diffusion en direct à alternance de microphones | |
| CN106375478B (zh) | 一种移动终端数据的同步方法、装置及系统 | |
| CN104683301B (zh) | 一种密码保存的方法及装置 | |
| WO2018095175A1 (fr) | Procédé de synchronisation de message de communication, procédé de copie de sauvegarde de données, dispositif et support de stockage | |
| CN106657251A (zh) | 一种数据同步方法和装置 | |
| WO2016150270A1 (fr) | Procédé et appareil pour traiter un message de session de groupe | |
| CN106453589B (zh) | 一种备份数据的同步方法和装置 | |
| WO2020164526A1 (fr) | Procédé de commande pour nœuds dans un système distribué et dispositif associé | |
| CN104580167A (zh) | 一种传输数据的方法、装置和系统 | |
| CN109157841B (zh) | 一种游戏组队方法、终端、服务器及计算机可读存储介质 | |
| CN106453402A (zh) | 一种数据处理方法及设备 | |
| WO2018049971A1 (fr) | Procédé de commutation de réseau à point d'accès sans fil et terminaux | |
| CN106445743A (zh) | 数据备份传输方法及移动终端 | |
| US10904198B2 (en) | Information sending method, information display method, terminal, server, system, and storage medium | |
| WO2018049970A1 (fr) | Procédé de commutation de réseau à point d'accès sans fil et terminal | |
| CN110572508A (zh) | 通讯录同步方法、装置、存储介质及电子设备 | |
| CN106209608A (zh) | 一种聊天信息区别同步的方法及装置 | |
| CN107786423B (zh) | 一种即时通讯的方法和系统 | |
| WO2015101300A1 (fr) | Procédé, dispositif et système pour établir un canal temporaire | |
| CN117040862A (zh) | 一种虚拟专用拨号网的接入方法、系统、装置及存储介质 | |
| CN106714279A (zh) | 一种热点网络切换方法及终端设备 | |
| CN106453514A (zh) | 一种聊天信息区别同步的方法及装置 |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 17872932 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 17872932 Country of ref document: EP Kind code of ref document: A1 |