CN115225649A - Data synchronization method and device and electronic equipment - Google Patents

Data synchronization method and device and electronic equipment Download PDF

Info

Publication number
CN115225649A
CN115225649A CN202210849782.0A CN202210849782A CN115225649A CN 115225649 A CN115225649 A CN 115225649A CN 202210849782 A CN202210849782 A CN 202210849782A CN 115225649 A CN115225649 A CN 115225649A
Authority
CN
China
Prior art keywords
data
local area
area network
electronic device
cloud server
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210849782.0A
Other languages
Chinese (zh)
Inventor
陈文杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Vivo Mobile Communication Co Ltd
Original Assignee
Vivo Mobile Communication Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Vivo Mobile Communication Co Ltd filed Critical Vivo Mobile Communication Co Ltd
Priority to CN202210849782.0A priority Critical patent/CN115225649A/en
Publication of CN115225649A publication Critical patent/CN115225649A/en
Priority to PCT/CN2023/106956 priority patent/WO2024017113A1/en
Pending legal-status Critical Current

Links

Images

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

Landscapes

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

Abstract

The application discloses a data synchronization method, a data synchronization device and electronic equipment, and belongs to the technical field of communication. The data synchronization method comprises the following steps: under the condition that the first electronic equipment is connected with second electronic equipment through a local area network, sending a data synchronization request to the second electronic equipment through the local area network; receiving synchronous data sent by the second electronic equipment through the local area network; wherein the data synchronization request carries a data identifier; the data identification is obtained according to data information of the synchronous data acquired from the cloud server.

Description

Data synchronization method and device and electronic equipment
Technical Field
The application belongs to the technical field of communication, and particularly relates to a data synchronization method, a data synchronization device and electronic equipment.
Background
Most of the current cloud synchronization technologies take a cloud server as a center, and synchronize data to each terminal through the internet. However, when data is transmitted through the internet, synchronization is very slow when the data is synchronized for the first time or when a large amount of data is updated, and a user needs to wait for a long time at a terminal to view and use the data.
Therefore, the data synchronization scheme in the prior art has the problems of low synchronization speed and the like.
Disclosure of Invention
The embodiment of the application aims to provide a data synchronization method, a data synchronization device and electronic equipment, and can solve the problem that a data synchronization scheme in the prior art is low in synchronization speed.
In a first aspect, an embodiment of the present application provides a data synchronization method, which is applied to a first electronic device, and the method includes:
under the condition that the first electronic equipment is connected with second electronic equipment through a local area network, sending a data synchronization request to the second electronic equipment through the local area network;
receiving synchronous data sent by the second electronic equipment through the local area network;
wherein the data synchronization request carries a data identifier; the data identification is obtained according to data information of the synchronous data acquired from the cloud server.
In a second aspect, an embodiment of the present application provides a data synchronization method, which is applied to a second electronic device, and includes:
under the condition that the second electronic equipment is connected with the first electronic equipment through a local area network, receiving a data synchronization request sent by the first electronic equipment through the local area network;
acquiring synchronous data according to the data identification in the data synchronous request;
sending the synchronization data to the first electronic device through the local area network;
the data identification is obtained by the first electronic device according to data information of the synchronous data acquired from the cloud server.
In a third aspect, an embodiment of the present application provides a data synchronization apparatus, applied to a first electronic device, including:
the first sending module is used for sending a data synchronization request to the second electronic equipment through the local area network under the condition that the first electronic equipment is connected with the second electronic equipment through the local area network;
the first receiving module is used for receiving the synchronous data sent by the second electronic equipment through the local area network;
wherein the data synchronization request carries a data identifier; the data identification is obtained according to data information of the synchronous data acquired from the cloud server.
In a fourth aspect, an embodiment of the present application provides a data synchronization apparatus, which is applied to a second electronic device, and includes:
a sixth receiving module, configured to receive, through a local area network, a data synchronization request sent by a first electronic device when the second electronic device is connected to the first electronic device through the local area network;
the first acquisition module is used for acquiring synchronous 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 according to data information of the synchronous data acquired from the cloud server.
In a fifth aspect, the present application provides an electronic device, which includes a processor, a memory, and a program or instructions stored on the memory and executable on the processor, and when executed by the processor, the program or instructions implement the steps of the method according to the first aspect or the second aspect.
In a sixth aspect, embodiments of the present application provide a readable storage medium, on which a program or instructions are stored, which when executed by a processor implement the steps of the method according to the first or second aspect.
In a seventh aspect, an embodiment of the present application provides a chip, where the chip includes a processor and a communication interface, where the communication interface is coupled to the processor, and the processor is configured to execute a program or instructions to implement the method according to the first aspect or the second aspect.
In the embodiment of the application, in the data synchronization method, a data synchronization request is sent to a second electronic device through a local area network when the first electronic device is connected with the second electronic device through the local area network; receiving synchronous data sent by the second electronic equipment through the local area network; wherein the data synchronization request carries a data identifier; the data identification is obtained according to data information of the synchronous data acquired from the cloud server; the data can be transmitted by using the local area network, the data synchronization speed can be increased, and the problem of low synchronization speed of a data synchronization scheme in the prior art is solved.
Drawings
FIG. 1 is a first flowchart illustrating a data synchronization method according to an embodiment of the present application;
FIG. 2 is a second flowchart illustrating a data synchronization method according to an embodiment of the present application;
FIG. 3 is a schematic diagram of a first networking approach of an embodiment of the present application;
FIG. 4 is a first device list diagram according to an embodiment of the present application;
fig. 5 is a first flowchart illustrating a specific implementation of a data synchronization method according to an embodiment of the present application;
FIG. 6 is a first diagram of data information according to an embodiment of the present application;
FIG. 7 is a schematic diagram of a second networking approach of an embodiment of the present application;
FIG. 8 is a device list diagram of the second embodiment of the present application;
fig. 9 is a schematic diagram of a specific implementation flow of a data synchronization method according to an embodiment of the present application;
FIG. 10 is a second data message diagram in accordance with an embodiment of the present application;
FIG. 11 is a first schematic structural diagram of a data synchronization apparatus according to an embodiment of the present application;
FIG. 12 is a second block diagram illustrating a data synchronization apparatus according to an embodiment of the present application;
FIG. 13 is a first schematic structural diagram of an electronic device according to an embodiment of the present application;
FIG. 14 is a schematic structural diagram of an electronic device according to an embodiment of the present application;
fig. 15 is a schematic structural diagram three of an electronic device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be described clearly below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some, but not all, embodiments of the present application. All other embodiments that can be derived by one of ordinary skill in the art from the embodiments given herein are intended to be within the scope of the present disclosure.
The terms first, second and the like in the description and in the claims of the present application are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It will be appreciated that the data so used may be interchanged under appropriate circumstances such that embodiments of the application may be practiced in sequences other than those illustrated or described herein, and that the terms "first," "second," and the like are generally used herein in a generic sense and do not limit the number of terms, e.g., the first term can be one or more than one. In addition, "and/or" in the specification and claims means at least one of connected objects, a character "/" generally means that a preceding and succeeding related objects are in an "or" relationship.
The data synchronization method provided by the embodiment of the present application is described in detail below with reference to the accompanying drawings through specific embodiments and application scenarios thereof.
The data synchronization method provided in the embodiment of the present application is applied to a first electronic device, and as shown in fig. 1, includes:
step 11: and under the condition that the first electronic equipment is connected with the second electronic equipment through the local area network, sending a data synchronization request to the second electronic equipment through the local area network.
Wherein the networking mode of the local area network comprises at least one of the following: a first networking mode of connecting through network hotspot equipment; and a second networking mode of directly connecting the devices. Under the first networking mode, the first electronic device and the second electronic device are respectively connected with the network hotspot device; and in the second networking mode, the first electronic equipment and the second electronic equipment are directly connected.
Regarding "network hotspot device", it may be: routers, mobile hotspot devices, and the like, and are not limited herein.
The data synchronization request may also carry other information, such as breakpoint information, and the like, which is not limited herein.
Further, before step 12, the method may further include: determining whether the first electronic equipment is connected with second electronic equipment through a local area network; this is done to make sure whether the local area network is used for data transmission.
Step 12: receiving synchronous data sent by the second electronic equipment through the local area network; wherein the data synchronization request carries a data identifier; the data identification is obtained according to data information of the synchronous data acquired from the cloud server.
The data identifier may be a globally unique identifier GUID, but is not limited thereto. The synchronization data may be a data body in the file type data, instead of the file summary information, such as a file name, a file size, a file type, a thumbnail, and the like, which is not limited herein.
In the embodiment of the application, under the condition that the first electronic device is connected with the second electronic device through the local area network, a data synchronization request is sent to the second electronic device through the local area network; receiving synchronous data sent by the second electronic equipment through the local area network; wherein the data synchronization request carries a data identifier; the data identification is obtained according to data information of the synchronous data acquired from the cloud server; the method and the device can realize the data transmission by using the local area network, increase the data synchronization speed and solve the problem of low synchronization speed of a data synchronization scheme in the prior art.
Further, the data synchronization method further includes: sending a data synchronization request to a cloud server under the condition that the first electronic equipment is not connected with second electronic equipment through a local area network; the data synchronization request carries the data identifier; and receiving the synchronous data sent by the cloud server.
Therefore, the normal synchronization of the data can be ensured under the condition that the data transmission can not be carried out through the local area network.
In an embodiment of the present application, the data synchronization method further includes: in the process of receiving the synchronous data sent by the cloud server, under the condition that the first electronic equipment is detected to be connected with the second electronic equipment through a local area network, the synchronous data is suspended from being received, and first breakpoint information of the synchronous data is recorded; sending a data synchronization request to the second electronic equipment through the local area network according to the first breakpoint information; receiving synchronous data which is sent by the second electronic equipment through the local area network and starts from a first breakpoint; wherein the first breakpoint corresponds to the first breakpoint information.
Therefore, the local area network can be used for data transmission as much as possible, so that the data synchronization speed is improved.
Further, before sending the data synchronization request to the second electronic device through the local area network, the method further includes: sending an information synchronization request to a cloud server; receiving data information of the synchronous data sent by the cloud server; the sending of the data synchronization request to the second electronic device through the local area network includes: and sending a data synchronization request to the second electronic equipment through the local area network according to the data identifier in the data information.
This makes it possible to determine that a data synchronization request is transmitted in order to acquire accurate synchronization data.
In an embodiment of the present application, the data synchronization method further includes: in the process of receiving the synchronous data sent by the second electronic device through the local area network, recording second breakpoint information of the synchronous data when the interruption of target connection is detected; sending a data synchronization request to a cloud server according to the second breakpoint information; receiving synchronous data which is sent by the cloud server and starts from a second breakpoint; 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.
Therefore, the normal synchronization of the data can be ensured under the condition that the data transmission can not be continued through the local area network.
An embodiment of the present application further provides a data synchronization method, applied to a second electronic device, as shown in fig. 2, including:
step 21: and under the condition that the second electronic equipment is connected with the first electronic equipment through a local area network, receiving a data synchronization request sent by the first electronic equipment through the local area network.
Wherein the networking mode of the local area network comprises at least one of the following: a first networking mode of connecting through network hotspot equipment; and a second networking mode of directly connecting the devices. Under the first networking mode, the first electronic device and the second electronic device are respectively connected with the network hotspot device; and in the second networking mode, the first electronic equipment and the second electronic equipment are directly connected.
Regarding "network hotspot device", it may be: routers, mobile hotspot devices, and the like, and are not limited herein.
Step 22: and acquiring synchronous data according to the data identification in the data synchronous request.
The data synchronization request may also carry other information, such as breakpoint information, and the like, which is not limited herein. The data identification may be a globally unique identifier GUID, but is not limited thereto.
Step 23: sending the synchronization data to the first electronic device through the local area network; the data identification is obtained by the first electronic equipment according to data information of the synchronous data acquired from the cloud server.
The synchronization data may be a data body in the file type data, instead of the file summary information, such as a file name, a file size, a file type, a thumbnail, and the like, which is not limited herein.
In the embodiment of the application, a data synchronization request sent by a first electronic device is received through a local area network under the condition that a second electronic device is connected with the first electronic device through the local area network; acquiring synchronous data according to the data identification in the data synchronous request; sending the synchronization data to the first electronic device through the local area network; the data identification is obtained by the first electronic equipment according to data information of synchronous data acquired from a cloud server; the data can be transmitted by using the local area network, the data synchronization speed can be increased, and the problem of low synchronization speed of a data synchronization scheme in the prior art is solved.
Further, the data synchronization request also carries first breakpoint information; the acquiring synchronous data according to the data identifier in the data synchronization request includes: acquiring synchronous data starting from a first breakpoint according to the data identifier and the first breakpoint information in the data synchronization request; wherein the first breakpoint corresponds to the first breakpoint information; the first breakpoint information is recorded when the first electronic device detects that the first electronic device is connected with the second electronic device through a local area network in a process of receiving synchronous data sent by a cloud server.
Therefore, the local area network can be used for data transmission as much as possible, so that the data synchronization speed is improved.
In this embodiment of the application, before receiving the data synchronization request sent by the first electronic device, the method further includes: under a first condition, uploading the synchronous data to a cloud server; wherein the first condition comprises at least one of: the residual capacity is larger than a first threshold value or in a charging state; connecting to a wireless network; the device temperature is below a second threshold; the required network bandwidth is below a third threshold.
Therefore, after the requirements of electric quantity, power consumption, data network flow and/or user use scenes are met, synchronous data can be uploaded in a delayed mode, and the effects of power saving and temperature control are achieved. The options included in the first condition may be a condition option that needs to be satisfied currently, or may be a condition option that needs to be satisfied at a certain specified time, for example: the time before the current time or the time after the current time is not limited herein.
Further, before uploading the synchronization data to the cloud server, the method further includes: and uploading the data information of the synchronous data to a cloud server.
Therefore, the first electronic equipment can download the data information of the synchronous data from the cloud server conveniently, and then relevant display is carried out, so that the user can conveniently view the data information.
In this embodiment of the application, before uploading the data information of the synchronized data to the cloud server, the method further includes: dividing data to be synchronized into text type data and file type data; determining synchronous data and data information of the synchronous data according to the file type data; the uploading of the data information of the synchronization data to a cloud server includes: and uploading the data information of the text type data and the synchronous data to a cloud server.
Therefore, cloud synchronization can be guaranteed to a certain extent.
Further, after the data information of the text type data and the synchronization data is uploaded to a cloud server, the method further includes: receiving a data identifier sent by the cloud server according to the data information; and associating the data identification with a local storage path of the synchronous data, and storing. The association relationship between the data identifier and the local storage path may be stored, but is not limited thereto.
Therefore, the synchronous data can be accurately acquired for feedback according to the data synchronization request (carrying the data identification) of the first electronic device.
For example, the data synchronization method provided in the embodiment of the present application is illustrated below, where the first electronic device is exemplified by the terminal a, the second electronic device is exemplified by the terminal B, the network hotspot device is exemplified by a router, and the second networking mode is exemplified by wifi p2p (wireless network direct connection).
In view of the foregoing technical problems, an embodiment of the present application provides a data synchronization method, which can be specifically implemented as a method for accelerating data synchronization by using a local area network, where the method includes: by using the centralized cloud service, the terminal a (such as a computer) synchronizes the file directory and the basic information (corresponding to the data information and having a small data amount) of the user through the internet, and then, according to the basic information of the file, the target terminal (i.e. the terminal B, such as a mobile phone) directly downloads the corresponding file content (corresponding to the synchronized data) through the local area network connection, so that the data synchronization speed can be greatly accelerated.
In addition, in the application, different networking schemes can be provided for different networking modes (the networking mode of the local area network comprises the first networking mode and the second networking mode). Specifically, the method can comprise the following steps: the networking mode (corresponding to the first networking mode) connected through the router and the point-to-point networking mode (corresponding to the second networking mode) connected through the wifi p2p (wireless network direct connection) are adapted to different user use scenes.
The following specifically exemplifies the scheme provided in the embodiments of the present application.
Example one (corresponding to the first networking approach described above):
assume that both terminal a (computer) and terminal B (mobile phone) have logged in the same data account (data account for synchronization), and as shown in fig. 3, both have connected to the same router or hotspot, and the router or hotspot has access to the internet. A cloud server exists to provide centralized synchronization services for multiple device terminals.
Based on the above, the overall scheme is mainly divided into three parts: part 1, establishing local area network connection (connection through a router); part 2, uploading data by a terminal B (mobile phone); part 3, terminal a (computer) downloads data.
Section 1 relates primarily to the following:
judging whether a local area network connection is established between a terminal A (computer) and a terminal B (mobile phone) for the first time, if so, entering the following operation 1, and if not, entering the following operation 2;
operation 1, local area network connection is established between a terminal A (computer) and a terminal B (mobile phone) for the first time.
In the scheme, the connection can be established by using an SSDP (simple service discovery protocol) local area network discovery mode. The terminal a and the terminal B may continuously send UDP (user datagram protocol) multicast messages to the multicast address in the local area network (for timely detection), and the messages may include device information of their own devices (which may be used for device list display), account information (which may be used for determining whether to log in the same account), an IP address (which may be used for subsequent connection between the terminal a and the terminal B), and the like. After receiving the message, the opposite terminal displays the devices found in the lan to a connectable device list, as shown in fig. 4. The devices that log in the same account are filtered out from the device list. The user clicks on the device in the device list, and a local area network connection can be established with the device.
After the local area network connection is established successfully for the first time, the ID of the equipment which is successfully connected for the last time can be recorded in the database.
And 2, establishing local area network connection between the terminal A (computer) and the terminal B (mobile phone) for the non-first time.
If the 'subsequent automatic connection' is selected during the first connection, after the terminal A (computer) and the terminal B (mobile phone) access the same router, the local area network discovery can be performed according to the mode in the operation 1 of the part. After finding the device list and before showing the device list, the terminal a may obtain the ID of the opposite device successfully connected for the last time 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, displaying the device list.
Section 2 relates primarily to the following:
operation 1, terminal B (mobile phone) triggers synchronization, uploads data information (corresponding to the text type data) and performs file pre-upload (corresponding to the data information).
Specifically, the terminal B (mobile phone) generates user data after the user performs actions such as note editing, photographing, document editing, picture and/or video receiving, and the like. The user data is divided into two types:
(1) Text type data: the data volume is small, and the transmission is fast. Such as notes, schedules, contacts, album directory structures, etc.
(2) File type data: the data volume is large and the transmission is slow. Such as a photo, video, etc. file type.
As shown in fig. 5, after data is generated, data synchronization (including dividing data into the above two types for uploading) is triggered once. Judging whether the terminal (namely the terminal B) is accessed to the Internet or not, and if so, uploading text type data to a server (corresponding to the cloud server); after the text type (data) is uploaded, the file of each file type data needs to be pre-uploaded, and the pre-uploading is used for uploading a small amount of summary information (corresponding to the data information) of the file in advance, so that other terminals can display icons and basic information (such as file size, file name, final modification time and the like) of the file on an interface under the condition that the specific content of the file is not uploaded or downloaded. The pre-upload content may include file summary information (corresponding to the above data information) such as a file name, a file size, a file type, a thumbnail, and the like, but does not include specific file content. Dividing the data to be synchronized into text type data and file type data correspondingly; according to the file type data, determining synchronous data and data information of the synchronous data; and uploading the data information of the text type data and the synchronous data to a cloud server.
The server analyzes the file summary information when the files are pre-uploaded, generates a GUID (globally unique identifier corresponding to the data identifier) for each file, and returns the GUID to the client terminal B (mobile phone). The GUID is a unique identifier of each file in the cloud server, and the GUID can be used for locating a certain file under a certain user (account number), and is used for binding the summary information pre-uploaded by the file with a file body and locating the file.
After receiving the GUID generated by the server, the terminal B (mobile phone) associates the GUID with the local file path (corresponding to the local storage path), and records the GUID in the database (local to the terminal B). At this point, the file pre-upload is complete. Receiving a data identifier sent by the cloud server according to the data information; and associating the data identification with a local storage path of the synchronous data, and storing.
Operation 2, the terminal B (mobile phone) judges a local environment condition (corresponding to the first condition), and uploads a file (corresponding to the synchronization data) to the cloud server through the internet at an appropriate time;
specific examples thereof are: the terminal B (mobile phone) will regularly detect whether the following conditions are met:
(1) The electric quantity of the mobile phone is larger than a certain threshold (if the electric quantity is larger than 20%), or the mobile phone is in charging; corresponding to the residual capacity being larger than a first threshold value or in a charging state;
(2) At the moment, the system is in a wifi network environment instead of a data network; corresponding to the connection to the wireless network;
(3) At this time, the temperature of the mobile phone is lower than a certain threshold (for example, the temperature is lower than 45 ℃); corresponding to the temperature of the equipment being lower than a second threshold value;
(4) At the moment, the mobile terminal is not in a game scene or other scenes with higher network bandwidth requirements; corresponding to the required network bandwidth being below a third threshold.
After the at least one condition is met, the terminal B (mobile phone) starts to upload the specific file content (corresponding to the above-mentioned synchronization data) to the server, and meanwhile, the GUID of the file is taken, and the GUID of the file is allocated by the cloud server in the pre-upload process of the operation 1 in this section.
If the condition is not satisfied, the system enters a waiting state, and the timer triggers the next time to detect the condition again.
Section 3 relates primarily to the following:
operation 1, downloading data to a cloud server through the internet.
And the terminal A (computer) sends a request to the cloud server at regular time through the Internet, and detects data updating. And if the cloud data update exists, downloading new data. Specific examples thereof are: the terminal A sends a detection request to the cloud server, the cloud server feeds back a detection response to the terminal A under the condition that the cloud server determines that the cloud server is updated, the terminal A sends an update request to the cloud server according to the detection response, and the cloud server sends data to the terminal A according to the update request; sending an information synchronization request (carrying a data identifier) to a cloud server; and receiving data information of the synchronous data sent by the cloud server.
The "downloading new data" may include the following items:
(1) The text type data is downloaded.
(2) The file information (i.e., the above-mentioned file summary information) is downloaded, and a file icon is displayed according to the file information, as shown in fig. 6.
The file information may include a file size, a last modification date, a file name, a file type, and a thumbnail, and at this time, the terminal a (computer) interface may display a file icon according to the file information.
Operation 2, the terminal a (computer) downloads the specific content of the file according to the GUID in the file information, as shown in fig. 6. This may be triggered by a user or performed automatically, without limitation.
Before downloading the file (specific content), it may be determined whether a local area network connection is made with the 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), and if the local area network connection is not established, the operation 2 of the part 1 may be returned to, and an automatic connection is attempted. The lan connection is specifically a connection established through the router.
(1) If the local area network is accessed, the file is automatically downloaded through the local area network, the file GUID is sent to the terminal B (mobile phone), and the file downloading is requested. Corresponding to the situation that the first electronic device is connected with the second electronic device through the local area network, sending a data synchronization request to the second electronic device through the local area network; and receiving the synchronous data sent by the second electronic equipment through the local area network.
(2) And if the mobile terminal does not enter the local area network, sending a file GUID to the cloud server through the Internet to request to download the file. Corresponding to the situation that the first electronic device is not connected with the second electronic device through the local area network, sending a data synchronization request (carrying a data identifier) to a cloud server; and receiving the synchronous data sent by the cloud server.
Operation 3. If during the downloading of the file (specific content), network switching is found, such as the following scenarios:
in the process of downloading the file by the local area network, the mobile phone is disconnected in the local area network, the breakpoint position (corresponding to the second breakpoint information) is recorded, and the internet cloud service is switched to try to continue downloading from the breakpoint. When the interruption of target connection is detected in the process of receiving the synchronous data sent by the second electronic device through the local area network, recording second breakpoint information of the synchronous data; sending a data synchronization request (carrying a data identifier) to a cloud server according to the second breakpoint information; and receiving the synchronous data which is sent by the cloud server and starts from the second breakpoint.
If the mobile phone is accessed to the local area network in the process of downloading the file through the internet, after the connection is automatically found through the operation 2 of the part 1, the internet downloading is suspended, and the breakpoint (corresponding to the first breakpoint information) is recorded. And switching to the local area network to continue downloading from the breakpoint, so as to accelerate the downloading speed. In the process of receiving the synchronous data sent by the cloud server, when the first electronic device is detected to be connected with the second electronic device through the local area network, the receiving of the synchronous data is suspended, and first breakpoint information of the synchronous data is recorded; according to the first breakpoint information, sending a data synchronization request (carrying a data identifier) to the second electronic device through the local area network; and receiving the synchronous data which is sent by the second electronic equipment through the local area network and starts from the first breakpoint.
And operation 4, in the file downloading process, the user opens the file and prompts the user to open the file until the downloading is completed.
The above description is not limited to the execution in the above order, and is not limited herein.
From the above, the scheme provided by this example has the following effects:
1. the specific content of the large file (namely the file type data) is transmitted through the local area network, and compared with the transmission by using the internet, the method has the advantages of being more stable and faster in transmission speed.
2. The terminal B (mobile phone) can delay uploading of specific file contents and delay uploading after the requirements of electric quantity, power consumption, data network flow and user use scenes are met; the effects of power saving and temperature control are achieved.
3. If the local area network condition is met (namely, the file is connected through the local area network), the terminal A (computer) can immediately download the file from the terminal B (mobile phone), and the time for uploading the file to the cloud service and the time for delaying the uploading of the file do not need to be waited for.
4. Under the condition of local area network transmission, the scheme improves the synchronization speed of the large file data and also improves the real-time property of the synchronization of the large file data.
Example two (corresponding to the second networking approach described above):
assume that both terminal a (computer) and terminal B (mobile phone) have logged in the same data account (data account for synchronization) and have accessed the internet as shown in fig. 7; both ends (terminal A and B) all have bluetooth module and wireless network card, support wifi p2p to be connected. A cloud server exists to provide centralized synchronization services for multiple device terminals.
Based on the above, the overall scheme is mainly divided into three parts: part 1, establishing local area network connection (equipment networking, wifi p2p connection); part 2, uploading data by a terminal B (mobile phone); part 3, terminal a (computer) downloads data.
Section 1 relates primarily to the following:
judging whether a local area network connection is established between a terminal A (computer) and a terminal B (mobile phone) for the first time, if so, entering the following operation 1, and if not, entering the following operation 2;
operation 1, connection is established between a terminal A (computer) and a terminal B (mobile phone) for the first time.
In the scheme, a terminal B (mobile phone) can externally send a broadcast through the low power consumption bluetooth BLE, and the broadcast content includes device information and account information (information of the data account can be used to determine whether to log in the same account) of its own device. After scanning nearby BLE broadcasts through BLE, the terminal a (computer) judges whether the account information of the other party is the same account as the local phone, and if so, the terminal B (mobile phone) is displayed in an equipment list, as shown in fig. 8. And clicking the equipment in the equipment list by the user, so that the point-to-point wifi p2p connection can be established with the equipment.
After the wifi p2p connection is established successfully for the first time, the ID of the equipment which is successfully connected for the last time can be recorded in the database.
And 2, establishing connection between the terminal A (computer) and the terminal B (mobile phone) for the non-first time.
If the 'subsequent automatic connection' is selected during the first connection, when the terminal A (computer) and the terminal B (mobile phone) approach to the Bluetooth discovery range, the Bluetooth search discovery is performed according to the mode in the operation 1. After discovering the device list and before displaying the device list, the terminal a may obtain the ID of the opposite device that has successfully connected for the last time from the database, and query the ID from the device list. And if the device ID exists in the device list, automatically carrying out wifi p2p connection (direct connection is successful). Otherwise, displaying the device list.
Section 2 relates primarily to the following:
operation 1, terminal B (mobile phone) triggers synchronization, uploads data information (corresponding to the text type data) and performs file pre-upload (corresponding to the data information).
Specifically, the terminal B (mobile phone) generates user data after the user performs actions such as memo editing, taking a picture, editing a document, receiving a picture and/or a video. The user data is divided into two types:
(1) Text type data: the data volume is small, and the transmission is fast. Such as notes, schedules, contacts, album directory structures, etc.
(2) File type data: the data volume is large and the transmission is slow. Such as a photo, video, etc. file type.
As shown in fig. 9, after each data generation, data synchronization (including dividing the data into the above two types for uploading) is triggered. Judging whether the terminal (namely the terminal B) is accessed to the Internet or not, and if so, uploading text type data to a server (corresponding to the cloud server); after the text type (data) is uploaded, the file of each file type data needs to be pre-uploaded, and the pre-uploading is used for uploading a small amount of summary information (corresponding to the data information) of the file in advance, so that other terminals can display icons and basic information (such as file size, file name, final modification time and the like) of the file on an interface under the condition that the specific content of the file is not uploaded or downloaded. The pre-upload content may include file summary information (corresponding to the above data information) such as a file name, a file size, a file type, a thumbnail, and the like, but does not include specific file content. Dividing the data to be synchronized into text type data and file type data correspondingly; according to the file type data, determining synchronous data and data information of the synchronous data; and uploading the data information of the text type data and the synchronous data to a cloud server.
The server analyzes the file summary information when the files are pre-uploaded, generates a GUID (globally unique identifier corresponding to the data identifier) for each file, and returns the GUID to the client terminal B (mobile phone). The GUID is a unique identifier of each file in the cloud server, and through the GUID, a certain file under a certain user (account) can be located, so that the GUID is used for binding the summary information pre-uploaded by the file with a file body and locating the file.
After receiving the GUID generated by the server, the terminal B (mobile phone) associates the GUID with the local file path (corresponding to the local storage path), and records the GUID in the database (local to the terminal B). At this point, the file pre-upload is complete. Receiving a data identifier sent by the cloud server according to the data information; and associating the data identification with a local storage path of the synchronous data, and storing. Operation 2, the terminal B (mobile phone) judges a local environment condition (corresponding to the first condition), and uploads a file (corresponding to the synchronization data) to the cloud server through the internet at an appropriate time;
specific examples thereof include: the terminal B (mobile phone) will regularly detect whether the following conditions are met:
(1) The electric quantity of the mobile phone is larger than a certain threshold (for example, the electric quantity is larger than 20%), or the mobile phone is in charging; corresponding to the residual capacity being greater than a first threshold value or in a charging state;
(2) At the moment, the system is in a wifi network environment instead of a data network; corresponding to the connection to the wireless network;
(3) At this time, the temperature of the mobile phone is lower than a certain threshold (for example, the temperature is lower than 45 ℃); corresponding to the temperature of the equipment being lower than a second threshold value;
(4) At the moment, the mobile terminal is not in a game scene or other scenes with higher network bandwidth requirements; corresponding to the required network bandwidth being below a third threshold.
After the at least one condition is met, the terminal B (mobile phone) starts to upload the specific file content (corresponding to the above-mentioned synchronization data) to the server, and meanwhile, the GUID of the file is taken, and the GUID of the file is allocated by the cloud server in the pre-upload process of the operation 1 in this section.
If the condition is not satisfied, the system enters a waiting state, and the timer triggers the next time to detect the condition again.
Section 3 relates primarily to the following:
and operation 1, downloading data to a cloud server through the Internet.
And the terminal A (computer) sends a request to the cloud server at regular time through the Internet, and detects data updating. And if the cloud data update exists, downloading new data. Specific examples thereof are: the terminal A sends a detection request to the cloud server, the cloud server feeds back a detection response to the terminal A under the condition that the cloud server determines that the cloud server is updated, the terminal A sends an update request to the cloud server according to the detection response, and the cloud server sends data to the terminal A according to the update request; sending an information synchronization request (carrying a data identifier) to a cloud server; and receiving data information of the synchronous data sent by the cloud server.
The "downloading new data" may include the following items:
(1) The text type data is downloaded.
(2) The file information (i.e., the above-mentioned file summary information) is downloaded, and a file icon is displayed based on the file information, as shown in fig. 10.
The file information may include a file size, a last modification date, a file name, a file type, and a thumbnail, and at this time, the terminal a (computer) interface may display a file icon according to the file information.
Operation 2, the terminal a (computer) downloads the specific content of the file according to the GUID in the file information, as shown in fig. 10. This may be triggered by a user or performed automatically, without limitation.
Before downloading the file (specific content), it may be determined whether a lan connection is made with the terminal B (mobile phone) (corresponding to the above determination of whether the first electronic device is connected to the second electronic device via the lan), and if a lan connection is not established, the operation 2 of the part 1 may be returned to, and an automatic connection is attempted. The local area network connection is specifically the wifi p2p connection.
(1) If the local area network is accessed, the file is automatically downloaded through the local area network, the file GUID is sent to the terminal B (mobile phone), and the file downloading is requested. Corresponding to the situation that the first electronic device is connected with the second electronic device through the local area network, sending a data synchronization request to the second electronic device through the local area network; and receiving the synchronous data sent by the second electronic equipment through the local area network.
(2) And if the mobile terminal does not enter the local area network, sending a file GUID to the cloud server through the Internet to request to download the file. Corresponding to the situation that the first electronic device is not connected with the second electronic device through the local area network, sending a data synchronization request (carrying a data identifier) to a cloud server; and receiving the synchronous data sent by the cloud server.
Operation 3. If during the downloading of the file (specific content), network switching is found, such as the following scenarios:
in the process of downloading the file by the local area network, the mobile phone is disconnected in the local area network, the breakpoint position (corresponding to the second breakpoint information) is recorded, and the internet cloud service is switched to try to continue downloading from the breakpoint. When the interruption of the target connection is detected in the process of receiving the synchronous data sent by the second electronic equipment through the local area network, recording second breakpoint information of the synchronous data; sending a data synchronization request (carrying a data identifier) to a cloud server according to the second breakpoint information; and receiving the synchronous data which is sent by the cloud server and starts from the second breakpoint.
If the mobile phone is accessed to the local area network in the process of downloading the file through the Internet, after the connection is automatically found through the operation 2 of the part 1, the Internet downloading is suspended, and the breakpoint (corresponding to the first breakpoint information) is recorded. And switching to the local area network to continue downloading from the breakpoint, so as to accelerate the downloading speed. In the process of receiving the synchronous data sent by the cloud server, when the first electronic device is detected to be connected with the second electronic device through the local area network, the receiving of the synchronous data is suspended, and first breakpoint information of the synchronous data is recorded; 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; and receiving the synchronous data which is sent by the second electronic equipment through the local area network and starts from the first breakpoint.
And operation 4, in the file downloading process, the user opens the file and prompts the user to open the file only after the downloading is finished.
The above description is not limited to the execution in the above order, and is not limited herein.
From the above, the scheme provided by this example has the following effects:
1. the specific content of the large file (namely the file type data) is transmitted through the local area network, and compared with the transmission by using the internet, the method has the advantages of being more stable and faster in transmission speed.
2. The terminal B (mobile phone) can delay uploading of specific file contents and delay uploading after the requirements of electric quantity, power consumption, data network flow and user use scenes are met; the effects of power saving and temperature control are achieved.
3. If the local area network conditions are met (namely, the files are connected through the local area network), the terminal A (computer) can immediately download the files from the terminal B (mobile phone), and the time for uploading the files to the cloud service by the terminal B (mobile phone) and the time for delaying uploading are not required to be waited.
4. Under the condition of local area network transmission, the scheme improves the synchronization speed of the large file data and also improves the real-time property of the synchronization of the large file data.
5. When the terminal of the user is not in the same router or local area network environment, the wifi p2p and the low-power Bluetooth can be used for discovering and connecting the equipment, and after the connection is successful, the equipment is in the same local area network, so that data transmission is carried out through the local area network.
In this description, the present solution:
1. the terminal A (computer) and the terminal B (mobile phone) can establish connection through a router or a mobile hotspot or directly establish wifi p2p connection, thereby forming the same local area network.
2. After a terminal A (computer) and a terminal B (mobile phone) user are connected and authorized through a local area network for the first time, the two devices can be automatically connected and automatically synchronized as long as the two devices are in the same local area network.
In conclusion, the scheme directly downloads the corresponding file content (corresponding to the synchronous data) through the connection of the local area network, and can greatly accelerate the data synchronization speed.
It should be noted that, in the data synchronization method provided in the embodiment of the present application, the execution main body may be a data synchronization apparatus, or a control module in the data synchronization apparatus for executing the data synchronization method. In the embodiment of the present application, a data synchronization method performed by a data synchronization apparatus is taken as an example, and the data synchronization apparatus provided in the embodiment of the present application is described.
The data synchronization apparatus provided in the embodiment of the present application is applied to a first electronic device, as shown in fig. 11, and includes:
a first sending module 111, configured to send a data synchronization request to a second electronic device through a local area network when the first electronic device is connected to the second electronic device through the local area network;
a first receiving module 112, configured to 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 identification is obtained according to data information of the synchronous data acquired from the cloud server.
In the embodiment of the application, a data synchronization request is sent to a second electronic device through a local area network under the condition that the first electronic device is connected with the second electronic device through the local area network; receiving synchronous data sent by the second electronic equipment through the local area network; wherein the data synchronization request carries a data identifier; the data identification is obtained according to data information of the synchronous data acquired from the cloud server; the data can be transmitted by using the local area network, the data synchronization speed can be increased, and the problem of low synchronization speed of a data synchronization scheme in the prior art is solved.
The networking mode of the local area network comprises at least one of the following: a first networking mode of connecting through network hotspot equipment; and a second networking mode of directly connecting the equipment.
Further, the data synchronization apparatus further includes: the second sending module is used for sending a data synchronization request to the cloud server under the condition that the first electronic equipment is not connected with the second electronic equipment through the local area network; wherein the data synchronization request carries the data identifier; and the second receiving module is used for receiving the synchronous data sent by the cloud server.
In an embodiment of the present application, the data synchronization apparatus further includes: the first processing module is used for suspending receiving the synchronous data and recording first breakpoint information of the synchronous data when detecting that the first electronic equipment is connected with the second electronic equipment through a local area network in the process of receiving the synchronous data sent by the cloud server; a third sending module, configured to send a data synchronization request to the second electronic device through the local area network according to the first breakpoint information; a third receiving module, configured to receive synchronization data, which is sent by the second electronic device through the local area network and starts from the first breakpoint; wherein the first breakpoint corresponds to the first breakpoint information.
Further, the data synchronization apparatus further includes: the fourth sending module is used for sending an information synchronization request to the cloud server before sending a data synchronization request to the second electronic device through the local area network; the fourth receiving module is used for receiving data information of the synchronous data sent by the cloud server; the sending of the data synchronization request to the second electronic device through the local area network includes: and sending a data synchronization request to the second electronic equipment through the local area network according to the data identifier in the data information.
In this embodiment of the present application, the data synchronization apparatus further includes: the second processing module is used for recording second breakpoint information of the synchronous data when the interruption of target connection is detected in the process of receiving the synchronous data sent by the second electronic equipment through the local area network; a fifth sending module, configured to send a data synchronization request to a cloud server according to the second breakpoint information; a fifth receiving module, configured to receive synchronization data that is sent by the cloud server and starts from a 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 corresponds to the second breakpoint information.
The data synchronization device in the embodiment of the present application may be a device, or may be a component, an integrated circuit, or a chip in a terminal. The device can be mobile electronic equipment or non-mobile electronic equipment. By way of example, the mobile electronic device may be a mobile phone, a tablet computer, a notebook computer, a palm top computer, a vehicle-mounted electronic device, a wearable device, an ultra-mobile personal computer (UMPC), a netbook or a Personal Digital Assistant (PDA), and the like, and the non-mobile electronic device may be a server, a Network Attached Storage (NAS), a Personal Computer (PC), a Television (TV), a teller machine or a self-service machine, and the like, and the embodiments of the present application are not particularly limited.
The data synchronization apparatus in the embodiment of the present application may be an apparatus having an operating system. The operating system may be an Android (Android) operating system, an ios operating system, or other possible operating systems, and embodiments of the present application are not limited specifically.
The data synchronization apparatus provided in the embodiment of the present application can implement each process implemented by the method embodiments of fig. 1 and fig. 3 to fig. 10, and is not described here again to avoid repetition.
An embodiment of the present application further provides a data synchronization apparatus, which is applied to a second electronic device, as shown in fig. 12, and includes:
a sixth receiving module 121, configured to receive, through a local area network, a data synchronization request sent by a first electronic device when the second electronic device is connected to the first electronic device through the local area network;
a first obtaining module 122, configured to obtain synchronous data according to a data identifier in the data synchronization request;
a sixth sending module 123, 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 according to data information of the synchronous data acquired from the cloud server.
In the embodiment of the application, a data synchronization request sent by a first electronic device is received through a local area network under the condition that a second electronic device is connected with the first electronic device through the local area network; acquiring synchronous data according to the data identification in the data synchronous request; sending the synchronization data to the first electronic device through the local area network; the data identification is obtained by the first electronic equipment according to data information of synchronous data acquired from a cloud server; the data can be transmitted by using the local area network, the data synchronization speed can be increased, and the problem of low synchronization speed of a data synchronization scheme in the prior art is solved.
Wherein the networking mode of the local area network comprises at least one of the following: a first networking mode of connecting through network hotspot equipment; and a second networking mode of directly connecting the devices.
In the embodiment of the application, the data synchronization request also carries first breakpoint information; the acquiring synchronous data according to the data identifier in the data synchronization request includes: acquiring synchronous data starting from a first breakpoint according to the data identifier and the first breakpoint information in the data synchronization request; wherein the first breakpoint corresponds to the first breakpoint information; the first breakpoint information is recorded when the first electronic device detects that the first electronic device is connected with the second electronic device through a local area network in a process of receiving synchronous data sent by a cloud server.
Further, the data synchronization apparatus further includes: the first uploading module is used for uploading the synchronous data to a cloud server under a first condition before receiving a data synchronization request sent by the first electronic device; wherein the first condition comprises at least one of: the residual capacity is larger than a first threshold value or in a charging state; connecting to a wireless network; the device temperature is below a second threshold; the required network bandwidth is below a third threshold.
In this embodiment of the present application, the data synchronization apparatus further includes: and the second uploading module is used for uploading the data information of the synchronous data to the cloud server before uploading the synchronous data to the cloud server.
Further, the data synchronization apparatus further includes: the third processing module is used for dividing 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; the first determining module is used for determining synchronous data and data information of the synchronous data according to the file type data; the uploading of the data information of the synchronization data to a cloud server includes: and uploading the data information of the text type data and the synchronous data to a cloud server.
In this embodiment of the present application, the data synchronization apparatus further includes: a seventh receiving module, configured to receive a data identifier sent by the cloud server according to the data information after uploading the data information of the text type data and the synchronization data to the cloud server; and the fourth processing module is used for associating and storing the data identification with the local storage path of the synchronous data.
The data synchronization device in the embodiment of the present application may be a device, or may be a component, an integrated circuit, or a chip in a terminal. The device can be mobile electronic equipment or non-mobile electronic equipment. By way of example, the mobile electronic device may be a mobile phone, a tablet computer, a notebook computer, a palm top computer, a vehicle-mounted electronic device, a wearable device, an ultra-mobile personal computer (UMPC), a netbook or a Personal Digital Assistant (PDA), and the like, and the non-mobile electronic device may be a server, a Network Attached Storage (NAS), a Personal Computer (PC), a Television (TV), a teller machine or a self-service machine, and the like, and the embodiments of the present application are not particularly limited.
The data synchronization apparatus in the embodiment of the present application may be an apparatus having an operating system. The operating system may be an Android (Android) operating system, an ios operating system, or other possible operating systems, and embodiments of the present application are not limited specifically.
The data synchronization apparatus provided in the embodiment of the present application can implement each process implemented in the method embodiments of fig. 2 to fig. 10, and is not described here again to avoid repetition.
Optionally, as shown in fig. 13, an electronic device 130 is further provided in this embodiment of the present application, and includes a processor 131, a memory 132, and a program or an instruction stored in the memory 132 and executable on the processor 131, where the program or the instruction is executed by the processor 131 to implement each process of the above-mentioned first electronic device side or second electronic device side data synchronization method embodiment, and can achieve the same technical effect, and no further description is provided here to avoid repetition.
It should be noted that the electronic device in the embodiment of the present application includes the mobile electronic device and the non-mobile electronic device described above.
Fig. 14 is a schematic hardware structure diagram of an electronic device implementing an embodiment of the present application.
The electronic device 140 includes, but is not limited to: a radio frequency unit 141, a network module 142, an audio output unit 143, an input unit 144, a sensor 145, a display unit 146, a user input unit 147, an interface unit 148, a memory 149, and a processor 1410.
Those skilled in the art will appreciate that the electronic device 140 may further comprise a power source (e.g., a battery) for supplying power to various components, and the power source may be logically connected to the processor 1410 via a power management system, so as to implement functions of managing charging, discharging, and power consumption via the power management system. The electronic device structure shown in fig. 14 does not constitute a limitation of the electronic device, and the electronic device may include more or less components than those shown, or combine some components, or arrange different components, and thus, the description is not repeated here.
The processor 1410 is configured to, when the first electronic device is connected to a second electronic device through a local area network, send a data synchronization request to the second electronic device through the local area network by using the radio frequency unit 141; receiving, by using the radio frequency unit 141, 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 identification is obtained according to data information of the synchronous data acquired from the cloud server.
In the embodiment of the application, a data synchronization request is sent to a second electronic device through a local area network under the condition that the first electronic device is connected with the second electronic device through the local area network; receiving synchronous data sent by the second electronic equipment through the local area network; wherein the data synchronization request carries a data identifier; the data identification is obtained according to data information of the synchronous data acquired from the cloud server; the method and the device can realize the data transmission by using the local area network, increase the data synchronization speed and solve the problem of low synchronization speed of a data synchronization scheme in the prior art.
Optionally, the networking mode of the local area network includes at least one of: a first networking mode of connecting through network hotspot equipment; and a second networking mode of directly connecting the devices.
Optionally, the processor 1410 is further configured to send a data synchronization request to a cloud server through the radio frequency unit 141 when the first electronic device is not connected to a second electronic device through a local area network; wherein the data synchronization request carries the data identifier; the synchronization data sent by the cloud server is received through the radio frequency unit 141.
Optionally, the processor 1410 is further configured to, in a process of receiving the synchronization data sent by the cloud server, suspend receiving the synchronization data when it is detected that the first electronic device is connected to the second electronic device through the local area network, and record first breakpoint information of the synchronization data; according to the first breakpoint information, a data synchronization request is sent to the second electronic device through the local area network by using the radio frequency unit 141; receiving, by using the radio frequency unit 141, synchronization data sent by the second electronic device through the local area network, starting from the first breakpoint; wherein the first breakpoint corresponds to the first breakpoint information.
Optionally, the processor 1410 is further 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; receiving data information of the synchronization data sent by the cloud server through a radio frequency unit 141; the sending of the data synchronization request to the second electronic device through the local area network includes: and sending a data synchronization request to the second electronic equipment through the local area network according to the data identification in the data information.
Optionally, the processor 1410 is further configured to record second breakpoint information of the synchronization data when a target connection is detected to be interrupted in a process of receiving the synchronization data sent by the second electronic device through the local area network; according to the second breakpoint information, a data synchronization request is sent to a cloud server by using the radio frequency unit 141; receiving, by using the radio frequency unit 141, the synchronization data sent by the cloud server 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 corresponds to the second breakpoint information.
The scheme directly downloads corresponding file contents (corresponding to the synchronous data) through local area network connection, and can greatly accelerate the data synchronization speed.
It should be understood that, in the embodiment of the present application, the input Unit 144 may include a Graphics Processing Unit (GPU) 1441 and a microphone 1442, and the Graphics Processing Unit 1441 processes image data of still pictures or videos obtained by an image capturing device (such as a camera) in a video capturing mode or an image capturing mode. The display unit 146 may include a display panel 1461, and the display panel 1461 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. A touch panel 1471, also referred to as a touch screen. The touch panel 1471 may include two parts of a touch detection device and a touch controller. Other input devices 1472 may include, but are not limited to, a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which are not described in detail herein. The memory 149 may be used to store software programs as well as various data including, but not limited to, application programs and an operating system. The processor 1410 may integrate an application processor, which mainly handles operating systems, user interfaces, application programs, etc., and a modem processor, which mainly handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into processor 1410.
Fig. 15 is a schematic hardware structure diagram of an electronic device implementing an embodiment of the present application.
The electronic device 150 includes, but is not limited to: a radio frequency unit 151, a network module 152, an audio output unit 153, an input unit 154, a sensor 155, a display unit 156, a user input unit 157, an interface unit 158, a memory 159, and a processor 1510.
Those skilled in the art will appreciate that the electronic device 150 may further include a power source (e.g., a battery) for supplying power to various components, and the power source may be logically connected to the processor 1510 via a power management system, so as to implement functions of managing charging, discharging, and power consumption via the power management system. The electronic device structure shown in fig. 15 does not constitute a limitation of the electronic device, and the electronic device may include more or less components than those shown, or combine some components, or arrange different components, and thus, the description is omitted here.
The processor 1510 is configured to receive, through the local area network and the radio frequency unit 151, a data synchronization request sent by a first electronic device when the second electronic device is connected to the first electronic device through the local area network; acquiring synchronous data according to the data identification in the data synchronization request; transmitting the synchronization data to the first electronic device through the local area network by using the radio frequency unit 151; the data identification is obtained by the first electronic device according to data information of the synchronous data acquired from the cloud server.
In the embodiment of the application, a data synchronization request sent by a first electronic device is received through a local area network under the condition that a second electronic device is connected with the first electronic device through the local area network; acquiring synchronous data according to the data identification in the data synchronous request; sending the synchronization data to the first electronic device through the local area network; the data identification is obtained by the first electronic equipment according to data information of synchronous data acquired from a cloud server; the data can be transmitted by using the local area network, the data synchronization speed can be increased, and the problem of low synchronization speed of a data synchronization scheme in the prior art is solved.
Optionally, the networking mode of the local area network includes at least one of: a first networking mode of connecting through network hotspot equipment; and a second networking mode of directly connecting the devices.
Optionally, the data synchronization request further carries first breakpoint information; the acquiring synchronous data according to the data identifier in the data synchronization request includes: acquiring synchronous data starting from a first breakpoint according to the data identifier and the first breakpoint information in the data synchronization request; wherein the first breakpoint corresponds to the first breakpoint information; the first breakpoint information is recorded when the first electronic device detects that the first electronic device is connected with the second electronic device through a local area network in a process of receiving synchronous data sent by a cloud server.
Optionally, the processor 1510 is further configured to, before receiving a data synchronization request sent by the first electronic device, upload the synchronization data to a cloud server through the radio frequency unit 151 under a first condition; wherein the first condition comprises at least one of: the residual capacity is larger than a first threshold value or in a charging state; connecting to a wireless network; the device temperature is below a second threshold; the required network bandwidth is below a third threshold.
Optionally, the processor 1510 is further configured to upload data information of the synchronization data to a cloud server through the radio frequency unit 151 before uploading the synchronization data to the cloud server.
Optionally, the processor 1510 is further configured to divide data to be synchronized into text type data and file type data before uploading data information of the synchronized data to a cloud server; according to the file type data, determining synchronous data and data information of the synchronous data; the uploading of the data information of the synchronization data to a cloud server includes: and uploading the data information of the text type data and the synchronous data to a cloud server.
Optionally, the processor 1510 is further configured to receive, through the radio frequency unit 151, a data identifier sent by the cloud server according to the data information after uploading the data information of the text type data and the synchronization data to the cloud server; and associating the data identification with a local storage path of the synchronous data, and storing.
The scheme directly downloads corresponding file contents (corresponding to the synchronous data) through local area network connection, and can greatly accelerate the data synchronization speed.
It should be understood that, in the embodiment of the present application, the input Unit 154 may include a Graphics Processing Unit (GPU) 1541 and a microphone 1542, and the Graphics Processing Unit 1541 processes image data of a still picture or a video obtained by an image capturing device (such as a camera) in a video capturing mode or an image capturing mode. The display unit 156 may include a display panel 1561, and the display panel 1561 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, also referred to as a touch screen. Touch panel 1571 may include two portions, a touch detection device and a touch controller. Other input devices 1572 may include, but are not limited to, a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which will not be described in detail herein. The memory 159 may be used to store software programs as well as various data including, but not limited to, application programs and an operating system. The processor 1510 may integrate an application processor, which mainly handles operating systems, user interfaces, application programs, etc., and a modem processor, which mainly handles wireless communication. It will be appreciated that the modem processor described above may not be integrated into the processor 1510.
The embodiment of the present application further provides a readable storage medium, where a program or an instruction is stored on the readable storage medium, and when the program or the instruction is executed by a processor, the program or the instruction implements each process of the above-mentioned first electronic device side or second electronic device side data synchronization method embodiment, and can achieve the same technical effect, and in order to avoid repetition, details are not repeated here.
The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and so on.
The embodiment of the present application further provides a chip, where the chip includes a processor and a communication interface, the communication interface is coupled to the processor, and the processor is configured to execute a program or an instruction to implement each process of the above-mentioned first electronic device side or second electronic device side data synchronization method embodiment, and can achieve the same technical effect, and in order to avoid repetition, the description is omitted here.
It should be understood that the chips mentioned in the embodiments of the present application may also be referred to as system-on-chip, system-on-chip or system-on-chip, etc.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising a … …" does not exclude the presence of another identical element in a process, method, article, or apparatus that comprises the element. Further, it should be noted that the scope of the methods and apparatus of the embodiments of the present application is not limited to performing the functions in the order illustrated or discussed, but may include performing the functions in a substantially simultaneous manner or in a reverse order based on the functions involved, e.g., the methods described may be performed in an order different than that described, and various steps may be added, omitted, or combined. In addition, features described with reference to certain examples may be combined in other examples.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present application may be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal (such as a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present application.
While the present embodiments have been described with reference to the accompanying drawings, it is to be understood that the invention is not limited to the precise embodiments described above, which are meant to be illustrative and not restrictive, and that various changes may be made therein by those skilled in the art without departing from the spirit and scope of the invention as defined by the appended claims.

Claims (17)

1. A data synchronization method is applied to first electronic equipment, and is characterized by comprising the following steps:
under the condition that the first electronic equipment is connected with second electronic equipment through a local area network, sending a data synchronization request to the second electronic equipment through the local area network;
receiving synchronous data sent by the second electronic equipment through the local area network;
wherein the data synchronization request carries a data identifier; the data identification is obtained according to data information of the synchronous data acquired from the cloud server.
2. The data synchronization method according to claim 1, wherein the networking mode of the local area network comprises at least one of the following:
a first networking mode of connecting through network hotspot equipment;
and a second networking mode of directly connecting the devices.
3. The data synchronization method of claim 1, further comprising:
sending a data synchronization request to a cloud server under the condition that the first electronic equipment is not connected with second electronic equipment through a local area network; wherein the data synchronization request carries the data identifier;
and receiving the synchronous data sent by the cloud server.
4. The data synchronization method of claim 3, further comprising:
in the process of receiving the synchronous data sent by the cloud server, under the condition that the first electronic equipment is detected to be connected with the second electronic equipment through a local area network, the synchronous data is suspended from being received, and first breakpoint information of the synchronous data is recorded;
sending a data synchronization request to the second electronic equipment through the local area network according to the first breakpoint information;
receiving synchronous data which is sent by the second electronic equipment through the local area network and starts from a first breakpoint;
wherein the first breakpoint corresponds to the first breakpoint information.
5. The data synchronization method of claim 1, before sending a data synchronization request to the second electronic device through the local area network, further comprising:
sending an information synchronization request to a cloud server;
receiving data information of the synchronous data sent by the cloud server;
the sending of the data synchronization request to the second electronic device through the local area network includes:
and sending a data synchronization request to the second electronic equipment through the local area network according to the data identifier in the data information.
6. The data synchronization method of claim 1, further comprising:
in the process of receiving the synchronous data sent by the second electronic device through the local area network, recording second breakpoint information of the synchronous data when the interruption of target connection is detected;
sending a data synchronization request to a cloud server according to the second breakpoint information;
receiving synchronous data which is sent by the cloud server and starts from a 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 corresponds to the second breakpoint information.
7. A data synchronization method applied to a second electronic device is characterized by comprising the following steps:
under the condition that the second electronic equipment is connected with the first electronic equipment through a local area network, receiving a data synchronization request sent by the first electronic equipment through the local area network;
acquiring synchronous data according to the data identification in the data synchronous request;
sending the synchronization data to the first electronic device through the local area network;
the data identification is obtained by the first electronic device according to data information of the synchronous data acquired from the cloud server.
8. The data synchronization method according to claim 7, wherein the networking mode of the local area network comprises at least one of the following:
a first networking mode of connecting through network hotspot equipment;
and a second networking mode of directly connecting the devices.
9. The data synchronization method according to claim 7, wherein the data synchronization request further carries first breakpoint information;
the acquiring synchronous data according to the data identifier in the data synchronization request includes:
acquiring synchronous data starting from a first breakpoint according to the data identifier and the first breakpoint information in the data synchronization request;
wherein the first breakpoint corresponds to the first breakpoint information;
the first breakpoint information is recorded when the first electronic device detects that the first electronic device is connected with the second electronic device through a local area network in a process of receiving synchronous data sent by a cloud server.
10. The data synchronization method according to claim 7, further comprising, before receiving the data synchronization request sent by the first electronic device:
under a first condition, uploading the synchronous data to a cloud server;
wherein the first condition comprises at least one of:
the residual capacity is larger than a first threshold value or in a charging state;
connecting to a wireless network;
the device temperature is below a second threshold;
the required network bandwidth is below a third threshold.
11. The data synchronization method according to claim 10, further comprising, before uploading the synchronized data to a cloud server:
and uploading the data information of the synchronous data to a cloud server.
12. The data synchronization method according to claim 11, before uploading the data information of the synchronized data to a cloud server, further comprising:
dividing data to be synchronized into text type data and file type data;
according to the file type data, determining synchronous data and data information of the synchronous data;
the uploading of the data information of the synchronization data to a cloud server includes:
and uploading the data information of the text type data and the synchronous data to a cloud server.
13. The data synchronization method according to claim 12, further comprising, after uploading the data information of the text type data and the synchronization data to a cloud server:
receiving a data identifier sent by the cloud server according to the data information;
and associating the data identification with a local storage path of the synchronous data, and storing.
14. A data synchronization device applied to a first electronic device, comprising:
the first sending module is used for sending a data synchronization request to the second electronic equipment through the local area network under the condition that the first electronic equipment is connected with the second electronic equipment through the local area network;
the first receiving module is used for receiving the synchronous data sent by the second electronic equipment through the local area network;
wherein the data synchronization request carries a data identifier; the data identification is obtained according to data information of the synchronous data acquired from the cloud server.
15. A data synchronization device applied to a second electronic device, comprising:
a sixth receiving module, configured to receive, through a local area network, a data synchronization request sent by a first electronic device when the second electronic device is connected to the first electronic device through the local area network;
the first acquisition module is used for acquiring synchronous data according to the data identification 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 according to data information of the synchronous data acquired from the cloud server.
16. An electronic device comprising a processor, a memory, and a program or instructions stored on the memory and executable on the processor, the program or instructions when executed by the processor implementing the steps of the data synchronization method of any of claims 1-6; alternatively, the first and second electrodes may be,
the program or instructions, when executed by the processor, implement the steps of the data synchronization method of any of claims 7-13.
17. A readable storage medium, characterized in that it stores thereon a program or instructions which, when executed by a processor, implement the steps of the data synchronization method according to any one of claims 1-6; alternatively, the first and second electrodes may be,
the program or instructions, when executed by a processor, implement the steps of the data synchronization method of any of claims 7-13.
CN202210849782.0A 2022-07-19 2022-07-19 Data synchronization method and device and electronic equipment Pending CN115225649A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202210849782.0A CN115225649A (en) 2022-07-19 2022-07-19 Data synchronization method and device and electronic equipment
PCT/CN2023/106956 WO2024017113A1 (en) 2022-07-19 2023-07-12 Data synchronization method and apparatus, and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210849782.0A CN115225649A (en) 2022-07-19 2022-07-19 Data synchronization method and device and electronic equipment

Publications (1)

Publication Number Publication Date
CN115225649A true CN115225649A (en) 2022-10-21

Family

ID=83611233

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210849782.0A Pending CN115225649A (en) 2022-07-19 2022-07-19 Data synchronization method and device and electronic equipment

Country Status (2)

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

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2024017113A1 (en) * 2022-07-19 2024-01-25 维沃移动通信有限公司 Data synchronization method and apparatus, and electronic device

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103095755A (en) * 2011-10-31 2013-05-08 联想(北京)有限公司 Data synchronism method and electronic equipment
US20140229436A1 (en) * 2013-02-08 2014-08-14 Wistron Corporation Method of File Synchronization and Electronic Device Thereof
WO2018049897A1 (en) * 2016-09-14 2018-03-22 广东欧珀移动通信有限公司 Data backup method and device
CN109271442A (en) * 2018-07-27 2019-01-25 东软集团股份有限公司 Database synchronization restoration methods, device, computer readable storage medium and electronic equipment
CN110866465A (en) * 2019-10-29 2020-03-06 维沃移动通信有限公司 Control method of electronic equipment and electronic equipment
CN110933150A (en) * 2019-11-18 2020-03-27 拉扎斯网络科技(上海)有限公司 Data synchronization method, system, device, electronic equipment and computer storage medium
WO2020237858A1 (en) * 2019-05-29 2020-12-03 平安科技(深圳)有限公司 Breakpoint data transmission method, apparatus, device, and non-volatile storage medium
CN112052230A (en) * 2020-09-02 2020-12-08 掌阅科技股份有限公司 Multi-machine room data synchronization method, computing equipment and storage medium
CN112905209A (en) * 2021-03-23 2021-06-04 维沃移动通信(深圳)有限公司 Application program updating method and device
CN113840003A (en) * 2021-09-24 2021-12-24 维沃移动通信有限公司 Synchronization method and device
WO2022012659A1 (en) * 2020-07-17 2022-01-20 维沃移动通信有限公司 Login method and apparatus, and electronic device

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104023334B (en) * 2014-05-19 2019-10-29 联想(北京)有限公司 A kind of information processing method and electronic equipment
US20210218725A1 (en) * 2018-09-03 2021-07-15 Huawei Technologies Co., Ltd. Login Method, Token Sending Method, and Device
CN113365274B (en) * 2021-06-10 2023-11-14 荣耀终端有限公司 Network access method and electronic equipment
CN115225649A (en) * 2022-07-19 2022-10-21 维沃移动通信有限公司 Data synchronization method and device and electronic equipment

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103095755A (en) * 2011-10-31 2013-05-08 联想(北京)有限公司 Data synchronism method and electronic equipment
US20140229436A1 (en) * 2013-02-08 2014-08-14 Wistron Corporation Method of File Synchronization and Electronic Device Thereof
WO2018049897A1 (en) * 2016-09-14 2018-03-22 广东欧珀移动通信有限公司 Data backup method and device
CN109271442A (en) * 2018-07-27 2019-01-25 东软集团股份有限公司 Database synchronization restoration methods, device, computer readable storage medium and electronic equipment
WO2020237858A1 (en) * 2019-05-29 2020-12-03 平安科技(深圳)有限公司 Breakpoint data transmission method, apparatus, device, and non-volatile storage medium
CN110866465A (en) * 2019-10-29 2020-03-06 维沃移动通信有限公司 Control method of electronic equipment and electronic equipment
CN110933150A (en) * 2019-11-18 2020-03-27 拉扎斯网络科技(上海)有限公司 Data synchronization method, system, device, electronic equipment and computer storage medium
WO2022012659A1 (en) * 2020-07-17 2022-01-20 维沃移动通信有限公司 Login method and apparatus, and electronic device
CN112052230A (en) * 2020-09-02 2020-12-08 掌阅科技股份有限公司 Multi-machine room data synchronization method, computing equipment and storage medium
CN112905209A (en) * 2021-03-23 2021-06-04 维沃移动通信(深圳)有限公司 Application program updating method and device
CN113840003A (en) * 2021-09-24 2021-12-24 维沃移动通信有限公司 Synchronization method and device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
梁凝;单晓强;孙叠;: "数据库同步技术的研究", 工业控制计算机, no. 07, 25 July 2017 (2017-07-25) *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2024017113A1 (en) * 2022-07-19 2024-01-25 维沃移动通信有限公司 Data synchronization method and apparatus, and electronic device

Also Published As

Publication number Publication date
WO2024017113A1 (en) 2024-01-25

Similar Documents

Publication Publication Date Title
RU2638737C2 (en) Multimedia information display method and device
JP6101861B2 (en) Group creation method, group withdrawal method, apparatus, program, and recording medium
CN112350981B (en) Method, device and system for switching communication protocol
CN106302996B (en) Message display method and device
CN112039929B (en) File editing method and device and electronic equipment
WO2022089568A1 (en) File sharing method and apparatus, and electronic device
CN104462570B (en) Web page contents acquisition methods and device
CN113014972B (en) Screen projection method, device and system
CN105323628B (en) Cross-screen playing method and system based on DLNA (digital Living network alliance), browser end device and playing device
WO2022001898A1 (en) Message sending method, message sending apparatus, and electronic device
US20220038405A1 (en) Method and apparatus for updating group member data, and terminal, system and storage medium
US11523146B2 (en) Live broadcast method and apparatus, electronic device, and storage medium
EP4084482A1 (en) Stream pull method and device for live stream
WO2024017113A1 (en) Data synchronization method and apparatus, and electronic device
CN104158854B (en) Resource share method and device
CN113162956A (en) Method, device and network equipment for establishing communication connection
CN111741352A (en) Screen projection control method, screen projection playing method and related device
JP2016524767A (en) Instant message management method, apparatus, program, and recording medium
CN111615694B (en) Method for selecting server node and terminal equipment
CN104349202B (en) Video acquiring method and device
KR101522728B1 (en) Data transmission method and device based on slide detection
CN109729402B (en) Media content synchronization method, device and storage medium
WO2023125856A1 (en) Method and apparatus for monitoring and reporting ursp rules, terminal, and network element
CN113613348B (en) Connection establishment method, device, electronic equipment and storage medium
CN112770185B (en) Method and device for processing Sprite map, electronic equipment and storage medium

Legal Events

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