CN107172165B - Data synchronization method and device - Google Patents

Data synchronization method and device Download PDF

Info

Publication number
CN107172165B
CN107172165B CN201710380312.3A CN201710380312A CN107172165B CN 107172165 B CN107172165 B CN 107172165B CN 201710380312 A CN201710380312 A CN 201710380312A CN 107172165 B CN107172165 B CN 107172165B
Authority
CN
China
Prior art keywords
icloud
data
server
communication
data packet
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201710380312.3A
Other languages
Chinese (zh)
Other versions
CN107172165A (en
Inventor
彭重阳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wondershare Technology Co ltd
Original Assignee
Wondershare Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Wondershare Technology Co ltd filed Critical Wondershare Technology Co ltd
Priority to CN201710380312.3A priority Critical patent/CN107172165B/en
Publication of CN107172165A publication Critical patent/CN107172165A/en
Application granted granted Critical
Publication of CN107172165B publication Critical patent/CN107172165B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/26Special purpose or proprietary protocols or architectures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1095Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes

Abstract

The invention provides a data synchronization method and a device, wherein the method comprises the following steps: when a synchronous instruction is detected, file downloading information and record management logic data corresponding to the iOS terminal identification are obtained through an iCloud communication protocol simulated in advance according to the iOS terminal identification carried by the synchronous instruction; and synchronizing the data of the iOS terminal corresponding to the iOS terminal identification to the android terminal according to the file downloading information and the record management logic data. According to the method, the iCloud communication protocol is simulated on the android terminal in advance, the communication between the android terminal and the iCloud server is realized through the iCloud communication protocol, the android terminal directly obtains the file downloading information and the recording management logic data from the iCloud server, the data of the iOS terminal is finally obtained according to the file downloading information and the recording management logic data, the data of the iOS terminal is directly synchronized to the android terminal, the data synchronization process is simplified, and the synchronization efficiency is improved.

Description

Data synchronization method and device
Technical Field
The invention relates to the technical field of internet communication, in particular to a data synchronization method and device.
Background
Currently, many users have terminals with different operating systems, such as terminals with Android operating system and iOS operating system (apple mobile operating system). Users have an increasing demand for data synchronization between terminals of different operating systems.
Currently, if a user wants to synchronize data on an iOS terminal to an Android terminal, the data on an iCloud (apple cloud service) server needs to be restored to the iOS terminal, then management software on the iOS terminal is used for backing up the data to be synchronized or exporting the data to a PC (Personal Computer), and finally the management software on the Android terminal is used for importing the data to the Android terminal.
The data are synchronized from the iCloud server to the Android terminal by means of a PC or management software, the synchronization process is complex, and the synchronization efficiency is low. And the type of data provided by the iCloud server is very limited, with substantially no third party application data.
Disclosure of Invention
In view of this, an embodiment of the present invention provides a data synchronization method and apparatus, so as to solve the following problems in the prior art: in the prior art, data are synchronized from an iCloud server to an Android terminal by means of a PC (personal computer) or management software, the synchronization process is complex, and the synchronization efficiency is low. And the type of data provided by the iCloud server is very limited, with substantially no third party application data.
In a first aspect, an embodiment of the present invention provides a data synchronization method, where the method includes:
when a synchronous instruction is detected, acquiring file downloading information and recording management logic data corresponding to the iOS terminal identification through a pre-simulated iCloud communication protocol according to the iOS terminal identification carried by the synchronous instruction;
and synchronizing the data of the iOS terminal corresponding to the iOS terminal identification to the local android terminal according to the file downloading information and the record management logic data.
With reference to the first aspect, an embodiment of the present invention provides a first possible implementation manner of the first aspect, where the obtaining, according to the iOS terminal identifier carried by the synchronization instruction, file download information and record management logic data corresponding to the iOS terminal identifier through a pre-simulated iCloud communication protocol includes:
sending the iOS terminal identification carried by the synchronous instruction to an iCloud server through a pre-simulated iCloud communication protocol;
and receiving file downloading information and record management logic data corresponding to the iOS terminal identification returned by the iCloud server.
With reference to the first possible implementation manner of the first aspect, an embodiment of the present invention provides a second possible implementation manner of the first aspect, where before sending the iOS terminal identifier carried by the synchronization instruction to the iCloud server, the method further includes:
acquiring an iCloud account and a password of a user;
sending the iCloud account and the password to an iCloud server through a pre-simulated iCloud communication protocol;
and receiving the authorization token returned by the iCloud server.
With reference to the first aspect, an embodiment of the present invention provides a third possible implementation manner of the first aspect, where before acquiring file download information and record management logic data corresponding to the iOS terminal identifier through a pre-simulated iCloud communication protocol, the method further includes:
and acquiring an iCloud data packet, and simulating an iCloud communication protocol according to the iCloud data packet.
With reference to the third possible implementation manner of the first aspect, an embodiment of the present invention provides a fourth possible implementation manner of the first aspect, where the simulating an iCloud communication protocol according to the iCloud packet includes:
analyzing the iCloud data packet to obtain format information of the iCloud data packet;
according to the format information, determining a communication instruction corresponding to the iCloud data packet in a reverse push mode;
sending the communication instruction to an iCloud server, and determining the communication instruction as the iCloud communication instruction if the iCloud data packet returned by the iCloud server is received; if the iCloud data packet returned by the iCloud server is not received, returning to execute the communication instruction corresponding to the iCloud data packet determined by reverse pushing according to the format information;
and generating the iCloud communication protocol according to all the determined iCloud communication instructions.
With reference to the first aspect, an embodiment of the present invention provides a fifth possible implementation manner of the first aspect, where synchronizing, according to the file download information and the record management logic data, data of the iOS terminal corresponding to the iOS terminal identifier to an android terminal local area includes:
downloading a plurality of data blocks corresponding to the iOS terminal identification from a third-party cloud storage server according to the file downloading information;
restoring the plurality of data blocks into an encrypted file according to data mapping information included in the record management logic data;
analyzing a key package and a file key from file meta information included in the file downloading information;
and decrypting the encrypted file according to the key package and the file secret key to obtain synchronous data.
In a second aspect, an embodiment of the present invention provides a data synchronization apparatus, where the apparatus includes:
the acquisition module is used for acquiring file downloading information and record management logic data corresponding to the iOS terminal identification through a pre-simulated iCloud communication protocol according to the iOS terminal identification carried by the synchronous instruction when the synchronous instruction is detected;
and the synchronization module is used for synchronizing the data of the iOS terminal corresponding to the iOS terminal identification to the local android terminal according to the file downloading information and the record management logic data.
With reference to the second aspect, an embodiment of the present invention provides a first possible implementation manner of the second aspect, where the obtaining module includes:
the sending unit is used for sending the iOS terminal identification carried by the synchronous instruction to the iCloud server through a pre-simulated iCloud communication protocol;
and the receiving unit is used for receiving the file downloading information and the record management logic data which are returned by the iOS terminal identification.
With reference to the second aspect or the first possible implementation manner of the second aspect, an embodiment of the present invention provides a second possible implementation manner of the second aspect, where the apparatus further includes:
and the simulation module is used for acquiring the iCloud data packet and simulating the iCloud communication protocol according to the iCloud data packet.
With reference to the second possible implementation manner of the second aspect, an embodiment of the present invention provides a third possible implementation manner of the second aspect, where the simulation module includes:
the acquisition unit is used for analyzing the iCloud data packet and acquiring the format information of the iCloud data packet;
the instruction reverse-pushing unit is used for determining a communication instruction corresponding to the iCloud data packet in a reverse-pushing mode according to the format information;
the command determining unit is used for sending the communication command to the iCloud server, and determining the communication command as the iCloud communication command if the iCloud data packet returned by the iCloud server is received; if the iCloud data packet returned by the iCloud server is not received, returning to execute the communication instruction corresponding to the iCloud data packet determined by reverse pushing according to the format information;
and the generating unit is used for generating the iCloud communication protocol according to all the determined iCloud communication instructions.
In the method and the device provided by the embodiment of the invention, when a synchronous instruction is detected, file downloading information and record management logic data corresponding to the iOS terminal identification are obtained through an iCloud communication protocol simulated in advance according to the iOS terminal identification carried by the synchronous instruction; and synchronizing the data of the iOS terminal corresponding to the iOS terminal identification to the android terminal according to the file downloading information and the record management logic data. According to the method, the iCloud communication protocol is simulated on the android terminal in advance, the communication between the android terminal and the iCloud server is realized through the iCloud communication protocol, the android terminal directly obtains the file downloading information and the recording management logic data from the iCloud server, the data of the iOS terminal is finally obtained according to the file downloading information and the recording management logic data, the data of the iOS terminal is directly synchronized to the android terminal, the data synchronization process is simplified, and the synchronization efficiency is improved.
In order to make the aforementioned and other objects, features and advantages of the present invention comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present invention and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained according to the drawings without inventive efforts.
Fig. 1 is a flowchart illustrating a data synchronization method according to embodiment 1 of the present invention;
fig. 2 is a functional block diagram illustrating a data synchronization method provided in embodiment 1 of the present invention;
fig. 3 is a schematic structural diagram illustrating a data synchronization apparatus according to embodiment 2 of the present invention;
fig. 4 is a schematic structural diagram illustrating another data synchronization apparatus provided in embodiment 2 of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. The components of embodiments of the present invention generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present invention, presented in the figures, is not intended to limit the scope of the invention, as claimed, but is merely representative of selected embodiments of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present invention without making any creative effort, shall fall within the protection scope of the present invention.
In consideration of the fact that in the prior art, when data are synchronized from an iCloud server to an Android terminal, a PC (personal computer) or management software is required, the synchronization process is complex, and the synchronization efficiency is low. And the type of data provided by the iCloud server is very limited, with substantially no third party application data. Based on this, embodiments of the present invention provide a data synchronization method and apparatus, which are described below by way of embodiments.
Example 1
The embodiment of the invention provides a data synchronization method.
The execution main body of the embodiment of the invention is the android terminal, when a user needs to synchronize data on the iOS terminal to the android terminal, the android terminal can simulate the iCloud communication protocol on the android terminal, realize data communication between the android terminal and the iCloud server through the simulated iCloud communication protocol, realize that the android terminal directly obtains the data from the iCloud server, simplify the data synchronization process between the android terminal and the iOS terminal, and improve the data synchronization efficiency.
Before the data synchronization is carried out through the method provided by the embodiment of the invention, the android terminal firstly acquires the iCloud data packet, and simulates the iCloud communication protocol according to the acquired iCloud data packet. The iCloud data packet can be acquired from the iOS terminal by a technician, and then the acquired iCloud data packet is submitted to the android terminal. After receiving the iCloud data packet submitted by the technical personnel, the android terminal simulates the iCloud communication protocol in the following mode, including:
analyzing the iCloud data packet to obtain format information of the iCloud data packet; determining a communication instruction corresponding to the iCloud data packet by reverse pushing according to the format information of the iCloud data packet; sending the communication instruction to an iCloud server, and determining the communication instruction as the iCloud communication instruction if receiving an iCloud data packet returned by the iCloud server; if the iCloud data packet returned by the iCloud server is not received, returning to execute the communication instruction corresponding to the iCloud data packet determined by reverse pushing according to the format information; and generating the iCloud communication protocol according to all the determined iCloud communication instructions.
And reversely pushing the communication command corresponding to the iCloud data packet and then sending the communication command to the iCloud server. And if the communication instruction is correct, the iCloud server sends the iCloud data packet to the android terminal according to the communication instruction after receiving the communication instruction. If the communication instruction is incorrect, the iCloud server does not respond to the communication instruction after receiving the communication instruction, or returns instruction error indication information to the android terminal. In the embodiment of the invention, after the android terminal sends the reversely pushed communication instruction to the iCloud server, if the iCloud data packet returned by the iCloud server is received, the communication instruction is determined to be correct, and the communication instruction is added into the simulated iCloud communication protocol. If the iCloud data packet returned by the iCloud server is not received within the preset time length or the instruction error indication information returned by the iCloud server is received, the communication instruction is determined to be incorrect, the communication instruction is discarded, then the step of determining the communication instruction corresponding to the iCloud data packet by performing reverse push according to the format information of the iCloud data packet is returned, a new communication instruction is re-pushed in the reverse direction, and then the new communication instruction is sent to the iCloud server according to the mode. And if the preset number of communication instructions are continuously pushed backwards for the same iCloud data packet, and finally the preset number of communication instructions are determined to be incorrect, the iCloud data packet is abandoned.
In the embodiment of the invention, a large number of iCloud data packets are obtained from the iOS terminal, the communication instructions corresponding to the data packets are pushed backwards in the mode, and the communication instructions are sent to the iCloud server for error test, so that the correct communication instructions are determined to form the simulated iCloud communication protocol. The pre-simulated iCloud communication protocol can realize the following core functions: (1) obtaining an authorization token through the iCloud account and the password to authorize the subsequent request; (2) acquiring a list of file records; (3) acquiring record management logic data; (4) acquiring the attribute of a file record, wherein the attribute of the file record comprises file decryption information; (5) acquiring file downloading information corresponding to the file record; (6) key packet data is obtained.
As shown in fig. 1, after the iCloud communication protocol is simulated on the android terminal in the above manner, the data on the iOS terminal is synchronized to the local of the android terminal through the following operations of steps 101 and 102.
Step 101: and when the synchronous instruction is detected, acquiring file downloading information and recording management logic data corresponding to the iOS terminal identification through a pre-simulated iCloud communication protocol according to the iOS terminal identification carried by the synchronous instruction.
When a user needs to synchronize data on a certain iOS terminal to an android terminal, the user submits a synchronization instruction to the android terminal, and the synchronization instruction carries an iOS terminal identifier corresponding to the iOS terminal. And after detecting the synchronous instruction, the android terminal firstly displays a login page to the user. The user enters the user's iCloud account and password in the login page. And the android terminal acquires the iCloud account and the password of the user from the login page. And then, the iCloud account and the password are sent to the iCloud server through a pre-simulated iCloud communication protocol. And after the iCloud server receives the iCloud account and the password, acquiring a corresponding registration password according to the iCloud account, judging whether the registration secret is consistent with the received password, if so, returning an authorization token to the android terminal, and the android terminal receives the authorization token returned by the iCloud server. And if the password is inconsistent with the password, returning prompt information for prompting the password error to the android terminal. And the android terminal receives the iCloud account and the password input again by the user after receiving the prompt message, and acquires the authorization token from the iCloud server according to the mode.
After the authorization token is obtained in the above manner, the android terminal can perform data communication with the iCloud server through the pre-simulated iCloud communication protocol. And the android terminal sends the iOS terminal identification carried by the synchronous instruction to the iCloud server through a pre-simulated iCloud communication protocol.
The backup files of current iOS terminals are typically stored divided into a plurality of data blocks. The storage policy for the iCloud server is: the iCloud server only stores file download information of the backup file of the iOS terminal, which includes basic information of the file, file meta information, file download token (flag), and the like, and record management logic data. The file meta-information includes a key package, a file key, and the like. The record management logic data includes data mapping information including a mapping relationship between the file and the data block and a mapping relationship between the arrangement sequence number and the data block. The mapping relation between the files and the data blocks is used for indicating which data blocks a file comprises, the arrangement sequence number indicates the arrangement position of the data blocks when the file is formed, and a plurality of data blocks included in the file can be formed into the file again according to the arrangement sequence number. And the data blocks divided by the backup file of the iOS terminal are stored on the third-party cloud storage server in a distributed mode.
Since the user may have multiple iOS terminals at the same time, for each iOS terminal, the iCloud server stores file download information of the backup file of the iOS terminal, records the correspondence of the management logic data and the iOS terminal identification. And the third-party cloud storage server stores the corresponding relation between the plurality of data blocks corresponding to the iOS terminal and the iOS terminal identifier.
The iCloud server receives an iOS terminal identification sent by the android terminal, acquires corresponding file downloading information and record management logic data according to the iOS terminal identification, and then returns the acquired file downloading information and record management logic data to the android terminal. And the android terminal receives file downloading information and record management logic data corresponding to the iOS terminal identification returned by the iCloud server.
Step 102: and synchronizing the data of the iOS terminal corresponding to the iOS terminal identification to the local android terminal according to the file downloading information and the record management logic data.
And after the android terminal receives the file downloading information and the record management logic data returned by the iCloud server, downloading a plurality of data blocks corresponding to the iOS terminal identification from a third-party cloud storage server according to the file downloading information. Restoring the downloaded data blocks into an encrypted file according to data mapping information included in the record management logic data; analyzing a key package and a file key from file meta information included in the file downloading information; and decrypting the encrypted file according to the key package and the file secret key to obtain synchronous data.
The android terminal analyzes data mapping information from the record management logic data, the data mapping information comprises a mapping relation between the arrangement serial number and the data block, the arrangement serial number corresponding to each downloaded data block is determined according to the mapping relation, the data blocks are sequenced according to the sequence of the arrangement serial numbers according to the arrangement serial numbers corresponding to the data blocks, and the data blocks are combined into an encrypted file. And then, a key package and a file key are obtained from file meta information included in the file downloading information, the encrypted file is decrypted through the key package and the file key, and the obtained plaintext is data on the iOS terminal, so that the data on the iOS terminal is synchronized to the local of the android terminal.
For a further understanding of the methods provided by embodiments of the present invention, reference is made to the following brief description taken in connection with the accompanying drawings. As shown in fig. 2, the data synchronization method provided by the embodiment of the present invention includes an application layer and a function implementation layer. The application layer comprises a login module and a data processing module, and the function implementation layer comprises an iCloud communication protocol module, a download module and a data decryption module. The login module is used for receiving the iCloud account and the password input by the user. The data processing module is used for processing the synchronous data acquired by the function implementation layer in combination with the service requirements of the application, such as performing operations of removing duplicate or merging on the address list. The iCloud communication protocol module covers all protocols required for communication with the iCloud server, including all protocols required for communication processes such as authentication, backup information acquisition, file record information acquisition, file download information acquisition, record attribute acquisition, record management logic data acquisition and the like. The downloading module is used for acquiring file downloading information and recording management logic data through an iCloud communication protocol and downloading data blocks from a third-party cloud storage server, and the data blocks downloaded by the downloading module are a plurality of data blocks which are divided after being encrypted. The data decryption module is used for combining a plurality of data blocks downloaded by the download module according to the mapping relation according to the data mapping information included in the record management logic data, restoring the data blocks into an encrypted file, and decrypting the combined encrypted file by using the key package and the file secret key included in the file download information to obtain a plaintext file, wherein the plaintext file is the synchronous data. The data decryption module obtains a decryption strategy through analysis of the iCloud data packet, and the decryption strategy is completely independent of components such as iTunes or iCloud Panel of apple Inc.
In the embodiment of the invention, when a synchronous instruction is detected, file downloading information and record management logic data corresponding to the iOS terminal identification are obtained through an iCloud communication protocol simulated in advance according to the iOS terminal identification carried by the synchronous instruction; and synchronizing the data of the iOS terminal corresponding to the iOS terminal identification to the android terminal according to the file downloading information and the record management logic data. According to the method, the iCloud communication protocol is simulated on the android terminal in advance, the communication between the android terminal and the iCloud server is realized through the iCloud communication protocol, the android terminal directly obtains the file downloading information and the recording management logic data from the iCloud server, the data of the iOS terminal is finally obtained according to the file downloading information and the recording management logic data, the data of the iOS terminal is directly synchronized to the android terminal, the data synchronization process is simplified, and the synchronization efficiency is improved.
Example 2
Referring to fig. 3, an embodiment of the present invention provides a data synchronization apparatus, configured to execute the data synchronization method provided in embodiment 1, where the apparatus includes:
the obtaining module 20 is configured to, when a synchronization instruction is detected, obtain, according to an iOS terminal identifier carried by the synchronization instruction, file download information and record management logic data corresponding to the iOS terminal identifier through an iCloud communication protocol that is simulated in advance;
and the synchronization module 21 is configured to synchronize the data of the iOS terminal corresponding to the iOS terminal identifier to the local android terminal according to the file download information and the record management logic data.
As shown in fig. 4, the obtaining module 20 includes:
the sending unit 201 is configured to send the iOS terminal identifier carried by the synchronization instruction to the iCloud server through the pre-simulated iCloud communication protocol;
and the receiving unit 202 is configured to receive file download information and record management logic data corresponding to the iOS terminal identifier returned by the iCloud server.
As shown in fig. 4, the apparatus further includes:
and the simulation module 22 is used for acquiring the iCloud data packet and simulating the iCloud communication protocol according to the iCloud data packet.
The simulation module 22 includes:
the acquisition unit is used for analyzing the iCloud data packet and acquiring the format information of the iCloud data packet;
the instruction reverse-pushing unit is used for determining a communication instruction corresponding to the iCloud data packet in a reverse-pushing mode according to the format information;
the command determining unit is used for sending a communication command to the iCloud server, and determining the communication command as the iCloud communication command if the iCloud data packet returned by the iCloud server is received; if the iCloud data packet returned by the iCloud server is not received, returning to execute the communication instruction corresponding to the iCloud data packet determined by reverse pushing according to the format information;
and the generating unit is used for generating the iCloud communication protocol according to all the determined iCloud communication instructions.
In this embodiment of the present invention, before the obtaining module 20 sends the iOS terminal identifier carried by the synchronization instruction to the iCloud server, the method further includes:
the token acquisition module is used for acquiring the iCloud account and the password of the user; sending an iCloud account and a password to an iCloud server through a pre-simulated iCloud communication protocol; an authorization token returned by the iCloud server is received.
In the embodiment of the present invention, the synchronization module 21 is configured to download, according to the file download information, a plurality of data blocks corresponding to the iOS terminal identifier from the third-party cloud storage server; restoring the downloaded data blocks into an encrypted file according to data mapping information included in the record management logic data; analyzing a key package and a file key from file meta information included in the file downloading information; and decrypting the encrypted file according to the key package and the file secret key to obtain synchronous data.
In the embodiment of the invention, when a synchronous instruction is detected, file downloading information and record management logic data corresponding to the iOS terminal identification are obtained through an iCloud communication protocol simulated in advance according to the iOS terminal identification carried by the synchronous instruction; and synchronizing the data of the iOS terminal corresponding to the iOS terminal identification to the android terminal according to the file downloading information and the record management logic data. According to the method, the iCloud communication protocol is simulated on the android terminal in advance, the communication between the android terminal and the iCloud server is realized through the iCloud communication protocol, the android terminal directly obtains the file downloading information and the recording management logic data from the iCloud server, the data of the iOS terminal is finally obtained according to the file downloading information and the recording management logic data, the data of the iOS terminal is directly synchronized to the android terminal, the data synchronization process is simplified, and the synchronization efficiency is improved.
The data synchronization device provided by the embodiment of the present invention may be specific hardware on the device, or software or firmware installed on the device, etc. The device provided by the embodiment of the present invention has the same implementation principle and technical effect as the method embodiments, and for the sake of brief description, reference may be made to the corresponding contents in the method embodiments without reference to the device embodiments. It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the foregoing systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus and method may be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one logical division, and there may be other divisions when actually implemented, and for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of devices or units through some communication interfaces, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments provided by the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus once an item is defined in one figure, it need not be further defined and explained in subsequent figures, and moreover, the terms "first", "second", "third", etc. are used merely to distinguish one description from another and are not to be construed as indicating or implying relative importance.
Finally, it should be noted that: the above-mentioned embodiments are only specific embodiments of the present invention, which are used for illustrating the technical solutions of the present invention and not for limiting the same, and the protection scope of the present invention is not limited thereto, although the present invention is described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: any person skilled in the art can modify or easily conceive the technical solutions described in the foregoing embodiments or equivalent substitutes for some technical features within the technical scope of the present disclosure; such modifications, changes or substitutions do not depart from the spirit and scope of the present invention in its spirit and scope. Are intended to be covered by the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the appended claims.

Claims (6)

1. A method for synchronizing data, the method comprising:
acquiring an iCloud data packet, and simulating an iCloud communication protocol according to the iCloud data packet;
when a synchronous instruction is detected, acquiring file downloading information and recording management logic data corresponding to the iOS terminal identification through a pre-simulated iCloud communication protocol according to the iOS terminal identification carried by the synchronous instruction;
according to the file downloading information and the record management logic data, synchronizing the data of the iOS terminal corresponding to the iOS terminal identification to the local position of the android terminal;
the simulation of the iCloud communication protocol according to the iCloud data packet comprises the following steps:
analyzing the iCloud data packet to obtain format information of the iCloud data packet;
according to the format information, determining a communication instruction corresponding to the iCloud data packet in a reverse push mode;
sending the communication instruction to an iCloud server, and determining the communication instruction as the iCloud communication instruction if the iCloud data packet returned by the iCloud server is received; if the iCloud data packet returned by the iCloud server is not received, returning to execute the communication instruction corresponding to the iCloud data packet determined by reverse pushing according to the format information;
and generating the iCloud communication protocol according to all the determined iCloud communication instructions.
2. The method according to claim 1, wherein the obtaining of the file download information and the record management logic data corresponding to the iOS terminal identifier through a pre-simulated iCloud communication protocol according to the iOS terminal identifier carried by the synchronization instruction comprises:
sending the iOS terminal identification carried by the synchronous instruction to an iCloud server through a pre-simulated iCloud communication protocol;
and receiving file downloading information and record management logic data corresponding to the iOS terminal identification returned by the iCloud server.
3. The method according to claim 2, wherein before sending the iOS terminal id carried by the synchronization instruction to the iCloud server, the method further comprises:
acquiring an iCloud account and a password of a user;
sending the iCloud account and the password to an iCloud server through a pre-simulated iCloud communication protocol;
and receiving the authorization token returned by the iCloud server.
4. The method according to claim 1, wherein the synchronizing the data of the iOS terminal corresponding to the iOS terminal identifier to the local of the android terminal according to the file download information and the record management logic data comprises:
downloading a plurality of data blocks corresponding to the iOS terminal identification from a third-party cloud storage server according to the file downloading information;
restoring the plurality of data blocks into an encrypted file according to data mapping information included in the record management logic data;
analyzing a key package and a file key from file meta information included in the file downloading information;
and decrypting the encrypted file according to the key package and the file secret key to obtain synchronous data.
5. A data synchronization apparatus, the apparatus comprising:
the simulation module is used for acquiring the iCloud data packet and simulating an iCloud communication protocol according to the iCloud data packet;
the acquisition module is used for acquiring file downloading information and record management logic data corresponding to the iOS terminal identification through a pre-simulated iCloud communication protocol according to the iOS terminal identification carried by the synchronous instruction when the synchronous instruction is detected;
the synchronization module is used for synchronizing the data of the iOS terminal corresponding to the iOS terminal identification to the local android terminal according to the file downloading information and the record management logic data;
the simulation module includes:
the acquisition unit is used for analyzing the iCloud data packet and acquiring the format information of the iCloud data packet;
the instruction reverse-pushing unit is used for determining a communication instruction corresponding to the iCloud data packet in a reverse-pushing mode according to the format information;
the command determining unit is used for sending the communication command to the iCloud server, and determining the communication command as the iCloud communication command if the iCloud data packet returned by the iCloud server is received; if the iCloud data packet returned by the iCloud server is not received, returning to execute the communication instruction corresponding to the iCloud data packet determined by reverse pushing according to the format information;
and the generating unit is used for generating the iCloud communication protocol according to all the determined iCloud communication instructions.
6. The apparatus of claim 5, wherein the obtaining module comprises:
the sending unit is used for sending the iOS terminal identification carried by the synchronous instruction to the iCloud server through a pre-simulated iCloud communication protocol;
and the receiving unit is used for receiving the file downloading information and the record management logic data which are returned by the iOS terminal identification.
CN201710380312.3A 2017-05-25 2017-05-25 Data synchronization method and device Active CN107172165B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710380312.3A CN107172165B (en) 2017-05-25 2017-05-25 Data synchronization method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710380312.3A CN107172165B (en) 2017-05-25 2017-05-25 Data synchronization method and device

Publications (2)

Publication Number Publication Date
CN107172165A CN107172165A (en) 2017-09-15
CN107172165B true CN107172165B (en) 2020-09-11

Family

ID=59820717

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710380312.3A Active CN107172165B (en) 2017-05-25 2017-05-25 Data synchronization method and device

Country Status (1)

Country Link
CN (1) CN107172165B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110333874B (en) * 2019-06-10 2022-09-23 腾讯科技(成都)有限公司 iOS system installation packet data acquisition method, device, equipment and medium
CN113377581B (en) * 2021-06-30 2023-02-10 深圳万兴软件有限公司 Data backup method and device, computer equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103973756A (en) * 2013-02-06 2014-08-06 上海华师京城高新技术开发有限公司 Resource synchronization method and system thereof
CN105162679A (en) * 2015-07-10 2015-12-16 深圳市美贝壳科技有限公司 Synchronous photo displaying method and system
CN105468472A (en) * 2014-07-14 2016-04-06 北京奇虎科技有限公司 iOS operation system based data backup and recovery method and apparatus
CN105530277A (en) * 2014-09-30 2016-04-27 宇龙计算机通信科技(深圳)有限公司 Method and device for cooperative work of devices
CN106161731A (en) * 2015-03-25 2016-11-23 北京奇虎科技有限公司 Harassing and wrecking contact person information updating method, terminal unit, server and system

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140096213A1 (en) * 2012-09-28 2014-04-03 Kevin Quan Method and system for distributed credential usage for android based and other restricted environment devices

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103973756A (en) * 2013-02-06 2014-08-06 上海华师京城高新技术开发有限公司 Resource synchronization method and system thereof
CN105468472A (en) * 2014-07-14 2016-04-06 北京奇虎科技有限公司 iOS operation system based data backup and recovery method and apparatus
CN105530277A (en) * 2014-09-30 2016-04-27 宇龙计算机通信科技(深圳)有限公司 Method and device for cooperative work of devices
CN106161731A (en) * 2015-03-25 2016-11-23 北京奇虎科技有限公司 Harassing and wrecking contact person information updating method, terminal unit, server and system
CN105162679A (en) * 2015-07-10 2015-12-16 深圳市美贝壳科技有限公司 Synchronous photo displaying method and system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
聊聊iOS和Android手机联系人同步的事儿;纸寿司;《http://blog.sina.com.cn/s/blog_49c991850102vpgg.html》;20150323;第1-5页 *

Also Published As

Publication number Publication date
CN107172165A (en) 2017-09-15

Similar Documents

Publication Publication Date Title
CN108734028B (en) Data management method based on block chain, block chain link point and storage medium
CN113378236B (en) Evidence data online security notarization platform and security method
CN112134708A (en) Authorization method, authorization request method and device
CN110661748B (en) Log encryption method, log decryption method and log encryption device
CN110830242A (en) Key generation and management method and server
CN113140079B (en) Intelligent cabinet opening method, data processing method and device and intelligent cabinet application system
CN113032357A (en) File storage method and device and server
CN110351276B (en) Data processing method, device and computer readable storage medium
CN112532629B (en) Data transmission method, device, equipment and medium
CN108549824A (en) A kind of data desensitization method and device
CN107172165B (en) Data synchronization method and device
CN110351364B (en) Data storage method, device and computer readable storage medium
CN108418679B (en) Method and device for processing secret key under multiple data centers and electronic equipment
CN111445250B (en) Block chain key testing method and device
JP2011253511A (en) Information generation system and method thereof
CN113542187A (en) File uploading and downloading method and device, computer device and medium
CN110034922A (en) Request processing method, processing unit and requests verification method, verifying device
CN114124469B (en) Data processing method, device and equipment
CN110807640A (en) Method and device for recording copyright information
CN111130788B (en) Data processing method and system, data reading method and iSCSI server
WO2014206146A1 (en) Address book update method and apparatus
CN114117388A (en) Device registration method, device registration apparatus, electronic device, and storage medium
CN113642046A (en) Method and equipment for issuing operation and maintenance lists in batches
CN110471922B (en) Content extension method and device for accounting node and computer readable storage medium
CN107425973B (en) Public key modification method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant