WO2024017113A1 - 数据同步方法、装置和电子设备 - Google Patents

数据同步方法、装置和电子设备 Download PDF

Info

Publication number
WO2024017113A1
WO2024017113A1 PCT/CN2023/106956 CN2023106956W WO2024017113A1 WO 2024017113 A1 WO2024017113 A1 WO 2024017113A1 CN 2023106956 W CN2023106956 W CN 2023106956W WO 2024017113 A1 WO2024017113 A1 WO 2024017113A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
synchronization
electronic device
local area
area network
Prior art date
Application number
PCT/CN2023/106956
Other languages
English (en)
French (fr)
Inventor
陈文杰
Original Assignee
维沃移动通信有限公司
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 维沃移动通信有限公司 filed Critical 维沃移动通信有限公司
Publication of WO2024017113A1 publication Critical patent/WO2024017113A1/zh

Links

Classifications

    • 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/2801Broadband local area networks

Definitions

  • This application belongs to the field of communication technology, and specifically relates to a data synchronization method, device and electronic equipment.
  • the data synchronization scheme in the prior art has problems such as slow synchronization speed.
  • the purpose of the embodiments of the present application is to provide a data synchronization method, device and electronic equipment, which can solve the problem of slow synchronization speed of data synchronization solutions in the prior art.
  • embodiments of the present application provide a data synchronization method applied to a first electronic device.
  • the method includes:
  • the data synchronization request carries a data identifier; the data identifier is obtained based on the data information of the synchronization data obtained from the cloud server.
  • embodiments of the present application provide a data synchronization method applied to a second electronic device.
  • the method includes:
  • the data identification is obtained by the first electronic device based on the data information of the synchronization data obtained from the cloud server.
  • inventions of the present application provide a data synchronization device applied to a first electronic device.
  • the device includes:
  • a first sending module configured to send a data synchronization request to the second electronic device through the local area network when the first electronic device is connected to the second electronic device through the local area network;
  • a first receiving module configured to receive synchronization data sent by the second electronic device through the local area network
  • the data synchronization request carries a data identifier; the data identifier is obtained based on the data information of the synchronization data obtained from the cloud server.
  • inventions of the present application provide a data synchronization device applied to a second electronic device.
  • the device includes:
  • a sixth receiving module configured to receive a data synchronization request sent by the first electronic device through the local area network when the second electronic device is connected to the first electronic device through a local area network;
  • the first acquisition module is used to acquire synchronization data according to the data identifier in the data synchronization request;
  • a sixth sending module configured to send the synchronization data to the first electronic device through the local area network
  • the data identification is obtained by the first electronic device based on the data information of the synchronization data obtained from the cloud server.
  • inventions of the present application provide an electronic device.
  • the electronic device includes a processor, a memory, and a program or instructions stored on the memory and executable on the processor.
  • the program or instructions are When the processor is executed, the steps of the method described in the first aspect or the second aspect are implemented. steps.
  • embodiments of the present application provide a readable storage medium on which programs or instructions are stored.
  • the programs or instructions are executed by a processor, the implementation is as described in the first aspect or the second aspect. steps of the method.
  • embodiments of the present application provide a chip.
  • the chip includes a processor and a communication interface.
  • the communication interface is coupled to the processor.
  • the processor is used to run programs or instructions to implement the first aspect. or the method described in the second aspect.
  • the data synchronization method when the first electronic device is connected to the second electronic device through a local area network, sending a data synchronization request to the second electronic device through the local area network; receiving the Synchronization data sent by the second electronic device through the local area network; wherein the data synchronization request carries a data identifier; the data identifier is obtained based on the data information of the synchronization data obtained from the cloud server; transmission using the local area network can be realized data, which can increase the data synchronization speed and solve the problem of slow synchronization speed of data synchronization solutions in the existing technology.
  • Figure 1 is a schematic flowchart 1 of the data synchronization method according to the embodiment of the present application.
  • Figure 2 is a schematic flowchart 2 of the data synchronization method according to the embodiment of the present application.
  • Figure 3 is a schematic diagram of the first networking method according to the embodiment of the present application.
  • FIG. 4 is a diagram 1 of the equipment list according to the embodiment of the present application.
  • Figure 5 is a schematic diagram 1 of the specific implementation flow of the data synchronization method according to the embodiment of the present application.
  • Figure 6 is a schematic diagram of data information according to the embodiment of the present application.
  • Figure 7 is a schematic diagram of the second networking method according to the embodiment of the present application.
  • Figure 8 is a diagram 2 of the equipment list according to the embodiment of the present application.
  • Figure 9 is a schematic diagram 2 of the specific implementation flow of the data synchronization method according to the embodiment of the present application.
  • Figure 10 is a second schematic diagram of data information according to the embodiment of the present application.
  • Figure 11 is a schematic structural diagram of the data synchronization device according to the embodiment of the present application.
  • Figure 12 is a schematic structural diagram 2 of the data synchronization device according to the embodiment of the present application.
  • Figure 13 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
  • Figure 14 is a schematic diagram 2 of the structure of an electronic device according to an embodiment of the present application.
  • Figure 15 is a schematic diagram three of the structure of an electronic device according to an embodiment of the present application.
  • first, second, etc. in the description and claims of this application are used to distinguish similar objects and are not used to describe a specific order or sequence. It is to be understood that the figures so used are interchangeable under appropriate circumstances so that the embodiments of the present application can be practiced in orders other than those illustrated or described herein, and that "first,” “second,” etc. are distinguished Objects are usually of one type, and the number of objects is not limited. For example, the first object can be one or multiple.
  • “and/or” in the description and claims indicates at least one of the connected objects, and the character “/" generally indicates that the related objects are in an "or” relationship.
  • the data synchronization method provided by the embodiment of the present application is applied to the first electronic device, as shown in Figure 1, including:
  • Step 11 When the first electronic device is connected to the second electronic device through the local area network, send a data synchronization request to the second electronic device through the local area network.
  • the networking mode of the local area network includes at least one of the following: a first networking mode of connecting through network hotspot devices; a second networking mode of direct connection of devices.
  • a first networking mode the first electronic device and the second electronic device are respectively connected to the network hotspot device; in the second networking mode, the first electronic device and the second electronic device The device is connected directly.
  • network hotspot device it can be: router, mobile hotspot device, etc., which is not limited here.
  • the data synchronization request can also carry other information, such as breakpoint information, etc., which is not limited here.
  • step 12 may also include: determining whether the first electronic device is connected to the second electronic device through a local area network; in this way, it is clear whether to use the local area network for data transmission.
  • Step 12 Receive synchronization data sent by the second electronic device through the local area network; wherein the data synchronization request carries a data identifier; the data identifier is obtained according to the data information of the synchronization data obtained from the cloud server.
  • the data identifier may be a Globally Unique Identifier (GUID), but is not limited to this.
  • GUID Globally Unique Identifier
  • the synchronization data may be the data ontology in the file type data, rather than file summary information, such as file name, file size, file type, thumbnail, etc., which is not limited here.
  • a data synchronization request is sent to the second electronic device through the local area network;
  • the data synchronization method also includes: when the first electronic device is not connected to the second electronic device through the local area network, sending a data synchronization request to the cloud server; wherein the data synchronization request carries has the data identification; receives the synchronization data sent by the cloud server.
  • the data synchronization method further includes: in the process of receiving the synchronization data sent by the cloud server, detecting that the first electronic device is connected to the second electronic device through the local area network. , suspend receiving the synchronization data, and record the first breakpoint information of the synchronization data; send a data synchronization request to the second electronic device through the local area network according to the first breakpoint information; receive the third Two electronic devices sent from the first through the local area network Synchronization data starting at the breakpoint; wherein the first breakpoint corresponds to the first breakpoint information.
  • the method further includes: sending an information synchronization request to the cloud server; receiving the data information of the synchronization data sent by the cloud server; , sending a data synchronization request to the second electronic device, including: sending a data synchronization request to the second electronic device through the local area network according to the data identifier in the data information.
  • the data synchronization method further includes: in the process of receiving the synchronization data sent by the second electronic device through the local area network, when it is detected that the target connection is interrupted, recording the third step of the synchronization data.
  • Two breakpoint information sending a data synchronization request to the cloud server according to the second breakpoint information; receiving synchronization data starting from the second breakpoint sent by the cloud server; wherein the target connection is the The local area network connection between the first electronic device and the second electronic device; the second breakpoint corresponds to the second breakpoint information.
  • the embodiment of the present application also provides a data synchronization method, applied to the second electronic device, as shown in Figure 2, including:
  • Step 21 When the second electronic device is connected to the first electronic device through the local area network, receive the data synchronization request sent by the first electronic device through the local area network.
  • the networking mode of the local area network includes at least one of the following: a first networking mode of connecting through network hotspot devices; a second networking mode of direct connection of devices.
  • a first networking mode the first electronic device and the second electronic device are respectively connected to the network hotspot device; in the second networking mode, the first electronic device and the second electronic device The device is connected directly.
  • network hotspot device it can be: router, mobile hotspot device, etc., which is not limited here.
  • Step 22 Obtain synchronization data according to the data identifier in the data synchronization request.
  • the data synchronization request can also carry other information, such as breakpoint information, etc.
  • the data identifier can be a globally unique identifier GUID, but is not limited to this.
  • Step 23 Send the synchronization data to the first electronic device through the local area network; wherein the data identifier is obtained by the first electronic device based on the data information of the synchronization data obtained from the cloud server.
  • the synchronization data may be the data ontology in the file type data, rather than file summary information, such as file name, file size, file type, thumbnail, etc., which is not limited here.
  • the data synchronization request sent by the first electronic device is received through the local area network; according to the data synchronization
  • the data identifier in the request is used to obtain the synchronization data; the synchronization data is sent to the first electronic device through the local area network; wherein the data identifier is the first electronic device according to the synchronization data obtained from the cloud server.
  • Data information is obtained; it is possible to use the local area network to transmit data, which can increase the data synchronization speed and solve the problem of slow synchronization speed of data synchronization solutions in the existing technology.
  • the data synchronization request also carries first breakpoint information; and obtaining synchronization data according to the data identifier in the data synchronization request includes: according to the data identifier in the data synchronization request and the first breakpoint information.
  • Breakpoint information obtain synchronization data starting from the first breakpoint; wherein the first breakpoint corresponds to the first breakpoint information; the first breakpoint information is the first electronic device at In the process of receiving the synchronization data sent by the cloud server, it is recorded when it is detected that the first electronic device is connected to the second electronic device through the local area network.
  • the method before receiving the data synchronization request sent by the first electronic device, the method further includes: uploading the synchronization data to the cloud server under a first condition; wherein the first condition includes at least the following: One item: the remaining power is greater than the first threshold, or is in a charging state; connected to a wireless network; the device temperature is lower than the second threshold; the required network bandwidth is lower than the third threshold.
  • synchronization data can be uploaded after the power, power consumption, data network traffic, and/or user usage scenarios are met to achieve the effects of power saving and temperature control.
  • the options included in the first condition it can be the condition options that need to be satisfied currently, or the condition options that need to be satisfied at a specified time. For example: at a certain time before the current time, or at a certain time after the current time, there is no limit here.
  • the method further includes: uploading the data information of the synchronization data to the cloud server.
  • the method before uploading the data information of the synchronized data to the cloud server, the method further includes: dividing the data to be synchronized into text type data and file type data; and determining the synchronized data and the corresponding data according to the file type data.
  • the data information of the synchronized data; the uploading the data information of the synchronized data to the cloud server includes: uploading the text type data and the data information of the synchronized data to the cloud server.
  • the method further includes: receiving a data identifier sent by the cloud server according to the data information; and comparing the data identifier with the The local storage path of the synchronized data is associated and stored. What is stored may be the association between the data identifier and the local storage path, but is not limited to this.
  • the first electronic device takes terminal A as an example
  • the second electronic device takes terminal B as an example
  • the network hotspot device takes a router as an example
  • the second networking method takes Take Wireless Fidelity Peer-to-Peer (WiFi P2P) as an example.
  • WiFi P2P Wireless Fidelity Peer-to-Peer
  • embodiments of the present application provide a data synchronization method, which can be specifically implemented as a method of accelerating data synchronization using a local area network, which involves: using a centralized cloud service, terminal A (such as a computer) synchronizes data through the Internet. Synchronize the user's file directory and basic information (corresponding to the above data information, the data amount is small), and then based on the basic information of the file, connect through the LAN, go to the target terminal (i.e. terminal B, such as a mobile phone) to directly download the corresponding file content (corresponding to in the above synchronized data), It can greatly speed up the data synchronization speed.
  • terminal A such as a computer
  • the networking mode of the local area network includes: the above-mentioned first networking mode and the second networking mode).
  • the networking mode of the local area network includes: the above-mentioned first networking mode and the second networking mode.
  • it may include: a networking mode connected through a router (corresponding to the above-mentioned first networking mode), and a point-to-point networking mode through WiFi P2P (wireless network direct connection) (corresponding to the above-mentioned second networking mode), Adapt to different user usage scenarios.
  • Example 1 (corresponding to the first networking method mentioned above):
  • terminal A computer
  • terminal B mobile phone
  • data account data account used for synchronization
  • FIG 3 both have connected to the same router or hotspot, and the router or hotspot has been Access the Internet.
  • cloud server that provides centralized synchronization services for multiple device terminals.
  • the overall solution is mainly divided into three parts: Part 1, establishing a LAN connection (connected through a router); Part 2, Terminal B (mobile phone) uploading data; Part 3, Terminal A (computer) downloading data.
  • Part 1 mainly involves the following:
  • Operation 1 Establish a LAN connection between terminal A (computer) and terminal B (mobile phone) for the first time.
  • the Simple Service Discovery Protocol (SSDP) LAN discovery method can be used to establish a connection.
  • Terminal A and Terminal B can continuously send User Datagram Protocol (UDP) multicast messages to the multicast address in the LAN (for timely detection), and the messages can contain device information of their own devices (which can be used for Device list display), account information (the above data account information can be used to confirm whether to log in to the same account), IP address (can be used for subsequent connections between terminals A and B), etc.
  • UDP User Datagram Protocol
  • the other party's terminal displays the devices discovered in the LAN into the list of connectable devices, as shown in Figure 4.
  • the device list will filter out devices logged in with the same account.
  • the device ID of the last successfully connected device can be recorded in the database.
  • terminal A computer
  • terminal B mobile phone
  • terminal A can perform LAN discovery according to the method in operation 1 of this section.
  • terminal A After terminal A discovers the device list and before the device list is displayed, it can obtain the other party's device identifier (Identifier, ID) of the last successful connection from the database, and query the ID from the device list. If the device ID exists in the device list, the direct connection is successful. Otherwise, the device list is displayed.
  • ID device identifier
  • Part 2 mainly covers the following content:
  • Terminal B (mobile phone) triggers synchronization, uploads data information (corresponding to the above text type data), and performs file pre-upload (corresponding to the above data information).
  • terminal B (mobile phone) generates user data after the user performs actions such as editing notes, taking photos, editing documents, and receiving pictures and/or videos.
  • actions such as editing notes, taking photos, editing documents, and receiving pictures and/or videos.
  • user data There are two types of user data:
  • Text type data small data volume and fast transmission. Such as notes, schedule, contacts, album directory structure, etc.
  • File type data large amount of data and slow transmission. File types such as photos, videos, etc.
  • a data synchronization will be triggered (including dividing the data into the above two types and uploading).
  • the terminal i.e. terminal B
  • upload text type data to the server (corresponding to the above cloud server); after uploading the text type (data)
  • each Files with file type data are pre-uploaded.
  • the function of pre-upload is to upload a small amount of summary information of the file in advance (corresponding to the above data information), so that other terminals can display the file on the interface without uploading or downloading the specific content of the file.
  • icon and basic information such as file size, file name, last modified time, etc.
  • the pre-uploaded content may include file summary information (corresponding to the above data information) such as file name, file size, file type, thumbnail, etc., but does not include specific file content.
  • file summary information corresponding to the above data information
  • the data to be synchronized is divided into text type data and file type data; according to the file type data, the synchronization data and the Synchronize the data information of the data; upload the text type data and the data information of the synchronized data to the cloud server.
  • the server parses the file summary information during file pre-upload, generates a GUID (global unique identifier, corresponding to the above data identification) for each file, and returns it to client terminal B (mobile phone).
  • GUID is the unique identifier of each file on the cloud server. Through GUID, you can locate a file under a certain user (account). It is used to bind the pre-uploaded summary information of the file to the file itself, as well as the file positioning.
  • terminal B After receiving the GUID generated by the server, terminal B (mobile phone) associates the GUID with the local file path (corresponding to the above-mentioned local storage path) and records it in the database (local to terminal B). At this point, the file pre-upload is completed.
  • terminal B mobile phone
  • Terminal B determines the local environment conditions (corresponding to the above-mentioned first condition), and uploads files to the cloud server through the Internet at the appropriate time (corresponding to the above-mentioned synchronization data);
  • Terminal B mobile phone
  • Terminal B mobile phone
  • the power of the mobile phone is greater than a certain threshold (for example, the power is greater than 20%), or it is charging; corresponding to the above remaining power being greater than the first threshold, or it is in a charging state;
  • a certain threshold for example, the power is greater than 20%
  • the temperature of the mobile phone is lower than a certain threshold (such as the temperature is less than 45 degrees Celsius); corresponding to the temperature of the above device being lower than the second threshold;
  • terminal B mobile phone
  • terminal B begins to upload the specific file content (corresponding to the above-mentioned synchronization data) to the server, and at the same time brings the GUID of the file.
  • the GUID of the file is determined by the cloud server during the pre-upload process in operation 1 of this part. distribute.
  • Part 3 mainly involves the following content:
  • Operation 1 Download data to the cloud server through the Internet.
  • Terminal A (computer) regularly sends requests to the cloud server through the Internet to detect data updates. If there is a cloud data update, the new data will be downloaded. Specifically, for example: Terminal A sends a detection request to the cloud server. If the cloud server determines that there is an update, it will feedback a detection response to Terminal A. Terminal A will send an update request to the cloud server accordingly, and the cloud server will send data to Terminal A based on the update request; including The above step is to send an information synchronization request (carrying a data identifier) to the cloud server; and to receive the data information of the synchronization data sent by the cloud server.
  • Terminal A sends a detection request to the cloud server. If the cloud server determines that there is an update, it will feedback a detection response to Terminal A. Terminal A will send an update request to the cloud server accordingly, and the cloud server will send data to Terminal A based on the update request; including The above step is to send an information synchronization request (carrying a data identifier) to the cloud server; and
  • the file information may include file size, last modification date, file name, file type, and thumbnail.
  • the terminal A (computer) interface may display the file icon according to the file information.
  • Terminal A (computer) downloads the specific content of the file based on the GUID in the file information, as shown in Figure 6. This can be triggered by the user or executed automatically, and is not limited here.
  • the file (specific content)
  • it can be determined whether there is a local area network connection with terminal B (mobile phone) (corresponding to the above determination of whether the first electronic device is connected to the second electronic device through the local area network). If the local area network is not established To connect, you can return to Operation 2 of Part 1 and try to connect automatically.
  • the LAN connection is specifically the connection established through the above-mentioned router.
  • the file will be automatically downloaded through the LAN, and the file GUID will be sent to Terminal B (mobile phone) to request to download the file.
  • Terminal B mobile phone
  • the breakpoint position (corresponding to the above-mentioned second breakpoint information) is recorded, and the mobile phone is switched to the Internet cloud service to try to continue downloading from the breakpoint.
  • second breakpoint information of the synchronization data is recorded; according to the second breakpoint information , sending a data synchronization request (carrying a data identifier) to the cloud server; receiving synchronization data starting from the second breakpoint sent by the cloud server.
  • the mobile phone is connected to the LAN during the process of downloading files through the Internet, and after operation 2 in Part 1 automatically finds the connection, the Internet download is paused, and the breakpoint is recorded (corresponding to the first breakpoint information above). Switch to LAN to continue downloading from the breakpoint to speed up downloading.
  • the reception of the synchronization data is suspended and the synchronization is recorded.
  • First breakpoint information of the data sending a data synchronization request (carrying a data identifier) to the second electronic device through the local area network according to the first breakpoint information; receiving the second electronic device through the local area network Synchronous data sent starting from the first breakpoint.
  • Operation 4 During the file download process, the user opens the file, and the user is prompted to wait for the download to complete before opening.
  • the specific content of large files (i.e. file type data) is transmitted through the LAN, which has the advantages of being more stable and faster than using the Internet.
  • Terminal B mobile phone
  • Terminal B can delay uploading specific file content. It can delay uploading after meeting the requirements of electricity, power consumption, data network traffic, and user usage scenarios; thus achieving the effects of power saving and temperature control.
  • Terminal A computer
  • Terminal B mobile phone
  • Terminal B mobile phone
  • this solution improves the synchronization speed of large file data and also improves the real-time performance of large file data synchronization.
  • Example 2 (corresponding to the second networking method mentioned above):
  • terminal A computer
  • terminal B mobile phone
  • both ends have Bluetooth module and wireless network card support WiFi P2P connection.
  • the overall solution is mainly divided into three parts: Part 1, establishing a LAN connection (device networking, WiFi P2P connection); Part 2, Terminal B (mobile phone) uploads data; Part 3, Terminal A (computer) downloads data.
  • Part 1 mainly involves the following:
  • Operation 1 The first connection is established between terminal A (computer) and terminal B (mobile phone).
  • terminal B mobile phone
  • BLE Bluetooth Low Energy
  • the broadcast content contains the device information and account information of its own device (the above data account information can be used to confirm whether to log in or not). same account), etc.
  • terminal A computer
  • the device ID of the last successful connection can be recorded in the database.
  • Part 2 mainly covers the following content:
  • Terminal B (mobile phone) triggers synchronization, uploads data information (corresponding to the above text type data), and performs file pre-upload (corresponding to the above data information).
  • terminal B (mobile phone) generates user data after the user performs actions such as editing notes, taking photos, editing documents, and receiving pictures and/or videos.
  • actions such as editing notes, taking photos, editing documents, and receiving pictures and/or videos.
  • user data There are two types of user data:
  • Text type data small data volume and fast transmission. Such as notes, schedule, contacts, album directory structure, etc.
  • File type data large amount of data and slow transmission. File types such as photos, videos, etc.
  • a data synchronization will be triggered (including dividing the data into the above two types and uploading).
  • the terminal i.e. terminal B
  • upload text type data to the server (corresponding to the above cloud server); after uploading the text type (data)
  • each Files with file type data are pre-uploaded.
  • the function of pre-upload is to upload a small amount of summary information of the file in advance (corresponding to the above data information), so that other terminals can display the file on the interface without uploading or downloading the specific content of the file.
  • icon and basic information such as file size, file name, last modification time, etc.
  • the pre-uploaded content may include file summary information (corresponding to the above data information) such as file name, file size, file type, thumbnail, etc., but does not include specific file content.
  • file summary information corresponding to the above data information
  • the data to be synchronized is divided into text type data and file type data; according to the file type data, synchronization data and the data information of the synchronization data are determined; the text type data and the data information of the synchronization data are determined Upload to cloud server.
  • the server parses the file summary information during file pre-upload, generates a GUID (global unique identifier, corresponding to the above data identification) for each file, and returns it to client terminal B (mobile phone).
  • GUID is the unique identifier of each file on the cloud server. Through GUID, you can locate a file under a certain user (account), which is used to bind the pre-uploaded summary information of the file to the file itself. determination, and the location of the file.
  • terminal B After receiving the GUID generated by the server, terminal B (mobile phone) associates the GUID with the local file path (corresponding to the above-mentioned local storage path) and records it in the database (local to terminal B). At this point, the file pre-upload is completed.
  • Terminal B determines the local environment conditions (corresponding to the above-mentioned first condition), and uploads files to the cloud server through the Internet at the appropriate time (corresponding to the above-mentioned synchronization data);
  • Terminal B mobile phone
  • Terminal B mobile phone
  • the power of the mobile phone is greater than a certain threshold (such as the power is greater than 20%), or it is charging; corresponding to the above remaining power is greater than the first threshold, or it is in a charging state;
  • the temperature of the mobile phone is lower than a certain threshold (such as the temperature is less than 45 degrees Celsius); corresponding to the temperature of the above device being lower than the second threshold;
  • terminal B mobile phone
  • terminal B begins to upload the specific file content (corresponding to the above-mentioned synchronization data) to the server, and at the same time brings the GUID of the file.
  • the GUID of the file is determined by the cloud server during the pre-upload process in operation 1 of this part. distribute.
  • Part 3 mainly involves the following content:
  • Operation 1 Download data to the cloud server through the Internet.
  • Terminal A (computer) regularly sends requests to the cloud server through the Internet to detect data updates. If there is a cloud data update, the new data will be downloaded. Specifically, for example: Terminal A sends a detection request to the cloud server. If the cloud server determines that there is an update, it will feedback a detection response to Terminal A. Terminal A will send an update request to the cloud server accordingly, and the cloud server will send data to Terminal A based on the update request; including The above-mentioned sending of information synchronization request (carrying data identification) to the cloud server; receiving the cloud service The data information of the synchronization data sent by the device.
  • information synchronization request carrier data identification
  • the file information may include file size, last modification date, file name, file type, and thumbnail.
  • the terminal A (computer) interface may display the file icon according to the file information.
  • Terminal A (computer) downloads the specific content of the file based on the GUID in the file information, as shown in Figure 10. This can be triggered by the user or executed automatically, and is not limited here.
  • the file (specific content)
  • it can be determined whether there is a local area network connection with terminal B (mobile phone) (corresponding to the above determination of whether the first electronic device is connected to the second electronic device through the local area network). If the local area network is not established To connect, you can return to Operation 2 of Part 1 and try to connect automatically.
  • the LAN connection is specifically the above-mentioned WiFi P2P connection.
  • the file will be automatically downloaded through the LAN, and the file GUID will be sent to Terminal B (mobile phone) to request to download the file.
  • Terminal B mobile phone
  • the breakpoint position (corresponding to the above-mentioned second breakpoint information) is recorded, and the mobile phone is switched to the Internet cloud service to try to continue downloading from the breakpoint.
  • the second breakpoint information of the synchronization data is recorded; according to the second break point information, send a data synchronization request (carrying a data identifier) to the cloud server; receive synchronization data starting from the second breakpoint sent by the cloud server.
  • the mobile phone is connected to the LAN during the process of downloading files through the Internet, and after operation 2 in Part 1 automatically finds the connection, the Internet download is paused, and the breakpoint is recorded (corresponding to the first breakpoint information above). Switch to LAN to continue downloading from the breakpoint to speed up downloading.
  • the reception of the synchronization data is suspended and the synchronization is recorded.
  • First breakpoint information of the data sending a data synchronization request (carrying a data identifier) to the second electronic device through the local area network according to the first breakpoint information; receiving the second electronic device through the local area network Synchronous data sent starting from the first breakpoint.
  • Operation 4 During the file download process, the user opens the file, and the user is prompted to wait for the download to complete before opening.
  • the specific content of large files (i.e. file type data) is transmitted through the LAN, which has the advantages of being more stable and faster than using the Internet.
  • Terminal B mobile phone
  • Terminal B can delay uploading specific file content. It can delay uploading after meeting the requirements of electricity, power consumption, data network traffic, and user usage scenarios; thus achieving the effects of power saving and temperature control.
  • Terminal A computer can immediately download files from Terminal B (mobile phone) without waiting for the time for Terminal B (mobile phone) to upload files to the cloud service and the delayed upload time. .
  • this solution improves the synchronization speed of large file data and also improves the real-time performance of large file data synchronization.
  • WiFi P2P and low-power Bluetooth can be used to discover and connect the device. After the connection is successful, it will be in the same LAN for data transmission through the LAN.
  • Terminal A computer and terminal B (mobile phone) can establish a connection through a router or mobile hotspot, or directly establish a WiFi P2P connection to form the same LAN network.
  • Terminal A computer
  • Terminal B mobile phone
  • this solution directly downloads the corresponding file content (corresponding to the above synchronization data) through a LAN connection, which can greatly accelerate the data synchronization speed.
  • the execution subject may be a data synchronization device, or a control module in the data synchronization device for executing the data synchronization method.
  • the data synchronization device performing the data synchronization method is used as an example to illustrate the data synchronization device provided by the embodiment of the present application.
  • the data synchronization device provided by the embodiment of the present application is applied to the first electronic device, as shown in Figure 11, and includes:
  • the first sending module 111 is configured to send a data synchronization request to the second electronic device through the local area network when the first electronic device is connected to the second electronic device through the local area network;
  • the first receiving module 112 is used to receive synchronization data sent by the second electronic device through the local area network;
  • the data synchronization request carries a data identifier; the data identifier is obtained based on the data information of the synchronization data obtained from the cloud server.
  • a data synchronization request is sent to the second electronic device through the local area network;
  • the networking mode of the local area network includes at least one of the following: a first networking mode of connecting through network hotspot devices; a second networking mode of direct connection of devices.
  • the data synchronization device further includes: a second sending module, configured to When the first electronic device is not connected to the second electronic device through the local area network, it sends a data synchronization request to the cloud server; wherein the data synchronization request carries the data identifier; a second receiving module is used to receive the Synchronized data sent by the cloud server.
  • the data synchronization device further includes: a first processing module, configured to detect that the first electronic device communicates with the second electronic device through the local area network during the process of receiving the synchronization data sent by the cloud server. When the electronic device is connected, it pauses receiving the synchronization data and records the first breakpoint information of the synchronization data; a third sending module is configured to send a message to all parties through the local area network according to the first breakpoint information.
  • the second electronic device sends a data synchronization request; a third receiving module is configured to receive synchronization data starting from a first breakpoint sent by the second electronic device through the local area network; wherein, the first breakpoint corresponds to the first breakpoint information.
  • the data synchronization device also includes: a fourth sending module, used to send an information synchronization request to the cloud server before sending a data synchronization request to the second electronic device through the local area network; a fourth receiving module, Data information for receiving synchronization data sent by the cloud server; sending a data synchronization request to the second electronic device through the local area network includes: according to the data identifier in the data information, sending a data synchronization request to the second electronic device through the local area network through the local area network. The second electronic device sends a data synchronization request.
  • the data synchronization device further includes: a second processing module, configured to detect when the target connection is interrupted during the process of receiving the synchronization data sent by the second electronic device through the local area network. Record the second breakpoint information of the synchronization data; the fifth sending module is used to send a data synchronization request to the cloud server according to the second breakpoint information; the fifth receiving module is used to receive the data sent by the cloud server. , synchronization data starting from the second breakpoint; wherein the target connection is a local area network connection between the first electronic device and the second electronic device; the second breakpoint and the second Breakpoint information corresponds.
  • the data synchronization device in the embodiment of the present application may be a device, or may be a component, integrated circuit, or chip in the terminal.
  • the device may be a mobile electronic device or a non-mobile electronic device.
  • the mobile electronic device may be a mobile phone, a tablet computer, a notebook computer, a handheld computer, a vehicle-mounted electronic device, a wearable device, or an Ultra-Mobile Personal Computer. Computer, UMPC), netbook or personal digital assistant (personal digital assistant, PDA), etc.
  • Non-mobile electronic devices can be servers, network attached storage (Network Attached Storage, NAS), personal computers (Personal Computer, PC), televisions ( Television, TV), teller machines or self-service machines, etc., are not specifically limited in the embodiments of this application.
  • the data synchronization device in the embodiment of the present application may be a device with an operating system.
  • the operating system can be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiments of this application.
  • the data synchronization device provided by the embodiment of the present application can implement various processes implemented by the method embodiments in Figure 1 and Figures 3 to 10. To avoid repetition, details will not be described here.
  • An embodiment of the present application also provides a data synchronization device, applied to a second electronic device, as shown in Figure 12, including:
  • the sixth receiving module 121 is configured to receive a data synchronization request sent by the first electronic device through the local area network when the second electronic device is connected to the first electronic device through a local area network;
  • the first acquisition module 122 is used to acquire synchronization data according to the data identifier in the data synchronization request;
  • the sixth sending module 123 is used to send the synchronization data to the first electronic device through the local area network;
  • the data identification is obtained by the first electronic device based on the data information of the synchronization data obtained from the cloud server.
  • the data synchronization request sent by the first electronic device is received through the local area network; according to the data synchronization
  • the data identifier in the request is used to obtain the synchronization data; the synchronization data is sent to the first electronic device through the local area network; wherein the data identifier is the first electronic device according to the synchronization data obtained from the cloud server.
  • Data information is obtained; it is possible to use the local area network to transmit data, which can increase the data synchronization speed and solve the problem of slow synchronization speed of data synchronization solutions in the existing technology.
  • the networking mode of the local area network includes at least one of the following: a first networking mode of connecting through network hotspot devices; a second networking mode of direct connection of devices.
  • the data synchronization request also carries first breakpoint information; and obtaining synchronization data according to the data identifier in the data synchronization request includes: according to the data identifier in the data synchronization request and the first breakpoint information to obtain synchronization data starting from the first breakpoint; wherein the first breakpoint corresponds to the first breakpoint information; the first breakpoint information is the first breakpoint It is recorded when the electronic device detects that the first electronic device is connected to the second electronic device through the local area network during the process of receiving the synchronization data sent by the cloud server.
  • the data synchronization device further includes: a first upload module, configured to upload the synchronization data to the cloud server under the first condition before receiving the data synchronization request sent by the first electronic device.
  • the first condition includes at least one of the following: the remaining power is greater than the first threshold, or is in a charging state; connected to a wireless network; the device temperature is lower than the second threshold; and the required network bandwidth is lower than the third threshold.
  • the data synchronization device further includes: a second upload module, configured to upload the data information of the synchronization data to the cloud server before uploading the synchronization data to the cloud server.
  • the data synchronization device also includes: a third processing module, used to divide the data to be synchronized into text type data and file type data before uploading the data information of the synchronization data to the cloud server;
  • the data synchronization device further includes: a seventh receiving module, configured to receive the cloud server's data according to the data after uploading the text type data and the data information of the synchronization data to the cloud server.
  • the data identifier sent by the data information a fourth processing module, configured to associate the data identifier with the local storage path of the synchronization data and store it.
  • the data synchronization device in the embodiment of the present application may be a device, or a component in the terminal, Integrated circuit, or chip.
  • the device may be a mobile electronic device or a non-mobile electronic device.
  • mobile electronic devices may be mobile phones, tablet computers, notebook computers, PDAs, vehicle-mounted electronic devices, wearable devices, super mobile personal computers, netbooks, or personal digital assistants, etc.
  • non-mobile electronic devices may be servers, network attachments, etc.
  • Memory, personal computer, television, teller machine or self-service machine, etc. are not specifically limited in the embodiments of this application.
  • the data synchronization device in the embodiment of the present application may be a device with an operating system.
  • the operating system can be an Android operating system, an ios operating system, or other possible operating systems, which are not specifically limited in the embodiments of this application.
  • the data synchronization device provided by the embodiment of the present application can implement various processes implemented by the method embodiments of Figures 2 to 10. To avoid repetition, they will not be described again here.
  • this embodiment of the present application also provides an electronic device 130, including a processor 131, a memory 132, and programs or instructions stored on the memory 132 and executable on the processor 131.
  • an electronic device 130 including a processor 131, a memory 132, and programs or instructions stored on the memory 132 and executable on the processor 131.
  • the program or instruction is executed by the processor 131, each process of the above-mentioned first electronic device side or second electronic device side data synchronization method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, details will not be described here.
  • the electronic devices in the embodiments of the present application include the above-mentioned mobile electronic devices and non-mobile electronic devices.
  • Figure 14 is a schematic diagram of the hardware structure of an electronic device that implements an embodiment of the present application.
  • the electronic device 140 includes but is not limited to: radio frequency unit 141, network module 142, audio output unit 143, input unit 144, sensor 145, display unit 146, user input unit 147, interface unit 148, memory 149, processor 1410, etc. part.
  • the electronic device 140 may also include a power supply (such as a battery) that supplies power to various components.
  • the power supply may be logically connected to the processor 1410 through a power management system, thereby managing charging, discharging, and function through the power management system. Consumption management and other functions.
  • the structure of the electronic device shown in Figure 14 does not constitute a limitation of the electronic device.
  • the electronic device may include more or less components than shown in the figure, or combine certain components, or arrange different components, which will not be described again here. .
  • the processor 1410 is configured to connect the first electronic device to the second electronic device through a local area network.
  • the radio frequency unit 141 is used to send a data synchronization request to the second electronic device through the local area network; the radio frequency unit 141 is used to receive the synchronization data sent by the second electronic device through the local area network; wherein, the The data synchronization request carries a data identifier; the data identifier is obtained based on the data information of the synchronization data obtained from the cloud server.
  • a data synchronization request is sent to the second electronic device through the local area network;
  • the networking mode of the local area network includes at least one of the following: a first networking mode of connecting through network hotspot devices; a second networking mode of direct connection of devices.
  • the processor 1410 is also configured to send a data synchronization request to the cloud server through the radio frequency unit 141 when the first electronic device is not connected to the second electronic device through the local area network; wherein, the data synchronization The request carries the data identifier; the synchronization data sent by the cloud server is received through the radio frequency unit 141.
  • the processor 1410 is also configured to suspend receiving the synchronization data sent by the cloud server if it is detected that the first electronic device is connected to the second electronic device through the local area network. Synchronize data and record the first breakpoint information of the synchronized data; use the radio frequency unit 141 to send a data synchronization request to the second electronic device through the local area network according to the first breakpoint information; use the radio frequency unit 141 , receiving synchronization data starting from a first breakpoint sent by the second electronic device through the local area network; wherein the first breakpoint corresponds to the first breakpoint information.
  • the processor 1410 is also configured to send an information synchronization request to the cloud server through the radio frequency unit 141 before sending a data synchronization request to the second electronic device through the local area network; receive the information synchronization request sent by the cloud server through the radio frequency unit 141 data information of synchronized data; sending a data synchronization request to the second electronic device through the local area network includes: according to the data information in the The data identifier sends a data synchronization request to the second electronic device through the local area network.
  • the processor 1410 is also configured to record the second breakpoint information of the synchronization data when it detects that the target connection is interrupted during the process of receiving the synchronization data sent by the second electronic device through the local area network;
  • the radio frequency unit 141 is used to send a data synchronization request to the cloud server;
  • the radio frequency unit 141 is used to receive synchronization data starting from the second breakpoint sent by the cloud server;
  • the target connection is a local area network connection between the first electronic device and the second electronic device; the second breakpoint corresponds to the second breakpoint information.
  • This solution directly downloads the corresponding file content (corresponding to the above synchronization data) through LAN connection, which can greatly accelerate the data synchronization speed.
  • the input unit 144 may include a graphics processor (Graphics Processing Unit, GPU) 1441 and a microphone 1442.
  • the graphics processor 1441 is responsible for the image capture device (GPU) in the video capture mode or the image capture mode. Process the image data of still pictures or videos obtained by cameras (such as cameras).
  • the display unit 146 may include a display panel 1461, which may be configured in the form of a liquid crystal display, an organic light emitting diode, or the like.
  • the user input unit 147 includes a touch panel 1471 and other input devices 1472. Touch panel 1471 is also called a touch screen.
  • the touch panel 1471 may include two parts: a touch detection device and a touch controller.
  • Memory 149 may be used to store software programs as well as various data, including but not limited to application programs and operating systems.
  • the processor 1410 can integrate an application processor and a modem processor, where the application processor mainly processes operating systems, user interfaces, application programs, etc., and the modem processor mainly processes wireless communications. It can be understood that the above modem processor may not be integrated into the processor 1410.
  • Figure 15 is a schematic diagram of the hardware structure of an electronic device that implements an embodiment of the present application.
  • the electronic device 150 includes but is not limited to: radio frequency unit 151, network module 152, audio output unit 153, input unit 154, sensor 155, display unit 156, user input unit 157, interface unit 158, memory 159, processor 1510, etc. part.
  • the electronic device 150 may also include a power supply for supplying power to various components.
  • Power supply such as battery
  • the power supply can be logically connected to the processor 1510 through the power management system, so that functions such as charging, discharging, and power consumption management can be implemented through the power management system.
  • the structure of the electronic device shown in Figure 15 does not constitute a limitation of the electronic device.
  • the electronic device may include more or less components than shown in the figure, or combine certain components, or arrange different components, which will not be described again here. .
  • the processor 1510 is configured to receive the data synchronization request sent by the first electronic device through the radio frequency unit 151 through the local area network when the second electronic device is connected to the first electronic device through the local area network; according to The data identifier in the data synchronization request is used to obtain synchronization data; the radio frequency unit 151 is used to send the synchronization data to the first electronic device through the local area network; wherein the data identifier is the first electronic device Obtained based on the data information of synchronized data obtained from the cloud server.
  • the data synchronization request sent by the first electronic device is received through the local area network; according to the data synchronization
  • the data identifier in the request is used to obtain the synchronization data; the synchronization data is sent to the first electronic device through the local area network; wherein the data identifier is the first electronic device according to the synchronization data obtained from the cloud server.
  • Data information is obtained; it is possible to use the local area network to transmit data, which can increase the data synchronization speed and solve the problem of slow synchronization speed of data synchronization solutions in the existing technology.
  • the networking mode of the local area network includes at least one of the following: a first networking mode of connecting through network hotspot devices; a second networking mode of direct connection of devices.
  • the data synchronization request also carries first breakpoint information; and obtaining the synchronization data according to the data identifier in the data synchronization request includes: according to the data identifier in the data synchronization request and the first breakpoint information.
  • the cloud server In the process of receiving the synchronization data sent by the cloud server, it is recorded when it is detected that the first electronic device is connected to the second electronic device through the local area network.
  • the processor 1510 is also configured to upload the synchronization data to the cloud service through the radio frequency unit 151 under the first condition before receiving the data synchronization request sent by the first electronic device.
  • server wherein the first condition includes at least one of the following: the remaining power is greater than the first threshold, or is in a charging state; connected to a wireless network; the device temperature is lower than the second threshold; the required network bandwidth is lower than the third threshold .
  • the processor 1510 is also configured to upload the data information of the synchronization data to the cloud server through the radio frequency unit 151 before uploading the synchronization data to the cloud server.
  • the processor 1510 is also configured to divide the data to be synchronized into text type data and file type data before uploading the data information of the synchronized data to the cloud server; determine the synchronized data according to the file type data. and the data information of the synchronized data; the uploading the data information of the synchronized data to the cloud server includes: uploading the text type data and the data information of the synchronized data to the cloud server.
  • the processor 1510 is also configured to receive data sent by the cloud server according to the data information through the radio frequency unit 151 after uploading the data information of the text type data and the synchronization data to the cloud server. Identification; associate the data identification with the local storage path of the synchronization data and store it.
  • This solution directly downloads the corresponding file content (corresponding to the above synchronization data) through LAN connection, which can greatly accelerate the data synchronization speed.
  • the input unit 154 may include a graphics processor (Graphics Processing Unit, GPU) 1541 and a microphone 1542.
  • the graphics processor 1541 is responsible for the image capture device (GPU) in the video capture mode or the image capture mode. Process the image data of still pictures or videos obtained by cameras (such as cameras).
  • the display unit 156 may include a display panel 1561, which may be configured in the form of a liquid crystal display, an organic light emitting diode, or the like.
  • the user input unit 157 includes a touch panel 1571 and other input devices 1572 . Touch panel 1571 is also called a touch screen.
  • the touch panel 1571 may include two parts: a touch detection device and a touch controller.
  • Memory 159 may be used to store software programs as well as various data, including but not limited to application programs and operating systems.
  • the processor 1510 can integrate an application processor and a modem processor, where the application processor mainly processes the operating system, user User interface and applications, etc., the modem processor mainly handles wireless communications. It can be understood that the above modem processor may not be integrated into the processor 1510.
  • Embodiments of the present application also provide a readable storage medium, which stores a program or instructions.
  • the program or instructions are executed by a processor, the above-mentioned data synchronization on the first electronic device side or the second electronic device side is achieved.
  • Each process of the method embodiment can achieve the same technical effect, so to avoid repetition, it will not be described again here.
  • the processor is the processor in the electronic device described in the above embodiment.
  • the readable storage media includes computer-readable storage media, such as computer read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disks or optical disks, etc.
  • An embodiment of the present application further provides a chip.
  • the chip includes a processor and a communication interface.
  • the communication interface is coupled to the processor.
  • the processor is used to run programs or instructions to implement the above-mentioned first electronic device side or
  • Each process of the embodiment of the second electronic device side data synchronization method can achieve the same technical effect. To avoid duplication, it will not be described again here.
  • chips mentioned in the embodiments of this application may also be called system-on-chip, system-on-a-chip, system-on-a-chip or system-on-chip, etc.
  • the methods of the above embodiments can be implemented by means of software plus the necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases the former is better. implementation.
  • the technical solution of the present application can be embodied in the form of a computer software product that is essentially or contributes to the existing technology.
  • the computer software product is stored in a storage medium (such as ROM/RAM, disk , CD), including several instructions to cause a terminal (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in various embodiments of this application.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Telephonic Communication Services (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

本申请公开了一种数据同步方法、装置和电子设备,属于通信技术领域。其中,数据同步方法,包括:在所述第一电子设备通过局域网与第二电子设备连接的情况下,通过所述局域网,向第二电子设备发送数据同步请求;接收所述第二电子设备通过所述局域网发送的同步数据;其中,所述数据同步请求携带有数据标识;所述数据标识是根据从云服务器获取的同步数据的数据信息得到的。

Description

数据同步方法、装置和电子设备
相关申请的交叉引用
本申请主张在2022年7月19日在中国提交的中国专利申请No.202210849782.0的优先权,其全部内容通过引用包含于此。
技术领域
本申请属于通信技术领域,具体涉及一种数据同步方法、装置和电子设备。
背景技术
目前大多数云同步技术,都是以云服务器为中心,通过互联网向各终端同步数据。但是,使用互联网传输数据,在首次同步或有大量数据更新时,同步会非常缓慢,用户在终端需要等待很长时间才能查看和使用数据。
由上,现有技术中的数据同步方案存在同步速度慢等问题。
发明内容
本申请实施例的目的是提供一种数据同步方法、装置和电子设备,能够解决现有技术中的数据同步方案同步速度慢的问题。
第一方面,本申请实施例提供了一种数据同步方法,应用于第一电子设备,该方法包括:
在所述第一电子设备通过局域网与第二电子设备连接的情况下,通过所述局域网,向第二电子设备发送数据同步请求;
接收所述第二电子设备通过所述局域网发送的同步数据;
其中,所述数据同步请求携带有数据标识;所述数据标识是根据从云服务器获取的同步数据的数据信息得到的。
第二方面,本申请实施例提供了一种数据同步方法,应用于第二电子设备,该方法包括:
在所述第二电子设备通过局域网与第一电子设备连接的情况下,通过所述局域网,接收所述第一电子设备发送的数据同步请求;
根据所述数据同步请求中的数据标识,获取同步数据;
通过所述局域网,向所述第一电子设备发送所述同步数据;
其中,所述数据标识是所述第一电子设备根据从云服务器获取的同步数据的数据信息得到的。
第三方面,本申请实施例提供了一种数据同步装置,应用于第一电子设备,该装置包括:
第一发送模块,用于在所述第一电子设备通过局域网与第二电子设备连接的情况下,通过所述局域网,向第二电子设备发送数据同步请求;
第一接收模块,用于接收所述第二电子设备通过所述局域网发送的同步数据;
其中,所述数据同步请求携带有数据标识;所述数据标识是根据从云服务器获取的同步数据的数据信息得到的。
第四方面,本申请实施例提供了一种数据同步装置,应用于第二电子设备,该装置包括:
第六接收模块,用于在所述第二电子设备通过局域网与第一电子设备连接的情况下,通过所述局域网,接收所述第一电子设备发送的数据同步请求;
第一获取模块,用于根据所述数据同步请求中的数据标识,获取同步数据;
第六发送模块,用于通过所述局域网,向所述第一电子设备发送所述同步数据;
其中,所述数据标识是所述第一电子设备根据从云服务器获取的同步数据的数据信息得到的。
第五方面,本申请实施例提供了一种电子设备,该电子设备包括处理器、存储器及存储在所述存储器上并可在所述处理器上运行的程序或指令,所述程序或指令被所述处理器执行时实现如第一方面或第二方面所述的方法的步 骤。
第六方面,本申请实施例提供了一种可读存储介质,所述可读存储介质上存储程序或指令,所述程序或指令被处理器执行时实现如第一方面或第二方面所述的方法的步骤。
第七方面,本申请实施例提供了一种芯片,所述芯片包括处理器和通信接口,所述通信接口和所述处理器耦合,所述处理器用于运行程序或指令,实现如第一方面或第二方面所述的方法。
在本申请实施例中,所述数据同步方法中通过在所述第一电子设备通过局域网与第二电子设备连接的情况下,通过所述局域网,向第二电子设备发送数据同步请求;接收所述第二电子设备通过所述局域网发送的同步数据;其中,所述数据同步请求携带有数据标识;所述数据标识是根据从云服务器获取的同步数据的数据信息得到的;能够实现使用局域网传输数据,可增加数据同步速度,解决现有技术中的数据同步方案同步速度慢的问题。
附图说明
图1是本申请实施例的数据同步方法流程示意图一;
图2是本申请实施例的数据同步方法流程示意图二;
图3是本申请实施例的第一组网方式示意图;
图4是本申请实施例的设备列表示意图一;
图5是本申请实施例的数据同步方法具体实现流程示意图一;
图6是本申请实施例的数据信息示意图一;
图7是本申请实施例的第二组网方式示意图;
图8是本申请实施例的设备列表示意图二;
图9是本申请实施例的数据同步方法具体实现流程示意图二;
图10是本申请实施例的数据信息示意图二;
图11是本申请实施例的数据同步装置结构示意图一;
图12是本申请实施例的数据同步装置结构示意图二;
图13是本申请实施例的电子设备结构示意图一;
图14是本申请实施例的电子设备结构示意图二;
图15是本申请实施例的电子设备结构示意图三。
具体实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员获得的所有其他实施例,都属于本申请保护的范围。
本申请的说明书和权利要求书中的术语“第一”、“第二”等是用于区别类似的对象,而不用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便本申请的实施例能够以除了在这里图示或描述的那些以外的顺序实施,且“第一”、“第二”等所区分的对象通常为一类,并不限定对象的个数,例如第一对象可以是一个,也可以是多个。此外,说明书以及权利要求中“和/或”表示所连接对象的至少其中之一,字符“/”,一般表示前后关联对象是一种“或”的关系。
下面结合附图,通过具体的实施例及其应用场景对本申请实施例提供的数据同步方法进行详细地说明。
本申请实施例提供的数据同步方法,应用于第一电子设备,如图1所示,包括:
步骤11:在所述第一电子设备通过局域网与第二电子设备连接的情况下,通过所述局域网,向第二电子设备发送数据同步请求。
其中,所述局域网的组网方式包括以下至少一项:通过网络热点设备连接的第一组网方式;设备直连的第二组网方式。在所述第一组网方式下,所述第一电子设备和第二电子设备分别与所述网络热点设备连接;在所述第二组网方式下,所述第一电子设备和第二电子设备直接连接。
关于“网络热点设备”,可为:路由器、移动热点设备等,在此不作限定。
其中,数据同步请求中还可以携带有其他信息,比如断点信息等,在此不作限定。
进一步的,在步骤12之前,还可包括:确定所述第一电子设备是否通过局域网与第二电子设备进行连接;这样以明确是否使用局域网进行数据传输。
步骤12:接收所述第二电子设备通过所述局域网发送的同步数据;其中,所述数据同步请求携带有数据标识;所述数据标识是根据从云服务器获取的同步数据的数据信息得到的。
其中,数据标识可为全局唯一标识符(Globally Unique Identifier,GUID),但并不以此为限。同步数据可为文件类型数据中的数据本体,而不是文件概要信息,比如文件名称、文件大小、文件类型、缩略图等,在此不作限定。
在本申请实施例中,通过在所述第一电子设备通过局域网与第二电子设备连接的情况下,通过所述局域网,向第二电子设备发送数据同步请求;接收所述第二电子设备通过所述局域网发送的同步数据;其中,所述数据同步请求携带有数据标识;所述数据标识是根据从云服务器获取的同步数据的数据信息得到的;能够实现使用局域网传输数据,可增加数据同步速度,解决现有技术中的数据同步方案同步速度慢的问题。
进一步的,所述的数据同步方法,还包括:在所述第一电子设备未通过局域网与第二电子设备进行连接的情况下,向云服务器发送数据同步请求;其中,所述数据同步请求携带有所述数据标识;接收所述云服务器发送的同步数据。
这样在无法通过局域网进行数据传输的情况下,也可以保证数据的正常同步。
本申请实施例中,所述的数据同步方法,还包括:在接收所述云服务器发送的同步数据的过程中,检测到所述第一电子设备通过局域网与第二电子设备进行连接的情况下,暂停接收所述同步数据,并记录所述同步数据的第一断点信息;根据所述第一断点信息,通过所述局域网向所述第二电子设备发送数据同步请求;接收所述第二电子设备通过所述局域网发送的、从第一 断点处开始的同步数据;其中,所述第一断点处与所述第一断点信息对应。
这样可以保证尽量使用局域网进行数据传输,以便提升数据同步速度。
进一步的,在通过所述局域网,向第二电子设备发送数据同步请求之前,还包括:向云服务器发送信息同步请求;接收所述云服务器发送的同步数据的数据信息;所述通过所述局域网,向第二电子设备发送数据同步请求,包括:根据所述数据信息中的数据标识,通过所述局域网,向第二电子设备发送数据同步请求。
这样可以确定数据同步请求进行发送以便获取准确的同步数据。
本申请实施例中,所述的数据同步方法,还包括:在接收所述第二电子设备通过所述局域网发送的同步数据的过程中,检测到目标连接中断时,记录所述同步数据的第二断点信息;根据所述第二断点信息,向云服务器发送数据同步请求;接收所述云服务器发送的、从第二断点处开始的同步数据;其中,所述目标连接为所述第一电子设备与所述第二电子设备之间的局域网连接;所述第二断点处与所述第二断点信息对应。
这样可以保证在无法通过局域网继续进行数据传输的情况下,保证数据的正常同步。
本申请实施例还提供了一种数据同步方法,应用于第二电子设备,如图2所示,包括:
步骤21:在所述第二电子设备通过局域网与第一电子设备连接的情况下,通过所述局域网,接收所述第一电子设备发送的数据同步请求。
其中,所述局域网的组网方式包括以下至少一项:通过网络热点设备连接的第一组网方式;设备直连的第二组网方式。在所述第一组网方式下,所述第一电子设备和第二电子设备分别与所述网络热点设备连接;在所述第二组网方式下,所述第一电子设备和第二电子设备直接连接。
关于“网络热点设备”,可为:路由器、移动热点设备等,在此不作限定。
步骤22:根据所述数据同步请求中的数据标识,获取同步数据。
其中,数据同步请求中还可以携带有其他信息,比如断点信息等,在此 不作限定。数据标识可为全局唯一标识符GUID,但并不以此为限。
步骤23:通过所述局域网,向所述第一电子设备发送所述同步数据;其中,所述数据标识是所述第一电子设备根据从云服务器获取的同步数据的数据信息得到的。
其中,同步数据可为文件类型数据中的数据本体,而不是文件概要信息,比如文件名称、文件大小、文件类型、缩略图等,在此不作限定。
在本申请实施例中,通过在所述第二电子设备通过局域网与第一电子设备连接的情况下,通过所述局域网,接收所述第一电子设备发送的数据同步请求;根据所述数据同步请求中的数据标识,获取同步数据;通过所述局域网,向所述第一电子设备发送所述同步数据;其中,所述数据标识是所述第一电子设备根据从云服务器获取的同步数据的数据信息得到的;能够实现使用局域网传输数据,可增加数据同步速度,解决现有技术中的数据同步方案同步速度慢的问题。
进一步的,所述数据同步请求中还携带有第一断点信息;所述根据所述数据同步请求中的数据标识,获取同步数据,包括:根据所述数据同步请求中的数据标识和第一断点信息,获取从第一断点处开始的同步数据;其中,所述第一断点处与所述第一断点信息对应;所述第一断点信息为所述第一电子设备在接收云服务器发送的同步数据的过程中,检测到所述第一电子设备通过局域网与所述第二电子设备进行连接的情况下记录的。
这样可以保证尽量使用局域网进行数据传输,以便提升数据同步速度。
本申请实施例中,在接收所述第一电子设备发送的数据同步请求之前,还包括:在第一条件下,将所述同步数据上传至云服务器;其中,所述第一条件包括以下至少一项:剩余电量大于第一阈值,或处于充电状态;连接于无线网络;设备温度低于第二阈值;所需网络带宽低于第三阈值。
这样可在满足电量、功耗、数据网络流量、和/或用户使用场景后,再延迟上传同步数据,达到省电、温度控制的效果。关于第一条件所包含的选项,可以是当前需满足的条件选项,也可以是某一指定时刻需满足的条件选项, 比如:在当前时刻之前的某一时刻,或者,在当前时刻之后的某一时刻,在此不作限定。
进一步的,在将所述同步数据上传至云服务器之前,还包括:将所述同步数据的数据信息上传至云服务器。
这样可以便于第一电子设备从云服务器下载所述同步数据的数据信息,进而进行相关显示,以便用户查看。
本申请实施例中,在将所述同步数据的数据信息上传至云服务器之前,还包括:将待同步数据划分为文本类型数据和文件类型数据;根据所述文件类型数据,确定同步数据以及所述同步数据的数据信息;所述将所述同步数据的数据信息上传至云服务器,包括:将所述文本类型数据和所述同步数据的数据信息上传至云服务器。
这样可以在一定程度上保证实现云同步。
进一步的,在将所述文本类型数据和所述同步数据的数据信息上传至云服务器之后,还包括:接收所述云服务器根据所述数据信息发送的数据标识;将所述数据标识与所述同步数据的本地存储路径进行关联,并存储。存储的可以是所述数据标识与所述本地存储路径之间的关联关系,但并不以此为限。
这样便于后续根据第一电子设备的数据同步请求(携带数据标识)准确获取同步数据进行反馈。
下面对本申请实施例提供的所述数据同步方法进行举例说明,第一电子设备以终端A为例,第二电子设备以终端B为例,网络热点设备以路由器为例,第二组网方式以无线网络直连(Wireless Fidelity Peer-to-Peer,WiFi P2P)为例。
针对上述技术问题,本申请实施例提供了一种数据同步方法,具体可实现为一种利用局域网加速数据同步的方法,其中涉及:使用中心化的云服务,终端A(如电脑)通过互联网来同步用户的文件目录及基础信息(对应于上述数据信息,数据量小),再根据文件的基础信息,通过局域网连接,去目标终端(即终端B,如手机)直接下载对应的文件内容(对应于上述同步数据), 可极大地加速数据的同步速度。
此外,本申请中,对于不同的组网方式(局域网的组网方式包括:上述第一组网方式和第二组网方式),可提供不同的组网方案。具体的,可包括:通过路由器连接的组网方式(对应于上述第一组网方式),与通过WiFi P2P(无线网络直连)点对点的组网方式(对应于上述第二组网方式),适配不同的用户使用场景。
下面对本申请实施例提供的方案进行具体举例说明。
举例一(对应于上述第一组网方式):
假设终端A(电脑)与终端B(手机)均已登录同一个数据账号(用于同步的数据账号),且如图3所示,均已连接同一个路由器或热点,且该路由器或热点已接入互联网。存在云服务器,为多个设备终端提供中心化的同步服务。
基于以上,整体方案主要分为三个部分:部分1,建立局域网连接(通过路由器连接);部分2,终端B(手机)上传数据;部分3,终端A(电脑)下载数据。
部分1主要涉及以下内容:
判断终端A(电脑)与终端B(手机)之间是否首次建立局域网连接,若是,进入以下操作1,若否,进入以下操作2;
操作1.终端A(电脑)与终端B(手机)之间首次建立局域网连接。
本方案中,可使用简单服务发现协议(Simple Service Discovery Protocol,SSDP)局域网发现方式建立连接。终端A与终端B可向局域网中的组播地址不断发送用户数据报协议(User Datagram Protocol,UDP)组播报文(以便及时检测),报文中可带有自身设备的设备信息(可用于设备列表显示)、账号信息(上述数据账号的信息,可用于确认是否登录同一账号)、IP地址(可用于后续终端A与B连接)等。对方终端接收到报文后,把局域网中发现的设备显示到可连接的设备列表中,如图4所示。设备列表中会过滤出登录同一个账号的设备。用户点击设备列表中的设备,即可与该设备建立局域网连 接。
首次建立局域网连接成功后,可在数据库中记录最后一次成功连接的设备ID。
操作2.终端A(电脑)与终端B(手机)之间非首次建立局域网连接。
如果首次连接时勾选了“后续自动连接”,则当终端A(电脑)与终端B(手机)接入同一个路由器后,可按照本部分操作1中的方式进行局域网发现。终端A发现设备列表后,设备列表展示之前,可从数据库中获取最后一次连接成功的对方设备标识符(Identifier,ID),并从设备列表中查询该ID。若设备列表中存在该设备ID,则直接连接成功。否则,显示设备列表。
部分2主要涉及以下内容:
操作1.终端B(手机)触发同步,上传数据信息(对应于上述文本类型数据),并进行文件预上传(对应于上述数据信息)。
具体的,终端B(手机)在用户进行便签编辑、拍照、编辑文档、接收图片和/或视频等行为后,产生用户数据。用户数据分两种:
(1)文本类型数据:数据量小,传输快。如笔记、日程、联系人、相册目录结构等。
(2)文件类型数据:数据量大,传输慢。如照片、视频等文件类型。
如图5所示,每次数据产生后,会触发一次数据同步(包括将数据分为上述两种,进行上传)。此时判断本终端(即终端B)是否已经接入互联网,若已经接入互联网,向服务端(对应于上述云服务器)上传文本类型数据;上传完文本类型(数据)后,需要对每个文件类型数据的文件做预上传,预上传的作用是提前上传文件的少量概要信息(对应于上述数据信息),使得其他终端可以在文件具体内容没有上传或下载的情况下,在界面显示出文件的图标及基本信息(如文件大小,文件名称,最后修改时间等)。预上传内容可包括文件名称、文件大小、文件类型、缩略图等文件概要信息(对应于上述数据信息),但不包含具体的文件内容。对应于上述将待同步数据划分为文本类型数据和文件类型数据;根据所述文件类型数据,确定同步数据以及所述 同步数据的数据信息;将所述文本类型数据和所述同步数据的数据信息上传至云服务器。
服务端在文件预上传时解析文件概要信息,为每个文件生成一个GUID(全局唯一标识符,对应于上述数据标识),并返回给客户端终端B(手机)。GUID是每个文件在云服务器的唯一标识符,通过GUID,可以定位到是某个用户(账号)下的某个文件,用于将文件预上传的概要信息与文件本体的绑定,以及文件的定位。
终端B(手机)接收到服务端生成的GUID后,将GUID与本地文件路径(对应于上述本地存储路径)进行关联,并记录到数据库(终端B的本地)中。到此,文件预上传完成。对应于上述接收所述云服务器根据所述数据信息发送的数据标识;将所述数据标识与所述同步数据的本地存储路径进行关联,并存储。
操作2.终端B(手机)判断本地环境条件(对应于上述第一条件),在合适的时间通过互联网往云服务器上传文件(对应于上述同步数据);
具体比如:终端B(手机)会定时检测是否满足以下条件:
(1)手机电量大于一定阈值(如电量大于20%),或处于充电中;对应于上述剩余电量大于第一阈值,或处于充电状态;
(2)此时正在wifi网络环境下,而不是数据网络;对应于上述连接于无线网络;
(3)此时手机的温度低于一定阈值(如温度小于45摄氏度);对应于上述设备温度低于第二阈值;
(4)此时不处于游戏场景或其他网络带宽要求比较高的场景;对应于上述所需网络带宽低于第三阈值。
满足以上至少一个条件后,终端B(手机)开始向服务器上传具体文件内容(对应于上述同步数据),同时带上该文件的GUID,文件的GUID在本部分操作1预上传过程中由云服务器分配。
若此时条件不满足,则进入等待,下一次定时器触发再次检测上述条件。
部分3主要涉及以下内容:
操作1.通过互联网向云服务器下载数据。
终端A(电脑)定时通过互联网,定时向云服务器发送请求,检测数据更新。若存在云端数据更新,则下载新数据。具体比如:终端A向云服务器发送检测请求,云服务器确定有更新的情况下向终端A反馈检测响应,终端A据此向云服务器发送更新请求,云服务器根据更新请求向终端A发送数据;包括上述向云服务器发送信息同步请求(携带有数据标识);接收所述云服务器发送的同步数据的数据信息。
关于“下载新数据”可以包括以下几项:
(1)下载文本类型数据。
(2)下载文件信息(即上述文件概要信息),根据文件信息显示文件图标,如图6所示。
其中,文件信息可包含文件大小、最后修改日期、文件名称、文件类型、缩略图,此时,终端A(电脑)界面可根据文件信息显示文件图标。
操作2.终端A(电脑)根据文件信息中的GUID,下载文件具体内容,如图6所示。这个可以由用户触发,或者自动执行,在此不作限定。
此时下载文件(具体内容)之前,可判断是否与终端B(手机)进行了局域网连接(对应于上述确定所述第一电子设备是否通过局域网与第二电子设备进行连接),若未建立局域网连接,可返回部分1的操作2,尝试自动连接。局域网连接具体为通过上述路由器建立的连接。
(1)若已接入局域网,则自动通过局域网下载文件,向终端B(手机)发送文件GUID,请求下载文件。对应于上述在所述第一电子设备通过局域网与第二电子设备进行连接的情况下,通过所述局域网,向所述第二电子设备发送数据同步请求;接收所述第二电子设备通过所述局域网发送的同步数据。
(2)若未接入局域网,则通过互联网,向云服务器发送文件GUID,请求下载文件。对应于上述在所述第一电子设备未通过局域网与第二电子设备 进行连接的情况下,向云服务器发送数据同步请求(携带有数据标识);接收所述云服务器发送的同步数据。
操作3.若文件(具体内容)下载过程中,发现网络切换,如以下场景:
局域网下载文件过程中,手机在局域网中断开连接,则记录断点位置(对应于上述第二断点信息),切换到互联网云服务尝试从断点继续下载。对应于上述在接收所述第二电子设备通过所述局域网发送的同步数据的过程中,检测到目标连接中断时,记录所述同步数据的第二断点信息;根据所述第二断点信息,向云服务器发送数据同步请求(携带有数据标识);接收所述云服务器发送的、从第二断点处开始的同步数据。
若通过互联网下载文件过程中,手机接入局域网,经过部分1的操作2自动发现连接上之后,暂停互联网下载,并记录断点(对应于上述第一断点信息)。切换到局域网从断点处继续下载,加快下载速度。对应于上述在接收所述云服务器发送的同步数据的过程中,检测到所述第一电子设备通过局域网与第二电子设备进行连接的情况下,暂停接收所述同步数据,并记录所述同步数据的第一断点信息;根据所述第一断点信息,通过所述局域网向所述第二电子设备发送数据同步请求(携带有数据标识);接收所述第二电子设备通过所述局域网发送的、从第一断点处开始的同步数据。
操作4.文件下载过程中,用户打开文件,提示用户需要等待下载完成才能打开。
在此说明,以上内容并不限定按照上述顺序执行,在此不作限定。
由上,本举例提供的方案存在如下效果:
1、大文件(即文件类型数据)的具体内容通过局域网传输,相比使用互联网传输有更稳定、传输速度更快的优势。
2、终端B(手机)可延后上传具体的文件内容,可在满足电量、功耗、数据网络流量、用户使用场景后,再延迟上传;达到省电、温度控制的效果。
3、若满足局域网条件(即通过局域网连接),终端A(电脑)可立即从终端B(手机)下载文件,不需要等待终端B(手机)向云服务上传文件的 时间与延后上传的时间。
4、使用局域网传输的情况下,本方案提升了大文件数据的同步速度,也提升了大文件数据同步的实时性。
举例二(对应于上述第二组网方式):
假设终端A(电脑)与终端B(手机)均已登录同一个数据账号(用于同步的数据账号),且如图7所示,已接入互联网;两端(终端A和B)均有蓝牙模块与无线网卡,支持WiFi P2P连接。存在云服务器,为多个设备终端提供中心化的同步服务。
基于以上,整体方案主要分为三个部分:部分1,建立局域网连接(设备组网,WiFi P2P连接);部分2,终端B(手机)上传数据;部分3,终端A(电脑)下载数据。
部分1主要涉及以下内容:
判断终端A(电脑)与终端B(手机)之间是否首次建立局域网连接,若是,进入以下操作1,若否,进入以下操作2;
操作1.终端A(电脑)与终端B(手机)之间首次建立连接。
本方案中,终端B(手机)可通过低功耗蓝牙(Bluetooth Low Energy,BLE)对外发送广播,广播内容带有自身设备的设备信息、账号信息(上述数据账号的信息,可用于确认是否登录同一账号)等。终端A(电脑)通过BLE扫描附近ble广播后,判断对方账号信息是否与本机是同一账号,若是,则将终端B(手机)显示到设备列表中,可参见图8。用户点击设备列表中的设备,即可与该设备建立点对点的WiFi P2P连接。
首次建立WiFi P2P连接成功后,可在数据库中记录最后一次成功连接的设备ID。
操作2.终端A(电脑)与终端B(手机)之间非首次建立连接。
如果首次连接时勾选了“后续自动连接”,则当终端A(电脑)与终端B(手机)靠近到蓝牙发现范围内,按照本部分操作1中的方式进行蓝牙搜索发现。终端A发现设备列表后,设备列表展示之前,可从数据库中获取最后 一次连接成功的对方设备ID,并从设备列表中查询该ID。若设备列表中存在该设备ID,则自动进行WiFi P2P连接(直接连接成功)。否则,显示设备列表。
部分2主要涉及以下内容:
操作1.终端B(手机)触发同步,上传数据信息(对应于上述文本类型数据),并进行文件预上传(对应于上述数据信息)。
具体的,终端B(手机)在用户进行便签编辑、拍照、编辑文档、接收图片和/或视频等行为后,产生用户数据。用户数据分两种:
(1)文本类型数据:数据量小,传输快。如笔记、日程、联系人、相册目录结构等。
(2)文件类型数据:数据量大,传输慢。如照片、视频等文件类型。
如图9所示,每次数据产生后,会触发一次数据同步(包括将数据分为上述两种,进行上传)。此时判断本终端(即终端B)是否已经接入互联网,若已经接入互联网,向服务端(对应于上述云服务器)上传文本类型数据;上传完文本类型(数据)后,需要对每个文件类型数据的文件做预上传,预上传的作用是提前上传文件的少量概要信息(对应于上述数据信息),使得其他终端可以在文件具体内容没有上传或下载的情况下,在界面显示出文件的图标及基本信息(如文件大小,文件名称,最后修改时间等)。预上传内容可包括文件名称、文件大小、文件类型、缩略图等文件概要信息(对应于上述数据信息),但不包含具体的文件内容。对应于上述将待同步数据划分为文本类型数据和文件类型数据;根据所述文件类型数据,确定同步数据以及所述同步数据的数据信息;将所述文本类型数据和所述同步数据的数据信息上传至云服务器。
服务端在文件预上传时解析文件概要信息,为每个文件生成一个GUID(全局唯一标识符,对应于上述数据标识),并返回给客户端终端B(手机)。GUID是每个文件在云服务器的唯一标识符,通过GUID,可以定位到是某个用户(账号)下的某个文件,用于将文件预上传的概要信息与文件本体的绑 定,以及文件的定位。
终端B(手机)接收到服务端生成的GUID后,将GUID与本地文件路径(对应于上述本地存储路径)进行关联,并记录到数据库(终端B的本地)中。到此,文件预上传完成。对应于上述接收所述云服务器根据所述数据信息发送的数据标识;将所述数据标识与所述同步数据的本地存储路径进行关联,并存储。操作2.终端B(手机)判断本地环境条件(对应于上述第一条件),在合适的时间通过互联网往云服务器上传文件(对应于上述同步数据);
具体比如:终端B(手机)会定时检测是否满足以下条件:
(1)手机电量大于一定阈值(如电量大于20%),或处于充电中;对应于上述剩余电量大于第一阈值,或处于充电状态;
(2)此时正在wifi网络环境下,而不是数据网络;对应于上述连接于无线网络;
(3)此时手机的温度低于一定阈值(如温度小于45摄氏度);对应于上述设备温度低于第二阈值;
(4)此时不处于游戏场景或其他网络带宽要求比较高的场景;对应于上述所需网络带宽低于第三阈值。
满足以上至少一个条件后,终端B(手机)开始向服务器上传具体文件内容(对应于上述同步数据),同时带上该文件的GUID,文件的GUID在本部分操作1预上传过程中由云服务器分配。
若此时条件不满足,则进入等待,下一次定时器触发再次检测上述条件。
部分3主要涉及以下内容:
操作1.通过互联网向云服务器下载数据。
终端A(电脑)定时通过互联网,定时向云服务器发送请求,检测数据更新。若存在云端数据更新,则下载新数据。具体比如:终端A向云服务器发送检测请求,云服务器确定有更新的情况下向终端A反馈检测响应,终端A据此向云服务器发送更新请求,云服务器根据更新请求向终端A发送数据;包括上述向云服务器发送信息同步请求(携带有数据标识);接收所述云服务 器发送的同步数据的数据信息。
关于“下载新数据”可以包括以下几项:
(1)下载文本类型数据。
(2)下载文件信息(即上述文件概要信息),根据文件信息显示文件图标,如图10所示。
其中,文件信息可包含文件大小、最后修改日期、文件名称、文件类型、缩略图,此时,终端A(电脑)界面可根据文件信息显示文件图标。
操作2.终端A(电脑)根据文件信息中的GUID,下载文件具体内容,如图10所示。这个可以由用户触发,或者自动执行,在此不作限定。
此时下载文件(具体内容)之前,可判断是否与终端B(手机)进行了局域网连接(对应于上述确定所述第一电子设备是否通过局域网与第二电子设备进行连接),若未建立局域网连接,可返回部分1的操作2,尝试自动连接。局域网连接具体为上述WiFi P2P连接。
(1)若已接入局域网,则自动通过局域网下载文件,向终端B(手机)发送文件GUID,请求下载文件。对应于上述在所述第一电子设备通过局域网与第二电子设备进行连接的情况下,通过所述局域网,向所述第二电子设备发送数据同步请求;接收所述第二电子设备通过所述局域网发送的同步数据。
(2)若未接入局域网,则通过互联网,向云服务器发送文件GUID,请求下载文件。对应于上述在所述第一电子设备未通过局域网与第二电子设备进行连接的情况下,向云服务器发送数据同步请求(携带有数据标识);接收所述云服务器发送的同步数据。
操作3.若文件(具体内容)下载过程中,发现网络切换,如以下场景:
局域网下载文件过程中,手机在局域网中断开连接,则记录断点位置(对应于上述第二断点信息),切换到互联网云服务尝试从断点继续下载。对应于上述在接收所述第二电子设备通过所述局域网发送的同步数据的过程中,检测到目标连接中断时,记录所述同步数据的第二断点信息;根据所述第二断 点信息,向云服务器发送数据同步请求(携带有数据标识);接收所述云服务器发送的、从第二断点处开始的同步数据。
若通过互联网下载文件过程中,手机接入局域网,经过部分1的操作2自动发现连接上之后,暂停互联网下载,并记录断点(对应于上述第一断点信息)。切换到局域网从断点处继续下载,加快下载速度。对应于上述在接收所述云服务器发送的同步数据的过程中,检测到所述第一电子设备通过局域网与第二电子设备进行连接的情况下,暂停接收所述同步数据,并记录所述同步数据的第一断点信息;根据所述第一断点信息,通过所述局域网向所述第二电子设备发送数据同步请求(携带有数据标识);接收所述第二电子设备通过所述局域网发送的、从第一断点处开始的同步数据。
操作4.文件下载过程中,用户打开文件,提示用户需要等待下载完成才能打开。
在此说明,以上内容并不限定按照上述顺序执行,在此不作限定。
由上,本举例提供的方案存在如下效果:
1、大文件(即文件类型数据)的具体内容通过局域网传输,相比使用互联网传输有更稳定、传输速度更快的优势。
2、终端B(手机)可延后上传具体的文件内容,可在满足电量、功耗、数据网络流量、用户使用场景后,再延迟上传;达到省电、温度控制的效果。
3、若满足局域网条件(即通过局域网连接),终端A(电脑)可立即从终端B(手机)下载文件,不需要等待终端B(手机)向云服务上传文件的时间与延后上传的时间。
4、使用局域网传输的情况下,本方案提升了大文件数据的同步速度,也提升了大文件数据同步的实时性。
5、当用户的终端不在同一个路由器或局域网环境下时,可以使用WiFi P2P与低功耗蓝牙进行设备发现与连接,连接成功后,即处于同一个局域网,以通过局域网进行数据传输。
在此说明,本方案中:
1、终端A(电脑)与终端B(手机)可通过路由器或移动热点建立连接、或直接建立WiFi P2P连接,从而组成同一个局域网网络。
2、终端A(电脑)与终端B(手机)用户首次通过局域网连接并授权后,后续只要两台设备处于同一个局域网内,均可自动连接且自动同步。
综上,本方案通过局域网连接,直接下载对应的文件内容(对应于上述同步数据),可极大地加速数据的同步速度。
需要说明的是,本申请实施例提供的数据同步方法,执行主体可以为数据同步装置,或者该数据同步装置中的用于执行数据同步方法的控制模块。本申请实施例中以数据同步装置执行数据同步方法为例,说明本申请实施例提供的数据同步装置。
本申请实施例提供的数据同步装置,应用于第一电子设备,如图11所示,包括:
第一发送模块111,用于在所述第一电子设备通过局域网与第二电子设备连接的情况下,通过所述局域网,向第二电子设备发送数据同步请求;
第一接收模块112,用于接收所述第二电子设备通过所述局域网发送的同步数据;
其中,所述数据同步请求携带有数据标识;所述数据标识是根据从云服务器获取的同步数据的数据信息得到的。
在本申请实施例中,通过在所述第一电子设备通过局域网与第二电子设备连接的情况下,通过所述局域网,向第二电子设备发送数据同步请求;接收所述第二电子设备通过所述局域网发送的同步数据;其中,所述数据同步请求携带有数据标识;所述数据标识是根据从云服务器获取的同步数据的数据信息得到的;能够实现使用局域网传输数据,可增加数据同步速度,解决现有技术中的数据同步方案同步速度慢的问题。
其中,所述局域网的组网方式包括以下至少一项:通过网络热点设备连接的第一组网方式;设备直连的第二组网方式。
进一步的,所述的数据同步装置,还包括:第二发送模块,用于在所述 第一电子设备未通过局域网与第二电子设备进行连接的情况下,向云服务器发送数据同步请求;其中,所述数据同步请求携带有所述数据标识;第二接收模块,用于接收所述云服务器发送的同步数据。
本申请实施例中,所述的数据同步装置,还包括:第一处理模块,用于在接收所述云服务器发送的同步数据的过程中,检测到所述第一电子设备通过局域网与第二电子设备进行连接的情况下,暂停接收所述同步数据,并记录所述同步数据的第一断点信息;第三发送模块,用于根据所述第一断点信息,通过所述局域网向所述第二电子设备发送数据同步请求;第三接收模块,用于接收所述第二电子设备通过所述局域网发送的、从第一断点处开始的同步数据;其中,所述第一断点处与所述第一断点信息对应。
进一步的,所述的数据同步装置,还包括:第四发送模块,用于在通过所述局域网,向第二电子设备发送数据同步请求之前,向云服务器发送信息同步请求;第四接收模块,用于接收所述云服务器发送的同步数据的数据信息;所述通过所述局域网,向第二电子设备发送数据同步请求,包括:根据所述数据信息中的数据标识,通过所述局域网,向第二电子设备发送数据同步请求。
本申请实施例中,所述的数据同步装置,还包括:第二处理模块,用于在接收所述第二电子设备通过所述局域网发送的同步数据的过程中,检测到目标连接中断时,记录所述同步数据的第二断点信息;第五发送模块,用于根据所述第二断点信息,向云服务器发送数据同步请求;第五接收模块,用于接收所述云服务器发送的、从第二断点处开始的同步数据;其中,所述目标连接为所述第一电子设备与所述第二电子设备之间的局域网连接;所述第二断点处与所述第二断点信息对应。
本申请实施例中的数据同步装置可以是装置,也可以是终端中的部件、集成电路、或芯片。该装置可以是移动电子设备,也可以为非移动电子设备。示例性的,移动电子设备可以为手机、平板电脑、笔记本电脑、掌上电脑、车载电子设备、可穿戴设备、超级移动个人计算机(Ultra-Mobile Personal  Computer,UMPC)、上网本或者个人数字助理(personal digital assistant,PDA)等,非移动电子设备可以为服务器、网络附属存储器(Network Attached Storage,NAS)、个人计算机(Personal Computer,PC)、电视机(Television,TV)、柜员机或者自助机等,本申请实施例不作具体限定。
本申请实施例中的数据同步装置可以为具有操作系统的装置。该操作系统可以为安卓(Android)操作系统,可以为iOS操作系统,还可以为其他可能的操作系统,本申请实施例不作具体限定。
本申请实施例提供的数据同步装置能够实现图1以及图3至图10的方法实施例实现的各个过程,为避免重复,这里不再赘述。
本申请实施例还提供了一种数据同步装置,应用于第二电子设备,如图12所示,包括:
第六接收模块121,用于在所述第二电子设备通过局域网与第一电子设备连接的情况下,通过所述局域网,接收所述第一电子设备发送的数据同步请求;
第一获取模块122,用于根据所述数据同步请求中的数据标识,获取同步数据;
第六发送模块123,用于通过所述局域网,向所述第一电子设备发送所述同步数据;
其中,所述数据标识是所述第一电子设备根据从云服务器获取的同步数据的数据信息得到的。
在本申请实施例中,通过在所述第二电子设备通过局域网与第一电子设备连接的情况下,通过所述局域网,接收所述第一电子设备发送的数据同步请求;根据所述数据同步请求中的数据标识,获取同步数据;通过所述局域网,向所述第一电子设备发送所述同步数据;其中,所述数据标识是所述第一电子设备根据从云服务器获取的同步数据的数据信息得到的;能够实现使用局域网传输数据,可增加数据同步速度,解决现有技术中的数据同步方案同步速度慢的问题。
其中,所述局域网的组网方式包括以下至少一项:通过网络热点设备连接的第一组网方式;设备直连的第二组网方式。
本申请实施例中,所述数据同步请求中还携带有第一断点信息;所述根据所述数据同步请求中的数据标识,获取同步数据,包括:根据所述数据同步请求中的数据标识和第一断点信息,获取从第一断点处开始的同步数据;其中,所述第一断点处与所述第一断点信息对应;所述第一断点信息为所述第一电子设备在接收云服务器发送的同步数据的过程中,检测到所述第一电子设备通过局域网与所述第二电子设备进行连接的情况下记录的。
进一步的,所述的数据同步装置,还包括:第一上传模块,用于在接收所述第一电子设备发送的数据同步请求之前,在第一条件下,将所述同步数据上传至云服务器;其中,所述第一条件包括以下至少一项:剩余电量大于第一阈值,或处于充电状态;连接于无线网络;设备温度低于第二阈值;所需网络带宽低于第三阈值。
本申请实施例中,所述的数据同步装置,还包括:第二上传模块,用于在将所述同步数据上传至云服务器之前,将所述同步数据的数据信息上传至云服务器。
进一步的,所述的数据同步装置,还包括:第三处理模块,用于在将所述同步数据的数据信息上传至云服务器之前,将待同步数据划分为文本类型数据和文件类型数据;第一确定模块,用于根据所述文件类型数据,确定同步数据以及所述同步数据的数据信息;所述将所述同步数据的数据信息上传至云服务器,包括:将所述文本类型数据和所述同步数据的数据信息上传至云服务器。
本申请实施例中,所述的数据同步装置,还包括:第七接收模块,用于在将所述文本类型数据和所述同步数据的数据信息上传至云服务器之后,接收所述云服务器根据所述数据信息发送的数据标识;第四处理模块,用于将所述数据标识与所述同步数据的本地存储路径进行关联,并存储。
本申请实施例中的数据同步装置可以是装置,也可以是终端中的部件、 集成电路、或芯片。该装置可以是移动电子设备,也可以为非移动电子设备。示例性的,移动电子设备可以为手机、平板电脑、笔记本电脑、掌上电脑、车载电子设备、可穿戴设备、超级移动个人计算机、上网本或者个人数字助理等,非移动电子设备可以为服务器、网络附属存储器、个人计算机、电视机、柜员机或者自助机等,本申请实施例不作具体限定。
本申请实施例中的数据同步装置可以为具有操作系统的装置。该操作系统可以为安卓(Android)操作系统,可以为ios操作系统,还可以为其他可能的操作系统,本申请实施例不作具体限定。
本申请实施例提供的数据同步装置能够实现图2至图10的方法实施例实现的各个过程,为避免重复,这里不再赘述。
可选地,如图13所示,本申请实施例还提供一种电子设备130,包括处理器131,存储器132,存储在存储器132上并可在所述处理器131上运行的程序或指令,该程序或指令被处理器131执行时实现上述第一电子设备侧或第二电子设备侧数据同步方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。
需要说明的是,本申请实施例中的电子设备包括上述所述的移动电子设备和非移动电子设备。
图14为实现本申请实施例的一种电子设备的硬件结构示意图。
该电子设备140包括但不限于:射频单元141、网络模块142、音频输出单元143、输入单元144、传感器145、显示单元146、用户输入单元147、接口单元148、存储器149、以及处理器1410等部件。
本领域技术人员可以理解,电子设备140还可以包括给各个部件供电的电源(比如电池),电源可以通过电源管理系统与处理器1410逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗管理等功能。图14中示出的电子设备结构并不构成对电子设备的限定,电子设备可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置,在此不再赘述。
其中,处理器1410,用于在所述第一电子设备通过局域网与第二电子设 备连接的情况下,利用射频单元141,通过所述局域网,向第二电子设备发送数据同步请求;利用射频单元141接收所述第二电子设备通过所述局域网发送的同步数据;其中,所述数据同步请求携带有数据标识;所述数据标识是根据从云服务器获取的同步数据的数据信息得到的。
在本申请实施例中,通过在所述第一电子设备通过局域网与第二电子设备连接的情况下,通过所述局域网,向第二电子设备发送数据同步请求;接收所述第二电子设备通过所述局域网发送的同步数据;其中,所述数据同步请求携带有数据标识;所述数据标识是根据从云服务器获取的同步数据的数据信息得到的;能够实现使用局域网传输数据,可增加数据同步速度,解决现有技术中的数据同步方案同步速度慢的问题。
可选地,所述局域网的组网方式包括以下至少一项:通过网络热点设备连接的第一组网方式;设备直连的第二组网方式。
可选地,处理器1410,还用于在所述第一电子设备未通过局域网与第二电子设备进行连接的情况下,通过射频单元141向云服务器发送数据同步请求;其中,所述数据同步请求携带有所述数据标识;通过射频单元141接收所述云服务器发送的同步数据。
可选地,处理器1410,还用于在接收所述云服务器发送的同步数据的过程中,检测到所述第一电子设备通过局域网与第二电子设备进行连接的情况下,暂停接收所述同步数据,并记录所述同步数据的第一断点信息;根据所述第一断点信息,利用射频单元141,通过所述局域网向所述第二电子设备发送数据同步请求;利用射频单元141,接收所述第二电子设备通过所述局域网发送的、从第一断点处开始的同步数据;其中,所述第一断点处与所述第一断点信息对应。
可选地,处理器1410,还用于在通过所述局域网,向第二电子设备发送数据同步请求之前,通过射频单元141向云服务器发送信息同步请求;通过射频单元141接收所述云服务器发送的同步数据的数据信息;所述通过所述局域网,向第二电子设备发送数据同步请求,包括:根据所述数据信息中的 数据标识,通过所述局域网,向第二电子设备发送数据同步请求。
可选地,处理器1410,还用于在接收所述第二电子设备通过所述局域网发送的同步数据的过程中,检测到目标连接中断时,记录所述同步数据的第二断点信息;根据所述第二断点信息,利用射频单元141,向云服务器发送数据同步请求;利用射频单元141,接收所述云服务器发送的、从第二断点处开始的同步数据;其中,所述目标连接为所述第一电子设备与所述第二电子设备之间的局域网连接;所述第二断点处与所述第二断点信息对应。
本方案通过局域网连接,直接下载对应的文件内容(对应于上述同步数据),可极大地加速数据的同步速度。
应理解的是,本申请实施例中,输入单元144可以包括图形处理器(Graphics Processing Unit,GPU)1441和麦克风1442,图形处理器1441对在视频捕获模式或图像捕获模式中由图像捕获装置(如摄像头)获得的静态图片或视频的图像数据进行处理。显示单元146可包括显示面板1461,可以采用液晶显示器、有机发光二极管等形式来配置显示面板1461。用户输入单元147包括触控面板1471以及其他输入设备1472。触控面板1471,也称为触摸屏。触控面板1471可包括触摸检测装置和触摸控制器两个部分。其他输入设备1472可以包括但不限于物理键盘、功能键(比如音量控制按键、开关按键等)、轨迹球、鼠标、操作杆,在此不再赘述。存储器149可用于存储软件程序以及各种数据,包括但不限于应用程序和操作系统。处理器1410可集成应用处理器和调制解调处理器,其中,应用处理器主要处理操作系统、用户界面和应用程序等,调制解调处理器主要处理无线通信。可以理解的是,上述调制解调处理器也可以不集成到处理器1410中。
图15为实现本申请实施例的一种电子设备的硬件结构示意图。
该电子设备150包括但不限于:射频单元151、网络模块152、音频输出单元153、输入单元154、传感器155、显示单元156、用户输入单元157、接口单元158、存储器159、以及处理器1510等部件。
本领域技术人员可以理解,电子设备150还可以包括给各个部件供电的 电源(比如电池),电源可以通过电源管理系统与处理器1510逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗管理等功能。图15中示出的电子设备结构并不构成对电子设备的限定,电子设备可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置,在此不再赘述。
其中,处理器1510,用于在所述第二电子设备通过局域网与第一电子设备连接的情况下,通过所述局域网,通过射频单元151接收所述第一电子设备发送的数据同步请求;根据所述数据同步请求中的数据标识,获取同步数据;利用射频单元151,通过所述局域网,向所述第一电子设备发送所述同步数据;其中,所述数据标识是所述第一电子设备根据从云服务器获取的同步数据的数据信息得到的。
在本申请实施例中,通过在所述第二电子设备通过局域网与第一电子设备连接的情况下,通过所述局域网,接收所述第一电子设备发送的数据同步请求;根据所述数据同步请求中的数据标识,获取同步数据;通过所述局域网,向所述第一电子设备发送所述同步数据;其中,所述数据标识是所述第一电子设备根据从云服务器获取的同步数据的数据信息得到的;能够实现使用局域网传输数据,可增加数据同步速度,解决现有技术中的数据同步方案同步速度慢的问题。
可选地,所述局域网的组网方式包括以下至少一项:通过网络热点设备连接的第一组网方式;设备直连的第二组网方式。
可选地,所述数据同步请求中还携带有第一断点信息;所述根据所述数据同步请求中的数据标识,获取同步数据,包括:根据所述数据同步请求中的数据标识和第一断点信息,获取从第一断点处开始的同步数据;其中,所述第一断点处与所述第一断点信息对应;所述第一断点信息为所述第一电子设备在接收云服务器发送的同步数据的过程中,检测到所述第一电子设备通过局域网与所述第二电子设备进行连接的情况下记录的。
可选地,处理器1510,还用于在接收所述第一电子设备发送的数据同步请求之前,在第一条件下,通过射频单元151,将所述同步数据上传至云服 务器;其中,所述第一条件包括以下至少一项:剩余电量大于第一阈值,或处于充电状态;连接于无线网络;设备温度低于第二阈值;所需网络带宽低于第三阈值。
可选地,处理器1510,还用于在将所述同步数据上传至云服务器之前,通过射频单元151,将所述同步数据的数据信息上传至云服务器。
可选地,处理器1510,还用于在将所述同步数据的数据信息上传至云服务器之前,将待同步数据划分为文本类型数据和文件类型数据;根据所述文件类型数据,确定同步数据以及所述同步数据的数据信息;所述将所述同步数据的数据信息上传至云服务器,包括:将所述文本类型数据和所述同步数据的数据信息上传至云服务器。
可选地,处理器1510,还用于在将所述文本类型数据和所述同步数据的数据信息上传至云服务器之后,通过射频单元151,接收所述云服务器根据所述数据信息发送的数据标识;将所述数据标识与所述同步数据的本地存储路径进行关联,并存储。
本方案通过局域网连接,直接下载对应的文件内容(对应于上述同步数据),可极大地加速数据的同步速度。
应理解的是,本申请实施例中,输入单元154可以包括图形处理器(Graphics Processing Unit,GPU)1541和麦克风1542,图形处理器1541对在视频捕获模式或图像捕获模式中由图像捕获装置(如摄像头)获得的静态图片或视频的图像数据进行处理。显示单元156可包括显示面板1561,可以采用液晶显示器、有机发光二极管等形式来配置显示面板1561。用户输入单元157包括触控面板1571以及其他输入设备1572。触控面板1571,也称为触摸屏。触控面板1571可包括触摸检测装置和触摸控制器两个部分。其他输入设备1572可以包括但不限于物理键盘、功能键(比如音量控制按键、开关按键等)、轨迹球、鼠标、操作杆,在此不再赘述。存储器159可用于存储软件程序以及各种数据,包括但不限于应用程序和操作系统。处理器1510可集成应用处理器和调制解调处理器,其中,应用处理器主要处理操作系统、用 户界面和应用程序等,调制解调处理器主要处理无线通信。可以理解的是,上述调制解调处理器也可以不集成到处理器1510中。
本申请实施例还提供一种可读存储介质,所述可读存储介质上存储有程序或指令,该程序或指令被处理器执行时实现上述第一电子设备侧或第二电子设备侧数据同步方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。
其中,所述处理器为上述实施例中所述的电子设备中的处理器。所述可读存储介质,包括计算机可读存储介质,如计算机只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等。
本申请实施例另提供了一种芯片,所述芯片包括处理器和通信接口,所述通信接口和所述处理器耦合,所述处理器用于运行程序或指令,实现上述第一电子设备侧或第二电子设备侧数据同步方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。
应理解,本申请实施例提到的芯片还可以称为系统级芯片、系统芯片、芯片系统或片上系统芯片等。
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者装置不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者装置所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者装置中还存在另外的相同要素。此外,需要指出的是,本申请实施方式中的方法和装置的范围不限按示出或讨论的顺序来执行功能,还可包括根据所涉及的功能按基本同时的方式或按相反的顺序来执行功能,例如,可以按不同于所描述的次序来执行所描述的方法,并且还可以添加、省去、或组合各种步骤。另外,参照某些示例所描述的特征可在其他示例中被组合。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以计算机软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端(可以是手机,计算机,服务器,或者网络设备等)执行本申请各个实施例所述的方法。
上面结合附图对本申请的实施例进行了描述,但是本申请并不局限于上述的具体实施方式,上述的具体实施方式仅仅是示意性的,而不是限制性的,本领域的普通技术人员在本申请的启示下,在不脱离本申请宗旨和权利要求所保护的范围情况下,还可做出很多形式,均属于本申请的保护之内。

Claims (18)

  1. 一种数据同步方法,应用于第一电子设备,包括:
    在所述第一电子设备通过局域网与第二电子设备连接的情况下,通过所述局域网,向第二电子设备发送数据同步请求;
    接收所述第二电子设备通过所述局域网发送的同步数据;
    其中,所述数据同步请求携带有数据标识;所述数据标识是根据从云服务器获取的同步数据的数据信息得到的。
  2. 根据权利要求1所述的数据同步方法,其中,所述局域网的组网方式包括以下至少一项:
    通过网络热点设备连接的第一组网方式;
    设备直连的第二组网方式。
  3. 根据权利要求1所述的数据同步方法,其中,还包括:
    在所述第一电子设备未通过局域网与第二电子设备进行连接的情况下,向云服务器发送数据同步请求;其中,所述数据同步请求携带有所述数据标识;
    接收所述云服务器发送的同步数据。
  4. 根据权利要求3所述的数据同步方法,其中,还包括:
    在接收所述云服务器发送的同步数据的过程中,检测到所述第一电子设备通过局域网与第二电子设备进行连接的情况下,暂停接收所述同步数据,并记录所述同步数据的第一断点信息;
    根据所述第一断点信息,通过所述局域网向所述第二电子设备发送数据同步请求;
    接收所述第二电子设备通过所述局域网发送的、从第一断点处开始的同步数据;
    其中,所述第一断点处与所述第一断点信息对应。
  5. 根据权利要求1所述的数据同步方法,其中,在通过所述局域网,向第二电子设备发送数据同步请求之前,还包括:
    向云服务器发送信息同步请求;
    接收所述云服务器发送的同步数据的数据信息;
    所述通过所述局域网,向第二电子设备发送数据同步请求,包括:
    根据所述数据信息中的数据标识,通过所述局域网,向第二电子设备发送数据同步请求。
  6. 根据权利要求1所述的数据同步方法,其中,还包括:
    在接收所述第二电子设备通过所述局域网发送的同步数据的过程中,检测到目标连接中断时,记录所述同步数据的第二断点信息;
    根据所述第二断点信息,向云服务器发送数据同步请求;
    接收所述云服务器发送的、从第二断点处开始的同步数据;
    其中,所述目标连接为所述第一电子设备与所述第二电子设备之间的局域网连接;
    所述第二断点处与所述第二断点信息对应。
  7. 一种数据同步方法,应用于第二电子设备,包括:
    在所述第二电子设备通过局域网与第一电子设备连接的情况下,通过所述局域网,接收所述第一电子设备发送的数据同步请求;
    根据所述数据同步请求中的数据标识,获取同步数据;
    通过所述局域网,向所述第一电子设备发送所述同步数据;
    其中,所述数据标识是所述第一电子设备根据从云服务器获取的同步数据的数据信息得到的。
  8. 根据权利要求7所述的数据同步方法,其中,所述局域网的组网方式包括以下至少一项:
    通过网络热点设备连接的第一组网方式;
    设备直连的第二组网方式。
  9. 根据权利要求7所述的数据同步方法,其中,所述数据同步请求中还 携带有第一断点信息;
    所述根据所述数据同步请求中的数据标识,获取同步数据,包括:
    根据所述数据同步请求中的数据标识和第一断点信息,获取从第一断点处开始的同步数据;
    其中,所述第一断点处与所述第一断点信息对应;
    所述第一断点信息为所述第一电子设备在接收云服务器发送的同步数据的过程中,检测到所述第一电子设备通过局域网与所述第二电子设备进行连接的情况下记录的。
  10. 根据权利要求7所述的数据同步方法,其中,在接收所述第一电子设备发送的数据同步请求之前,还包括:
    在第一条件下,将所述同步数据上传至云服务器;
    其中,所述第一条件包括以下至少一项:
    剩余电量大于第一阈值,或处于充电状态;
    连接于无线网络;
    设备温度低于第二阈值;
    所需网络带宽低于第三阈值。
  11. 根据权利要求10所述的数据同步方法,其中,在将所述同步数据上传至云服务器之前,还包括:
    将所述同步数据的数据信息上传至云服务器。
  12. 根据权利要求11所述的数据同步方法,其中,在将所述同步数据的数据信息上传至云服务器之前,还包括:
    将待同步数据划分为文本类型数据和文件类型数据;
    根据所述文件类型数据,确定同步数据以及所述同步数据的数据信息;
    所述将所述同步数据的数据信息上传至云服务器,包括:
    将所述文本类型数据和所述同步数据的数据信息上传至云服务器。
  13. 根据权利要求12所述的数据同步方法,其中,在将所述文本类型数据和所述同步数据的数据信息上传至云服务器之后,还包括:
    接收所述云服务器根据所述数据信息发送的数据标识;
    将所述数据标识与所述同步数据的本地存储路径进行关联,并存储。
  14. 一种数据同步装置,应用于第一电子设备,包括:
    第一发送模块,用于在所述第一电子设备通过局域网与第二电子设备连接的情况下,通过所述局域网,向第二电子设备发送数据同步请求;
    第一接收模块,用于接收所述第二电子设备通过所述局域网发送的同步数据;
    其中,所述数据同步请求携带有数据标识;所述数据标识是根据从云服务器获取的同步数据的数据信息得到的。
  15. 一种数据同步装置,应用于第二电子设备,包括:
    第六接收模块,用于在所述第二电子设备通过局域网与第一电子设备连接的情况下,通过所述局域网,接收所述第一电子设备发送的数据同步请求;
    第一获取模块,用于根据所述数据同步请求中的数据标识,获取同步数据;
    第六发送模块,用于通过所述局域网,向所述第一电子设备发送所述同步数据;
    其中,所述数据标识是所述第一电子设备根据从云服务器获取的同步数据的数据信息得到的。
  16. 一种电子设备,包括处理器,存储器及存储在所述存储器上并可在所述处理器上运行的程序或指令,所述程序或指令被所述处理器执行时实现如权利要求1-6任一项所述的数据同步方法的步骤;或者,
    所述程序或指令被所述处理器执行时实现如权利要求7-13任一项所述的数据同步方法的步骤。
  17. 一种可读存储介质,所述可读存储介质上存储程序或指令,所述程序或指令被处理器执行时实现如权利要求1-6任一项所述的数据同步方法的步骤;或者,
    所述程序或指令被处理器执行时实现如权利要求7-13任一项所述的数据 同步方法的步骤。
  18. 一种芯片,所述芯片包括处理器和通信接口,所述通信接口和所述处理器耦合,所述处理器用于运行程序或指令,实现如权利要求1-6任一项所述的数据同步方法的步骤;
    或者,
    所述处理器用于运行程序或指令,实现如权利要求7-13任一项所述的数据同步方法的步骤。
PCT/CN2023/106956 2022-07-19 2023-07-12 数据同步方法、装置和电子设备 WO2024017113A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210849782.0A CN115225649A (zh) 2022-07-19 2022-07-19 数据同步方法、装置和电子设备
CN202210849782.0 2022-07-19

Publications (1)

Publication Number Publication Date
WO2024017113A1 true WO2024017113A1 (zh) 2024-01-25

Family

ID=83611233

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/106956 WO2024017113A1 (zh) 2022-07-19 2023-07-12 数据同步方法、装置和电子设备

Country Status (2)

Country Link
CN (1) CN115225649A (zh)
WO (1) WO2024017113A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115225649A (zh) * 2022-07-19 2022-10-21 维沃移动通信有限公司 数据同步方法、装置和电子设备

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103095755A (zh) * 2011-10-31 2013-05-08 联想(北京)有限公司 一种数据同步方法及电子设备
CN104023334A (zh) * 2014-05-19 2014-09-03 联想(北京)有限公司 一种信息处理方法及电子设备
US20210218725A1 (en) * 2018-09-03 2021-07-15 Huawei Technologies Co., Ltd. Login Method, Token Sending Method, and Device
CN113365274A (zh) * 2021-06-10 2021-09-07 荣耀终端有限公司 一种网络接入方法和电子设备
CN113840003A (zh) * 2021-09-24 2021-12-24 维沃移动通信有限公司 同步方法和装置
CN115225649A (zh) * 2022-07-19 2022-10-21 维沃移动通信有限公司 数据同步方法、装置和电子设备

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103986742B (zh) * 2013-02-08 2018-08-31 纬创资通股份有限公司 文件同步的方法及相关电子装置
CN106453511B (zh) * 2016-09-14 2019-04-16 Oppo广东移动通信有限公司 一种数据备份方法及设备
CN109271442A (zh) * 2018-07-27 2019-01-25 东软集团股份有限公司 数据库同步恢复方法、装置、计算机可读存储介质和电子设备
CN110336791B (zh) * 2019-05-29 2022-02-22 平安科技(深圳)有限公司 一种断点数据传输方法、装置、设备及计算机存储介质
CN110866465A (zh) * 2019-10-29 2020-03-06 维沃移动通信有限公司 电子设备的控制方法及电子设备
CN110933150A (zh) * 2019-11-18 2020-03-27 拉扎斯网络科技(上海)有限公司 数据同步方法、系统、装置、电子设备及计算机存储介质
CN111859357A (zh) * 2020-07-17 2020-10-30 维沃移动通信有限公司 登录方法、装置和电子设备
CN112052230B (zh) * 2020-09-02 2024-03-15 掌阅科技股份有限公司 多机房数据同步方法、计算设备及存储介质
CN112905209A (zh) * 2021-03-23 2021-06-04 维沃移动通信(深圳)有限公司 应用程序更新方法及装置

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103095755A (zh) * 2011-10-31 2013-05-08 联想(北京)有限公司 一种数据同步方法及电子设备
CN104023334A (zh) * 2014-05-19 2014-09-03 联想(北京)有限公司 一种信息处理方法及电子设备
US20210218725A1 (en) * 2018-09-03 2021-07-15 Huawei Technologies Co., Ltd. Login Method, Token Sending Method, and Device
CN113365274A (zh) * 2021-06-10 2021-09-07 荣耀终端有限公司 一种网络接入方法和电子设备
CN113840003A (zh) * 2021-09-24 2021-12-24 维沃移动通信有限公司 同步方法和装置
CN115225649A (zh) * 2022-07-19 2022-10-21 维沃移动通信有限公司 数据同步方法、装置和电子设备

Also Published As

Publication number Publication date
CN115225649A (zh) 2022-10-21

Similar Documents

Publication Publication Date Title
US11025963B2 (en) Data processing method, apparatus, and system for live streaming page
JP6101861B2 (ja) グループ作成方法、グループ脱退方法、装置、プログラム、及び記録媒体
TWI470455B (zh) 媒體內容與用戶訂閱內容的無線同步
EP3188437B1 (en) Method and system for implementing information sharing
US10187474B2 (en) Method and device for resource sharing between devices
WO2022017107A1 (zh) 信息处理方法、装置、计算机设备及存储介质
CN112350981B (zh) 一种切换通信协议的方法、装置和系统
US11321407B2 (en) Search method, and apparatus
WO2022143081A1 (zh) 一种数据同步方法和装置
WO2022089568A1 (zh) 文件分享的方法、装置和电子设备
US20230122838A1 (en) Data Sharing Method, Electronic Device, and System
CN104462570B (zh) 网页内容获取方法及装置
WO2024017113A1 (zh) 数据同步方法、装置和电子设备
WO2017148383A1 (zh) 多媒体资源播放系统、方法及服务器
CN113014972B (zh) 投屏方法、装置和系统
CN104133852A (zh) 网页访问方法、装置、服务器及终端
CN113037929A (zh) 一种信息接力输出方法、装置、电子设备及存储介质
WO2018161788A1 (zh) 多媒体数据共享方法及装置
CN111741352A (zh) 一种投屏控制的方法、投屏播放的方法以及相关装置
CN111935255A (zh) 一种信息处理方法、装置及存储介质
CN108549695B (zh) 数据交互方法、装置、终端设备及存储介质
CN106657281B (zh) 文件共享方法及装置
CN104702578A (zh) 一种终端间进行通信的方法及终端
CN112965830A (zh) 数据同步方法及其装置
WO2023125856A1 (zh) Ursp规则的监控和上报方法、装置、终端及网元

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: 23842178

Country of ref document: EP

Kind code of ref document: A1