Data synchronization method, electronic equipment 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
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HUAWEI TECH CO LTD
- Filing Date
- 2024-06-11
- Publication Date
- 2026-05-01
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 transmit data through a combination of end-to-end synchronization and end-to-cloud synchronization. The appropriate transmission method is selected according to the data type to ensure the timeliness and stability of synchronization.
This approach ensures timely data synchronization while improving the stability and efficiency of data synchronization, and avoids data synchronization anomalies caused by changes in network conditions or device status.
Smart Images

Figure CN121970307A_ABST
Abstract
Description
Data synchronization methods, electronic devices and systems
[0001] This application claims priority to Chinese Patent Application No. 202311162897.3, filed with the State Intellectual Property Office of China on September 6, 2023, entitled “Data Synchronization Method, Electronic Device and System”, the entire contents of which are incorporated herein by reference.
[0002] This application relates to the field of terminal technology, and in particular to a data synchronization method, electronic device and system.
[0003] With the development of terminal technology, electronic devices can establish connections with various other electronic devices to form distributed communication systems. In distributed communication systems, electronic devices can synchronize data with other devices to ensure data consistency across multiple electronic devices.
[0004] For example, while the phone is running a note-taking app, it updates the app's content in response to the user's editing. Then, the phone sends the updated notes to the tablet via a cloud server through end-to-end synchronization. This way, when the tablet launches the note-taking app in response to the user's action, it displays the latest notes edited by the user on the phone, making it convenient for the user.
[0005] However, in the above process, data synchronization between different electronic devices via end-to-cloud synchronization is difficult to guarantee in a timely manner, which affects the user experience.
[0006]
[0007] To address the aforementioned technical problems, this application provides a data synchronization method, electronic device, and system. The technical solution provided by this application, after generating data to be synchronized, separates procedural data and persistent data for synchronization based on the data type, thereby ensuring both the timeliness and stability of data synchronization.
[0008] To achieve the above-mentioned technical objectives, this application provides the following technical solution:
[0009] In a first aspect, a data synchronization method is provided, applied to a first electronic device. The method includes: displaying an interface of a first application; receiving a first operation from a user on the first application; acquiring first data and second data of the first application generated by the first operation, wherein the first data is data not saved to the storage module of the first electronic device, and the second data is 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.
[0010] In some examples, data types include procedural data and persistent data. The first electronic device can distinguish between procedural data and persistent data based on whether or not it saves the generated data to the storage module. For example, if the first electronic device saves the generated data to the storage module, the data in the storage module is persistent data; data not saved to the storage module by the first electronic device is procedural data. 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, mechanical hard disk, solid-state drive, or magnetic disk.
[0011] In this way, the first and second electronic devices can flexibly achieve data synchronization between different devices through various data synchronization methods, such as procedural end-to-end data synchronization and persistent end-to-cloud data synchronization, depending on the data type. This ensures both the timeliness and stability of data synchronization.
[0012] According to the first aspect, sending first data to the second electronic device includes: sending first data to the second electronic device via a short-range communication method, wherein the short-range communication method includes at least one of Bluetooth point-to-point connection P2P communication method, Wi-Fi P2P communication method, and local area network communication method.
[0013] In this way, after acquiring the procedural data (i.e., the first data), the first electronic device directly sends the procedural data to the second electronic device. By using end-to-end synchronization, the efficiency of data synchronization is improved.
[0014] According to the first aspect, or any implementation of the first aspect above, the method further includes: receiving a second operation by the user on the first application, and obtaining fourth data of the first application generated by the second operation, wherein the fourth data is data already saved to the storage module. Under preset conditions, the fourth data is sent to a second electronic device, wherein the preset conditions include one or more of the following: failure to send the fourth data to the cloud server, cloud synchronization function not enabled, insufficient cloud space capacity, and the priority of end-to-end synchronization being higher than the priority of end-to-cloud synchronization.
[0015] In this way, persistent data is synchronized on demand between the first and second electronic devices through end-to-end synchronization, avoiding data synchronization anomalies caused by the inability to perform end-to-cloud synchronization, which would affect user experience.
[0016] Furthermore, in some scenarios, end-to-end synchronization can achieve better data synchronization efficiency. Therefore, the first electronic device can directly choose to synchronize persistent data through end-to-end synchronization. For example, if the first electronic device determines that end-to-end synchronization is more efficient than end-to-cloud synchronization based on factors such as the current network status, the first electronic device can send all data (including procedural data and persistent data) to the second electronic device through end-to-end synchronization.
[0017] According to the first aspect, or any implementation of the first aspect above, the method further includes: receiving a third operation by a user on a first application, obtaining seventh data of the first application generated by the third operation, wherein the seventh data is data already saved to a storage module, and the amount of the seventh data is greater than a preset threshold. Under preset conditions, sending first information of the seventh data to a second electronic device, wherein the first information includes the storage address and / or abbreviation information of the seventh data.
[0018] 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 the 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 address 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.
[0019] In this way, the first electronic device can synchronize persistent data with the second electronic device end-to-end according to the amount of data, thereby improving the end-to-end synchronization efficiency of persistent data.
[0020] According to the first aspect, or any implementation of the first aspect above, the method further includes: receiving a user's data saving operation or detecting that the data saving period has been met, saving the first data to the storage module; and sending the first data from the storage module to the cloud server.
[0021] For example, if the first electronic device responds to a user's operation and saves procedural data to the storage module, then this procedural data becomes persistent data. The first electronic device then sends the persistent data to the cloud server according to a preset period, or after confirming that it has been acquired.
[0022] For example, the first application is configured with an auto-save function, automatically saving procedural data according to a preset period. Then, after the first electronic device obtains the latest persistent data saved in the storage module, it can send the persistent data to the cloud server.
[0023] In this way, the first electronic device distinguishes between procedural data and persistent data based on whether the data is saved, and synchronizes the procedural data and persistent data in different ways. This ensures both the timeliness and stability of data synchronization.
[0024] Secondly, a data synchronization method is provided, applied to a second electronic device. The method includes: receiving first data sent by a first electronic device; and downloading second data sent by the first electronic device to a cloud server from a 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 not saved to the storage module of the first electronic device, and the second data being data already saved to the storage module of the first electronic device.
[0025] According to the second aspect, receiving first data sent by the first electronic device includes: receiving first data sent by the first electronic device through a short-range communication method, wherein the short-range communication method includes at least one of Bluetooth point-to-point connection P2P communication method, Wi-Fi P2P communication method, and local area network communication method.
[0026] According to the second aspect, or any implementation thereof, downloading the second data sent by the first electronic device to the cloud server includes: obtaining first data information of the third data sent by the cloud server, wherein the third data includes the second data and data in the first data already saved to the storage module. Based on the first data information, requesting the cloud server to download the second data in the third data that has not been synchronized end-to-end with the first electronic device.
[0027] 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.
[0028] According to the second aspect, or any implementation of the second aspect above, the method further includes: receiving fourth data sent by the second electronic device under preset conditions, wherein the fourth data is data that the first electronic device has saved to the storage module; the preset conditions include 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 the cloud synchronization function, the cloud space capacity is insufficient, and the priority of end-to-end synchronization is higher than the priority of end-to-cloud synchronization.
[0029] According to the second aspect, or any implementation of the second aspect above, the method further includes: receiving second data information of the 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. Based on the second data information, requesting the cloud server to download a sixth data portion of the fifth data that has not been synchronized with the first electronic device, wherein the sixth data does not include the fourth data.
[0030] In this way, the second electronic device can retrieve data from the cloud server as needed based on the actual data synchronization status, without having to repeatedly download data that has already been synchronized.
[0031] According to the second aspect, or any implementation of the second aspect above, the method further includes: receiving first information of seventh data sent by the first electronic device under preset conditions, wherein the seventh data is data that the first electronic device has saved to the storage module, the data volume of the seventh data is greater than a preset threshold, and the first information includes the storage address and / or abbreviation information of the seventh data.
[0032] Thirdly, a first electronic device is provided. The first electronic device includes: a processor, a memory, and a display screen, the memory and display screen being coupled to the processor. The memory stores computer program code, which includes computer instructions. When the processor reads the computer instructions from the memory, the first electronic device executes the following: displaying an interface of a first application; receiving a first operation from a user on the first application; acquiring first data and second data of the first application generated by the first operation, the first data being data not yet saved to the 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.
[0033] According to the third aspect, sending first data to the second electronic device includes: sending first data to the second electronic device via a short-range communication method, wherein the short-range communication method includes at least one of Bluetooth point-to-point connection P2P communication method, Wi-Fi P2P communication method, and local area network communication method.
[0034] According to the third aspect, or any implementation of the third aspect above, when the processor reads computer instructions from the memory, it also causes the first electronic device to perform: receiving a second operation from the user on the first application, and obtaining fourth data of the first application generated by the second operation, wherein the fourth data is data already saved to the storage module. Under preset conditions, the fourth data is sent to the second electronic device, wherein the preset conditions include one or more of the following: failure to send the fourth data to the cloud server, cloud synchronization function not enabled, insufficient cloud space capacity, and the priority of end-to-end synchronization being higher than the priority of end-to-cloud synchronization.
[0035] According to the third aspect, or any implementation of the third aspect above, when the processor reads computer instructions from memory, it further causes the first electronic device to perform: receiving a third operation by the user on the first application, acquiring seventh data of the first application generated by the third operation, wherein the seventh data is data already saved to the storage module, and the amount of the seventh data is greater than a preset threshold. Under preset conditions, sending first information of the seventh data to the second electronic device, wherein the first information includes the storage address and / or abbreviation information of the seventh data.
[0036] According to the third aspect, or any implementation of the third aspect above, when the processor reads computer instructions from the memory, it also causes the first electronic device to perform: receiving user data saving operations or detecting that the data saving period has been met, saving the first data to the storage module; and sending the first data in the storage module to the cloud server.
[0037] Fourthly, a second electronic device is provided. The second electronic device includes a processor and a memory, the memory being coupled to the processor. The memory stores computer program code, which includes computer instructions. When the processor reads the computer instructions from the memory, the second electronic device performs the following actions: receiving first data sent by a first electronic device; and downloading second data sent by the first electronic device to a cloud server. The first data and the second data are data generated by a first application in the first electronic device, the first data being data not yet saved to the storage module of the first electronic device, and the second data being data already saved to the storage module of the first electronic device.
[0038] According to the fourth aspect, receiving first data sent by the first electronic device includes: receiving first data sent by the first electronic device through a short-range communication method, wherein the short-range communication method includes at least one of Bluetooth point-to-point connection P2P communication method, Wi-Fi P2P communication method, and local area network communication method.
[0039] According to the fourth aspect, or any implementation of the fourth aspect above, downloading the second data sent by the first electronic device to the cloud server includes: obtaining first data information of the third data sent by the cloud server, wherein the third data includes the second data and data in the first data that has been saved to the storage module. Based on the first data information, requesting the cloud server to download the second data in the third data that has not been synchronized end-to-end with the first electronic device.
[0040] According to the fourth aspect, or any implementation of the fourth aspect above, when the processor reads computer instructions from the memory, it also causes the second electronic device to execute: receiving fourth data sent by the first electronic device under preset conditions, wherein the fourth data is data that the first electronic device has saved to the storage module; the preset conditions include 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 the cloud synchronization function, the cloud space capacity is insufficient, and the priority of end-to-end synchronization is higher than the priority of end-to-cloud synchronization.
[0041] According to the fourth aspect, or any implementation of the fourth aspect above, when the processor reads computer instructions from memory, it also causes the second electronic device to execute: receiving second data information from the cloud server, where the fifth data is data from the first application sent by the first electronic device to the cloud server; and requesting the cloud server to download sixth data from the fifth data that has not been synchronized end-to-end with the first electronic device, where the sixth data does not include the fourth data.
[0042] According to the fourth aspect, or any implementation of the fourth aspect above, when the processor reads computer instructions from the memory, it also causes the second electronic device to execute: receiving first information of the seventh data sent by the first electronic device under preset conditions, wherein the seventh data is data that the first electronic device has saved to the storage module, the amount of the seventh data is greater than a preset threshold, and the first information includes the storage address and / or abbreviation information of the seventh data.
[0043] Fifthly, a data synchronization system is provided, comprising a first electronic device and a second electronic device, wherein a short-range communication connection is established between the first electronic device and the second electronic device. The first electronic device is used to: display the interface of a first application; receive a first operation performed by a user on the first application; acquire first data and second data of the first application generated by the first operation, wherein the first data is data not yet saved to the storage module of the first electronic device, and the second data is data already 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 used to: receive the first data sent by the first electronic device, and download the second data from the cloud server.
[0044] According to the fifth aspect, the second electronic device is further configured to: acquire first data information of the third data sent by the cloud server, wherein the third data includes the second data and data from the first data that has been saved to the storage module; and, based on the first data information, request the cloud server to download the second data from the third data that has not been synchronized end-to-end with the first electronic device.
[0045] According to the fifth aspect, or any implementation of the fifth aspect above, the first electronic device is further configured to: receive a second operation by the user on the first application, and obtain fourth data of the first application generated by the second operation, wherein the fourth data is data already saved to the storage module. Under preset conditions, the fourth data is sent to the second electronic device, wherein the preset conditions include one or more of the following: failure to send the fourth data to the cloud server, cloud synchronization function not enabled, insufficient cloud space capacity, and end-to-end synchronization having a higher priority than end-to-cloud synchronization. The second electronic device is further configured to: receive the fourth data sent by the first electronic device.
[0046] According to the fifth aspect, or any implementation thereof, the second electronic device is further configured to: receive second data information of the 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, based on the second data information, request the cloud server to download sixth data from the fifth data that has not been synchronized end-to-end with the first electronic device, wherein the sixth data does not include the fourth data.
[0047] Sixthly, an electronic device is provided, which has the function of implementing the data synchronization method as described in the first aspect and any of its possible implementations; or, the electronic device has the function of implementing the data synchronization method as described in the second aspect and any of its possible implementations. This function can be implemented in hardware or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above-described function.
[0048] A seventh aspect provides a computer-readable storage medium. The computer-readable storage medium stores a computer program (also referred to as instructions or code) that, when executed by an electronic device, causes the electronic device to perform the method of the first aspect or any embodiment thereof; or causes the electronic device to perform the method of the second aspect or any embodiment thereof.
[0049] Eighthly, a computer program product is provided that, when run on an electronic device, causes the electronic device to perform the method of the first aspect or any one of the embodiments of the first aspect; or causes the electronic device to perform the method of the second aspect or any one of the embodiments of the second aspect.
[0050] A ninth aspect provides a circuit system including a processing circuit configured to perform the method of the first aspect or any embodiment thereof; or, the processing circuit is configured to perform the method of the second aspect or any embodiment thereof.
[0051] In a tenth aspect, a chip system is provided, including at least one processor and at least one interface circuit, wherein the at least one interface circuit is configured to perform transceiver functions and send instructions to the at least one processor, wherein when the at least one processor executes the instructions, the at least one processor performs the method of the first aspect or any embodiment thereof; or, the at least one processor performs the method of the second aspect or any embodiment thereof.
[0052] The technical effects of the aforementioned aspects can be referenced from each other, and will not be elaborated further here.
[0053] Figure 1 is a schematic diagram of the end-to-cloud data synchronization scenario provided in an embodiment of this application;
[0054] Figure 2 is a schematic diagram of the end-to-end data synchronization scenario provided in an embodiment of this application;
[0055] Figure 3 is a schematic diagram of a communication system in which the data synchronization method provided in the embodiments of this application is applied;
[0056] Figure 4 is a schematic diagram of the hardware structure of the first electronic device provided in an embodiment of this application;
[0057] Figure 5 is a schematic diagram of the software structure provided in an embodiment of this application;
[0058] Figure 6 is a schematic diagram of a scenario for process-based end-to-end data synchronization provided in an embodiment of this application;
[0059] Figure 7 is a schematic diagram of a persistent data terminal cloud data synchronization scenario provided in an embodiment of this application;
[0060] Figure 8 is a schematic diagram of a scenario for on-demand end-to-end data synchronization of persistent data provided in an embodiment of this application;
[0061] Figure 9 is a schematic diagram of a scenario for on-demand end-to-end data synchronization of persistent data provided in an embodiment of this application;
[0062] Figure 10 is a schematic diagram of a scenario where data synchronization is adaptively performed based on data type and data synchronization scenario, as provided in an embodiment of this application.
[0063] Figure 11 is a flowchart illustrating the data synchronization method provided in an embodiment of this application;
[0064] Figure 12 is a schematic diagram of the structure of the first electronic device provided in an embodiment of this application;
[0065] Figure 13 is a schematic diagram of the structure of the second electronic device provided in an embodiment of this application.
[0066] The technical solutions of the embodiments of this application are described below with reference to the accompanying drawings. In the description of the embodiments of this application, the terminology used in the following embodiments is for the purpose of describing specific embodiments only and is not intended to be a limitation of this application. As used in the specification and appended claims of this application, the singular expressions “a,” “an,” “the,” “the,” “the,” and “this” are intended to include expressions such as “one or more,” unless the context clearly indicates otherwise. It should also be understood that in the following embodiments of this application, “at least one” and “one or more” refer to one or more (including two).
[0067] References to "one embodiment" or "some embodiments" in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized. The term "connection" includes direct connections and indirect connections, unless otherwise stated. "First" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated.
[0068] In the embodiments of this application, the words "exemplarily" or "for example" are used to indicate examples, illustrations, or explanations. Any embodiment or design described as "exemplarily" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design solutions. Specifically, the use of the words "exemplarily" or "for example" is intended to present the relevant concepts in a specific manner.
[0069] In some embodiments, multiple electronic devices in a distributed communication system can synchronize data through end-to-cloud synchronization, thereby ensuring data consistency across multiple devices.
[0070] For example, as shown in Figure 1, when electronic device A is running a note-taking application, it updates the note-taking application content in response to the user's editing operation and saves the updated note content to the storage module. Then, electronic device A sends the note content (i.e., data A) from the storage module to the cloud server via end-to-cloud synchronization. Electronic device B can then download this note content from the cloud server. Thus, when electronic device B responds to user operations and launches the note-taking application, the displayed note content is the latest note content edited by the user on electronic device A, providing convenience for the user.
[0071] However, in the above process, data synchronization between different electronic devices via end-to-end cloud synchronization is difficult to guarantee in a timely manner, affecting the user experience. For example, if the phone determines that it needs to send updated notes to the cloud server, but the current network quality is poor and the transmission fails, then because the phone cannot upload the updated notes to the cloud server, the tablet also cannot obtain the latest notes. Therefore, if the user opens the notes app on the tablet at this time, they will not be able to view the latest notes.
[0072] In addition, some electronic devices lack cloud synchronization functionality or have it disabled, preventing them from synchronizing data with other devices via end-to-end cloud synchronization. Alternatively, some electronic devices may be configured to only perform cloud data synchronization when using a wireless network, thus hindering the timeliness of data synchronization when using mobile data.
[0073] In other embodiments, multiple electronic devices in a distributed communication system can synchronize data through end-to-end synchronization, thereby ensuring the consistency of data across multiple devices.
[0074] For example, as shown in Figure 2, when electronic device A is running a note-taking application, it updates the note content in response to the user's editing operation, generating procedural data for the note-taking application. During this process, electronic device A detects electronic device B located nearby and establishes a communication connection with electronic device B. Therefore, electronic device A can synchronize the updated procedural data (i.e., data A) from the note-taking application to electronic device B in real time. Thus, after electronic device B responds to the user's operation and launches the note-taking application, it can display the latest note content edited by the user on electronic device A in real time, facilitating user access.
[0075] However, in the above process, the stability of the end-to-end connection between devices is poor, and it is prone to interruption. Furthermore, the data transmission speed is slow, affecting the efficiency of data synchronization between different electronic devices through end-to-end synchronization.
[0076] Furthermore, electronic devices can only perform end-to-end data synchronization when using wireless networks, but cannot perform end-to-end data synchronization when using carrier data traffic, which affects the timeliness of data synchronization.
[0077] In some other embodiments, cursor synchronization is achieved between different electronic devices through end-to-end data synchronization, while other data is synchronized via end-to-cloud synchronization. However, the aforementioned technical problems still exist in this solution.
[0078] Therefore, this application provides a data synchronization method in which, after generating data to be synchronized, the electronic device separates procedural data and persistent data for synchronization according to the data type of the data to be synchronized, thereby ensuring both the timeliness and stability of data synchronization.
[0079] Figure 3 is a schematic diagram of a communication system in which the data synchronization method provided in this application is applied. As shown in Figure 3, the communication system includes a first electronic device 100, a second electronic device 200, and a server 300.
[0080] Optionally, the first electronic device 100 or the second electronic device 200 may be, for example, a mobile phone, tablet computer, laptop computer, smart screen, wearable device, vehicle terminal, ultra-mobile personal computer (UMPC), netbook, personal digital assistant (PDA), artificial intelligence (AI) device, or other terminal device. The operating system installed on the first electronic device 100 or the second electronic device 200 may include, but is not limited to, […]. Alternatively, other operating systems may be used. This application does not limit the specific type of the first electronic device 100 or the second electronic device 200, or the operating system installed thereon.
[0081] Optionally, server 300 can be a device or server with computing capabilities, such as a cloud server or a network server. The aforementioned server can be a single server, a server cluster consisting of multiple servers, or a cloud computing service center.
[0082] In some embodiments, the first electronic device 100 is the electronic device that generates the data to be synchronized, and the second electronic device 200 is the electronic device to which the data is to be synchronized. After generating the data to be synchronized, the first electronic device 100 determines the data type and sends the procedural data to the second electronic device 200 through end-to-end synchronization; and sends the persistent data to the second electronic device 200 through end-to-cloud synchronization.
[0083] Optionally, the first electronic device 100 and the second electronic device 200 in the embodiments of this application can be implemented by the same or different devices. Different devices can have the same, similar or different hardware structures, such as the hardware structure shown in Figure 4.
[0084] For example, taking the first electronic device 100 having the hardware structure shown in FIG4 as an example, the hardware structure shown in FIG4 will be described.
[0085] As shown in Figure 4, the first electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging 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 button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc.
[0086] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the first electronic device 100. In other embodiments of this application, the first electronic device 100 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0087] Processor 110 may include one or more processing units, such as application processors (APs), modem processors, graphics processing units (GPUs), image signal processors (ISPs), controllers, video codecs, digital signal processors (DSPs), baseband processors, and / or neural network processing units (NPUs). These different processing units may be independent devices or integrated into one or more processors.
[0088] The controller can generate operation control signals based on the instruction opcode and timing signals to complete the control of instruction fetching and execution.
[0089] The processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory can store instructions or data that the processor 110 has just used or that are used repeatedly. If the processor 110 needs to use the instruction or data again, it can retrieve it directly from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0090] In some embodiments, the processor 110 may include one or more interfaces. Interfaces may 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.
[0091] 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 may include multiple I2C buses. The processor 110 can couple to a touch sensor, charger, flash, camera 193, etc., through different I2C bus interfaces. For example, the processor 110 can couple to a touch sensor through the I2C interface, enabling the processor 110 and the touch sensor to communicate through the I2C bus interface, thereby realizing the touch function of the first electronic device 100.
[0092] The MIPI interface can be used to connect the processor 110 to peripheral devices such as the display screen 194 and the camera 193. The MIPI interface includes a camera serial interface (CSI) and a display serial interface (DSI). In some embodiments, the processor 110 and the camera 193 communicate via the CSI interface to enable the shooting function of the first electronic device 100. The processor 110 and the display screen 194 communicate via the DSI interface to enable the display function of the first electronic device 100.
[0093] USB interface 130 is a USB standard compliant interface, specifically a Mini USB interface, Micro USB interface, USB Type-C interface, etc. USB interface 130 can be used to connect a charger to charge the first electronic device 100, and can also be used for data transfer between the first electronic device 100 and peripheral devices. It can also be used to connect headphones for audio playback. This interface can also be used to connect other electronic devices, such as AR devices.
[0094] It is understood that the interface connection relationships between the modules illustrated in the embodiments of this application are merely illustrative and do not constitute a structural limitation on the first electronic device 100. In other embodiments of this application, the first electronic device 100 may also adopt different interface connection methods or a combination of multiple interface connection methods as described in the above embodiments.
[0095] The charging management module 140 receives 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 receives charging input from the wired charger via a USB interface 130. In some wireless charging embodiments, the charging management module 140 receives wireless charging input via the wireless charging coil of the first electronic device 100. While charging the battery 142, the charging management module 140 can also supply power to the electronic device via the power management module 141.
[0096] The power management module 141 connects the battery 142, the charging management module 140, and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, providing power to the processor 110, internal memory 121, display screen 194, camera 193, and wireless communication module 160, etc. The power management module 141 can also monitor parameters such as battery capacity, battery cycle count, and battery health status (leakage current, impedance). In some other embodiments, the power management module 141 may also be located within the processor 110. In other embodiments, the power management module 141 and the charging management module 140 may be located in the same device.
[0097] The wireless communication function of the first electronic device 100 can be implemented through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor, and baseband processor.
[0098] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in the first electronic device 100 can be used to cover one or more communication frequency bands. Different antennas can also be multiplexed to improve antenna utilization. For example, 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 conjunction with a tuning switch.
[0099] The mobile communication module 150 can provide solutions for wireless communication, including 2G / 3G / 4G / 5G, applied to the first electronic device 100. The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves via antenna 1, and perform filtering, amplification, and other processing on the received electromagnetic waves before transmitting them to a modem processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modem processor and convert it into electromagnetic waves for radiation via antenna 1. In some embodiments, at least some functional modules of the mobile communication module 150 may be housed in the processor 110. In some embodiments, at least some functional modules of the mobile communication module 150 and at least some modules of the processor 110 may be housed in the same device.
[0100] The modem processor may include a modulator and a demodulator. The modulator modulates the low-frequency baseband signal to be transmitted into a mid-to-high frequency signal. The demodulator demodulates the 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. After processing by the baseband processor, the low-frequency baseband signal is transmitted to the application processor. The application processor outputs a sound signal through an audio device or displays an image or video through the display screen 194. In some embodiments, the modem processor may be a separate device. In other embodiments, the modem processor may be independent of the processor 110 and may be housed in the same device as the mobile communication module 150 or other functional modules.
[0101] The wireless communication module 160 can provide solutions for wireless communication applications on the first electronic device 100, including wireless local area networks (WLANs) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared (IR) technologies. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via antenna 2, performs frequency modulation and filtering of the electromagnetic wave signals, and sends the processed signal to processor 110. The wireless communication module 160 can also receive signals to be transmitted from processor 110, perform frequency modulation and amplification, and convert them into electromagnetic waves for radiation via antenna 2.
[0102] In some embodiments, antenna 1 of the first electronic device 100 is coupled to mobile communication module 150, and antenna 2 is coupled to wireless communication module 160, enabling the first electronic device 100 to communicate with networks and other devices via wireless communication technology. The wireless communication technology may 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 technologies, etc. The GNSS may include the Global Positioning System (GPS), the Global Navigation Satellite System (GLONASS), the BeiDou Navigation Satellite System (BDS), the Quasi-Zenith Satellite System (QZSS), and / or satellite-based augmentation systems (SBAS).
[0103] The first electronic device 100 implements display functions through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations and for graphics rendering. The processor 110 may include one or more GPUs, which execute program instructions to generate or modify display information.
[0104] Display screen 194 is used to display images, videos, etc. Display screen 194 includes a display panel. The display panel can be manufactured using a liquid crystal display (LCD), such as an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible 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 may include one or N displays 194, where N is a positive integer greater than 1.
[0105] Camera 193 is used to capture still images or videos. An object is projected onto a photosensitive element by generating an optical image through the lens. The photosensitive element can be a charge-coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, which is then passed to an ISP for conversion 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 image signals in standard RGB, YUV, or other formats. In some embodiments, the first electronic device 100 may include one or N cameras 193, where N is a positive integer greater than 1.
[0106] The external storage interface 120 can be used to connect an external storage card, such as a Micro SD card, to expand the storage capacity of the first electronic device 100. The external storage card communicates with the processor 110 through the external storage interface 120 to perform data storage functions. For example, music, video, and other files can be saved on the external storage card.
[0107] Internal memory 121 can be used to store computer executable program code, which includes instructions. Internal memory 121 may include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback, image playback, etc.), etc. The data storage area may store data created during the use of the first electronic device 100 (such as audio data, phonebook, etc.). Furthermore, internal memory 121 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc. Processor 110 executes various functional applications and data processing of the first electronic device 100 by running instructions stored in internal memory 121 and / or instructions stored in memory disposed in the processor.
[0108] The audio module 170 is used to convert digital audio information into analog audio signals for output, and also to convert analog audio input into digital audio signals. The audio module 170 can also be used for encoding and decoding audio signals. In some embodiments, the audio module 170 may be located in the processor 110, or some functional modules of the audio module 170 may be located in the processor 110. The first electronic device 100 can use the audio module 170 for functions such as music playback and recording. The audio module 170 may include a speaker, receiver, microphone, headphone jack, and application processor to implement audio functions.
[0109] The sensor module 180 may include pressure sensors, gyroscope sensors, barometric pressure sensors, magnetic sensors, accelerometers, distance sensors, proximity sensors, fingerprint sensors, temperature sensors, touch sensors, ambient light sensors, bone conduction sensors, etc.
[0110] Buttons 190 include a power button, volume buttons, etc. Buttons 190 can be mechanical buttons or touch-sensitive buttons. The first electronic device 100 can receive button input and generate key signal inputs related to user settings and function control of the first electronic device 100.
[0111] Motor 191 can generate vibration alerts. Motor 191 can be used for incoming call vibration alerts or for touch vibration feedback. Different touch operations applied to different areas of the display screen 194 will also correspond to different vibration feedback effects from motor 191. Different application scenarios (e.g., time reminders, receiving messages, alarm clocks, games, etc.) can also correspond to different vibration feedback effects.
[0112] Indicator 192 can be an indicator light, used to indicate charging status, power changes, or to indicate messages, missed calls, notifications, etc.
[0113] The SIM card interface 195 is used to connect a SIM card. The SIM card can be inserted into or removed from the SIM card interface 195 to make contact with and separate from 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.
[0114] The software system of the first electronic device 100 or the second electronic device 200 can adopt a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture. This application embodiment uses a layered Android system as an example to exemplify the software structure of the first electronic device 100 or the second electronic device 200.
[0115] Figure 5 is a software structure block diagram of the first electronic device 100 according to an embodiment of this application. The second electronic device 200 may have the same, similar or different software structures.
[0116] A layered architecture divides software into several layers, each with a clear role and function. Layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom: the application layer, the application framework layer, the Android runtime and system libraries, and the kernel layer.
[0117] The application layer can include a series of application packages.
[0118] As shown in Figure 5, the application package can include applications such as Notes, Contacts, Memos, Health, Clipboard, Gallery, Maps, Camera, and Video.
[0119] The application framework layer provides application programming interfaces (APIs) and a programming framework for applications in the application layer. The application framework layer includes some predefined functions.
[0120] As shown in Figure 5, the application framework layer may include a window manager, content provider, view system, phone manager, resource manager, notification manager, etc.
[0121] The window manager is used to manage windowed applications. It can retrieve screen size, determine the presence of a status bar, lock the screen, and capture screenshots, among other things.
[0122] Content providers store and retrieve data, making that data accessible to applications. This data can include videos, images, audio, phone calls made and received, browsing history and bookmarks, phone books, and more.
[0123] A view system includes visual controls, such as controls for displaying text and controls for displaying images. View systems can be used to build applications. A display interface can consist of one or more views. For example, a display interface including a text notification icon could include views for displaying text and views for displaying images.
[0124] The phone manager is used to provide communication functions for the first electronic device 100. For example, it manages call status (including connection, hang-up, etc.).
[0125] The file explorer provides applications with various resources, such as localized strings, icons, images, layout files, video files, and more.
[0126] The notification manager allows applications to display notifications in the status bar. These notifications can be used to deliver informational messages and can disappear automatically after a short pause, requiring no user interaction. The notification manager can also display notifications as icons or scrolling text in the system's top status bar.
[0127] The Android runtime consists of core libraries and a virtual machine. The Android runtime is responsible for scheduling and managing the Android system.
[0128] The core library consists of two parts: one part is the functionalities that need to be called by the Java language, and the other part is the Android core library.
[0129] The application layer and application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and application framework layer as binary files. The virtual machine is used to perform functions such as object lifecycle management, stack management, thread management, security and exception management, and garbage collection.
[0130] System libraries can include multiple functional modules. For example: surface manager, media libraries, 3D graphics processing libraries (e.g., OpenGL ES), 2D graphics engines (e.g., SGL), etc.
[0131] The Surface Manager is used to manage the display subsystem and provides the blending of 2D and 3D layers for multiple applications.
[0132] The media library supports playback and recording of various common audio and video formats, as well as still image files. It supports multiple audio and video encoding formats, such as MPEG4, H.264, MP3, AAC, AMR, JPG, and PNG.
[0133] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.
[0134] A 2D graphics engine is a graphics engine for 2D drawing.
[0135] The kernel layer is the layer between hardware and software. The kernel layer contains at least the display driver, camera driver, audio driver, and sensor driver.
[0136] The following example, using a scenario of synchronizing note data, illustrates the workflow of the software and hardware of the first electronic device 100 and the second electronic device 200.
[0137] 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.). The raw input event is stored in the kernel layer. The application framework layer retrieves the raw input event from the kernel layer and identifies the control corresponding to the input event. Taking a single touch operation as an example, where the corresponding control is the note-taking application icon, the note-taking application calls the interface of the application framework layer to launch the note-taking application. Subsequently, while displaying the note-taking application, the first electronic device 100 detects the user's touch operation in the note-taking application through the touch sensor, determines that the note-taking application has generated new data, and data synchronization is required.
[0138] Subsequently, if the first electronic device 100 detects the nearby second electronic device 200 and determines that a communication connection has been established with the second electronic device 200, then the first electronic device 100 can send newly generated note data to the second electronic device 200. This newly generated note data is procedural data generated in real time by the note-taking application in the first electronic device 100. Thus, data synchronization between the note-taking applications in the first electronic device 100 and the second electronic device 200 is achieved through end-to-end synchronization.
[0139] If the first electronic device 100 does not detect the nearby second electronic device 200, then the first electronic device 100 can respond to the user's save operation by saving the newly generated note data to the storage module. Subsequently, the first electronic device 100 uploads the note data saved in the storage module to the cloud server. This uploaded note data becomes the persistent data of the note-taking application in the first electronic device 100. Correspondingly, the second electronic device 200 can obtain the note data by downloading it from the cloud server. Thus, data synchronization between the note-taking applications in the first electronic device 100 and the second electronic device 200 is achieved through end-to-cloud synchronization.
[0140] The following section uses the first electronic device 100 as the electronic device that generates data to be synchronized and the second electronic device 200 as the electronic device to be synchronized to provide data, to describe in detail the data synchronization method provided in the embodiments of this application.
[0141] In some embodiments, electronic devices may generate data of different data types during the operation of applications. In some examples, data types include procedural data and persistent data. The electronic device can distinguish between procedural data and persistent data based on whether or not it saves the generated data to a storage module. For example, if the electronic device saves the generated data to a storage module, the data in the storage module is persistent data; data that the electronic device does not save to the storage module is procedural data.
[0142] In some examples, the storage module is a storage medium capable of storing data. Examples of storage modules include read-only memory (ROM), such as hard disks, mechanical hard disks, solid-state drives, and magnetic disks.
[0143] For example, procedural data includes text content, attachment information, cursor position, and other data generated by the application in real time. Persistent data includes attachments stored in storage modules such as images, videos, documents, and text content.
[0144] In some embodiments, after generating data, the electronic device synchronizes different data types separately based on their data types. In some examples, the electronic device synchronizes procedural data with other electronic devices through end-to-end synchronization, thereby ensuring the timeliness of procedural data synchronization. The electronic device synchronizes persistent data with other electronic devices through end-to-cloud synchronization, thereby ensuring the stability of persistent data synchronization.
[0145] For example, as shown in Figure 6, 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 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 and second electronic devices). 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 electronic device is running the application, then through end-to-end data synchronization, the second electronic device can synchronously display the note content edited by the user in the note-taking application on the first electronic device. 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 note content through the second electronic device.
[0146] For example, as shown in Figure 7, the first electronic device, in response to the user's save operation, 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 note-taking application. The first electronic device can then upload these attachments to the cloud server, completing the persistent data synchronization between the first and second electronic devices. Subsequently, the second electronic device can download the persistent data uploaded by the first electronic device from the cloud server as needed and save it to the storage module, completing the 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 the 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 note content through the second electronic device. Thus, data synchronization can be achieved through end-to-end cloud synchronization regardless of whether the second electronic device is located near the first electronic device.
[0147] In some embodiments, after generating persistent data, electronic devices can also synchronize data with other electronic devices as needed through end-to-end synchronization.
[0148] For example, as shown in Figure 8, during the operation of the note-taking application, the first electronic device, in response to user operations, stores the generated procedural data of the note-taking application in the storage module, generating persistent data for the note-taking application. The first electronic device will synchronize persistent data with other devices as needed via end-to-end synchronization under any one or more of the following conditions: the first electronic device has not configured cloud synchronization, has not enabled cloud synchronization, the current network quality is poor and cannot upload persistent data to the cloud server, cloud space capacity is insufficient, wireless communication network function is not enabled or not connected to a wireless communication network (such as Wi-Fi), or the end-to-end synchronization priority is determined to be higher than the end-to-cloud synchronization priority. The priority order between end-to-end synchronization and end-to-cloud synchronization can be a pre-configured priority order in the first electronic device or a user-defined priority order. Different user accounts correspond to different cloud spaces. After logging into a user account, the first electronic device can obtain the corresponding cloud space for data backup, etc. This cloud space capacity is limited; therefore, when the cloud space capacity is insufficient, the first electronic device cannot send persistent data to the cloud server.
[0149] It should be understood that in some other scenarios, the first electronic device can also send persistent data to the second electronic device on demand via end-to-end synchronization, which will not be exemplified in this application embodiment. For example, if the first electronic device determines that the peer device (such as the second electronic device) cannot download data from the cloud server, it can also send persistent data to the peer device via end-to-end synchronization.
[0150] In the various scenarios described above, the first electronic device detects a nearby second electronic device and can establish a communication connection with it (or a communication connection already exists between them). Subsequently, the first electronic device can send persistent data of the note-taking application stored in its storage module to the second electronic device through this communication connection. This enables on-demand end-to-end synchronization of persistent data between the first and second electronic devices, avoiding data synchronization anomalies caused by the inability to perform end-to-cloud synchronization, which could impact user experience.
[0151] In some embodiments, procedural data is stored in the storage module in two ways: as a file and as a database. Storing data as a file represents storing the data content of the procedural data. For example, in response to a user's save operation in a note-taking application, the electronic device stores newly added video content in the note-taking application as a file in the storage module. Storing data as a database represents storing the Uniform Resource Locator (URL) corresponding to the file in the storage module, which indicates a specific file storage address. For example, after the electronic device saves video content as a file in the storage module in response to a user's save operation, it determines the URL of the storage address and stores the URL in the database. Optionally, the database stores a file directory corresponding to the note-taking application, which includes one or more URLs for indexing one or more files of the note-taking application already stored in the storage module.
[0152] In some examples, the first electronic device establishes a point-to-point (P2P) connection with the second electronic device via Bluetooth, Wi-Fi, or other methods to achieve end-to-end data synchronization. Generally, P2P connections have relatively slow data transmission speeds. Therefore, to ensure data synchronization efficiency, when end-to-end synchronization of persistent data is required, one can choose to synchronize the file corresponding to the persistent data (such as an attachment stored as a file), or select to synchronize information about the persistent data, such as the database content corresponding to the persistent data (such as a URL stored in the database) or thumbnail information (such as thumbnails, video covers, etc.). In this way, even with a large amount of persistent data, the first and second electronic devices can still achieve data synchronization by synchronizing the information in the persistent data. Subsequently, the second electronic device can also read the persistent data across devices as needed based on the information in the persistent data.
[0153] For example, as shown in Figure 9, after the electronic device stores procedural data in the storage module, the stored content includes attachments stored in the form of files and attachment URLs stored in the form of a database.
[0154] In one scenario, while running a note-taking application, a first electronic device detects a user clicking the save button and saves the user-entered text to its storage module. The first electronic device determines that it cannot currently upload the text to a cloud server and confirms that it has established a P2P connection with a nearby second electronic device. Therefore, the first electronic device can synchronize the text to the second electronic device via end-to-end synchronization. The second electronic device then saves the text to its storage module, completing the data synchronization for the note-taking application.
[0155] In another scenario, while running a note-taking application, the first electronic device detects a user clicking the save button and saves the user-inputted video file to its storage module. The first electronic device determines that it cannot currently upload the video file to a cloud server and confirms that a P2P connection has been established with a nearby second electronic device. Due to the large size of the video file, the first electronic device can synchronize the video file's cover art and URL to the second electronic device via end-to-end synchronization. The second electronic device then saves the video file's cover art and URL to its storage module, completing the data synchronization for the note-taking application. Subsequently, in response to the user's action, the second electronic device launches the note-taking application and displays the video file's cover art. If it detects a user clicking the video file's cover art, the second electronic device can then request the video stream from the first electronic device via cross-device file reading using the video file's URL. This ensures both efficient and effective data synchronization.
[0156] Therefore, as shown in Figure 10, the first electronic device and the second electronic device can flexibly achieve data synchronization between different devices through various data synchronization methods, such as process-based end-to-end data synchronization, persistent end-to-cloud data synchronization, and persistent data on-demand end-to-end synchronization, depending on the data type and the current data synchronization scenario.
[0157] In some embodiments, different electronic devices synchronize data in various ways. While ensuring data consistency across multiple devices, it is also necessary to avoid duplicate data synchronization.
[0158] In some examples, electronic devices determine the consistency and repeatability of data synchronization by comparing data.
[0159] For example, after obtaining synchronized data via end-to-end or end-to-cloud synchronization, the second electronic device compares this synchronized data with local data to determine if the same data is already stored locally. If the same data is already stored locally, the second electronic device can discard the synchronized data. If the same data is not stored locally, the second electronic device can save the synchronized data.
[0160] For example, as shown in Figure 10, during the operation of a note-taking application, the first electronic device generates procedural data for the note-taking application in response to user actions, 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. Then, the first electronic device uploads the persistent data of the note-taking application to a cloud server. Correspondingly, the second electronic device requests to download the persistent data of the note-taking application from the cloud server. This persistent data may include the procedural data of the note-taking application previously acquired by the first and second electronic devices via end-to-end synchronization. Therefore, the second electronic device can determine whether it needs to retain some or all of the persistent data acquired from the cloud server through data comparison.
[0161] 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.
[0162] 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.
[0163] As an example, as shown in Figure 10, during the operation of a note-taking application, the first electronic device inserts images and videos into the application in response to the user's editing operations. After detecting the user's save operation in the note-taking application, the first electronic device saves the persistent data of the note-taking application in the storage module. Then, the first electronic device determines that cloud synchronization is not currently enabled and detects a nearby second electronic device, and can synchronize the persistent data of the note-taking application to the second electronic device as needed via end-to-end synchronization. Subsequently, if the first electronic device detects that the user has enabled cloud synchronization, it can upload the persistent data of the note-taking application that has not yet been uploaded to the cloud server to the cloud server.
[0164] 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.
[0165] 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.
[0166] In this way, the second electronic device can retrieve data from the cloud server as needed based on the actual data synchronization situation.
[0167] In other examples, electronic devices determine the consistency and repeatability of data synchronization by comparing data information.
[0168] 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.
[0169] For example, as shown in Figure 10, during the operation of a note-taking application, the first electronic device generates procedural data for the note-taking application in response to the user's editing operation, 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.
[0170] Subsequently, in response to the user's activation of the note-taking application, the second electronic device sends a data synchronization request to the cloud server. This data synchronization request carries a note-taking application identifier. Accordingly, the cloud server receives the data synchronization request and, based on the note-taking application identifier carried in the request, determines the data from the note-taking application that the second electronic device is requesting to synchronize. The cloud server can either identify the note-taking application data uploaded by the first electronic device between the second electronic device's last data synchronization and this data synchronization as the data to be synchronized, and send this information to the second electronic device; or, the cloud server can directly identify all note-taking application data as the data to be synchronized and send this information to the second electronic device.
[0171] Accordingly, after receiving the information about the data to be synchronized from the cloud server, the second electronic device compares the information about the data to be synchronized with the local data information of the note-taking application to determine the actual data that needs to be synchronized. Then, it sends another data synchronization request to the cloud server, including information about the data that actually needs to be synchronized in the data synchronization request. Upon receiving the data synchronization request, the cloud server, based on the data information carried in the request, sends the corresponding data to be synchronized to the second electronic device.
[0172] In this way, the second electronic device not only achieves data synchronization with the first electronic device, but also avoids downloading duplicate attachment data, thus improving the efficiency of end-to-cloud data synchronization.
[0173] For example, while the first electronic device is running a note-taking application, it updates the note-taking application content in response to user actions and sends the updated note content to the second electronic device via end-to-end synchronization. If the second electronic device is also running a note-taking application, the first and second electronic devices can simultaneously display the note content edited by the user; alternatively, even if the second electronic device is not running a note-taking application, it can still save and retrieve the note content. Subsequently, in response to the user's save note-taking application action, the first electronic device uploads the updated note content and update time to the cloud server. When the second electronic device requests synchronization of note-taking application data from the cloud server, if the last update time of the note content (e.g., equal to the time the note content was uploaded to the cloud server) is earlier than the synchronization time of the locally stored note content, it can determine that it is unnecessary to synchronize the note content with the cloud server again.
[0174] In this way, the second electronic device can determine whether data synchronization is needed by comparing the last update time of the data to be synchronized, thus effectively improving the efficiency of data synchronization.
[0175] Figure 11 is a schematic flowchart of a data synchronization method provided in an embodiment of this application. It should be noted that this method is not limited to the specific order shown in Figure 11 and below. It should be understood that in other embodiments, the order of some steps in this method can be interchanged according to actual needs, or some steps can be omitted or deleted. The method includes the following steps:
[0176] S1101, The first electronic device displays the interface of the first application.
[0177] In some embodiments, a first electronic device runs a first application in the foreground, displaying the interface of the first application. During the display of the interface of the first application, the first electronic device can receive user operations, which can generate data for the first application.
[0178] S1102. The first electronic device receives a first operation from the user on the first application and obtains first data and second data of the first application generated by the first operation. The first data is data not yet saved to the storage module of the first electronic device, and the second data is data already saved to the storage module of the first electronic device.
[0179] The first data consists of procedural data not yet saved to the storage model, while the second data consists of persistent data already saved to the storage module. Optionally, the storage module is a storage medium capable of data storage. Examples of storage modules include ROM, hard disks, mechanical hard disks, solid-state drives, and magnetic disks.
[0180] In some embodiments, the first application detects a user's first operation and can generate data for the first application. For example, if the first operation is an edit operation, the first application can generate procedural data based on the user's edit. As another example, if the first operation is a save operation, the first application can save second data to the storage module based on the user's operation; in this case, the second data is persistent data.
[0181] In some examples, the first application may generate procedural and / or persistent data during runtime.
[0182] S1103, The first electronic device sends the first data to the second electronic device.
[0183] S1104, The first electronic device sends the second data to the cloud server.
[0184] In some embodiments, after acquiring 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 located near the first electronic device, and a short-range communication connection is established between the first electronic device and the second electronic device.
[0185] In some examples, a first electronic device sends first data to a second electronic device via short-range communication. Correspondingly, the second electronic device receives the first data sent by the first electronic device via short-range communication. The short-range communication method includes at least one of Bluetooth P2P communication, Wi-Fi P2P communication, and local area network communication.
[0186] 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 a cloud server so that other electronic devices can download the second data.
[0187] It should be understood that the execution order of S1103 and S1104 is not limited in the embodiments of this application.
[0188] S1105, The second electronic device downloads the second data to the cloud server.
[0189] In some embodiments, the second electronic device obtains first data information from third data sent by the cloud server. This third data includes second data and data from the first data that has already been saved to the storage module. Based on the first data information, the second electronic device requests the cloud server to download the second data from the third data that has not been synchronized with the first electronic device.
[0190] In this way, the second electronic device can request data synchronization from the cloud server on demand, and can also pull data from the cloud server that has not been synchronized with other electronic devices. This reduces the amount of data downloaded, and the second electronic device can obtain the latest application data.
[0191] In some embodiments, the first electronic device receives a user's data saving operation or detects that the data saving period has been met, and saves the first data to the storage module. The first electronic device then sends the first data from the storage module to the cloud server.
[0192] For example, if the first electronic device responds to a user's operation and saves procedural data to the storage module, then this procedural data becomes persistent data. The first electronic device then sends the persistent data to the cloud server according to a preset period, or after confirming that it has been acquired.
[0193] For example, the first application is configured with an auto-save function, automatically saving procedural data according to a preset period. Then, after the first electronic device obtains the latest persistent data saved in the storage module, it can send the persistent data to the cloud server.
[0194] In this way, the first electronic device distinguishes between procedural data and persistent data based on whether the data is saved, and synchronizes the procedural data and persistent data in different ways. This ensures both the timeliness and stability of data synchronization.
[0195] For example, as shown in Figure 10, during the operation of a first application (such as a note-taking application), the first electronic device generates procedural data for the note-taking application in response to user 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 a storage module, acquiring the persistent data of the note-taking application. Then, the first electronic device uploads the persistent data of the note-taking application to a cloud server. Correspondingly, the second electronic device requests to download the persistent data of the note-taking application from the cloud server. This persistent data may include the procedural data of the note-taking application previously acquired by the first and second electronic devices via end-to-end synchronization. Therefore, the second electronic device can determine whether it needs to retain some or all of the persistent data acquired from the cloud server through data comparison.
[0196] 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.
[0197] In some embodiments, a first electronic device receives a second operation from a user on a first application and obtains fourth data of the first application generated by the second operation. This fourth data is data already saved to a storage module. Under preset conditions, the first electronic device sends the fourth data to a second electronic device. Correspondingly, the second electronic device receives the fourth data sent by the second electronic device under the preset conditions. The preset conditions include one or more of the following: failure to send the fourth data to the cloud server, cloud synchronization not enabled, insufficient cloud storage capacity, and end-to-end synchronization having a higher priority than end-to-cloud synchronization.
[0198] For example, as shown in Figure 10, during the operation of a note-taking application, the first electronic device inserts images and videos into the application in response to the user's editing operations. After detecting the user's save operation in the note-taking application, the first electronic device saves the persistent data of the note-taking application in the storage module. Then, the first electronic device determines that cloud synchronization is not currently enabled and detects a nearby second electronic device, and can synchronize the persistent data of the note-taking application to the second electronic device as needed via end-to-end synchronization. Subsequently, if the first electronic device detects that the user has enabled cloud synchronization, it can upload the persistent data of the note-taking application that has not yet been uploaded to the cloud server to the cloud server.
[0199] In this way, the first electronic device and the second electronic device can flexibly realize data synchronization between different devices through various data synchronization methods, such as process-based end-to-end data synchronization, persistent end-to-cloud data synchronization, and persistent end-to-end data synchronization on demand, depending on the data type and the current data synchronization scenario.
[0200] In some embodiments, the second electronic device receives second data information from the cloud server, where the fifth data is data from the first application sent by the first electronic device to the cloud server. Based on the second data information, the second electronic device requests the cloud server to download a sixth data portion of the fifth data that has not been synchronized with the first electronic device. This sixth data does not include the fourth data.
[0201] In this way, the second electronic device can retrieve data from the cloud server as needed based on the actual data synchronization status, without having to repeatedly download data that has already been synchronized.
[0202] In some embodiments, a first electronic device receives a third operation from a user on a first application, and obtains seventh data of the first application generated by the third operation. The seventh data is data already saved to a storage module, and the amount of the seventh data exceeds a preset threshold. Under preset conditions, the first electronic device sends first information about the seventh data to a second electronic device. This first information includes the storage address and / or abbreviation information of the seventh data. Correspondingly, the second electronic device receives the first information about the seventh data sent by the first electronic device under the preset conditions.
[0203] 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 the 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 URLs 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 videos containing the unsynchronized attachments.
[0204] In this way, the first electronic device can synchronize persistent data with the second electronic device end-to-end according to the amount of data, thereby improving the end-to-end synchronization efficiency of persistent data.
[0205] The data synchronization method provided by the embodiments of this application has been described in detail above with reference to Figures 6-11. The first electronic device and the second electronic device provided by the embodiments of this application are described in detail below with reference to Figures 12 and 13.
[0206] In one possible design, FIG12 is a schematic diagram of the structure of a first electronic device provided in an embodiment of this application. As shown in FIG12, 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.
[0207] 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 executing S1101 in FIG11.
[0208] Optionally, the processing unit 1202 is used to support the first electronic device 1200 in executing S1102 in FIG11.
[0209] Optionally, the transceiver unit 1203 is used to support the first electronic device 1200 in performing S1103 and S1104 in FIG11.
[0210] 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.
[0211] Optionally, the first electronic device 1200 shown in FIG12 may further include a storage unit (not shown in FIG12) storing a program or instructions. When the display unit 1201, the processing unit 1202, and the transceiver unit 1203 execute the program or instructions, the first electronic device 1200 shown in FIG12 can execute the data synchronization method described in the above method embodiments.
[0212] The technical effects of the first electronic device 1200 shown in Figure 12 can be referred to the technical effects of the data synchronization method described in the above method embodiments, and will not be repeated here.
[0213] 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.
[0214] In one possible design, Figure 13 is a schematic diagram of the structure of the second electronic device provided in an embodiment of this application. As shown in Figure 13, 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.
[0215] Optionally, the transceiver unit 1301 is used to support the second electronic device 1300 in performing S1103 and S1105 in FIG11.
[0216] 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.
[0217] 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.
[0218] Optionally, the second electronic device 1300 shown in FIG13 may further include a storage unit (not shown in FIG13) storing a program or instructions. When the transceiver unit 1301 and the processing unit 1302 execute the program or instructions, the second electronic device 1300 shown in FIG13 can perform the data synchronization method described in the above method embodiments.
[0219] The technical effects of the second electronic device 1300 shown in Figure 13 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.
[0220] 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.
[0221] Optionally, the chip system may contain one or more processors. These processors can be implemented in hardware or software. When implemented in hardware, the processor can be a logic circuit, an integrated circuit, etc. When implemented in software, the processor can be a general-purpose processor, implemented by reading software code stored in memory.
[0222] Optionally, the chip system may contain one or more memories. The memory may be integrated with the processor or disposed separately from it; this application embodiment does not limit this. For example, the memory may be a non-transient processor, such as a read-only memory (ROM), which may be integrated with the processor on the same chip or disposed separately on different chips. This application embodiment does not specifically limit the type of memory or the arrangement of the memory and processor.
[0223] For example, the chip system may 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.
[0224] It should be understood that each step in the above method embodiments can be completed by integrated logic circuits in the processor hardware or by instructions in software form. The method steps disclosed in the embodiments of this application can be directly manifested as being executed by a hardware processor, or being executed by a combination of hardware and software modules in the processor.
[0225] This application also provides a computer-readable storage medium storing a computer program. When the computer program is run on a computer, it causes the computer to perform the aforementioned steps to implement the data synchronization method described in the above embodiments.
[0226] This application also provides a computer program product that, when run on a computer, causes the computer to perform the aforementioned steps to implement the data synchronization method described above.
[0227] In addition, this application also provides an apparatus. Specifically, the apparatus may be a component or module, and may include one or more processors and a memory connected together. The memory is used to store a computer program. When the computer program is executed by one or more processors, the apparatus causes it to perform the data synchronization methods described in the above-described method embodiments.
[0228] The apparatus, computer-readable storage medium, computer program product, or chip provided in the embodiments of this application are all used to execute the corresponding methods provided above. Therefore, the beneficial effects they can achieve can be referred to the beneficial effects of the corresponding methods provided above, and will not be repeated here.
[0229] The steps of the methods or algorithms described in conjunction with the embodiments of this application can be implemented in hardware or by a processor executing software instructions. The software instructions can consist of corresponding software modules, which can be stored in random access memory (RAM), flash memory, read-only memory (ROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), registers, hard disks, portable hard disks, CD-ROMs, or any other form of storage medium well known in the art. An exemplary storage medium is coupled to a processor, enabling the processor to read information from and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can reside in an application-specific integrated circuit (ASIC).
[0230] Through the above description of the embodiments, those skilled in the art can clearly understand that, for the sake of convenience and brevity, the division of the above functional modules is only used as an example. In practical applications, the above functions can be assigned to different functional modules as needed; that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. The specific working process of the system, device and unit described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here. In the several embodiments provided in this application, it should be understood that the disclosed method can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of modules or units is only a logical functional division, and there may be other division methods in actual implementation; for example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of modules or units, and can be electrical, mechanical or other forms. In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated units described above can be implemented in either hardware or software functional units.
[0231] Computer-readable storage media include, but are not limited to, any of the following: USB flash drive, portable hard drive, read-only memory (ROM), random access memory (RAM), magnetic disk or optical disk, and other media capable of storing program code.
[0232] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
A data synchronization system, characterized in that, The system includes a first electronic device and a second electronic device, and a short-range communication connection is established between the first electronic device and the second electronic device; the first electronic device is used to: display the interface of a first application; The system receives a first operation from a user on the first application, and obtains first data and second data of the first application generated by the first operation, wherein the first data is data not saved to the storage module of the first electronic device, and the second data is data already saved to the storage module; it sends the first data to a second electronic device and sends the second data to a cloud server; the second electronic device is used to: receive the first data sent by the first electronic device and download the second data from the cloud server. The system according to claim 1, characterized in that, The second electronic device is further configured to: acquire first data information of the third data sent by the cloud server, wherein the third data includes the second data and the data in the first data that has been saved to the storage module; Based on the first data information, a request is made to the cloud server to download the second data in the third data that has not been synchronized with the first electronic device. The system according to claim 1 or 2 is characterized in that, The first electronic device is further configured to: receive a second operation by the user on the first application, obtain fourth data of the first application generated by the second operation, wherein the fourth data is data already saved to the storage module; and send the fourth data to the second electronic device under preset conditions, wherein the preset conditions include one or more of the following: failure to send the fourth data to the cloud server, cloud synchronization function not enabled, insufficient cloud space capacity, and the priority of end-to-end synchronization being higher than the priority of end-to-cloud synchronization; the second electronic device is further configured to: receive the fourth data sent by the first electronic device. The system according to claim 3 is characterized in that, The second electronic device is further configured to: receive second data information from the cloud server, wherein the fifth data is data of the first application sent by the first electronic device to the cloud server; Based on the second data information, a request is made to the cloud server to download the sixth data in the fifth data that has not been synchronized with the first electronic device. The sixth data does not include the fourth data. A data synchronization method, characterized in that, The method, applied to a first electronic device, includes: displaying an interface of a first application; receiving a first operation performed by a user on the first application; acquiring first data and second data of the first application generated by the first operation, wherein the first data is data not saved to the storage module of the first electronic device, and the second data is 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. The method according to claim 5, characterized in that, Sending the first data to the second electronic device includes: sending the first data to the second electronic device via a short-range communication method, wherein the short-range communication method includes at least one of Bluetooth point-to-point (P2P) communication, Wi-Fi P2P communication, and local area network (LAN) communication. The method according to claim 5 or 6, characterized in that, The method further includes: receiving a second operation from a user on the first application, obtaining fourth data of the first application generated by the second operation, wherein the fourth data is data already saved to the storage module; and sending the fourth data to the second electronic device under preset conditions, wherein the preset conditions include one or more of the following: failure to send the fourth data to the cloud server, cloud synchronization function not enabled, insufficient cloud space capacity, and the priority of end-to-end synchronization being higher than the priority of end-to-cloud synchronization. The method according to claim 7, characterized in that, The method further includes: receiving a third operation by a user on the first application, obtaining seventh data of the first application generated by the third operation, wherein the seventh data is data already saved to the storage module, and the data volume of the seventh data is greater than a preset threshold; and under the preset conditions, sending first information of the seventh data to the second electronic device, wherein the first information includes the storage address and / or abbreviation information of the seventh data. The method according to any one of claims 5-8, characterized in that, The method further includes: receiving a user's data saving operation or detecting that the data saving period has been met, saving the first data to the storage module; and sending the first data in the storage module to the cloud server. A data synchronization method, characterized in that, 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 the cloud server from a 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 the storage module of the first electronic device, and the second data is data already saved to the storage module of the first electronic device. The method according to claim 10, characterized in that, Receiving the first data sent by the first electronic device includes: receiving the first data sent by the first electronic device through a short-range communication method, wherein the short-range communication method includes at least one of Bluetooth point-to-point connection P2P communication method, Wi-Fi P2P communication method, and local area network communication method. The method according to claim 10 or 11 is characterized in that, The step of downloading the second data sent by the first electronic device to the cloud server includes: obtaining first data information of the third data sent by the cloud server, wherein the third data includes 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, based on the first data information. The method according to any one of claims 10-12, characterized in that, The method further includes: receiving fourth data sent by the first electronic device under preset conditions, wherein the fourth data is data that the first electronic device has saved to the storage module; the preset conditions include 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 cloud synchronization function, the cloud space capacity is insufficient, and the priority of end-to-end synchronization is higher than the priority of end-to-cloud synchronization. The method according to claim 13, characterized in that, The method further includes: receiving second data information of the 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 a sixth data in the fifth data that has not been synchronized with the first electronic device, wherein the sixth data does not include the fourth data, based on the second data information. The method according to claim 13 or 14 is characterized in that, The method further includes: receiving first information of seventh data sent by the first electronic device under the preset conditions, wherein the seventh data is data that the first electronic device has saved to the storage module, the data volume of the seventh data is greater than a preset threshold, and the first information includes the storage address and / or abbreviation information of the seventh data. An electronic device, characterized in that, include: The electronic device includes a processor, a memory, and a display screen, the memory and the display screen being coupled to the processor. The memory stores computer program code, the computer program code including computer instructions, which, when read from the memory by the processor, cause the electronic device to perform the method as described in any one of claims 5-9. An electronic device, characterized in that, include: A processor and a memory, the memory being coupled to the processor, the memory being used to store computer program code, the computer program code including computer instructions, which, when the processor reads the computer instructions from the memory, cause the electronic device to perform the method as described in any one of claims 10-15. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a computer program that, when executed on an electronic device, causes the electronic device to perform the method as described in any one of claims 5-9; or causes the electronic device to perform the method as described in any one of claims 10-15. A computer program product, characterized in that, When the computer program product is run on a computer, it causes the computer to perform the method as described in any one of claims 5-9; or, causes the computer to perform the method as described in any one of claims 10-15.