Data synchronization method and electronic equipment

By adopting a unified strategy between electronic devices in the trust ring, the problem of conflicts in the timing of the transmission channel being occupied and synchronization is solved, the success rate of data synchronization is improved, and the user experience is improved.

CN120282254AActive Publication Date: 2025-07-08HONOR DEVICE CO LTD
View PDF 10 Cites 0 Cited by

Patent Information

Application Number
CN202311873943.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-12-30
Publication Date
2025-07-08
Estimated Expiration
2043-12-30

AI Technical Summary

Technical Problem

When multiple electronic devices in the trust ring synchronize data in the application, the data synchronization success rate may be low due to reasons such as the occupation of the transmission channel and synchronization timing conflict, which will affect the user experience.

Method used

By using a unified strategy between electronic devices in the trust ring, the Bluetooth connection and transmission channel establishment is ensured, so as to avoid conflicts and achieve orderly data synchronization.

Benefits of technology

It improves the success rate of data synchronization between electronic devices in the trust ring, ensures that all shared applications of devices can synchronize data and improve user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120282254A_ABST
    Figure CN120282254A_ABST
Patent Text Reader

Abstract

The invention discloses a data synchronization method and electronic equipment, relates to the field of data synchronization, and is used for improving the success rate of data synchronization when sharing data is synchronized between electronic equipment in a trust ring. For example, a first electronic device in a trust ring comprises a first shared application, and a second electronic device comprises a second shared application, the method comprises the following steps: 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 shared application and the second shared application, and displaying the data in all the shared applications in each shared application. Wherein the first strategy indicates the opportunity of initiating Bluetooth connection and establishing a transmission channel at one end of the two pieces of electronic equipment, the equipment identifier of which meets a first preset condition, and the opportunity of initiating establishment of a transmission channel for synchronizing shared data at one end of the two pieces of electronic equipment, which meets a second preset condition. The shared data is data in the first shared application and / or the second shared application.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present application relate to the field of data synchronization, and in particular, to a data synchronization method and an electronic device. Background Art

[0002] At present, when multiple electronic devices in a trust ring synchronize data in a shared application, due to reasons such as the occupied transmission channel and the conflict of synchronization timing, the shared applications of some electronic devices in the trust ring may not be able to synchronize the data in the shared applications of other electronic devices, that is, the success rate of data synchronization is relatively low, affecting the user experience. Summary of the Invention

[0003] Embodiments of the present application provide a data synchronization method and an electronic device, which are used to improve the success rate of data synchronization when synchronizing shared data between electronic devices in a trust ring.

[0004] To achieve the above object, the embodiments of the present application adopt the following technical solutions:

[0005] In a first aspect, a data synchronization method is provided, which is applied to a first electronic device. The first electronic device and at least one second electronic device are electronic devices in a trust ring. The first electronic device includes a first shared application, and the second electronic device includes a second shared application. The first shared application and the second shared application are used to display the material metadata of the shared files of each electronic device in the trust ring. The method may include: First, the first electronic device displays the material metadata of the first shared file in the first shared application. Then, in response to the data synchronization event of the first electronic device, the first electronic device and the second electronic device synchronize the shared data according to a first policy supported by both the first shared application and the second shared application. Finally, the first electronic device displays the material metadata of the second shared file in each second shared application in the first shared application.

[0006] The shared data is the data in the first shared application and / or the second shared application. On the one hand, the first policy indicates that the end of the device identifier in the first electronic device and the second electronic device that meets the first preset condition initiates a Bluetooth connection. On the other hand, the first policy also indicates the timing of establishing a transmission channel, and the end of the first electronic device and the second electronic device that meets the second preset condition initiates to establish a transmission channel. The transmission channel is used to synchronize the shared data.

[0007] As can be seen from the above, before the electronic devices within the trust ring synchronize the data in the shared applications, each electronic device will synchronize the data (i.e., shared data) in at least one shared application according to the first policy supported by all the shared applications in each electronic device, so that all the data in all the shared applications within the trust ring is displayed in each shared application. On the one hand, the first policy can instruct one end of any two electronic devices within the trust ring whose device identifiers meet the first preset condition to initiate a Bluetooth connection. In this way, no conflict will occur when any two electronic devices establish a Bluetooth connection, improving the success rate of Bluetooth connection. On the other hand, the first policy can indicate the timing for any two electronic devices to establish a transmission channel, and one end of any two electronic devices that meets the second preset condition initiates the establishment of a transmission channel for transmitting shared data. In this way, no conflict will occur when any two electronic devices establish a transmission channel, improving the success rate of establishing a transmission channel. Based on this, when any two electronic devices synchronize shared data, situations such as the occupation of the transmission channel and conflict in synchronization timing can be avoided, enabling the data synchronization process to proceed in an orderly manner one by one. As a result, the shared applications of any electronic device within the trust ring can synchronize the data in the shared applications of other electronic devices within the trust ring, improving the success rate of data synchronization of the electronic devices within the trust ring and enhancing the user experience.

[0008] In a possible implementation manner of the first aspect, the electronic device that triggers the data synchronization event includes any one of the following:

[0009] An electronic device that joins the trust ring, an electronic device whose data in the shared application within the trust ring is modified, an electronic device whose interface of the shared application within the trust ring is pulled down and refreshed, an electronic device that switches the shared application within the trust ring from the background to the foreground, and an electronic device that cold-starts the shared application within the trust ring.

[0010] In another possible implementation manner of the first aspect, a shared application includes at least one workspace, and each workspace is used to display the material metadata of the shared file. The modification of the data in the above-mentioned shared application includes: the spatial metadata of any workspace is modified, and / or, the material metadata of any shared file is modified.

[0011] In another possible implementation manner of the first aspect, the first electronic device and the second electronic device synchronize the shared data according to the first policy supported by the first shared application and the second shared application, including: First, the first electronic device and the second electronic device establish a Bluetooth connection based on the first preset condition; then, in the case of successful Bluetooth connection, 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; finally, the first electronic device and the second electronic device transmit the shared data based on the transmission channel.

[0012] In another possible implementation of the first aspect, the above first preset condition is that the electronic device with a smaller device identifier initiates a Bluetooth connection. The first electronic device and the second electronic device establish a Bluetooth connection based on the first preset condition, including: First, based on the first device identifier being 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 above first preset condition is that the electronic device with a larger device identifier initiates a Bluetooth connection. The first electronic device and the second electronic device establish a Bluetooth connection based on the first preset condition, including: First, based on the first device identifier being larger 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: First, the first electronic device receives the 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, 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.

[0018] Wherein, the first target data is the shared data transmitted through the transmission channel. The electronic device that meets the second preset condition is the second electronic device, and the second preset condition includes: There is first target data in the second shared application to be synchronized to the first shared application, and the second electronic device is in an idle state. The transmission channel establishment timing is that the first electronic device is in an idle state. Before the first electronic device and the second electronic device synchronize the shared data, the second shared application includes the first target data, and the first shared application does not include the first target data.

[0019] 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 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] Among them, the first target data is the 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 at the head of the first synchronization queue of the first electronic device. The transmission channel establishment timing is that 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 synchronize the shared data, the second shared application includes the first target data and the first shared application does not include the first target data.

[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 the first synchronization queue.

[0022] In another possible implementation of the first aspect, the method further includes: First, the first electronic device receives a first synchronization completion message sent by the second electronic device; then, the first electronic device sets the synchronization state to synchronization success.

[0023] Among them, the first synchronization completion message is generated by the second electronic device after the first shared application and the second shared 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 state 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 state of the second electronic device to synchronization success.

[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 receives a first feedback message sent by the second electronic device. Among them, the first feedback message is used to indicate that the second shared application includes the first target data and the first shared application does not include the first target data.

[0025] 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 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] Among them, the second target data is 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 shared application, and the first electronic device is in an idle state. The timing for establishing the transmission channel is when the second target data is included in the first shared application, the first target data is not 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 the shared 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.

[0027] In another possible implementation manner of the first aspect, the method further includes: based on the successful establishment of the transmission channel, the first electronic device sets its current state to the synchronization state.

[0028] In another possible implementation manner of the first aspect, based on the timing for establishing the transmission channel 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] Among them, 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 at the head of the second synchronization queue of the second electronic device. The timing for establishing the transmission channel is: the timing for establishing the transmission channel is when the second target data is included in the first shared application, the first target data is not included in the second shared application, and the first electronic device is in an idle state. Before the first electronic device and the second electronic device synchronize the shared 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 the synchronization state, the second electronic device adds the device identifier of the first electronic device to the second synchronization queue. The second target data is shared data transmitted in the transmission channel.

[0030] In another possible implementation manner of the first aspect, the method further includes: First, the first electronic device sends a second synchronization completion message to the second electronic device; then, the first electronic device sets the synchronization state to synchronization success.

[0031] Among them, the second synchronization completion message is generated by the first electronic device after the first shared application and the second shared 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 state 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 state of the second electronic device to synchronization success.

[0032] 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 receives a second negotiation message sent by the second electronic device.

[0033] Wherein, the second negotiation message is used to instruct the first electronic device to determine whether there is second target data in the first shared application. The second negotiation message includes: the current state of the second electronic device, and the second historical timestamp when the second shared application last synchronized data from the first shared 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 shared application does not include the first target data.

[0034] In another possible implementation of the first aspect, the method further includes: the first electronic device sends a first negotiation message to the second electronic device.

[0035] Wherein, the first negotiation message is used to instruct the second electronic device to determine whether there is first target data in the second shared application. The first negotiation message includes the first historical timestamp when the first shared application last synchronized data from the second shared application, and the current state of the first electronic device. The current state is an idle state or a synchronization state.

[0036] In another possible implementation of the first aspect, the method further includes: first, when the Bluetooth connection fails, 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 synchronize shared data according to a second policy.

[0038] Wherein, the second policy is a policy supported by the first shared application and / or the second shared application, and the second policy is a historical policy of the first policy. The second policy instructs the first electronic device and the second electronic device to directly synchronize shared data.

[0039] In another possible implementation of the first aspect, the first electronic device and the second electronic device synchronize shared data according to the second policy, 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; 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: First, 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 shared application and the second shared application are the same, the first electronic device determines that the first electronic device and the second electronic device synchronize shared data according to the first policy; otherwise, it determines that the first electronic device and the second electronic device synchronize shared data according to the second policy.

[0041] In another possible implementation of the first aspect, the first electronic device obtaining the version number of the second shared application includes: 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.

[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 sends query information to the server.

[0043] Wherein, the query information is used to query the version number of the second shared application, and the device identifier of the second electronic device is included in the query information.

[0044] In another possible implementation of the first aspect, before the first electronic device and the second electronic device synchronize shared data, the method further includes: First, in response to a deletion operation on the first data in the first shared application, the first electronic device deletes the first data from the first shared application; then, the first electronic device sets the existence status identifier of the first data to a second value to obtain second data;

[0045] Wherein, 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 shared application. The first data may be the third target data in the first shared application, or the first data is the fifth target data synchronized by the first shared application from the second shared application.

[0046] In another possible implementation of the first aspect, the first data is the fifth target data. The method further includes: First, the first electronic device receives the second prompt message or the third prompt message sent by the second electronic device; then, the first electronic device displays the second prompt message or the third prompt message in the first shared application.

[0047] Wherein, the second prompt message is used to prompt that the deletion of the fifth target data is successful, and the third prompt message is used to prompt that the deletion of the fifth target data fails.

[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 sends a fourth prompt message to the server.

[0049] Among them, the fourth prompt message includes the device identifier of the first electronic device. The fourth prompt message is used for the server to prompt the second electronic device to hide the data in the first shared application in the second shared application.

[0050] In another possible implementation manner of the first aspect, after the first electronic device rejoins the trust ring again, the method further includes: the first electronic device sends an eighth prompt message to the server.

[0051] Among them, the eighth prompt message includes the device identifier of the first electronic device. The sixth prompt message is used for the server to prompt the second electronic device to display the hidden data in the first shared application in the second shared application, and display the fifth prompt message. The fifth prompt message is used to prompt that the first electronic device and the second electronic device are synchronizing the shared data.

[0052] In a second aspect, an electronic device is provided, including: a processor and a memory; instructions are stored in the memory, and when the processor executes the instructions, the method as described in the first aspect and any of its embodiments is executed.

[0053] In a third aspect, a computer-readable storage medium is provided, including instructions, and when the instructions are executed on an electronic device, the electronic device can execute the method as described in the first aspect and any of its embodiments.

[0054] In a fourth aspect, a computer program product containing instructions is provided, and when the instructions run on the above-mentioned electronic device, the electronic device executes the method as described in the first aspect and any of its embodiments.

[0055] In a fifth aspect, a chip system is provided. The chip system includes a processor for supporting the electronic device to implement the functions involved in the first aspect. In a possible design, the electronic device further includes an interface circuit, and the interface circuit can be used to receive signals from other devices (such as a memory), or send signals to other devices (such as a communication interface). The chip system may include chips and may also include other discrete devices.

[0056] Among them, for the technical effects of the second aspect to the fifth aspect, reference can be made to the technical effects of the first aspect and any of its embodiments, which will not be elaborated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0057] Figure 1 It is a schematic structural diagram of a communication system provided by an embodiment of the present application;

[0058] Figure 2 It is a schematic hardware structure diagram of an electronic device provided by an embodiment of the present application;

[0059] Figure 3 Schematic diagram of the software architecture of a communication system provided by an embodiment of the present application;

[0060] Figure 4 Schematic diagram of an interface for data synchronization in conventional technology;

[0061] Figure 5 One of the schematic diagrams of an interface for data synchronization provided by an embodiment of the present application;

[0062] Figure 6 One of the schematic diagrams of the process of a data synchronization method provided by an embodiment of the present application;

[0063] Figure 7 Two of the schematic diagrams of the process of a data synchronization method provided by an embodiment of the present application;

[0064] Figure 8 Three of the schematic diagrams of the process of a data synchronization method provided by an embodiment of the present application;

[0065] Figure 9 Four of the schematic diagrams of the process of a data synchronization method provided by an embodiment of the present application;

[0066] Figure 10 Five of the schematic diagrams of the process of a data synchronization method provided by an embodiment of the present application;

[0067] Figure 11 Six of the schematic diagrams of the process of a data synchronization method provided by an embodiment of the present application;

[0068] Figure 12 Seven of the schematic diagrams of the process of a data synchronization method provided by an embodiment of the present application;

[0069] Figure 13 Eight of the schematic diagrams of the process of a data synchronization method provided by an embodiment of the present application;

[0070] Figure 14 Nine of the schematic diagrams of the process of a data synchronization method provided by an embodiment of the present application;

[0071] Figure 15 Two of the schematic diagrams of an interface for data synchronization provided by an embodiment of the present application;

[0072] Figure 16 Ten of the schematic diagrams of the process of a data synchronization method provided by an embodiment of the present application;

[0073] Figure 17 Three of the schematic diagrams of an interface for data synchronization provided by an embodiment of the present application;

[0074] Figure 18Schematic diagram of the eleventh data synchronization method provided by an embodiment of the present application;

[0075] Figure 19 Schematic diagram of the fourth interface for data synchronization provided by an embodiment of the present application;

[0076] Figure 20 Schematic diagram of the twelfth data synchronization method provided by an embodiment of the present application;

[0077] Figure 21 Schematic diagram of the fifth interface for data synchronization provided by an embodiment of the present application;

[0078] Figure 22 Schematic diagram of the sixth interface for data synchronization provided by an embodiment of the present application;

[0079] Figure 23 Schematic diagram of the seventh interface for data synchronization provided by an embodiment of the present application;

[0080] Figure 24 Schematic diagram of the structure of a chip system provided by an embodiment of the present application. Detailed implementation manners

[0081] Terms such as "first" and "second" involved in embodiments of the present application are only used for the purpose of distinguishing features of the same type and should not be construed as indicating relative importance, quantity, order, etc.

[0082] Terms such as "exemplary" or "for example" involved in embodiments of the present application are used to represent examples, illustrations or explanations. Any embodiment or design solution described as "exemplary" or "for example" in the present application should not be construed as being more preferred or having more advantages than other embodiments or design solutions. Exactly speaking, using terms such as "exemplary" or "for example" aims to present relevant concepts in a specific manner.

[0083] Terms such as "coupled" and "connected" involved in embodiments of the present application should be understood in a broad sense. For example, it may refer to a direct physical connection or an indirect connection realized through electronic devices, such as a connection realized through resistors, inductors, capacitors or other electronic devices.

[0084] First, some concepts involved in embodiments of the present application are introduced.

[0085] Magic ring: It is a technical solution based on the identity authentication system to achieve trusted interconnection of multiple devices across systems, enabling intelligent transfer and sharing of services among devices. The magic ring can include a far-field magic ring and a near-field magic ring. One account can correspond to one magic ring. When multiple electronic devices log in to the same account and the Bluetooth (BT) module and wireless fidelity (Wi-Fi) module of each electronic device are both turned on, they can join the same near-field magic ring. When multiple electronic devices log in to the same account and are in an Internet-connected state, they can join the same far-field magic ring. Electronic devices in the same magic ring can be automatically connected, and data such as incoming call messages, notification messages, documents, audio and video can be transferred among various electronic devices.

[0086] Global collection: It is an application (APP) with a collection (or collection) function on an electronic device. Users can drag files (or materials) to be collected on the electronic device (such as pictures, documents, texts, audio, videos, web pages, folders, etc.) into the global collection application for collection, so as to facilitate later access. The file entity of the file is not stored in the global collection application, but only the material metadata of the file is stored. When the global collection application is installed on each electronic device within the same magic ring, the material metadata of the files stored in the global collection application of any electronic device within the magic ring can be synchronized to the global collection applications of other electronic devices within the magic ring.

[0087] Metadata: (metadata), also known as mediation data and relay data, is data about data, mainly information describing the properties of data, used to support functions such as indicating storage location, historical data, resource search, file recording, etc. Metadata is a kind of electronic directory. In order to achieve the purpose of compiling the directory, it is necessary to describe and collect the content or characteristics of the data, so as to assist in data retrieval. The metadata involved in the embodiments of the present application may include the material metadata of files and the spatial metadata of workspaces. Among them, a workspace can be a display interface (or display page) in the global collection application.

[0088] The data synchronization method provided by the embodiments of the present application can be applied to Figure 1 the communication system shown in the figure. The communication system can be a near-field communication system or a far-field communication system. The near-field communication system can be a near-field magic ring composed of multiple electronic devices. The far-field communication system can be a far-field magic ring composed of multiple electronic devices. In this embodiment, the Figure 1 communication system shown in the figure is taken as an example of a near-field magic ring for introduction. Hereinafter, the near-field magic ring is simply referred to as the magic ring.

[0089] As shown Figure 1 in the figure, the trust ring may include a first electronic device 101 and at least one second electronic device 102. Data can be synchronized between the first electronic device 101 and the second electronic device 102, and data can also be synchronized between different second electronic devices 102. The first electronic device 101 and the second electronic device 102 can be of the same type of electronic device or different types of electronic devices. Each of the at least one second electronic devices 102 can be of the same type of electronic device or different types of electronic devices.

[0090] The electronic device involved in the embodiments of the present application can be a device with communication and display functions. The electronic device can be mobile or fixed. The electronic device can be deployed on land (such as indoors or outdoors, handheld or vehicle-mounted, etc.), can also be deployed on water (such as a ship, etc.), and can also be deployed in the air (such as an airplane, a balloon, etc.). This electronic device can be called a user equipment (UE), an access terminal, a terminal unit, a subscriber unit, a terminal station, a mobile station (MS), a mobile platform, a terminal agent, or a terminal device, etc. For example, this electronic device can be a mobile phone, a tablet computer, a laptop computer, etc. The embodiments of the present application do not limit the specific type and structure of the electronic device. A possible structure of the electronic device will be described below.

[0091] Taking the electronic device as a mobile phone as an example, Figure 2 FIG. shows a schematic hardware structure diagram of an electronic device 200 provided by the embodiments of the present application. As Figure 2 shown in the figure, 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 can be understood that the structure illustrated in the embodiments of the present application does not constitute a specific limitation on the electronic device 200. In other embodiments, the electronic device 200 may include more or fewer components than shown in the figure, or combine certain components, or split certain components, or have different component arrangements. The illustrated components can be implemented in hardware, software, or a combination of software and hardware.

[0093] The processor 210 may include one or more processing units. For example, the processor 210 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Among them, different processing units may be independent devices or integrated in one or more processors. The controller may be the nerve center and command center of the electronic device 200. The controller may generate operation control signals according to the instruction operation code and timing signals to complete the control of fetching and executing instructions.

[0094] A memory may also be provided in the processor 210 for storing instructions and data. In some embodiments, the memory in the processor 210 is a cache memory. This memory may save the instructions or data that the processor 210 has just used or recycled. If the processor 210 needs to use the instruction or data again, it can be directly called 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, the processor 210 may include one or more interfaces. The 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 can be understood that the interface connection relationships between the modules illustrated in the embodiments of the present application are only illustrative descriptions and do not constitute a structural limitation on the electronic device. In other embodiments, the electronic device may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.

[0097] The memory 220 may be used to store computer-executable program codes, and the executable program codes include 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. Among them, the program storage area may store an operating system and application programs required for at least one function (such as a sound playback function, an interface display function, etc.). The data storage area may store data created during the use of the electronic device (such as notification messages). In addition, the memory 220 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.

[0098] The power management module 240 is used to connect the battery to the processor 210. The power management module 240 receives battery and / or power input and supplies power to the processor 210, the memory 220, the communication module 250, the display screen 260, the display screen 260, and the camera 280, etc. The power management module 240 may also be used to monitor parameters such as battery capacity, battery cycle count, and battery health status (leakage, impedance). In some other embodiments, the power management module 240 may also be disposed in the processor 210.

[0099] The communication module 250 may provide solutions for wireless communications applied to the electronic device 200, including wireless local area networks (WLANs) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite systems (GNSSs), frequency modulation (FM), near field communication (NFC), infrared (IR), etc. The communication module 250 may 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 processing on the electromagnetic wave signals, and sends the processed signals to the processor 210. The communication module 250 may also receive signals to be sent from the processor 210, perform frequency modulation and amplification on them, and convert them into electromagnetic waves through the antenna for radiation.

[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 a network 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-Synchronous Code Division Multiple Access (TD-SCDMA), Long Term Evolution (LTE), Bluetooth (BT), Global Navigation Satellite System (GNSS), Wireless Local Area Network (WLAN), Near Field Communication (NFC), Frequency Modulation (FM), and / or Infrared (IR) technology, etc. The GNSS may include Global Positioning System (GPS), BeiDou Navigation Satellite System (BDS), Global Navigation Satellite System (GLONASS), and / or Galileo Satellite Navigation System (GALILEO).

[0101] The electronic device 200 implements the display function through a GPU, a display screen 260, and an application processor, etc. 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 for graphics rendering. The processor 210 may include one or more GPUs, which execute program instructions to generate or change 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 Micro-OLED, a quantum dot light-emitting diode (QLED), etc. In the embodiments of the present application, the display screen 260 can be used to display the material metadata of shared files in a shared application. For example, the display screen 260 can display the icon (such as a thumbnail) of a shared file (such as a picture) in a shared application.

[0103] The electronic device 200 can implement the shooting function through an ISP, a camera 280, a video codec, a GPU, a display screen 260, an application processor, etc.

[0104] The audio module 270 is used to convert digital audio information into an analog audio signal for output, and is also used to convert an analog audio input into a digital audio signal. The audio module 270 can also be used to encode and decode audio signals. In some embodiments, the audio module 270 can be disposed in the processor 210, or some functional modules of the audio module 270 can be disposed in the processor 210.

[0105] The camera 280 is used to capture still images or videos. An object generates an optical image through a lens and projects it onto a photosensitive element. The photosensitive element can be a charge-coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then transmits the electrical signal to the ISP to convert it into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV, etc. format.

[0106] It can be understood that generally speaking, the realization of the functions of an electronic device requires the cooperation of software in addition to the support of hardware.

[0107] The software system of an electronic device can adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservices architecture, or a cloud architecture. In the embodiments of this application, Android with a layered architecture is taken as an example to exemplarily illustrate the software structure of the electronic device in the above communication system. For example, it exemplarily illustrates the software structure of the electronic device in the above communication system.

[0108] Figure 3 It is a schematic diagram of the software architecture of a communication system provided by the embodiments of this application.

[0109] The layered architecture divides the software into several layers, and each layer has a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, Android is divided into four layers, from top to bottom, namely the application layer, the application framework layer, the middle layer, and the hardware layer. For example, it is divided into four layers, from top to bottom, namely the application layer, the application framework layer, the middle layer, and the hardware layer.

[0110] The application layer may include a series of application packages. As shown, the application packages may include shared applications (the shared applications in the embodiments of this application may be global favorite applications), a distributed file system, Bluetooth, WLAN, and other applications. Figure 3 As shown, the application packages may include shared applications (the shared applications in the embodiments of this application may be global favorite applications), a distributed file system, Bluetooth, WLAN, and other applications.

[0111] Among them, the shared application can be used to collect the shared files in each electronic device in the communication system (i.e., the trust ring), and display the material metadata of the shared files in each electronic device. The shared file can be any file in any electronic device in the communication system (i.e., the trust ring).

[0112] In some embodiments, the application layer may further include a negotiation module. The negotiation module is used to perform Bluetooth connection negotiation between the electronic devices within the trust ring to establish a Bluetooth connection; or, perform Wi-Fi connection negotiation to establish a Wi-Fi connection. In this embodiment, the example of performing Bluetooth connection negotiation to establish a Bluetooth connection is introduced. The negotiation module is also used to perform data synchronization negotiation between the electronic devices within the trust ring, and is used to negotiate the timing of establishing a transmission channel, the initiating end of establishing a transmission channel, etc., so as to establish a transmission channel for synchronizing data.

[0113] The distributed file system can be used to store the storage paths of the shared files in each electronic device in the communication system, as well as the device identifiers of the electronic devices to which the shared files belong. The distributed file system is also used to transmit the file entities of the shared files.

[0114] The application framework layer provides application programming interfaces (APIs) and programming frameworks for the applications in the application layer. The application framework layer includes some predefined functions. Exemplarily, as Figure 3As shown in the figure, the application framework layer may include a window manager service (WMS), a view system, a file system, etc.

[0115] Among them, the window manager is used to manage window programs. The window manager can obtain the display screen size, determine whether there is a status bar, a locked screen, take screenshots, etc.

[0116] The view system may include visible controls, such as controls for displaying text, controls for displaying pictures, etc. The view system can be used to build application programs. A display interface can be composed of at least one view. For example, a display interface including a shared application may include a view for displaying text and a view for displaying pictures, etc.

[0117] The file system can be used to store file entities of all files of this electronic device, storage paths of all files, and the device identifier of this electronic device. That is to say, the file system of an electronic device stores file entities and storage paths of shared files collected in the shared applications of this electronic device.

[0118] The middle layer may include a device manager, a channel manager, etc.

[0119] Among them, the device manager is used to store the device identifier of this electronic device and is also used to obtain the device identifiers of other electronic devices in the trust ring.

[0120] The channel manager is used to obtain the device identifiers of other electronic devices in the trust ring from the device manager, and after joining the trust ring, create a transmission channel with other electronic devices in the trust ring, such as a near-field transmission channel (magic link). The transmission channel is used to transmit spatial metadata of the workspace in the shared application, material metadata of the shared files in the shared application, and the file entities of the shared files to the communication module of the hardware layer, and then send them to other electronic devices within the trust ring through the communication module of the hardware layer; the near-field transmission channel is also used to receive spatial metadata of the workspace in the shared application, material metadata of the shared files in the shared application, and the file entities of the shared files in other electronic devices from the communication module and transmit them upward to the application layer.

[0121] In some embodiments, the middle layer may include a negotiation module.

[0122] In summary, the negotiation module may be included in both the application layer and the middle layer, or the negotiation module may be included in the application layer, or the negotiation module may be included in the middle layer.

[0123] Figure 1In each of the electronic devices included in the shown communication system (or trust ring), a shared application (such as a global collection application) is installed. The shared application may include at least one workspace for collecting shared files and can display the material metadata of the shared files. The data in the shared applications of each electronic device within the trust ring can be synchronized with each other, so that the data in each shared application within the trust ring can be displayed in the shared application of any electronic device within the trust ring. In this way, the data in the shared applications of all electronic devices within the trust ring can be viewed on any electronic device within the trust ring.

[0124] Among them, the data of the shared application may include: the spatial metadata of each workspace in the shared application, and the material metadata of each shared file in the workspace. The spatial metadata of the workspace can be used to indicate the attributes of the workspace, and the material metadata of the shared file is used to indicate the attributes of the shared file. One workspace of the shared application can correspond to one display interface of the shared application. A shared file is a file stored in an electronic device and collected in the shared application of the electronic device. The types of shared files may include, but are not limited to, at least one of pictures, videos, audios, documents, folders, texts, and web pages.

[0125] Currently, when multiple electronic devices within the trust ring synchronize the data in the shared application, due to reasons such as the transmission channel being occupied and the synchronization timing conflicts, the shared applications of some electronic devices within the trust ring may not be able to synchronize the data in the shared applications of other electronic devices, that is, the data synchronization success rate is relatively low, affecting the user experience. Among them, the situation of synchronization timing conflicts may include, but is not limited to: two electronic devices synchronize data with one electronic device at the same time, resulting in the transmission channel being occupied. The situation where an electronic device occupies the transmission channel may also include that the electronic device occupies the transmission channel to perform other data transmission services. Below, the case where two electronic devices synchronize data with one electronic device at the same time is taken as an example for introduction.

[0126] Figure 4 A schematic diagram of an interface for data synchronization in the conventional technology is shown.

[0127] In one scenario, the first electronic device (such as tablet computer C) is to join the trust ring, and two second electronic devices (such as mobile phone A and mobile phone B respectively) have joined the same trust ring, and the shared file is a picture. Below, in combination with Figure 4 , the introduction of the synchronization of the material metadata of the pictures in the shared application among the various electronic devices within the trust ring is carried out.

[0128] As Figure 4As shown by A in [figure], mobile phone A and mobile phone B are within the same trust ring, and tablet computer C has not joined this trust ring. The main interface of mobile phone A displays a first floating window 410. In the first floating window 410, the icon 411 of the first picture and the icon 412 of the second picture collected in the shared application of mobile phone A are displayed. The main interface of mobile phone B displays a second floating window 420. In the second floating window 420, the icon 411 of the first picture and the icon 412 of the second picture collected in the shared application of mobile phone B are displayed. The main interface of tablet computer C displays a third floating window 430. In the third floating window 430, the icon 431 of the third picture collected in the shared application of tablet computer C is displayed.

[0129] It can be seen that the pictures collected in the shared application of mobile phone A within the same trust ring are the same as those collected in the shared application of mobile phone B, but different from those collected in the shared application of tablet computer C that has not joined this trust ring.

[0130] As Figure 4 shown by B in [figure], after tablet computer C joins the trust ring, the data in the corresponding shared applications are synchronized among mobile phone A, mobile phone B, and tablet computer C. However, since mobile phone A and mobile phone B synchronize data with tablet computer C simultaneously, the icon 411 of the first picture, the icon 412 of the second picture, and the icon 431 of the third picture are displayed in the shared application of mobile phone A; the icon 411 of the first picture, the icon 412 of the second picture, and the icon 431 of the third picture are displayed in the shared application of mobile phone B; and the icon 431 of the third picture is displayed in the shared application of tablet computer C. That is to say, the pictures collected in the shared application of mobile phone A and the pictures collected in the shared application of mobile phone B are not synchronized to the shared application of tablet computer C.

[0131] In summary, in the conventional technology, during the process of synchronizing the data in the shared applications among the electronic devices within the trust ring, the success rate of data synchronization is relatively low.

[0132] It should be noted that in the figures in this article (such as Figure 4 ), the trust ring is represented by a dotted line box. The mobile phones within the dotted line box indicate the mobile phones that have joined the trust ring; the mobile phones not within the dotted line box indicate the mobile phones that have not joined the trust ring or the mobile phones that have joined the trust ring.

[0133] To this end, the embodiments of the present application provide a data synchronization method. Before synchronizing the data in the shared application within the trust ring, each electronic device in the trust ring will synchronize the data (i.e., shared data) in at least one shared application according to the first policy supported by all the shared applications in each electronic device, so that all the data in all the shared applications within the trust ring are displayed in each shared application. On the one hand, the first policy can instruct one end of any two electronic devices within the trust ring whose device identifiers meet the first preset condition to initiate a Bluetooth connection. In this way, no conflict will occur when any two electronic devices establish a Bluetooth connection, improving the success rate of Bluetooth connection. On the other hand, the first policy can instruct the timing for any two electronic devices to establish a transmission channel, and one end of any two electronic devices that meets the second preset condition to initiate the establishment of a transmission channel for transmitting shared data. In this way, no conflict will occur when any two electronic devices establish a transmission channel, improving the success rate of establishing a transmission channel. Based on this, when any two electronic devices synchronize shared data, situations such as the occupation of the transmission channel and conflict in synchronization timing can be avoided, enabling the data synchronization process to proceed orderly in sequence. As a result, the shared application of any electronic device within the trust ring can synchronize the data in the shared applications of other electronic devices within the trust ring, improving the success rate of data synchronization of the electronic devices within the trust ring and enhancing the user experience.

[0134] Figure 5 Fig. 4 shows one of the schematic diagrams of the interface for data synchronization provided by the embodiments of the present application.

[0135] As Figure 5 shown in A of Fig. 4, mobile phone A and mobile phone B are within the same trust ring, and tablet computer C has not joined this trust ring. The main interface of mobile phone A displays the first floating window 410. The icon 411 of the first picture and the icon 412 of the second picture collected in the shared application of mobile phone A are displayed in the first floating window 410. The main interface of mobile phone B displays the second floating window 420. The icon 411 of the first picture and the icon 412 of the second picture collected in the shared application of mobile phone B are displayed in the second floating window 420. The main interface of tablet computer C displays the third floating window 430. The icon 431 of the third picture collected in the shared application of tablet computer C is displayed in the third floating window 430.

[0136] As Figure 5As shown in B of [0], after the tablet computer C joins the trust ring, the data in the shared applications of the mobile phone A, the mobile phone B, and the tablet computer C are synchronized with each other. At this time, the icons 411 of the first picture, the icons 412 of the second picture, and the icons 431 of the third picture are sequentially displayed in the shared application of the mobile phone A; the icons 411 of the first picture, the icons 412 of the second picture, and the icons 431 of the third picture are sequentially displayed in the shared application of the mobile phone B; the icons 411 of the first picture, the icons 412 of the second picture, and the icons 431 of the third picture are sequentially displayed in the shared application of the tablet computer C.

[0137] It can be seen that for the electronic devices provided in the embodiments of the present application, when in the same trust ring, the shared files displayed in the shared applications of each electronic device are the same, and the sorting of the shared files is the same.

[0138] It should be noted that the relevant interfaces of the shared application provided in the embodiments of the present application are not limited to the interfaces shown in the figures in the embodiments of the present application.

[0139] The following combines Figures 6 - 24 to introduce the data synchronization method provided in the embodiments of the present application.

[0140] Figure 6 FIG. shows one of the schematic flowcharts of a data synchronization method provided in the embodiments of the present application. As Figure 6 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 electronic device in the first shared application.

[0142] In each of the electronic devices involved in the embodiments of the present application, a shared application is installed. As Figure 5 shown in A of [0], before the electronic device (such as the tablet computer C) joins the trust ring, the shared application of the electronic device may only collect and store the shared files (such as pictures) in this electronic device. Therefore, the shared application of the electronic device may only display the material metadata of the shared files in this electronic device (such as the thumbnail of the picture). As Figure 5 shown in B of [0], after the electronic device (such as the tablet computer C) joins the trust ring, the shared application of the electronic device may collect and store the shared files in each electronic device within the trust ring. Therefore, the shared application of the electronic device may display the material metadata of the shared files in each electronic device within the trust ring.

[0143] For the sake of easy distinction, in the embodiments of the present 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] Based on this, before the first electronic device joins the trust ring, only the material metadata of the first shared file is displayed in the first shared application of the first electronic device. Similarly, before the second electronic device joins the trust ring, only the material metadata of the second shared file is displayed in the second shared application of the second electronic device.

[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 the first electronic device logs in to the account corresponding to the trust ring, it can join the trust ring where the second electronic device is located. In this way, the first electronic device can synchronize the data collected in the corresponding shared application with each electronic device in the trust ring.

[0147] Generally, when a device joins a trust ring or triggers other data synchronization events, the device will send an online message to the server corresponding to the trust ring. The online message may include the device identifier of the device. In this way, the server can broadcast the device identifier of the device to other devices in the trust ring.

[0148] The specific process of the first electronic device joining the trust ring where the second electronic device is located can refer to the introduction in the prior art and will not be elaborated herein.

[0149] After 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 the shared data according to the first policy supported by both the first shared application and the second shared application.

[0150] Among them, the above - mentioned shared data is the data in the first shared application and / or the second shared application. The first policy indicates that the end with the device identifier meeting the first preset condition in the first electronic device and the second electronic device initiates a Bluetooth connection. The first policy also indicates the timing of establishing a transmission channel, and the end meeting the second preset condition in the first electronic device and the second electronic device initiates the establishment of a transmission channel. The above - mentioned transmission channel is used to synchronize the shared data.

[0151] In one embodiment, the first electronic device is an electronic device that triggers a data synchronization event. The electronic device that triggers a data synchronization event may include any of the following electronic devices: an electronic device newly added to the trust ring, an electronic device that has joined the trust ring and the data in the shared application has changed (i.e., the data has been modified), an electronic device that has joined the trust ring and the shared application has been refreshed, an electronic device that has joined the trust ring and the shared application has been switched from the background to the foreground, and an electronic device that has joined the trust ring and cold-starts the shared application. Among them, the refreshing of the shared application may be that the display interface corresponding to a workspace of the shared application is pulled down for refreshing, but is not limited thereto.

[0152] In this embodiment, an example is given where the first electronic device is an electronic device newly added to the trust ring where the second electronic device is located. It should be understood that in other embodiments, the first electronic device may be an electronic device that triggers other data synchronization events. At this time, before the first electronic device and the second electronic device synchronize the data collected in the corresponding shared application with each other, the following steps may also be executed.

[0153] S603. The first electronic device and the second electronic device establish a Bluetooth connection based on a first preset condition.

[0154] The first electronic device and the second electronic device synchronize the shared data according to the synchronization policy supported by the first shared application, or the first electronic device and the second electronic device synchronize the shared data according to the synchronization policy supported by the second shared application. Different versions of the shared application support different synchronization policies.

[0155] In some embodiments, the versions of the first shared application and the second shared application are the same. Therefore, the synchronization policies supported by the first shared application and the second shared application are the same policy, such as the first policy or the second policy. At this time, the first electronic device and the second electronic device synchronize the shared data according to the first policy or the second policy.

[0156] Among them, the second policy is the historical policy of the first policy. The two electronic devices will negotiate during the process of synchronizing the shared data according to the first policy. The two electronic devices will not negotiate during the process of synchronizing the shared data according to the first policy. Among them, the negotiation may include Bluetooth connection negotiation and data synchronization negotiation.

[0157] In other embodiments, the first shared application or the second shared application supports different synchronization policies. For example, the first shared application supports the first policy and the second shared application supports the second policy. In order to be compatible with the historical version, the first electronic device and the second electronic device will synchronize the shared data according to the historical policy (i.e., the second policy).

[0158] In this embodiment, the first electronic device and the second electronic device synchronize and share data according to a first policy supported by both the first shared application and the second shared application. Among them, the first policy may instruct that the end with the device identifier meeting the first preset condition in the first electronic device and the second electronic device initiates a Bluetooth connection. That is to say, the first electronic device and the second electronic device will conduct Bluetooth connection negotiation during the process of synchronizing and sharing data, so as to establish a Bluetooth connection to transmit messages via Bluetooth.

[0159] Specifically, the first preset condition may be that the electronic device with a smaller device identifier initiates a Bluetooth connection, or the electronic device with a larger device identifier initiates a Bluetooth connection. Among them, the device identifier is the unique identification code (universally unique identifier, UUID) of the electronic device. Each electronic device within the trust ring has a different device identifier. Among them, the device identifier may include:

[0160] For the convenience of distinction, in the embodiments of the present 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, taking the first preset condition that the electronic device with a smaller device identifier initiates a Bluetooth connection as an example. Figure 7 FIG. 2 shows a second schematic flow diagram of a data synchronization method provided by the embodiments of the present application. As Figure 7 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 all different, the device identifiers of each electronic device within the trust ring have a size relationship.

[0166] S704. Based on the first device identifier being smaller 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 of the first electronic device and the second electronic device establishing a Bluetooth connection based on the Bluetooth connection request can refer to the relevant introduction in the conventional technology, and will not be elaborated in the embodiments of the present application.

[0169] In another embodiment, when the first preset condition is that an electronic device with a large device identifier initiates a Bluetooth connection, the specific process of S603 can refer to the steps in S701 - S705 and will not be elaborated herein.

[0170] Furthermore, Figure 8 FIG. 3 shows a third schematic flowchart of a data synchronization method provided by an embodiment of the present application. As Figure 8 shown, in S603, after S702, the data synchronization method provided by the embodiment of the present application may include:

[0171] S801. The first electronic device sends a first query message to the server.

[0172] In the embodiment of the present application, the server may store the version numbers of the shared applications installed in each electronic device. For example, the server may store a mapping table between the device identifiers of the electronic devices and the version numbers of the shared applications. 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 in the server.

[0173] In this embodiment, the first query message may include a second device identifier for instructing the server to query the version number corresponding to the second device identifier. That is to say, the first query message is used to instruct the server to query the version number of the second shared application (i.e., the second version number) 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] Among them, the second query message may include a first device identifier for instructing the server to query the version number corresponding to the first device identifier. That is to say, the second query message is used to instruct the server to query the version number of the first shared application (i.e., the first version number) 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 sequence requirement among S801 to S804.

[0179] S805. Based on the first version number and the second version number indicating that 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] Among them, the version number can uniquely identify the version of a shared application. Different version numbers of two shared applications indicate that the versions of the two shared applications are different, and thus the synchronization policies of the two shared applications are different. The same version numbers of two shared applications indicate that the versions of the two shared applications are the same, and thus the synchronization policies of the two shared applications are the same. Therefore, whether two shared applications support the first policy can be determined by the version numbers of the two shared applications.

[0181] In this embodiment, the server sends the device identifier and version number of another electronic device to an electronic device in two times. In other embodiments, the server can send the device identifier and version number of another electronic device to an electronic device at one time.

[0182] In the embodiments of the present application, the messages transmitted via Bluetooth may include: any one of the first negotiation message, the second negotiation message, the first feedback message, the second feedback message, the first complete synchronization message, the second complete synchronization message, etc. involved in the embodiments of the present 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 electronic devices: an electronic device newly added to the trust ring, an electronic device that has joined the trust ring and the data in the shared application has changed (i.e., the data has been modified), an electronic device that has joined the trust ring and the shared application has been refreshed, an electronic device that has joined the trust ring and the shared application has been switched from the background to the foreground, an electronic device that has joined the trust ring and cold-starts the shared application. Among them, the refresh of the shared application may be: the display interface corresponding to a workspace of the shared application is pulled down for refreshing, but is not limited thereto.

[0184] In this embodiment, an example is given in which the first electronic device is an electronic device newly added to the trust ring where the second electronic device is located. It should be understood that in other embodiments, the first electronic device may be an electronic device that triggers other data synchronization events. At this time, before the first electronic device and the second electronic device synchronize the data collected in the corresponding shared application with each other, S603 may also be executed.

[0185] S604. Based on the successful Bluetooth connection, the first electronic device sends a first negotiation message to each second electronic device.

[0186] After the Bluetooth connection is successful, data synchronization negotiation is performed between the two electronic devices. During the data synchronization negotiation, the electronic device that triggers the data synchronization event (i.e., the first electronic device) among the two electronic devices sends a first negotiation message to the other electronic device (i.e., the second electronic device). The first negotiation message is used for the second electronic device to determine whether the second electronic device needs to synchronize the shared data to the first electronic device.

[0187] In one embodiment, the first negotiation message may include: the current state of the electronic device that triggers the data synchronization event, and the historical timestamp when the shared application of this electronic device last synchronized data from the shared application of another electronic device. Among them, the current state may be a synchronization state or an idle state. The synchronization state is used to indicate that the electronic device that triggers the data synchronization event is currently (or about to) synchronize shared data. The idle state is used to indicate that the electronic device that triggers the data synchronization event is not synchronizing shared data at the current moment.

[0188] Based on the above introduction, in this embodiment, the first negotiation message may include: the current state of the first electronic device, and the first historical timestamp when the first shared application last synchronized data from the second shared application.

[0189] In another embodiment, the first negotiation message may include: the current state of the electronic device that triggers the data synchronization event, the historical timestamp when the shared application of this electronic device last synchronized data from the shared application of another electronic device, and the version number of the shared application in the electronic device that triggers the data synchronization event.

[0190] Based on the above introduction, in this embodiment, the first negotiation message may include: the current state of the first electronic device, the first historical timestamp when the first shared application last synchronized data from the second shared application, and the first version number.

[0191] In this embodiment, after the Bluetooth connection is successful, the first electronic device and the second electronic device can send each other the version number of the shared application.

[0192] In one embodiment, the 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 establish a Bluetooth connection on the first connection based on the Bluetooth connection request, or the first electronic device and the second electronic device successfully establish a Bluetooth connection after multiple connections based on the Bluetooth connection request within the first preset time period, or the first electronic device and the second electronic device successfully establish a Bluetooth connection after two connections based on the Bluetooth connection request.

[0193] S605. When both the first shared application and the second shared application support the first policy, based on the first historical timestamp in the first negotiation message and the change timestamp of each data in the second shared application, the second electronic device determines that there is first target data in the second shared application to be synchronized to the first shared application.

[0194] In the case where there is no version number in the first negotiation message, if the second electronic device can perform the step of determining whether there is first target data to be synchronized from the second shared application to the first shared application after receiving the first historical timestamp, then the version numbers of the first shared application and the second shared application are the same. That is to say, both the first shared application and the second shared application support the first policy. Otherwise, the version numbers are different, that is, the second shared application does not support the first policy.

[0195] In the case where there is a version number in the first negotiation message, the second electronic device can directly compare the version numbers of the first shared application and 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, take the version number of the shared application in the electronic device that triggers the data synchronization event included in the first negotiation message as an example. Therefore, the second electronic device can determine whether both the first shared application and the second shared application support the first policy according to the version number in the first negotiation message. In this step, take the case where both the first shared application and the second shared application support the first policy as an example for introduction.

[0197] In one embodiment, if the first electronic device joins the trust ring where the second electronic device is located for the first time, then all the 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 has been synchronized from the second shared application to the first shared application and has changed, data that has been synchronized from the second shared application to the first shared application and has not changed, and data that has not been synchronized from the second shared application to the first shared application.

[0199] Among them, the data that has been synchronized from the second shared application to the first shared application and has changed, as well as the data that has not been synchronized from the second shared application to the first shared application can both be data to be synchronized. The data that has been synchronized from the second shared application to the first shared application and has not changed is synchronized data. For the synchronized data, there is no need to synchronize it again during this synchronization process, which can reduce the amount of synchronized data, thereby saving the resources of the electronic device and reducing the power consumption of the electronic device, etc.

[0200] For the convenience of description, hereinafter, the data that has been synchronized from the second shared application to the first shared application and has changed is referred to as the first data to be synchronized, and the data that has not been synchronized from the second shared application to the first shared application is referred to as the second data to be synchronized. At this time, 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 timestamps of each piece of data in the second shared application, and based on the change timestamp of a piece of data in the second shared application being later than the first historical timestamp, the second electronic device determines that piece of data as the first target data.

[0202] Among them, the change timestamp of a piece of data can represent the timestamp when the data changes. For example, if the sorting of the data changes, the change timestamp of the data changes. Another example is that if the name of the data is modified, the change timestamp of the data changes.

[0203] Optionally, the data in the shared application may include: the spatial metadata of each workspace in at least one workspace, and the material metadata of the shared files collected in each workspace. For the convenience of distinction, in the embodiments of the present application, 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 the present application, the first target data may include: the spatial metadata of the second target workspace and / or the material metadata of the second target shared file. The second target workspace belongs to the second workspace, and the second target shared file belongs to the second shared file.

[0205] Each electronic device within the trust ring includes a database for storing the shared application. The database may include multiple storage areas. One storage area is used to store the spatial metadata of a workspace in the shared application, and the material metadata of the shared files collected within that workspace. That is to say, the storage areas in the database correspond one-to-one with the workspaces. Every time an electronic device creates or copies a workspace, a storage area will be automatically added to the database.

[0206] S606. The second electronic device sends a first feedback message to the first electronic device.

[0207] Among them, the first feedback message is used to indicate that there is first target data in the second shared application to be synchronized to the first shared application.

[0208] In one embodiment, the first feedback message may include a second historical timestamp when the second shared application last synchronized data from the first shared application. In another embodiment, the first feedback message does not include the second historical timestamp when the second shared application last synchronized data from the first shared application.

[0209] S607. Based on the current state of the first electronic device being the idle state, the second electronic device sends a transmission channel establishment request to the first electronic device.

[0210] The first policy may also indicate the timing for establishing the transmission channel, and the end that meets the second preset condition among the first electronic device and the second electronic device initiates the establishment of the transmission channel (i.e., sends a transmission channel request). The transmission channel is used to synchronize and share data.

[0211] In this embodiment, the electronic device that meets the second preset condition is the second electronic device. The second preset condition may include: there is first target data in the second shared application to be synchronized to the first shared application, and the second electronic device is in the idle state. The timing for establishing the transmission channel is when the first electronic device is in the idle state. That is, when the second electronic device is in the idle state and there is first target data in the second shared application, the second electronic device will send a transmission channel establishment request to the first electronic device so that the first electronic device and the second electronic device establish a transmission channel.

[0212] The transmission channel establishment request may include: the device identifiers of the two electronic devices for 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 identifier of the first electronic device and the device identifier of the second electronic device.

[0213] It should be noted that if the first electronic device receives the first feedback message within the third preset time period (such as 10S), the first electronic device executes S607 and sets the negotiation state of data synchronization to negotiation success. If the first electronic device does not receive the first feedback message within the third preset time period, the first electronic device no longer executes S607 and sets the negotiation state of data synchronization to negotiation failure. At this time, data is directly synchronized between the first electronic device and the second electronic device.

[0214] Among them, directly synchronizing data between the first electronic device and the second electronic device means that: the first electronic device directly sends a transmission channel establishment request to the second electronic device, and the first electronic device and the second electronic device establish a transmission channel based on the transmission channel establishment request. Then, the first electronic device sends the data in 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 in the first shared application. The second electronic device sends the data in 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 in the second shared application.

[0215] Optionally, after S607, based on the second electronic device being in the idle state, the second electronic device may set the current state of the second electronic device to the synchronization state.

[0216] Specifically, the second electronic device sets its current state to the synchronization state to notify other electronic devices in the trust ring except the first electronic device that the second electronic device is synchronizing data or about to start synchronizing shared data, and at this time, data synchronization with other electronic devices is not possible.

[0217] S608. The first electronic device and the second electronic device establish a transmission channel based on a transmission channel establishment request.

[0218] The process by which the first electronic device and the second electronic device establish a transmission channel based on a transmission channel establishment request can refer to the process by which the first electronic device and the second electronic device establish a Bluetooth connection based on a Bluetooth connection request. Therefore, this embodiment of the present application will not elaborate on this.

[0219] In the embodiments of the present 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, the successful establishment of the transmission channel may include: the first electronic device and the second electronic device successfully establish a transmission channel on the first attempt based on a transmission channel establishment request, or the first electronic device and the second electronic device successfully establish a transmission channel after multiple attempts based on a transmission channel establishment request within a second preset time period.

[0222] The successful establishment of a transmission channel between the first electronic device and the second electronic device indicates that the first electronic device and the second electronic device are about to start synchronizing shared data. At this time, the first electronic device sets its current state to the synchronization state to notify other electronic devices in the trust ring except the second electronic device that the first electronic device is synchronizing data or about to start synchronizing shared data, and at this time, data synchronization with other electronic devices is not possible.

[0223] It should be noted that if the first electronic device and the second electronic device do not successfully establish a transmission channel on the first attempt, the second electronic device repeats the above S607, and the first electronic device and the second electronic device repeat the above S608.

[0224] S610. The second electronic device sends 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 of the second shared application, or it can be part of the data in the second shared application. That is to say, the second electronic device can synchronize all the data in the second shared application to the first shared application in full, or the second electronic device can synchronize the data in the second shared application to the first shared application incrementally.

[0226] In some other embodiments, when the second electronic device determines that there is first target data in the second shared application 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 to say, the second electronic device synchronizes all the data in the second shared application to the first shared application in full.

[0227] S611. Based on the first target data, the first electronic device updates the data in the first shared application.

[0228] As can be seen from the introduction in S605 above, the first target data may include: the spatial metadata of the second target workspace and / or the material metadata of the second target shared file. The following introduces the detailed process of the first electronic device updating the data in the first shared application based on the first target data according to the specific content of the first target data:

[0229] In one embodiment, when the first target data includes the 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 the workspaces in the first shared application. Then, the first electronic device copies the third target workspace. Based on this, the workspaces in the first electronic device and the second electronic device are exactly the same, and there are no workspaces with duplicate names.

[0230] Specifically, since the names of each workspace created by the electronic device in the shared application are all different, after the first electronic device receives the spatial metadata of the second target workspace, according to whether the name of the second target workspace is the same as the name of each workspace in all the existing workspaces in the first shared application, the second target workspace can be divided into: a third target workspace whose name is different from the names of all the existing workspaces in the first shared application, and / or a fourth target workspace whose name is the same as the name of one workspace in all the existing workspaces in the first shared application. That is to say, 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 first electronic device may set the space source identifier of the third target workspace to another electronic device within the trusted 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 in the first shared application according to the space sorting timestamp of each workspace in the first shared application. The sorting rule may be ascending order or descending order, but is not limited thereto. Based on this, the sorting of the same workspace is the same in each electronic device within the trusted ring.

[0233] In another embodiment, on the basis of the above embodiment, when the first target data further includes the material metadata of the second target shared file, after the first electronic device copies the third target workspace, it may display the material metadata of each second target shared file in each workspace corresponding to the first shared application.

[0234] Specifically, the material metadata of each shared file includes the workspace identifier to which the shared file belongs. That is to say, there is a mapping relationship between the material metadata of the shared file and the workspace. Therefore, after the first electronic device receives the material metadata of the second target shared file, according to the workspace identifier to which the second target shared file belongs, it can determine which second workspace in the second shared application the material metadata of the second target shared file comes from. That is to say, the first electronic device can determine the name of the second workspace to which the material metadata of the second target shared file belongs in the second shared application according to the workspace identifier in the material metadata of the second target shared file.

[0235] After the first electronic device copies the third target workspace, all the second workspaces in the second electronic device are already included in the first electronic device. Therefore, the first electronic device can find the workspace with the same name in the first shared application according to the name of the workspace to which the material metadata of the second target shared file belongs, that is, determine the storage area of the database corresponding to the third target workspace in the first shared application, and display the material metadata of the second target shared file in the workspace to which the first shared application belongs. In this way, the material metadata of the second target shared file can be displayed in all workspaces with the same name. For example, the material metadata displayed in the workspace A of the second electronic device will also be displayed in the 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 each workspace corresponding to the first shared application.

[0237] It should be noted that in the embodiments of the present application, the sorting of the same material metadata in the same workspace of each electronic device within the trust ring is the same.

[0238] In some other embodiments, when the second electronic device directly synchronizes all the data in the second shared application to the first shared application in full, the first electronic device can update the data in the first shared application according to the data in the second shared application.

[0239] S612. The first electronic device sends the data in the first shared application to the second electronic device through the transmission channel.

[0240] In this step, the data in the first shared application sent by the first electronic device to the second electronic device can be any one of the following:

[0241] In one embodiment, the first electronic device sends all the data in the first shared application to the second electronic device. That is to say, the first electronic device synchronizes all the data in the first shared application to the second shared application in full. In this way, it is more convenient and saves the computing amount of the first electronic device, thereby saving the system resources of the first electronic device.

[0242] In another embodiment, when the first feedback message can include the second historical timestamp when the second shared application last synchronized data from the first shared application, the first electronic device only sends the different data between the first shared application and the second shared application to the second electronic device. That is to say, the first electronic device synchronizes the different data in the first shared application to the second shared application incrementally. In this way, the data transmission volume can be reduced, the data transmission efficiency is improved, and the transmission time is saved.

[0243] Among them, in this embodiment, the first electronic device needs to screen out the different data between the first shared application and the second shared application from the first shared application. Specifically, reference can be made to the process of the second electronic device determining the first target data above, which will not be elaborated in the embodiments of the present application.

[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 refer to the introduction in S611 above, which will not be elaborated in the embodiments of the present application.

[0246] S614. The second electronic device sends a first complete synchronization message to the first electronic device.

[0247] In an embodiment of the present application, after data synchronization is completed between two electronic devices, the electronic device that finally completes the data synchronization will send a synchronization completion message to the other electronic device. The synchronization completion message is used to indicate that the electronic device that finally completes the data synchronization has successfully updated the data in the shared application, which means that the data has been successfully synchronized between the two electronic devices with each other.

[0248] For the convenience of distinction, the synchronization completion message sent by the second electronic device is called the first synchronization completion message. The first synchronization completion message is used to indicate that the second electronic device has successfully updated the data in the second shared application based on the data in the first shared application. At the same time, the first synchronization completion message can also be used to indicate that the data has been successfully synchronized between the first electronic device and the second electronic device with each other.

[0249] S615. The second electronic device sets the synchronization status of the second electronic device to synchronization success.

[0250] Among them, the second electronic device setting the synchronization status of the second electronic device to synchronization success means 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 success.

[0252] Among them, the first electronic device setting the synchronization status of the first electronic device to synchronization success means 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 (such as 30S), 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 the synchronization status of the first electronic device to synchronization failure. Until the next data synchronization event is triggered, the first electronic device and the second electronic device will re-execute the steps in any embodiment of the embodiments of the present application.

[0254] In this case, after the first electronic device sets the synchronization status of the first electronic device to synchronization failure, the data in the second shared application can be displayed in the first shared application. However, it may not be possible to access the data in the second shared application in the first shared application. For example, it is not possible to open the document in the second shared application in the first shared application.

[0255] In some embodiments, after data synchronization is completed between the first electronic device and the second electronic device, that is, after the first electronic device receives the first synchronization completion message, the first electronic device will query whether there are still device identifiers stored in the first synchronization queue. If there are device identifiers in the first synchronization queue, the first electronic device will synchronize data with the electronic devices corresponding to each device identifier in the first synchronization queue in sequence.

[0256] In other embodiments, in response to any operation that triggers a data synchronization event, such as the first shared application being refreshed, the first shared application being opened, or the first shared application being switched from the background to the foreground, the first electronic device will also query whether there are still device identifiers stored in the first synchronization queue. That is to say, whether an electronic device within the trust ring queries whether there are still device identifiers stored in the synchronization queue does not completely depend on whether the electronic device has received the synchronization completion message. Based on this, it can be ensured that data synchronization between each electronic device within the trust ring can be carried out in sequence, thereby ensuring the success rate of data synchronization.

[0257] In other embodiments, after the first electronic device receives the first synchronization completion message within the fourth preset time period, the first electronic device will query whether there are still device identifiers 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 will query whether there are still device identifiers stored in the first synchronization queue.

[0258] Further, Figure 9 FIG. 4 shows a schematic flow diagram of a data synchronization method provided by an embodiment of the present application. On the basis of the above embodiments, in combination with Figure 6 , as Figure 9 shown, after S606, the data synchronization method provided in this embodiment may include:

[0259] S901. Based on the current state of the first electronic device being the synchronization state, the first electronic device adds the second device identifier to the first synchronization queue.

[0260] In each electronic device involved in the embodiments of the present application, a synchronization queue is preset. 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 can indicate the order in which this electronic device synchronizes data with the electronic devices corresponding to each device identifier.

[0261] For the sake of easy distinction, in the embodiments of the present 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] The first electronic device receives a first feedback message. If the current state of the first electronic device is the idle state, it indicates that the first electronic device has not synchronized data with any electronic device within the trust ring at the current moment. Therefore, data synchronization can be immediately performed between the first shared application and the second shared application, and thus the first electronic device does not need to add the second device identifier to the first synchronization queue for queuing.

[0263] The first electronic device receives a first feedback message. If the current state of the first electronic device is the synchronization state, it indicates that the first electronic device is (or will be) synchronizing shared data with other electronic devices within the trust ring except the second electronic device at the current moment. Therefore, the first shared application cannot immediately synchronize data with the second shared application, and thus the second electronic device needs to queue. Based on this, the first electronic device adds the second device identifier to the first synchronization queue for queuing. In this way, the first shared application can synchronize data with the corresponding shared application in sequence according to the order of the device identifiers in the first synchronization queue, so as not to cause conflicts, enabling successful mutual data synchronization between any two shared applications.

[0264] In one embodiment, if an electronic device within the trust ring adds a device identifier to the synchronization queue of this electronic device, then this electronic device will notify the electronic device corresponding to the device identifier. For example, if the first electronic device adds the second device identifier to the first synchronization queue, the first electronic device will send a notification message to the second electronic device to notify the second electronic device that the second device identifier has been added to the first synchronization queue.

[0265] It should be noted that after the first electronic device synchronizes data with an electronic device within the trust ring, it will query whether there is still a device identifier stored in the first synchronization queue. If there is still a device identifier stored in the first synchronization queue, the first electronic device will not change the current state. That is to say, at this time, the current state of the first electronic device is still the synchronization state. Otherwise, the first electronic device will set the current state to the idle state.

[0266] S902. Based on the fact that the device identifier of the second electronic device is 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, a queue manages the data stored in the queue according to the principle of first in, first out. When a piece of data in the queue is at the head of the queue, it means that this 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 shared 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 at the head of the first synchronization queue of the first electronic device. The timing for establishing the transmission channel is that the first target data is included in the second shared application and the second electronic device is in an idle state. That is to say, when the first target data is included in the second shared application, the second electronic device is in an idle state, and the device identifier of the second electronic device is 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 by which the first electronic device and the second electronic device establish a transmission channel based on the transmission channel establishment request can refer to the process by which the first electronic device and the second electronic device establish a Bluetooth connection based on a Bluetooth connection request. Therefore, this is not elaborated in this embodiment of the present application. Among them, the session information of the second transmission channel may include the first device identifier and the 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 the current state of the second electronic device to the synchronization state.

[0272] The second electronic device sets the current state of the second electronic device to the synchronization state to notify other electronic devices in the trust ring except the first electronic device that the second electronic device is synchronizing data or about to start synchronizing shared data, and at this time, data synchronization with other electronic devices is not possible.

[0273] Further, Figure 10 shows the fifth flow diagram of a data synchronization method provided by an embodiment of the present application. On the basis of the above embodiment, in combination with Figure 6 , as Figure 10 shown, after S604, the data synchronization method provided in this embodiment may include:

[0274] S1001. When both the first shared application and the second shared application support the first policy, based on the first historical timestamp in the first negotiation message and the change timestamp of each data in the second shared application, the second electronic device determines that there is no first target data in the second shared application to be synchronized to the first shared application.

[0275] Referring to the introduction 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 timestamps of each piece of data in the second shared application. Based on the change timestamp of any piece of data in the second shared application being earlier than the first historical timestamp, the data in the second shared application is determined as 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] Among them, the second negotiation message is used to indicate that among the electronic devices that establish a Bluetooth connection with the electronic device that triggers the data synchronization event, there is no first target data to be synchronized to the electronic device that triggers the data synchronization event. The second negotiation message is used for the first electronic device to determine whether the first electronic device needs to synchronize shared data to the second electronic device.

[0278] In one embodiment, the second negotiation message may include: the current state of the electronic device that establishes a Bluetooth connection with the electronic device that triggers the data synchronization event, and the historical timestamp when the shared application of this electronic device last synchronized data from the shared application of the electronic device that triggers the data synchronization event.

[0279] Based on the above introduction, in this embodiment, the second negotiation message may include: the current state of the second electronic device, and the second historical timestamp when the second shared application last synchronized data from the first shared application.

[0280] In another embodiment, the second negotiation message may include: the current state of the electronic device that establishes a Bluetooth connection with the electronic device that triggers the data synchronization event, the historical timestamp when the shared application of this electronic device last synchronized data from the shared application of the electronic device that triggers the data synchronization event, and the version number of the shared application of this electronic device.

[0281] Based on the above introduction, in this embodiment, the second negotiation message may include: the current state of the second electronic device, the second historical timestamp when the second shared application last synchronized data from the first shared application, and the second version number.

[0282] S1003. In the case where both the first shared application and the second shared application support the first policy, based on the second historical timestamp in the second negotiation message and the change timestamps of each piece of data in the first shared application, the first electronic device determines that there is second target data in the first shared application to be synchronized to the second shared application.

[0283] In one embodiment, if the first electronic device joins the trust ring where the second electronic device is located for the first time, all the 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 where the second electronic device is located for the first time, the data in the first shared application may include at least one of the following: data that has been synchronized from the first shared application to the second shared application and has changed, data that has been synchronized from the first shared application to the second shared application and has not changed, and data that has not been synchronized from the first shared application to the second shared application.

[0285] Among them, the data that has been synchronized from the first shared application to the second shared application and has changed, and the data that has not been synchronized from the first shared application to the second shared application can both be data to be synchronized. The data that has been synchronized from the first shared application to the second shared application and has not changed is already synchronized data. For the already synchronized data, there is no need to synchronize it again, which can reduce the amount of synchronized data, thereby saving the resources of the electronic device and reducing the power consumption of the electronic device, etc.

[0286] For the sake of convenience in description, hereinafter, the data that has been synchronized from the first shared application to the second shared application and has changed is referred to as the third data to be synchronized, and the data that has not been synchronized from the first shared application to the second shared application is referred to as the fourth data to be synchronized. At this time, 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 change timestamp of a data in the first shared application being later than the second historical timestamp, the first electronic device determines this data as the second target data.

[0288] Continuing to refer to the introduction of the data in the shared application in S605, in the embodiment of the present application, the second target data may include: the spatial metadata of the first target workspace and / or the 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 negotiation status of data synchronization to negotiation success. If the first electronic device does not receive the second negotiation message within the third preset time period, the first electronic device no longer executes S1003 and sets the negotiation status of data synchronization to negotiation failure. At this time, data is directly synchronized between the first electronic device and the second electronic device. Here, the direct data synchronization between the first electronic device and the second electronic device can refer to the introduction in S607 and will not be elaborated in this article.

[0290] S1004. The first electronic device sends a second feedback message to the second electronic device.

[0291] Among them, the second feedback message is used to indicate that there is second target data in the first shared application to be synchronized to the second shared application.

[0292] In one embodiment, the second feedback message may include a first historical timestamp when the first shared application last synchronized data from the second shared application. In another embodiment, the first feedback message does not include the first historical timestamp when the first shared application last synchronized data from the second shared application.

[0293] S1005. Based on the current state of the second electronic device being an idle state, 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 second target data and the first electronic device is in an idle state. The timing for establishing the transmission channel is when the first shared application includes 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 negotiation status of data synchronization to negotiation success. If the second electronic device does not receive the second feedback message within the third preset time period, the second electronic device no longer executes S1006 and sets the negotiation status of data synchronization to negotiation failure. At this time, data is directly synchronized between the first electronic device and the second electronic device.

[0296] Optionally, after S1005, based on the current state of the first electronic device being the idle state, the first electronic device may set the current state of the first electronic device to the synchronization state to notify other electronic devices in the trust ring except the second electronic device that the first electronic device is synchronizing data or about to start synchronizing shared data, and at this time, data synchronization with other electronic devices is not possible.

[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, when the transmission channel is successfully established, the second electronic device may set the current state of the second electronic device to the synchronization state to notify other electronic devices in the trust ring except the first electronic device that the second electronic device is synchronizing data or about to start synchronizing shared data, and at this time, data synchronization with other electronic devices is not possible.

[0299] S1007. The first electronic device sends the second target data to the second electronic device through the transmission channel.

[0300] As can be analyzed in S1003 above, the second target data may be all the data of the first shared application, or the second target data may be part of the data in the first shared application. That is to say, the first electronic device may synchronize all the data in the first shared application to the second shared application in full amount, or the first electronic device may synchronize the data in the first shared application to the second shared application incrementally.

[0301] In other embodiments, when the first electronic device determines that there is second target data in the first shared application to be synchronized to the second shared application, the first electronic device may directly send all the data in the first shared application to the second electronic device through the transmission channel. That is to say, the first electronic device directly synchronizes all the data in the first shared application to the second shared application in full amount.

[0302] S1008. Based on the second target data, the second electronic device updates the data in the second shared application.

[0303] As can be introduced in S1003 above, the second target data may include: the spatial metadata of the first target workspace and / or the material metadata of the first target shared file. Below, according to the specific content of the second target data and the introduction in S1103, a brief introduction is given to the process of the second electronic device updating the data in the second shared application based on the second target data:

[0304] In one embodiment, when the second target data includes the 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 the 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 electronic device and the second electronic device are exactly the same, 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: the spatial metadata of the fifth target workspace, and / or the 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 second electronic device can set the spatial source identifier of the fifth target workspace to come from other electronic devices within the trust ring. For example, the second electronic device sets the spatial source identifier of the fifth target workspace to the 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 in the second shared application. The sorting rule can be ascending order or descending order, but is not limited thereto.

[0308] In another embodiment, on the basis of the above embodiment, when the second target data further includes the material metadata of the first target shared file, after the second electronic device copies the fifth target workspace, it can display the material metadata of each first target shared file in the corresponding workspaces of the second shared application.

[0309] In another embodiment, when the second target data only includes the first target shared file, the second electronic device directly displays the material metadata of each first target shared file in the corresponding workspaces of the second shared application.

[0310] In some embodiments, after the data synchronization between the first electronic device and the second electronic device is completed, the second electronic device queries whether there is still a device identifier in the second synchronization queue. If there is a device identifier 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 some other embodiments, in response to operations such as the second shared application being refreshed, the second shared application being opened, or the second shared application being switched from the background to the foreground, the second electronic device will query whether there is still a device identifier stored in the second synchronization queue. That is to say, whether there is still a device identifier stored in the synchronization queue queried by the electronic devices within the trust ring does not entirely depend on whether the electronic device has received a completion synchronization message. Based on this, it can be ensured that the data synchronization between the electronic devices within the trust ring can proceed sequentially, thereby ensuring the success rate of data synchronization.

[0312] Further, Figure 11 FIG. 6 shows a schematic flowchart of a data synchronization method provided by an embodiment of the present application. On the basis of the above embodiments, as Figure 11 shown, after S1008, the data synchronization method provided in this embodiment may include:

[0313] S1101. The second electronic device sends the data in the second shared application to the first electronic device through a transmission channel.

[0314] In this step, the second electronic device may synchronize all 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 may refer to S611 above and will not be elaborated herein.

[0317] S1103. The first electronic device sends a second completion synchronization message to the second electronic device.

[0318] In the embodiments of the present application, the completion synchronization message sent by the first electronic device is referred to as the second completion synchronization message. The second completion synchronization message is used to indicate that: based on the data in the second shared application, the first electronic device has successfully updated the data in the first shared application. At the same time, the second completion synchronization message can also be used to indicate that the first electronic device and the second electronic device have successfully synchronized data with each other.

[0319] S1104. The first electronic device sets the synchronization status of the first electronic device to synchronization success.

[0320] S1105. Based on the second completion synchronization message, the second electronic device sets the synchronization status of the second electronic device to synchronization success.

[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 the synchronization status of the second electronic device to synchronization failure. Until the next data synchronization event is triggered, the steps in any embodiment of this application embodiment will be re-executed between the second electronic device and the first electronic device.

[0322] In this case, after the second electronic device sets the synchronization status of the second electronic device to synchronization failure, the data in the first shared application can be displayed in the second shared application. However, it may not be possible to access the data in the first shared application in the second shared application. For example, it is not possible to open the document in the first shared application in the second shared application.

[0323] Furthermore, Figure 12 FIG. 7 shows a schematic flow chart of a data synchronization method provided by an embodiment of the present application. On the basis of the above embodiment, as Figure 12 shown, after S1004, the data synchronization method provided in this embodiment may include:

[0324] S1201. Based on the current state of the second electronic device being the synchronization state, the second electronic device adds the first device identifier to the second synchronization queue.

[0325] When the second electronic device receives the second feedback message, if the current state of the second electronic device is the idle state, it indicates that the second electronic device has not synchronized data with any electronic device within the trust ring at the current moment. Therefore, data synchronization can be immediately performed between the first shared application and the second shared application, so the second electronic device does not need to add the first device identifier to the second synchronization queue for queuing.

[0326] When the second electronic device receives the second feedback message, if the current state of the second electronic device is the synchronization state, it indicates that the second electronic device is (or will be) synchronizing shared data with other electronic devices within the trust ring except 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 device identifier of the first electronic device being 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 with the electronic devices corresponding to the respective device identifiers in the second synchronization queue in sequence. When the first device identifier is at the head of the second synchronization queue, it indicates that the second electronic device is about to synchronize shared data with the first electronic device. Therefore, 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 at the head of the second synchronization queue of the second electronic device. The timing for establishing the transmission channel is: when the second target data is included in the first shared application, the first target data is not included in the second shared application, and the first electronic device is in an idle state.

[0330] Optionally, after S1202, the second electronic device may set the current state of the second electronic device to the 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, when the transmission channel is successfully established and the first electronic device is in an idle state, the first electronic device may set the current state of the first electronic device to the synchronization state.

[0333] Furthermore, Figure 13 FIG. 8 shows a schematic flow chart of a data synchronization method provided by an embodiment of the present application. On the basis of the above embodiment, as Figure 13 shown, after S603 in this embodiment, the data synchronization method provided by the embodiment of the present application may include:

[0334] S1301. Based on the failure of the Bluetooth connection, the first electronic device sends a transmission channel establishment request to the second electronic device.

[0335] In this embodiment, the failure of the Bluetooth connection between the first electronic device and the second electronic device means that within the first preset time period, after the first electronic device and the second electronic device have made multiple connection attempts based on the Bluetooth connection request, they still fail to successfully establish a Bluetooth connection, or after the first electronic device and the second electronic device have made two connection attempts based on the Bluetooth connection request, they still fail to successfully establish a Bluetooth connection. If the connection between the first electronic device and the second electronic device fails, the first electronic device and the second electronic device do not negotiate anymore and can directly synchronize data.

[0336] Among them, 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 shared application and the second shared application support the historical policy, either the first shared application or the second shared application supports the historical policy, and the Bluetooth versions of the first electronic device and the second electronic device 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 the data in 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 the data in 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 the situation where data synchronization fails due to different versions of the shared applications in the two electronic devices, ultimately resulting in the inability to synchronize data between the two shared applications. That is to say, the data synchronization method provided in the embodiments of the present application is compatible with historical versions.

[0343] Further, Figure 14 shows the ninth flowchart of the data synchronization method provided in the embodiments of the present application. On the basis of any of the above embodiments, as Figure 14 shown, after S604, the data synchronization method provided in the embodiments of the present application may include:

[0344] S1401. When the first shared application and / or the second shared application support the second policy, the first electronic device sends a transmission channel establishment request to the second electronic device.

[0345] After the second electronic device receives the first negotiation message, if the first shared application and / or the second shared application support the second policy, it means that the first electronic device and the second electronic device do not need to perform data synchronization negotiation when mutually synchronizing the data in the shared application. At this time, the second electronic device does not need to determine whether there is the first target data in the second shared application and other steps, and the first electronic device and the second electronic device can directly mutually synchronize the data in the shared application, so 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 directly synchronizing data between the first electronic device and the second electronic device, the transmission channel can transmit all the data of the first shared application and all the data of the second shared application. That is to say, directly synchronizing data means full - volume synchronizing all the data in the shared applications.

[0348] Further, based on any of the above embodiments, if the transmission channel establishment fails on the basis of the establishment of the transmission channel initiated by the first electronic device, then the first electronic device and the second electronic device cannot synchronize shared data. At this time, when the first electronic device waits for the next data synchronization event to be triggered, it synchronizes shared data with the second electronic device again. If the transmission channel establishment fails on the basis of the establishment of the transmission channel initiated by the second electronic device, then the first electronic device and the second electronic device cannot synchronize data. At this time, when the second electronic device waits for the next data synchronization event to be triggered, it synchronizes data with the first electronic device again.

[0349] Among them, the failure of establishing the transmission channel means that within the second preset time period, after the first electronic device and the second electronic device establish the transmission channel multiple times based on the transmission channel establishment request, they still fail to successfully establish the transmission channel. If the transmission channel establishment fails, the first electronic device and the second electronic device cannot synchronize the data in the shared application. The reasons for the failure of establishing the transmission channel can include, but are not limited to: the first electronic device and / or the second electronic device is performing other data transmission tasks.

[0350] Of course, when other problems (such as negotiation failure) cause the failure of synchronizing data (i.e., unable to synchronize data) between the first electronic device and the second electronic device, the first electronic device and / or the second electronic device synchronizes data with the peer electronic device again when the next data synchronization event is triggered.

[0351] In addition, if the data synchronization fails between the first electronic device and the second electronic device, each electronic device will record the reason for the failure, and the shared application of each electronic device will display a first prompt message. The first prompt message is used to prompt the failure of this data synchronization. For example, the first prompt message can be: Synchronization failed, but not limited to this.

[0352] Figure 15 Shows the second schematic diagram of the interface for data synchronization provided by the embodiments of the present application.

[0353] Such as Figure 15As shown by A in [figure], mobile phone C is within the trust ring, and the icon 411 of the first picture is displayed in the shared application of mobile phone C. Mobile phone D has not joined the trust ring, and the icon 412 of the second picture is displayed in the shared application of mobile phone D.

[0354] As Figure 15 shown by B in [figure], after mobile phone D joins the trust ring where mobile phone C is located, only the icon 411 of the first picture is still displayed in the shared application of mobile phone C, and the first prompt message 1510 is displayed in the shared application of mobile phone C. Only the icon 412 of the second picture is still displayed in the shared application of mobile phone D, and the first prompt message 1510 is displayed in the shared application of mobile phone D. For example, the first prompt message may be a synchronization failure.

[0355] Further, based on any of the above embodiments, when 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 pulled down to refresh), the shared application is switched from the background to the foreground, or the shared application is cold-started, exited from the trust ring, etc., in response to any of the above operations, this electronic device and other electronic devices (such as the second electronic device) within the trust ring may execute S603 and the steps after S603, which are not elaborated in the embodiments of the present application.

[0356] Among them, the modification of the data in the shared application (that is, the data in the shared application changes) may include at least one of: the data in the shared application is deleted, new data is added to the shared application, the order of the data in the shared application changes, the data in the shared application is modified, etc.

[0357] Exemplarily, the deletion of the data in the shared application may include at least one of: the workspace is deleted, the shared file is deleted from the workspace, etc. The addition of new data to the shared application may include at least one of: a new workspace is added, there are newly collected shared files in the workspace, etc. The change in the order of the data in the shared application may include at least one of: the order of each workspace changes, the order of each shared file collected in the same workspace changes, etc. The modification of the data in the shared application may include at least one of: the spatial metadata (such as the name) of the workspace is modified, the material metadata (such as the name) of the shared file is modified, etc.

[0358] Optionally, Figure 16 shows the tenth flowchart of a data synchronization method provided by the embodiments of the present application. Based on any of the above embodiments, as Figure 16 shown, the data synchronization method provided by the embodiments of the present application may include:

[0359] S1601. In response to the operation of deleting the third target data, the first electronic device deletes the third target data from the first shared application.

[0360] The third target data is the data that originally belonged to the first electronic device. The third target data may include: the spatial metadata of the seventh target workspace, and / or, the material metadata of the third target shared file. Among them, the seventh target workspace is any workspace in the first workspace, and the third target shared file is any shared file in the first shared file.

[0361] That is to say, the first electronic device deletes the workspace created by the first electronic device in the first shared application; or, the first electronic device deletes the material metadata of the first shared file stored in the first electronic device in the first shared 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 shared application.

[0362] S1602. The first electronic device updates the third target data to the fourth target data.

[0363] Whether the electronic device within the trust ring deletes the data obtained from its own end and belonging to the shared application, the electronic device will not delete the data from its own database, but only sets the existence status flag of the data stored in its own database to the second value (such as 1) to indicate that the data is no longer displayed in the shared application of this electronic device. When full - scale data synchronization occurs among the electronic devices within the trust ring, this electronic device will not synchronize the data whose existence status flag is set to the second value to other electronic devices within the trust ring. In this way, the data synchronization efficiency can be improved.

[0364] It can be seen that the fourth target data is the third target data whose existence status flag is set to the second value. That is to say, in this embodiment, the fourth target data is the second data. After the first electronic device deletes the third target data from the first shared application, the third target data is no longer displayed in the first shared 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 flag of the seventh target workspace to the second value, indicating that the seventh target workspace is no longer displayed in the first shared application.

[0366] In another embodiment, after the material metadata of the third target shared file is deleted, the first electronic device sets the file existence status flag of the third target shared file to the second value, indicating that the third target shared file is no longer collected in the first shared application, so the material metadata of the third target shared file is no longer displayed in the first shared application.

[0367] In this embodiment, the data in the first shared application of the first electronic device is modified, so the first electronic device triggers a data synchronization event. Therefore, after S1602, the steps after S603 and S603 can be executed between the first electronic device and the second electronic device. For details, please refer to the above introduction, and this application embodiment will not be elaborated.

[0368] Figure 17 Fig. 3 shows a third schematic diagram of the interface for data synchronization provided by the embodiment of the present application.

[0369] As Figure 17 shown in A of, the icon 411 of the first picture and the icon 412 of the second picture are displayed in the shared application of the mobile phone E. In response to the operation of long pressing the icon 412 of the second picture, as Figure 17 shown in B of, a check box 1701 can appear in the upper right corner of the icon 411 of the first picture, and a check box 1701 can appear in the upper right corner of the icon 412 of the second picture. In response to the operation of clicking the check box 1701 corresponding to any picture (such as the second picture), as Figure 17 shown in C of, the check box 1701 corresponding to the second picture is selected, and a delete control 1702 is displayed in the shared application of the mobile phone E. In response to clicking the delete control 1702, as Figure 17 shown in D of, only the icon 411 of the first picture is displayed in the shared application of the mobile phone E, and the icon 412 of the second picture is no longer displayed.

[0370] Optionally, Figure 18 Fig. 11 shows a schematic flow chart of a data synchronization method provided by the embodiment of the present application. On the basis of any of the above embodiments, as Figure 18 shown, the data synchronization method provided by the embodiment of the present application 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 may be data synchronized by the first electronic device from the shared application of other devices within the trusted ring. In this embodiment, an example is given in which the fifth target data is data synchronized by the first electronic device from the second shared application of the second electronic device.

[0373] Specifically, the fifth target data may include: the spatial metadata of the eighth target workspace, and / or, the material metadata of the fourth target shared file. The eighth target workspace is any workspace in the second workspace, and the fourth target shared file is any shared file in the second shared file.

[0374] That is to say, the first electronic device deletes the workspace copied from the second electronic device in the first shared application; or, the first electronic device deletes the material metadata of the second shared file stored in the second electronic device in the first shared 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 shared 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 peer device and belonging to a shared application, the electronic device sets the existence status flag of the data to a second value in its local database to indicate that the first electronic device no longer displays the data. It can be seen that the sixth target data is the fifth target data with the existence status flag 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 flag 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, after the material metadata of the fourth target shared file is deleted, the first electronic device sets the file existence status flag of the fourth target shared file to a second value, indicating that the fourth target shared file is no longer collected in the first shared application. Therefore, the material metadata of the third target shared file is no longer displayed in the first shared application.

[0379] In this embodiment, the data in the first shared application of the first electronic device is modified, so the first electronic device triggers a data synchronization event. Therefore, after S1802 and before S1803, operations such as Bluetooth connection and creating a transmission channel can be performed between the first electronic device and the second electronic device (this part is not reflected in the corresponding Figure 19 of this embodiment). For details, please refer to the above introduction, and this application embodiment will not be elaborated.

[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] Compared with the fifth target data, the sixth target data only has a change in the status flag. Therefore, after the second electronic device receives the sixth target data, it can determine the fifth target data that needs to be deleted. After the second electronic device deletes the fifth target data from the second shared application, the fifth target data is no longer displayed in the second shared application.

[0383] In one embodiment, when the fifth target data includes the spatial metadata of the eighth target workspace, the second electronic device can set the spatial existence status flag 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 flag of the fourth target shared file to a second value, indicating that the fourth target shared file is no longer collected in the second shared application. Therefore, the material metadata of the fourth target shared file is no longer displayed in the second shared application.

[0385] S1805. The second electronic device sends a second prompt message or a third prompt message to the first electronic device.

[0386] Among them, the second prompt message is used to prompt that the deletion of the fifth target data is successful. The third prompt message is used to prompt that the deletion of the fifth target data fails.

[0387] If the second electronic device successfully deletes the fifth target data from the second shared application, the second electronic device generates a second prompt message and sends the second prompt message to the first electronic device. If the second electronic device fails to delete the fifth target data from the second shared application, the second electronic device generates a third prompt message and sends the third prompt message to the first electronic device.

[0388] S1806. The first electronic device displays the second prompt message or the third prompt message.

[0389] Figure 19 Fig. 4 shows a schematic interface diagram of data synchronization provided by an embodiment of the present application.

[0390] As Figure 19As shown in A of the figure, the mobile phone F and the tablet computer C are in the same trust ring. In the shared application of the mobile phone F, the icon 411 of the first picture and the icon 431 of the third picture are displayed. In the shared application of the tablet computer C, the icon 411 of the first picture and the icon 431 of the third picture are displayed. Among them, the first picture is stored in the mobile phone F, and the third picture is stored in the tablet computer C. Based on this, the icon 431 of the third picture displayed in the shared application of the mobile phone F includes the device identifier 1901 of the tablet computer C, indicating that the third picture is stored in the tablet computer C. The icon 411 of the first picture displayed in the shared application of the tablet computer includes the device identifier 1902 of the mobile phone F, indicating that the first picture is stored in the mobile phone F.

[0391] In response to the deletion operation on the icon 431 of the third picture on the mobile phone F, as Figure 19 shown in B of the figure, only the icon 411 of the first picture is displayed in the shared application of the mobile phone F, and the icon 431 of the third picture is no longer displayed. Only the icon 411 of the first picture is displayed in the shared application of the tablet computer C, and the icon 431 of the third picture is no longer displayed. At the same time, the second prompt message 1903 is displayed in the shared application of the mobile phone F. For example, the second prompt message is "Deletion successful".

[0392] Among them, in response to the deletion operation on the icon 431 of the third picture on the mobile phone F, the specific operation of the mobile phone F to delete the icon 431 of the third picture can refer to the above Figure 17 introduction, and the embodiments of the present application will not be elaborated.

[0393] Furthermore, Figure 20 shows the twelfth schematic flow diagram of a data synchronization method provided by an embodiment of the present application. As Figure 20 shown, the data synchronization method provided by the embodiment of the present application 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 operations, the first electronic device can exit the trust ring where the second electronic device is located: logging out of the account corresponding to the trust ring, disconnecting the Wi-Fi connection, disconnecting the Bluetooth connection, but not limited thereto.

[0396] S2002. The first electronic device sends a fourth prompt message to the server.

[0397] When an electronic device in the trust ring exits the trust ring, it will send a fourth prompt message to the server corresponding to the trust ring to prompt the server that this electronic device exits the trust ring. In this way, the server will broadcast to other electronic devices in the trust ring that this electronic device exits the trust ring.

[0398] Among them, the fourth prompt message may include the device identifier of the electronic device that exits the trust ring. For example, in this embodiment, the fourth prompt message includes the first device identifier.

[0399] S2003. The server sends a sixth prompt message to the second electronic device.

[0400] Among them, the sixth prompt message includes the device identifier of the electronic device that exits the trust ring.

[0401] S2004. Based on the sixth prompt message, 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 in the trust ring exits the trust ring, other electronic devices do not delete the data of the shared application of this electronic device, but hide the data of the shared application of this electronic device. Based on this, when this electronic device rejoins the trust ring, the shared applications of other electronic devices can directly display the data of the shared application of this electronic device.

[0403] In this embodiment, when the electronic device hides the data in the shared application, it can set the hidden state identifier of the data stored in the database of this electronic device to a second value to indicate that the data is hidden and temporarily not displayed in the shared application of this electronic device. When the hidden state identifier of the data of this electronic device is set to a first value (such as 0), it indicates that the data is no longer hidden but displayed in the shared application of this electronic device.

[0404] Referring to the above introduction, it can be known that after the first electronic device joins the trust ring where the second electronic device is located, the second electronic device synchronizes the spatial metadata of the fifth target workspace and the material metadata of the first target shared file in the first shared application. Therefore, when the first electronic device exits the trust ring, the second electronic device will hide the spatial metadata of the fifth target workspace and the material metadata of 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, since the first electronic device joins the trust ring, the first electronic device triggers a data synchronization event. Therefore, after S2005 and before S2006, operations such as Bluetooth connection and creation of a transmission channel can be performed between the first electronic device and the second electronic device (this part is not reflected in this embodiment Figure 20 and can be specifically referred to the above introduction, which will not be elaborated in the embodiments of this application).

[0407] Here, the first electronic device may send an eighth prompt message to the server. The eighth prompt message includes the device identifier of the first electronic device, which is used for the server to prompt the second electronic device to display the data in the hidden first shared application in the second shared application and display the fifth prompt message. The fifth prompt message is used to prompt that the first electronic device and the second electronic device are synchronizing shared data.

[0408] S2006. The second electronic device displays the data in the hidden 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 rejoins the trust ring again, when the hidden status identifier of the data in the hidden first shared application of the second electronic device is set 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] Since when the first electronic device exits the trust ring where the second electronic device is located, the second electronic device does not delete the data of the first shared application but only hides the data of the first shared application, when the first electronic device rejoins the trust ring again, the second electronic device can quickly display the data of the first shared application in the second shared application. However, at this time, the second electronic device does not actually synchronize the data in the first shared application. Therefore, the second electronic device displays the fifth prompt message in the second shared application to prompt the user that the first electronic device and the second electronic device are synchronizing the data of the corresponding shared application.

[0411] Referring to the introduction in S2002 above, it can be known that after the first electronic device rejoins the trust ring where the second electronic device is located, the spatial metadata of the fifth target workspace in the first shared application and the material metadata of the first target shared file can be displayed in the second shared application.

[0412] Exemplarily, the fourth prompt message may include any one of: loading, updating, data synchronizing, etc.

[0413] Figure 21 Fig. 4 shows a schematic diagram of an interface for data synchronization provided by an embodiment of the present application.

[0414] As Figure 21 shown in A of, mobile phone G is within the trust ring, and mobile phone H has exited the trust ring. The icon 411 of the first picture is displayed in the shared application of mobile phone G. The icon 412 of the second picture and the icon 431 of the third picture are displayed in the shared application of mobile phone H. Among them, the second picture is the picture collected in the shared application of mobile phone H before mobile phone H exits the trust ring. The third picture is the picture collected in the shared application of mobile phone H after mobile phone H exits the trust ring.

[0415] As Figure 21 shown in B of Figure 21 , after mobile phone H rejoins the trust ring again, the icons 411 of the first picture and 412 of the second picture are displayed in the shared application of mobile phone G, and the fifth prompt message 2101 is displayed in the shared application of mobile phone G. For example, the fifth prompt message can be "Loading".

[0416] S2007, the first electronic device and the second electronic device synchronize the data in the corresponding shared application with each other.

[0417] This step may include the steps of performing data synchronization in any of the above embodiments. After this step, the icon 411 of the first picture, the icon 412 of the second picture, and the icon 431 of the third picture are displayed in the first shared application. The icon 411 of the first picture, the icon 412 of the second picture, and the icon 431 of the third picture are displayed in the second shared application.

[0418] As Figure 22 shown in C of Figure 22 , after mobile phone G and mobile phone H synchronize the data in the corresponding shared application with each other, the icon 411 of the first picture, the icon 412 of the second picture, and the icon 431 of the third picture are displayed in the shared application of mobile phone G. The icon 411 of the first picture, the icon 412 of the second picture, and the icon 431 of the third picture are displayed in the shared application of mobile phone H.

[0419] In one embodiment, after the first electronic device rejoins the trust ring where the second electronic device is located again and before the data synchronization between the first electronic device and the second electronic device is completed (i.e., S2006), in response to a refresh (such as a pull-down refresh) operation on the second shared application, the second electronic device can display the time when the second shared application was last updated with data in the second shared application.

[0420] Figure 22 Fig. shows the fifth schematic diagram of the interface for data synchronization provided by the embodiments of the present application.

[0421] As Figure 22 shown in A of Figure 22 , the icon 411 of the first picture and the icon 412 of the second picture are displayed in the shared application of mobile phone G, and the fifth prompt message 2101 is displayed in the shared application of mobile phone G. In response to the user's operation of pulling down and refreshing the shared application of mobile phone G, as Figure 22 shown in B of Figure 22 , mobile phone G displays in the display interface of the shared application that the data was updated on December 19, 2023, 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 a pull-down refresh) on the second shared application, the second electronic device can display a prompt message indicating that the synchronization is completed 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 a pull-down refresh) on the first shared application, the first electronic device can display a prompt message indicating that the synchronization is completed in the first shared application.

[0423] Further, in the embodiments of the present application, in order to ensure the reliability of data synchronization in each electronic device within the trust ring, when the 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 (such as 72 hours), then this electronic device performs a data synchronization with other devices within the trust ring. This data synchronization can be a full-volume data synchronization.

[0424] It should be noted that this data synchronization will not affect the process of other data synchronizations that this electronic device is performing with other electronic devices within the trust ring.

[0425] Further, in the embodiments of the present application, when the Bluetooth connection between the first electronic device and the second electronic device is successful, if the amount of data to be synchronized between the first electronic device and the second electronic device is small, then the first electronic device and the second electronic device can directly synchronize this data via Bluetooth.

[0426] Further, in the embodiments of the present application, when an electronic device triggers a data synchronization event, this electronic device needs to quickly mount the shared files on this electronic device to the file nodes of other electronic devices within the trust ring through a distributed file system. At this time, only the links to the shared files of this electronic device are displayed on other electronic devices within the trust ring, and other electronic devices do not store the shared files of this electronic device.

[0427] That is to say, all the shared files of each electronic device within the trust ring are mounted in the distributed file system of each electronic device to facilitate the access of electronic devices within the trust ring to the shared files. Among them, access can include non-download operations such as viewing and modifying, as well as download operations.

[0428] In one embodiment, if the mounting fails, then when the electronic device that triggers the data synchronization event displays the shared application in the foreground, refreshes the shared application, or uses the shared files of other electronic devices within the trust ring on this electronic device (i.e., uses shared files across devices), the electronic device that triggers the data synchronization event will check the mounting status and remount.

[0429] Further, in the embodiments of the present 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 shared application on the electronic device, but the event has not been synchronized to other electronic devices in the trust ring yet, when another electronic device in the trust ring accesses the fifth target shared file in the shared application at the local end, 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] Among them, the sixth prompt message can be: access failed, cannot access, the accessed file does not exist, etc.

[0431] Figure 23 Fig. 7 shows a schematic diagram of an interface for data synchronization provided by an embodiment of the present application.

[0432] As Figure 23 shown in A therein, mobile phone G and mobile phone H are in the same trust ring, and the shared applications of mobile phone G and mobile phone H have not completed data synchronization yet. Therefore, the material metadata displayed in the shared applications of mobile phone G and mobile phone H is different. Among them, the shared application of mobile phone G displays the icon 411 of the first picture, the icon 412 of the second picture, and the icon 431 of the third picture. The shared application of mobile phone H displays the icon 411 of the first picture and the icon 412 of the second picture. Among them, the first picture is stored in mobile phone G, the second picture is stored in mobile phone H, and the third picture was originally stored in mobile phone H but has been deleted.

[0433] As Figure 23 shown in B therein, in response to clicking on the icon 431 of the third picture in the shared application of mobile phone G, the shared application of mobile phone G displays a seventh prompt message 2301. For example, the seventh prompt message is that access is denied.

[0434] As Figure 24 shown, an embodiment of the present application further 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 can be interconnected through a line. The processor 2501 is used to support the electronic device to implement each step in the above method embodiments, and the at least one interface circuit 2502 can be used to receive signals from other devices (such as a memory), or send signals to other devices (such as a communication interface). The chip system may include a chip and may also include other discrete devices.

[0435] The embodiments of the present application also provide a computer storage medium, which includes instructions. When the instructions run on the above-mentioned electronic device, the electronic device is caused to execute the steps in the above-mentioned method embodiments.

[0436] The embodiments of the present application also provide a computer program product including instructions. When the instructions run on the above-mentioned electronic device, the electronic device is caused to execute the steps in the above-mentioned method embodiments.

[0437] For the technical effects of the chip system, computer storage medium, and computer program product, refer to the technical effects of the foregoing method embodiments.

[0438] It should be understood that in various embodiments of the present application, the magnitudes of the serial numbers of the above processes do not mean the order of execution is prior or posterior. The order of execution of each process should be determined according to its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.

[0439] Those of ordinary skill in the art can realize that the modules and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraint conditions of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present application.

[0440] Those skilled in the art can clearly understand that for the convenience and conciseness of description, the specific working processes of the systems, devices, and modules described above can refer to the corresponding processes in the foregoing method embodiments, and will not be described herein again.

[0441] In several embodiments provided by the present 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 example, the division of the modules is only a logical function division, and there can be other division methods in actual implementation. For example, multiple modules or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the displayed or discussed mutual coupling or direct coupling or communication connection can be through some interfaces, and the indirect coupling or communication connection of devices or modules can be in an electrical, mechanical, or other form.

[0442] The module described as a separation component may or may not be physically separated. The component shown as a module may or may not be a physical module, that is, it may be located in one device or distributed to multiple devices. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0443] In addition, in each embodiment of the present application, each functional module can be integrated in one device, or each module can exist physically alone, or two or more modules can be integrated in one device.

[0444] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using a software program, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions described in the embodiments of the present application are generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. 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 a website, computer, server, or data center to another website, computer, server, or data center by wire (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.). The computer storage medium can be any available medium that the computer can access or a data storage device such as a server or data center that contains one or more integrated media. The available medium can be a magnetic medium (such as a floppy disk, hard disk, magnetic tape), an optical medium (such as a DVD), or a semiconductor medium (such as a solid state disk (SSD)).

[0445] The above is only the specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art within the technical scope disclosed in the present application can easily think of changes or substitutions, which should all be covered by the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

Claims

1. A data synchronization method, characterized in that, 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 shared application, and the second electronic device includes a second shared application. The first shared application and the second shared application are used to display the material metadata of the 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 shared application; 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 policy supported by both the first shared application and the second shared application. Wherein, the shared data is the data in the first shared application and / or the second shared application. The first policy indicates that the end with the device identifier meeting the first preset condition in the first electronic device and the second electronic device initiates a Bluetooth connection. The first policy also indicates the timing of establishing a transmission channel, and the end meeting the second preset condition in the first electronic device and the second electronic device initiates the establishment of the transmission channel. The transmission channel is used to synchronize the shared data; Display the material metadata of the second shared file in each second shared application in the first shared application.

2. The method according to claim 1, wherein The electronic device triggering the data synchronization event includes any one of the following: An electronic device joining the trust ring, an electronic device in which the data in the shared application within the trust ring is modified, an electronic device in which the interface of the shared application within the trust ring is pulled down and refreshed, an electronic device in which the shared application within the trust ring is switched from the background to the foreground, an electronic device in which the shared application within the trust ring is cold-started.

3. The method according to claim 2, characterized in that, A shared application includes at least one workspace, and each workspace is used to display the material metadata of the shared file; The modification of the data in the shared application includes: the modification of the space metadata of any workspace, and / or, the modification of the material metadata of any shared file.

4. The method according to any one of claims 1 to 3, characterized in that The first electronic device and the second electronic device synchronize shared data according to the first policy supported by both the first shared application and the second shared application, including: The first electronic device and the second electronic device perform a Bluetooth connection based on the first preset condition; In the case of a successful Bluetooth connection, 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; 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 the electronic device with a smaller device identifier initiates a Bluetooth connection; The first electronic device and the second electronic device perform a Bluetooth connection based on the first preset condition, including: Based on the first device identifier being 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, wherein The first preset condition is that the electronic device with a larger device identifier initiates the Bluetooth connection; The first electronic device and the second electronic device perform Bluetooth connection based on the first preset condition, including: Based on the first device identifier being 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 and the second electronic device establish a Bluetooth connection.

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 any one of claims 4-7, characterized in that Based on the transmission channel establishment time and the second preset condition, the first electronic device and the second electronic device establish a transmission channel, including: 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 second preset condition includes: there is first target data in the second shared application to be synchronized to the first shared application, and the second electronic device is in an idle state: the transmission channel establishment time is when the first electronic device is in an idle state; before the first electronic device and the second electronic device synchronize shared 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 and the second electronic device establish a transmission channel; the first target data is the shared data transmitted through the transmission channel.

9. The method according to any one of claims 4 to 7, characterized in that, Based on the transmission channel establishment time and the second preset condition, the first electronic device and the second electronic device establish a transmission channel, including: 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 second preset condition includes: the device identifier of the second electronic device is at the head of the first synchronization queue of the first electronic device; the transmission channel establishment time is 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 synchronize shared 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 and the second electronic device establish a transmission channel; the first target data is the shared data transmitted through the transmission channel.

10. The method according to claim 9, wherein, 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: 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 the first synchronization queue.

11. The method according to any one of claims 8 to 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 shared application and the second shared 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 state of the first electronic device to synchronization success, and the first synchronization completion message is further used to instruct the second electronic device to set the synchronization state of the second electronic device to synchronization success; The first electronic device sets the synchronization state to synchronization success.

12. The method according to any one of claims 8-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 first target data is included in the second shared application and the first target data is not included in the first shared application.

13. The method according to any one of claims 4 - 7, characterized in that, Based on the timing of establishing the transmission channel and the second preset condition, the establishment of the transmission channel between the first electronic device and the second electronic device 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 second preset condition includes: the second target data is included in the first shared application and the first electronic device is in an idle state; the timing of establishing the transmission channel is that the second target data is included in the first shared application, the first target data is not 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 the shared data, the second target data is included in the first shared application, the second target data is not included in the second shared application, the first target data is not included in the first shared application, and the first target data is included in the second shared application; The first electronic device and the second electronic device establish a transmission channel; the second target data is the shared data transmitted 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 the current state to the synchronization state.

15. The method according to any one of claims 4 to 7, characterized in that, Based on the timing of establishing the transmission channel and the second preset condition, the establishment of the transmission channel between the first electronic device and the second electronic device includes: The first electronic device receives a transmission channel establishment request sent by the second electronic device; wherein, the electronic device meeting the second preset condition is the second electronic device, and the second preset condition includes: the device identifier of the first electronic device is at the head of the second synchronization queue of the second electronic device; the timing for establishing the transmission channel is: the timing for establishing the transmission channel is when the first shared application includes second target data, the second shared application does not include first target data, and the first electronic device is in an idle state; before the first electronic device and the second electronic device synchronize shared 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; The first electronic device and the second electronic device establish a transmission channel; the second target data is the shared data transmitted in the transmission channel.

16. The method according to any one of claims 13 - 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 shared application and the second shared 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 state of the first electronic device to synchronization success, and the second synchronization completion message is further used to instruct the second electronic device to set the synchronization state of the second electronic device to synchronization success; The first electronic device sets the synchronization state to synchronization success.

17. The method according to any one of claims 13 - 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 there is the second target data in the first shared application; the second negotiation message includes: the current state of the second electronic device, and the second historical timestamp when the second shared application last synchronized data from the first shared 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 shared application does not include the first target data.

18. The method according to claim 12 or 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 there is the first target data in the second shared application; the first negotiation message includes the first historical timestamp when the first shared application last synchronized data from the second shared 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 any one of claims 4 to 18, wherein The method further includes: In the case 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-19, 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 policy; wherein, the second policy is a policy supported by the first shared application and / or the second shared application, and the second policy is a historical policy of the first policy; the second policy instructs the first electronic device and the second electronic device to directly synchronize the shared data.

21. The method according to claim 20, wherein The first electronic device and the second electronic device synchronize the shared data according to the second policy, including: The first electronic device sends a transmission channel request to the second electronic device. The first electronic device and the second electronic device establish a transmission channel. 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-21, characterized in that, The method further includes: The first electronic device obtains the version number of the second shared application. Based on the version numbers of the first shared application and the second shared application being the same, the first electronic device determines that the first electronic device and the second electronic device synchronize the shared data according to the first policy; otherwise, it determines that the first electronic device and the second electronic device synchronize the shared data according to the second policy.

23. The method according to claim 22, wherein 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, wherein 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-24, 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 first data in the first shared application, the first electronic device deletes the first data from the first shared application; wherein, the first data may be third target data in the first shared application, or the first data is fifth target data synchronized by the first shared application from the second shared application. The first electronic device sets the existence status identifier of the first data to a second value to obtain 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, wherein When the first data is the fifth target data, the method further includes: The first electronic device receives the second prompt message or the third prompt message sent by the second electronic device; wherein, the second prompt message is used to prompt that the deletion of the fifth target data is successful, and the third prompt message is used to prompt that the deletion of the fifth target data fails; The first electronic device displays the second prompt message or the third prompt message in the first shared application.

27. The method according to any one of claims 1-26, 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 for 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, wherein 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 for the server to prompt the second electronic device to display the hidden data in the first shared application in the second shared application, and to display a fifth prompt message; the fifth prompt message is used to prompt that the first electronic device and the second electronic device are synchronizing the shared data.

29. An electronic device, characterized in that, It includes a processor and a memory, and instructions are stored in the memory. When the processor executes the instructions, the method according to any one of claims 1-28 is executed.

30. A computer-readable storage medium, characterized in that, It includes instructions that, when executed on an electronic device, cause the electronic device to execute the method according to any one of claims 1-28.

Citation Information

Patent Citations

  • Data exchange method based on equipment discovery mechanism

    CN102904616A

  • Method for sharing data in local area network and electronic device

    CN111066306A

  • Data sharing implementation method, data sending end and data receiving end

    CN111246592A

  • Cross-device content sharing method, electronic device and system

    CN112486363A

  • Network connection method and device, computer equipment and storage medium

    CN112600820A