Data synchronization method, electronic device, and system
By distinguishing between procedural data and persistent data, and employing a combination of end-to-end synchronization and end-to-cloud synchronization, the timeliness and stability issues of data synchronization in distributed communication systems are resolved, thereby improving the user experience.
Patent Information
- Application Number
- CN202311162897.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-06
- Publication Date
- 2025-11-07
- Estimated Expiration
- 2043-09-06
AI Technical Summary
In distributed communication systems, when electronic devices synchronize data via end-to-cloud synchronization, it is difficult to guarantee the timeliness and stability of data synchronization, which affects the user experience.
Electronic devices distinguish between procedural data and persistent data, and process them separately through end-to-end synchronization and end-to-cloud synchronization. The appropriate synchronization method is selected according to the data type to ensure the timeliness and stability of data synchronization.
It achieves both timely data synchronization and improved data synchronization stability, avoiding data synchronization anomalies and conflicts, thus enhancing the user experience.
Smart Images

Figure CN119583567B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of terminal, and particularly relates to a data synchronization method, an electronic device and a system. BACKGROUND
[0002] With the development of terminal technology, electronic devices can establish connections with various types of other electronic devices to form a distributed communication system. In the distributed communication system, electronic devices can realize data synchronization with other devices to ensure the consistency of multi-terminal electronic device data.
[0003] For example, during the running of a note application, a mobile phone updates the note application content in response to the editing operation of a user. Then, the mobile phone sends the updated note content to a tablet through a cloud server by means of terminal-cloud synchronization. In this way, after the tablet starts the note application in response to the user operation, the displayed note content is the latest note content edited by the user on the mobile phone, which is convenient for the user to use.
[0004] However, in the above process, the data synchronization between different electronic devices through terminal-cloud synchronization is difficult to ensure the timeliness of data synchronization, which affects the user experience. SUMMARY
[0005] To solve the above technical problems, the present application provides a data synchronization method, an electronic device and a system. According to the technical scheme provided by the present application, after the electronic device generates the to-be-synchronized data, the process data and the persistent data are synchronized separately according to the data type of the to-be-synchronized data, so as to ensure the stability of data synchronization while ensuring the timeliness of data synchronization.
[0006] To achieve the above technical purposes, the present application provides the following technical scheme:
[0007] In a first aspect, a data synchronization method is provided, applied to a first electronic device. The method comprises: displaying an interface of a first application. Receiving a first operation of the first application by a user, obtaining first data and second data of the first application generated by the first operation, the first data being data not saved to a storage module of the first electronic device, and the second data being data already saved to the storage module. Sending the first data to a second electronic device, and sending the second data to a cloud server.
[0008] In some examples, the data types include, for example, procedural data and persistent data. In this case, the first electronic device can distinguish the procedural data and the persistent data according to whether the generated data is saved to the storage module. For example, the data in the storage module is the persistent data after the first electronic device saves the generated data to the storage module; and the data not saved to the storage module is the procedural data. In some examples, the storage module is a storage medium capable of storing data. For example, the storage module is a read-only memory (ROM), such as a hard disk, a mechanical hard disk, a solid state disk, a magnetic disk, and the like.
[0009] In this way, the first electronic device and the second electronic device can flexibly realize data synchronization between different devices through various data synchronization modes, such as end-to-end synchronization of the procedural data and cloud synchronization of the persistent data, according to the data types. The timeliness and stability of data synchronization are ensured.
[0010] According to the first aspect, the first data is sent to the second electronic device by a short-distance communication mode, and the short-distance communication mode includes at least one of a Bluetooth point-to-point (P2P) communication mode, a wireless fidelity (Wi-Fi) P2P communication mode, and a local area network communication mode.
[0011] In this way, after the first electronic device obtains the procedural data (i.e., the first data), the first electronic device directly sends the procedural data to the second electronic device. The efficiency of data synchronization is improved through end-to-end synchronization.
[0012] According to the first aspect or any one of the implementations of the first aspect, the method further includes receiving a second operation of the first application by a user, obtaining fourth data of the first application generated by the second operation, and the fourth data being data that has been saved to the storage module. The fourth data is sent to the second electronic device under a preset condition, and the preset condition includes one or more of the following: failure to send the fourth data to the cloud server, the cloud synchronization function not being enabled, the cloud space being insufficient, and the priority of the end-to-end synchronization being higher than the priority of the end-to-cloud synchronization.
[0013] In this way, the first electronic device and the second electronic device synchronize the persistent data through end-to-end synchronization on demand, so that the data synchronization exception caused by the failure to perform end-to-cloud synchronization is avoided, and the use of the user is affected.
[0014] In addition, in some scenarios, end-to-end synchronization can obtain better data synchronization benefits, and therefore the first electronic device can directly select to synchronize the persistent data through end-to-end synchronization. For example, the first electronic device determines that the efficiency of the end-to-end synchronization is higher than the efficiency of the end-to-cloud synchronization according to the current network state and other factors, and the first electronic device can send all data (including the procedural data and the persistent data) to the second electronic device through end-to-end synchronization.
[0015] According to a first aspect, or any possible implementation mode of the above first aspect, the method further includes: receiving a third operation of the first application by the user, obtaining seventh data of the first application generated by the third operation, the seventh data being data that has been saved to the storage module, and a data amount of the seventh data being greater than a preset threshold. Under a preset condition, sending first information of the seventh data to the second electronic device, the first information including a storage address of the seventh data and / or thumbnail information.
[0016] For example, in the process of on-demand end-to-end synchronization of persistent data between the first electronic device and the second electronic device, the first electronic device determines that the amount of newly added picture data in the note application is small, and can directly synchronize the attachment through the end-to-end synchronization; the first electronic device determines that the amount of newly added video data in the note application is large, and can synchronize the address of the video through the end-to-end synchronization. Then, subsequently, after the second electronic device obtains the persistent data of the note application from the cloud server, the second electronic device can discard the pictures that have been synchronized, and save the video of which the attachment content has not been synchronized.
[0017] In this way, the first electronic device can synchronize the persistent data with the second electronic device according to the data amount, thereby improving the end-to-end synchronization efficiency of the persistent data.
[0018] According to a first aspect, or any possible implementation mode of the above first aspect, the method further includes: receiving a data saving operation of the user or detecting that a data saving period is met, saving the first data to the storage module. Sending the first data in the storage module to the cloud server.
[0019] For example, the first electronic device saves the procedural data to the storage module in response to the user operation, and the procedural data becomes persistent data. The first electronic device sends the persistent data to the cloud server according to a preset period or after confirming that the persistent data is obtained.
[0020] For another example, the first application is configured with an automatic saving function, and the first application automatically saves the procedural data according to a preset period. Then, after the first electronic device obtains the latest saved persistent data in the storage module, the first electronic device can send the persistent data to the cloud server.
[0021] In this way, the first electronic device divides the procedural data and the persistent data according to whether the data is saved, and synchronizes the procedural data and the persistent data in different ways. Thus, the timeliness of data synchronization is ensured while the stability of data synchronization is ensured.
[0022] In a second aspect, a data synchronization method is provided and applied to a second electronic device. The method comprises: receiving first data sent by a first electronic device; and downloading second data sent by the first electronic device to a cloud server from the cloud server, wherein the first data and the second data are data generated by a first application in the first electronic device, the first data is data that has not been saved to a storage module of the first electronic device, and the second data is data that has been saved to the storage module of the first electronic device.
[0023] According to the second aspect, the receiving of the first data sent by the first electronic device comprises: receiving the first data sent by the first electronic device through a short-distance communication mode, wherein the short-distance communication mode comprises at least one of a Bluetooth point-to-point (P2P) communication mode, a wireless fidelity (Wi-Fi) P2P communication mode, and a local area network (LAN) communication mode.
[0024] According to the second aspect or any possible implementation mode of the second aspect, the downloading of the second data sent by the first electronic device to the cloud server from the cloud server comprises: obtaining first data information of third data sent by the cloud server, wherein the third data comprises the second data and data in the first data that has been saved to the storage module; and requesting the cloud server to download the second data in the third data that has not been synchronized with the first electronic device in an end-to-end manner according to the first data information.
[0025] In this way, the synchronization of the data in the second electronic device with the data in the first electronic device is ensured, and data conflicts between different devices are avoided.
[0026] According to the second aspect or any possible implementation mode of the second aspect, the method further comprises: receiving fourth data sent by the second electronic device under a preset condition, wherein the fourth data is data that has been saved to the storage module of the first electronic device; and the preset condition comprises one or more of the following: the first electronic device fails to send the fourth data to the cloud server, the first electronic device does not start a cloud synchronization function, a cloud space capacity is insufficient, and a priority of the end-to-end synchronization is higher than a priority of the end-to-cloud synchronization.
[0027] According to the second aspect or any possible implementation mode of the second aspect, the method further comprises: receiving second data information of fifth data sent by the cloud server, wherein the fifth data is data of the first application sent by the first electronic device to the cloud server; and requesting the cloud server to download sixth data in the fifth data that has not been synchronized with the first electronic device in an end-to-end manner according to the second data information, wherein the sixth data does not comprise the fourth data.
[0028] In this way, the second electronic device performs data pulling from the cloud server according to an actual data synchronization situation, and does not need to repeatedly download data that has been synchronized.
[0029] According to a second aspect, or any possible implementation mode of the second aspect, the method further comprises: receiving first information of seventh data sent by the first electronic device under a preset condition, the seventh data being data saved by the first electronic device to the storage module, a data quantity of the seventh data being greater than a preset threshold, the first information comprising a storage address and / or thumbnail information of the seventh data.
[0030] According to a third aspect, a first electronic device is provided. The first electronic device comprises a processor, a memory and a display screen, the memory and the display screen being coupled to the processor, the memory being configured to store computer program code, the computer program code comprising computer instructions, when the processor reads the computer instructions from the memory, causing the first electronic device to perform: displaying an interface of a first application. Receiving a first operation of the first application by a user, obtaining first data and second data of the first application generated by the first operation, the first data being data not saved to a storage module of the first electronic device, the second data being data saved to the storage module. Sending the first data to a second electronic device, and sending the second data to a cloud server.
[0031] According to the third aspect, sending the first data to the second electronic device comprises: sending the first data to the second electronic device through a short-distance communication mode, the short-distance communication mode comprising at least one of a Bluetooth point-to-point (P2P) communication mode, a wireless fidelity (Wi-Fi) P2P communication mode, and a local area network (LAN) communication mode.
[0032] According to the third aspect, or any possible implementation mode of the third aspect, when the processor reads the computer instructions from the memory, the first electronic device further performs: receiving a second operation of the first application by the user, obtaining fourth data of the first application generated by the second operation, the fourth data being data saved to the storage module. Under a preset condition, sending the fourth data to the second electronic device, the preset condition comprising one or more of the following: failing to send the fourth data to the cloud server, not enabling a cloud synchronization function, insufficient cloud space capacity, and a priority of end-to-end synchronization being higher than a priority of end-to-cloud synchronization.
[0033] According to the third aspect, or any possible implementation mode of the third aspect, when the processor reads the computer instructions from the memory, the first electronic device further performs: receiving a third operation of the first application by the user, obtaining seventh data of the first application generated by the third operation, the seventh data being data saved to the storage module, a data quantity of the seventh data being greater than a preset threshold. Under a preset condition, sending first information of the seventh data to the second electronic device, the first information comprising a storage address and / or thumbnail information of the seventh data.
[0034] According to a third aspect, or any possible implementation mode of the third aspect, when the processor reads the computer instructions from the memory, the first electronic device further performs: receiving a data saving operation of the user or detecting that a data saving period is met, and saving the first data to the storage module. The first data in the storage module is sent to the cloud server.
[0035] According to a fourth aspect, a second electronic device is provided. The second electronic device comprises a processor and a memory coupled to the processor, and the memory is configured to store computer program codes including computer instructions. When the processor reads the computer instructions from the memory, the second electronic device performs: receiving first data sent by a first electronic device. Downloading second data sent by the first electronic device to the cloud server from the cloud server; wherein the first data and the second data are data generated by a first application in the first electronic device, the first data is data not saved to a storage module of the first electronic device, and the second data is data saved to the storage module of the first electronic device.
[0036] According to the fourth aspect, receiving the first data sent by the first electronic device comprises: receiving the first data sent by the first electronic device through a short-distance communication mode, and the short-distance communication mode comprises at least one of a Bluetooth point-to-point (P2P) communication mode, a wireless fidelity (Wi-Fi) P2P communication mode, and a local area network (LAN) communication mode.
[0037] According to the fourth aspect, or any possible implementation mode of the fourth aspect, downloading the second data sent by the first electronic device to the cloud server from the cloud server comprises: obtaining first data information of third data sent by the cloud server, the third data comprising the second data and data in the first data that has been saved to the storage module. According to the first data information, the second data in the third data that has not been end-to-end synchronized with the first electronic device is requested to be downloaded from the cloud server.
[0038] According to the fourth aspect, or any possible implementation mode of the fourth aspect, when the processor reads the computer instructions from the memory, the second electronic device further performs: receiving fourth data sent by the first electronic device under a preset condition, the fourth data being data saved by the first electronic device to the storage module; and the preset condition comprises one or more of the following: the first electronic device fails to send the fourth data to the cloud server, the first electronic device does not enable a cloud synchronization function, a cloud space capacity is insufficient, and an end-to-end synchronization priority is higher than an end-to-cloud synchronization priority.
[0039] According to a fourth aspect, or any possible implementation mode of the fourth aspect, when the processor reads the computer instructions from the memory, the second electronic device further performs: receiving second data information of fifth data sent by the cloud server, the fifth data being data of the first application sent by the first electronic device to the cloud server; and according to the second data information, requesting the cloud server to download sixth data in the fifth data that is not end-to-end synchronized with the first electronic device, the sixth data not including the fourth data.
[0040] According to a fourth aspect, or any possible implementation mode of the fourth aspect, when the processor reads the computer instructions from the memory, the second electronic device further performs: receiving first information of seventh data sent by the first electronic device under a preset condition, the seventh data being data saved to the storage module by the first electronic device, a data amount of the seventh data being greater than a preset threshold, the first information including a storage address and / or thumbnail information of the seventh data.
[0041] A fifth aspect provides a data synchronization system, the system including a first electronic device and a second electronic device, and a short-distance communication connection being established between the first electronic device and the second electronic device. The first electronic device is configured to: display an interface of a first application; receive a first operation of the first application by a user; obtain first data and second data of the first application generated by the first operation, the first data being data not saved to a storage module of the first electronic device, and the second data being data saved to the storage module; send the first data to the second electronic device, and send the second data to a cloud server. The second electronic device is configured to: receive the first data sent by the first electronic device, and download the second data from the cloud server.
[0042] According to the fifth aspect, the second electronic device is further configured to: obtain first data information of third data sent by the cloud server, the third data including the second data and data in the first data that has been saved to the storage module; and according to the first data information, request the cloud server to download the second data in the third data that is not end-to-end synchronized with the first electronic device.
[0043] According to the fifth aspect, or any possible implementation mode of the fifth aspect, the first electronic device is further configured to: receive a second operation of the first application by the user; obtain fourth data of the first application generated by the second operation, the fourth data being data saved to the storage module; and under a preset condition, send the fourth data to the second electronic device, the preset condition including one or more of the following: failure in sending the fourth data to the cloud server, the cloud synchronization function not being enabled, the cloud space being insufficient, and a priority of end-to-end synchronization being higher than a priority of end-to-cloud synchronization. The second electronic device is further configured to: receive the fourth data sent by the first electronic device.
[0044] According to a fifth aspect, or any possible implementation mode of the fifth aspect, the second electronic device further receives second data information of fifth data sent by the cloud server, the fifth data being data of the first application sent by the first electronic device to the cloud server. According to the second data information, the cloud server is requested to download sixth data in the fifth data that is not end-to-end synchronized with the first electronic device, the sixth data not including the fourth data.
[0045] According to a sixth aspect, there is provided an electronic device having a function of implementing the data synchronization method according to the first aspect and any possible implementation mode of the first aspect; or having a function of implementing the data synchronization method according to the second aspect and any possible implementation mode of the second aspect. The function can be implemented by hardware, or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above functions.
[0046] According to a seventh aspect, there is provided a computer-readable storage medium. The computer-readable storage medium stores a computer program (also referred to as instructions or code), when the computer program is executed by an electronic device, the electronic device executes the method of the first aspect or any possible implementation mode of the first aspect; or the electronic device executes the method of the second aspect or any possible implementation mode of the second aspect.
[0047] According to an eighth aspect, there is provided a computer program product, when the computer program product is run on an electronic device, the electronic device executes the method of the first aspect or any possible implementation mode of the first aspect; or the electronic device executes the method of the second aspect or any possible implementation mode of the second aspect.
[0048] According to a ninth aspect, there is provided a circuit system, the circuit system including a processing circuit configured to execute the method of the first aspect or any possible implementation mode of the first aspect; or the processing circuit is configured to execute the method of the second aspect or any possible implementation mode of the second aspect.
[0049] According to a tenth aspect, there is provided a chip system, including at least one processor and at least one interface circuit, the at least one interface circuit being configured to perform a transceiving function and send instructions to the at least one processor, when the at least one processor executes the instructions, the at least one processor executes the method of the first aspect or any possible implementation mode of the first aspect; or the at least one processor executes the method of the second aspect or any possible implementation mode of the second aspect.
[0050] The technical effects of the foregoing aspects can be referred to each other, which will not be repeated here. BRIEF DESCRIPTION OF DRAWINGS
[0051] Figure 1An end-to-cloud data synchronization scenario diagram provided by an embodiment of the present application;
[0052] Figure 2 An end-to-end data synchronization scenario diagram provided by an embodiment of the present application;
[0053] Figure 3 A communication system diagram to which a data synchronization method provided by an embodiment of the present application is applied;
[0054] Figure 4 A hardware structure diagram of a first electronic device provided by an embodiment of the present application;
[0055] Figure 5 A software structure block diagram provided by an embodiment of the present application;
[0056] Figure 6 A process data end-to-end data synchronization scenario diagram provided by an embodiment of the present application;
[0057] Figure 7 A persistent data end-to-cloud data synchronization scenario diagram provided by an embodiment of the present application;
[0058] Figure 8 A persistent data on-demand end-to-end data synchronization scenario diagram provided by an embodiment of the present application Figure 1 ;
[0059] Figure 9 A persistent data on-demand end-to-end data synchronization scenario diagram provided by an embodiment of the present application Figure 2 ;
[0060] Figure 10 A scenario diagram of adaptive data synchronization according to data type and data synchronization scenario provided by an embodiment of the present application;
[0061] Figure 11 A flow diagram of a data synchronization method provided by an embodiment of the present application;
[0062] Figure 12 A structure diagram of a first electronic device provided by an embodiment of the present application;
[0063] Figure 13 A structure diagram of a second electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0064] The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application. In the description of the embodiments of the present application, the terms used in the following embodiments are only for the purpose of describing the specific embodiments and are not intended to be limiting to the present application. As used in the specification and the appended claims of the present application, the singular forms “a,” “an” and “the” are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will also be understood that “at least one” and “one or more” as used in the embodiments herein indicates one or two or more (including two).
[0065] In this specification, the phrase “one embodiment” or “some embodiments” etc. means that a particular feature, structure, or characteristic described in connection with the embodiment is included in at least one embodiment of the application. Thus, the appearances of the phrase “in one embodiment,” “in some embodiments,” “in other embodiments,” “in additional embodiments,” etc. in various places in the specification are not necessarily all referring to the same embodiment, unless otherwise specified. The terms “comprising,” “including,” “having” and their variations, as used in this specification, mean “including but not limited to,” unless otherwise specified. The term “connected” includes both direct and indirect connections, unless otherwise specified. “First,” “second,” etc. are used only to describe different instances and do not imply relative importance or an ordering.
[0066] In the embodiments of the present application, the words “exemplary” or “for example” are used to mean serving as an example, instance, or illustration. Any embodiment or design described in the embodiments of the present application as “exemplary” or “for example” should not be construed as preferred or advantageous over other embodiments or designs. Rather, the exemplary or illustrative embodiments are presented for the purpose of illustration only and do not constitute a limitation in the scope of the present application. The word “exemplary” or “for example” is used in the sense of serving as an example, instance, or illustration.
[0067] In some embodiments, the multiple electronic devices in the distributed communication system can synchronize data through the end-cloud synchronization manner, so as to ensure the consistency of the multi-end data.
[0068] Exemplarily, as Figure 1As shown, the electronic device A updates the note application content in response to the user's editing operation in the process of running the note application, and saves the updated note content to the storage module. Then, the electronic device A sends the note content (i.e., data A) in the storage module to the cloud server through the end-cloud synchronization. Then, the electronic device B can download the note content from the cloud server. In this way, the electronic device B displays the latest note content edited by the user on the electronic device A after starting the note application in response to the user operation, which is convenient for the user to use.
[0069] However, in the above process, the data synchronization between different electronic devices through the end-cloud synchronization is difficult to ensure the timeliness of the data synchronization, which affects the user experience. For example, when the mobile phone determines that the updated note content needs to be sent to the cloud server, the current network quality is poor, and the sending fails. Then, in this process, since the mobile phone fails to upload the updated note content to the cloud server, the tablet also fails to obtain the latest note content. Then, if the user opens the note application on the tablet at this time, the user cannot view the latest note application content.
[0070] In addition, some electronic devices are not configured or do not start the cloud synchronization function, so that the electronic devices cannot synchronize data with other devices through the end-cloud synchronization. Or, some electronic devices are set by the user to only synchronize cloud data when using a wireless network, and cannot synchronize cloud data when using operator data traffic, which affects the timeliness of data synchronization.
[0071] In some other embodiments, the multiple electronic devices in the distributed communication system can synchronize data through the end-end synchronization, so as to ensure the consistency of the multi-end data.
[0072] Exemplarily, as shown in Figure 2 As shown, the electronic device A updates the note content in response to the user's editing operation in the process of running the note application, and generates the process data of the note application. In this process, the electronic device A detects the electronic device B located nearby, and establishes a communication connection with the electronic device B. Then, the electronic device A can synchronize the process data of the note application update (i.e., data A) to the electronic device B in real time. In this way, the electronic device B can display the latest note content edited by the user on the electronic device A in real time after starting the note application in response to the user operation, which is convenient for the user to use.
[0073] However, in the above process, the stability of the end-end connection between devices is poor and is easy to be interrupted. Moreover, the data transmission speed is slow, which affects the data synchronization efficiency between different electronic devices through the end-end synchronization.
[0074] In addition, the electronic device can only perform end-to-end data synchronization when using a wireless network, and cannot perform end-to-end data synchronization when using operator data traffic, which affects the timeliness of data synchronization.
[0075] In yet other embodiments, different electronic devices perform cursor synchronization through end-to-end data synchronization, and other data is synchronized through end-cloud synchronization. In this scheme, the above technical problems still exist.
[0076] Therefore, the embodiments of the present application provide a data synchronization method. After an electronic device generates to-be-synchronized data, the electronic device synchronizes procedural data and persistent data separately according to the data type of the to-be-synchronized data, thereby ensuring the timeliness and stability of data synchronization.
[0077] Figure 3 A schematic diagram of a communication system to which the data synchronization method provided by the embodiments of the present application is applied is shown in FIG. 1. Figure 3 As shown in FIG. 1, the communication system includes a first electronic device 100, a second electronic device 200, and a server 300.
[0078] Optionally, the first electronic device 100 or the second electronic device 200 can be, for example, a terminal device such as a mobile phone, a tablet computer, a notebook computer, a smart TV, a wearable device, a vehicle-mounted terminal, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), an artificial intelligence (AI) device, etc. The operating system installed in the first electronic device 100 or the second electronic device 200 includes, but is not limited to or other operating systems. The specific type of the first electronic device 100 or the second electronic device 200 and the operating system installed therein are not limited in the present application.
[0079] Optionally, the server 300 can be a cloud server or a network server, etc. The above-mentioned server can be a server, a server cluster composed of multiple servers, or a cloud computing service center.
[0080] In some embodiments, the first electronic device 100 is an electronic device that generates to-be-synchronized data, and the second electronic device 200 is an electronic device that is to be synchronized. After the first electronic device 100 generates to-be-synchronized data, the first electronic device 100 determines the data type, sends procedural data to the second electronic device 200 through end-to-end synchronization, and sends persistent data to the second electronic device 200 through end-cloud synchronization.
[0081] Optionally, the first electronic device 100 and the second electronic device 200 in the embodiments of the present application can be implemented by the same or different devices, and the different devices can have the same, similar or certain different hardware structures, such as Figure 4 hardware structures shown in the figures.
[0082] For example, taking the first electronic device 100 having the hardware structure as shown in Figure 4 as an example, the hardware structure as shown in Figure 4 is described.
[0083] As shown in Figure 4 , the first electronic device 100 can include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charge management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a sensor module 180, a key 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc.
[0084] It can be understood that the structure shown in the embodiments of the present application does not constitute a specific limitation on the first electronic device 100. In other embodiments of the present application, the first electronic device 100 can include more or fewer components than shown, or combine certain components, or split certain components, or different component arrangements. The components shown can be implemented in hardware, software, or a combination of software and hardware.
[0085] The processor 110 can include one or more processing units, for example: the processor 110 can include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Among them, different processing units can be independent devices, or can be integrated in one or more processors.
[0086] The controller can generate operation control signals according to the instruction operation code and the timing signal, and complete the control of fetching and executing instructions.
[0087] The processor 110 can also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory can store instructions or data that have just been used or recycled by the processor 110. If the processor 110 needs to use the instructions or data again, it can be directly called from the memory. This avoids repeated access and reduces the waiting time of the processor 110, thereby improving the efficiency of the system.
[0088] In some embodiments, the processor 110 can include one or more interfaces. The interfaces can include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.
[0089] The I2C interface is a bidirectional synchronous serial bus, including a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 110 can include multiple sets of I2C buses. The processor 110 can be coupled to a touch sensor, a charger, a flash, a camera 193, etc. through different I2C bus interfaces, respectively. For example, the processor 110 can be coupled to a touch sensor through an I2C interface, so that the processor 110 and the touch sensor communicate through the I2C bus interface to realize the touch function of the first electronic device 100.
[0090] The MIPI interface can be used to connect the processor 110 and the display screen 194, the camera 193 and other peripheral devices. The MIPI interface includes a camera serial interface (CSI), a display serial interface (DSI), and the like. In some embodiments, the processor 110 and the camera 193 communicate through the CSI interface to implement the shooting function of the first electronic device 100. The processor 110 and the display screen 194 communicate through the DSI interface to implement the display function of the first electronic device 100.
[0091] The USB interface 130 is an interface conforming to the USB standard specification, and can be a Mini USB interface, a Micro USB interface, a USB Type C interface, or the like. The USB interface 130 can be used to connect a charger to charge the first electronic device 100, and can also be used to transmit data between the first electronic device 100 and a peripheral device. It can also be used to connect a headset to play audio through the headset. The interface can also be used to connect other electronic devices, such as AR devices and the like.
[0092] It can be understood that the interface connection relationship between the modules shown in the embodiments of the present application is only illustrative and does not constitute a structural limitation of the first electronic device 100. In some other embodiments of the present application, the first electronic device 100 can also use different interface connection methods or combinations of multiple interface connection methods in the above embodiments.
[0093] The charging management module 140 is used to receive charging input from a charger. The charger can be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 can receive charging input from a wired charger through the USB interface 130. In some wireless charging embodiments, the charging management module 140 can receive wireless charging input through the wireless charging coil of the first electronic device 100. The charging management module 140 charges the battery 142 while also supplying power to the electronic device through the power management module 141.
[0094] The power management module 141 is configured to connect the battery 142 and the charging management module 140 to the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140 to power the processor 110, the internal memory 121, the display 194, the camera 193, the wireless communication module 160, and the like. The power management module 141 can also be configured to monitor parameters such as battery capacity, battery cycle count, battery health status (leakage, impedance), and the like. In some embodiments, the power management module 141 can also be disposed in the processor 110. In some other embodiments, the power management module 141 and the charging management module 140 can be disposed in the same device.
[0095] The wireless communication function of the first electronic device 100 can be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor, and the baseband processor, and the like.
[0096] The antenna 1 and the antenna 2 are configured to transmit and receive electromagnetic wave signals. Each antenna in the first electronic device 100 can be configured to cover a single or multiple communication frequency bands. Different antennas can also be multiplexed to improve the utilization of the antennas. For example, the antenna 1 can be multiplexed as a diversity antenna for a wireless local area network. In some other embodiments, the antennas can be used in combination with a tuning switch.
[0097] The mobile communication module 150 can provide a solution for wireless communication including 2G / 3G / 4G / 5G and the like applied to the first electronic device 100. The mobile communication module 150 can include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), and the like. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, filter, amplify, and the like the received electromagnetic waves, and transmit the processed signals to the modem processor for demodulation. The mobile communication module 150 can also amplify signals modulated by the modem processor and radiate the signals as electromagnetic waves through the antenna 1. In some embodiments, at least part of the functional modules of the mobile communication module 150 can be disposed in the processor 110. In some embodiments, at least part of the functional modules of the mobile communication module 150 and at least part of the modules of the processor 110 can be disposed in the same device.
[0098] The modem processor can include a modulator and a demodulator. The modulator is configured to modulate a low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is configured to demodulate a received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. The low-frequency baseband signal processed by the baseband processor is transmitted to the application processor. The application processor outputs an audio signal through an audio device, or displays an image or video through the display screen 194. In some embodiments, the modem processor can be a separate device. In other embodiments, the modem processor can be independent of the processor 110, and be arranged in the same device as the mobile communication module 150 or other functional modules.
[0099] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (e.g., wireless fidelity (Wi-Fi) network), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR) technology, etc. The wireless communication module 160 can be one or more devices that integrate at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates and filters the electromagnetic wave signal, and transmits the processed signal to the processor 110. The wireless communication module 160 can also receive a signal to be transmitted from the processor 110, modulate it, amplify it, and convert it into electromagnetic wave radiation via the antenna 2.
[0100] In some embodiments, the antenna 1 and the mobile communication module 150 of the first electronic device 100 are coupled, and the antenna 2 and the wireless communication module 160 are coupled, so that the first electronic device 100 can communicate with a network and other devices through wireless communication technology. The wireless communication technology can include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology, etc. The GNSS can include global positioning system (GPS), global navigation satellite system (GLONASS), beidou navigation satellite system (BDS), quasi-zenith satellite system (QZSS), and / or satellite based augmentation systems (SBAS).
[0101] The first electronic device 100 implements a display function through a GPU, a display screen 194, and an application processor, etc. The GPU is a microprocessor for image processing, which is connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 can include one or more GPUs, which execute program instructions to generate or change display information.
[0102] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be manufactured by using a liquid crystal display (LCD), for example, an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flex light-emitting diode (FLED), a Mini-led, a Micro-led, a Micro-oled, a quantum dot light emitting diode (QLED), etc. In some embodiments, the first electronic device 100 can include 1 or N display screens 194, where N is a positive integer greater than 1.
[0103] The camera 193 is used to capture still images or videos. An object generates an optical image through a lens and projects the optical image to a photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then transmits the electrical signal to an ISP to convert it into a digital image signal. The ISP outputs the digital image signal to a DSP for processing. The DSP converts the digital image signal into an image signal in a standard format, such as RGB, YUV, etc. In some embodiments, the first electronic device 100 can include 1 or N cameras 193, where N is a positive integer greater than 1.
[0104] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the first electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement data storage functions. For example, music, video, etc. files are saved in the external memory card.
[0105] The internal memory 121 can be used to store computer executable program codes including instructions. The internal memory 121 can include a program storage area and a data storage area. The program storage area can store an operating system, at least one application program required by a function (such as a sound playing function, an image playing function, etc.), and the like. The data storage area can store data created during the use of the first electronic device 100 (such as audio data, a phone book, etc.), and the like. In addition, the internal memory 121 can include a high-speed random access memory, and can further include a non-volatile memory such as at least one of a magnetic disk storage device, a flash memory device, a universal flash storage (UFS), and the like. The processor 110 executes various function applications and data processing of the first electronic device 100 by running instructions stored in the internal memory 121 and / or instructions stored in a memory disposed in the processor.
[0106] The audio module 170 is used to convert digital audio information into an analog audio signal output, and is also used to convert an analog audio input into a digital audio signal. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be disposed in the processor 110, or part of the function modules of the audio module 170 can be disposed in the processor 110. The first electronic device 100 can play music, record sound, etc. through the audio module 170. The audio module 170 can include a speaker, a receiver, a microphone, an earphone interface, and an application processor, etc. to realize audio functions.
[0107] The sensor module 180 can include a pressure sensor, a gyroscope sensor, a barometric pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, etc.
[0108] The key 190 includes a power-on key, a volume key, etc. The key 190 can be a mechanical key. It can also be a touch key. The first electronic device 100 can receive a key input, and generate a key signal input related to the user settings and function control of the first electronic device 100.
[0109] The motor 191 can generate a vibration prompt. The motor 191 can be used for incoming call vibration prompt, and can also be used for touch vibration feedback. The motor 191 can correspond to different vibration feedback effects for touch operations on different regions of the display screen 194. Different application scenarios (such as time reminders, received messages, alarms, games, etc.) can also correspond to different vibration feedback effects.
[0110] The indicator 192 can be an indicator light, which can be used to indicate a charging state, a power change, and can also be used to indicate a message, a missed call, a notification, etc.
[0111] The SIM card interface 195 is configured to connect a SIM card. The SIM card can be inserted into or pulled out of the SIM card interface 195 to realize contact and separation with the first electronic device 100. The first electronic device 100 can support one or N SIM card interfaces, where N is a positive integer greater than 1.
[0112] The software system of the first electronic device 100 or the second electronic device 200 can adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture. Embodiments of the present application take an Android system with a layered architecture as an example to exemplarily illustrate the software structure of the first electronic device 100 or the second electronic device 200.
[0113] Figure 5 FIG. 1 is a software structure block diagram of the first electronic device 100 according to an embodiment of the present application. The second electronic device 200 can have the same, similar, or certain different software structure.
[0114] The layered architecture divides software into several layers, each of which has a clear role and division of labor. Layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom, an application layer, an application framework layer, an Android runtime and system library, and a kernel layer.
[0115] The application layer can include a series of application packages.
[0116] As shown in FIG. 1, the application packages can include note, contact, memo, motion health, clipboard, gallery, map, camera, video, and the like. Figure 5
[0117] The application framework layer provides application programming interfaces (APIs) and programming frameworks for the applications of the application layer. The application framework layer includes some pre-defined functions.
[0118] As shown in FIG. 1, the application framework layer can include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, and the like. Figure 5
[0119] The window manager is configured to manage window programs. The window manager can obtain the size of a display screen, determine whether there is a status bar, lock a screen, and take a screenshot, and the like.
[0120] The content provider stores and retrieves data and makes it accessible to the application. The data can include videos, images, audio, dialed and received calls, browsing history and bookmarks, phonebook, etc.
[0121] The view system includes visual controls, such as controls that display text, controls that display pictures, etc. The view system can be used to build an application. A display interface can be composed of one or more views. For example, a display interface that includes a short message notification icon can include a view that displays text and a view that displays a picture.
[0122] The telephony manager is used to provide the communication function of the first electronic device 100. For example, the management of the call state (including call connection, call hang-up, etc.).
[0123] The resource manager provides various resources for the application, such as localized strings, icons, pictures, layout files, video files, etc.
[0124] The notification manager enables the application to display notification information in the status bar, which can be used to convey a message of the notification type, which can automatically disappear after a short stay without user interaction. The notification manager can also be a notification that appears in the form of a chart or a scroll bar text in the top status bar of the system.
[0125] The Android runtime includes the core library and the virtual machine. The Android runtime is responsible for the scheduling and management of the Android system.
[0126] The core library contains two parts: one part is the function function that the java language needs to call, and the other part is the core library of Android.
[0127] The application layer and the application framework layer run in the virtual machine. The virtual machine executes the java files of the application layer and the application framework layer into binary files. The virtual machine is used to perform the management of the object life cycle, the management of the stack, the management of the thread, the management of the security and the exception, and the garbage collection, etc.
[0128] The system library can include multiple functional modules. For example: surface manager, media library, three-dimensional graphics processing library (for example: OpenGL ES), two-dimensional graphics engine (for example: SGL), etc.
[0129] The surface manager is used to manage the display subsystem and provides the fusion of 2D and 3D layers for multiple applications.
[0130] The media library supports a variety of commonly used audio, video format playback and recording, and static image files, etc. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
[0131] The three-dimensional graphics processing library is used to implement three-dimensional graphics drawing, image rendering, synthesis, and layer processing, etc.
[0132] The two-dimensional graphics engine is a drawing engine for 2D drawing.
[0133] The kernel layer is a layer between hardware and software. The kernel layer at least contains display driver, camera driver, audio driver, sensor driver.
[0134] The working flow of the software and hardware of the first electronic device 100 and the second electronic device 200 will be described below in the synchronization scenario of note data.
[0135] In the first electronic device 100, when the touch sensor receives a touch operation, a corresponding hardware interrupt is sent to the kernel layer. The kernel layer processes the touch operation into a raw input event (including touch coordinates, timestamp of the touch operation, etc. information). The raw input event is stored in the kernel layer. The application framework layer obtains the raw input event from the kernel layer, and identifies the control corresponding to the input event. Taking the touch operation as a touch single-click operation, and the control corresponding to the single-click operation as the control of the note application icon as an example, the note application calls the interface of the application framework layer, and starts the note application. After that, the first electronic device 100 detects the touch operation of the user in the note application through the touch sensor during the display of the note application, and determines that the note application generates new data, and data synchronization is needed.
[0136] After that, if the first electronic device 100 detects the second electronic device 200 located nearby, and determines to establish a communication connection with the second electronic device 200. Then, the first electronic device 100 can send the newly generated note data to the second electronic device 200, and the newly generated note data is the procedural data generated by the note application in the first electronic device 100 in real time. Thus, through the end-to-end synchronization mode, the data synchronization of the note applications in the first electronic device 100 and the second electronic device 200 is realized.
[0137] If the first electronic device 100 does not detect the second electronic device 200 located nearby, the first electronic device 100 can save the newly generated note data to the storage module in response to a save operation of the user. Subsequently, the first electronic device 100 uploads the note data saved in the storage module to the cloud server, and the note data uploaded to the cloud server is the persistent data of the note application in the first electronic device 100. Correspondingly, the second electronic device 200 can obtain the note data by downloading from the cloud server. Thus, the data synchronization of the note applications in the first electronic device 100 and the second electronic device 200 is realized by the end-cloud synchronization.
[0138] Hereinafter, the first electronic device 100 is taken as an example of the electronic device generating the data to be synchronized, and the second electronic device 200 is taken as an example of the electronic device to be synchronized, and the data synchronization method provided by the embodiments of the present application is described in detail.
[0139] In some embodiments, the electronic device can generate data of different data types in the process of running the application. In some examples, the data types include, for example, procedural data and persistent data. The electronic device can distinguish the procedural data and the persistent data according to whether the generated data is saved to the storage module. For example, the data in the storage module is persistent data after the electronic device saves the generated data to the storage module, and the data not saved to the storage module is procedural data.
[0140] In some examples, the storage module is a storage medium capable of storing data. The storage module is, for example, a read only memory (ROM), such as a hard disk, a mechanical hard disk, a solid state disk, a magnetic disk, etc.
[0141] For example, the procedural data includes text content, attachment information, cursor position, etc. generated by the application in real time. The persistent data includes pictures, videos, documents, text content, etc. stored in the storage module.
[0142] In some embodiments, the electronic device synchronizes the data of different data types separately according to the data types after generating the data. In some examples, the electronic device synchronizes the procedural data with other electronic devices by end-end synchronization, so as to ensure the timeliness of the synchronization of the procedural data. The electronic device synchronizes the persistent data with other electronic devices by end-cloud synchronization, so as to ensure the stability of the synchronization of the persistent data.
[0143] For example, Figure 6As shown, while running a note-taking application, the first electronic device generates new note content in response to user actions. During this process, the first electronic device detects a nearby second electronic device and can establish a communication connection with it (or a communication connection may already exist between them). Subsequently, while updating the note content, the first electronic device can send the updated note content to the second electronic device via end-to-end synchronization. That is, the first electronic device synchronizes procedural data to the second electronic device via end-to-end synchronization. Thus, if the second electronic device is also running a note-taking application while the first is running it, the second electronic device can synchronously display the note content edited by the user in the note-taking application on the first electronic device through end-to-end data synchronization. Alternatively, after the second electronic device responds to user actions and launches the note-taking application, it can display the note content synchronized by the first electronic device via end-to-end synchronization, allowing the user to continue editing the note content on the second electronic device.
[0144] For example, such as Figure 7 As shown, in response to a user's save operation, the first electronic device saves the updated note content to the storage module. The storage module then stores attachments from the note-taking application, which may include text, images, videos, etc., entered by the user in the application. The first electronic device can then upload these attachments to a cloud server, completing persistent data synchronization between the first and second electronic devices. Subsequently, the second electronic device can download the persistent data uploaded by the first device from the cloud server as needed and save it to the storage module, completing persistent data synchronization between the second and second electronic devices. In other words, data synchronization between the first and second electronic devices is achieved through end-to-end cloud synchronization. For example, in response to a user's instruction to launch the note-taking application, the second electronic device sends a data synchronization request to the cloud server to request the synchronization of note content. After end-to-end cloud data synchronization, the second electronic device can display the note content edited by the user on the first electronic device, allowing the user to continue editing the notes on the second device. Thus, data synchronization can be achieved regardless of whether the second electronic device is located near the first electronic device.
[0145] In some embodiments, after generating persistent data, electronic devices can also synchronize data with other electronic devices as needed through end-to-end synchronization.
[0146] For example, such as Figure 8As shown, the first electronic device stores the generated process data of the note application into the storage module in response to a user operation during running of the note application, and generates the persistent data of the note application. The first electronic device may, as needed, synchronize the persistent data with other devices through end-to-end synchronization in any one or more of the following situations. For example, the first electronic device is not configured with a cloud synchronization function, the cloud synchronization function is not enabled, the current network quality is poor and the persistent data cannot be uploaded to the cloud server, the cloud space capacity is insufficient, the wireless communication network function is not enabled or the first electronic device is not connected to the wireless communication network (such as a Wi-Fi network), and it is determined that the end-to-end synchronization priority is higher than the end-to-cloud synchronization priority. The priority order between end-to-end synchronization and end-to-cloud synchronization can be a preconfigured priority order in the first electronic device, or a priority order customized by the user. Different user accounts correspond to different cloud spaces, and the first electronic device can obtain the corresponding cloud space after logging in to the user account, which is used for data backup and the like. The cloud space has limited capacity, so the first electronic device cannot send the persistent data to the cloud server in the case of insufficient cloud space capacity.
[0147] It should be understood that in some other demand scenarios, the first electronic device can also send the persistent data to the second electronic device through end-to-end synchronization as needed, and the embodiments of the present application will not be exemplified one by one. For example, the first electronic device determines that the peer device (such as the second electronic device) cannot download data from the cloud server, and can also send the persistent data to the peer device through end-to-end synchronization.
[0148] In the various cases of the above examples, the first electronic device detects the second electronic device located nearby, and the first electronic device can establish a communication connection with the second electronic device (or a communication connection has already been established between the first electronic device and the second electronic device). Then, the first electronic device can send the persistent data of the note application already stored in the storage module to the second electronic device through the communication connection between the first electronic device and the second electronic device. Thus, the first electronic device and the second electronic device can synchronize the persistent data through end-to-end synchronization as needed, and avoid data synchronization anomalies due to the inability to perform end-to-cloud synchronization, thereby affecting user use.
[0149] In some embodiments, the process data is stored in the storage module in the form of a file and in the form of a database. The storage in the form of a file refers to storage of data content of the process data. For example, the electronic device stores the video content added by the user in the note application in the form of a file in the storage module in response to the user's save operation in the note application. The storage in the form of a database refers to storage of a uniform resource locator (URL) corresponding to the file in the storage module, which indicates a specific file storage address. For example, the electronic device determines the URL of the storage address after saving the video content in the form of a file in the storage module in response to the user's save operation, and stores the URL in the form of a database. Optionally, the database stores a file directory corresponding to the note application, which includes one or more URLs for indexing one or more files of the note application stored in the storage module.
[0150] In some examples, the first electronic device establishes a point to point (P2P) connection with the second electronic device through Bluetooth, Wi-Fi, etc., and implements end-to-end data synchronization through the P2P connection. Generally, the data transmission speed of the P2P connection is slow. Therefore, in order to ensure the data synchronization efficiency, when it is necessary to synchronize the persistent data through end-to-end synchronization, the file corresponding to the synchronized persistent data (such as the file stored in the form of an attachment) or the information of the synchronized persistent data can be selected, such as the information including the database content (such as the URL stored in the database) or the thumbnail information (such as a thumbnail, a video cover, etc.) corresponding to the persistent data. In this way, when the data amount of the persistent data is large, the first electronic device and the second electronic device can also synchronize the data through the information of the persistent data. Subsequently, the second electronic device can also read the persistent data on demand across devices according to the information of the persistent data.
[0151] For example, as shown in Figure 9 After the electronic device stores the process data in the storage module, the storage content includes the attachment stored in the form of a file and the attachment URL stored in the form of a database.
[0152] In one scenario, the first electronic device detects the user's operation of clicking the save control during the running of the note application, saves the text content input by the user to the storage module. The first electronic device determines that the text content cannot be uploaded to the cloud server at present, and determines that the P2P connection with the second electronic device located nearby has been established. Then, the first electronic device can synchronize the text content to the second electronic device through end-to-end synchronization. The second electronic device saves the text content to the storage module to complete the data synchronization of the note application.
[0153] In another scenario, the first electronic device detects a user operation of clicking a save control while running a note application, and saves a video file input by the user to a storage module. The first electronic device determines that the video file cannot be uploaded to a cloud server at present, and determines that a P2P connection has been established with the second electronic device located nearby. Since the data volume of the video file is large, the first electronic device can synchronize cover information and a URL of the video file to the second electronic device in an end-to-end synchronization manner. The second electronic device saves the cover information and the URL of the video file to the storage module to complete data synchronization of the note application. Subsequently, the second electronic device starts the note application in response to a user operation, and can display the cover of the video file. If a user operation of clicking the cover of the video file is detected, the second electronic device can request the first electronic device to obtain a video stream of the video file in a cross-device file reading manner according to the URL of the video file, thereby ensuring data synchronization efficiency and effectiveness.
[0154] Thus, as shown in Figure 10 the first electronic device and the second electronic device can flexibly realize data synchronization between different devices according to data types and current data synchronization scenarios through various data synchronization manners such as process data end-to-end synchronization, persistent data end-to-cloud synchronization, and persistent data on-demand end-to-end synchronization.
[0155] In some embodiments, data synchronization is performed between different electronic devices in various manners, which ensures consistency of multi-end data and avoids repeated synchronization of data.
[0156] In some examples, an electronic device determines consistency and repetition of data synchronization through data comparison.
[0157] For example, after the second electronic device obtains synchronization data through end-to-end synchronization or end-to-cloud synchronization, the second electronic device compares the synchronization data with local data to determine whether the local data already stores the same data. If the local data already stores the same data, the second electronic device can discard the synchronization data. If the local data does not store the same data, the second electronic device can save the synchronization data.
[0158] For example, as shown in Figure 10As shown, during the operation of a note-taking application, the first electronic device generates procedural data for the application in response to user actions and synchronizes this data to a nearby second electronic device via end-to-end synchronization. The second electronic device acquires and saves this procedural data. Subsequently, in response to the user's save operation, the first electronic device saves the procedural data to a storage module, acquiring the persistent data of the note-taking application. Then, the first electronic device uploads this persistent data to a cloud server. Correspondingly, the second electronic device requests to download the persistent data from the cloud server. This persistent data may include the procedural data previously acquired by the first and second electronic devices via end-to-end synchronization. Therefore, the second electronic device can determine whether to retain some or all of the persistent data acquired from the cloud server through data comparison.
[0159] For example, during end-to-end synchronization, the second electronic device acquires three images entered by the user into the note-taking application, along with the edit timestamps of those images. Subsequently, the second electronic device downloads persistent data from the cloud server, including five images entered by the user and their edit timestamps. Based on the images and edit timestamps, the second electronic device can determine that after end-to-end synchronization, the first electronic device inserted two more images into the note-taking application based on user actions. Therefore, the second electronic device can retain these two newly added images and discard the three images downloaded repeatedly from the cloud server. Alternatively, the second electronic device can determine, based on the images and edit timestamps, that after end-to-end synchronization, the user edited the three already synchronized images. In this case, the second electronic device can discard the three images synchronized from the end-to-end but retain all five images synchronized from the cloud server.
[0160] In this way, the data in the second electronic device is kept synchronized with the data in the first electronic device, and data conflicts between different devices are avoided.
[0161] For example, such as Figure 10 As shown, during the operation of the note-taking application, the first electronic device, in response to the user's editing operations, inserts images and videos into the application. After detecting the user's save operation, the first electronic device saves the persistent data of the note-taking application in its storage module. Subsequently, the first electronic device determines that cloud synchronization is not currently enabled and detects a nearby second electronic device, which can synchronize the persistent data of the note-taking application to the second electronic device as needed via end-to-end synchronization. Later, if the first electronic device detects that the user has enabled cloud synchronization, it can upload any persistent data of the note-taking application that has not yet been uploaded to the cloud server to the cloud server.
[0162] For example, after downloading persistent data from the note-taking application from the cloud server, the second electronic device can determine that this persistent data has already been synchronized with the first electronic device via end-to-end synchronization. Therefore, the second electronic device can avoid synchronizing this duplicate data again.
[0163] For example, during the on-demand end-to-end synchronization of persistent data between the first electronic device and the second electronic device, if the first electronic device determines that the amount of newly added image data in the note-taking application is small, it can directly synchronize attachments via end-to-end synchronization; if the first electronic device determines that the amount of newly added video data in the note-taking application is large, it can synchronize the video URL via end-to-end synchronization. Then, subsequently, after the second electronic device obtains the persistent data from the note-taking application from the cloud server, it can discard the already synchronized images and save the unsynchronized video attachments.
[0164] In this way, the second electronic device can retrieve data from the cloud server as needed based on the actual data synchronization situation.
[0165] In other examples, electronic devices determine the consistency and repeatability of data synchronization by comparing data information.
[0166] For example, the second electronic device determines whether the editing time of data on the cloud server is later than the editing time of local application data by comparing data editing times. This allows the second electronic device to download only the latest data to be synchronized, avoiding the need to repeatedly download historical data, effectively reducing power consumption during data download and data synchronization time. In other words, the second electronic device first determines the editing time of the data to be synchronized, downloads attachments from the cloud server as needed, and avoids repeated downloads if the attachments have not changed.
[0167] For example, such as Figure 10 As shown, during the operation of the note-taking application, the first electronic device generates procedural data for the note-taking application in response to the user's editing operations, and synchronizes this procedural data to a nearby second electronic device via end-to-end synchronization. The second electronic device acquires and saves this procedural data. Subsequently, in response to the user's save operation, the first electronic device saves the procedural data of the note-taking application to the storage module, acquiring the persistent data of the note-taking application. Afterwards, the first electronic device uploads the persistent data of the note-taking application to a cloud server.
[0168] Afterwards, the second electronic device sends a data synchronization request to the cloud server in response to the user starting the note application, and the data synchronization request carries a note application identifier. Correspondingly, the cloud server receives the data synchronization request, and determines that the second electronic device requests to synchronize the data of the note application according to the note application identifier carried in the data synchronization request. The cloud server can determine the data uploaded by the first electronic device between the last data synchronization of the second electronic device and the current data synchronization as the to-be-synchronized data, and send the information of the to-be-synchronized data to the second electronic device; or the cloud server directly determines all the data of the note application as the to-be-synchronized data, and sends the information of the to-be-synchronized data to the second electronic device.
[0169] Correspondingly, after the second electronic device receives the information of the to-be-synchronized data sent by the cloud server, the second electronic device determines the data actually needed to be synchronized by comparing the information of the to-be-synchronized data with the local data information of the note application, and then sends a data synchronization request to the cloud server again, and carries the information of the data actually needed to be synchronized in the data synchronization request. Correspondingly, the cloud server sends the corresponding to-be-synchronized data to the second electronic device according to the data information carried in the data synchronization request after receiving the data synchronization request.
[0170] In this way, the second electronic device not only realizes data synchronization with the first electronic device, but also avoids downloading repeated attachment data, thereby improving the efficiency of end-cloud data synchronization.
[0171] Exemplarily, the first electronic device updates the content of the note application in response to a user operation during the running of the note application, and sends the updated note content to the second electronic device through end-end synchronization. If the second electronic device is also running the note application, the first electronic device and the second electronic device can synchronously display the note application content edited by the user; or the second electronic device does not run the note application, and can also save the obtained note content. Subsequently, the first electronic device uploads the updated content of the note application and the update time to the cloud server in response to the user saving the note application. When the second electronic device requests to synchronize the data of the note application from the cloud server, if the last update time of the note content fed back by the cloud server (such as the time when the note content is uploaded to the cloud server) is earlier than the synchronization time of the locally stored note content, it can be determined that the note content does not need to be synchronized with the cloud server.
[0172] In this way, the second electronic device determines whether data synchronization is needed by comparing the final update time of the to-be-synchronized data, thereby effectively improving the data synchronization efficiency.
[0173] Figure 11 A flowchart of a data synchronization method provided by an embodiment of the present application is shown. It should be noted that the method is not necessarily limited to the order of the steps shown in the flowchart. Figure 11and the following specific order is limited, it should be understood that in other embodiments, the order of some steps in the method can be exchanged with each other according to actual needs, or some steps can be omitted or deleted. The method comprises the following steps:
[0174] S1101, the first electronic device displays an interface of the first application.
[0175] In some embodiments, the first electronic device runs the first application in the foreground and displays the interface of the first application. During the display of the interface of the first application, the first electronic device can receive the operation of the user, which can generate the data of the first application.
[0176] S1102, the first electronic device receives the first operation of the user on the first application, and obtains the first data and the second data of the first application generated by the first operation. The first data is data that has not been saved to the storage module of the first electronic device, and the second data is data that has been saved to the storage module of the first electronic device.
[0177] The first data is process data that has not been saved to the storage module, and the second data is persistent data that has been saved to the storage module. Optionally, the storage module is a storage medium capable of storing data. The storage module is, for example, a ROM, such as a hard disk, a mechanical hard disk, a solid state disk, a magnetic disk, etc.
[0178] In some embodiments, the first application detects the first operation of the user and can generate the data of the first application. For example, the first operation is an editing operation, and the first application can generate process data according to the editing of the user. For another example, the first operation is a save operation, and the first application saves the second data to the storage module according to the operation of the user, and then the second data is persistent data.
[0179] In some examples, the first application can generate process data and / or persistent data during running.
[0180] S1103, the first electronic device sends the first data to the second electronic device.
[0181] S1104, the first electronic device sends the second data to the cloud server.
[0182] In some embodiments, after obtaining the first data of the first application generated by the first operation, the first electronic device directly sends the first data to the second electronic device. The second electronic device is an electronic device near the first electronic device, and a short-distance communication connection is established between the first electronic device and the second electronic device.
[0183] In some examples, the first electronic device sends the first data to the second electronic device through a short-distance communication manner. Correspondingly, the second electronic device receives the first data sent by the first electronic device through the short-distance communication manner. The short-distance communication manner includes at least one of a Bluetooth P2P communication manner, a Wi-Fi P2P communication manner, and a local area network communication manner.
[0184] In some embodiments, after obtaining the second data of the first application generated by the first operation, the first electronic device uploads the second data to the cloud server, so as to facilitate other electronic devices to download the second data.
[0185] It should be understood that the embodiments of the present application do not limit the execution order of S1103 and S1104.
[0186] S1105, the second electronic device downloads the second data from the cloud server.
[0187] In some embodiments, the second electronic device obtains first data information of third data sent by the cloud server, the third data including the second data and the data in the first data that has been saved to the storage module. The second electronic device requests the cloud server to download the second data in the third data that is not synchronized with the first electronic device according to the first data information.
[0188] In this way, the second electronic device can request data synchronization from the cloud server on demand, and the second electronic device can pull data from the cloud server that is not in the synchronization process with other electronic devices. Thus, the amount of data downloaded is reduced, and the second electronic device can obtain the latest application data.
[0189] In some embodiments, the first electronic device receives a data saving operation of the user or detects that a data saving period is met, and saves the first data to the storage module. The first electronic device sends the first data in the storage module to the cloud server.
[0190] For example, the first electronic device saves the procedural data to the storage module in response to a user operation, and the procedural data becomes persistent data. The first electronic device sends the persistent data to the cloud server according to a preset period or after confirming that the persistent data is obtained.
[0191] For another example, the first application is configured with an automatic saving function, and the first application automatically saves the procedural data according to a preset period. Then, the first electronic device can send the persistent data saved in the storage module to the cloud server after obtaining the persistent data.
[0192] In this way, the first electronic device divides the process data and the persistent data according to whether the data is saved, and synchronizes the process data and the persistent data in different manners. In this way, the timeliness and stability of data synchronization are ensured.
[0193] For example, as shown in Figure 10 the first electronic device generates process data of the note application in response to a user operation during running of the first application (such as the note application), and synchronizes the process data to a second electronic device located nearby in an end-to-end synchronization manner. The second electronic device acquires and saves the process data. Subsequently, the first electronic device saves the process data of the note application to the storage module in response to a save operation of the user, and acquires persistent data of the note application. Then, the first electronic device uploads the persistent data of the note application to the cloud server. Correspondingly, the second electronic device requests to download the persistent data of the note application from the cloud server. The persistent data of the note application can include the process data of the note application acquired by the first electronic device and the second electronic device through the end-to-end synchronization manner. Therefore, the second electronic device can determine whether to retain part or all of the persistent data acquired from the cloud server through data comparison.
[0194] In this way, the consistency of data in the second electronic device and the first electronic device is ensured, and data conflicts between different devices are avoided.
[0195] In some embodiments, the first electronic device receives a second operation of the user on the first application, acquires fourth data of the first application generated by the second operation, and the fourth data is data that has been saved to the storage module. Under a preset condition, the first electronic device sends the fourth data to the second electronic device. Correspondingly, the second electronic device receives the fourth data sent by the second electronic device under the preset condition. The preset condition includes one or more of the following: failure to send the fourth data to the cloud server, not starting the cloud synchronization function, insufficient cloud space capacity, and higher priority of the end-to-end synchronization than the end-to-cloud synchronization.
[0196] For example, as shown in Figure 10 the first electronic device inserts pictures and videos in the note application in response to an edit operation of the user during running of the note application. After detecting a save operation of the user in the note application, the first electronic device saves persistent data of the note application in the storage module. Then, the first electronic device determines that the cloud synchronization function is not started, and detects a second electronic device located nearby. The persistent data of the note application can be synchronized to the second electronic device through the end-to-end synchronization manner as needed. Subsequently, the first electronic device detects that the user starts the cloud synchronization function, and can upload the persistent data of the note application that has not been uploaded to the cloud server to the cloud server.
[0197] In this way, the first electronic device and the second electronic device can flexibly realize data synchronization between different devices according to the data type, the current data synchronization scenario, and the multiple data synchronization modes of process data end-to-end synchronization, persistent data end-to-cloud synchronization, and persistent data on-demand end-to-end synchronization.
[0198] In some embodiments, the second electronic device receives second data information of fifth data sent by the cloud server, the fifth data being data of the first application sent by the first electronic device to the cloud server. The second electronic device requests the cloud server to download sixth data in the fifth data that has not been synchronized with the first electronic device according to the second data information, the sixth data not including the fourth data.
[0199] In this way, the second electronic device can pull data from the cloud server on demand according to the actual data synchronization situation, without repeatedly downloading data that has been synchronized.
[0200] In some embodiments, the first electronic device receives a third operation of the first application by the user, obtains seventh data of the first application generated by the third operation, the seventh data being data that has been saved to the storage module, and the data amount of the seventh data being greater than a preset threshold. Under a preset condition, the first electronic device sends first information of the seventh data to the second electronic device. The first information includes the storage address and / or thumbnail information of the seventh data. Correspondingly, the second electronic device receives the first information of the seventh data sent by the first electronic device under the preset condition.
[0201] For example, in the process of on-demand end-to-end synchronization of persistent data between the first electronic device and the second electronic device, the first electronic device determines that the amount of newly added picture data in the note application is small, and can directly synchronize the attachment through end-to-end synchronization; the first electronic device determines that the amount of newly added video data in the note application is large, and can synchronize the URL of the video through end-to-end synchronization. Then, subsequently, after the second electronic device obtains the persistent data of the note application from the cloud server, it can discard the synchronized pictures and save the video of which the attachment content has not been synchronized.
[0202] In this way, the first electronic device can synchronize the persistent data with the second electronic device according to the data amount, thereby improving the end-to-end synchronization efficiency of the persistent data.
[0203] The above Figures 6-11 The data synchronization method provided by the embodiments of the present application is described in detail. The following Figure 12 and Figure 13 The first electronic device and the second electronic device provided by the embodiments of the present application are described in detail.
[0204] In a possible design, Figure 12This is a schematic diagram of the structure of a first electronic device provided in an embodiment of this application. Figure 12 As shown, the first electronic device 1200 may include a display unit 1201, a processing unit 1202, and a transceiver unit 1203. The first electronic device 1200 can be used to implement the functions of the first electronic device involved in the above method embodiments.
[0205] Optionally, the display unit 1201 is used to support the first electronic device 1200 in displaying interface content; and / or to support the first electronic device 1200 in performing... Figure 11 S1101 in the middle.
[0206] Optionally, the processing unit 1202 is used to support the first electronic device 1200 in performing operations. Figure 11 S1102 in the middle.
[0207] Optionally, the transceiver unit 1203 is used to support the first electronic device 1200 in performing... Figure 11 S1103 and S1104 in the example.
[0208] The transceiver unit may include a receiving unit and a transmitting unit, and may be implemented by a transceiver or transceiver-related circuit components, and may be a transceiver or transceiver module. The operation and / or function of each unit in the first electronic device 1200 are respectively to implement the corresponding process of the data synchronization method described in the above method embodiments. All relevant content of each step involved in the above method embodiments can be referred to the functional description of the corresponding functional unit, and will not be repeated here for the sake of brevity.
[0209] Optionally, Figure 12 The first electronic device 1200 shown may also include a storage unit ( Figure 12 (not shown in the image), this storage unit stores a program or instruction. When the display unit 1201, processing unit 1202, and transceiver unit 1203 execute the program or instruction, it causes... Figure 12 The first electronic device 1200 shown can perform the data synchronization method described in the above method embodiments.
[0210] Figure 12 The technical effects of the first electronic device 1200 shown can be referred to the technical effects of the data synchronization method described in the above method embodiments, and will not be repeated here.
[0211] In addition to being in the form of the first electronic device 1200, the technical solutions provided in this application may also be functional units or chips in the first electronic device, or devices used in conjunction with the first electronic device.
[0212] In one possible design, Figure 13This is a schematic diagram of the structure of the second electronic device provided in an embodiment of this application. Figure 13 As shown, the second electronic device 1300 may include a transceiver unit 1301 and a processing unit 1302. The second electronic device 1300 can be used to implement the functions of the second electronic device involved in the above method embodiments.
[0213] Optionally, the transceiver unit 1301 is used to support the second electronic device 1300 in performing [operations]. Figure 11 S1103 and S1105 in the example.
[0214] Optionally, the processing unit 1302 is configured to support the second electronic device 1300 in comparing data received from the first electronic device with data downloaded from the cloud server, thereby determining which data is not duplicated in the synchronization.
[0215] The transceiver unit may include a receiving unit and a transmitting unit, and may be implemented by a transceiver or transceiver-related circuit components, and may be a transceiver or transceiver module. The operation and / or function of each unit in the second electronic device 1300 are respectively to implement the corresponding process of the data synchronization method described in the above method embodiments. All relevant content of each step involved in the above method embodiments can be referred to the functional description of the corresponding functional unit, and for the sake of brevity, it will not be repeated here.
[0216] Optionally, Figure 13 The second electronic device 1300 shown may also include a storage unit ( Figure 13 (not shown in the image), this storage unit stores a program or instruction. When the transceiver unit 1301 and the processing unit 1302 execute the program or instruction, it causes... Figure 13 The second electronic device 1300 shown can perform the data synchronization method described in the above method embodiments.
[0217] Figure 13 The technical effects of the second electronic device 1300 shown can be referred to the technical effects of the data synchronization method described in the above method embodiments, and will not be repeated here. In addition to being in the form of a second electronic device 1300, the technical solution provided in this application can also be a functional unit or chip in a second electronic device, or a device used in conjunction with a second electronic device.
[0218] This application also provides a chip system, including: a processor coupled to a memory, the memory being used to store programs or instructions, wherein when the program or instructions are executed by the processor, the chip system implements the methods in any of the above method embodiments.
[0219] Optionally, the processor in the chip system can be one or more. The processor can be implemented by hardware or software. When implemented by hardware, the processor can be a logic circuit, an integrated circuit, etc. When implemented by software, the processor can be a general-purpose processor, which is implemented by reading software codes stored in a memory.
[0220] Optionally, the memory in the chip system can also be one or more. The memory can be integrated with the processor or arranged separately from the processor, and the embodiments of the present application do not limit the same. For example, the memory can be a non-transient processor, such as a read-only memory (ROM), which can be integrated on the same chip as the processor or arranged on different chips, and the embodiments of the present application do not limit the type of memory or the arrangement of the memory and the processor.
[0221] For example, the chip system can be a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on chip (SoC), a central processor unit (CPU), a network processor (NP), a digital signal processor (DSP), a micro controller unit (MCU), a programmable logic device (PLD), or other integrated chips.
[0222] It should be understood that each step in the above method embodiments can be completed by the integrated logic circuit of hardware in the processor or the instructions in the form of software. The method steps disclosed in conjunction with the embodiments of the present application can be directly embodied as hardware processor execution or executed by a combination of hardware and software modules in the processor.
[0223] The embodiments of the present application also provide a computer readable storage medium, which stores a computer program. When the computer program is run on a computer, the computer is caused to execute the above related steps to implement the data synchronization method in the above embodiments.
[0224] The embodiment of the present application further provides a computer program product, which, when running on a computer, causes the computer to execute the related steps to realize the data synchronization method in the above embodiment.
[0225] In addition, the embodiment of the present application further provides an apparatus. The apparatus can be specifically a component or a module, and can include one or more processors and memories connected thereto. The memories are used to store computer programs. When the computer programs are executed by the one or more processors, the apparatus executes the data synchronization method in the above method embodiments.
[0226] The apparatus, the computer readable storage medium, the computer program product or the chip provided by the embodiment of the present application are used to execute the corresponding method provided above. Therefore, the beneficial effects achieved thereby can refer to the beneficial effects of the corresponding method provided above, which will not be described here again.
[0227] The steps of the method or algorithm described in connection with the embodiments disclosed herein can be implemented in hardware, or be implemented by a processor executing software instructions. The software instructions can be composed of corresponding software modules, which can be stored in a random access memory (RAM), a flash memory, a read only memory (ROM), an erasable programmable ROM (EPROM), an electrically EPROM (EEPROM), a register, a hard disk, a mobile hard disk, a compact disk (CD-ROM) or any other form of storage medium well known in the art. An exemplary storage medium is coupled to the processor, so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be an integral part of the processor. The processor and the storage medium can be located in an application specific integrated circuit (ASIC).
[0228] From the above description of the embodiments, those skilled in the art can clearly understand that, for the convenience and brevity of description, only the division of the above functional modules is taken as an example for illustration. In actual application, the above functions can be completed by different functional modules according to needs; that is, the internal structure of the apparatus is divided into different functional modules to complete all or part of the functions described above. The specific working process of the above-described system, apparatus and unit can refer to the corresponding process in the foregoing method embodiments, which will not be described here again.
[0229] In several embodiments provided in the present application, it should be understood that the disclosed methods can be implemented in other ways. The above-described device embodiments are only illustrative. For example, the division of the modules or units is only a logical function division, and actual implementation can have another division manner; for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the displayed or discussed units can be indirect coupling or communication connection through some interfaces, modules or units, which can be electrical, mechanical or other forms.
[0230] In addition, each functional unit in each embodiment of the present application can be integrated in one processing unit, or each unit can be physically present separately, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software functional unit.
[0231] The computer readable storage medium includes, but is not limited to, any one of the following: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various media capable of storing program codes.
[0232] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited to this. Any change or replacement within the technical scope disclosed in the present application should be covered in the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. A data synchronization system, characterized by, The system comprises a first electronic device and a second electronic device, and a short-distance communication connection is established between the first electronic device and the second electronic device; The first electronic device is configured to: display an interface of a first application; receive a first operation of the first application by a user, and acquire first data and second data of the first application generated by the first operation, wherein the first data is data that has not been saved to a storage module of the first electronic device, and the second data is data that has been saved to the storage module; send the first data to the second electronic device, and send the second data to a cloud server; The second electronic device is configured to: receive the first data sent by the first electronic device, and download the second data from the cloud server.
2. The system of claim 1, wherein: the second electronic device is further configured to: acquire first data information of third data sent by the cloud server, wherein the third data comprises data that has been saved to the storage module from among the second data and the first data; according to the first data information, request the cloud server to download second data in the third data that has not been end-to-end synchronized with the first electronic device.
3. The system of claim 1 or 2, wherein: the first electronic device is further configured to: receive a second operation of the first application by a user, and acquire fourth data of the first application generated by the second operation, wherein the fourth data is data that has been saved to the storage module; under a preset condition, send the fourth data to the second electronic device, wherein the preset condition comprises one or more of the following: failure to send the fourth data to the cloud server, not starting a cloud synchronization function, insufficient cloud space capacity, and a priority of end-to-end synchronization being higher than a priority of end-to-cloud synchronization; the second electronic device is further configured to: receive the fourth data sent by the first electronic device.
4. The system of claim 3, wherein: the second electronic device is further configured to: receive second data information of fifth data sent by the cloud server, wherein the fifth data is data of the first application sent by the first electronic device to the cloud server; according to the second data information, request the cloud server to download sixth data in the fifth data that has not been end-to-end synchronized with the first electronic device, wherein the sixth data does not comprise the fourth data.
5. A data synchronization method, characterized by, The method applied to a first electronic device comprises: displaying an interface of a first application; receiving a first operation of the first application by a user, and acquiring first data and second data of the first application generated by the first operation, wherein the first data is data that has not been saved to a storage module of the first electronic device, and the second data is data that has been saved to the storage module; sending the first data to a second electronic device, and sending the second data to a cloud server.
6. The method of claim 5, wherein, The sending of the first data to the second electronic device comprises: The first data is sent to the second electronic device through a short-distance communication mode, and the short-distance communication mode includes at least one of a Bluetooth point-to-point connection (P2P) communication mode, a wireless fidelity (Wi-Fi) P2P communication mode, and a local area network communication mode.
7. The method according to claim 5 or 6, characterized in that, The method further includes: receiving a second operation of the first application by a user, and obtaining fourth data of the first application generated by the second operation, the fourth data being data that has been saved to the storage module; under a preset condition, sending the fourth data to the second electronic device, the preset condition including one or more of the following: failure to send the fourth data to the cloud server, not starting a cloud synchronization function, insufficient cloud space capacity, and a priority of end-to-end synchronization being higher than a priority of end-to-cloud synchronization.
8. The method of claim 7, wherein, The method further includes: receiving a third operation of the first application by a user, and obtaining seventh data of the first application generated by the third operation, the seventh data being data that has been saved to the storage module, and a data amount of the seventh data being greater than a preset threshold; under the preset condition, sending first information of the seventh data to the second electronic device, the first information including a storage address of the seventh data and / or thumbnail information.
9. The method according to any one of claims 5-8, characterized in that, The method further includes: saving the first data to the storage module upon receiving a data saving operation by a user or detecting that a data saving period is met; sending the first data in the storage module to the cloud server.
10. A data synchronization method, characterized by, The method applied to a second electronic device includes: receiving first data sent by a first electronic device; downloading second data sent by the first electronic device to a cloud server from the cloud server; wherein the first data and the second data are data generated by a first application in the first electronic device, the first data being data that has not been saved to a storage module of the first electronic device, and the second data being data that has been saved to the storage module of the first electronic device.
11. The method of claim 10, wherein, The receiving first data sent by a first electronic device includes: receiving the first data sent by the first electronic device through a short-distance communication mode, and the short-distance communication mode includes at least one of a Bluetooth point-to-point connection (P2P) communication mode, a wireless fidelity (Wi-Fi) P2P communication mode, and a local area network communication mode.
12. The method according to claim 10 or 11, characterized in that, The downloading second data sent by the first electronic device to a cloud server from the cloud server includes: obtaining first data information of third data sent by the cloud server, the third data including the second data and data in the first data that has been saved to the storage module; requesting the cloud server to download the second data in the third data that has not been synchronized with the first electronic device according to the first data information.
13. The method according to any one of claims 10-12, characterized in that, The method further includes: receive fourth data sent by the first electronic device under a preset condition, the fourth data being data saved by the first electronic device to the storage module; the preset condition including one or more of the following: the first electronic device fails to send the fourth data to the cloud server, the first electronic device does not start a cloud synchronization function, cloud space capacity is insufficient, and a priority of end-end synchronization is higher than a priority of end-cloud synchronization.
14. The method of claim 13, wherein, The method further includes: receiving second data information of fifth data sent by the cloud server, the fifth data being data of the first application sent by the first electronic device to the cloud server; requesting, according to the second data information, the cloud server to download sixth data in the fifth data that is not synchronized with the first electronic device in an end-end manner, the sixth data not including the fourth data.
15. The method according to claim 13 or 14, characterized in that, The method further includes: receiving first information of seventh data sent by the first electronic device under the preset condition, the seventh data being data saved by the first electronic device to the storage module, a data amount of the seventh data being greater than a preset threshold, and the first information including a storage address and / or thumbnail information of the seventh data.
16. An electronic device, comprising: including: a processor, a memory, and a display screen, the memory and the display screen being coupled with the processor, the memory being configured to store computer program code, the computer program code including computer instructions, when the processor reads the computer instructions from the memory, causing the electronic device to perform the method of any one of claims 5-9.
17. An electronic device, comprising: including: a processor and a memory, the memory being coupled with the processor, the memory being configured to store computer program code, the computer program code including computer instructions, when the processor reads the computer instructions from the memory, causing the electronic device to perform the method of any one of claims 10-15.
18. A computer-readable storage medium, characterized in that, The computer readable storage medium includes a computer program, when the computer program runs on an electronic device, causing the electronic device to perform the method of any one of claims 5-9; or, causing the electronic device to perform the method of any one of claims 10-15.
19. A computer program product, characterised in that, When the computer program product runs on a computer, causing the computer to perform the method of any one of claims 5-9; or, causing the computer to perform the method of any one of claims 10-15.
Citation Information
Patent Citations
Data synchronization method, electronic equipment and computer readable storage medium
CN113923230A
Data synchronization method and device and electronic equipment
CN115225649A