A data synchronization method and electronic device
By employing strategic Bluetooth connections and transmission channel establishment between electronic devices within the trust ring, the problems of transmission channel occupancy and synchronization timing conflicts are resolved, improving data synchronization success rate and enhancing user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HONOR DEVICE CO LTD
- Filing Date
- 2023-12-30
- Publication Date
- 2026-06-23
AI Technical Summary
When multiple electronic devices within a trust ring synchronize and share data in an application, the data synchronization success rate may be low due to occupied transmission channels or conflicting synchronization timing, which may affect the user experience.
By employing strategic Bluetooth connections and transmission channel establishment among electronic devices within the trust ring, the connection and channel establishment are initiated by the device whose identifier meets preset conditions, thus avoiding conflicts and achieving an orderly data synchronization process.
It improves the success rate of data synchronization, ensuring that all electronic devices within the trust ring can smoothly synchronize data, thus enhancing the user experience.
Smart Images

Figure CN120282254B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data synchronization, and more particularly to a data synchronization method and an electronic device. Background Technology
[0002] Currently, when multiple electronic devices within a trust ring are synchronizing data in shared applications, issues such as occupied transmission channels and conflicting synchronization times may cause some electronic devices within the trust ring to be unable to synchronize data in the shared applications of other electronic devices, resulting in a low data synchronization success rate and impacting user experience. Summary of the Invention
[0003] This application provides a data synchronization method and an electronic device for improving the success rate of data synchronization when synchronizing and sharing data between electronic devices within a trust ring.
[0004] To achieve the above objectives, the embodiments of this application adopt the following technical solutions:
[0005] In a first aspect, a data synchronization method is provided, applied to a first electronic device. The first electronic device and at least one second electronic device are electronic devices within a trust ring. The first electronic device includes a first sharing application, and the second electronic device includes a second sharing application. The first and second sharing applications are used to display material metadata of shared files in each electronic device within the trust ring. The method may include: firstly, the first electronic device displays material metadata of the first shared files in the first sharing application; then, in response to a data synchronization event of the first electronic device, the first electronic device and the second electronic device synchronize shared data according to a first strategy supported by both the first and second sharing applications; finally, the first electronic device displays material metadata of the second shared files in each of the second sharing applications in the first sharing application.
[0006] The shared data refers to data from the first sharing application and / or the second sharing application. On one hand, the first strategy instructs the device identifier of the first electronic device and the second electronic device, whichever meets a first preset condition, to initiate a Bluetooth connection. On the other hand, the first strategy also instructs the timing of establishing a transmission channel, and that the device identifier of the first electronic device and the second electronic device, which meets a second preset condition, initiates the establishment of the transmission channel. The transmission channel is used for synchronizing and sharing data.
[0007] As described above, before synchronizing data in shared applications, each electronic device within the trust ring synchronizes data from at least one shared application (i.e., shared data) according to a first strategy supported by all shared applications within the device. This ensures that each shared application displays data from all shared applications within the trust ring. On one hand, the first strategy can instruct one of the device identifiers of any two electronic devices within the trust ring to initiate a Bluetooth connection if the device identifier meets a first preset condition. This prevents conflicts between any two electronic devices during Bluetooth connection, improving the success rate of Bluetooth connections. On the other hand, the first strategy can also instruct any two electronic devices to indicate the timing for establishing a transmission channel, and allow one of the two electronic devices to initiate the establishment of a transmission channel for transmitting shared data. This prevents conflicts between any two electronic devices during transmission channel establishment, improving the success rate of establishing a transmission channel. Based on this, when any two electronic devices synchronize shared data, situations such as transmission channel occupancy and synchronization timing conflicts can be avoided, ensuring that the data synchronization process proceeds sequentially and orderly. This allows any shared application of any electronic device within the trust ring to synchronize data from the shared applications of other electronic devices within the trust ring, improving the data synchronization success rate of electronic devices within the trust ring and enhancing the user experience.
[0008] In one possible implementation of the first aspect, the electronic device that triggers the data synchronization event includes any of the following:
[0009] Electronic devices added to the trust ring, electronic devices whose data in shared applications within the trust ring is modified, electronic devices whose interface in shared applications within the trust ring is refreshed by pull-to-refresh, electronic devices whose shared applications within the trust ring are switched from the background to the foreground, and electronic devices whose shared applications within the trust ring undergo a cold start.
[0010] In another possible implementation of the first aspect, a shared application includes at least one workspace, each workspace used to display the material metadata of shared files. Modification of data in the aforementioned shared application includes: modification of the space metadata of any workspace, and / or modification of the material metadata of any shared file.
[0011] In another possible implementation of the first aspect, the first electronic device and the second electronic device synchronously share data according to a first strategy supported by both the first and second sharing applications, including: first, the first electronic device and the second electronic device establish a Bluetooth connection based on a first preset condition; then, if the Bluetooth connection is successful, the first electronic device and the second electronic device establish a transmission channel based on the timing of the transmission channel establishment and the second preset condition; finally, the first electronic device and the second electronic device transmit shared data based on the transmission channel.
[0012] In another possible implementation of the first aspect, the first preset condition is that the Bluetooth connection is initiated by an electronic device with a smaller device identifier. The Bluetooth connection between the first electronic device and the second electronic device based on the first preset condition includes: firstly, based on the fact that the first device identifier is smaller than the second device identifier, the first electronic device sends a Bluetooth connection request to the second electronic device; then, based on the Bluetooth connection request, the first electronic device and the second electronic device establish a Bluetooth connection.
[0013] Wherein, the first device identifier is the device identifier of the first electronic device, and the second device identifier is the device identifier of the second electronic device.
[0014] In another possible implementation of the first aspect, the first preset condition is that the Bluetooth connection is initiated by the electronic device with the larger device identifier. The Bluetooth connection between the first electronic device and the second electronic device based on the first preset condition includes: firstly, based on the fact that the first device identifier is greater than the second device identifier, the first electronic device sends a Bluetooth connection request to the second electronic device; then, based on the Bluetooth connection request, the first electronic device and the second electronic device establish a Bluetooth connection.
[0015] Wherein, the first device identifier is the device identifier of the first electronic device, and the second device identifier is the device identifier of the second electronic device.
[0016] In another possible implementation of the first aspect, before the first electronic device sends a Bluetooth connection request to the second electronic device, the method further includes: firstly, the first electronic device receives a second device identifier sent by the second electronic device; then, the first electronic device compares the size relationship between the first device identifier and the second device identifier.
[0017] In another possible implementation of the first aspect, the first electronic device and the second electronic device establish a transmission channel based on the timing of the transmission channel establishment and a second preset condition, including: first, the first electronic device receives a transmission channel establishment request sent by the second electronic device; then, the first electronic device and the second electronic device establish a transmission channel.
[0018] The first target data is shared data transmitted through the transmission channel. The electronic device that meets the second preset condition is the second electronic device. The second preset condition includes: the second shared application contains the first target data to be synchronized with the first shared application, and the second electronic device is in an idle state. The transmission channel is established when the first electronic device is in an idle state. Before the first and second electronic devices synchronize and share data, the second shared application includes the first target data, while the first shared application does not.
[0019] In another possible implementation of the first aspect, the first electronic device and the second electronic device establish a transmission channel based on the timing of the transmission channel establishment and the second preset condition, including: first, the first electronic device sends a transmission channel establishment request to the second electronic device; then, the first electronic device and the second electronic device establish a transmission channel.
[0020] The first target data is shared data transmitted through the transmission channel. The electronic device that meets the second preset condition is the first electronic device. The second preset condition includes: the device identifier of the second electronic device is located at the head of the first synchronization queue of the first electronic device. The transmission channel is established when the first target data is included in the second shared application and the second electronic device is in an idle state. Before the first electronic device and the second electronic device synchronize and share data, the first target data is included in the second shared application, but not in the first shared application.
[0021] In another possible implementation of the first aspect, before the first electronic device sends a second transmission channel establishment request to the second electronic device, the method further includes: based on the first electronic device being in a synchronization state, the first electronic device adds the device identifier of the second electronic device to a first synchronization queue.
[0022] In another possible implementation of the first aspect, the method further includes: firstly, the first electronic device receives a first synchronization completion message sent by the second electronic device; then, the first electronic device sets the synchronization status to synchronization successful.
[0023] The first synchronization completion message is generated by the second electronic device after the first sharing application and the second sharing application have completed the synchronization of shared data. The first synchronization completion message is used to instruct the first electronic device to set its synchronization status to successful, and it is also used to instruct the second electronic device to set its synchronization status to successful.
[0024] In another possible implementation of the first aspect, before the first electronic device and the second electronic device establish a transmission channel, the method further includes: the first electronic device receiving a first feedback message sent by the second electronic device. The first feedback message indicates that the second shared application includes the first target data, while the first shared application does not include the first target data.
[0025] In another possible implementation of the first aspect, the first electronic device and the second electronic device establish a transmission channel based on the timing of the transmission channel establishment and the second preset condition, including: first, the first electronic device sends a transmission channel establishment request to the second electronic device; then, the first electronic device and the second electronic device establish a transmission channel.
[0026] The second target data is the shared data transmitted in the transmission channel. The electronic device that meets the second preset condition is the first electronic device. The second preset condition includes: the second target data is included in the first sharing application, and the first electronic device is in an idle state. The transmission channel is established when the second target data is included in the first sharing application, the first target data is not included in the second sharing application, and the second electronic device is in an idle state. Before the first electronic device and the second electronic device synchronously share data, the first sharing application includes the second target data, the second sharing application does not include the second target data, the first sharing application does not include the first target data, and the second sharing application includes the first target data.
[0027] In another possible implementation of the first aspect, the method further includes: based on the successful establishment of the transmission channel, the first electronic device sets the current state to a synchronization state.
[0028] In another possible implementation of the first aspect, based on the transmission channel establishment timing and the second preset condition, the first electronic device and the second electronic device establish a transmission channel, including: first, the first electronic device receives a transmission channel establishment request sent by the second electronic device; then, the first electronic device and the second electronic device establish a transmission channel.
[0029] The electronic device that meets the second preset condition is the second electronic device. The second preset condition includes: the device identifier of the first electronic device is located at the head of the second synchronization queue of the second electronic device. The transmission channel is established when: the first shared application includes the second target data, the second shared application does not include the first target data, and the first electronic device is in an idle state. Before the first and second electronic devices synchronize and share data, the first shared application includes the second target data, the second shared application does not include the second target data, the first shared application does not include the first target data, and the second shared application includes the first target data. Based on the second electronic device being in a synchronized state, the second electronic device adds the device identifier of the first electronic device to the second synchronization queue. The second target data is the shared data transmitted in the transmission channel.
[0030] In another possible implementation of the first aspect, the method further includes: firstly, the first electronic device sends a second synchronization completion message to the second electronic device; then, the first electronic device sets the synchronization status to synchronization successful.
[0031] The second synchronization completion message is generated by the first electronic device after the first sharing application and the second sharing application complete the synchronization of the shared data; the second synchronization completion message is used to instruct the first electronic device to set the synchronization status of the first electronic device to successful synchronization, and the second synchronization completion message is also used to instruct the second electronic device to set the synchronization status of the second electronic device to successful synchronization.
[0032] In another possible implementation of the first aspect, before the first electronic device establishes a transmission channel with the second electronic device, the method further includes: the first electronic device receiving a second negotiation message sent by the second electronic device.
[0033] The second negotiation message is used to instruct the first electronic device to determine whether the second target data exists in the first sharing application. The second negotiation message includes: the current state of the second electronic device, and a second historical timestamp of the last time the second sharing application synchronized data from the first sharing application. The current state includes an idle state and a synchronized state; the second negotiation message is generated by the second electronic device when it determines that the second sharing application does not contain the first target data.
[0034] In another possible implementation of the first aspect, the method further includes: the first electronic device sending a first negotiation message to the second electronic device.
[0035] The first negotiation message instructs the second electronic device to determine whether the first target data exists in the second sharing application. The first negotiation message includes a first historical timestamp of the most recent time the first sharing application synchronized data from the second sharing application, and the current state of the first electronic device. The current state is either idle or synchronized.
[0036] In another possible implementation of the first aspect, the method further includes: first, in the event of a Bluetooth connection failure, the first electronic device sends a transmission channel establishment request to the second electronic device; then, the first electronic device and the second electronic device establish a transmission channel. All data in the first shared application and all data in the second shared application are shared data transmitted through the transmission channel.
[0037] In another possible implementation of the first aspect, the method further includes: in response to a data synchronization event of the first electronic device, the first electronic device and the second electronic device synchronously share data according to a second strategy.
[0038] The second strategy is a strategy supported by the first sharing application and / or the second sharing application, and the second strategy is a historical strategy of the first strategy. The second strategy instructs the first electronic device and the second electronic device to directly synchronize and share data.
[0039] In another possible implementation of the first aspect, the first electronic device and the second electronic device synchronously share data according to the second strategy, including: first, the first electronic device sends a transmission channel request to the second electronic device; then, the first electronic device and the second electronic device establish a transmission channel; and finally, the first electronic device and the second electronic device transmit shared data based on the transmission channel.
[0040] In another possible implementation of the first aspect, the method further includes: firstly, the first electronic device obtains the version number of the second shared application; then, based on the fact that the version numbers of the first and second shared applications are the same, the first electronic device determines that the first electronic device and the second electronic device synchronously share data according to a first strategy; otherwise, it determines that the first electronic device and the second electronic device synchronously share data according to a second strategy.
[0041] In another possible implementation of the first aspect, the first electronic device obtains the version number of the second shared application by: the first electronic device receiving the version number of the second shared application sent by the second electronic device; or, the first electronic device receiving the version number of the second shared application sent by the server.
[0042] In another possible implementation of the first aspect, before the first electronic device receives the version number of the second shared application sent by the server, the method further includes: the first electronic device sending query information to the server.
[0043] The query information is used to query the version number of the second shared application, and the query information includes the device identifier of the second electronic device.
[0044] In another possible implementation of the first aspect, before the first electronic device and the second electronic device synchronously share data, the method further includes: firstly, in response to a deletion operation of the first data in the first sharing application, the first electronic device deletes the first data from the first sharing application; then, the first electronic device sets the existence status identifier of the first data to a second value to obtain the second data;
[0045] The second data is shared data. The second data is used to instruct the second electronic device to delete the first data from the second sharing application. The first data may be a third target data in the first sharing application, or it may be a fifth target data synchronized by the first sharing application from the second sharing application.
[0046] In another possible implementation of the first aspect, the first data is the fifth target data. The method further includes: firstly, the first electronic device receiving a second or third prompt message sent by the second electronic device; then, the first electronic device displaying the second or third prompt message in the first sharing application.
[0047] The second prompt message indicates that the deletion of the fifth target data was successful, while the third prompt message indicates that the deletion of the fifth target data failed.
[0048] In another possible implementation of the first aspect, after the first electronic device exits the trust ring, the method further includes: the first electronic device sending a fourth prompt message to the server.
[0049] The fourth prompt message includes the device identifier of the first electronic device. This fourth prompt message is used by the server to prompt the second electronic device to hide data from the first shared application within the second shared application.
[0050] In another possible implementation of the first aspect, after the first electronic device rejoins the trust ring, the method further includes: the first electronic device sending an eighth prompt message to the server.
[0051] The eighth prompt message includes the device identifier of the first electronic device. The sixth prompt message is used by the server to prompt the second electronic device to display the data hidden in the first shared application in the second shared application, and also displays the fifth prompt message. The fifth prompt message is used to indicate that the first and second electronic devices are synchronizing the shared data.
[0052] In a second aspect, an electronic device is provided, comprising: a processor and a memory; the memory storing instructions which, when executed by the processor, are performed as described in the first aspect and any embodiment thereof.
[0053] Thirdly, a computer-readable storage medium is provided, including instructions that, when executed on an electronic device, cause the electronic device to perform the method as described in the first aspect and any embodiment thereof.
[0054] Fourthly, a computer program product containing instructions is provided, which, when executed on the aforementioned electronic device, cause the electronic device to perform the method as described in the first aspect and any embodiment thereof.
[0055] Fifthly, a chip system is provided, including a processor for supporting an electronic device in implementing the functions described in the first aspect. In one possible design, the electronic device further includes interface circuitry for receiving signals from other devices (e.g., memory) or sending signals to other devices (e.g., a communication interface). The chip system may include a chip and may also include other discrete devices.
[0056] The technical effects of the second to fifth aspects can be found in the technical effects of the first aspect and any of its embodiments, and will not be repeated here. Attached Figure Description
[0057] Figure 1 This application provides a schematic diagram of the structure of a communication system according to an embodiment of the present application.
[0058] Figure 2 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application;
[0059] Figure 3 This application provides a schematic diagram of the software architecture of a communication system.
[0060] Figure 4 This is a schematic diagram of a data synchronization interface in a conventional technology.
[0061] Figure 5 One of the schematic diagrams of a data synchronization interface provided in this application embodiment;
[0062] Figure 6 This is one of the flowcharts illustrating a data synchronization method provided in an embodiment of this application;
[0063] Figure 7 A second schematic flowchart illustrating a data synchronization method provided in an embodiment of this application;
[0064] Figure 8 The third schematic flowchart of a data synchronization method provided in this application embodiment;
[0065] Figure 9 The fourth flowchart illustrates a data synchronization method provided in this application embodiment;
[0066] Figure 10 Fifth of a flowchart illustrating a data synchronization method provided in an embodiment of this application;
[0067] Figure 11 A flowchart illustrating a data synchronization method provided in this application is shown in Figure 6.
[0068] Figure 12 The seventh flowchart illustrates a data synchronization method provided in this application embodiment;
[0069] Figure 13 This is the eighth flowchart illustrating a data synchronization method provided in an embodiment of this application.
[0070] Figure 14 A flowchart illustrating a data synchronization method provided in this application embodiment is shown in Figure 9.
[0071] Figure 15 A second schematic diagram of a data synchronization interface provided in an embodiment of this application;
[0072] Figure 16 The tenth flowchart illustrates a data synchronization method provided in this application embodiment;
[0073] Figure 17 The third schematic diagram of a data synchronization interface provided in this application embodiment;
[0074] Figure 18This is eleventh of a flowchart illustrating a data synchronization method provided in an embodiment of this application;
[0075] Figure 19 The fourth schematic diagram of a data synchronization interface provided in this application embodiment;
[0076] Figure 20 The twelfth flowchart illustrates a data synchronization method provided in this application embodiment;
[0077] Figure 21 Fifth schematic diagram of a data synchronization interface provided for an embodiment of this application;
[0078] Figure 22 A sixth schematic diagram of a data synchronization interface provided for an embodiment of this application;
[0079] Figure 23 The seventh schematic diagram of a data synchronization interface provided in this application embodiment;
[0080] Figure 24 This is a schematic diagram of a chip system provided in an embodiment of this application. Detailed Implementation
[0081] The terms "first" and "second" used in the embodiments of this application are only used to distinguish features of the same type and should not be construed as indicating relative importance, quantity, order, etc.
[0082] The terms "exemplary" or "for example" used in the embodiments of this application are used to indicate examples, illustrations, or descriptions. Any embodiment or design described as "exemplary" or "for example" in this application should not be construed as being more preferred or advantageous than other embodiments or designs. Specifically, the use of terms such as "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.
[0083] The terms "coupling" and "connection" used in the embodiments of this application should be interpreted broadly. For example, they can refer to a physical direct connection or an indirect connection achieved through electronic devices, such as a connection achieved through resistors, inductors, capacitors or other electronic devices.
[0084] First, some concepts involved in the embodiments of this application will be introduced.
[0085] A magic ring is a technology solution based on an identity authentication system that enables trusted interconnection among multiple devices across systems, allowing services to flow and be shared intelligently between devices. Magic rings can include far-field magic rings and near-field magic rings. One account can correspond to one magic ring. Multiple electronic devices logged into the same account, with their Bluetooth (BT) and Wi-Fi modules both enabled, can join the same near-field magic ring. Similarly, multiple electronic devices logged into the same account and connected to the internet can join the same far-field magic ring. Electronic devices within the same magic ring can automatically connect, allowing data such as incoming calls, notifications, documents, and multimedia messages to flow between them.
[0086] Global Collections: This is an application (APP) on electronic devices that has a collection (or saving) function. Users can drag and drop files (or materials) (such as pictures, documents, text, audio, video, web pages, folders, etc.) that they want to collect from their electronic devices into the Global Collections application for easy access later. The Global Collections application does not store the actual files; it only stores the file's metadata. When multiple electronic devices within the same trust ring have the Global Collections application installed, the metadata of files stored in the Global Collections application of any electronic device within the trust ring can be synchronized to the Global Collections applications of other electronic devices within the trust ring.
[0087] Metadata, also known as intermediary data or relay data, is data about data. It primarily describes data properties and supports functions such as indicating storage location, historical data, resource lookup, and file records. Metadata is a type of electronic catalog. To achieve the purpose of cataloging, it is necessary to describe and collect the content or characteristics of the data, thereby assisting in data retrieval. The metadata involved in this application's embodiments may include file material metadata and workspace spatial metadata. A workspace can be a display interface (or display page) in a global collection application.
[0088] The data synchronization method provided in this application embodiment can be applied to... Figure 1 The communication system shown can be either a near-field communication system or a far-field communication system. A near-field communication system can be a near-field trust loop composed of multiple electronic devices. A far-field communication system can be a far-field trust loop composed of multiple electronic devices. In this embodiment, [the system is described using...]. Figure 1 The communication system shown is an example of a near-field trust ring. In the following text, the near-field trust ring will be referred to simply as a trust ring.
[0089] like Figure 1 As shown, the trust ring may include a first electronic device 101 and at least one second electronic device 102. The first electronic device 101 and the second electronic device 102 can synchronize data with each other, and different second electronic devices 102 can also synchronize data with each other. The first electronic device 101 and the second electronic device 102 can be the same type of electronic device or different types of electronic devices. Each of the at least one second electronic device 102 can be the same type of electronic device or different types of electronic devices.
[0090] The electronic device involved in this application embodiment can be a device with communication and display functions. The electronic device can be mobile or fixed. It can be deployed on land (e.g., indoors or outdoors, handheld or vehicle-mounted), on water (e.g., ships), or in the air (e.g., airplanes, balloons). This electronic device can be referred to as user equipment (UE), access terminal, terminal unit, subscriber unit, terminal station, mobile station (MS), mobile station, terminal agent, or terminal device, etc. For example, the electronic device can be a mobile phone, tablet computer, laptop computer, etc. This application embodiment does not limit the specific type and structure of the electronic device. The following describes one possible structure of the electronic device.
[0091] Taking mobile phones as an example, Figure 2 This diagram illustrates the hardware structure of an electronic device 200 according to an embodiment of this application. Figure 2 As shown, the electronic device 200 may include: a processor 210, a memory 220, a universal serial bus (USB) interface 230, a power management module 240, an antenna, a communication module 250, a display screen 260, an audio module 270, a camera 280, etc.
[0092] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the electronic device 200. In other embodiments, the electronic device 200 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0093] Processor 210 may include one or more processing units, such as application processors (APs), modem processors, graphics processing units (GPUs), image signal processors (ISPs), controllers, memory, video codecs, digital signal processors (DSPs), baseband processors, and / or neural network processing units (NPUs). Different processing units may be independent devices or integrated into one or more processors. The controller may serve as the central nervous system and command center of the electronic device 200. The controller can generate operation control signals based on instruction opcodes and timing signals to control instruction fetching and execution.
[0094] The processor 210 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 210 is a cache memory. This memory can store instructions or data that the processor 210 has just used or that are used repeatedly. If the processor 210 needs to use the instruction or data again, it can directly retrieve it from the memory. This avoids repeated accesses, reduces the waiting time of the processor 210, and thus improves the efficiency of the system.
[0095] In some embodiments, processor 210 may include one or more interfaces. Interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface 230, etc.
[0096] It is understood that the interface connection relationships between the modules illustrated in the embodiments of this application are merely illustrative and do not constitute a limitation on the structure of the electronic device. In other embodiments, the electronic device may also employ different interface connection methods or combinations of multiple interface connection methods as described in the above embodiments.
[0097] The memory 220 can be used to store computer executable program code, which includes instructions. The processor 210 executes various functional applications and data processing of the electronic device by running the instructions stored in the memory 220. The memory 220 may include a program storage area and a data storage area. The program storage area may store the operating system and at least one application program required for a function (such as sound playback, interface display, etc.). The data storage area may store data created during the use of the electronic device (such as notification messages). Furthermore, the memory 220 may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc.
[0098] The power management module 240 is used to connect the battery and the processor 210. The power management module 240 receives battery and / or power input to power the processor 210, memory 220, communication module 250, display screen 260, and camera 280, etc. The power management module 240 can also be used to monitor parameters such as battery capacity, battery cycle count, and battery health status (leakage current, impedance). In some other embodiments, the power management module 240 may also be located within the processor 210.
[0099] The communication module 250 can provide solutions for wireless communication applications on the electronic device 200, including wireless local area networks (WLANs) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared (IR). The communication module 250 can be one or more devices integrating at least one communication processing module. The communication module 250 receives electromagnetic waves via an antenna, performs frequency modulation and filtering of the electromagnetic wave signals, and sends the processed signal to the processor 210. The communication module 250 can also receive signals to be transmitted from the processor 210, perform frequency modulation and amplification, and convert them into electromagnetic waves for radiation via the antenna.
[0100] In some embodiments, the antenna of the electronic device 200 is coupled to the communication module 250, enabling the electronic device 200 to communicate with networks and other devices via wireless communication technologies. The wireless communication technologies may include Global System for Mobile Communications (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Time Division Code Division Multiple Access (TD-SCDMA), Long Term Evolution (LTE), BitTorrent, Global Navigation Satellite System (GNSS), WLAN, NFC, FM, and / or IR technologies. The GNSS may include Global Positioning System (GPS), BeiDou Navigation Satellite System (BDS), GLONASS, and / or Galileo.
[0101] Electronic device 200 implements display functions through a GPU, display screen 260, and application processor. The GPU is a microprocessor for image processing, connected to the display screen 260 and the application processor. The GPU is used to perform mathematical and geometric calculations and for graphics rendering. Processor 210 may include one or more GPUs, which execute program instructions to generate or modify display information.
[0102] The display screen 260 is used to display images, videos, etc. The display screen 260 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a Mini-LED, a Micro-OLED, a quantum dot light-emitting diode (QLED), etc. In this embodiment, the display screen 260 can be used to display metadata of shared files in a sharing application. For example, the display screen 260 can display icons (such as thumbnails) of shared files (such as images) in a sharing application.
[0103] Electronic device 200 can perform shooting functions through ISP, camera 280, video codec, GPU, display 260 and application processor.
[0104] The audio module 270 is used to convert digital audio information into analog audio signals for output, and also to convert analog audio input into digital audio signals. The audio module 270 can also be used for encoding and decoding audio signals. In some embodiments, the audio module 270 may be located in the processor 210, or some functional modules of the audio module 270 may be located in the processor 210.
[0105] Camera 280 is used to capture still images or videos. An object is projected onto a photosensitive element through the lens, generating an optical image. This photosensitive element can be a charge-coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, which is then passed to an ISP (Image Signal Processor) for conversion into a digital image signal. The ISP outputs the digital image signal to a DSP (Digital Signal Processor) for further processing. The DSP converts the digital image signal into standard image signals in formats such as RGB and YUV.
[0106] Understandably, the implementation of electronic device functions generally requires not only hardware support but also software cooperation.
[0107] The software system of an electronic device can adopt a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture. This application's embodiment uses a layered architecture of Android. For example, the software structure of the electronic device in the above communication system is illustrated.
[0108] Figure 3 This is a schematic diagram of the software architecture of a communication system provided in an embodiment of this application.
[0109] A layered architecture divides software into several layers, each with a clear role and function. Layers communicate with each other through software interfaces. In some embodiments, Android is used. It is divided into four layers, from top to bottom: application layer, application framework layer, middleware layer, and hardware layer.
[0110] The application layer can include a series of application packages. For example... Figure 3 As shown, the application package may include shared applications (in this embodiment, the shared application may be a global collection application), distributed file system, Bluetooth, WLAN, and other applications.
[0111] The sharing application can be used to collect shared files from various electronic devices within a communication system (i.e., a trust ring) and display the metadata of the shared files from each electronic device. A shared file can be any file from any electronic device within the communication system (i.e., a trust ring).
[0112] In some embodiments, the application layer may further include a negotiation module. The negotiation module is used to negotiate Bluetooth connections between electronic devices within the trust ring to establish a Bluetooth connection; or to negotiate Wi-Fi connections to establish a Wi-Fi connection. This embodiment uses Bluetooth connection negotiation to establish a Bluetooth connection as an example. The negotiation module is also used to negotiate data synchronization between electronic devices within the trust ring, negotiating the timing of establishing a transmission channel, the initiator of the transmission channel, etc., to establish a transmission channel for data synchronization.
[0113] Distributed file systems can be used to store the storage paths of shared files across various electronic devices in a communication system, as well as the device identifiers of the electronic devices to which the shared files belong. Distributed file systems are also used to transfer the file entities of shared files.
[0114] The application framework layer provides application programming interfaces (APIs) and a programming framework for applications in the application layer. The application framework layer includes some predefined functions. For example, such as... Figure 3As shown, the application framework layer may include the window manager service (WMS), the view system, the file system, etc.
[0115] The window manager is used to manage window programs. It can obtain the screen size, determine if a status bar is present, lock the screen, and capture the screen, among other things.
[0116] A view system can include visual controls, such as controls for displaying text and controls for displaying images. View systems can be used to build applications. A display interface can consist of at least one view. For example, the display interface of a sharing application may include a view for displaying text and a view for displaying images.
[0117] A file system can be used to store the file entities of all files on this electronic device, the storage paths of all files, and the device identifier of this electronic device. In other words, the file system of an electronic device stores the file entities and storage paths of shared files collected in the shared applications of this electronic device.
[0118] The middle layer can include device manager, channel manager, etc.
[0119] The Device Manager is used to store the device identifier of this electronic device and also to obtain the device identifiers of other electronic devices in the trust ring.
[0120] The Channel Manager retrieves device identifiers from other electronic devices in the Trust Ring from the Device Manager. After joining the Trust Ring, it creates transmission channels, such as near-field transmission channels (magic links), with other electronic devices in the Trust Ring. These transmission channels transmit spatial metadata of the workspace in the shared application, material metadata of shared files in the shared application, and the file entities of shared files to the communication module at the hardware layer. From there, the communication module sends these data to other electronic devices within the Trust Ring. The near-field transmission channel also receives spatial metadata of the workspace in the shared application, material metadata of shared files in the shared application, and the file entities of shared files from other electronic devices via the communication module and transmits these data upwards to the application layer.
[0121] In some embodiments, the middle layer may include a negotiation module.
[0122] In summary, both the application layer and the middleware layer can include a negotiation module, or the application layer can include a negotiation module, or the middleware layer can include a negotiation module.
[0123] Figure 1The communication system (or trust ring) shown includes electronic devices each equipped with a shared application (such as a global collection application). Each shared application can include at least one workspace for collecting shared files and displaying the metadata of those files. Data within the shared applications of the various electronic devices in the trust ring can be synchronized, allowing any electronic device in the trust ring to display data from all other shared applications within the ring. Thus, any electronic device in the trust ring can access data from the shared applications of all other electronic devices within the ring.
[0124] The data in a shared application may include: spatial metadata for each workspace within the shared application, and material metadata for each shared file within a workspace. The spatial metadata of a workspace indicates the attributes of the workspace, while the material metadata of a shared file indicates the attributes of the shared file. One workspace in a shared application may correspond to one display interface within the shared application. Shared files are files stored on an electronic device and stored within the shared application on that device. The types of shared files may include, but are not limited to, at least one of the following: images, videos, audio, documents, folders, text, and web pages.
[0125] Currently, when multiple electronic devices within a trust ring synchronize and share data in an application, issues such as occupied transmission channels and synchronization timing conflicts may prevent some devices from synchronizing data with other devices' shared applications, resulting in a low data synchronization success rate and impacting user experience. Synchronization timing conflicts can include, but are not limited to, two electronic devices simultaneously synchronizing data with one other electronic device, causing the transmission channel to be occupied. Electronic devices occupying the transmission channel can also be doing other data transmission services. The following section uses the example of two electronic devices simultaneously synchronizing data with one other electronic device to illustrate this.
[0126] Figure 4 This diagram illustrates an interface diagram of a data synchronization technique using conventional methods.
[0127] In one scenario, a first electronic device (such as tablet C) is about to be added to a trust ring, while two second electronic devices (such as mobile phone A and mobile phone B) have already joined the same trust ring, sharing images as files. The following section combines... Figure 4 This section introduces how image metadata is shared synchronously among various electronic devices within a trust ring.
[0128] like Figure 4As shown in Figure A, mobile phone A and mobile phone B are in the same trust ring, while tablet C is not. Mobile phone A's main interface displays a first floating window 410. The first floating window 410 displays icons 411 and 412 of a first image saved in mobile phone A's sharing applications. Mobile phone B's main interface displays a second floating window 420. The second floating window 420 displays icons 411 and 412 of the first image saved in mobile phone B's sharing applications. Tablet C's main interface displays a third floating window 430. The third floating window 430 displays icon 431 of a third image saved in tablet C's sharing applications.
[0129] Therefore, the pictures saved in the shared application of mobile phone A, which is within the same trust ring, are the same as the pictures saved in the shared application of mobile phone B, but are different from the pictures saved in the shared application of tablet computer C, which is not in the same trust ring.
[0130] like Figure 4 As shown in Figure B, after tablet C is added to the trust ring, data in the corresponding shared applications is synchronized between mobile phone A, mobile phone B, and tablet C. However, because mobile phone A and mobile phone B are synchronizing data with tablet C simultaneously, the shared application of mobile phone A displays the icons 411 (first image), 412 (second image), and 431 (third image); the shared application of mobile phone B displays the icons 411, 412, and 431 (first image); and the shared application of tablet C displays the icon 431 (third image). In other words, the shared application of tablet C does not synchronize the images saved in the shared application of mobile phone A, nor does it synchronize the images saved in the shared application of mobile phone B.
[0131] In summary, in conventional technologies, the data synchronization success rate is low when electronic devices within a trust ring synchronize and share data in an application.
[0132] It should be noted that the figures in this article (such as...) Figure 4 In the diagram, a dashed box represents a trust loop. A phone inside the dashed box is a phone that has joined the trust loop; a phone not inside the dashed box is a phone that has joined or has not joined the trust loop.
[0133] To address this, this application provides a data synchronization method. Before synchronizing data in shared applications, each electronic device within a trust ring synchronizes data (i.e., shared data) in at least one shared application according to a first strategy supported by all shared applications within the device, enabling each shared application to display data from all shared applications within the trust ring. On one hand, the first strategy can instruct one of any two electronic devices within the trust ring to initiate a Bluetooth connection if its device identifier meets a first preset condition. This prevents conflicts between any two electronic devices during Bluetooth connection, improving the success rate of Bluetooth connection. On the other hand, the first strategy can allow any two electronic devices to indicate the timing for establishing a transmission channel, and for one of any two electronic devices to initiate the establishment of a transmission channel for transmitting shared data. This prevents conflicts between any two electronic devices during transmission channel establishment, improving the success rate of establishing a transmission channel. Based on this, when any two electronic devices synchronize shared data, situations such as transmission channel occupancy and synchronization timing conflicts can be avoided, ensuring that the data synchronization process proceeds sequentially and orderly. This allows any shared application of any electronic device within the trust ring to synchronize data from the shared applications of other electronic devices within the trust ring, improving the data synchronization success rate of electronic devices within the trust ring and enhancing the user experience.
[0134] Figure 5 This illustration shows one of the interface diagrams for data synchronization provided in an embodiment of this application.
[0135] like Figure 5 As shown in Figure A, mobile phone A and mobile phone B are in the same trust ring, while tablet C is not. Mobile phone A's main interface displays a first floating window 410. The first floating window 410 displays icons 411 and 412 of a first image saved in mobile phone A's sharing applications. Mobile phone B's main interface displays a second floating window 420. The second floating window 420 displays icons 411 and 412 of the first image saved in mobile phone B's sharing applications. Tablet C's main interface displays a third floating window 430. The third floating window 430 displays icon 431 of a third image saved in tablet C's sharing applications.
[0136] like Figure 5As shown in B, after tablet C is added to the trust ring, mobile phone A, mobile phone B, and tablet C synchronize data in their respective shared applications. At this time, the shared application of mobile phone A displays the icons 411 (first image), 412 (second image), and 431 (third image) in sequence; the shared application of mobile phone B displays the icons 411 (first image), 412 (second image), and 431 (third image) in sequence; and the shared application of tablet C displays the icons 411 (first image), 412 (second image), and 431 (third image) in sequence.
[0137] Therefore, it can be seen that when the electronic devices provided in this application are in the same trust ring, the shared files displayed in the shared applications of each electronic device are the same, and the order of the shared files is the same.
[0138] It should be noted that the interfaces of the shared applications provided in this application embodiment are not limited to the interfaces shown in the figures in this application embodiment.
[0139] The following text combines Figures 6-24 The data synchronization method provided in the embodiments of this application will be introduced.
[0140] Figure 6 This illustration shows one of the flowcharts of a data synchronization method provided in an embodiment of this application. Figure 6 As shown, in this embodiment, the data synchronization method may include:
[0141] S601, The first electronic device displays the material metadata of the first shared file in the first shared application.
[0142] The various electronic devices involved in the embodiments of this application have shared applications installed. For example... Figure 5 As shown in A, before an electronic device (such as tablet C) is added to the trust ring, the sharing applications on that device can only save shared files (such as pictures) stored on that device. Therefore, the sharing applications on that device can only display the metadata of the shared files (such as thumbnails of pictures) on that device. Figure 5 As shown in B, after an electronic device (such as a tablet C) is added to the trust ring, the sharing application of the electronic device can collect shared files stored on various electronic devices within the trust ring. Therefore, the sharing application of the electronic device can display the material metadata of the shared files on various electronic devices within the trust ring.
[0143] For ease of distinction, in this embodiment of the application, the shared application installed in the first electronic device is referred to as the first shared application, the shared file stored in the first electronic device is referred to as the first shared file, the shared application installed in the second electronic device is referred to as the second shared application, and the shared file stored in the second electronic device is referred to as the second shared file.
[0144] Therefore, before the first electronic device joins the trust ring, its first shared application only displays the metadata of the first shared file. Similarly, before the second electronic device joins the trust ring, its second shared application only displays the metadata of the second shared file.
[0145] S602, The first electronic device joins the trust ring where the second electronic device is located.
[0146] One account can correspond to one trust ring. After logging into the account corresponding to the first electronic device in the trust ring, it can join the trust ring of the second electronic device. In this way, the first electronic device can synchronize data stored in the corresponding shared applications with other electronic devices in the trust ring.
[0147] Typically, when a device joins a trust ring or triggers other data synchronization events, it sends a login message to the server corresponding to the trust ring. This login message can include the device's identifier. This allows the server to broadcast the device's identifier to other devices within the trust ring.
[0148] The specific process of the first electronic device joining the trust ring of the second electronic device can be found in existing technologies and will not be elaborated here.
[0149] Following S601-S602, in response to the data synchronization event of the first electronic device, the first electronic device and the second electronic device can synchronize and share data according to a first strategy supported by both the first sharing application and the second sharing application.
[0150] The shared data mentioned above refers to data from the first sharing application and / or the second sharing application. The first strategy instructs the device identifier of one of the first and second electronic devices, meeting a first preset condition, to initiate a Bluetooth connection. The first strategy also instructs the timing for establishing a transmission channel, and the timing for the one of the first and second electronic devices, meeting a second preset condition, to initiate the establishment of the transmission channel. The transmission channel is used for synchronously sharing data.
[0151] In one embodiment, the first electronic device is the electronic device that triggers the data synchronization event. The electronic device that triggers the data synchronization event may include any of the following: an electronic device newly added to the trust ring; an electronic device already added to the trust ring where data in the shared application has changed (i.e., the data has been modified); an electronic device already added to the trust ring where the shared application has been refreshed; an electronic device already added to the trust ring where the shared application has been switched from the background to the foreground; or an electronic device already added to the trust ring where the shared application has undergone a cold start. The sharing application being refreshed can be, but is not limited to, a pull-to-refresh operation of the display interface corresponding to a workspace of the shared application.
[0152] In this embodiment, the example is described where the first electronic device is a newly added electronic device in the trust ring of the second electronic device. It should be understood that in other embodiments, the first electronic device may be an electronic device that triggers other data synchronization events. In this case, before the first and second electronic devices synchronize the data stored in their respective shared applications, the following steps may also be performed.
[0153] S603, The first electronic device and the second electronic device establish a Bluetooth connection based on the first preset conditions.
[0154] The first electronic device and the second electronic device synchronously share data according to the synchronization strategy supported by the first sharing application, or the first electronic device and the second electronic device synchronously share data according to the synchronization strategy supported by the second sharing application. Different versions of the sharing application support different synchronization strategies.
[0155] In some embodiments, the first sharing application and the second sharing application are the same version, therefore the synchronization strategy supported by the first sharing application and the second sharing application is the same strategy, such as the first strategy or the second strategy. In this case, the first electronic device and the second electronic device synchronize and share data according to the first strategy or the second strategy.
[0156] The second strategy is a historical version of the first strategy. The two electronic devices will negotiate during the synchronization and data sharing process according to the first strategy. Alternatively, the two electronic devices will not negotiate during the synchronization and data sharing process according to the first strategy. This negotiation may include Bluetooth connection negotiation and data synchronization negotiation.
[0157] In other embodiments, the first sharing application or the second sharing application supports different synchronization strategies, such as the first sharing application supporting a first strategy and the second sharing application supporting a second strategy. To maintain compatibility with historical versions, the first electronic device and the second electronic device will synchronize and share data according to the historical strategy (i.e., the second strategy).
[0158] In this embodiment, the first electronic device and the second electronic device synchronously share data according to a first strategy supported by both the first and second sharing applications. The first strategy instructs the device identifier of the first and second electronic devices that meets a first preset condition to initiate a Bluetooth connection. That is, during the synchronous data sharing process, the first and second electronic devices negotiate a Bluetooth connection to establish a connection for message transmission via Bluetooth.
[0159] Specifically, the first preset condition can be that the Bluetooth connection is initiated by an electronic device with a smaller device ID, or by an electronic device with a larger device ID. Here, the device ID is a universally unique identifier (UUID) for the electronic device. Each electronic device within the trust ring has a different device ID. The device ID can include:
[0160] For ease of distinction, in this embodiment of the application, the device identifier of the first electronic device is referred to as the first device identifier, and the device identifier of the second electronic device is referred to as the second device identifier.
[0161] In one embodiment, the first preset condition is that a Bluetooth connection is initiated by an electronic device with a small device identifier. Figure 7 This is a second schematic flowchart illustrating a data synchronization method provided in an embodiment of this application. For example... Figure 7 As shown, the above S603 may include:
[0162] S701, The first electronic device receives the second device identifier sent by the server.
[0163] S702, The second electronic device receives the first device identifier sent by the server.
[0164] S703, the first electronic device and the second electronic device respectively determine the size relationship between the first device identifier and the second device identifier.
[0165] Since the device identifiers of each electronic device within the trust ring are different, the device identifiers of each electronic device within the trust ring have a size relationship.
[0166] S704. Based on the fact that the first device identifier is less than the second device identifier, the first electronic device sends a Bluetooth connection request to the second electronic device.
[0167] S705, the first electronic device, and the second electronic device establish a Bluetooth connection based on the Bluetooth connection request.
[0168] The process by which the first electronic device and the second electronic device establish a Bluetooth connection based on a Bluetooth connection request can be referred to in the relevant descriptions in conventional technologies, and will not be repeated in the embodiments of this application.
[0169] In another embodiment, when the first preset condition is that the Bluetooth connection is initiated by an electronic device with a large device identifier, the specific process of S603 can be referred to the steps in S701-S705, which will not be repeated here.
[0170] Furthermore, Figure 8 This is illustrated as a third schematic flowchart of a data synchronization method provided in an embodiment of this application. Figure 8 As shown in S603, after S702, the data synchronization method provided in this application embodiment may include:
[0171] S801, The first electronic device sends a first query message to the server.
[0172] In this embodiment, the server can store the version numbers of the shared applications installed on each electronic device. For example, the server can store a mapping table between the device identifier of the electronic device and the version number of the shared application. In this way, each electronic device in the trust ring can obtain the version number of the shared application of the corresponding electronic device by querying the mapping table on the server.
[0173] In this embodiment, the first query message may include a second device identifier, used to instruct the server to query the version number corresponding to the second device identifier. That is, the first query message instructs the server to query the version number (i.e., the second version number) of the second shared application in the second electronic device.
[0174] S802, The server sends the second version number to the first electronic device.
[0175] S803, the second electronic device sends a second query message to the server.
[0176] The second query message may include a first device identifier, which instructs the server to query the version number corresponding to the first device identifier. In other words, the second query message instructs the server to query the version number (i.e., the first version number) of the first shared application in the first electronic device.
[0177] S804, The server sends the first version number to the second electronic device.
[0178] It should be noted that in this embodiment, there is no specific order between S801 and S804.
[0179] S805. Based on the first version number and the second version number, both the first shared application and the second shared application support the first policy. The first electronic device and the second electronic device respectively determine the size relationship between the first device identifier and the second device identifier.
[0180] The version number uniquely identifies the version of a shared application. Two shared applications with different version numbers indicate different versions of the applications, and therefore different synchronization strategies. Two shared applications with the same version number indicate the same version of the applications, and therefore the same synchronization strategy. Therefore, the version numbers of two shared applications can be used to determine whether they support the first strategy.
[0181] In this embodiment, the server sends the device identifier and version number of another electronic device to one electronic device in two separate steps. In other embodiments, the server may send the device identifier and version number of another electronic device to one electronic device at a time.
[0182] In this embodiment of the application, the messages transmitted via Bluetooth may include any one of the following messages: first negotiation message, second negotiation message, first feedback message, second feedback message, first synchronization completion message, second synchronization completion message, etc., which are involved in this embodiment of the application.
[0183] In one embodiment, the first electronic device is the electronic device that triggers the data synchronization event. The electronic device that triggers the data synchronization event may include any of the following: an electronic device newly added to the trust ring; an electronic device already added to the trust ring where data in the shared application has changed (i.e., the data has been modified); an electronic device already added to the trust ring where the shared application has been refreshed; an electronic device already added to the trust ring where the shared application has been switched from the background to the foreground; or an electronic device already added to the trust ring where the shared application has undergone a cold start. The sharing application being refreshed can be, but is not limited to, a pull-to-refresh operation of the display interface corresponding to a workspace of the shared application.
[0184] In this embodiment, the example is described where the first electronic device is a newly added electronic device in the trust ring of the second electronic device. It should be understood that in other embodiments, the first electronic device may be an electronic device that triggers other data synchronization events. In this case, S603 can also be executed before the first and second electronic devices synchronize the data stored in their respective shared applications.
[0185] S604. Based on the successful Bluetooth connection, the first electronic device sends a first negotiation message to each of the second electronic devices.
[0186] After a successful Bluetooth connection, the two electronic devices negotiate data synchronization. During this negotiation, the electronic device that triggered the data synchronization event (the first electronic device) sends a first negotiation message to the other electronic device (the second electronic device). This first negotiation message is used by the second electronic device to determine whether it needs to synchronize and share data with the first electronic device.
[0187] In one embodiment, the first negotiation message may include: the current state of the electronic device that triggered the data synchronization event, and a historical timestamp of the last time the electronic device's sharing application synchronized data from another electronic device's sharing application. The current state can be either a synchronized state or an idle state. A synchronized state indicates that the electronic device that triggered the data synchronization event is currently (or about to) synchronize shared data. An idle state indicates that the electronic device that triggered the data synchronization event is not currently synchronizing shared data.
[0188] Based on the above description, in this embodiment, the first negotiation message may include: the current state of the first electronic device and the first historical timestamp of the last time the first sharing application synchronized data from the second sharing application.
[0189] In another embodiment, the first negotiation message may include: the current state of the electronic device that triggered the data synchronization event, the historical timestamp of the last time the shared application of the electronic device synchronized data from the shared application of another electronic device, and the version number of the shared application in the electronic device that triggered the data synchronization event.
[0190] Based on the above description, in this embodiment, the first negotiation message may include: the current state of the first electronic device, the first historical timestamp of the last time the first sharing application synchronized data from the second sharing application, and the first version number.
[0191] In this embodiment, after a successful Bluetooth connection, the first electronic device and the second electronic device can send each other the version number of the shared application.
[0192] In one embodiment, a successful Bluetooth connection between the first electronic device and the second electronic device may include: the first electronic device and the second electronic device successfully establishing a Bluetooth connection on the first connection based on a Bluetooth connection request; or, the first electronic device and the second electronic device successfully establishing a Bluetooth connection after multiple connections based on a Bluetooth connection request within a first preset time period; or, the first electronic device and the second electronic device successfully establishing a Bluetooth connection after two connections based on a Bluetooth connection request.
[0193] S605, if both the first sharing application and the second sharing application support the first strategy, based on the first historical timestamp in the first negotiation message and the change timestamp of each data in the second sharing application, the second electronic device determines that there is first target data in the second sharing application that needs to be synchronized to the first sharing application.
[0194] If the first negotiation message does not contain a version number, and the second electronic device, upon receiving the first historical timestamp, is able to perform the step of determining whether the second shared application contains first target data to be synchronized to the first shared application, then the version number of the first shared application and the version number of the second shared application are the same. That is, both the first and second shared applications support the first policy. Conversely, if the version numbers are different, then the second shared application does not support the first policy.
[0195] If the first negotiation message contains a version number, the second electronic device can directly compare the version number of the first shared application and the version number of the second shared application to determine whether both the first shared application and the second shared application support the first policy.
[0196] In this embodiment, the version number of the shared application in the electronic device that triggered the data synchronization event is included in the first negotiation message as an example. Therefore, the second electronic device can determine whether both the first and second shared applications support the first policy based on the version number in the first negotiation message. This step is described using the example where both the first and second shared applications support the first policy.
[0197] In one embodiment, if the first electronic device joins the trust ring of the second electronic device for the first time, all data in the second shared application is the first target data to be synchronized from the second shared application to the first shared application.
[0198] In another embodiment, if the first electronic device is not joining the trust ring where the second electronic device is located for the first time, the data in the second shared application may include at least one of the following: data that the second shared application has synchronized with the first shared application and has changed, data that the second shared application has synchronized with the first shared application and has not changed, and data that the second shared application has not synchronized with the first shared application.
[0199] Data to be synchronized includes both data that has been synchronized from the second sharing application to the first sharing application and data that has changed, as well as data that has not been synchronized from the second sharing application to the first sharing application. Data that has been synchronized from the second sharing application to the first sharing application and has not changed is considered synchronized data. For already synchronized data, there is no need to synchronize it again during this current synchronization process. This reduces the amount of data to be synchronized, thereby saving resources and reducing power consumption of electronic devices.
[0200] For ease of description, the data that the second sharing application has synchronized with the first sharing application and has changed will be referred to as the first data to be synchronized, and the data that the second sharing application has not synchronized with the first sharing application will be referred to as the second data to be synchronized. In this case, the first target data may include the first data to be synchronized and / or the second data to be synchronized.
[0201] Specifically, in this step, after receiving the first negotiation information, the second electronic device will perform the following process based on the first negotiation message: the second electronic device compares the first historical timestamp with the change timestamp of each data in the second shared application, and based on the fact that the change timestamp of a data in the second shared application is later than the first historical timestamp, the second electronic device determines that data as the first target data.
[0202] A data change timestamp indicates when the data was modified. For example, if the data's sorting changes, the data change timestamp changes. Similarly, if the data's name is modified, the data change timestamp changes.
[0203] Optionally, the data in the shared application may include: spatial metadata for each workspace in at least one workspace, and material metadata for the shared files collected in each workspace. For ease of distinction, in this embodiment, the workspace created by the first electronic device in the first shared application is referred to as the first workspace, and the workspace created by the second electronic device in the second shared application is referred to as the second workspace.
[0204] Based on this, in the embodiments of this application, the first target data may include: spatial metadata of the second target workspace and / or material metadata of the second target shared files. The second target workspace belongs to the second workspace, and the second target shared files belong to the second shared files.
[0205] Each electronic device within the trust ring includes a database for storing shared applications. This database can comprise multiple storage areas. Each storage area stores the spatial metadata of a workspace within that shared application, as well as the material metadata of the shared files collected within that workspace. In other words, there is a one-to-one correspondence between storage areas in the database and workspaces. Each time an electronic device creates or copies a workspace, a new storage area is automatically added to the database.
[0206] S606, the second electronic device sends a first feedback message to the first electronic device.
[0207] The first feedback message is used to indicate that there is first target data in the second sharing application that needs to be synchronized to the first sharing application.
[0208] In one embodiment, the first feedback message may include a second historical timestamp of the last time the second sharing application synchronized data from the first sharing application. In another embodiment, the first feedback message does not include the second historical timestamp of the last time the second sharing application synchronized data from the first sharing application.
[0209] S607. Based on the fact that the current state of the first electronic device is idle, the second electronic device sends a transmission channel establishment request to the first electronic device.
[0210] The first strategy can also indicate when to establish a transmission channel, and when one of the first and second electronic devices that meets the second preset condition initiates the establishment of the transmission channel (i.e., sends a transmission channel request). The transmission channel is used for synchronous data sharing.
[0211] In this embodiment, the electronic device that meets the second preset condition is the second electronic device. The second preset condition may include: the existence of first target data to be synchronized to the first shared application in the second shared application, and the second electronic device being in an idle state. The transmission channel is established when the first electronic device is in an idle state. That is, the second electronic device will send a transmission channel establishment request to the first electronic device only when the second electronic device is in an idle state and the first target data exists in the second shared application, so that the first electronic device and the second electronic device can establish a transmission channel.
[0212] The transmission channel establishment request may include the device identifiers of the two electronic devices to which the transmission channel is to be established. Therefore, the transmission channel establishment request sent by the second electronic device to the first electronic device may include the device identifiers of both the first and second electronic devices.
[0213] It should be noted that if the first electronic device receives the first feedback message within the third preset time period (e.g., 10 seconds), the first electronic device executes S607 and sets the data synchronization negotiation status to successful. If the first electronic device does not receive the first feedback message within the third preset time period, the first electronic device does not execute S607 and sets the data synchronization negotiation status to failed. In this case, the first electronic device and the second electronic device directly synchronize data.
[0214] Direct data synchronization between the first electronic device and the second electronic device refers to the following: the first electronic device directly sends a transmission channel establishment request to the second electronic device, and the first and second electronic devices establish a transmission channel based on the request. Then, the first electronic device sends data from the first shared application through the transmission channel, and the second electronic device updates the data in the second shared application based on the data from the first shared application. The second electronic device then sends data from the second shared application through the transmission channel, and the first electronic device updates the data in the first shared application based on the data from the second shared application.
[0215] Optionally, after S607, based on the fact that the second electronic device is in an idle state, the second electronic device can set its current state to a synchronization state.
[0216] Specifically, the second electronic device sets its current state to synchronization state to notify other electronic devices in the trust ring, excluding the first electronic device, that the second electronic device is synchronizing data or is about to start synchronizing shared data, and cannot synchronize data with other electronic devices at this time.
[0217] S608, the first electronic device and the second electronic device establish a transmission channel based on the transmission channel establishment request.
[0218] The process of establishing a transmission channel based on a transmission channel establishment request between the first electronic device and the second electronic device can be referred to as the process of establishing a Bluetooth connection based on a Bluetooth connection request between the first electronic device and the second electronic device. Therefore, this embodiment of the application will not elaborate on this process.
[0219] In this embodiment of the application, the transmission channel established between any two electronic devices in the trust ring has the device identifiers of these two electronic devices. Therefore, the transmission channel established by the first electronic device and the second electronic device has the first device identifier and the second device identifier.
[0220] S609. Based on the successful establishment of the transmission channel, the first electronic device sets its current state to the synchronization state.
[0221] In this embodiment, successful establishment of the transmission channel may include: the first electronic device and the second electronic device successfully establishing the transmission channel on the first attempt based on the transmission channel establishment request, or the first electronic device and the second electronic device successfully establishing the transmission channel after multiple attempts based on the transmission channel establishment request within a second preset time period.
[0222] A transmission channel has been successfully established between the first and second electronic devices, indicating that they are about to begin synchronizing and sharing data. At this time, the first electronic device sets its current state to synchronized state to notify other electronic devices within the trust ring, except for the second electronic device, that it is synchronizing data or about to begin synchronizing and sharing data, and that it cannot synchronize data with other electronic devices at this time.
[0223] It should be noted that if the first electronic device and the second electronic device fail to establish a transmission channel on the first attempt, the second electronic device repeats the above-described S607, and the first electronic device and the second electronic device repeat the above-described S608.
[0224] S610, the second electronic device sends the first target data to the first electronic device through the transmission channel.
[0225] As can be seen from the analysis in S605 above, the first target data can be all the data in the second shared application, or it can be a portion of the data in the second shared application. That is to say, the second electronic device can fully synchronize the data in the second shared application to the first shared application, or the second electronic device can incrementally synchronize the data in the second shared application to the first shared application.
[0226] In other embodiments, when the second electronic device determines that there is first target data in the second shared application that needs to be synchronized to the first shared application, the second electronic device can directly send all the data in the second shared application to the first electronic device through the transmission channel. That is, the second electronic device directly synchronizes all the data in the second shared application to the first shared application.
[0227] S611. Based on the first target data, the first electronic device updates the data in the first shared application.
[0228] As described in S605 above, the first target data may include: spatial metadata of the second target workspace and / or material metadata of the second target shared files. The following describes the detailed process by which the first electronic device updates data in the first shared application based on the specific content of the first target data:
[0229] In one embodiment, when the first target data includes spatial metadata of the second target workspace, it indicates that the material metadata of the second shared file in the second electronic device has not changed. At this time, the first electronic device determines a third target workspace from the second target workspace based on the name of the second target workspace and the names of all workspaces in the first shared application. Then, the first electronic device copies the third target workspace. Based on this, the workspaces in the first and second electronic devices are completely identical, and there are no workspaces with duplicate names.
[0230] Specifically, since the names of the various workspaces created by the electronic devices in the shared application are all different, after the first electronic device receives the spatial metadata of the second target workspace, it can divide the second target workspace into: a third target workspace with a name different from the names of all existing workspaces in the first shared application, and / or a fourth target workspace with a name identical to that of one of the existing workspaces in the first shared application. In other words, the spatial metadata of the second target workspace sent by the second electronic device to the first electronic device includes: the spatial metadata of the third target workspace, and / or the spatial metadata of the fourth target workspace.
[0231] After the first electronic device copies the third target workspace in the first shared application, in order to distinguish the third target workspace from the first workspace, the space source identifier of the third target workspace can be set to originate from another electronic device within the trust ring. For example, the first electronic device sets the space source identifier of the third target workspace to a second value.
[0232] After the first electronic device copies the third target workspace, it sorts the workspaces within the first shared application according to their spatial sorting timestamps. The sorting rule can be ascending or descending order, but is not limited to this. Based on this, the same workspace will have the same sorting across all electronic devices within the trust ring.
[0233] In another embodiment, based on the above embodiments, when the first target data also includes the material metadata of the second target shared files, after the first electronic device has copied the third target workspace, it can display the material metadata of each second target shared file in the respective workspaces corresponding to the first shared application.
[0234] Specifically, the metadata of each shared file includes an identifier for the workspace to which the shared file belongs; that is, there is a mapping relationship between the metadata of the shared file and the workspace. Therefore, after receiving the metadata of the second target shared file, the first electronic device can determine, based on the identifier of the workspace to which the metadata of the second target shared file originates, which is the second workspace within the second sharing application. In other words, the first electronic device can determine the name of the second workspace to which the metadata of the second target shared file belongs in the second sharing application based on the identifier of the workspace to which the metadata of the second target shared file belongs.
[0235] After the first electronic device copies the third target workspace, it now includes all the second workspaces from the second electronic device. Therefore, based on the name of the workspace containing the metadata of the second target shared file, the first electronic device can find workspaces with the same name in the first sharing application. In other words, it determines the storage area of the database corresponding to the third target workspace in the first sharing application and displays the metadata of the second target shared file in its corresponding workspace within the first sharing application. Thus, the metadata of the second target shared file can be displayed in all workspaces with the same name. For example, the metadata displayed in workspace A of the second electronic device will also be displayed in workspace A of the first electronic device.
[0236] In another embodiment, when the first target data only includes the second target shared files, the first electronic device directly displays the material metadata of each second target shared file in the respective workspaces corresponding to the first shared application.
[0237] It should be noted that, in the embodiments of this application, the same material metadata is ordered in the same workspace of each electronic device within the trust ring.
[0238] In other embodiments, when the second electronic device directly synchronizes all data in the second shared application to the first shared application, the first electronic device can update the data in the first shared application based on the data in the second shared application.
[0239] S612, The first electronic device sends data from the first shared application to the second electronic device through the transmission channel.
[0240] In this step, the data sent from the first electronic device to the second electronic device in the first shared application can be any of the following:
[0241] In one embodiment, the first electronic device sends all data from the first shared application to the second electronic device. That is, the first electronic device fully synchronizes the data from the first shared application to the second shared application. This is convenient, saves computational load on the first electronic device, and thus conserves system resources.
[0242] In another embodiment, when the first feedback message may include a second historical timestamp of the last time the second sharing application synchronized data from the first sharing application, the first electronic device only sends the data that differs between the first and second sharing applications to the second electronic device. That is, the first electronic device incrementally synchronizes data from the first sharing application to the second sharing application. This reduces the amount of data transmitted, improves data transmission efficiency, and saves transmission time.
[0243] In this embodiment, the first electronic device needs to filter out data that differs between the first and second shared applications from the first shared application. Specifically, the process of determining the first target data by the second electronic device described above can be referred to, and will not be repeated in this embodiment.
[0244] S613. The second electronic device updates the data in the second shared application based on the data in the first shared application.
[0245] This step can be referred to in the description of S611 above, and will not be repeated in the embodiments of this application.
[0246] S614, The second electronic device sends a first synchronization completion message to the first electronic device.
[0247] In this embodiment of the application, after data synchronization is completed between two electronic devices, the electronic device that last completed data synchronization will send a synchronization completion message to the other electronic device. The synchronization completion message indicates that the electronic device that last completed data synchronization has successfully updated the data in the shared application, which means that the two electronic devices have successfully synchronized their data.
[0248] For ease of distinction, the synchronization completion message sent by the second electronic device is referred to as the first synchronization completion message. The first synchronization completion message indicates that the second electronic device has successfully updated the data in the second shared application based on the data in the first shared application. Simultaneously, the first synchronization completion message can also be used to indicate that the first and second electronic devices have successfully synchronized their data.
[0249] S615, The second electronic device sets its synchronization status to successful synchronization.
[0250] The second electronic device sets its synchronization status to successful, indicating that the second shared application has successfully synchronized the data in the first shared application.
[0251] S616. Based on the first synchronization completion message, the first electronic device sets the synchronization status of the first electronic device to synchronization successful.
[0252] In this process, the first electronic device sets its synchronization status to successful, indicating that the first shared application has successfully synchronized the data in the second shared application.
[0253] It should be noted that if the first electronic device receives the first synchronization completion message within the fourth preset time period (e.g., 30 seconds), the first electronic device executes S616. If the first electronic device does not receive the first synchronization completion message within the fourth preset time period, the first electronic device sets its synchronization status to synchronization failure until the next data synchronization event is triggered, at which point the first electronic device and the second electronic device will re-execute the steps in any of the embodiments of this application.
[0254] In this scenario, after the first electronic device sets its synchronization state to "synchronization failed," the first shared application can display data from the second shared application. However, the first shared application may not be able to access the data in the second shared application. For example, the first shared application may not be able to open a document in the second shared application.
[0255] In some embodiments, after the first electronic device and the second electronic device complete data synchronization, that is, after the first electronic device receives the first synchronization completion message, the first electronic device queries whether there are still device identifiers in the first synchronization queue. If there are device identifiers in the first synchronization queue, the first electronic device synchronizes data with the electronic device corresponding to each device identifier in the first synchronization queue in turn.
[0256] In other embodiments, in response to any data synchronization event triggered by the first shared application being refreshed, opened, or switched from the background to the foreground, the first electronic device also checks whether a device identifier is still present in the first synchronization queue. That is, the electronic device within the trust ring checks whether a device identifier is still present in the synchronization queue, not entirely depending on whether the electronic device has received a synchronization completion message. Based on this, it can be ensured that data synchronization between electronic devices within the trust ring can proceed sequentially, thereby guaranteeing a high success rate for data synchronization.
[0257] In other embodiments, after receiving the first synchronization completion message within a fourth preset time period, the first electronic device queries whether a device identifier is still stored in the first synchronization queue. If the first electronic device does not receive the first synchronization completion message within the fourth preset time period, and the data synchronization event is not triggered, the first electronic device queries whether a device identifier is still stored in the first synchronization queue.
[0258] Furthermore, Figure 9 This is illustrated as a fourth flowchart of a data synchronization method provided in an embodiment of this application. Based on the above embodiments, and combined with... Figure 6 ,like Figure 9 As shown, after S606, the data synchronization method provided in this embodiment may include:
[0259] S901. Based on the fact that the current state of the first electronic device is a synchronization state, the first electronic device adds the second device identifier to the first synchronization queue.
[0260] Each electronic device involved in the embodiments of this application has a preset synchronization queue. The synchronization queue is an ordered linear list that can store the device identifiers of each electronic device within the trust ring. The order of each device identifier in the synchronization queue of this electronic device indicates the order in which this electronic device synchronizes data with the electronic devices corresponding to each device identifier.
[0261] For ease of distinction, in this embodiment of the application, the synchronization queue in the first electronic device is referred to as the first synchronization queue, and the synchronization queue in the second electronic device is referred to as the second synchronization queue.
[0262] If the first electronic device receives the first feedback message and its current state is idle, it means that the first electronic device has not synchronized data with any electronic device in the trust ring at the current moment. Therefore, the first shared application and the second shared application can immediately synchronize data, so the first electronic device does not need to add the second device identifier to the first synchronization queue for queuing.
[0263] Upon receiving the first feedback message, if the first electronic device is currently in a synchronized state, it indicates that it is (or about to) synchronizing and sharing data with other electronic devices within the trust ring, excluding the second electronic device. Therefore, the first sharing application cannot immediately synchronize data with the second sharing application, and the second electronic device needs to queue. Based on this, the first electronic device adds the second device identifier to the first synchronization queue. In this way, the first sharing application can synchronize data with the corresponding sharing application sequentially according to the order of the device identifiers in the first synchronization queue, thus avoiding conflicts and enabling any two sharing applications to successfully synchronize data.
[0264] In one embodiment, if an electronic device within the trust ring adds a device identifier to its own synchronization queue, the electronic device will notify the electronic device corresponding to that device identifier. For example, if a first electronic device adds a second device identifier to a first synchronization queue, the first electronic device will send a notification message to the second electronic device to notify the second electronic device that it has added the second device identifier to the first synchronization queue.
[0265] It should be noted that after the first electronic device synchronizes its data with another electronic device within the trust ring, it checks whether the device identifier is still stored in the first synchronization queue. If the device identifier is still stored in the first synchronization queue, the first electronic device will not change its current state. That is, the current state of the first electronic device is still synchronized. Otherwise, the first electronic device will set its current state to idle.
[0266] S902, based on the fact that the device identifier of the second electronic device is located at the head of the first synchronization queue, the first electronic device sends a transmission channel establishment request to the second electronic device.
[0267] As is well known, queues manage data stored in them according to the first-in, first-out (FIFO) principle. When a piece of data is at the head of the queue, it indicates that the data is about to be used. Based on this, in this embodiment, when the device identifier of the second electronic device is at the head of the first synchronization queue, it indicates that the first electronic device is about to synchronize and share data with the second electronic device. Therefore, the first electronic device sends a transmission channel establishment request to the second electronic device.
[0268] In this embodiment, the electronic device that meets the second preset condition is the first electronic device. The second preset condition includes: the device identifier of the second electronic device is located at the head of the first synchronization queue of the first electronic device. The transmission channel is established when the second shared application includes the first target data and the second electronic device is in an idle state. That is, when the second shared application includes the first target data, the second electronic device is in an idle state, and the device identifier of the second electronic device is located at the head of the first synchronization queue of the first electronic device, the first electronic device will send a transmission channel establishment request to the second electronic device to establish a transmission channel between the first electronic device and the second electronic device.
[0269] S903, the first electronic device and the second electronic device establish a transmission channel based on the transmission channel establishment request.
[0270] The process of establishing a transmission channel based on a transmission channel establishment request between the first electronic device and the second electronic device can be referenced to the process of establishing a Bluetooth connection based on a Bluetooth connection request between the first electronic device and the second electronic device. Therefore, this embodiment will not elaborate on this process. The session information of the second transmission channel may include a first device identifier and a second device identifier.
[0271] Optionally, after S903, based on the successful establishment of the transmission channel and the second electronic device being in an idle state, the second electronic device sets its current state to a synchronization state.
[0272] The second electronic device sets its current state to synchronization state to notify other electronic devices in the trust ring, except for the first electronic device, that the second electronic device is synchronizing data or is about to start synchronizing shared data, and cannot synchronize data with other electronic devices at this time.
[0273] Furthermore, Figure 10 This is illustrated as a fifth flowchart of a data synchronization method provided in an embodiment of this application. Based on the above embodiments, and combined with... Figure 6 ,like Figure 10 As shown, after S604, the data synchronization method provided in this embodiment may include:
[0274] S1001, if both the first sharing application and the second sharing application support the first strategy, based on the first historical timestamp in the first negotiation message and the change timestamp of each data in the second sharing application, the second electronic device determines that there is no first target data to be synchronized to the first sharing application in the second sharing application.
[0275] Referring to the description in S605 above, in this step, after receiving the first negotiation message, the second electronic device will perform the following process based on the first negotiation message: The second electronic device compares the first historical timestamp with the change timestamp of each data in the second shared application. Based on the fact that the change timestamp of any data in the second shared application is earlier than the first historical timestamp, the data in the second shared application is determined to be synchronized data. Based on this, the second electronic device determines that the first target data does not exist in the second shared application.
[0276] S1002, The second electronic device sends a second negotiation message to the first electronic device.
[0277] The second negotiation message indicates that the first electronic device, which has established a Bluetooth connection with the electronic device that triggered the data synchronization event, does not have the first target data to be synchronized with the electronic device that triggered the data synchronization event. The second negotiation message is used by the first electronic device to determine whether it needs to synchronize shared data with the second electronic device.
[0278] In one embodiment, the second negotiation message may include: the current state of the electronic device that established a Bluetooth connection with the electronic device that triggered the data synchronization event, and a historical timestamp of the last time that the shared application of the electronic device synchronized data from the shared application of the electronic device that triggered the data synchronization event.
[0279] Based on the above description, in this embodiment, the second negotiation message may include: the current state of the second electronic device and the second historical timestamp of the last time the second sharing application synchronized data from the first sharing application.
[0280] In another embodiment, the second negotiation message may include: the current state of the electronic device that established a Bluetooth connection with the electronic device that triggered the data synchronization event, the historical timestamp of when the shared application of the electronic device last synchronized data from the shared application of the electronic device that triggered the data synchronization event, and the version number of the shared application of the electronic device.
[0281] Based on the above description, in this embodiment, the second negotiation message may include: the current state of the second electronic device, the second historical timestamp of the last time the second sharing application synchronized data from the first sharing application, and the second version number.
[0282] S1003, if both the first sharing application and the second sharing application support the first strategy, based on the second historical timestamp in the second negotiation message and the change timestamp of each data in the first sharing application, the first electronic device determines that there is second target data in the first sharing application that needs to be synchronized to the second sharing application.
[0283] In one embodiment, if the first electronic device joins the trust ring of the second electronic device for the first time, then all data in the first shared application is the second target data to be synchronized from the first shared application to the second shared application.
[0284] In another embodiment, if the first electronic device is not joining the trust ring of the second electronic device for the first time, the data in the first shared application may include at least one of the following: data that the first shared application has synchronized with the second shared application and has changed, data that the first shared application has synchronized with the second shared application and has not changed, and data that the first shared application has not synchronized with the second shared application.
[0285] Data to be synchronized can include both data that has been synchronized from the first sharing application to the second sharing application and data that has changed, as well as data that has not been synchronized from the first sharing application to the second sharing application. Data that has been synchronized from the first sharing application to the second sharing application and has not changed is considered synchronized data. Synchronized data does not need to be synchronized again, thus reducing the amount of data to be synchronized, saving resources and reducing power consumption of electronic devices.
[0286] For ease of description, the data that the first sharing application has synchronized with the second sharing application and has changed will be referred to as the third data to be synchronized, and the data that the first sharing application has not synchronized with the second sharing application will be referred to as the fourth data to be synchronized. In this case, the second target data may include the third data to be synchronized and / or the fourth data to be synchronized.
[0287] Specifically, in this step, after receiving the second negotiation information, the first electronic device will perform the following process based on the second negotiation message: the first electronic device compares the second historical timestamp with the change timestamp of each data in the first shared application, and based on the fact that the change timestamp of a data in the first shared application is later than the second historical timestamp, the first electronic device determines that data as the second target data.
[0288] Referring again to the description of data in the shared application in S605, in this embodiment of the application, the second target data may include: spatial metadata of the first target workspace and / or material metadata of the first target shared file.
[0289] It should be noted that if the first electronic device receives the second negotiation message within the third preset time period, the first electronic device executes S1003 and sets the data synchronization negotiation status to negotiation successful. If the first electronic device does not receive the second negotiation message within the third preset time period, the first electronic device does not execute S1003 and sets the data synchronization negotiation status to negotiation failed. In this case, the first electronic device and the second electronic device directly synchronize data. The direct data synchronization between the first and second electronic devices can be referred to in S607, and will not be elaborated upon here.
[0290] S1004, The first electronic device sends a second feedback message to the second electronic device.
[0291] The second feedback message is used to indicate that there is second target data in the first sharing application that needs to be synchronized to the second sharing application.
[0292] In one embodiment, the second feedback message may include a first historical timestamp of the last time the first sharing application synchronized data from the second sharing application. In another embodiment, the first feedback message does not include the first historical timestamp of the last time the first sharing application synchronized data from the second sharing application.
[0293] S1005. Based on the fact that the current state of the second electronic device is idle, the first electronic device sends a transmission channel establishment request to the second electronic device.
[0294] In this embodiment, the electronic device that meets the second preset condition is the first electronic device. The second preset condition includes: the first shared application includes the second target data, and the first electronic device is in an idle state. The transmission channel is established when the first shared application includes the second target data, the second shared application does not include the first target data, and the second electronic device is in an idle state.
[0295] It should be noted that if the second electronic device receives the second feedback message within the third preset time period, the second electronic device executes S1006 and sets the data synchronization negotiation status to successful. If the second electronic device does not receive the second feedback message within the third preset time period, the second electronic device does not execute S1006 and sets the data synchronization negotiation status to failed. In this case, the first electronic device and the second electronic device directly synchronize data.
[0296] Optionally, after S1005, based on the fact that the current state of the first electronic device is idle, the first electronic device can set its current state to synchronization state to notify other electronic devices in the trust ring except for the second electronic device: the first electronic device is synchronizing data or is about to start synchronizing shared data, and cannot synchronize data with other electronic devices at this time.
[0297] S1006. The first electronic device and the second electronic device establish a transmission channel based on the transmission channel establishment request.
[0298] Optionally, after S1006, if the transmission channel is successfully established, the second electronic device can set its current state to a synchronization state to notify other electronic devices in the trust ring, except for the first electronic device, that the second electronic device is synchronizing data or is about to start synchronizing shared data, and cannot synchronize data with other electronic devices at this time.
[0299] S1007. The first electronic device sends the second target data to the second electronic device through the transmission channel.
[0300] As can be seen from the analysis in S1003 above, the second target data can be all the data of the first shared application, or it can be a portion of the data in the first shared application. That is to say, the first electronic device can fully synchronize the data in the first shared application to the second shared application, or the first electronic device can incrementally synchronize the data in the first shared application to the second shared application.
[0301] In other embodiments, when the first electronic device determines that there is second target data in the first shared application that needs to be synchronized to the second shared application, the first electronic device can directly send all the data in the first shared application to the second electronic device through the transmission channel. That is, the first electronic device directly synchronizes all the data in the first shared application to the second shared application.
[0302] S1008. Based on the second target data, the second electronic device updates the data in the second shared application.
[0303] As described in S1003 above, the second target data may include: spatial metadata of the first target workspace and / or material metadata of the first target shared files. The following is a brief description of the process by which the second electronic device updates data in the second shared application based on the second target data, according to the specific content of the second target data and the description in S1103:
[0304] In one embodiment, when the second target data includes spatial metadata of the first target workspace, it indicates that the material metadata of the first shared file in the first electronic device has not changed. At this time, the second electronic device determines a fifth target workspace from the first target workspace based on the name of the first target workspace and the names of all workspaces in the second shared application. Then, the first electronic device copies the fifth target workspace. Based on this, the workspaces in the first and second electronic devices are completely identical, and there are no workspaces with duplicate names.
[0305] Specifically, the spatial metadata of the first target workspace sent by the first electronic device to the second electronic device includes: spatial metadata of the fifth target workspace, and / or spatial metadata of the sixth target workspace.
[0306] After the second electronic device copies the fifth target workspace in the second shared application, in order to distinguish the fifth target workspace from the second workspace, the space source identifier of the fifth target workspace can be set to originate from another electronic device within the trust ring. For example, the second electronic device sets the space source identifier of the fifth target workspace to a second value.
[0307] After the second electronic device copies the fifth target workspace, it sorts the workspaces in the second shared application according to the spatial sorting timestamp of each workspace. The sorting rule can be ascending or descending order, but is not limited to this.
[0308] In another embodiment, based on the above embodiment, when the second target data also includes the material metadata of the first target shared file, after the second electronic device has copied the fifth target workspace, it can display the material metadata of each first target shared file in the respective workspaces corresponding to the second shared application.
[0309] In another embodiment, when the second target data only includes the first target shared files, the second electronic device directly displays the material metadata of each first target shared file in the respective workspaces corresponding to the second shared application.
[0310] In some embodiments, after the first electronic device and the second electronic device complete data synchronization, the second electronic device queries whether there are still device identifiers in the second synchronization queue. If there are device identifiers in the second synchronization queue, the second electronic device synchronizes data with the electronic device corresponding to each device identifier in the second synchronization queue in turn.
[0311] In other embodiments, in response to operations such as refreshing the second shared application, opening the second shared application, or switching the second shared application from the background to the foreground, the second electronic device will check whether the device identifier is still present in the second synchronization queue. That is, the electronic device within the trust ring checks whether the device identifier is still present in the synchronization queue, not entirely depending on whether the electronic device has received a synchronization completion message. Based on this, it can be ensured that data synchronization between various electronic devices within the trust ring can proceed sequentially, thereby guaranteeing the success rate of data synchronization.
[0312] Furthermore, Figure 11 This illustration shows a sixth flowchart of a data synchronization method provided in an embodiment of this application. Based on the above embodiments, as... Figure 11 As shown, after S1008, the data synchronization method provided in this embodiment may include:
[0313] S1101, The second electronic device sends data from the second shared application to the first electronic device through the transmission channel.
[0314] In this step, the second electronic device can fully synchronize the data in the second shared application to the first shared application.
[0315] S1102. Based on the data in the second shared application, the first electronic device updates the data in the first shared application.
[0316] This step can be referred to in S611 above, and will not be repeated here.
[0317] S1103, The first electronic device sends a second synchronization completion message to the second electronic device.
[0318] In this embodiment, the synchronization completion message sent by the first electronic device is referred to as the second synchronization completion message. The second synchronization completion message indicates that the first electronic device has successfully updated the data in the first shared application based on the data in the second shared application. Simultaneously, the second synchronization completion message can also be used to indicate that the first electronic device and the second electronic device have successfully synchronized their data.
[0319] S1104. The first electronic device sets its synchronization status to successful synchronization.
[0320] S1105. Based on the second synchronization completion message, the second electronic device sets the synchronization status of the second electronic device to synchronization successful.
[0321] It should be noted that if the second electronic device receives the second synchronization completion message within the fourth preset time period, the second electronic device executes S1105. If the second electronic device does not receive the second synchronization completion message within the fourth preset time period, the second electronic device sets its synchronization status to synchronization failure until the next data synchronization event is triggered, at which point the second electronic device and the first electronic device will re-execute the steps in any of the embodiments of this application.
[0322] In this scenario, after the second electronic device sets its synchronization status to "synchronization failed," the second shared application can display data from the first shared application. However, the second shared application may not be able to access the data in the first shared application. For example, the second shared application may not be able to open a document from the first shared application.
[0323] Furthermore, Figure 12 This illustration shows a seventh flowchart of a data synchronization method provided in an embodiment of this application. Based on the above embodiments, as... Figure 12 As shown, after S1004, the data synchronization method provided in this embodiment may include:
[0324] S1201. Based on the fact that the current state of the second electronic device is a synchronization state, the second electronic device adds the first device identifier to the second synchronization queue.
[0325] If the second electronic device receives the second feedback message and its current state is idle, it means that the second electronic device has not synchronized data with any electronic device in the trust ring at the current moment. Therefore, the first shared application and the second shared application can immediately synchronize data, so the second electronic device does not need to add the first device identifier to the second synchronization queue for queuing.
[0326] Upon receiving the second feedback message, if the second electronic device is currently in a synchronized state, it indicates that the second electronic device is currently (or about to) synchronizing and sharing data with other electronic devices within the trust ring, excluding the first electronic device. Based on this, the second electronic device adds the first device identifier to the second synchronization queue for queuing.
[0327] S1202, Based on the fact that the device identifier of the first electronic device is located at the head of the second synchronization queue, the second electronic device sends a transmission channel establishment request to the first electronic device.
[0328] The second electronic device synchronizes data sequentially with the electronic devices corresponding to each device identifier in the second synchronization queue until the first device identifier is at the head of the second synchronization queue. This indicates that the second electronic device is about to synchronize and share data with the first electronic device, so the second electronic device sends a transmission channel establishment request to the first electronic device.
[0329] In this embodiment, the electronic device that meets the second preset condition is the second electronic device. The second preset condition includes: the device identifier of the first electronic device is located at the head of the second synchronization queue of the second electronic device. The transmission channel is established when: the first shared application includes the second target data, the second shared application does not include the first target data, and the first electronic device is in an idle state.
[0330] Optionally, after S1202, the second electronic device can set its current state to a synchronization state.
[0331] S1203. The first electronic device and the second electronic device establish a transmission channel based on the transmission channel establishment request.
[0332] Optionally, after S1203, if the transmission channel is successfully established and the first electronic device is in an idle state, the first electronic device can set its current state to a synchronization state.
[0333] Furthermore, Figure 13 This illustration shows an eighth flowchart of a data synchronization method provided in an embodiment of this application. Based on the above embodiments, as... Figure 13 As shown, in this embodiment, after S603, the data synchronization method provided in this application embodiment may include:
[0334] S1301. Based on the Bluetooth connection failure, the first electronic device sends a transmission channel establishment request to the second electronic device.
[0335] In this embodiment, a Bluetooth connection failure between the first electronic device and the second electronic device means that, within a first preset time period, the first electronic device and the second electronic device fail to establish a Bluetooth connection after multiple attempts based on Bluetooth connection requests, or, after two attempts based on Bluetooth connection requests, they still fail to establish a Bluetooth connection. If the connection between the first electronic device and the second electronic device fails, they will no longer negotiate and can directly synchronize data.
[0336] The reasons for the failure of Bluetooth connection between the first electronic device and the second electronic device may include, but are not limited to: both the first and second sharing applications support historical policies, either the first or second sharing application supports historical policies, or the Bluetooth versions of the first and second electronic devices are different.
[0337] S1302, the first electronic device and the second electronic device establish a transmission channel based on the transmission channel establishment request.
[0338] S1303. Based on the successful establishment of the transmission channel, the first electronic device sends data from the first shared application to the second electronic device through the transmission channel.
[0339] S1304. Based on the data in the first shared application, the second electronic device updates the data in the second shared application.
[0340] S1305, The second electronic device sends data from the second shared application to the first electronic device through the transmission channel.
[0341] S1306. Based on the data in the second shared application, the first electronic device updates the data in the first shared application.
[0342] In summary, the data synchronization method provided in this embodiment can avoid synchronization failures caused by different versions of shared applications on two electronic devices, ultimately preventing the two shared applications from synchronizing data. In other words, the data synchronization method provided in this embodiment is compatible with historical versions.
[0343] Furthermore, Figure 14 This illustration shows a flowchart of a data synchronization method provided in an embodiment of this application, number nine. Based on any of the above embodiments, such as... Figure 14 As shown in S604, the data synchronization method provided in this application embodiment may include:
[0344] S1401, if the first shared application and / or the second shared application support the second strategy, the first electronic device sends a transmission channel establishment request to the second electronic device.
[0345] After receiving the first negotiation message, if the first sharing application and / or the second sharing application support the second strategy, it means that the first and second electronic devices do not need to perform data synchronization negotiation when synchronizing data in the shared applications. In this case, the second electronic device no longer needs to determine whether the first target data exists in the second sharing application, and the first and second electronic devices can directly synchronize data in the shared applications. Therefore, the first electronic device directly sends a transmission channel establishment request to the second electronic device.
[0346] S1402. Based on the transmission channel establishment request, the first electronic device and the second electronic device establish a transmission channel.
[0347] It should be noted that in the above embodiments, when the first electronic device and the second electronic device directly synchronize data, the transmission channel can transmit all data of the first shared application and all data of the second shared application. That is to say, direct data synchronization refers to the full synchronization of all data in the shared application.
[0348] Furthermore, based on any of the above embodiments, if the establishment of the transmission channel initiated by the first electronic device fails, the first electronic device and the second electronic device cannot synchronize and share data. In this case, the first electronic device waits for the next data synchronization event to be triggered before synchronizing and sharing data with the second electronic device. If the establishment of the transmission channel initiated by the second electronic device fails, the first electronic device and the second electronic device cannot synchronize data. In this case, the second electronic device waits for the next data synchronization event to be triggered before synchronizing data with the first electronic device.
[0349] In this context, "transmission channel establishment failure" refers to a situation where, within a second preset time period, the first electronic device and the second electronic device fail to successfully establish a transmission channel despite multiple attempts based on transmission channel establishment requests. If the transmission channel establishment fails, the first and second electronic devices cannot synchronously share data within the application. Reasons for transmission channel establishment failure may include, but are not limited to, the first and / or second electronic devices performing other data transmission tasks.
[0350] Of course, if other problems (such as negotiation failure) cause the data synchronization between the first electronic device and the second electronic device to fail (i.e., data cannot be synchronized), the first electronic device and / or the second electronic device will synchronize data with the other electronic device again when the next data synchronization event is triggered.
[0351] Additionally, if data synchronization between the first and second electronic devices fails, each electronic device will record the reason for the failure, and the shared application on each electronic device will display a first prompt message. The first prompt message indicates that the data synchronization failed. For example, the first prompt message could be: "Synchronization failed," but it is not limited to this.
[0352] Figure 15 The second schematic diagram of a data synchronization interface provided in an embodiment of this application is shown.
[0353] like Figure 15As shown in Figure A, phone C is within the trust ring, and the sharing application on phone C displays the icon 411 of the first image. Phone D is not in the trust ring, and the sharing application on phone D displays the icon 412 of the second image.
[0354] like Figure 15 As shown in B, after phone D joins the trust ring where phone C is located, phone C's sharing application still only displays the icon 411 of the first image, and the first prompt message 1510 is displayed in phone C's sharing application. Phone D's sharing application still only displays the icon 412 of the second image, and the first prompt message 1510 is displayed in phone D's sharing application. For example, the first prompt message could be "synchronization failed."
[0355] Furthermore, based on any of the above embodiments, if the data of the shared application of any electronic device (such as the first electronic device) within the trust ring is modified, the shared application is refreshed (such as pull-to-refresh), the shared application is switched from the background to the foreground or the shared application is cold-started, or the device exits the trust ring, in response to any of the above operations, the electronic device and other electronic devices (such as the second electronic device) within the trust ring can execute S603 and the steps after S603, which will not be elaborated in the embodiments of this application.
[0356] Modification of data in a shared application (i.e., changes to data in a shared application) can include at least one of the following: data being deleted from the shared application, new data being added to the shared application, the order of data in the shared application changing, or data being modified in the shared application.
[0357] For example, data deletion in a shared application can include at least one of the following: workspace deletion, or shared file deletion from the workspace. New data addition in a shared application can include at least one of the following: a new workspace is created, or a new collection of shared files is added to the workspace. Changes in the order of data in a shared application can include at least one of the following: a change in the order of different workspaces, or a change in the order of different collections of shared files within the same workspace. Data modification in a shared application can include at least one of the following: modification of workspace metadata (e.g., name), or modification of shared file metadata (e.g., name).
[0358] Optional, Figure 16 This illustration shows a flowchart of a data synchronization method provided in an embodiment of this application. Based on any of the above embodiments, such as... Figure 16 As shown, the data synchronization method provided in this application embodiment may include:
[0359] S1601, In response to the operation of deleting third target data, the first electronic device deletes the third target data from the first shared application.
[0360] The third target data is data that originally belonged to the first electronic device. The third target data may include: spatial metadata of the seventh target workspace, and / or, material metadata of the third target shared files. The seventh target workspace is any workspace within the first workspace, and the third target shared files are any shared files within the first shared files.
[0361] In other words, the first electronic device deletes the workspace created by the first electronic device in the first sharing application; or, the first electronic device deletes the material metadata of the first shared file stored in the first electronic device in the first sharing application; or, the first electronic device deletes both the workspace created by the first electronic device and the material metadata of the first shared file stored in the first electronic device in the first sharing application.
[0362] S1602, the first electronic device updates the third target data to the fourth target data.
[0363] Regardless of whether an electronic device within the trust ring deletes data obtained from this device and belonging to a shared application, the electronic device will not delete the data from its own database. Instead, it will set the existence status flag of the data stored in its database to a second value (e.g., 1) to indicate that the data is no longer displayed in the shared application of this electronic device. During full data synchronization between electronic devices within the trust ring, this electronic device will not synchronize data with an existence status flag set to the second value to other electronic devices within the trust ring. This improves data synchronization efficiency.
[0364] Therefore, the fourth target data is the third target data whose existence status identifier is set to the second value. In other words, in this embodiment, the fourth target data is the second data. After the first electronic device deletes the third target data from the first sharing application, the third target data is no longer displayed in the first sharing application.
[0365] In one embodiment, after the spatial metadata of the seventh target workspace is deleted, the first electronic device sets the spatial existence status identifier of the seventh target workspace to a second value, indicating that the seventh target workspace is no longer displayed in the first shared application.
[0366] In another embodiment, when the material metadata of the third target shared file is deleted, the first electronic device sets the file existence status identifier of the third target shared file to a second value, indicating that the third target shared file is no longer collected in the first sharing application, and therefore the material metadata of the third target shared file is no longer displayed in the first sharing application.
[0367] In this embodiment, the data in the first shared application of the first electronic device is modified, thus triggering a data synchronization event on the first electronic device. Therefore, after S1602, the first electronic device and the second electronic device can execute the steps described above in S603 and after S603, as detailed above. This embodiment will not be repeated here.
[0368] Figure 17 The third illustration shows a data synchronization interface provided in an embodiment of this application.
[0369] like Figure 17 As shown in A, the sharing application on phone E displays icon 411 of the first image and icon 412 of the second image. In response to a long press on icon 412 of the second image, as... Figure 17 As shown in B, a checkbox 1701 can appear in the upper right corner of the first image icon 411, and a checkbox 1701 can also appear in the upper right corner of the second image icon 412. In response to clicking the checkbox 1701 corresponding to either image (such as the second image), as follows... Figure 17 As shown in C, the checkbox 1701 corresponding to the second image is selected, and the delete control 1702 is displayed in the sharing application on phone E. In response to clicking the delete control 1702, as... Figure 17 As shown in D, the sharing application on phone E only displays the icon 411 of the first image, and no longer displays the icon 412 of the second image.
[0370] Optional, Figure 18 This illustration shows eleventh of a flowchart illustrating a data synchronization method provided in an embodiment of this application. Based on any of the above embodiments, such as... Figure 18 As shown, the data synchronization method provided in this application embodiment may include:
[0371] S1801, In response to the operation of deleting the fifth target data, the first electronic device deletes the fifth target data from the first shared application.
[0372] The fifth target data can be data synchronized by the first electronic device from a shared application of other devices within the trust ring. In this embodiment, the fifth target data is described as data synchronized by the first electronic device from a second shared application of the second electronic device.
[0373] Specifically, the fifth target data may include: spatial metadata of the eighth target workspace, and / or, material metadata of the fourth target shared files. The eighth target workspace is any workspace within the second workspace, and the fourth target shared file is any shared file within the second shared files.
[0374] In other words, the first electronic device deletes the workspace copied from the second electronic device in the first sharing application; or, the first electronic device deletes the material metadata of the second shared file stored in the second electronic device in the first sharing application; or, the first electronic device deletes both the workspace copied from the second electronic device and the material metadata of the second shared file stored in the second electronic device in the first sharing application.
[0375] S1802, the first electronic device updates the fifth target data to the sixth target data.
[0376] When an electronic device within the trust ring deletes data obtained from the other end that belongs to the shared application, the electronic device sets the existence status flag of that data to a second value in its local database, indicating that the first electronic device will no longer display that data. Therefore, the sixth target data is the fifth target data whose existence status flag is set to the second value. In this embodiment, the sixth target data is the second data. After the first electronic device deletes the fifth target data from the first shared application, the fifth target data is no longer displayed in the first shared application.
[0377] In one embodiment, after the spatial metadata of the eighth target workspace is deleted, the first electronic device sets the spatial existence status identifier of the eighth target workspace to a second value, indicating that the eighth target workspace is no longer displayed in the first shared application.
[0378] In another embodiment, when the material metadata of the fourth target shared file is deleted, the first electronic device sets the file existence status identifier of the fourth target shared file to a second value, indicating that the fourth target shared file is no longer collected in the first sharing application, and therefore the material metadata of the third target shared file is no longer displayed in the first sharing application.
[0379] In this embodiment, the data in the first shared application of the first electronic device is modified, thus triggering a data synchronization event. Therefore, after S1802 and before S1803, the first electronic device and the second electronic device can perform operations such as Bluetooth connection and creating a transmission channel (corresponding to this embodiment). Figure 19 (This part is not shown in the text), please refer to the above introduction for details, and the embodiments in this application will not be repeated.
[0380] S1803, The first electronic device sends the sixth target data to the second electronic device through the transmission channel.
[0381] S1804. Based on the sixth target data, the second electronic device deletes the fifth target data from the second shared application.
[0382] The sixth target data differs from the fifth target data only in its status identifier. Therefore, upon receiving the sixth target data, the second electronic device can determine which fifth target data needs to be deleted. After the second electronic device deletes the fifth target data from the second sharing application, the fifth target data will no longer be displayed in the second sharing application.
[0383] In one embodiment, when the fifth target data includes spatial metadata of the eighth target workspace, the second electronic device can set the spatial existence status identifier of the eighth target workspace to a second value in the database of the second electronic device, indicating that the eighth target workspace is no longer displayed in the second shared application.
[0384] In another embodiment, when the fifth target data includes the material metadata of the fourth target shared file, the second electronic device sets the file existence status identifier of the fourth target shared file to a second value, indicating that the fourth target shared file is no longer collected in the second sharing application, and therefore the material metadata of the fourth target shared file is no longer displayed in the second sharing application.
[0385] S1805, The second electronic device sends a second prompt message or a third prompt message to the first electronic device.
[0386] The second message indicates that the deletion of the fifth target data was successful. The third message indicates that the deletion of the fifth target data failed.
[0387] If the second electronic device successfully deletes the fifth target data from the second sharing application, the second electronic device generates a second notification message and sends the second notification message to the first electronic device. If the second electronic device fails to successfully delete the fifth target data from the second sharing application, the second electronic device generates a third notification message and sends the third notification message to the first electronic device.
[0388] S1806, The first electronic device displays a second or third prompt message.
[0389] Figure 19 The fourth illustration shows a data synchronization interface provided in an embodiment of this application.
[0390] like Figure 19As shown in Figure A, mobile phone F and tablet computer C are in the same trust ring. The sharing application on mobile phone F displays an icon 411 for the first image and an icon 431 for the third image. The sharing application on tablet computer C also displays an icon 411 for the first image and an icon 431 for the third image. The first image is stored on mobile phone F, and the third image is stored on tablet computer C. Therefore, the icon 431 for the third image displayed in the sharing application on mobile phone F includes the device identifier 1901 of tablet computer C, indicating that the third image is stored on tablet computer C. The icon 411 for the first image displayed in the sharing application on tablet computer C includes the device identifier 1902 of mobile phone F, indicating that the first image is stored on mobile phone F.
[0391] In response to the deletion operation of icon 431 of the third image on phone F, such as Figure 19 As shown in B, the sharing application on phone F only displays the icon 411 of the first image, and no longer displays the icon 431 of the third image. Similarly, the sharing application on tablet C only displays the icon 411 of the first image, and no longer displays the icon 431 of the third image. At the same time, the sharing application on phone F displays a second notification message 1903. For example, the second notification message might be "Deletion successful."
[0392] Specifically, in response to the deletion operation of icon 431 of the third image on mobile phone F, the specific operation of mobile phone F to delete icon 431 of the third image can be referred to the above. Figure 17 The descriptions in the previous embodiments are not repeated here.
[0393] Furthermore, Figure 20 This is illustrated as a flowchart, specifically illustration twelve, of a data synchronization method provided in an embodiment of this application. Figure 20 As shown, the data synchronization method provided in this application embodiment may include:
[0394] S2001, The first electronic device exits the trust ring where the second electronic device is located.
[0395] In response to any of the following actions, the first electronic device may exit the trust ring of the second electronic device: exit the account corresponding to the trust ring, disconnect the Wi-Fi connection, disconnect the Bluetooth connection, but not limited to these.
[0396] S2002, The first electronic device sends the fourth prompt message to the server.
[0397] When an electronic device leaves the trust ring, it sends a fourth notification message to the server corresponding to the trust ring, indicating that the electronic device has left the trust ring. The server then broadcasts this message to other electronic devices within the trust ring.
[0398] The fourth prompt message may include the device identifier of the electronic device that exited the trust ring. For example, in this embodiment, the fourth prompt message includes the first device identifier.
[0399] S2003, The server sends the sixth prompt message to the second electronic device.
[0400] The sixth prompt message includes the device identifier of the electronic device that exited the trust ring.
[0401] S2004. Based on the sixth prompt information, the second electronic device hides the data in the first shared application in the second shared application.
[0402] In this embodiment, when any electronic device leaves the trust ring, other electronic devices do not delete the shared application data of that electronic device; instead, they hide the shared application data. Therefore, when that electronic device rejoins the trust ring, the shared applications of other electronic devices can directly display the shared application data of that electronic device.
[0403] In this embodiment, when an electronic device hides data in a shared application, it can set the hiding status flag of the data stored in its database to a second value to indicate that the data is hidden and temporarily not displayed in the shared application. When the electronic device sets the hiding status flag of the data to a first value (such as 0), it indicates that the data is no longer hidden but is displayed in the shared application.
[0404] As described above, after the first electronic device joins the trust ring containing the second electronic device, the second electronic device synchronizes the spatial metadata of the fifth target workspace in the first shared application, as well as the material metadata of the first target shared file. Therefore, when the first electronic device leaves the trust ring, the second electronic device hides the material metadata of the fifth target workspace and the first target shared file.
[0405] S2005, the first electronic device rejoins the trust ring where the second electronic device is located.
[0406] In this embodiment, the first electronic device joins the trust ring, thus triggering a data synchronization event. Therefore, between S2005 and S2006, the first electronic device and the second electronic device can perform operations such as Bluetooth connection and creating a transmission channel (as described in this embodiment). Figure 20 (This part is not shown in the text), please refer to the above introduction for details, and the embodiments in this application will not be repeated.
[0407] Here, the first electronic device can send an eighth prompt message to the server. This eighth prompt message includes the device identifier of the first electronic device, which the server uses to prompt the second electronic device to display the data hidden in the first shared application within the second shared application, and also displays a fifth prompt message. The fifth prompt message indicates that the first and second electronic devices are synchronizing and sharing data.
[0408] S2006. The second electronic device displays data hidden in the first shared application in the second shared application, and the fifth prompt message is displayed in the second shared application.
[0409] After the second electronic device determines that the first electronic device has rejoined the trust ring, when the second electronic device sets the hiding status flag of the data in the first shared application that was hidden to the first electronic device to a first value (such as 0), it indicates that the data is no longer hidden, but is displayed in the second shared application.
[0410] Because the second electronic device did not delete the data of the first shared application when the first electronic device exited the trust ring, but only hid it, the second electronic device can quickly display the data of the first shared application in the second shared application when the first electronic device rejoins the trust ring. However, the second electronic device has not actually synchronized the data in the first shared application at this time. Therefore, the second electronic device displays a fifth prompt message in the second shared application to inform the user that the first and second electronic devices are synchronizing the data of the corresponding shared applications.
[0411] Referring to the description in S2002 above, after the first electronic device rejoins the trust ring where the second electronic device is located, the second shared application can display the spatial metadata of the fifth target workspace in the first shared application, as well as the material metadata of the first target shared file.
[0412] For example, the fourth prompt message may include any one of the following: loading, updating, data synchronization, etc.
[0413] Figure 21 The fourth illustration shows a data synchronization interface provided in an embodiment of this application.
[0414] like Figure 21 As shown in Figure A, phone G is within the trust ring, while phone H has exited the trust ring. Phone G's sharing application displays icon 411 for the first image. Phone H's sharing application displays icons 412 for the second image and 431 for the third image. The second image is the image saved in phone H's sharing application before phone H exited the trust ring. The third image is the image saved in phone H's sharing application after phone H exited the trust ring.
[0415] like Figure 21 As shown in B, after phone H rejoins the trust ring, the sharing application of phone G displays the icon 411 of the first image and the icon 412 of the second image, and the sharing application of phone G displays the fifth prompt message 2101. For example, the fifth prompt message could be "Loading".
[0416] S2007, The first electronic device and the second electronic device synchronize the data in the corresponding shared application.
[0417] This step may include the data synchronization step in any of the above embodiments. After this step, the first sharing application displays the icon 411 of the first image, the icon 412 of the second image, and the icon 431 of the third image. The second sharing application displays the icon 411 of the first image, the icon 412 of the second image, and the icon 431 of the third image.
[0418] like Figure 22 As shown in C, after mobile phones G and H have synchronized the data in their respective shared applications, mobile phone G displays the icon 411 of the first image, the icon 412 of the second image, and the icon 431 of the third image in its shared application. Mobile phone H displays the icon 411 of the first image, the icon 412 of the second image, and the icon 431 of the third image in its shared application.
[0419] In one embodiment, after the first electronic device rejoins the trust ring where the second electronic device is located, and before data synchronization between the first electronic device and the second electronic device is completed (i.e., S2006), in response to a refresh operation on the second shared application (such as pull-to-refresh), the second electronic device can display the time of the most recent data update of the second shared application in the second shared application.
[0420] Figure 22 The fifth illustration shows a data synchronization interface provided in an embodiment of this application.
[0421] like Figure 22 As shown in A, the sharing application on phone G displays the icon 411 of the first image and the icon 412 of the second image, and the sharing application on phone G also displays the fifth prompt message 2101. In response to the user's pull-down refresh operation of the sharing application on phone G, as shown... Figure 22 As shown in B, the data displayed on the sharing application interface of mobile phone G was updated on December 19, 2023 at 16:19.
[0422] In another embodiment, after data synchronization is completed between the first electronic device and the second electronic device, in response to a refresh operation (such as pull-to-refresh) on the second shared application, the second electronic device can display a synchronization completion notification in the second shared application. Similarly, after data synchronization is completed between the first electronic device and the second electronic device, in response to a refresh operation (such as pull-to-refresh) on the first shared application, the first electronic device can display a synchronization completion notification in the first shared application.
[0423] Furthermore, in this embodiment of the application, in order to ensure the reliability of data synchronization among various electronic devices within the trust ring, when a shared application of any electronic device within the trust ring is displayed in the foreground, if the time period since the most recent data synchronization exceeds a fifth preset time period (e.g., 72 hours), then the electronic device will perform a data synchronization with other devices within the trust ring. This data synchronization can be a full data synchronization.
[0424] It should be noted that this data synchronization will not affect other data synchronization processes that are currently being carried out between this electronic device and other electronic devices within the trust ring.
[0425] Furthermore, in this embodiment of the application, if the Bluetooth connection between the first electronic device and the second electronic device is successful, and the amount of data to be synchronized between the first electronic device and the second electronic device is small, the first electronic device and the second electronic device can directly synchronize the data via Bluetooth.
[0426] Furthermore, in this embodiment, when an electronic device triggers a data synchronization event, the electronic device needs to mount the shared files on its own device to the file nodes of other electronic devices within the trust ring as quickly as possible through the distributed file system. At this time, the other electronic devices within the trust ring only display links to the shared files of this electronic device; the other electronic devices do not actually store the shared files of this electronic device.
[0427] In other words, all shared files on each electronic device within the trust ring are mounted in the distributed file system of each device, allowing devices within the trust ring to access these shared files. Access can include non-download operations such as viewing and modifying, as well as download operations.
[0428] In one embodiment, if mounting fails, the electronic device that triggered the data synchronization event will check the mounting status and remount if the electronic device that triggered the data synchronization event displays the shared application in the foreground, refreshes the shared application, or uses a shared file from another electronic device within the trust ring (i.e., uses a shared file across devices).
[0429] Furthermore, in this embodiment of the application, if the fifth target shared file stored on an electronic device in the trust ring is deleted, or the fifth target shared file is no longer collected in the sharing application on the electronic device, but the event has not been synchronized to other electronic devices in the trust ring, when another electronic device in the trust ring accesses the fifth target shared file in its local sharing application, the distributed file system of the other electronic device will generate a sixth prompt message and display it in the shared files of the other electronic device to prompt the user that the fifth target shared file cannot be accessed.
[0430] The sixth prompt message could be: access failed, access is allowed, or the file to be accessed does not exist.
[0431] Figure 23 The seventh illustration shows a data synchronization interface provided in an embodiment of this application.
[0432] like Figure 23 As shown in Figure A, mobile phones G and H are in the same trust ring, and the sharing applications of mobile phones G and H have not yet completed data synchronization. Therefore, the metadata of the materials displayed in the sharing applications of mobile phones G and H are different. Specifically, the sharing application of mobile phone G displays icon 411 for the first image, icon 412 for the second image, and icon 431 for the third image. The sharing application of mobile phone H displays icon 411 for the first image and icon 412 for the second image. The first image is stored on mobile phone G, the second image is stored on mobile phone H, and the third image was originally stored on mobile phone H but has been deleted.
[0433] like Figure 23 As shown in B, in response to clicking the icon 431 of the third image in the sharing application of mobile phone G, the seventh prompt message 2301 is displayed in the sharing application of mobile phone G. For example, the seventh prompt message is "Access denied".
[0434] like Figure 24 As shown in the illustration, this application also provides a chip system. The chip system 2500 includes at least one processor 2501 and at least one interface circuit 2502. The at least one processor 2501 and the at least one interface circuit 2502 are interconnected via lines. The processor 2501 is used to support an electronic device in implementing the various steps in the above method embodiments, and the at least one interface circuit 2502 can be used to receive signals from other devices (e.g., memory) or to send signals to other devices (e.g., a communication interface). The chip system may include a chip and may also include other discrete devices.
[0435] This application also provides a computer storage medium including instructions that, when executed on the electronic device, cause the electronic device to perform the steps in the above method embodiments.
[0436] This application also provides a computer program product including instructions that, when executed on the electronic device, cause the electronic device to perform the steps in the method embodiments described above.
[0437] The technical effects of the chip system, computer storage medium, and computer program product are similar to those in the preceding method embodiments.
[0438] It should be understood that in the various embodiments of this application, the order of the above-mentioned processes does not imply 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 this application.
[0439] Those skilled in the art will recognize that the modules and algorithm steps of the various examples 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 implemented in hardware or software 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, but such implementation should not be considered beyond the scope of this application.
[0440] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and modules described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0441] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules or components may be combined or integrated into another device, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or modules may be electrical, mechanical, or other forms.
[0442] The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical modules; that is, they may be located on one device or distributed across multiple devices. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0443] In addition, the functional modules in the various embodiments of this application can be integrated into one device, or each module can exist physically separately, or two or more modules can be integrated into one device.
[0444] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software programs, implementation can be entirely or partially in the form of a computer program product. This computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer storage medium or transmitted from one computer storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer storage medium can be any available medium accessible to a computer or a data storage device including one or more servers, data centers, etc., that can be integrated with the medium. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state disk (SSD)).
[0445] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A data synchronization method, characterized in that, The method is applied to a first electronic device, wherein the first electronic device and at least one second electronic device are electronic devices within a trust ring, the first electronic device includes a first sharing application, the second electronic device includes a second sharing application, and the first and second sharing applications are used to display material metadata of shared files of each electronic device within the trust ring; the method includes: Display the material metadata of the first shared file in the first electronic device in the first sharing application; In response to a data synchronization event of the first electronic device, the first electronic device and the second electronic device synchronize and share data according to a first strategy supported by both the first and second sharing applications; wherein the shared data is data in the first sharing application and / or the second sharing application; the first strategy instructs one of the first and second electronic devices that meets a first preset condition to initiate a Bluetooth connection; the first strategy also instructs the timing for establishing a transmission channel, and the timing for one of the first and second electronic devices that meets a second preset condition to initiate the establishment of the transmission channel; wherein the first preset condition includes: a device identifier that is larger or smaller, determined based on a preset sorting rule; the second preset condition includes: the identifier of the peer device is at the head of the synchronization queue of the local device, or, there is data to be synchronized in the sharing application of the local device and the local device is in an idle state; the timing for establishing a transmission channel includes: the peer device is in an idle state; the first electronic device and the second electronic device are peer devices to each other; the transmission channel is used to synchronize the shared data; The first sharing application displays the material metadata of each second shared file in the second sharing application.
2. The method according to claim 1, characterized in that, The electronic device that triggers the data synchronization event includes any of the following: Electronic devices that are added to the trust ring, electronic devices whose data in shared applications within the trust ring is modified, electronic devices whose interfaces in shared applications within the trust ring are refreshed by pull-down, electronic devices whose shared applications within the trust ring are switched from the background to the foreground, and electronic devices that perform a cold start on shared applications within the trust ring.
3. The method according to claim 2, characterized in that, A shared application includes at least one workspace, each of which is used to display material metadata of shared files; The data modification in the shared application includes: the spatial metadata of any of the workspaces being modified, and / or the material metadata of any of the shared files being modified.
4. The method according to claim 3, characterized in that, The first electronic device and the second electronic device synchronously share data according to a first strategy supported by both the first sharing application and the second sharing application, including: The first electronic device and the second electronic device establish a Bluetooth connection based on the first preset conditions; When the Bluetooth connection is successful, the first electronic device and the second electronic device establish a transmission channel based on the timing of the transmission channel establishment and the second preset condition. The first electronic device and the second electronic device transmit the shared data based on the transmission channel.
5. The method according to claim 4, characterized in that, The first preset condition is that a Bluetooth connection is initiated by an electronic device with a small device identifier; The first electronic device and the second electronic device establish a Bluetooth connection based on the first preset conditions, including: Based on the fact that the first device identifier is less than the second device identifier, the first electronic device sends a Bluetooth connection request to the second electronic device; wherein, the first device identifier is the device identifier of the first electronic device, and the second device identifier is the device identifier of the second electronic device; Based on the Bluetooth connection request, the first electronic device establishes a Bluetooth connection with the second electronic device.
6. The method according to claim 4, characterized in that, The first preset condition is that a Bluetooth connection is initiated by an electronic device with a large device identifier; The first electronic device and the second electronic device establish a Bluetooth connection based on the first preset conditions, including: Based on the fact that the first device identifier is greater than the second device identifier, the first electronic device sends a Bluetooth connection request to the second electronic device; wherein, the first device identifier is the device identifier of the first electronic device, and the second device identifier is the device identifier of the second electronic device; Based on the Bluetooth connection request, the first electronic device establishes a Bluetooth connection with the second electronic device.
7. The method according to claim 5 or 6, characterized in that, Before the first electronic device sends a Bluetooth connection request to the second electronic device, the method further includes: The first electronic device receives the second device identifier sent by the second electronic device; The first electronic device compares the size relationship between the first device identifier and the second device identifier.
8. The method according to claim 4, characterized in that, The second preset condition is: there is data to be synchronized in the shared application of the local device and the local device is in an idle state; The establishment of a transmission channel between the first electronic device and the second electronic device based on the established transmission channel timing and the second preset condition includes: The first electronic device receives a transmission channel establishment request sent by the second electronic device; wherein, the electronic device that meets the second preset condition is the second electronic device, and the transmission channel is established when the first electronic device is in an idle state; before the first electronic device and the second electronic device synchronously share data, the second sharing application includes the first target data, and the first sharing application does not include the first target data; The first electronic device establishes a transmission channel with the second electronic device; the first target data is the shared data transmitted by the second electronic device to the first electronic device through the transmission channel.
9. The method according to claim 4, characterized in that, The second preset condition is: the identifier of the peer device is located at the head of the synchronization queue of the local device; The establishment of a transmission channel between the first electronic device and the second electronic device based on the established transmission channel timing and the second preset condition includes: The first electronic device sends a transmission channel establishment request to the second electronic device; wherein, the electronic device that meets the second preset condition is the first electronic device, and the transmission channel is established when the second shared application includes the first target data and the second electronic device is in an idle state; before the first electronic device and the second electronic device synchronously share data, the second shared application includes the first target data, and the first shared application does not include the first target data; The first electronic device establishes a transmission channel with the second electronic device; the first target data is the shared data transmitted by the second electronic device to the first electronic device through the transmission channel.
10. The method according to claim 8 or 9, characterized in that, The method further includes: before the first electronic device sends a second transmission channel establishment request to the second electronic device, the method further includes: Since the first electronic device is in a synchronization state, the first electronic device adds the device identifier of the second electronic device to the first synchronization queue.
11. The method according to claim 10, characterized in that, The method further includes: The first electronic device receives a first synchronization completion message sent by the second electronic device; wherein, the first synchronization completion message is generated by the second electronic device after the first sharing application and the second sharing application complete the synchronization of the shared data; the first synchronization completion message is used to instruct the first electronic device to set the synchronization status of the first electronic device to synchronization success, and the first synchronization completion message is also used to instruct the second electronic device to set the synchronization status of the second electronic device to synchronization success; The first electronic device sets the synchronization status to successful synchronization.
12. The method according to claim 11, characterized in that, Before the first electronic device and the second electronic device establish a transmission channel, the method further includes: The first electronic device receives a first feedback message sent by the second electronic device; wherein the first feedback message is used to indicate that the second sharing application includes the first target data, and the first sharing application does not include the first target data.
13. The method according to claim 4, characterized in that, The second preset condition is: there is data to be synchronized in the shared application of the local device and the local device is in an idle state; The establishment of a transmission channel between the first electronic device and the second electronic device based on the established transmission channel timing and the second preset condition includes: The first electronic device sends a transmission channel establishment request to the second electronic device; wherein, the electronic device that meets the second preset condition is the first electronic device, and the transmission channel is established when the first sharing application includes the second target data, the second sharing application does not include the first target data, and the second electronic device is in an idle state; before the first electronic device and the second electronic device synchronously share data, the first sharing application includes the second target data, the second sharing application does not include the second target data, the first sharing application does not include the first target data, and the second sharing application includes the first target data; The first electronic device establishes a transmission channel with the second electronic device; the second target data is the shared data transmitted by the first electronic device to the second electronic device in the transmission channel.
14. The method according to claim 8 or 13, characterized in that, The method further includes: Based on the successful establishment of the transmission channel, the first electronic device sets its current state to synchronization state.
15. The method according to claim 4, characterized in that, The second preset condition is: the identifier of the peer device is located at the head of the synchronization queue of the local device; The establishment of a transmission channel between the first electronic device and the second electronic device based on the established transmission channel timing and the second preset condition includes: The first electronic device receives a transmission channel establishment request sent by the second electronic device; wherein, the electronic device that meets the second preset condition is the second electronic device, and the transmission channel establishment timing is when the first sharing application includes the second target data, the second sharing application does not include the first target data, and the first electronic device is in an idle state; before the first electronic device and the second electronic device synchronously share data, the first sharing application includes the second target data, the second sharing application does not include the second target data, the first sharing application does not include the first target data, and the second sharing application includes the first target data; The first electronic device establishes a transmission channel with the second electronic device; the second target data is the shared data transmitted by the first electronic device to the second electronic device in the transmission channel.
16. The method according to claim 13 or 15, characterized in that, The method further includes: The first electronic device sends a second synchronization completion message to the second electronic device; wherein, the second synchronization completion message is generated by the first electronic device after the first sharing application and the second sharing application have completed the synchronization of the shared data; the second synchronization completion message is used to instruct the first electronic device to set the synchronization status of the first electronic device to synchronization success, and the second synchronization completion message is also used to instruct the second electronic device to set the synchronization status of the second electronic device to synchronization success; The first electronic device sets the synchronization status to successful synchronization.
17. The method according to claim 16, characterized in that, Before the first electronic device and the second electronic device establish a transmission channel, the method further includes: The first electronic device receives a second negotiation message sent by the second electronic device; wherein the second negotiation message is used to instruct the first electronic device to determine whether the second target data exists in the first sharing application; the second negotiation message includes: the current state of the second electronic device, and a second historical timestamp when the second sharing application last synchronized data from the first sharing application; the current state includes an idle state and a synchronization state; the second negotiation message is generated by the second electronic device when it determines that the second sharing application does not include the first target data.
18. The method according to claim 17, characterized in that, The method further includes: The first electronic device sends a first negotiation message to the second electronic device; wherein, the first negotiation message is used to instruct the second electronic device to determine whether the first target data exists in the second sharing application; the first negotiation message includes a first historical timestamp when the first sharing application last synchronized data from the second sharing application, and the current state of the first electronic device; the current state is an idle state or a synchronization state.
19. The method according to claim 4, characterized in that, The method further includes: In the event of a Bluetooth connection failure, the first electronic device sends a transmission channel establishment request to the second electronic device. The first electronic device establishes a transmission channel with the second electronic device; all data in the first shared application and all data in the second shared application are the shared data transmitted through the transmission channel.
20. The method according to any one of claims 1-6, characterized in that, The method further includes: In response to a data synchronization event of the first electronic device, the first electronic device and the second electronic device synchronize the shared data according to a second strategy; wherein the second strategy is a strategy supported by the first sharing application and / or the second sharing application, and the second strategy is a historical strategy of the first strategy; the second strategy indicates that the first electronic device and the second electronic device directly synchronize the shared data.
21. The method according to claim 20, characterized in that, The first electronic device and the second electronic device synchronize the shared data according to the second strategy, including: The first electronic device sends a transmission channel request to the second electronic device; The first electronic device establishes a transmission channel with the second electronic device; The first electronic device and the second electronic device transmit the shared data based on the transmission channel.
22. The method according to any one of claims 1-6, characterized in that, The method further includes: The first electronic device obtains the version number of the second shared application; The first electronic device determines that the shared data is synchronized with the second electronic device according to the first strategy if the version numbers of the first and second shared applications are the same; otherwise, it determines that the shared data is synchronized with the second electronic device according to the second strategy.
23. The method according to claim 22, characterized in that, The first electronic device obtains the version number of the second shared application, including: The first electronic device receives the version number of the second shared application sent by the second electronic device; or, The first electronic device receives the version number of the second shared application sent by the server.
24. The method according to claim 23, characterized in that, Before the first electronic device receives the version number of the second shared application sent by the server, the method further includes: The first electronic device sends query information to the server; wherein the query information is used to query the version number of the second shared application, and the query information includes the device identifier of the second electronic device.
25. The method according to any one of claims 1-6, characterized in that, Before the first electronic device and the second electronic device synchronize the shared data, the method further includes: In response to a deletion operation on the first data in the first sharing application, the first electronic device deletes the first data from the first sharing application; wherein the first data may be third target data in the first sharing application, or the first data may be fifth target data synchronized by the first sharing application from the second sharing application; The first electronic device sets the existence status identifier of the first data to a second value to obtain the second data; wherein, the second data is the shared data, and the second data is used to instruct the second electronic device to delete the first data from the second shared application.
26. The method according to claim 25, characterized in that, The first data is the fifth target data, and the method further includes: The first electronic device receives a second or third prompt message sent by the second electronic device; wherein the second prompt message is used to indicate that the fifth target data was successfully deleted, and the third prompt message is used to indicate that the fifth target data was deleted unsuccessfully. The first electronic device displays the second prompt message or the third prompt message in the first sharing application.
27. The method according to any one of claims 1-6, characterized in that, After the first electronic device exits the trust ring, the method further includes: The first electronic device sends a fourth prompt message to the server; wherein, the fourth prompt message includes the device identifier of the first electronic device, and the fourth prompt message is used by the server to prompt the second electronic device to hide the data in the first shared application in the second shared application.
28. The method according to claim 27, characterized in that, After the first electronic device rejoins the trust ring, the method further includes: The first electronic device sends an eighth prompt message to the server; wherein the eighth prompt message includes the device identifier of the first electronic device, and is used by the server to prompt the second electronic device to display the data in the first shared application that is hidden in the second shared application, and to display a fifth prompt message; the fifth prompt message is used to prompt the first electronic device and the second electronic device to synchronize the shared data.
29. An electronic device, characterized in that, It includes a processor and a memory, wherein instructions are stored in the memory, and when the processor executes the instructions, the method as described in any one of claims 1-28 is performed.
30. A computer-readable storage medium, characterized in that, Includes instructions that, when executed on an electronic device, cause the electronic device to perform the method as described in any one of claims 1-28.