Data synchronization method and electronic equipment

By automatically synchronizing the material metadata of shared files between electronic devices in the trust ring, the problem of data inconsistency in shared applications is solved, and storage resources are saved and user experience is improved.

CN119226249APending Publication Date: 2024-12-31HONOR DEVICE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310798828.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-06-30
Publication Date
2024-12-31

AI Technical Summary

Technical Problem

Between electronic devices within the trust ring, the synchronization of the material metadata of shared files is inconsistent, resulting in poor user experience, wasted storage resources and inconsistent data.

Method used

Through the automatic synchronization method, each electronic device in the trust ring sends and receives the material metadata of shared files to each other, ensuring that the number, content and sort of material metadata displayed in each shared application are consistent, and when the data changes Real-time synchronization.

Benefits of technology

It realizes the automatic consistency of material metadata in the shared applications of various electronic devices within the trust ring, saving storage space and improving user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119226249A_ABST
    Figure CN119226249A_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 automatically keeping material metadata displayed in a shared application of each piece of electronic equipment in a trust ring consistent. Taking a trust ring comprising a first electronic device and a second electronic device, the first electronic device comprising a first shared application and the second electronic device comprising a second shared application as an example, the method comprises the following steps: the first electronic device automatically sends material metadata of a first shared file in the first electronic device to the second electronic device, displaying in the second shared application; and the second electronic equipment automatically sends material metadata of a second shared file in the second electronic equipment to the first electronic equipment so as to be displayed in the first shared application. In this way, the material metadata displayed in the first sharing application and the second sharing application are automatically kept consistent. Based on this, the material metadata displayed in the shared application of each electronic device within the trust ring automatically remains consistent.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The 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] The sharing application in the electronic device can be used to collect the shared files in the electronic device and display the material metadata of the shared files. When the sharing application of the first electronic device synchronizes the material metadata of the shared files with the sharing applications of other electronic devices in the trust ring, it is first necessary to specify the electronic device to be synchronized, and then send the material metadata of the shared files to the electronic device to be synchronized, so that the material metadata of the shared files is displayed in the sharing application of the electronic device to be synchronized. However, the material metadata of the shared files cannot be synchronously displayed in the sharing applications of other electronic devices in the trust ring except the specified electronic device, resulting in inconsistency in the material metadata of the shared files displayed in the sharing applications of each electronic device in the trust ring. Summary of the invention

[0003] The present application provides a data synchronization method and an electronic device, which are used to automatically keep consistent the material metadata displayed in the shared applications of each electronic device within a trust ring.

[0004] In order to achieve the above objectives, this application adopts the following technical solutions:

[0005] In a first aspect, a data synchronization method is provided, which can be applied to a first electronic device, wherein the first electronic device and the 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 can be used to display the material metadata of the shared files of each electronic device within the trust ring. The method may include: the first electronic device displays the material metadata of the first shared file in the first electronic device in the first shared application, and sends the material metadata of the first shared file to the second electronic device for display in the second shared application, and the material metadata displayed in the second shared application includes the material metadata of the second shared file in the second electronic device; then the first electronic device can also receive the material metadata of the second shared file sent by the second electronic device, and display the material metadata of the second shared file in the first shared application.

[0006] In the data synchronization method provided in the present application, a first electronic device automatically sends the material metadata of a first shared file in the first electronic device to a second electronic device, so that the material metadata of the first shared file can be displayed in a second shared application of the second electronic device. At the same time, the second electronic device also automatically sends the material metadata of the second shared file in the second electronic device to the first electronic device, so that the material metadata of the second shared file can be displayed in the first shared application of the first electronic device. In this way, the first shared application includes the material metadata in the second shared application, and the second shared application also includes the material metadata in the first shared application. Based on this, the shared application in any electronic device within the trust ring can display the material metadata of the shared files of each electronic device within the trust ring, so that the material metadata displayed in the shared applications of each electronic device within the trust ring automatically remains consistent.

[0007] In a possible implementation of the first aspect, the shared applications of each electronic device in the trust ring include a workspace. The workspace is used to display the material metadata of the shared files in each electronic device. The workspace has spatial metadata for indicating the properties of the workspace. The spatial metadata of the workspace includes the name of the workspace. Before the first electronic device displays the material metadata of the second shared file in the first shared application, the data synchronization method further includes:

[0008] First, the first electronic device sends the spatial metadata of the first target workspace in the first shared application to the second electronic device, for copying the first target workspace in the second shared application. The name of the first target workspace is different from the names of all workspaces in the second shared application. Next, the first electronic device receives the spatial metadata of the second target workspace in the second shared application sent by the second electronic device. Finally, the first electronic device copies the second target workspace in the first shared application based on the spatial metadata of the second target workspace and the spatial metadata of all workspaces in the first electronic device; the name of the second target workspace is different from the names of all workspaces in the first electronic device.

[0009] From the above process of copying the workspace, it can be seen that the name of each workspace in a shared application is different, and because the electronic devices in the trust ring automatically synchronize the workspaces with each other, the workspaces in each shared application automatically remain consistent.

[0010] In another possible implementation of the first aspect, the spatial metadata of a workspace includes a spatial source identifier of the workspace. A spatial source identifier is used to identify that the workspace is created by this electronic device, or copied from other electronic devices in the trust ring. The data synchronization method also includes: setting the spatial source identifier of the copied workspace to other electronic devices in the trust ring. In this way, the source of each workspace in a shared application can be determined.

[0011] In another possible implementation of the first aspect, the spatial metadata of a workspace also includes a spatial sorting timestamp of the workspace, which is used to sort the workspace. When a shared application includes multiple workspaces, the data synchronization method further includes: sorting each workspace according to the spatial sorting timestamp of each workspace in the multiple workspaces. Specifically, the sorting can be in descending order or in ascending order, but is not limited thereto.

[0012] By using the same sorting rule to sort each workspace in each shared application, it can be ensured that the sorting of all workspaces in each shared application is also consistent. In this way, in addition to the number and name of the workspaces in each shared application being consistent, the sorting of the workspaces in each shared application is also consistent.

[0013] In another possible implementation manner of the first aspect, for a target workspace in the same shared application, the target workspace is any workspace in the shared application:

[0014] When the target workspace is a newly created workspace, the spatial sorting timestamp of the target workspace refers to: the moment when the target workspace is created; when the target workspace is moved to the first position of all workspaces in a shared application, the spatial sorting timestamp of the target workspace refers to: the moment when the position of the target workspace is moved to the first position of all workspaces; when the target workspace is moved to the last position of all workspaces in a shared application, the spatial sorting timestamp of the target workspace refers to: the difference between the spatial sorting timestamp of the previous workspace and the first preset value; when the target workspace is moved between any two adjacent workspaces, the spatial sorting timestamp of the target workspace refers to: half of the sum of the spatial sorting timestamps of any two adjacent workspaces.

[0015] In another possible implementation of the first aspect, the material metadata of a shared file includes an identifier of the workspace to which the shared file belongs. The above-mentioned first electronic device displays the material metadata of the second shared file in the first shared application, including: first, the first electronic device determines the name of the workspace to which the second shared file belongs in the second shared application based on the identifier of the workspace to which the second shared file belongs. Next, the first electronic device determines the workspace to which the second shared file belongs in the first shared application based on the name of the workspace to which each second shared file belongs in the second shared application. Finally, the first electronic device displays the material metadata of the second shared file in the workspace to which it belongs in the first shared application. In this way, it can be ensured that the material metadata of the same shared file can be displayed in the workspace with the same name.

[0016] In another possible implementation of the first aspect, the material metadata of the shared file also includes a file sorting timestamp of the shared file, which is used to sort the shared file. When the belonging workspace includes material metadata of multiple shared files, the first electronic device displays the material metadata of the second shared file in the belonging workspace in the first shared application, including: first, the first electronic device sorts and displays the material metadata of each shared file in the belonging workspace in the first shared application according to the file sorting timestamp of each shared file in the belonging workspace in the first shared application. Among them, the material metadata of each shared file includes the material metadata of the second shared file.

[0017] In another possible implementation of the first aspect, for the material metadata of the target shared file in the same workspace: when the material metadata of the target shared file is newly added to the workspace, the file sorting timestamp of the target shared file refers to: the moment when the material metadata of the target shared file is newly added to the workspace; when the material metadata of the target shared file is moved to the first position of the material metadata of all shared files in the workspace, the file sorting timestamp of the target shared file refers to: the moment when the material metadata of the target shared file is moved to the first position of the material metadata of all shared files; when the material metadata of the target shared file is moved to the last position of the material metadata of all shared files in the workspace, the file sorting timestamp of the target shared file refers to: the difference between the file sorting timestamp of the material metadata of the previous shared file of the material metadata of the target shared file and the second preset value; when the material metadata of the target shared file is moved between the material metadata of any two adjacent shared files, the file sorting timestamp of the target shared file refers to: half of the sum of the file sorting timestamps of any two adjacent shared files; when the material metadata of other shared files in the workspace is dragged to the position of the material metadata of the target shared file and forms a folder with the material metadata of the target shared file, the file sorting timestamp of the folder is the file sorting timestamp of the target shared file.

[0018] In another possible implementation of the first aspect, the data synchronization method also includes: the first electronic device determines the material metadata of the third shared file that has changed in the third target workspace, where the third target workspace is any workspace in the first shared application; and the first electronic device sends the material metadata of the third shared file to the second electronic device, for updating the material metadata of the third shared file in the fourth target workspace in the second electronic device; the name of the fourth target workspace is the same as the name of the third target workspace.

[0019] In another possible implementation of the first aspect, the data synchronization method also includes: the first electronic device receives material metadata of a fourth shared file in a fourth target workspace sent by the second electronic device, the fourth target workspace is any workspace in the second shared application, and the material metadata of the fourth shared file is the material metadata of the shared file that has changed in the fourth target workspace; and the first electronic device updates the material metadata of the fourth shared file in the third target workspace based on the material metadata of the fourth shared file, and the name of the fourth target workspace is the same as the name of the third target workspace.

[0020] Based on this, when the material metadata of a shared file in any electronic device within the trust ring changes, the material metadata of the same shared file in other electronic devices within the trust ring will change accordingly, so that the material metadata displayed in the shared applications of each electronic device within the trust ring will always automatically remain consistent.

[0021] In another possible implementation of the first aspect, the material metadata of the shared file that has changed includes at least one of the following data: material metadata of the shared file that has been added to the workspace, material metadata of the shared file that has been deleted from the workspace, material metadata of a folder after multiple material metadata in the workspace are dragged into a folder, and material metadata of the shared file whose position has changed in the workspace.

[0022] In another possible implementation of the first aspect, the data synchronization method also includes: the first electronic device generates first indication information in response to a target operation on the material metadata of the fifth shared file in the first shared application; the first indication information is used to instruct the second electronic device to send the fifth shared file to the first electronic device, and the fifth shared file is a file in the second electronic device; the first electronic device sends the first indication information to the second electronic device; and the first electronic device receives the fifth shared file.

[0023] In another possible implementation of the first aspect, the target operation includes a non-download operation. The data synchronization method further includes: temporarily storing the fifth shared file in the memory of the first electronic device. In this way, when the second electronic device exits the trust loop, the first electronic device automatically deletes the fifth shared file, thereby not occupying the storage space of the first electronic device.

[0024] In another possible implementation of the first aspect, the non-download operation includes a modification operation; the data synchronization method further includes: the first electronic device temporarily stores a sixth shared file, the sixth shared file being a file modified from the fifth shared file; the first electronic device sends the sixth shared file to the second electronic device, for persistently storing the sixth shared file in the second electronic device. In this way, the shared files on other electronic devices in the trusted ring can be modified in any electronic device in the trusted ring, and the other electronic devices will also store the modified shared files.

[0025] In another possible implementation of the first aspect, the target operation includes a download operation. The data synchronization method further includes: persistently storing the fifth shared file in the first electronic device. In this way, even if the second electronic device exits the trust loop, the first electronic device still stores the fifth shared file.

[0026] In another possible implementation of the first aspect, the data synchronization method further includes: the first electronic device receives second indication information sent by the second electronic device. The second indication information is generated by the second electronic device in response to a target operation on the material metadata of the seventh shared file, and is used to instruct the first electronic device to send the seventh shared file to the second electronic device. The seventh shared file is a file in the first electronic device. And the first electronic device sends the seventh shared file to the second electronic device, so that the second electronic device stores the seventh shared file.

[0027] In another possible implementation of the first aspect, the target operation includes a non-download operation. Storing the seventh shared file refers to temporarily storing the seventh shared file in the memory of the second electronic device. In this way, when the first electronic device exits the trust loop, the second electronic device will automatically delete the seventh shared file, thereby not occupying the storage space of the second electronic device.

[0028] In another possible implementation of the first aspect, the non-download operation includes a modification operation. The data synchronization method further includes: receiving an eighth shared file, and persistently storing the eighth shared file, where the eighth shared file is a file modified from the seventh shared file. In this way, the shared files on other electronic devices in the trusted ring can be modified in any electronic device in the trusted ring, and the other electronic devices will also store the modified shared files.

[0029] In another possible implementation of the first aspect, the target operation includes a download operation. Storing the seventh shared file refers to: persistently storing the seventh shared file in the second electronic device. In this way, even if the first electronic device exits the trust loop, the seventh shared file is still stored in the second electronic device.

[0030] In a second aspect, an electronic device is provided, comprising: a processor and a memory; the memory stores instructions, and when the processor executes the instructions, the method described in the first aspect and any embodiment thereof is executed.

[0031] According to a third aspect, a computer-readable storage medium is provided, comprising instructions, which, when executed on an electronic device, enable the electronic device to execute the method according to the first aspect and any embodiment thereof.

[0032] In a fourth aspect, a computer program product comprising instructions is provided. When the instructions are executed on the electronic device, the electronic device executes the method as described in the first aspect and any embodiment thereof.

[0033] In a fifth aspect, a chip system is provided, the chip system including a processor for supporting an electronic device to implement the functions involved in the first aspect. In a possible design, the electronic device also includes an interface circuit, which 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.

[0034] Among them, the technical effects of the second to fifth aspects can refer to the technical effects of the first aspect and any of its embodiments, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] Figure 1 A schematic diagram of a communication system architecture applicable to a data synchronization method provided in an embodiment of the present application;

[0036] Figure 2 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application;

[0037] Figure 3 A schematic diagram of the software architecture of a communication system provided in an embodiment of the present application;

[0038] Figure 4 This is one of the interface diagrams of data synchronization in the prior art;

[0039] Figure 5 This is a second schematic diagram of a data synchronization interface in the prior art;

[0040] Figure 6 This is a third schematic diagram of a data synchronization interface in the prior art;

[0041] Figure 7 One of the schematic diagrams of a data synchronization interface provided in an embodiment of the present application;

[0042] Figure 8 A second schematic diagram of a data synchronization interface provided in an embodiment of the present application;

[0043] Fig. 9 A third schematic diagram of a data synchronization interface provided in an embodiment of the present application;

[0044] Fig.10 A fourth schematic diagram of a data synchronization interface provided in an embodiment of the present application;

[0045] Fig.11 A flowchart of a data synchronization method provided in an embodiment of the present application;

[0046] Fig.12 A fifth diagram of a data synchronization interface provided in an embodiment of the present application;

[0047] Fig.13 A sixth schematic diagram of a data synchronization interface provided in an embodiment of the present application;

[0048] Fig.14 A schematic diagram of the structure of a chip system provided in an embodiment of the present application. DETAILED DESCRIPTION

[0049] The terms "first", "second", etc. involved in the embodiments of the present application are only used to distinguish features of the same type and cannot be understood as indicating relative importance, quantity, order, etc.

[0050] The terms "exemplary" or "for example" and the like in the embodiments of the present application are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of the terms "exemplary" or "for example" is intended to present the related concepts in a specific way.

[0051] The terms "coupling" and "connection" involved in the embodiments of the present application should be understood in a broad sense. For example, they may refer to a direct physical connection, or an indirect connection achieved through electronic devices, such as a connection achieved through resistors, inductors, capacitors or other electronic devices.

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

[0053] Global Collection: It is an application (APP) on an electronic device that has a collection (or collection) function. Users can drag the files (or materials) (such as pictures, documents, text, audio, video, web pages, folders, etc.) that need to be collected on the screen of the electronic device to the global collection application for collection, so as to facilitate later reference. The global collection application does not store the file entity of the file, but only the material metadata of the file. When each electronic device in the same trust ring is installed with the global collection application, the files collected in the global collection application of an electronic device in the trust ring can be synchronized to the global collection applications of other electronic devices in the trust ring.

[0054] Magic Ring: It is a technical solution based on the identity authentication system to achieve cross-system multi-device trusted interconnection and enable intelligent flow and sharing of services between devices. One account can correspond to one magic ring, and multiple electronic devices can log in to the same account to join the same magic ring. Electronic devices in the same magic ring can automatically connect when they are close to each other, and services such as incoming calls, notification messages, documents, and audio and video can flow between various electronic devices.

[0055] Metadata: (metadata), also known as intermediary data, relay data, is data that describes data (data aboutdata), mainly information that describes data attributes (property), used to support functions such as indicating storage location, historical data, resource search, file records, etc. Metadata is a kind of electronic directory. In order to achieve the purpose of compiling a directory, it is necessary to describe and collect the content or characteristics of the data, thereby achieving the purpose of assisting data retrieval. The metadata involved in the embodiments of the present application may include the material metadata of the file and the spatial metadata of the workspace. Among them, a workspace can be a page in a global collection application.

[0056] Master / slave replication mode: After the data of the master device is updated, the updated data will be automatically synchronized to the slave device. The master device and the slave device are relative. Usually, the device that sends data can be the master device, and the device that receives data can be the slave device. For example, when the second electronic device in the trust ring sends data to the first electronic device in the trust ring, the second electronic device is the master device and the first electronic device is the slave device; when the first electronic device sends data to the second electronic device, the first electronic device is the master device and the second electronic device is the slave device.

[0057] Distributed file system (DFS): refers to the physical storage resources of file management that are not necessarily directly connected to the local node, but are connected to the node through a computer network. In simple terms, it is to collect some scattered (distributed on various computers in the local area network) shared folders into one file (virtual shared folder). For users, to access these shared folders, users do not feel that these shared files are scattered on various computers.

[0058] Exemplarily, the shared file on the first electronic device can be mounted on the file node of the second electronic device through a distributed file system. At this time, only the link to the shared file is displayed on the second electronic device, and the second electronic device does not actually store the shared file. Therefore, when the user opens the shared file on the second electronic device, he actually uses the software on the second electronic device to open the shared file of the first electronic device. After the user modifies the shared file on the second electronic device, the shared file is still stored in the first electronic device.

[0059] Full synchronization: is a way of synchronizing database data, which means synchronizing all the data in the database at one time. For example, the first electronic device sends all the data in the global favorite application in the first electronic device to the second electronic device.

[0060] Incremental synchronization: Another way of data synchronization, which refers to synchronizing only the different data in two databases. For example, the first electronic device sends all the changed data in the global favorite application in the first electronic device to the second electronic device.

[0061] The data synchronization method provided in the embodiment of the present application can be applied to Figure 1 The communication system shown in the figure may be a trust ring composed of multiple electronic devices. Figure 1 As shown, the trust circle may include a first electronic device 101 and at least one second electronic device 102. Files may be synchronized between the first electronic device 101 and the second electronic device 102, and between different second electronic devices 102. The first electronic device 101 and the second electronic device 102 may be electronic devices of the same type or of different types. Each second electronic device in the at least one second electronic device 102 may be electronic devices of the same type or of different types.

[0062] The electronic device involved in the embodiments of the present application may be a device with a communication function, and the electronic device may be mobile or fixed. The electronic device may be deployed on land (e.g., indoors or outdoors, handheld or vehicle-mounted, etc.), on the water (e.g., ships, etc.), or in the air (e.g., airplanes, balloons, etc.). The electronic device may be referred to as user equipment (UE), access terminal, terminal unit, subscriber unit (subscriberunit), terminal station, mobile station (MS), mobile station, terminal agent or terminal device, etc. For example, the electronic device may 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 is described below.

[0063] Taking a mobile phone as an example, Figure 2 The hardware structure diagram of an electronic device 200 provided in an embodiment of the present application is shown. The electronic device 200 may include: a processor 210, a memory 220, a universal serial bus (USB) interface 230, a power management module 240, an antenna, a communication module 250, a display screen 260, an audio module 270, a camera 280, etc.

[0064] It is to be understood that the structure illustrated in this embodiment 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 some components, or separate some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

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

[0066] The processor 210 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 210 is a cache memory. The memory may store instructions or data that the processor 210 has just used or cyclically used. If the processor 210 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 210, and thus improves the efficiency of the system.

[0067] In some embodiments, the processor 210 may include one or more interfaces. The interface 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.

[0068] It is understandable that the interface connection relationship between the modules illustrated in this embodiment is only a schematic illustration and does not constitute a structural limitation of 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.

[0069] The memory 220 can be used to store computer executable program codes, which 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, an application required for at least one function (such as a sound playback function, an interface display function, etc.). The data storage area may store data (such as notification messages) created during the use of the electronic device, etc. 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.

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

[0071] The communication module 250 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) network), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the electronic device 200. The communication module 250 can be one or more devices integrating at least one communication processing module. The communication module 250 receives electromagnetic waves via an antenna, modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 210. The communication module 250 can also receive the signal to be sent from the processor 210, modulate the frequency, amplify it, and convert it into electromagnetic waves for radiation through the antenna.

[0072] In some embodiments, the antenna of the electronic device 200 is coupled to the communication module 250 so that the electronic device 200 can communicate with the network and other devices through wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, global navigation satellite system (GNSS), WLAN, NFC, FM, and / or 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).

[0073] In the embodiment of the present application, the electronic device 200 can access the local area network via Wi-Fi and form a trust ring with other electronic devices. Alternatively, the electronic device 200 can establish a connection with other electronic devices via Bluetooth to form a trust ring. Further, the electronic device 200 can synchronize data with other electronic devices in the trust ring via Wi-Fi or Bluetooth.

[0074] The electronic device 200 implements the display function through a GPU, a display screen 260, and an application processor. The GPU is a microprocessor for image processing, which connects 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.

[0075] 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 or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Mini-LED, Micro-OLED, Micro-OLED, quantum dot light-emitting diodes (QLED), etc. In the embodiment of the present application, the display screen 260 can be used to display the material metadata of the shared file in the shared application.

[0076] The electronic device 200 can realize the shooting function through the ISP, the camera 280, the video codec, the GPU, the display screen 260 and the application processor.

[0077] The audio module 270 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into 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 arranged in the processor 210, or some functional modules of the audio module 270 can be arranged in the processor 210.

[0078] The camera 280 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the 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 for conversion 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 or other format.

[0079] It is understandable that, generally speaking, the realization of electronic device functions requires not only hardware support but also software cooperation.

[0080] The software system of the electronic device can adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. Take the example to illustrate the software structure of the electronic device.

[0081] Figure 3 It is a schematic diagram of the software architecture of a communication system provided in an embodiment of the present application.

[0082] The layered architecture divides the software into several layers, each with a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android operating system It is divided into four layers, from top to bottom: application layer, application framework layer, middle layer and hardware layer.

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

[0084] The sharing application can be used to collect shared files in various electronic devices in the communication system (ie, the trust ring) and display the material metadata of the shared files in various electronic devices. The shared file can be any file in any electronic device in the communication system (ie, the trust ring).

[0085] 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 identification of the electronic device to which the shared files belong. The distributed file system is also used to transmit the file entity of the shared files.

[0086] The application framework layer provides an application programming interface (API) and a programming framework for the applications in the application layer. The application framework layer includes some predefined functions. For example, Figure 3 As shown, the application framework layer may include a window manager service (WMS), a view system, a file system, and the like.

[0087] 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, lock the screen, capture the screen, etc.

[0088] The view system may include visual controls, such as controls for displaying text, controls for displaying images, etc. The view system may be used to build applications. A display interface may consist of at least one view. For example, a display interface including a shared application may include a view for displaying text, a view for displaying images, etc.

[0089] The file system can be used to store the file entities of all files of the electronic device, the storage paths of all files, and the device identification of the electronic device. In other words, the file system of an electronic device stores the file entities and storage paths of the shared files collected in the shared application of the electronic device.

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

[0091] The device manager is used to store the device identification of the electronic device and to obtain the device identifications of other electronic devices in the trust ring.

[0092] The channel manager is used to obtain the device identification of other electronic devices in the trust ring from the device manager, and when joining the trust ring, it creates a near-field transmission channel (magic link) with other electronic devices in the trust ring. The near-field transmission channel is used to transmit the metadata of shared applications, the material metadata of shared files in shared applications, and the file entity of shared files to the transmission module of the hardware layer, and then send it to other electronic devices in the trust ring through the transmission module of the hardware layer; the near-field transmission channel is also used to receive the metadata of shared applications in other electronic devices, the material metadata of shared files in shared applications, and the file entity of shared files from the transmission module, and transmit it upward to the application layer.

[0093] The types of files synchronized between electronic devices within the trust ring may include: pictures, videos, audios, documents, folders, web pages, texts, etc. The embodiments of the present application do not limit the types of files.

[0094] Each electronic device in the trust ring is installed with a sharing application. The sharing application can be used to display the material metadata of at least one shared file. A shared file in an electronic device in the trust ring can be synchronized to other electronic devices in the trust ring through the sharing application.

[0095] The following description will be made by taking the synchronization of files from a first electronic device to a second electronic device within a trust ring as an example.

[0096] When the trust circle includes at least two second electronic devices, the process of synchronizing files from the first electronic device to the second electronic device may include: first, the first electronic device responds to the user's operation of adding a shared file (any file in the first electronic device) to a shared application, and the shared application of the first electronic device displays the material metadata of the shared file (such as the icon (such as a thumbnail), name, etc. of the shared file); then, in response to the user's operation of selecting the second electronic device to be synchronized in the first electronic device, the first electronic device sends the file entity of the shared file and the material metadata of the shared file to the second electronic device to be synchronized through the near-field transmission channel between the first electronic device and the second electronic device to be synchronized. Based on this, the material metadata of the shared file can be displayed in the shared application of the second electronic device to be synchronized, and the shared file is persistently stored in the second electronic device.

[0097] Assume that the trust circle includes a first electronic device (e.g., mobile phone A), two second electronic devices (e.g., mobile phone B and tablet computer C), and the shared file is a picture. Figure 4 and Figure 5 , the conventional process of synchronizing pictures between a first electronic device and a second electronic device is introduced.

[0098] like Figure 4 As shown in A in FIG. 1 , mobile phone A displays a preview interface 401 of a gallery application. Preview interface 401 includes a first picture 402 and a first floating window 403. First floating window 403 is used to display a shared application of mobile phone A. In response to the user's operation of adding first picture 402 to a shared application (such as dragging first picture 402 to first floating window 403), as shown in FIG. Figure 4 As shown in B in FIG. 1 , a thumbnail of the first picture 402 is displayed in the shared application of mobile phone A. Based on this, mobile phone A collects the first picture 402 in the shared application of mobile phone A. At this time, the material metadata of the first picture 402 is displayed in the shared application of mobile phone A.

[0099] like Figure 5 As shown in A in FIG. 5 , the main interface 501 of the mobile phone A displays the first floating window 403, and the first floating window 403 displays the thumbnail of the first picture 401. In response to the first operation (such as a long press operation, a click operation, etc.) of the user on the thumbnail of the first picture 401 in the first floating window 403, as shown in FIG. Figure 5 As shown in B in FIG. 4 , the first floating window 403 displays the first control 502 (such as a flow control). In response to the user's click operation on the first control 502, as shown in FIG. Figure 5As shown in C in FIG. 1 , the main interface 501 of mobile phone A displays a second floating window 503. The second floating window 503 is used to display the icon 504 of mobile phone B and the icon 505 of tablet computer C in the same trust circle. In response to the user clicking the icon 505 of tablet computer C, mobile phone A sends the material metadata of the first picture 402 to the sharing application of tablet computer C, and sends the first picture 402 to tablet computer C. Figure 5 As shown in D in FIG. 5 , the main interface 506 of the tablet computer C displays a third floating window 507. The third floating window 507 is used to display the shared applications of the tablet computer C. The third floating window 507 displays a plurality of thumbnails of pictures collected in the shared applications of the tablet computer C, wherein the thumbnails of these pictures include a thumbnail of the first picture 402, and the first picture 402 is displayed in the preview interface 508 of the gallery application of the tablet computer C.

[0100] Combination Figure 5 A- Figure 5 In C, such as Figure 6 As shown in A in FIG. 1 , the main interface 601 of mobile phone B displays a fourth floating window 602. The fourth floating window 602 is used to display the shared application of mobile phone B. The fourth floating window 602 displays thumbnails of multiple pictures collected in the shared application of mobile phone B, and the thumbnails of these pictures do not include the thumbnail of the first picture 402. Figure 6 As shown in B in FIG. 8 , the first picture 402 is not displayed in the preview interface 603 of the gallery application of mobile phone B.

[0101] From the above synchronization process, we can see that there are the following problems in the process of synchronizing files between electronic devices in the same trust ring:

[0102] (1) Within the same trust circle, only designated electronic devices can synchronize shared files. If you want to synchronize shared files with every electronic device within the same trust circle, you need to repeat the operation multiple times. This makes the synchronization process cumbersome and affects the user experience.

[0103] (2) During the synchronization process, the file entity of the shared file and the material metadata of the shared file are sent to the designated electronic device. In this way, the shared file will be persistently stored in the designated electronic device. In other words, even if the designated electronic device exits the trust loop, the file entity of the shared file will still be stored in the designated electronic device. Especially when the shared file occupies a large amount of space, it will occupy more storage space of the designated electronic device, wasting the storage resources of the designated electronic device.

[0104] (3) The shared applications of each electronic device in the same trust circle can only collect files stored in the electronic device itself, which leads to inconsistent metadata of the materials displayed in the shared applications of each electronic device in the same trust circle. Figure 5 A- Figure 5 C in Figure 6 A and Figure 6 As shown in B, the quantity and content of the material metadata displayed in the shared applications of mobile phone A, mobile phone B and tablet computer C are different. In other examples, even if the quantity and content of the material metadata displayed in the shared applications of various electronic devices are the same, the order of the material metadata may not be the same. In this way, any electronic device cannot understand the specific situation of the shared files collected in the shared applications of other electronic devices in the trust ring.

[0105] Based on the above problems, an embodiment of the present application provides a data synchronization method, in which the first electronic device and the second electronic device within the trust ring will automatically synchronize the material metadata of the shared files displayed in their respective shared applications to each other, so that the quantity, content, and order of the material metadata displayed in the shared application of the first electronic device and the material metadata displayed in the shared application of the second electronic device after synchronization are consistent. When the material metadata displayed in the shared application of any electronic device changes, the material metadata displayed in the shared applications of other electronic devices will automatically keep in sync with it. In this way, the material metadata in the shared applications of each electronic device within the same trust ring can automatically remain consistent and always be consistent.

[0106] In addition, when a user performs a download operation (such as Save As, etc.) on any shared file of other electronic devices on an electronic device, the electronic device will persistently store the file entity of the shared file. When a user performs a non-download operation (such as preview, modify, etc.) on a shared file on the electronic device, the electronic device will not persistently store the file entity of the shared file, but only open the shared file on other electronic devices through the software on the electronic device (i.e., use the file across devices). In this way, not only can the shared files on other electronic devices be used on the electronic device, but the storage space of the electronic device can also be greatly saved.

[0107] For example, Figure 7 As shown in A in FIG. 1 , mobile phone A displays a preview interface 401 of a gallery application. Preview interface 401 includes a first picture 402 and a first floating window 403, and first floating window 403 is used to display a shared application of mobile phone A. First floating window 403 includes a thumbnail 701 of a second picture and a thumbnail 702 of a third picture. In response to the user's operation of adding the first picture 402 to the shared application of mobile phone A (such as dragging the first picture 402 to the first floating window 403), as shown in FIG. Figure 7As shown in B in FIG. 1 , the first floating window 403 displays the thumbnail of the first picture 402, the thumbnail 701 of the second picture, and the thumbnail 702 of the third picture from top to bottom. Based on this, mobile phone A collects the first picture 402 in the sharing application of mobile phone A. Figure 7 As shown in C in FIG. 1 , the sharing application of mobile phone B also displays the thumbnail of the first picture, the thumbnail 701 of the second picture, and the thumbnail 702 of the third picture from top to bottom. Figure 7 As shown in C in FIG. 1 , the shared application of tablet computer C also displays the thumbnail of the first picture 402, the thumbnail 701 of the second picture, and the thumbnail 702 of the third picture from top to bottom. It can be seen that the material metadata in the shared applications of mobile phone A, mobile phone B, and tablet computer C in the same trust circle are consistent.

[0108] Exemplary, combined Figure 7 A- Figure 7 In C, such as Figure 8 As shown in A in FIG. 4 , the first picture 402 is not displayed in the gallery application of mobile phone B. Figure 8 As shown in B in FIG. 1 , the first picture 402 is not displayed in the gallery application of the tablet computer C. In other words, the mobile phone B and the tablet computer C do not store the first picture 402 persistently.

[0109] It should be noted that, for electronic devices such as mobile phones and tablet computers, image files are usually stored in the gallery application by default. Therefore, when the gallery application of electronic devices such as mobile phones and tablet computers does not display the first image, it can be determined that the mobile phone and tablet computer do not have the first image persistently stored.

[0110] Exemplary, combined Figure 7 A- Figure 7 In C, such as Fig. 9 As shown in A in FIG. 1 , when the user drags the thumbnail of the first picture in the shared application of the tablet computer C to the main interface 506 of the tablet computer C, the first picture 402 is downloaded. In response to the operation, the tablet computer C will persistently store the first picture 402. Figure 7 As shown in B in FIG. 1 , the first picture 402 is displayed in the gallery application of the tablet computer C.

[0111] Exemplary, combined Figure 7 A- Figure 7 In C, such as Fig.10 As shown in A in FIG. 1 , when the user clicks on the thumbnail of the first picture in the shared application of the tablet computer C, a preview operation is performed on the first picture. As a response to the operation, Fig.10 As shown in B in FIG. 4 , the tablet computer C displays the first picture 402. However, the tablet computer C does not persistently store the first picture 402. Fig.10 As shown in C in FIG. 4 , the gallery application of tablet computer C does not display the first picture 402 .

[0112] It should be noted that the related interfaces of the shared application provided in the embodiments of the present application are not limited to the interfaces illustrated in the above figures.

[0113] Specifically, the following Fig.11 , taking the second electronic device having created a trust ring (the process of creating a trust ring can refer to the prior art, and the present embodiment will not repeat it in detail), and the first electronic device joining the trust ring as an example, the data synchronization method provided by the present embodiment is introduced. The data synchronization method includes:

[0114] S1101: The first electronic device displays material metadata of a first shared file in the first electronic device in a first shared application.

[0115] A sharing application is installed in each electronic device within the trust ring (the sharing application involved in the embodiment of the present application may be a global favorite application). Before the electronic device joins the trust ring, the sharing application may display the material metadata of the shared files in the electronic device. After the electronic device joins the trust ring, the sharing application may display the material metadata of the shared files in each electronic device within the trust ring. Among them, the shared file is a file collected in the sharing application, which may be any file in the electronic device.

[0116] For ease of distinction, in an embodiment of the present application, the shared application installed in the first electronic device is referred to as the first shared application, and the shared file 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 in the second electronic device is referred to as the second shared file. Before the first electronic device synchronizes data (i.e., does not join the trust loop), 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 loop, only the material metadata of the second shared file is displayed in the second shared application of the second electronic device.

[0117] S1102: The first electronic device joins the trust ring created by the second electronic device.

[0118] One account can correspond to one trust ring. After the first electronic device logs in to the account corresponding to the trust ring and connects to the same local area network as the second electronic device, it can join the trust ring created by the second electronic device.

[0119] It should be noted that after the first electronic device joins the trust ring, it will establish a unique near-field transmission channel with each second electronic device in the trust ring, which is used to synchronize data with each second electronic device (such as the spatial metadata of the workspace involved below, the material metadata of the shared file, and the file entity of the shared file). Of course, there is also a unique near-field transmission channel between any two second electronic devices in the trust ring. The identification of each near-field transmission channel includes the device identification of the two connected electronic devices.

[0120] S1103: The first electronic device sends spatial metadata of a first workspace in a first shared application to a second electronic device.

[0121] The shared application involved in the embodiment of the present application may include at least one workspace. A workspace may correspond to a page in the shared application, and multiple workspaces (i.e., multiple pages) may be switched. Each workspace has spatial metadata. The spatial metadata of the workspace may be used to indicate the properties of the workspace. The workspace may be used to display the material metadata of the shared files of the electronic device to collect the shared files in the electronic device. Among them, the material metadata of the shared files is used to indicate the properties of the shared files collected in the shared application. The metadata of the above-mentioned shared application may include the spatial metadata of each workspace in the shared application.

[0122] Each electronic device in the trust ring also includes a database for storing spatial metadata and material metadata in each electronic device in the trust ring. The database may include multiple storage areas, one storage area is used to store the spatial metadata of a workspace, and the material metadata displayed in the workspace. In other words, the storage areas in the database correspond to the workspaces one by one. Each time a workspace is created (or copied) in an electronic device, a storage area is automatically added to the database.

[0123] For ease of distinction, in an embodiment of the present application, the workspace created by the first electronic device in the first shared application is referred to as the first workspace. The first shared application may include N first workspaces. Similarly, the workspace created by the second electronic device in the second shared application is referred to as the second workspace. The second shared application may include P second workspaces. Wherein N and P are positive integers. The following is an introduction taking the first shared application in the first electronic device as an example.

[0124] In one embodiment, N=1 is taken as an example, that is, the first shared application includes a first workspace. At this time, the first workspace can be used to display the material metadata of all shared files in each electronic device within the trust ring. In other words, the first workspace can collect all shared files in all electronic devices within the trust ring.

[0125] For example, Figure 7 A- Figure 7 The shared applications of mobile phone A, mobile phone B, and tablet computer C shown in C all include one workspace, that is, the shared applications of mobile phone A, mobile phone B, and tablet computer all include one page. At the same time, all the material metadata in mobile phone A are displayed in one workspace, all the material metadata in mobile phone B are displayed in one workspace, and all the material metadata in tablet computer C are displayed in one workspace.

[0126] In another embodiment, taking N>1 as an example, the first shared application includes multiple first workspaces. At this time, different first workspaces can display material metadata of different types of shared files. That is to say, the first electronic device can classify and display the material metadata of shared files. For example, a shared file with a file type of document can be collected in a first workspace, and a shared file with a file type of picture can be collected in another first workspace. It should be understood that the material metadata of shared files displayed in different first workspaces are not necessarily divided according to the type of shared files, and the embodiments of the present application are not limited to this.

[0127] For example, Fig.12 As shown in A in FIG. 1 , the shared application of the mobile phone displays workspace A. Workspace A displays the material metadata of the picture. In response to the user's switching operation (such as sliding left or right, Fig.12 A in the figure means sliding to the right), such as Fig.12 As shown in B in FIG. 1 , the shared application of the mobile phone displays workspace B. Workspace B displays the material metadata of the document.

[0128] The spatial metadata of the workspace of each electronic device in the trust ring is the same. The composition structure of the spatial metadata of the workspace is briefly introduced below.

[0129] Exemplarily, the spatial metadata of a workspace may include: creation order identifier, workspace unique identifier, name, current workspace identifier, space creation timestamp, space source identifier, device identifier of the electronic device that created the workspace, device name of the electronic device that created the workspace, naming status identifier, space change timestamp, space sorting timestamp, workspace interface information, and space existence status identifier. Among them:

[0130] (1) A creation order identifier is used to indicate the number of workspaces created in a shared application. The creation order identifier can also be used to identify the storage area in the database corresponding to the workspace.

[0131] (2) A universally unique identifier (UUID) for a workspace, which is used to uniquely identify a workspace within the trust ring. The workspace unique identifier may include: the media access control (MAC) address of the electronic device that created the workspace, and the timestamp of the workspace creation (the timestamp format is Unix timestamp).

[0132] Since the workspace corresponds one-to-one to the storage area in the database, the unique identifier of the workspace is also the identifier of the storage area in the database corresponding to the workspace.

[0133] (3) The current workspace identifier is used to indicate whether the workspace is displayed in the shared application, that is, whether it can be seen by the user. In the case where the shared application has multiple workspaces, the workspace displayed on the shared application is determined as the current workspace. For example, when the current workspace identifier is represented by a first value (such as 0), it indicates that the workspace is the current workspace; when the current workspace is represented by a second value (such as 1), it indicates that the workspace is not the current workspace.

[0134] For example, Fig.12 As shown in A in , workspace A is the current workspace. Fig.12 As shown in B, workspace B is the current workspace.

[0135] (4) A space source identifier, which is used to indicate whether the workspace is created by the electronic device or copied from another electronic device after the electronic device joins the trust ring. For example, when the space source identifier is represented by a first value (such as 0), it indicates that the workspace is created by the electronic device; when the space source identifier is represented by a second value (such as 1), it indicates that the workspace is copied from another electronic device after the electronic device joins the trust ring.

[0136] Usually, before joining the trust ring, the workspace in the electronic device is the workspace created by the electronic device; after joining the trust ring, the workspace in the electronic device may also include the workspace copied by the electronic device from other electronic devices in the trust ring. The spatial source identifier of the copied workspace is set to the second value. In addition, the spatial metadata of the copied workspace is the same as the spatial metadata of the copied workspace. In other words, the electronic device will set the spatial source identifier of the copied workspace to come from other electronic devices in the trust ring to distinguish it from the workspace created by the electronic device.

[0137] (5) Naming status flag, used to indicate whether the workspace is a temporary workspace (i.e., an unnamed workspace) or a named workspace. For example, when the naming status flag of the workspace is represented by a first value (e.g., 0), it indicates that the workspace is a temporary workspace; when the naming status flag of the workspace is represented by a second value (e.g., 1), it indicates that the workspace is a named workspace.

[0138] (6) Space creation timestamp refers to the moment when an electronic device creates a workspace in a shared application.

[0139] (7) Space change timestamp refers to the time when the metadata of the material in the workspace changes (such as addition, deletion, etc.).

[0140] (8) Space sorting timestamp, used to sort workspaces in shared applications. The space sorting timestamp is related to the space creation timestamp and space change timestamp.

[0141] When the target workspace is a newly created workspace, the spatial sort timestamp is the spatial creation timestamp. The target workspace is any workspace in a shared application. When the location of the target workspace is moved, the spatial sort timestamp can be any of the following:

[0142] In one example, when the target workspace is moved to the first position among all workspaces in the shared application, the spatial sorting timestamp of the target workspace refers to: the moment when the position of the target workspace is moved to the first position among all workspaces;

[0143] In another example, when the target workspace is moved to the end of all workspaces in the shared application, the spatial sorting timestamp of the target workspace refers to: the difference between the spatial sorting timestamp of the previous workspace and the first preset value.

[0144] In another example, when the target workspace is moved between any two adjacent workspaces, the spatial sorting timestamp of the target workspace refers to: half of the sum of the spatial sorting timestamps of any two adjacent workspaces.

[0145] (9) Space existence status flag, used to indicate whether the workspace is deleted. For example, when the space existence status flag is represented by a first value (such as 0), it indicates that the workspace is not deleted; when the space existence status flag is represented by a second value (such as 1), it indicates that the workspace is deleted.

[0146] (10) Workspace interface information, which is used to indicate the style, color, etc. of the interface of the workspace displayed in the shared application.

[0147] S1104: The second electronic device determines a first target workspace according to the name of the first workspace and the names of all workspaces in the second shared application.

[0148] It should be noted that the names of the various workspaces created by the electronic device in the shared application are different. After the second electronic device receives the spatial metadata of the first workspace, based on whether the name of the first workspace is the same as the name of a workspace among all existing workspaces in the second shared application, the first workspace can be divided into: a first target workspace whose name is different from the names of all existing workspaces in the second shared application, and a fifth target workspace whose name is the same as the name of a workspace among all existing workspaces in the second shared application. In other words, the spatial metadata sent by the first electronic device to the second electronic device includes: the spatial metadata of the first target workspace, and the spatial metadata of the fifth target workspace.

[0149] S1105: The second electronic device copies the first target workspace in the second shared application.

[0150] The second electronic device copies the first target workspace in the second shared application, which can ensure that the second shared application includes the workspace in the first electronic device and that no workspace with the same name appears in the second shared application.

[0151] Optionally, after the second electronic device copies the first target workspace in the second shared application, in order to distinguish the first target workspace from the second workspace, the space source identifier of the first target workspace can be set to another electronic device in the trust circle. For example, the second electronic device sets the space source identifier of the first target workspace to the second value.

[0152] Optionally, after the second electronic device has copied the first target workspace, it will sort the workspaces in the second shared application according to the space sorting timestamp of each workspace in the second shared application. The sorting rule may be ascending order or descending order, but is not limited thereto.

[0153] S1106: The first electronic device sends material metadata of the first shared file to the second electronic device.

[0154] The material metadata of the shared files varies depending on the type of shared files. The following is a brief introduction to the composition structure of the material metadata of shared files.

[0155] Exemplarily, for all types of shared files, the shared file metadata may include: type, icon, collection order identifier, shared file unique identifier, workspace identifier, name, file change timestamp, storage path, fingerprint information, file sorting timestamp, file search identifier, file existence status identifier, file source identifier, electronic device identifier, and file change identifier. Among them:

[0156] (1) Type, which can be any of document, picture, video, audio, web page, text, folder, video excerpt, etc.

[0157] (2) Icon, used to indicate the content of the shared file. The type of icon is related to the type of the shared file. When the type of the shared file is a picture, the icon of the shared file can be a thumbnail of the shared file; when the type of the shared file is a document, the icon of the shared file is an icon of the document type and the name of the document; when the type of the shared file is text, the icon of the shared file is the content of the text. Usually, the icon of the shared file is displayed in the workspace for users to view.

[0158] For example, Fig.12 As shown in A in FIG, when the document type is a picture, the icon of the shared file is a thumbnail of the picture.

[0159] For another example, when the document type is a document, the icon of the shared file type may be: an icon of a text document (word), an icon of a spreadsheet (excel), an icon of a portable document format (PDF) (such as Fig.12 (as shown in B in the figure), presentation (power point, PPT) icons, etc.

[0160] For example, Fig.12 As shown in B, when the type of the shared file is text, the icon of the shared file is the content of the text.

[0161] (3) A collection order identifier, which is used to indicate the order of the shared file collected in the first workspace.

[0162] (4) The unique identifier of a shared file is the unique identifier of the shared file in the trust ring. The unique identifier of a shared file may include: the media access control address of the electronic device that persistently stores the shared file, and the timestamp of when the shared file is saved in the workspace (the timestamp format is Unix timestamp).

[0163] (5) The workspace identifier is the unique identifier of the workspace that contains the shared file within the trust ring (i.e., the workspace unique identifier). Based on the workspace identifier of a shared file, any electronic device within the trust ring can determine which workspace of which electronic device within the trust ring the shared file originated from.

[0164] (6) Storage path, used to indicate the storage path of shared files within the trust ring. Before an electronic device joins the trust ring, the shared files collected by the electronic device are persistently stored in the electronic device, so the storage path of the shared files is the storage path of the shared files on the electronic device. After the electronic device joins the trust ring, the shared files collected by the electronic device may be persistently stored on other electronic devices within the trust ring, so the storage path of the shared files may be the storage path of the shared files on other electronic devices within the trust ring.

[0165] Optionally, when the shared file is a file in an electronic device (such as a mobile phone) with an Android operating system, and the shared file is a picture, the material metadata of the shared file may also include a uniform resource identifier (URI). The uniform resource identifier is used to indicate the storage path of the picture on the electronic device with the Android operating system.

[0166] (7) Fingerprint information, used to uniquely identify a shared file. In response to a user adding a shared file to a workspace, the electronic device determines the fingerprint information of the shared file.

[0167] The electronic device may be pre-stored with a hash algorithm, such as the message-digest algorithm (MD5), the secure hash algorithm (SHA-1), etc. The electronic device may calculate the unique fingerprint information of the shared file based on the hash algorithm, and the process is irreversible, that is, the electronic device cannot infer the content of the shared file based on the fingerprint information.

[0168] Specifically, in the process of collecting a shared file stored in this electronic device in a workspace created by this electronic device: first, the electronic device determines the fingerprint information of the shared file according to a hash algorithm; then, the electronic device determines whether the material metadata of the shared file is stored in the workspace, that is, whether the workspace has collected the shared file, based on the fingerprint information of the shared file and the fingerprint information of the shared file stored in the workspace. Next, if the electronic device determines that the material metadata of the shared file has been stored in the workspace, the workspace cannot repeatedly store the material metadata of the shared file, that is, the workspace will not repeatedly collect the same shared file. If the electronic device determines that the material metadata of the shared file is not stored in the workspace, the workspace stores the material metadata of the shared file. Based on this, the material metadata of the same shared file will not be displayed in a workspace, thereby saving storage resources of the storage area corresponding to the workspace.

[0169] For example, Fig.13 As shown in A in FIG. 1 , the mobile phone displays a preview interface 401 of the gallery application. The preview interface 401 includes a first picture 402 and a first floating window 403. The first floating window 403 displays a shared application of the mobile phone A. A workspace of the shared application stores the material metadata of the first picture. In response to the user's operation of adding the first picture 402 to the shared application (such as dragging the first picture 402 to the first floating window 403), as shown in FIG. Fig.13 As shown in B in the figure, the first prompt information is displayed in the first floating window, and the first prompt information can be used to prompt that the first picture 402 has been collected in the first workspace and the first picture cannot be collected again. For example, the first prompt information can be: the first picture has been collected.

[0170] (8) File change timestamp refers to the time when the shared file is collected in the workspace, or the time when the name, storage path, etc. of the shared file is changed.

[0171] (9) File sorting timestamp, used to sort all material metadata in a workspace. File sorting timestamp is related to file change timestamp. The following is an introduction to the following situations:

[0172] In one embodiment, taking the case where the target shared file's material metadata is newly added to the workspace as an example, the file sorting timestamp of the target shared file refers to the time when the target shared file's material metadata is newly added to the workspace. The target shared file is any shared file.

[0173] In another embodiment, taking the case where the target shared file's metadata is moved to the first position among all shared files' metadata in the workspace, the file sorting timestamp of the target shared file refers to the time when the target shared file's metadata is moved to the first position among all shared files' metadata.

[0174] In another embodiment, taking the case where the target shared file's material metadata is moved to the end of all shared files' material metadata in the workspace as an example, the file sorting timestamp of the target shared file refers to: the difference between the file sorting timestamp of the material metadata of the previous shared file of the target shared file's material metadata and the second preset value.

[0175] In another embodiment, taking the case where the material metadata of the target shared file is moved between the material metadata of any two adjacent shared files as an example, the file sorting timestamp of the target shared file refers to: half of the sum of the file sorting timestamps of any two adjacent shared files.

[0176] In another embodiment, taking the example that the material metadata of other shared files in the workspace is dragged to the location of the material metadata of the target shared file and forms a folder with the material metadata of the target shared file, the file sorting timestamp of the folder is the file sorting timestamp of the target shared file.

[0177] (10) A file search flag, which is used to indicate whether the shared files stored in the workspace can still be found on the electronic devices in the trust circle. For example, when the file search flag is represented by a first value (such as 0), it indicates that the shared file cannot be found (such as the shared file is lost, the storage path of the shared file is modified, the name of the shared file is modified and cannot be indexed, etc.); when the file search flag is represented by a second value (such as 1), it indicates that the shared file can be found.

[0178] (11) File source identifier, used to indicate how the shared file was collected in the workspace. For example, when the file source identifier is represented by a first value (such as 0), it indicates that it is impossible to determine how the shared file was collected in the workspace; when the file source identifier is represented by a second value (such as 1), it indicates that the shared file was dragged into the workspace; when the source of the shared file is represented by a third value (such as 2), it indicates that the shared file was pasted into the workspace via the clipboard; when the source of the shared file is represented by a fourth value (such as 3), it indicates that the shared file was collected in the workspace of other electronic devices within the trust ring and synchronized to this workspace.

[0179] (12) File existence status flag, used to indicate whether a shared file originally collected in the workspace has been deleted from the workspace. For example, when the file existence status flag is represented by a first value (such as 0), it indicates that the shared file is still collected in the workspace; when the file existence status flag is represented by a second value (such as 1), it indicates that the workspace no longer collects the shared file.

[0180] (13) Electronic device identifier, which is used to indicate on which electronic device in the trust circle the shared file in the workspace is stored. If the shared file in the workspace is not stored in the electronic device, the electronic device identifier will be displayed on the icon of the shared file, so that the user can intuitively determine whether the shared file in the workspace is from the current electronic device or another electronic device in the trust circle.

[0181] For example, Figure 7 A in Figure 7 As shown in B, the workspace of mobile phone A displays a thumbnail 701 of the second picture, and the thumbnail 701 of the second icon also includes: the device identifier of the electronic device to which the second picture belongs (i.e., the device identifier of tablet computer C). The workspace of tablet computer C only displays a thumbnail of the first picture 402. Figure 7 As shown in C, the thumbnail of the first picture is displayed in the workspace of mobile phone B, and the thumbnail of the first icon also includes: the device identifier of the electronic device to which the first picture belongs (i.e., the device identifier of mobile phone A). The workspace of tablet computer C only displays the thumbnail 701 of the second picture and the thumbnail 702 of the third picture.

[0182] (14) A file change flag, which is used to indicate that the material metadata of the shared file has changed. For example, when the file change flag is represented by a first value (such as 0), it indicates that the material metadata of the shared file has changed; when the file change flag is represented by a second value (such as 1), it indicates that the material metadata of the shared file has not changed.

[0183] Optionally, when the type of the shared file includes multiple subtypes, the material metadata of the shared file may further include the subtype of the shared file. For example, when the type of the shared file is a document, the material metadata may further include the subtype of the shared file. The subtype may include: text document (word), table (excel), portable document format (PDF), presentation (power point, PPT).

[0184] Optionally, when the type of the shared file is a folder, the folder may include at least one sub-file. The fourth identifier of the folder may be a parent identifier of each sub-file in the folder, and the material metadata of each sub-file in the folder includes a fifth identifier, and the fifth identifier is used to indicate the folder to which the sub-file belongs. The fifth identifier includes the fourth identifier. In this way, according to the fifth identifier, it can be determined that the sub-file is stored in the folder.

[0185] When the type of the shared file is a folder, the material metadata of the shared file may further include the number of sub-files stored in each folder and the material metadata of each sub-file.

[0186] When the type of the shared file is a folder, the material metadata of the shared file may further include the naming status of the shared file. For example, when the naming status of the shared file is represented by a first value (such as 0), it indicates that the shared file is an unnamed folder; when the naming status of the shared file is represented by a second value (such as 1), it indicates that the shared file is a named folder.

[0187] Optionally, when the type of the shared file is a web page, the material metadata of the shared file may also include the loading status of the shared file. For example, when the loading status of the shared file is represented by a first value (such as 0), it indicates that the shared file is a web page being loaded; when the loading status of the shared file is represented by a second value (such as 1), it indicates that the shared file is a loaded web page.

[0188] It should be noted that, in some embodiments, the above S1103 and S1106 can be executed simultaneously. That is, the first electronic device simultaneously sends the spatial metadata of the first workspace and the material metadata of the first shared file to the second electronic device. In this case, the second electronic device can first receive the spatial metadata of the first workspace, then execute S1104 and S1105, and then execute S1106.

[0189] S1107: The second electronic device displays the material metadata of the first shared file in the second shared application.

[0190] The material metadata of each shared file includes the workspace identifier of the shared file, that is, the material metadata of the shared file has a mapping relationship with the workspace. Therefore, after the second electronic device receives the material metadata of the first shared file, it can determine which first workspace in the first shared application the material metadata of the first shared file originates from based on the workspace identifier of the first shared file. In other words, the second electronic device can determine the name of the first workspace to which the material metadata of the first shared file belongs in the first shared application based on the workspace identifier in the material metadata of the first shared file.

[0191] After the above S1105, all the first workspaces in the first electronic device have been included in the second electronic device. Therefore, the second electronic device can find the workspace with the same name in the second shared application according to the name of the workspace to which the material metadata of the first shared file belongs, that is, determine the workspace to which the first shared file belongs in the second shared application. The material metadata of the first shared file is then stored in the storage area of ​​the database corresponding to the workspace to which it belongs in the second shared application, and the material metadata of the first shared file is displayed in the workspace to which it belongs in the second shared application. In this way, the material metadata of the first shared file can be displayed in all workspaces with the same name. For example, the material metadata displayed in workspace A of the first electronic device will also be displayed in workspace A of the second electronic device.

[0192] Optionally, when the second electronic device displays the material metadata of the first shared file in the second shared application, the material metadata of each shared file in the workspace to which the first shared file belongs in the second shared application is sorted according to the file sorting timestamps in the material metadata of each shared file in the workspace. The sorting rule may be descending order or ascending order, but is not limited thereto.

[0193] Exemplarily, taking descending order as an example, it is assumed that the first workspace A of the first electronic device stores three material metadata A, B, and C, and the file sorting timestamp of material metadata A is 18, the file sorting timestamp of material metadata B is 9, and the file sorting timestamp of material metadata C is 13; it is assumed that the second workspace A of the second electronic device stores three material metadata D, E, and F, and the file sorting timestamp of material metadata D is 16, the file sorting timestamp of material metadata E is 17, and the file sorting timestamp of material metadata F is 20. The second electronic device sorts the material metadata according to the file sorting timestamps in the above-mentioned material metadata into: material metadata F, material metadata A, material metadata E, material metadata D, material metadata C, and material metadata B.

[0194] Optionally, if the file sorting timestamps of two shared files in a workspace of the first electronic device are consistent, the material metadata of the two shared files can also be sorted according to the timestamps (such as file change timestamps) when the material metadata of the two shared files are stored in the database.

[0195] S1108: The second electronic device sends spatial metadata of a second workspace in a second shared application to the first electronic device.

[0196] After the second electronic device synchronizes the spatial metadata of the first workspace in the first electronic device and the material metadata of the first shared file, it will also send the spatial metadata of the second workspace and the material metadata of the second shared file to the first electronic device, so that the first electronic device can also synchronize the spatial metadata of the second workspace in the second electronic device and the material metadata of the second shared file.

[0197] S1109: The first electronic device determines a second target workspace according to the name of the second workspace and the names of all workspaces in the first shared application.

[0198] After the first electronic device receives the spatial metadata of the second workspace, based on whether the name of the second workspace is the same as the name of a workspace in all existing workspaces in the first shared application, the second workspace can be divided into: a second target workspace whose name is different from the names of all existing workspaces in the first shared application, and a sixth target workspace whose name is the same as the name of a workspace in all existing workspaces in the first shared application. In other words, the spatial metadata sent by the second electronic device to the first electronic device includes: the spatial metadata of the second target workspace, and the spatial metadata of the sixth target workspace.

[0199] S1110 . The first electronic device copies a second target workspace in the first shared application.

[0200] The first electronic device copies the second target workspace in the first shared application, which can ensure that the first shared application includes the workspace in the second electronic device and that no workspace with the same name appears in the first shared application.

[0201] Optionally, after the first electronic device copies the second target workspace in the first shared application, in order to distinguish the second target workspace from the first workspace, the space source identifier of the second target workspace can be set to another electronic device in the trust circle. For example, the first electronic device sets the space source identifier of the second target workspace to the second value.

[0202] Optionally, after the first electronic device copies the second target workspace, it will sort 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.

[0203] From the above, it can be seen that when the first electronic device sorts the workspaces in the first shared application, it sorts based on the spatial sorting timestamps of each workspace in the first shared application. When the second electronic device sorts the workspaces in the second shared application, it also sorts based on the spatial sorting timestamps of each workspace in the second shared application. The spatial sorting timestamps of workspaces with the same name are the same, so the sorting of each workspace in the first shared application is the same as the sorting of each workspace in the second shared application. Based on this, it can be ensured that the sorting of workspaces in the shared applications of each electronic device within the trust ring is consistent.

[0204] S1111. The second electronic device sends material metadata of the second shared file to the first electronic device.

[0205] The composition structure of the material metadata of the second shared file may refer to the description of the material metadata of the shared file in S1106 above, and will not be repeated herein in this embodiment of the present application.

[0206] S1112: The first electronic device displays the material metadata of the second shared file in the first shared application.

[0207] The first electronic device displays the material metadata of the second shared file in the first shared application, which may include: first, since the material metadata of the shared file has a mapping relationship with the workspace, the first electronic device can determine the name of the workspace to which the second shared file belongs in the second shared application according to the workspace identifier of the second shared file; then, the first electronic device determines the workspace to which the second shared file belongs in the first shared application according to the name of the workspace to which the second shared file belongs in the second shared application; finally, the first electronic device displays the material metadata of the second shared file in the workspace to which it belongs in the first shared application. Based on this, the material metadata of the shared file displayed in the first shared application can be the same as the material metadata of the shared file displayed in the second shared application.

[0208] Optionally, when the first electronic device displays the material metadata of the second shared file in the first shared application, the material metadata of each shared file in the workspace to which the second shared file belongs in the first shared application is sorted according to the file sorting timestamps in the material metadata of each shared file in the workspace. The sorting rule may be descending order or ascending order, but is not limited thereto.

[0209] It should be noted that when the first electronic device sorts the material metadata of shared files in a workspace, the sorting is based on the file sorting timestamps in each material metadata in the workspace. When the second electronic device sorts the material metadata of shared files in a workspace with the same name, the sorting is also based on the file sorting timestamps in each material metadata in the workspace. The file sorting timestamps in the same material metadata are the same, so the content and sorting of the material metadata of each shared file in the workspace with the same name are consistent.

[0210] Based on the above S1103-S1112, it can be known that: the number of workspaces in the first electronic device is the same as the number of workspaces in the second electronic device, the order of each workspace in the first electronic device is also the same as the order of each workspace in the second electronic device, and the material metadata of shared files in workspaces with the same name are also the same. The same material metadata of shared files means: the content of the material metadata is the same, the order is the same, etc. In this way, the workspaces in the shared applications on each electronic device within the trust ring are consistent, and the material metadata in each workspace is also consistent. Therefore, on any electronic device within the trust ring, you can check the material metadata on all electronic devices within the trust ring.

[0211] For example, assume that the first shared application of mobile phone A includes a first workspace, and the second shared application of mobile phone B includes a second workspace. Figure 7 B in Figure 7 As shown in C, the material metadata displayed in the first workspace of mobile phone A is the same as the material metadata displayed in the second workspace of mobile phone B.

[0212] S1113: The first electronic device determines the material metadata of the third shared file that has been changed in the third target workspace.

[0213] The third target workspace is any workspace in the first shared application in the first electronic device. In response to the user's change operation on the material metadata of the shared file in the third target workspace, the material metadata of the shared file in the third target workspace changes. The first electronic device determines the material metadata of the shared file that has changed as the material metadata of the third shared file. Among them, the operations of changing the shared file may include: adding, sorting, dragging and grouping, and deleting, but are not limited to this.

[0214] After the first electronic device determines the material metadata of the third shared file, it sets the file change identifier in the material metadata of the third shared file to the material metadata that has changed, so as to distinguish which shared files in the third target workspace have their material metadata changed. For example, the first electronic device can represent the file change identifier with a first value (such as 0) to indicate that the material metadata of the shared file has changed.

[0215] The following describes the third shared file based on the specific type of change operation:

[0216] In one embodiment, taking the change operation as a new operation as an example, the material metadata of the third shared file may be: the material metadata of the shared file newly displayed in the third target workspace. That is, the third shared file is a shared file newly collected in the third target workspace.

[0217] The icons of the shared files displayed in a workspace are sorted according to the file sorting timestamps in the material metadata of the shared files. Since the file sorting timestamp in the material metadata of the third shared file is later than the file sorting timestamps in the other material metadata in the third target workspace, the icon of the third shared file is located at the first place among the icons of all shared files in the third target workspace.

[0218] For example, Figure 7 A in Figure 7 As shown in C in FIG. 1 , the icon of the newly collected shared file (such as the first picture 402 ) in the workspace is located at the top of the icons of all shared files in the workspace.

[0219] In another embodiment, the change operation is taken as a sorting operation. The material metadata of the third shared file may be: the material metadata of the shared file whose sorting position of the icon of the shared file in the third target workspace is changed. At this time, the file sorting timestamp in the material metadata of the third shared file is changed. Among them, the change rules of the file sorting timestamp in the material metadata of the third shared file can refer to the determination rules of the file sorting timestamp introduced in S1106 above.

[0220] In another embodiment, take the change operation as a drag-and-drop grouping operation as an example. The icon of shared file A in the third target workspace is dragged to the location of the icon of shared file B, thereby forming a folder, that is, the icons of multiple shared files in the third target workspace can be dragged into a group. At this time, the third shared file is the folder. Among them, the file sorting timestamp of the folder is the file sorting timestamp of shared file B.

[0221] In another embodiment, taking the change operation as a deletion operation as an example, the material metadata of the third shared file may be: the material metadata of the shared file deleted from the third target workspace. In other words, the third shared file is no longer collected in the first target workspace. At this time, the existence status flag in the material metadata of the third shared file may be set to a second value to indicate that the material metadata of the third shared file has been deleted from the third target workspace.

[0222] S1114: The first electronic device sends material metadata of the third shared file to the second electronic device.

[0223] S1115: The second electronic device updates the material metadata of the third shared file in the fourth target workspace according to the material metadata of the third shared file.

[0224] The fourth target workspace is any workspace in the second shared application of the second electronic device. The name of the fourth target workspace is the same as the name of the third target workspace.

[0225] After the second electronic device receives the material metadata of the third shared file, the following operations can be performed: first, the second electronic device can determine the fourth target workspace to which the material metadata of the third shared file belongs based on the workspace identifier in the material metadata of the third shared file; then, the second electronic device updates the material metadata of the third shared file in the fourth target workspace based on the specific situation in the material metadata of the third shared file, so that the updated material metadata in the fourth target workspace are the same as the updated material metadata in the third target workspace. The following is an introduction to each situation:

[0226] In one embodiment, taking the material metadata of the third shared file as the newly added material metadata of the shared file as an example, the second electronic device adds the material metadata of the third shared file in the fourth target workspace, and the icon of the third shared file is located at the first position of the fourth target workspace.

[0227] In another embodiment, taking the case where the material metadata of the third shared file is the material metadata of the deleted shared file as an example, the second electronic device deletes the material metadata of the third shared file in the fourth target workspace.

[0228] In another embodiment, taking the material metadata of the third shared file as the material metadata of the folder dragged into a group as an example, the second electronic device drags the icons of the corresponding shared files in the fourth target workspace into a group to form the same folder.

[0229] In another embodiment, taking the material metadata of the third shared file as: the position of the shared file icon is changed as an example, the second electronic device makes the same change to the position of the third shared file icon in the fourth target workspace.

[0230] Similarly, when the material metadata of any shared file in the fourth target workspace in the second electronic device (such as the material metadata of the fourth shared file) changes, the second electronic device will also determine the material metadata of the fourth shared file in the fourth target workspace as in the above-mentioned process S1113, and the second electronic device will also send the material metadata of the fourth shared file to the first electronic device. After the first electronic device receives the target material metadata, it will also execute the process in S1115 as described above. This embodiment of the present application will not be described in detail.

[0231] After the second electronic device determines the material metadata of the fourth shared file, it also sets the file change identifier in the material metadata of the fourth shared file to the material metadata that has changed, so as to distinguish which shared files in the fourth target workspace have their material metadata changed. For example, the second electronic device can use the first value (such as 0) to represent the file change identifier to indicate that the material metadata of the shared file has changed.

[0232] Optionally, when the fifth target workspace in the first electronic device changes (such as adding, deleting, sorting, etc.), the first electronic device will also send the spatial metadata of the fifth target workspace to the second electronic device. After the second electronic device receives the spatial metadata of the fifth target workspace, it will make the same change operation to the workspace in the second shared application based on the spatial metadata of the fifth target workspace, so that the workspace in the first shared application is always consistent with the workspace in the second shared application. Among them, the fifth target workspace is any workspace in the first shared application.

[0233] Similarly, when the sixth target workspace in the second electronic device changes (such as adding, deleting, sorting, etc.), the second electronic device will also send the spatial metadata of the sixth target workspace to the first electronic device. After the first electronic device receives the spatial metadata of the sixth target workspace, it will make the same change operation to the workspace in the first shared application based on the spatial metadata of the sixth target workspace, so that the workspace in the first shared application is always consistent with the workspace in the second shared application. Among them, the sixth target workspace is any workspace in the second shared application.

[0234] It can be seen that when the spatial metadata of any workspace in any electronic device in the trust ring or the material metadata in any workspace changes, all electronic devices in the trust ring will keep in sync with it. In other words, the data in the shared applications of all electronic devices in the trust ring are always consistent.

[0235] Optionally, when any electronic device in the trust ring exits the trust ring, the space metadata of each workspace in the shared application of the electronic device and the material metadata in each workspace will be automatically deleted in the shared application of other electronic devices in the trust ring. In other words, only the data in the shared applications of each electronic device in the trust ring will remain consistent.

[0236] S1116: The first electronic device generates first indication information in response to a target operation on the material metadata of the fifth shared file in the first shared application.

[0237] Wherein: the first indication information is used to instruct the second electronic device to send the fifth shared file to the first electronic device. The fifth shared file is a shared file in the second electronic device. The first indication information may include material metadata of the fifth shared file. The target operation may be a download operation (such as save as, dragging the icon of the first shared file from the first shared application, etc.), and the target operation may also be a non-download operation (such as preview, modify, etc.).

[0238] S1117. The first electronic device sends first indication information to the second electronic device.

[0239] S1118. The second electronic device sends a fifth shared file to the first electronic device.

[0240] Each electronic device in the trust ring is also installed with a distributed file system application (distributed file system for short). The distributed file system is used to store the storage path of each shared file collected in the shared application of each electronic device in the trust ring, as well as the device identification of the electronic device to which each shared file belongs. The distributed file system is also used to obtain the file entity.

[0241] Specifically, the process of the second electronic device sending the fifth shared file to the first electronic device may include: after the second electronic device receives the above request information, the second electronic device obtains the file entity of the fifth shared file from the file system of the second electronic device and sends it to the distributed file system of the second electronic device. The distributed file system of the second electronic device sends the file entity of the fifth shared file to the distributed file system of the first electronic device.

[0242] After receiving the file entity of the fifth shared file, the distributed file system of the first electronic device sends the file entity of the fifth shared file to the file system of the first electronic device.

[0243] Optionally, if the above-mentioned target operation is a download operation, the data synchronization method provided in the embodiment of the present application may also include the following S1119.

[0244] S1119. The first electronic device persistently stores the fifth shared file.

[0245] The first electronic device persistently stores the fifth shared file, so that the fifth shared file will be stored in the first electronic device regardless of whether the second electronic device exits the trust loop.

[0246] For example, Fig. 9 A and Fig. 9 As shown in B, in response to the user dragging the thumbnail of the first picture out of the first floating window in the tablet computer C, the first picture is displayed in the gallery application of the tablet computer C.

[0247] Optionally, if the above target operation is a non-download operation, the data synchronization method provided in the embodiment of the present application may further include the following S1120.

[0248] S1120. The first electronic device temporarily stores the fifth shared file.

[0249] The first electronic device temporarily storing the fifth shared file means that the first electronic device temporarily stores the fifth shared file in the running memory of the first electronic device.

[0250] For example, Fig.10 A- Fig.10 As shown in C in FIG. 1 , in response to the user's operation of previewing the first picture in the tablet computer C, the display screen of the tablet computer C displays the first picture, but the first picture is not displayed in the gallery application of the tablet computer C.

[0251] Based on this, when the second electronic device exits the trust loop, the fifth shared file will be automatically deleted from the first electronic device and will not occupy the storage space of the first electronic device.

[0252] Optionally, if the target operation is a modification operation in a non-download operation, the data synchronization method provided in the embodiment of the present application may further include the following S1121 and S1122 based on the above S1120.

[0253] S1121. The first electronic device temporarily stores a sixth shared file obtained by modifying the fifth shared file.

[0254] If the user modifies the fifth shared file on the first electronic device and saves it to obtain the sixth shared file, the first electronic device will temporarily store the sixth shared file. Usually, the sixth shared file can overwrite the fifth shared file. When the second electronic device exits the trust loop, the first electronic device will delete the sixth shared file.

[0255] S1122: The first electronic device sends a sixth shared file to the second electronic device.

[0256] After the second electronic device receives the sixth shared file, the second electronic device will persistently store the sixth shared file.

[0257] It should be noted that the above S1119 and S1120 will not be executed at the same time, and S1121 and S1122 may be executed or may not be executed.

[0258] Similarly, when the user performs a target operation on the seventh shared file in the second shared application, the second electronic device generates second indication information in response to the operation and sends the second indication information to the first electronic device. Then, the second electronic device receives the seventh shared file sent by the first electronic device.

[0259] Wherein: the seventh shared file is any shared file in the first electronic device, and the second indication information is used to instruct the first electronic device to send the seventh shared file to the second electronic device. The first indication information may include material metadata of the seventh shared file. The target operation may be a download operation (such as save as, dragging the icon of the second shared file from the second shared application, etc.), and the target operation may also be a non-download operation (such as preview, modify, etc.). For details, please refer to the description in S1116-S1118 above.

[0260] Optionally, the second electronic device may also persistently store the seventh shared file, temporarily store the seventh shared file, or temporarily store the seventh shared file after modifying the seventh shared file, according to the specific situation of the target operation, and send any operation in the seventh shared file to the first electronic device. For details, please refer to the description in S1119-S1122 above.

[0261] In summary, the shared applications of each electronic device in the trust ring will automatically synchronize the spatial metadata of each workspace and the material metadata of the shared files collected in each workspace. In this way, the data in the shared applications of each electronic device in the trust ring are always automatically consistent. When an electronic device responds to the user's operation of using (downloading or not downloading) shared files on other electronic devices, the shared files on other electronic devices will be transferred to the electronic device. In this way, the storage space of the electronic device is saved to a great extent.

[0262] like Fig.14 As shown, the embodiment of the present application also provides a chip system. The chip system 1400 includes at least one processor 1401 and at least one interface circuit 1402. The at least one processor 1401 and the at least one interface circuit 1402 can be interconnected through a line. The processor 1401 is used to support the electronic device to implement each step in the above method embodiment, such as Fig.11 In the method shown, at least one interface circuit 1402 may be used to receive signals from other devices (eg, memory) or to send signals to other devices (eg, communication interface). The chip system may include a chip and may also include other discrete devices.

[0263] The present application also provides a computer storage medium, which includes instructions. When the instructions are executed on the electronic device, the electronic device executes each step in the method embodiment, such as executing Fig.11 The method shown.

[0264] The present application also provides a computer program product including instructions. When the instructions are executed on the electronic device, the electronic device executes each step in the method embodiment, such as executing Fig.11 The method shown.

[0265] Regarding the technical effects of the chip system, computer storage medium, and computer program product, refer to the technical effects of the previous method embodiments.

[0266] It should be understood that in the various embodiments of the present application, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0267] Those of ordinary skill in the art will appreciate that the modules and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0268] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and modules described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0269] In the several embodiments provided in 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 only schematic. For example, the division of the modules is only a logical function division. There may be other division methods in actual implementation, such as 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 mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.

[0270] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical modules, that is, they may be located in one device or distributed on multiple devices. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present embodiment.

[0271] In addition, each functional module in each embodiment of the present application may be integrated into one device, or each module may exist physically separately, or two or more modules may be integrated into one device.

[0272] 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 process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer storage medium, or transmitted from one computer storage medium to another computer storage medium, for example, the computer instructions may be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (digital subscriber line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer storage medium may be any available medium that a computer can access or a data storage device such as a server, data center, etc. that contains one or more servers that can be integrated with a medium. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid state disk (SSD)), etc.

[0273] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A data synchronization method, characterized in that: Applied to a first electronic device, the first electronic device and the second electronic device are electronic devices within a trust ring, the first electronic device includes a first sharing application, the second electronic device includes a second sharing application, the first sharing application and the second sharing application are used to display material metadata of shared files of each electronic device within the trust ring; the method includes: Displaying the material metadata of the first shared file in the first electronic device in the first shared application; Sending material metadata of the first shared file to the second electronic device for display in the second shared application; the material metadata displayed in the second shared application includes the material metadata of the second shared file in the second electronic device; Receiving material metadata of the second shared file sent by the second electronic device; The material metadata of the second shared file is displayed in the first shared application.

2. The method according to claim 1, characterized in that The shared application of each electronic device includes a workspace, the workspace is used to display the material metadata of the shared file in each electronic device, the workspace has space metadata for indicating the attribute of the workspace, and the space metadata of the workspace includes the name of the workspace; Before displaying the material metadata of the second shared file in the first shared application, the method further includes: Sending spatial metadata of a first target workspace in the first shared application to the second electronic device for copying the first target workspace in the second shared application, wherein the name of the first target workspace is different from the names of all workspaces in the second shared application; Receive spatial metadata of a second target workspace in the second shared application sent by the second electronic device; The second target workspace is copied in the first shared application according to the spatial metadata of the second target workspace and the spatial metadata of all workspaces in the first electronic device; the name of the second target workspace is different from the names of all workspaces in the first electronic device.

3. The method according to claim 2, characterized in that The spatial metadata of the workspace includes a spatial source identifier of the workspace, and the spatial source identifier is used to identify that the workspace is created by the electronic device, or is copied from other electronic devices in the trust ring. The method further includes: The space source identifier of the copied workspace is set to be from other electronic devices within the trust ring.

4. The method according to claim 2 or 3, characterized in that: The spatial metadata of the workspace also includes a spatial sorting timestamp of the workspace, which is used for sorting the workspace; When the shared application includes multiple workspaces, the method further includes: The workspaces are sorted according to the spatial sorting timestamp of each workspace in the multiple workspaces.

5. The method according to claim 4, characterized in that For a target workspace in the same shared application: When the target workspace is a newly created workspace, the spatial sorting timestamp of the target workspace refers to: the creation time of the target workspace; When the target workspace is moved to the first position among all the workspaces in the shared application, the spatial sorting timestamp of the target workspace refers to: the moment when the position of the target workspace is moved to the first position among all the workspaces; When the target workspace is moved to the end of all workspaces in the shared application, the spatial sorting timestamp of the target workspace refers to: the difference between the spatial sorting timestamp of the previous workspace of the workspace and a first preset value; When the target workspace is moved between any two adjacent workspaces, the spatial sorting timestamp of the target workspace refers to: half of the sum of the spatial sorting timestamps of the any two adjacent workspaces.

6. The method according to any one of claims 2 to 5, characterized in that: The material metadata of the shared file includes an identifier of a workspace to which the shared file belongs; and the displaying of the material metadata of the second shared file in the first shared application includes: Determining, according to the workspace identifier to which the second shared file belongs, the name of the workspace to which the second shared file belongs in the second shared application; determining, according to the name of the workspace to which the second shared file belongs in the second shared application, the workspace to which the second shared file belongs in the first shared application; The material metadata of the second shared file is displayed in the corresponding workspace in the first shared application.

7. The method according to claim 6, characterized in that The material metadata of the shared file also includes a file sorting timestamp of the shared file, which is used for sorting the shared file; when the belonging workspace includes material metadata of multiple shared files, displaying the material metadata of the second shared file in the belonging workspace in the first shared application includes: According to the file sorting timestamps of the shared files in the workspace belonging to the first shared application, the material metadata of the shared files are sorted and displayed, and the material metadata of the shared files includes the material metadata of the second shared file.

8. The method according to claim 7, characterized in that For the material metadata of the target shared file in the same workspace, the material metadata of the target shared file is the material metadata of any shared file in the workspace: When the material metadata of the target shared file is newly added to the workspace, the file sorting timestamp of the target shared file refers to: the time when the material metadata of the target shared file is newly added to the workspace; When the material metadata of the target shared file is moved to the first place among the material metadata of all shared files in the workspace, the file sorting timestamp of the target shared file refers to: the moment when the material metadata of the target shared file is moved to the first place among the material metadata of all shared files; When the material metadata of the target shared file is moved to the end of the material metadata of all shared files in the workspace, the file sorting timestamp of the target shared file refers to: the difference between the file sorting timestamp of the material metadata of the previous shared file of the material metadata of the target shared file and the second preset value; When the material metadata of the target shared file is moved between the material metadata of any two adjacent shared files, the file sorting timestamp of the target shared file refers to: half of the sum of the file sorting timestamps of the any two adjacent shared files; When the material metadata of other shared files in the workspace is dragged to the location of the material metadata of the target shared file and forms a folder with the material metadata of the target shared file, the file sorting timestamp of the folder is the file sorting timestamp of the target shared file.

9. The method according to claim 7 or 8, characterized in that: The method further comprises: Determine the material metadata of the third shared file that has changed in the third target workspace; the third target workspace is any workspace in the first shared application; The material metadata of the third shared file is sent to the second electronic device for updating the material metadata of the third shared file in a fourth target workspace in the second electronic device; the name of the fourth target workspace is the same as the name of the third target workspace.

10. The method according to claim 7 or 8, characterized in that: The method further comprises: Receiving material metadata of a fourth shared file in a fourth target workspace sent by the second electronic device; the fourth target workspace is any workspace in the second shared application, and the material metadata of the fourth shared file is material metadata of a shared file that has been changed in the fourth target workspace; The material metadata of the fourth shared file in the third target workspace is updated according to the material metadata of the fourth shared file; the name of the fourth target workspace is the same as the name of the third target workspace.

11. The method according to claim 9 or 10, characterized in that: The material metadata of the shared file that has changed includes at least one of the following data: material metadata of the shared file that has been added to the workspace, material metadata of the shared file that has been deleted from the workspace, material metadata of the folder after multiple material metadata in the workspace are dragged into a folder, and material metadata of the shared file whose position has changed in the workspace.

12. The method according to any one of claims 1 to 11, characterized in that: The method further comprises: In response to a target operation on the material metadata of the fifth shared file in the first shared application, generating first indication information; the first indication information is used to instruct the second electronic device to send the fifth shared file to the first electronic device, and the fifth shared file is a shared file in the second electronic device; sending the first indication information to the second electronic device; The fifth shared file is received.

13. The method according to claim 12, characterized in that The target operation includes a non-download operation; and the method further includes: temporarily storing the fifth shared file in the memory of the first electronic device.

14. The method according to claim 13, characterized in that The non-downloading operation includes a modification operation; and the method further includes: Temporarily storing a sixth shared file, where the sixth shared file is a file modified from the fifth shared file; The sixth shared file is sent to the second electronic device, so as to persistently store the sixth shared file in the second electronic device.

15. The method according to claim 12, characterized in that The target operation includes a download operation; and the method further includes: persistently storing the fifth shared file in the first electronic device.

16. The method according to any one of claims 1 to 11, characterized in that: The method further comprises: receiving second indication information sent by the second electronic device; the second indication information is generated by the second electronic device in response to a target operation on the material metadata of the seventh shared file, and is used to instruct the first electronic device to send the seventh shared file to the second electronic device, where the seventh shared file is a shared file in the first electronic device; The seventh shared file is sent to the second electronic device, so that the second electronic device stores the seventh shared file.

17. The method according to claim 16, characterized in that The target operation includes a non-download operation; and storing the seventh shared file refers to temporarily storing the seventh shared file in the memory of the second electronic device.

18. The method according to claim 17, characterized in that The non-downloading operation includes a modification operation; and the method further includes: An eighth shared file is received and persistently stored, where the eighth shared file is a file that is a modified version of the seventh shared file.

19. The method according to claim 16, characterized in that The target operation includes a download operation; and storing the seventh shared file refers to: persistently storing the seventh shared file in the second electronic device.

20. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores instructions, and when the processor executes the instructions, the method according to any one of claims 1 to 19 is executed.

21. A computer-readable storage medium, characterized in that: The method comprises instructions which, when executed on an electronic device, cause the electronic device to execute the method according to any one of claims 1 to 19.