Data synchronization method and electronic equipment
By determining whether there is a synchronization group created by the second electronic device in the electronic device and storing the data to be synchronized to the metadatabase of the synchronization group, the problem that the user cannot select the synchronization application is solved, and application-level data synchronization is achieved, and user experience is improved.
Patent Information
- Application Number
- CN202311627131.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-29
- Publication Date
- 2025-06-06
AI Technical Summary
The prior art cannot enable users to select synchronized applications according to their own needs, resulting in poor user experience in data synchronization from device level to application level.
By determining in the electronic device whether there is a synchronization group created by the second electronic device, if so, the data to be synchronized in the first application database is stored in the metadatabase of the synchronization group, thereby achieving the synchronization of data of only a portion of the application program.
It realizes that users choose synchronized applications according to their own needs, improves user experience, and transforms data synchronization from device level to application level.
Smart Images

Figure CN120104690A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing, and more specifically, to a data synchronization method and an electronic device. Background Art
[0002] At present, the same user usually owns multiple electronic devices, and the data can be automatically synchronized between the electronic devices.
[0003] For example, user A has two electronic devices, a smartphone 10 and a tablet computer PAD 30, and the smartphone 10 and the tablet computer PAD 30 are logged into the same account information. Photos taken by user A through the smartphone 10 can be automatically synchronized to the PAD 30, so that user A can easily view photos in the PAD 30. However, at this stage, users can only choose whether to enable the data synchronization function of the electronic device. If the user chooses to enable the data synchronization function in the smartphone 10, all applications in the smartphone 10 will enable the data synchronization function. The user cannot enable the data synchronization function of some applications in the smartphone 10, which will result in a poor user experience.
[0004] Based on this, how to achieve data synchronization based on user selection has become an urgent problem to be solved. Summary of the invention
[0005] The present application provides a data synchronization method, which can realize data synchronization based on user selection.
[0006] In a first aspect, a data synchronization method is provided. The method is applied to a first electronic device. The first electronic device is communicatively connected to a second electronic device. The first electronic device runs at least two applications, the at least two applications include a first application, and the first electronic device includes a first application database corresponding to the first application. The method includes:
[0007] Determine whether a first synchronization group exists in the first electronic device, the first synchronization group is a synchronization group created by the second electronic device, and the first synchronization group performs data synchronization through a metadata library;
[0008] If the first synchronization group exists in the first electronic device, the first data to be synchronized in the first application database is stored in the metadata database in the first synchronization group.
[0009] The first electronic device may be an edge device, and the second electronic device may be a central device.
[0010] The data synchronization method provided in the embodiment of the present application is applied to a first electronic device, the first electronic device is communicatively connected with a second electronic device, the first electronic device runs at least two applications, the at least two applications include a first application, the first electronic device includes a first application database corresponding to the first application, by determining whether a first synchronization group exists in the first electronic device, the first synchronization group is a synchronization group created by the second electronic device, the first synchronization group performs data synchronization through a metadata database, if the first synchronization group exists in the first electronic device, the first data to be synchronized in the first application database is stored in the metadata database in the first synchronization group, which is equivalent to the data synchronized between the first electronic device and the second electronic device, which may only be the data in the first application database in the first electronic device, so that only part of the application data can be synchronized between the first electronic device and the second electronic device, instead of synchronizing all the application data in the first electronic device, so that the user can choose the synchronized application according to their own needs, and transform the data synchronization from device-level data synchronization to application-level data synchronization, thereby improving the user experience.
[0011] In combination with the first aspect, in some embodiments of the first aspect, if the first synchronization group does not exist in the first electronic device, a synchronization group copy corresponding to the first synchronization group is created, and the synchronization group copy includes a metadata library.
[0012] In combination with the first aspect, in some embodiments of the first aspect, creating a synchronization group replica corresponding to the first synchronization group includes: creating a metadata library.
[0013] The data synchronization method provided in the embodiment of the present application is applied to a first electronic device, where the first electronic device is communicatively connected with a second electronic device, where the first electronic device runs at least two applications, where the at least two applications include a first application, and where the first electronic device includes a first application database corresponding to the first application. By determining whether a first synchronization group exists in the first electronic device, the first synchronization group is a synchronization group created by the second electronic device, and the first synchronization group performs data synchronization through a metadata database, if the first synchronization group does not exist in the first electronic device, a synchronization group copy corresponding to the first synchronization group is created, and a metadata database is created so that the first electronic device can store the first data to be synchronized in the first application database into the metadata database in the first synchronization group, thereby enabling the data synchronized between the first electronic device and the second electronic device to be only the data in the first application database in the first electronic device, rather than synchronizing the data of all applications of the first electronic device, thereby enabling the user to select the synchronized application according to their own needs, thereby transforming the data synchronization from device-level data synchronization to application-level data synchronization, and improving the user experience.
[0014] In combination with the first aspect, in some embodiments of the first aspect, the first electronic device also includes a first synchronization group housekeeper module, and determining whether the first synchronization group exists in the first electronic device includes: the first synchronization group housekeeper module determines whether the first synchronization group exists in the first electronic device.
[0015] In combination with the first aspect, in certain embodiments of the first aspect, the electronic device also includes a first device management module, and the first synchronization group housekeeper module determines whether the first synchronization group exists in the first electronic device, including: the first application obtains the synchronization group identifier from the first device management module; the first application sends the synchronization group identifier to the first synchronization group housekeeper module; the first synchronization group housekeeper module determines whether the first synchronization group exists in the first electronic device based on the synchronization group identifier.
[0016] In combination with the first aspect, in some embodiments of the first aspect, the first electronic device also includes a first synchronization group housekeeper module, which creates a synchronization group copy corresponding to the first synchronization group, including: the first synchronization group housekeeper module creates a metadata library corresponding to the first synchronization group.
[0017] After the first synchronization group housekeeper module creates the metadata base, the first synchronization group housekeeper module may return to execute the step of storing the first data to be synchronized in the first application database into the metadata base in the first synchronization group.
[0018] In combination with the first aspect, in some embodiments of the first aspect, the first data to be synchronized includes synchronization configuration information of the first application, and the synchronization configuration information includes parameters for data synchronization of the first application.
[0019] In a second aspect, a data synchronization method is provided. The method is applied to a second electronic device. The second electronic device is communicatively connected to a first electronic device. The first electronic device runs at least two applications, the at least two applications include a first application, and the first electronic device includes a first application database corresponding to the first application. The method includes:
[0020] Get the synchronization group ID;
[0021] A first synchronization group is created based on the synchronization group identifier, and the first synchronization group performs data synchronization through the metadata database.
[0022] In combination with the second aspect, in certain embodiments of the second aspect, the second electronic device includes a second device management module and a second synchronization group housekeeper module, and obtaining the synchronization group identifier includes: the second synchronization group housekeeper module obtains the synchronization group identifier from the second device management module; creating a first synchronization group based on the synchronization group identifier includes: the second synchronization group housekeeper module creates the first synchronization group based on the synchronization group identifier.
[0023] The data synchronization method provided in the embodiment of the present application is applied to a second electronic device, the second electronic device is communicatively connected with a first electronic device, the first electronic device runs at least two applications, the at least two applications include a first application, and the first electronic device includes a first application database corresponding to the first application. The method includes: obtaining a synchronization group identifier, creating a first synchronization group based on the synchronization group identifier, so that the first electronic device stores the first data to be synchronized in the first application database into a metadata database in the first synchronization group, wherein the first synchronization group performs data synchronization through the metadata database, so that data synchronization of the first application can be achieved by storing the data corresponding to the first application in the first electronic device in the first synchronization group created by the second electronic device, that is, the data synchronized between the first electronic device and the second electronic device may only be the data in the first application database in the first electronic device, so that only the data of part of the applications can be synchronized between the first electronic device and the second electronic device, instead of synchronizing the data of all the applications in the first electronic device, so that the user can select the synchronized application according to their own needs, and transform the data synchronization from device-level data synchronization to application-level data synchronization, thereby improving the user experience.
[0024] In combination with the second aspect, in some embodiments of the second aspect, the synchronization group identifier is an identifier of the second electronic device.
[0025] It can be understood that the identifier of the second electronic device is used to indicate the second electronic device and usually will not be repeated with the identifiers of other electronic devices in the synchronization group. That is to say, within the synchronization group, the identifier of the second electronic device is unique. Therefore, using the identifier of the second electronic device as the synchronization group name of the first synchronization group can distinguish the first synchronization group from other synchronization groups.
[0026] In the data synchronization method provided in the embodiment of the present application, the second electronic device can create a first synchronization group based on the second electronic device identifier during the process of creating a synchronization group. Within the synchronization group, the identifier of the second electronic device is usually unique. Therefore, by using the identifier of the second electronic device as the synchronization group name of the first synchronization group, the first synchronization group can be distinguished from other synchronization groups, thereby avoiding the first electronic device from mistakenly synchronizing data with other electronic devices in the first synchronization group when synchronizing data with the second electronic device.
[0027] In a third aspect, a data synchronization method is provided. The method is applied to a data synchronization system. The data synchronization system includes the first electronic device as described in the first aspect and the second electronic device as described in the second aspect.
[0028] In combination with the third aspect, in certain embodiments of the third aspect, the data synchronization system also includes a third electronic device, and the method also includes: the second electronic device synchronizes first data to be synchronized to the third electronic device, and the first data to be synchronized is data corresponding to a first application running in the first electronic device.
[0029] The data synchronization method provided in the embodiment of the present application is applied to a data synchronization system, and the data synchronization system includes a first electronic device, a second electronic device and a third electronic device as shown in the above embodiment. After the first data to be synchronized is synchronized between the first electronic device and the second electronic device, the second electronic device synchronizes the first data to be synchronized to the third electronic device, wherein the first data to be synchronized is data corresponding to a first application running in the first electronic device, so that the first electronic device can synchronize the first data to be synchronized to the third electronic device. It can be understood that the third electronic device can be multiple electronic devices, so it is equivalent to that the first electronic device can synchronize data to multiple electronic devices through the second electronic device, thereby improving the efficiency of synchronizing data.
[0030] In a fourth aspect, a data synchronization device is provided, comprising a unit for executing any one of the methods in the first aspect or the second aspect. The device may be a server, a terminal device, or a chip in a terminal device. The device may include an input unit and a processing unit.
[0031] When the device is a terminal device, the processing unit may be a processor, and the input unit may be a communication interface; the terminal device may also include a memory, which is used to store computer program code. When the processor executes the computer program code stored in the memory, the terminal device executes any one of the methods in the first aspect or the second aspect.
[0032] When the device is a chip in a terminal device, the processing unit may be a processing unit inside the chip, and the input unit may be an output interface, a pin or a circuit, etc.; the chip may also include a memory, which may be a memory inside the chip (for example, a register, a cache, etc.) or a memory located outside the chip (for example, a read-only memory, a random access memory, etc.); the memory is used to store computer program code, and when the processor executes the computer program code stored in the memory, the chip executes any one of the methods in the first aspect or the second aspect.
[0033] In one possible implementation, a memory is used to store computer program code; a processor executes the computer program code stored in the memory, and when the computer program code stored in the memory is executed, the processor is used to execute: obtaining first data to be synchronized in a first application database, the first data to be synchronized is data corresponding to a first application; and sending the first data to be synchronized to a second electronic device.
[0034] In one possible implementation, a memory is used to store computer program code; a processor executes the computer program code stored in the memory, and when the computer program code stored in the memory is executed, the processor is used to perform: obtaining a synchronization group identifier; creating a first synchronization group based on the synchronization group identifier, so that the first electronic device stores the first data to be synchronized in the first application database into a metadata database in the first synchronization group, wherein the first synchronization group performs data synchronization through the metadata database.
[0035] In a fifth aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program code. When the computer program code is executed by a data synchronization device, the data synchronization device executes any one of the data synchronization methods in the first aspect or the second aspect.
[0036] In a sixth aspect, a computer program product is provided, the computer program product comprising: a computer program code, when the computer program code is executed by a data synchronization device, the data synchronization device executes any one of the device methods in the first aspect or the second aspect.
[0037] The data synchronization method provided by the embodiment of the present application comprises: a first electronic device and a second electronic device are communicatively connected, the first electronic device runs at least two applications, the at least two applications include a first application, the first electronic device includes a first application database corresponding to the first application, and by determining whether a first synchronization group exists in the first electronic device, the first synchronization group is a synchronization group created by the second electronic device, and the first synchronization group performs data synchronization through a metadata database. If the first synchronization group exists in the first electronic device, the first data to be synchronized in the first application database is stored in the metadata database in the first synchronization group, which is equivalent to the data synchronized between the first electronic device and the second electronic device, which may only be the data in the first application database in the first electronic device, so that only the data of some applications can be synchronized between the first electronic device and the second electronic device, instead of synchronizing the data of all applications in the first electronic device, so that the user can select the synchronized application according to his own needs, and transform the data synchronization from device-level data synchronization to application-level data synchronization, thereby improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1A It is a schematic diagram of data synchronization between edge devices and central devices;
[0039] Figure 1B It is a schematic diagram of the interface for logging into the same account on different electronic devices;
[0040] Figure 1C It is a schematic diagram of an interface for data synchronization between different electronic devices;
[0041] Figure 2 is a schematic diagram of a hardware system of an electronic device applicable to the present application;
[0042] Figure 3A It is a schematic diagram of an application scenario provided by an embodiment of the present application;
[0043] Figure 3B This is a schematic diagram of an interface for selecting an application for synchronization provided in an embodiment of the present application;
[0044] Figure 3C It is a schematic diagram of an application scenario provided by an embodiment of the present application;
[0045] Figure 3D This is a schematic diagram of an interface for synchronizing an application program provided in an embodiment of the present application;
[0046] Figure 3E It is a schematic diagram of another interface for synchronizing application programs provided by an embodiment of the present application;
[0047] Figure 4 It is a structural diagram of a synchronization group provided in an embodiment of the present application;
[0048] Figure 5 is a schematic diagram of a synchronizable database provided in an embodiment of the present application;
[0049] Figure 6 This is a schematic diagram of a process for creating a synchronization group provided by an embodiment of the present application;
[0050] Figure 7 This is a schematic diagram of a process for creating a synchronization group provided by an embodiment of the present application;
[0051] Figure 8 This is a schematic diagram of a process of joining a synchronization group provided in an embodiment of the present application;
[0052] Fig. 9 It is a flowchart of a data synchronization method provided in an embodiment of the present application;
[0053] Fig.10 It is a flowchart of a data synchronization method provided in an embodiment of the present application;
[0054] Fig.11 It is a flowchart of a data synchronization method provided in an embodiment of the present application;
[0055] Fig.12 It is a flowchart of a data synchronization method provided in an embodiment of the present application;
[0056] Fig.13 It is a flowchart of a data synchronization method provided in an embodiment of the present application;
[0057] Fig.14 It is a flowchart of a data synchronization method provided in an embodiment of the present application;
[0058] Fig.15 It is a schematic diagram of a data synchronization electronic device provided by the present application. DETAILED DESCRIPTION
[0059] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application. In the description of the embodiments of the present application, unless otherwise specified, " / " means or, for example, A / B can mean A or B; "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, "multiple" means two or more than two.
[0060] In the following, the terms "first", "second", and "third" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first", "second", and "third" may explicitly or implicitly include one or more of the features.
[0061] At present, the same user usually has multiple sub-devices, and the function of automatic data synchronization can be realized between various electronic devices. It is understandable that the data synchronization between electronic devices can be determined by a central device to perform data synchronization. Among them, a central device can be connected to multiple electronic devices, and the multiple electronic devices connected to the central device can be called edge devices.
[0062] For example, after new data is generated in the application 10 running in the edge device A, the application 10 can call the data synchronization service process 111 to synchronize data with the edge device B. Usually, the data synchronization service process 111 needs to send the data to be synchronized to the central device before synchronizing data with the edge device B. The data synchronization service process 211 in the central device sends the data to be synchronized to the edge device B. For example, Figure 1AAs shown, the synchronization calculation module 101 in the application 10 in the edge device A generates new data (data to be synchronized) and sends it to the data synchronization service process 111 in the edge device A, and the data synchronization service process 111 sends the data to be synchronized to the data synchronization service process 211 in the central device. Then, the data synchronization service process 211 sends the data to be synchronized to the synchronization calculation module 201 in the application 20 in the central device. The synchronization calculation module 201 performs corresponding processing on the data to be synchronized and returns the data to be synchronized to the data synchronization service process 211. The corresponding processing may include storing the data to be synchronized, calculating the data to be synchronized, and then making a decision based on the calculation result to determine whether to synchronize the data to the edge device B. If the decision result indicates that the data needs to be synchronized to the edge device B, the processed data to be synchronized is sent to the data synchronization service process 311 in the edge device B through the data synchronization service process 211, and then the data synchronization service process 311 sends the processed data to be synchronized to the synchronization calculation module 301 in the application 30 in the edge device B to notify the application 30 that there is synchronization data sent by the edge device A.
[0063] In one possible scenario, Figure 1B As shown, user A logs into account "1111" on smartphone 11, and user A logs into account "1111" on tablet computer PAD 21 at the same time. At this time, user A takes a photo of the snow mountain through smartphone 11, and obtains the photo 101, as shown in FIG. Figure 1B At the same time, the photos 101 in the smart phone 11 can be automatically synchronized to the PAD 21, so that the user A can check the photos in the PAD 21 conveniently.
[0064] At this time, the photo albums in the smart phone 11 and the PAD 21 both display the photo 101, as shown in FIG. Figure 1C In this case, if there are more than two services that can realize the data synchronization function, for example, both the call service and the gallery service can realize the data synchronization function, the user can only choose to synchronize data for both services, or not synchronize data for both services, which will result in the user being unable to independently select the synchronized service, resulting in a poor user experience.
[0065] In view of this, an embodiment of the present application provides a data synchronization method, in which a first electronic device is communicatively connected with a second electronic device, the first electronic device runs at least two applications, the at least two applications include a first application, and the first electronic device includes a first application database corresponding to the first application. By determining whether a first synchronization group exists in the first electronic device, the first synchronization group is a synchronization group created by the second electronic device, and the first synchronization group performs data synchronization through a metadata database. If the first synchronization group exists in the first electronic device, the first data to be synchronized in the first application database is stored in the metadata database in the first synchronization group. This is equivalent to the data synchronized between the first electronic device and the second electronic device being only the data in the first application database in the first electronic device, so that only the data of one of the applications can be synchronized between the first electronic device and the second electronic device, instead of synchronizing the data of all applications in the first electronic device, so that the user can choose the synchronized application according to their own needs, and transform the data synchronization from device-level data synchronization to application-level data synchronization, thereby improving the user experience.
[0066] The data synchronization method provided in the embodiment of the present application can be applied to electronic devices. Optionally, the electronic device includes a terminal device, which can also be called a terminal, a user equipment (UE), a mobile station (MS), a mobile terminal (MT), etc. The terminal device can be a mobile phone, a smart TV, a wearable device, a tablet computer (Pad), a computer with wireless transceiver function, a virtual reality (VR) terminal device, an augmented reality (AR) terminal device, a wireless terminal in industrial control, a wireless terminal in self-driving, a wireless terminal in remote medical surgery, a wireless terminal in smart grid, a wireless terminal in transportation safety, a wireless terminal in smart city, a wireless terminal in smart home, etc. The embodiment of the present application does not limit the specific technology and specific device form adopted by the terminal device.
[0067] For example, Figure 21 shows a schematic diagram of the structure of the electronic device 100. The 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 speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, 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. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0068] It is to be understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0069] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.
[0070] The controller may be the nerve center and command center of the electronic device 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.
[0071] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0072] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.
[0073] The electronic device 100 implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
[0074] The electronic device 100 can realize the shooting function through ISP, camera 193, video codec, GPU, display screen 194 and application processor.
[0075] The electronic device 100 can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.
[0076] It should be noted that any electronic device mentioned in the embodiments of the present application may include more or fewer modules in the electronic device 100.
[0077] The software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture.
[0078] The application scenarios provided by the embodiments of the present application are described below with reference to the accompanying drawings.
[0079] FIG. 3A to FIG. 3E A schematic diagram of an application scenario of the data synchronization method provided in an embodiment of the present application.
[0080] If user A has three electronic devices, namely, a mobile phone 10, a home storage center device (Network Attached Storage, NAS) 20 and a PAD 30, the mobile phone 10 and the PAD 30 can synchronize data through the NAS 20 or directly, which is not limited in the present embodiment. Figure 3A As shown, data synchronization is performed between the mobile phone 10 and the PAD 30 via the NAS 20 .
[0081] It is understandable that there are two applications in the mobile phone 10 that can perform data synchronization, for example, both the gallery application and the call log application can perform data synchronization. User A can select one of the applications for data synchronization, or can select both the gallery application and the call log application for data synchronization, which is not limited in the embodiment of the present application.
[0082] For example, the user logs in to the mobile phone 10 and the PAD 30 through the same account, and data synchronization can be performed between the mobile phone 10 and the PAD 30. Figure 3B As shown, user A selects to synchronize the gallery in the mobile phone 10 and selects not to synchronize the call records; and selects to synchronize the gallery in the PAD 30 and selects not to synchronize the call records.
[0083] If the user takes a photo of the snow mountain through the mobile phone 10, an image 110 is obtained. The image 110 is stored in the photo album of the mobile phone 10, and the image 110 is displayed in the photo album, such as Figure 3C Based on the selection of user A, the mobile phone 10 synchronizes the images in the gallery, and then synchronously displays the image 110 in the album of the PAD 30, as shown in FIG. Figure 3D shown.
[0084] However, since user A chooses not to synchronize call records, user A calls "Xiao A" at the current moment, and the call record of calling "Xiao A" is displayed on the mobile phone 10, but the call record of calling "Xiao A" is not synchronously displayed on the PAD 30, as shown in FIG. Figure 3E shown.
[0085] It should be understood that the above is an example of an application scenario and does not limit the application scenario of the present application.
[0086] Combine the following Figures 4 to 14 The data synchronization method provided in the embodiment of the present application is described in detail.
[0087] When synchronizing data between electronic devices, a Sync Group can be used as the largest data synchronizable unit in the data synchronization service process. Databases with the same name in a Sync Group can be synchronized, but databases with different names (equivalent to databases across groups) cannot be synchronized.
[0088] The structural diagram of a synchronization group can be as follows Figure 4 As shown, it includes a metadata database and multiple application databases. The application database stores the data of the application program, and the metadata database stores the configuration data related to the data synchronization process in the application database.
[0089] Both the metadata database and the application database in the application process can be stored in the structure of Syncable KV DB. For example, Figure 5 As shown in the figure, Syncable KV DB consists of two parts: business database (data DB) and log database (log DB). Among them, data DB is usually used to persist data and supports reading, writing and querying data, so dataDB is used to store actual business data. Log DB can be used to store operation logs, that is, data modification records of data DB. A device in the synchronization group stores logs in log DB, and another device in the synchronization group can reproduce the logs to achieve data synchronization with the database of the above device. Therefore, it can be said that log DB is the key to achieving data synchronization between different devices. The data and data format stored in log DB can be shown in Table 1.
[0090] Table 1
[0091] max Index Key ${max Index} Index For Devld Synced logs' max index index data db operation log index data db operation log index data db operation log
[0092] Among them, the max Index Key is used to store the largest operation record index in the current logDB, and the maxIndex Key will increase as the operation records are generated.
[0093] Index For Devld is used to record the maximum index of synchronized operation records of the other end device in the synchronization group;
[0094] Index: used to mark the order of each operation record. The format of the operation record is shown in Table 2.
[0095] Table 2
[0096] index 0 key name value jack type add / delete / mofify / conflict src local / remote status written / not written timestamp 129391
[0097] The key is used to indicate the key of the data corresponding to the operation record.
[0098] Value is used to indicate the value of the data corresponding to the operation record.
[0099] Type is used to indicate the type of operation record, including add, delete, mofify, and conflict.
[0100] The source (src) is used to indicate the source of the data corresponding to the operation record, for example, the data corresponding to the operation record is local data, or the data corresponding to the operation record is data synchronized to the local device by other devices.
[0101] The status is used to indicate whether the operation record has stored the corresponding data. For example, the operation record has been written to the disk, but the specific data item has not been written to the disk; writing to the disk can mean storing it in the database.
[0102] A timestamp refers to the time when the data corresponding to the operation record is generated, and can be represented by the count value of a counter in an electronic device.
[0103] Data is stored in Syncable KV DB based on Leveldb in KV format, that is, data is stored by key and value. Both key and value are arbitrary byte arrays. When storing data, the key value is sorted according to the comparator function specified by the user.
[0104] Usually, each electronic device will establish a synchronization group when it is turned on, and other electronic devices can choose whether to join the synchronization group. Usually, NAS can be used to manage synchronized data, so other electronic devices usually choose NAS as the central device and join the synchronization group created by NAS.
[0105] Next, the process of how an electronic device establishes a synchronization group is described.
[0106] When the electronic device is turned on, it usually automatically creates a synchronization group named after its own device ID, and the leader of the synchronization group is the device itself by default. It is understandable that the leader of the synchronization group can be the central device.
[0107] For example, Figure 6 As shown, when NAS20 is turned on, the synchronization group manager module in the synchronization service process in NAS20 obtains the device ID of NAS20 from the device management service. For example, the device ID of NAS20 is: DEV_ID_OF_NAS. The synchronization group manager creates a synchronization group named DEV_ID_OF_NAS based on the device ID of NAS20, and sets the leader of the synchronization group to NAS20. Then the synchronization group manager module creates a corresponding metadata library. Among them, the metadata library is used to store database information with NAS20 as the central database. The structure of the metadata library can use the structure of the syncable database SyncableKVDB to store data.
[0108] by Figure 3BThe synchronization of call records in the mobile phone 10 shown is used as an example for explanation. After automatic synchronization of call records is selected, the call application in the mobile phone 10 calls the interface of the data synchronization service process to create an edge database, that is, a call application database. For example, the name is "callRecord" call application database. At the same time, the central device of the synchronization group joined by the mobile phone 10 is the synchronization group of NAS20, then the data synchronization service process on the mobile phone 10 will create a copy of the NAS20 synchronization group on the mobile phone 10 (essentially also a synchronization group). At the same time, the mobile phone 10 also creates a metadata database for the synchronization group on the mobile phone 10, and adds a piece of data to the metadata database, indicating that the call application has created an edge database under the synchronization group.
[0109] The data added in data DB may be shown in Table 3, and the data added in log DB may be shown in Table 5.
[0110] Table 3
[0111] key value callRecord db_config_data
[0112] The data structure in "value" can be as shown in Table 4.
[0113] Table 4
[0114] ServiceId Phone Call is Auto Sync true bind When Dead false …… ……
[0115] Among them, "ServiceId" is used to indicate the service type of the data, for example, "phone Call" shown in Table 4 indicates that the service type of the stored data is a call service. "is Auto Sync" is used to indicate whether automatic synchronization is performed. If the value of "isAuto Sync" is "true", as shown in Table 4, it means that automatic synchronization is required; if the value of "is Auto Sync" is "false", it means that automatic synchronization is not required. "bind When Dead" indicates whether to automatically initiate a synchronization request when the current process does not exist. For example, the value of "bind When Dead" shown in Table 4 is "false", which means that when the call process does not exist, the synchronization request will not be automatically initiated; if the value of "bind When Dead" is "true", it means that when the call process does not exist, the synchronization request will be automatically initiated.
[0116] The data added in log DB can be shown in Table 5.
[0117] Table 5
[0118] Key value maxIndex 0 Index_for_center -1 logIndex-0 dataDB-operation_log
[0119] The data structure in "value" can be as shown in Table 6.
[0120] Table 6
[0121] Index phoneCall key call Record value {phone Call,true,false} type add src local status written time stamp 1265022
[0122] The value assignment "{phone Call, true, false}" in Table 6 may indicate the information included in value in Table 4.
[0123] The flowchart for creating a synchronization group can be as follows: Figure 7 As shown, including:
[0124] S101. In response to a power-on operation of an electronic device, a synchronization group manager module obtains a storage path of a synchronization group from a read-only memory (ROM).
[0125] S102: The synchronization group manager module obtains the local device ID from the device management module.
[0126] S103: The synchronization group manager module determines whether there is a synchronization group corresponding to the local device ID.
[0127] If there is a synchronization group corresponding to the local device ID, the process ends.
[0128] If there is no synchronization group corresponding to the local device ID, execute S104.
[0129] S104. The synchronization group manager module creates a synchronization group A with the local device ID as the synchronization group name.
[0130] S105. The synchronization group manager module requests the ROM for the storage path of the synchronization group A.
[0131] S106: The synchronization group manager module creates a metadata library for synchronization group A.
[0132] S107. The synchronization group manager module saves the metadata library of synchronization group A to the storage path of synchronization group A in ROM.
[0133] The following describes the process of how other electronic devices join the synchronization group.
[0134] Continuing to take NAS20 as the leader of the synchronization group as an example, the process of how other electronic devices join the synchronization group is described.
[0135] Other electronic devices may refer to Figure 3A It should be understood that the application process that needs to perform data synchronization in the mobile phone 10 is usually unable to directly interact with the synchronization service process, so the data interaction between the two processes is achieved through the cross-process assisting process.
[0136] For example, Figure 8 As shown in the figure, the call process exchanges data with the synchronization service process through the cross-process assistance process. Usually, the database manager in the call process will create Figure 8 The call record database shown in is used to store call records. The structure of the call record database may adopt the structure of the above-mentioned SyncableKVDB, and the name of the call record database may be Call Record.
[0137] The electronic device can specify to synchronize the call data to the synchronization group whose synchronization group name is group Id DEV_ID_OF_NAS, and then the database manager in the call process notifies the synchronization group manager in the synchronization service process through the cross-process assistance process that the call record database has been created. The synchronization group manager searches whether there is a synchronization group with the synchronization group name DEV_ID_OF_NAS in the mobile phone 10. Since the mobile phone 10 has not yet joined the synchronization group DEV_ID_OF_NAS, there is no synchronization group with the synchronization group name DEV_ID_OF_NAS in the mobile phone 10. At this time, the mobile phone needs to create a synchronization group copy with the synchronization group name DEV_ID_OF_NAS. The synchronization group copy can be an empty metadata database and adopt the structure of the above-mentioned SyncableKVDB. After creating the synchronization group copy with the synchronization group name DEV_ID_OF_NAS, the synchronization group copy adds a piece of data 1 to the metadata database in the mobile phone. The data key of data 1 is the name of the call record database established by the call service, namely Call Record. The data structure of data 1 can be as shown in Table 4.
[0138] Among them, "ServiceId" is used to indicate the service type of the data, for example, "phone Call" shown in Table 4 indicates that the service type of the stored data is a call service. "is Auto Sync" is used to indicate whether automatic synchronization is performed. If the value of "isAuto Sync" is "true", as shown in Table 4, it means that automatic synchronization is required; if the value of "is Auto Sync" is "false", it means that automatic synchronization is not required. "bind When Dead" indicates whether to automatically initiate a synchronization request when the current process does not exist. For example, the value of "bind When Dead" shown in Table 4 is "false", which means that when the call process does not exist, the synchronization request will not be automatically initiated; if the value of "bind When Dead" is "true", it means that when the call process does not exist, the synchronization request will be automatically initiated.
[0139] Correspondingly, a piece of data 2 is added to the metadata database of the synchronization group leader NAS20.
[0140] Thus, the mobile phone 10 has been successfully added to the synchronization group DEV_ID_OF_NAS. When the application in the mobile phone needs to synchronize data to the NAS, the application data (such as call records) is stored in the metadata library in the synchronization service process through the application to be synchronized (such as the call application), and the value of "max index Key" and the value of "index For NAS" are updated at the same time.
[0141] Exemplarily, the flow chart of the edge device joining the synchronization group can be as follows: Fig. 9 As shown, including:
[0142] S201. In response to an operation of connecting to a central device, a device management module obtains a synchronization group ID of the central device.
[0143] Among them, the central device can refer to Figure 3B In the NAS20 shown in FIG. 1 , the synchronization group ID may refer to the ID “DEV_ID_OF_NAS” of NAS20. The operation of connecting to the central device may also be referred to as the central device going online, that is, the NAS20 going online. It is understandable that the device management module may obtain the central device synchronization group ID by the central device actively sending it to the device management module when the central device goes online.
[0144] S202: The application process obtains a synchronization group ID.
[0145] The application process may be an application running on an edge device that needs to synchronize data, for example, Fig. 9 As shown, the application process may be a gallery application process. For ease of understanding, the following description is made by taking the gallery application process as an example.
[0146] The gallery application process can actively send a request to the device management module to obtain the synchronization group ID. In response to the request, the device management module returns the synchronization group ID to the gallery application process. The device management module can also actively return the synchronization group ID to the gallery application process after obtaining the synchronization group ID of the central device. The embodiment of the present application does not limit this.
[0147] S203: In response to the user's operation of enabling the synchronization function of the gallery application, the gallery application process creates a gallery application database.
[0148] The gallery application database stores data generated by the gallery application.
[0149] S204: The gallery application process saves the gallery application database to a save path in the ROM.
[0150] It should be understood that saving the picture library application database to the saving path in the ROM is equivalent to determining a section of memory in the ROM, and the section of memory is used to store the data of the picture library application database.
[0151] S205. The gallery application process sends the synchronization group ID of the central device to the synchronization group manager module, and requests to join the synchronization group whose synchronization group name is the synchronization group ID.
[0152] It should be understood that the synchronization group manager may refer to a module in the synchronization service process.
[0153] S206: The synchronization group manager determines whether there is a synchronization group with the synchronization group name being the synchronization group ID in the edge device.
[0154] It should be noted that if there is a synchronization group with the synchronization group name being the synchronization group ID in the edge device, that is to say, there is a metadata library with the synchronization group ID as the group name in the edge device. If there is no synchronization group with the synchronization group name being the synchronization group ID in the edge device, that is to say, there is no metadata library with the synchronization group ID as the group name in the edge device.
[0155] If a synchronization group with the synchronization group name being the synchronization group ID exists in the edge device, that is, a metadata library with the synchronization group ID as the group name exists in the edge device, S207 is executed.
[0156] If there is no synchronization group with the synchronization group name being the synchronization group ID in the edge device, that is, there is no metadata library with the synchronization group ID as the group name in the edge device, S208 is executed.
[0157] S207 . The synchronization group manager stores the to-be-synchronized data corresponding to the gallery application process in a metadata repository with the synchronization group ID as the group name.
[0158] The data to be synchronized may refer to configuration information corresponding to the newly added data of the gallery application. Storing the data to be synchronized corresponding to the gallery application process in the metadata base with the synchronization group ID as the group name may refer to storing the data to be synchronized in the storage path corresponding to the metadata base in the ROM.
[0159] S208. The synchronization group manager creates a synchronization group copy with the synchronization group name being the synchronization group ID.
[0160] S209: The synchronization group manager stores the synchronization group copy whose synchronization group name is the synchronization group ID in the ROM.
[0161] It can be understood that storing the synchronization group replica whose synchronization group name is the synchronization group ID in the ROM may refer to allocating a memory space in the ROM for the synchronization group replica whose synchronization group name is the synchronization group ID.
[0162] S210. The synchronization group manager creates a metadata base corresponding to the synchronization group name and the synchronization group ID.
[0163] S211. The synchronization group manager stores the metadata database whose synchronization group name is the synchronization group ID in the ROM.
[0164] It can be understood that storing the metadata base corresponding to the synchronization group name and the synchronization group ID in the ROM may refer to allocating a memory space in the ROM for the metadata base.
[0165] At this point, the metadatabase corresponding to the synchronization group name and the synchronization group ID already exists in the edge device, so the synchronization group key can return to execute S207 to store the to-be-synchronized data corresponding to the gallery application process into the metadatabase with the synchronization group ID as the group name.
[0166] Fig.10 A flowchart of a data synchronization method provided in an embodiment of the present application is shown as follows: Fig.10 As shown, the method is applied to a first electronic device, the first electronic device is communicatively connected with a second electronic device, the first electronic device runs at least two applications, the at least two applications include a first application, the first electronic device includes a first application database corresponding to the first application, and the method includes:
[0167] S301: Determine whether a first synchronization group exists in a first electronic device, where the first synchronization group is a synchronization group created by a second electronic device, and the first synchronization group performs data synchronization through a metadata library.
[0168] It is understood that the first electronic device may be Figure 3A The second electronic device may be a mobile phone 10 shown in FIG. Figure 3A In one possible case, the second electronic device may also be Figure 3A PAD 30 shown in FIG.
[0169] S302: If a first synchronization group exists in the first electronic device, store first data to be synchronized in the first application database into a metadata database in the first synchronization group.
[0170] Fig.10 The implementation principle of the embodiment shown is the same as that of the above Figures 4 to 9 The embodiments shown are similar and will not be described again here.
[0171] The data synchronization method provided in the embodiment of the present application is applied to a first electronic device, the first electronic device is communicatively connected with a second electronic device, the first electronic device runs at least two applications, the at least two applications include a first application, the first electronic device includes a first application database corresponding to the first application, by determining whether a first synchronization group exists in the first electronic device, the first synchronization group is a synchronization group created by the second electronic device, the first synchronization group performs data synchronization through a metadata database, if the first synchronization group exists in the first electronic device, the first data to be synchronized in the first application database is stored in the metadata database in the first synchronization group, which is equivalent to the data synchronized between the first electronic device and the second electronic device, which is only the data in the first application database in the first electronic device, so that only the data of one of the applications can be synchronized between the first electronic device and the second electronic device, instead of synchronizing all the data in the first electronic device and the second electronic device, so that the user can choose the synchronized application according to their own needs, and transform the data synchronization from device-level data synchronization to application-level data synchronization, thereby improving the user experience.
[0172] Fig.11 A flowchart of a data synchronization method provided in an embodiment of the present application is shown as follows: Fig.11 As shown, the method is applied to a first electronic device, the first electronic device is communicatively connected with a second electronic device, the first electronic device runs at least two applications, the at least two applications include a first application, the first electronic device includes a first application database corresponding to the first application, and the method includes:
[0173] S401: Determine whether a first synchronization group exists in a first electronic device, where the first synchronization group is a synchronization group created by a second electronic device, and the first synchronization group performs data synchronization through a metadata library.
[0174] If the first synchronization group exists in the first electronic device, S402 is executed.
[0175] If the first synchronization group does not exist in the first electronic device, steps S403 to S404 are executed.
[0176] S402: Store first data to be synchronized in the first application database into a metadata database in the first synchronization group.
[0177] S403: Create a synchronization group replica corresponding to the first synchronization group.
[0178] S404: Create a metadata database.
[0179] After creating the metadata library, the first electronic device may return to execute S402.
[0180] Fig.11 The implementation principle of the embodiment shown is the same as that of the above Figures 4 to 9 The embodiments shown are similar and will not be described again here.
[0181] The data synchronization method provided in the embodiment of the present application is applied to a first electronic device, where the first electronic device is communicatively connected with a second electronic device, where the first electronic device runs at least two applications, where the at least two applications include a first application, and where the first electronic device includes a first application database corresponding to the first application. By determining whether a first synchronization group exists in the first electronic device, the first synchronization group is a synchronization group created by the second electronic device, and the first synchronization group performs data synchronization through a metadata database, if the first synchronization group does not exist in the first electronic device, a synchronization group copy corresponding to the first synchronization group is created, and a metadata database is created so that the first electronic device can store the first data to be synchronized in the first application database into the metadata database in the first synchronization group, thereby enabling the data synchronized between the first electronic device and the second electronic device to be only the data in the first application database in the first electronic device, rather than synchronizing all the data in the first electronic device and the second electronic device, thereby enabling the user to select the synchronized application according to their own needs, thereby transforming the data synchronization from device-level data synchronization to application-level data synchronization, and improving the user experience.
[0182] Fig.12 A flowchart of a data synchronization method provided in an embodiment of the present application is shown as follows: Fig.12 As shown, the method is applied to a first electronic device, the first electronic device is communicatively connected with a second electronic device, the first electronic device runs at least two applications, the at least two applications include a first application, the first electronic device includes a first application database corresponding to the first application, a first synchronization group housekeeper module and a first device management module, and the method includes:
[0183] S501. A first application program obtains a synchronization group identifier from a first device management module.
[0184] S502: The first application sends a synchronization group identifier to a first synchronization group manager module.
[0185] S503: The first synchronization group manager module determines whether a first synchronization group exists in the first electronic device based on the synchronization group identifier.
[0186] If the first synchronization group exists in the first electronic device, S504 is executed.
[0187] If the first synchronization group does not exist in the first electronic device, steps S505 to S506 are executed.
[0188] S504: The first synchronization group housekeeper module stores the first data to be synchronized in the first application database into the metadata database in the first synchronization group.
[0189] The first data to be synchronized includes synchronization configuration information of the first application, and the synchronization configuration information includes parameters for data synchronization of the first application.
[0190] S505. The first synchronization group housekeeper module creates a synchronization group replica corresponding to the first synchronization group, where the synchronization group replica includes a metadata library.
[0191] S506: The first synchronization group manager module creates a metadata library.
[0192] After the first synchronization group manager module creates the metadata library, the first synchronization group manager module may return to execute S504.
[0193] Fig.12 The implementation principle of the embodiment shown is the same as that of the above Figures 4 to 9 The embodiments shown are similar and will not be described again here.
[0194] The above embodiments focus on how the first electronic device (edge device) performs application-level data synchronization through a synchronization group. Fig.13 The illustrated embodiment is used to illustrate the specific process of how the second electronic device (central device) creates a synchronization group.
[0195] Fig.13 A flowchart of a data synchronization method provided in an embodiment of the present application is shown as follows: Fig.13 As shown, the method is applied to a second electronic device, the second electronic device is communicatively connected with a first electronic device, the first electronic device runs at least two applications, the at least two applications include a first application, the first electronic device includes a first application database corresponding to the first application, and the method includes:
[0196] S601: Obtain a synchronization group identifier.
[0197] S602: Create a first synchronization group based on the synchronization group identifier, so that the first electronic device stores the first data to be synchronized in the first application database into a metadata database in the first synchronization group, wherein the first synchronization group performs data synchronization through the metadata database.
[0198] The creation of a synchronization group may refer to using a storage space in a read-only memory (ROM) of the second electronic device as a synchronization group storage space in a folder format, which is equivalent to allocating a specific space in the ROM of the second electronic device to store all data of the synchronization group in the form of a folder (or a similar folder).
[0199] The format of the folder is different from that of the database, and the synchronization group storage space exists in the form of a folder. In order to more effectively manage and access the data therein, the second electronic device uses the database format to establish a specific metadata library in the folder to quickly index, query and synchronize data.
[0200] Creating the first synchronization group based on the synchronization group identifier may refer to creating the first synchronization group using the identifier of the second electronic device as the synchronization group name.
[0201] Fig.13 The implementation principle of the embodiment shown is the same as that of the above Figures 4 to 9 The embodiments shown are similar and will not be described again here.
[0202] The data synchronization method provided in the embodiment of the present application is applied to a second electronic device, the second electronic device is communicatively connected with a first electronic device, the first electronic device runs at least two applications, the at least two applications include a first application, and the first electronic device includes a first application database corresponding to the first application. The method includes: obtaining a synchronization group identifier, creating a first synchronization group based on the synchronization group identifier, so that the first electronic device stores the first data to be synchronized in the first application database into a metadata database in the first synchronization group, wherein the first synchronization group performs data synchronization through the metadata database, so that it can be achieved by storing the data corresponding to the first application in the first electronic device in the first synchronization group created by the second electronic device, that is, the data synchronized between the first electronic device and the second electronic device is only the data in the first application database in the first electronic device, so that the first electronic device and the second electronic device can only synchronize the data of one of the applications, rather than synchronizing the data of all applications of the first electronic device, so that the user can select the synchronized application according to their own needs, and transform the data synchronization from device-level data synchronization to application-level data synchronization, thereby improving the user experience.
[0203] Optionally, the synchronization group identifier is an identifier of the second electronic device.
[0204] It can be understood that the identifier of the second electronic device is used to indicate the second electronic device and usually will not be repeated with the identifiers of other electronic devices in the synchronization group. That is to say, within the synchronization group, the identifier of the second electronic device is unique. Therefore, using the identifier of the second electronic device as the synchronization group name of the first synchronization group can distinguish the first synchronization group from other synchronization groups.
[0205] In the data synchronization method provided in the embodiment of the present application, the second electronic device can create a first synchronization group based on the second electronic device identifier during the process of creating a synchronization group. Within the synchronization group, the identifier of the second electronic device is usually unique. Therefore, by using the identifier of the second electronic device as the synchronization group name of the first synchronization group, the first synchronization group can be distinguished from other synchronization groups, thereby avoiding the first electronic device from mistakenly synchronizing data with other electronic devices outside the first synchronization group when synchronizing data with the second electronic device.
[0206] Fig.14 A flowchart of a data synchronization method provided in an embodiment of the present application is shown as follows: Fig.14 As shown, the method is applied to a second electronic device, the second electronic device is communicatively connected with a first electronic device, the first electronic device runs at least two applications, the at least two applications include a first application, the first electronic device includes a first application database corresponding to the first application, the second electronic device includes a second device management module and a second synchronization group housekeeper module, and the method includes:
[0207] S701. The second synchronization group manager module obtains a synchronization group identifier from the second device management module.
[0208] S702. The second synchronization group manager module creates a first synchronization group based on the synchronization group identifier, so that the first electronic device stores the first data to be synchronized in the first application database into the metadata database in the first synchronization group, wherein the first synchronization group synchronizes data through the metadata database.
[0209] Fig.14 The implementation principle of the embodiment shown is the same as that of the above Figures 4 to 9 The embodiments shown are similar and will not be described again here.
[0210] In one embodiment, a data synchronization method is provided. The method is applied to a data synchronization system. The data synchronization system includes a first electronic device and a second electronic device as shown in the above embodiment.
[0211] Optionally, the data synchronization system also includes a third electronic device. After the first data to be synchronized is synchronized between the first electronic device and the second electronic device, the second electronic device synchronizes the first data to be synchronized to the third electronic device, where the first data to be synchronized is data corresponding to the first application running in the first electronic device.
[0212] It can be understood that the third electronic device can be multiple electronic devices.
[0213] The implementation principle of the above embodiment is Figures 4 to 14 The embodiments shown are similar and will not be described again here.
[0214] The data synchronization method provided in the embodiment of the present application is applied to a data synchronization system, and the data synchronization system includes a first electronic device, a second electronic device and a third electronic device as shown in the above embodiment. After the first data to be synchronized is synchronized between the first electronic device and the second electronic device, the second electronic device synchronizes the first data to be synchronized to the third electronic device, wherein the first data to be synchronized is data corresponding to a first application running in the first electronic device, so that the first electronic device can synchronize the first data to be synchronized to the third electronic device. It can be understood that the third electronic device can be multiple electronic devices, so it is equivalent to that the first electronic device can synchronize data to multiple electronic devices through the second electronic device, thereby improving the efficiency of synchronizing data.
[0215] It should be understood that, although each step in the flow chart in the above-described embodiment is shown in sequence according to the indication of the arrow, these steps are not necessarily performed in sequence according to the order indicated by the arrow. Unless there is clear explanation in this article, the execution of these steps does not have strict order restriction, and these steps can be performed in other orders. Moreover, at least a portion of the steps in the flow chart may include a plurality of sub-steps or a plurality of stages, and these sub-steps or stages are not necessarily performed at the same time, but can be performed at different times, and the execution order of these sub-steps or stages is not necessarily performed in sequence, but can be performed in turn or alternately with at least a portion of other steps or sub-steps or stages of other steps.
[0216] It is understandable that in order to implement the above functions, the electronic device includes hardware and / or software modules corresponding to the execution of each function. In combination with the algorithm steps of each example described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application in combination with the embodiments, but such implementation should not be considered to be beyond the scope of the present application.
[0217] The embodiment of the present application can divide the functional modules of the electronic device according to the above method example. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one module. It should be noted that the division of modules in the embodiment of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation. It should be noted that the names of the modules in the embodiment of the present application are schematic and are not limited to the names of the modules in actual implementation.
[0218] Fig.15 A structural schematic diagram of an electronic device provided by the present application is shown. Fig.15The dotted line in the figure indicates that the unit or the module is optional. The electronic device 700 can be used to implement the data synchronization method described in the above method embodiment.
[0219] The electronic device 700 includes one or more processors 701, which can support the electronic device 700 to implement the data synchronization method in the method embodiment. The processor 701 can be a general-purpose processor or a special-purpose processor. For example, the processor 701 can be a central processing unit (CPU), a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, such as discrete gates, transistor logic devices or discrete hardware components.
[0220] The processor 701 may be used to control the electronic device 700, execute software programs, and process data of the software programs. The electronic device 700 may also include a communication unit 705 to implement input (reception) and output (transmission) of signals.
[0221] For example, the electronic device 700 may be a chip, the communication unit 705 may be an input and / or output circuit of the chip, or the communication unit 705 may be a communication interface of the chip, and the chip may be a component of a terminal device or other electronic devices.
[0222] For another example, the electronic device 700 may be a terminal device, and the communication unit 705 may be a transceiver of the terminal device, or the communication unit 705 may be a transceiver circuit of the terminal device.
[0223] The electronic device 700 may include one or more memories 702 on which a program 704 is stored. The program 704 can be executed by the processor 701 to generate instructions 703, so that the processor 701 executes the impedance matching method described in the above method embodiment according to the instructions 703.
[0224] Optionally, data may be stored in the memory 702. Optionally, the processor 701 may read data stored in the memory 702. The data may be stored at the same storage address as the program 704, or may be stored at a different storage address than the program 704.
[0225] The processor 701 and the memory 702 may be provided separately or integrated together; for example, integrated on a system on chip (SOC) of a terminal device.
[0226] Exemplarily, the memory 702 can be used to store the relevant program 704 of the data synchronization method provided in the embodiment of the present application, and the processor 701 can be used to call the relevant program 704 of the data synchronization method stored in the memory 702 when performing data synchronization, and execute the data synchronization method of the embodiment of the present application; including: determining whether there is a first synchronization group in the first electronic device, the first synchronization group is a synchronization group created by the second electronic device, and the first synchronization group synchronizes data through the metadata database; if the first synchronization group exists in the first electronic device, the first data to be synchronized in the first application database is stored in the metadata database in the first synchronization group.
[0227] Exemplarily, the memory 702 can be used to store the relevant program 704 of the data synchronization method provided in the embodiment of the present application, and the processor 701 can be used to call the relevant program 704 of the data synchronization method stored in the memory 702 when performing data synchronization, and execute the data synchronization method of the embodiment of the present application; including: obtaining a synchronization group identifier; creating a first synchronization group based on the synchronization group identifier, so that the first electronic device stores the first data to be synchronized in the first application database into the metadata database in the first synchronization group, wherein the first synchronization group performs data synchronization through the metadata database.
[0228] The present application also provides a computer program product, which, when executed by the processor 701, implements the data synchronization method described in any method embodiment of the present application.
[0229] The computer program product may be stored in the memory 702 , for example, a program 704 , which is converted into an executable target file that can be executed by the processor 701 after preprocessing, compiling, assembling, and linking.
[0230] The present application also provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a computer, the data synchronization method described in any method embodiment of the present application is implemented. The computer program can be a high-level language program or an executable target program.
[0231] The computer-readable storage medium is, for example, a memory 702. The memory 702 may be a volatile memory or a nonvolatile memory, or the memory 702 may include both a volatile memory and a nonvolatile memory. Among them, the nonvolatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct rambus RAM (DR RAM).
[0232] In this application, "at least one" means one or more, and "more than one" means two or more. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can be represented by: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple.
[0233] It should be understood that in the various embodiments of the present application, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0234] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0235] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0236] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic; for example, the division of the units is only a logical function 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. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0237] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0238] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0239] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A data synchronization method, It is characterized in that The method is applied to a first electronic device, the first electronic device is communicatively connected with a second electronic device, the first electronic device runs at least two applications, the at least two applications include a first application, and the first electronic device includes a first application database corresponding to the first application, the method includes: Determine whether a first synchronization group exists in the first electronic device, the first synchronization group is a synchronization group created by the second electronic device, and the first synchronization group performs data synchronization through a metadata database; If the first synchronization group exists in the first electronic device, the first data to be synchronized in the first application database is stored in the metadata database in the first synchronization group.
2. The method according to claim 1, It is characterized in that The method further comprises: If the first synchronization group does not exist in the first electronic device, a synchronization group replica corresponding to the first synchronization group is created, and the synchronization group replica includes the metadata library.
3. The method according to claim 2, It is characterized in that Creating a synchronization group replica corresponding to the first synchronization group includes: The metadata database is created.
4. The method according to any one of claims 1 to 3, It is characterized in that The first electronic device further includes a first synchronization group manager module, and the determining whether the first synchronization group exists in the first electronic device includes: The first synchronization group manager module determines whether the first synchronization group exists in the first electronic device.
5. The method according to claim 4, It is characterized in that The electronic device further includes a first device management module, and the first synchronization group manager module determines whether the first synchronization group exists in the first electronic device, including: The first application obtains a synchronization group identifier from the first device management module; The first application sends the synchronization group identifier to the first synchronization group manager module; The first synchronization group manager module determines whether the first synchronization group exists in the first electronic device based on the synchronization group identifier.
6. The method according to any one of claims 2 to 5, It is characterized in that The first electronic device further includes a first synchronization group manager module, and the step of creating a synchronization group copy corresponding to the first synchronization group includes: The first synchronization group housekeeper module creates the metadata library corresponding to the first synchronization group.
7. The method according to any one of claims 1 to 6, It is characterized in that The first data to be synchronized includes synchronization configuration information of the first application, and the synchronization configuration information includes parameters for data synchronization of the first application.
8. A data synchronization method, It is characterized in that The method is applied to a second electronic device, the second electronic device is communicatively connected to a first electronic device, the first electronic device runs at least two applications, the at least two applications include a first application, and the first electronic device includes a first application database corresponding to the first application, the method includes: Get the synchronization group ID; A first synchronization group is created based on the synchronization group identifier, so that the first electronic device stores the first data to be synchronized in the first application database into a metadata database in the first synchronization group, wherein the first synchronization group performs data synchronization through the metadata database.
9. The method according to claim 8, It is characterized in that The second electronic device includes a second device management module and a second synchronization group manager module, and obtaining the synchronization group identifier includes: The second synchronization group manager module obtains the synchronization group identifier from the second device management module; Creating a first synchronization group based on the synchronization group identifier includes: The second synchronization group manager module creates a first synchronization group based on the synchronization group identifier.
10. The method according to any one of claims 8 or 9, It is characterized in that The synchronization group identifier is an identifier of the second electronic device.
11. A data synchronization method, It is characterized in that The method is applied to a data synchronization system, which includes a first electronic device as claimed in any one of claims 1 to 7 and a second electronic device as claimed in any one of claims 8 to 10.
12. The method according to claim 11, It is characterized in that The data synchronization system further includes a third electronic device, and the method further includes: The second electronic device synchronizes first data to be synchronized with the third electronic device, where the first data to be synchronized is data corresponding to a first application running in the first electronic device.
13. An electronic device, It is characterized in that The electronic device comprises a module for executing the method according to any one of claims 1 to 7, or the electronic device comprises a module for executing the method according to any one of claims 8 to 10.
14. An electronic device, It is characterized in that include: one or more processors; Memory; and one or more computer programs, wherein the one or more computer programs are stored in the memory, and when the computer programs are executed by the one or more processors, the electronic device executes the method as claimed in any one of claims 1 to 7, or the electronic device executes the method as claimed in any one of claims 8 to 10.
15. A chip system, It is characterized in that The chip system includes a processor for calling and running a computer program from a memory so that an electronic device equipped with the chip system executes a method as described in any one of claims 1 to 7, or an electronic device equipped with the chip system executes a method as described in any one of claims 8 to 10.
16. A computer-readable storage medium comprising a computer program, It is characterized in that When the computer program is executed on an electronic device, the electronic device is enabled to execute the method according to any one of claims 1 to 7, or the electronic device is enabled to execute the method according to any one of claims 8 to 10.
Citation Information
Patent Citations
Data synchronization method and device, equipment and storage medium
CN114281892A
Data synchronization method and device
CN114691631A
Data synchronization method and related equipment
CN115017227A
Data synchronization management method and system and electronic equipment
CN116166740A
Systems and methods for synchronizing content and information on multiple computing devices
US20180234496A1