Data sharing method and device, electronic equipment and storage medium
By selecting multiple data sharing modes among electronic devices, identifying the target data to be shared, and sending metadata, the low security problem caused by the single data sharing method in the existing technology is solved, realizing flexible data sharing and personalized permission management, and improving data protection and user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
- Filing Date
- 2022-11-22
- Publication Date
- 2026-04-21
AI Technical Summary
Existing methods for sharing data between electronic devices are fixed and singular, resulting in low data security and an inability to effectively protect user privacy and data security.
Upon receiving a data sharing instruction, the system selects a target mode from multiple data sharing modes, determines the target data to be shared, and sends its corresponding metadata to a second electronic device. This instructs the second electronic device to determine the data structure based on the metadata for cross-device data access.
It enhances the protection of user data, increases the flexibility of data sharing, and enables the setting of personalized operation permissions based on different users and devices, thereby improving data security and user experience.
Smart Images

Figure CN115712608B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of electronic equipment technology, and more specifically, to a data sharing method, apparatus, electronic device, and storage medium. Background Technology
[0002] With the development of science and technology, electronic devices are becoming increasingly widespread and feature-rich, becoming an essential part of people's daily lives. Currently, electronic devices support data sharing; for example, they can share local data with other devices. However, current sharing methods are fixed and limited, leading to lower data security. Summary of the Invention
[0003] In view of the above problems, this application proposes a data sharing method, apparatus, electronic device, and storage medium to solve the above problems.
[0004] In a first aspect, embodiments of this application provide a data sharing method applied to a first electronic device, wherein the first electronic device is connected to a second electronic device. The method includes: upon receiving a data sharing instruction, determining a target data sharing mode from a plurality of data sharing modes; based on the target data sharing mode, determining target data to be shared from a plurality of data to be shared; and sending metadata corresponding to the target data to be shared to the second electronic device to instruct the second electronic device to determine the data structure of the target data to be shared in the first electronic device based on the metadata corresponding to the target data to be shared.
[0005] Secondly, embodiments of this application provide a data sharing method applied to a second electronic device connected to a first electronic device. The method includes: receiving metadata corresponding to target data to be shared sent by the first electronic device, wherein the target data to be shared is determined by the first electronic device from multiple data to be shared based on a target data sharing mode, and the target data sharing mode is determined by the first electronic device from multiple data sharing modes upon receiving a data sharing instruction; and determining the data structure of the target data to be shared in the first electronic device based on the metadata corresponding to the target data to be shared.
[0006] Thirdly, embodiments of this application provide a data sharing device applied to a first electronic device, the first electronic device being connected to a second electronic device. The device includes: a sharing mode determination module, configured to determine a target data sharing mode from multiple data sharing modes upon receiving a data sharing instruction; a shared data determination module, configured to determine a target data to be shared from multiple data to be shared based on the target data sharing mode; and a data sending module, configured to send metadata corresponding to the target data to be shared to the second electronic device, thereby instructing the second electronic device to determine the data structure of the target data to be shared in the first electronic device based on the metadata corresponding to the target data to be shared.
[0007] Fourthly, embodiments of this application provide a data sharing device applied to a second electronic device connected to a first electronic device. The device includes: a data receiving module for receiving metadata corresponding to target data to be shared sent by the first electronic device, wherein the target data to be shared is determined by the first electronic device from multiple data to be shared based on a target data sharing mode, and the target data sharing mode is determined by the first electronic device from multiple data sharing modes upon receiving a data sharing instruction; and a data structure determining module for determining the data structure of the target data to be shared in the first electronic device based on the metadata corresponding to the target data to be shared.
[0008] Fifthly, embodiments of this application provide an electronic device, including a memory and a processor, wherein the memory is coupled to the processor, the memory stores instructions, and when the instructions are executed by the processor, the processor performs the above-described method.
[0009] Sixthly, embodiments of this application provide a computer-readable storage medium storing program code, which can be invoked by a processor to execute the above-described method.
[0010] The data sharing method, apparatus, electronic device, and storage medium provided in this application, upon receiving a data sharing instruction, determine a target data sharing mode from multiple data sharing modes, determine target data to be shared from multiple data to be shared based on the target data sharing mode, and send the metadata corresponding to the target data to be shared to a second electronic device to instruct the second electronic device to determine the data structure of the target data to be shared in the first electronic device based on the metadata corresponding to the target data to be shared. Thus, by setting multiple data sharing modes for data sharing, the protection of user data can be enhanced and the flexibility of data sharing can be increased. Attached Figure Description
[0011] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0012] Figure 1 A schematic diagram illustrating the application environment of the data sharing method provided in the embodiments of this application is shown.
[0013] Figure 2 A timing diagram of a data sharing method provided in an embodiment of this application is shown;
[0014] Figure 3 A flowchart illustrating a data sharing method provided in an embodiment of this application is shown;
[0015] Figure 4 A flowchart illustrating a data sharing method provided in an embodiment of this application is shown;
[0016] Figure 5 This application shows Figure 4 The flowchart of step S350 of the data sharing method shown is illustrated.
[0017] Figure 6 This application shows Figure 5 The flowchart of step S353 of the data sharing method shown is illustrated.
[0018] Figure 7 A flowchart illustrating the recursive directory sharing mode provided in an embodiment of this application is shown;
[0019] Figure 8 A flowchart illustrating a data sharing method provided in an embodiment of this application is shown;
[0020] Figure 9 A schematic diagram illustrating cross-device sharing of electronic devices provided in an embodiment of this application is shown;
[0021] Figure 10 A flowchart illustrating a data sharing method provided in an embodiment of this application is shown;
[0022] Figure 11 A block diagram of a data sharing apparatus provided in one embodiment of this application is shown;
[0023] Figure 12 A block diagram of a data sharing apparatus provided in one embodiment of this application is shown;
[0024] Figure 13A block diagram of an electronic device for performing a data sharing method according to an embodiment of this application is shown;
[0025] Figure 14 An embodiment of the present application shows a storage unit for storing or carrying program code that implements a data sharing method according to an embodiment of the present application. Detailed Implementation
[0026] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings.
[0027] With the development of communication and electronic technologies, people have access to an increasing number of devices, gradually breaking down barriers between them and enabling data sharing across multiple devices. A similar scenario is when friends travel together and need to share photos, videos, or interesting moments they've captured on a large screen. This involves multiple mobile phones, tablets, and even cameras and drones sharing data on a large screen. Current cross-device communication technologies can achieve this without copying files or leaving the user's original files on the sharing devices. When sharing ends, no data remains on any of the sharing devices. However, this technology also raises issues of data security and user privacy.
[0028] Specifically, it can be divided into the following three points:
[0029] 1. When multiple devices share data, it is necessary to determine the scope of the shared data to ensure user privacy.
[0030] 2. Determine the permissions for accessing and editing shared files, and assign different permissions to different files to ensure data security.
[0031] 3. There are multiple users on electronic devices, and different user identifiers will correspond to completely different applications and files. How to achieve data sharing among multiple devices when switching users?
[0032] In response to the current need for data sharing among different devices and users, the industry has proposed the following methods:
[0033] 1. To ensure user privacy and data security, a server is used to determine access permissions. Specifically, when user account A on device A needs to access data from user account B on device B, the server first checks for access permissions. If user account B on device B has already granted A access, a notification is triggered, prompting user B to confirm access. This method ensures data security and protects user privacy by requiring confirmation from the user every time cross-device or cross-user account access occurs.
[0034] 2. To ensure the security of multi-user data editing and access, access permissions for different users are differentiated by marking the status of the accessed file. The specific design is as follows: When user A accesses public data, the portion of a set of flags belonging to user A is modified to a "set" status. If this "set" status exists and is the only one available, then user A can exclusively access the data. Otherwise, the modification is reverted, and the setting is repeated after a period of time.
[0035] The first method requires multiple devices to register with the same server, specifying the allowed devices and users. A significant risk is that if the server malfunctions or registration information is lost, users will be unable to access data on other devices. Secondly, this method lacks fine-grained operations for shared data, such as allowing sharing only a specific file on device B instead of all data. It also fails to restrict user permissions on the same file; access and editing permissions are affected by file attributes, specifically the file's group and owner. Since multiple users see the same file attributes, they cannot differentiate between them. Thirdly, when multiple users need to access each other's data in a mesh network, the server must process multiple requests and trigger multiple authorizations, degrading the user experience. For multiple users in close proximity who need to share files, a remote server is unnecessary; they can directly share data by connecting multiple devices and configuring file sharing.
[0036] The second method, using flags to differentiate between multiple users, can alleviate data conflicts caused by simultaneous operations on a file by multiple users. However, it doesn't solve the problem of setting individual permissions for different users. Flags can only distinguish whether a user has exclusive access to the file, not their specific permissions for manipulating it. Therefore, the problem of uncustomizable access and editing permissions, mentioned in the first method, persists.
[0037] To address the aforementioned problems, the inventors, through long-term research, discovered and proposed the data sharing method, apparatus, electronic device, and storage medium provided in the embodiments of this application. By setting multiple data sharing modes for selection, data sharing can be enhanced, thereby increasing the protection of user data and the flexibility of data sharing. The specific data sharing method will be described in detail in the subsequent embodiments.
[0038] The following is a schematic diagram illustrating the application environment of the data sharing method provided in the embodiments of this application.
[0039] Please see Figure 1 , Figure 1 A schematic diagram illustrating an application environment for the data sharing method provided in the embodiments of this application is shown. For example... Figure 1 As shown, it includes a first electronic device 100 and a second electronic device 200. The number of first electronic devices 100 can be one or more (the illustration shows one as an example), and the number of second electronic devices 200 can be one or more (the illustration shows five as an example). The first electronic devices 100 and 200 are connected, for example, via a local area network, via Wi-Fi, or via Bluetooth. Device connection authentication between the first electronic devices 100 and 200 can be confirmed by scanning a QR code.
[0040] Please see Figure 2 , Figure 2 A timing diagram of a data sharing method provided in an embodiment of this application is shown. This method is used to share data by setting multiple data sharing modes, which can enhance the protection of user data and increase the flexibility of data sharing. The following will focus on... Figure 2 The process shown will be described in detail, and the data sharing method may specifically include the following steps:
[0041] Step S110: Upon receiving a data sharing instruction, the first electronic device determines a target data sharing mode from multiple data sharing modes.
[0042] In this embodiment, when the first electronic device is connected to the second electronic device, it can detect whether it has received a data sharing instruction. If it detects that the first electronic device has received a data sharing instruction, it can respond to the data sharing instruction and determine a target data sharing mode from multiple data sharing modes.
[0043] In some implementations, the first electronic device may have multiple data sharing modes pre-set, wherein each data sharing mode shares data in a different way or shares different data. For example, the first electronic device may have a first data sharing mode, a second data sharing mode, and a third data sharing mode pre-set, wherein each of the first, second, and third data sharing modes shares data in a different way or shares different data. In this embodiment, a target data sharing mode can be determined from the first, second, and third data sharing modes, such as determining the first data sharing mode as the target data sharing mode.
[0044] In some implementations, the first electronic device can determine that a data sharing instruction has been received upon receiving first target voice information; or, the first electronic device can determine that a data sharing instruction has been received upon receiving a first target touch operation, without limitation. As one possible implementation, the first electronic device displays a first target interface, wherein the first target interface includes a first control used to trigger data sharing. Based on this, upon detecting a touch operation applied to the first control, it can be determined that a data sharing instruction has been received.
[0045] Step S120: The first electronic device determines the target data to be shared from multiple data to be shared based on the target data sharing mode.
[0046] In this embodiment, when the first electronic device determines the target data sharing mode from multiple data sharing modes, it can determine the target data sharing mode from multiple data to be shared based on the target data sharing mode.
[0047] In some implementations, the first electronic device may pre-set and store multiple data sharing modes, multiple data to be shared, and the correspondence between the multiple data sharing modes and the multiple data to be shared. The correspondence between the multiple data sharing modes and the multiple data to be shared may include one data sharing mode corresponding to one data to be shared, one data sharing mode corresponding to multiple data to be shared, multiple data sharing modes corresponding to one data to be shared, etc., and is not limited thereto. Therefore, in this embodiment, when determining a target data sharing mode from multiple data sharing modes, the data to be shared corresponding to the target data sharing mode can be determined as the target data to be shared based on the correspondence between the multiple data sharing modes and the multiple data to be shared.
[0048] For example, suppose there are multiple data sharing modes, including a first data sharing mode, a second data sharing mode, and a third data sharing mode; and multiple data to be shared, including a first data to be shared, a second data to be shared, and a third data to be shared, where the first data sharing mode corresponds to the first data to be shared, the second data sharing mode corresponds to the second data to be shared, and the third data sharing mode corresponds to the third data to be shared. Then, if the first data sharing mode is determined to be the target data sharing mode, then the first data to be shared can be determined to be the target data to be shared; similarly, if the third data sharing mode is determined to be the target data sharing mode, then the third data to be shared can be determined to be the target data to be shared.
[0049] Step S130: The first electronic device sends the metadata corresponding to the target data to be shared to the second electronic device.
[0050] In this embodiment, when a target data to be shared is determined, the first electronic device can obtain the metadata corresponding to the target data to be shared and send the metadata to the second electronic device. The metadata corresponding to the target data to be shared, also known as intermediary data or relay data, is data describing the data, mainly information describing the data attributes, used to support functions such as indicating storage location, historical data, resource search, and file records.
[0051] The metadata corresponding to the target data to be shared may include the file attributes of the target data to be shared. Then, the first electronic device may send the metadata corresponding to the target data to be shared, including the file attributes of the target data to the second electronic device.
[0052] In some implementations, when the first electronic device obtains the metadata corresponding to the target data to be shared, it can encapsulate the metadata of the target data to be shared to obtain encapsulated data and send the encapsulated data to the second electronic device.
[0053] In some implementations, there can be multiple second electronic devices, and the target data to be shared can include target data corresponding to each of the multiple second electronic devices. Based on this, metadata corresponding to the target data to be shared for each of the multiple second electronic devices can be sent to the multiple second electronic devices respectively. The target data to be shared for each of the multiple second electronic devices can be the same or different, and the first electronic device can distinguish the multiple second electronic devices by a device ID number.
[0054] As an feasible approach, if the number of second electronic devices for which the first electronic device shares data is one, the first electronic device can directly select the target data sharing mode for the second electronic device upon receiving a data sharing instruction. If the number of second electronic devices for which the first electronic device shares data is multiple, the first electronic device can determine the corresponding target data sharing mode for each of the multiple second electronic devices upon receiving a data sharing instruction.
[0055] Step S140: The second electronic device determines the data structure of the target data to be shared in the first electronic device based on the metadata corresponding to the target data to be shared.
[0056] In this embodiment, upon receiving the metadata corresponding to the target data to be shared, the second electronic device can determine the data structure of the target data to be shared in the first electronic device based on the metadata. The metadata of the target data to be shared is transmitted from the first electronic device to the second electronic device, allowing the second electronic device to see the data structure formed by the target data to be shared and to perform cross-device data access through this data structure.
[0057] In some implementations, upon receiving metadata corresponding to the target data to be shared, the second electronic device can save the received data into memory and organize the target data to be shared into a data structure on the first electronic device based on the metadata, then display it to the user. Based on this, the user of the second electronic device can determine the storage location of the target data to be shared on the first electronic device and trigger cross-device operations based on the data structure of the target data to be shared on the first electronic device.
[0058] In some implementations, there can be multiple second electronic devices, and the target data to be shared can include target data corresponding to each of the multiple second electronic devices. Based on this, when the multiple second electronic devices receive the metadata corresponding to their respective target data to be shared, they can determine the data structure of their respective target data to be shared in the first electronic device based on the metadata corresponding to their respective target data to be shared.
[0059] In some implementations, when the second electronic device saves the metadata corresponding to the target data to be shared into memory, it can detect the amount of metadata stored in memory. If the amount of metadata is less than a data size threshold, the metadata can continue to be stored in memory. If the amount of metadata is greater than the data size threshold, the metadata can be written from memory to disk (transferred to the hard drive). At the end of the sharing process, the written metadata is deleted to ensure the security of the shared data.
[0060] One embodiment of this application provides a data sharing method in which a first electronic device, upon receiving a data sharing instruction, determines a target data sharing mode from multiple data sharing modes. Based on the target data sharing mode, the first electronic device determines target data to be shared from multiple data to be shared. The first electronic device sends the metadata corresponding to the target data to be shared to a second electronic device. The second electronic device determines the data structure of the target data to be shared in the first electronic device based on the metadata corresponding to the target data to be shared. Thus, by setting multiple data sharing modes for data sharing, the protection of user data can be enhanced and the flexibility of data sharing can be increased.
[0061] Please see Figure 3 , Figure 3 A flowchart illustrating a data sharing method according to an embodiment of this application is shown. This method allows for data sharing by selecting from multiple data sharing modes, enhancing the protection of user data and increasing the flexibility of data sharing. In specific embodiments, this data sharing method is applied to, for example... Figure 11 The data sharing device 300 and the first electronic device 100 configured with the data sharing device 300 are shown. Figure 13 The following will address... Figure 3 The process shown will be described in detail. In this embodiment, the first electronic device is connected to the second electronic device, and the data sharing method may specifically include the following steps:
[0062] Step S210: Upon receiving a data sharing instruction, determine the target data sharing mode from multiple data sharing modes.
[0063] Step S220: Based on the target data sharing mode, determine the target data to be shared from multiple data to be shared.
[0064] Step S230: Send the metadata corresponding to the target data to be shared to the second electronic device, so as to instruct the second electronic device to determine the data structure of the target data to be shared in the first electronic device based on the metadata corresponding to the target data to be shared.
[0065] For a detailed description of steps S210-S230, please refer to steps S110-S140, which will not be repeated here.
[0066] An embodiment of this application provides a data sharing method that, upon receiving a data sharing instruction, determines a target data sharing mode from multiple data sharing modes, determines target data to be shared from multiple data to be shared based on the target data sharing mode, and sends the metadata corresponding to the target data to be shared to a second electronic device, thereby instructing the second electronic device to determine the data structure of the target data to be shared in the first electronic device based on the metadata corresponding to the target data to be shared. By setting multiple data sharing modes for data sharing, the protection of user data can be enhanced and the flexibility of data sharing can be increased.
[0067] Please see Figure 4 , Figure 4 A flowchart illustrating a data sharing method according to an embodiment of this application is shown. The method is applied to a first electronic device connected to a second electronic device. The following will focus on... Figure 4 The process shown is described in detail. In this embodiment, multiple data sharing modes include single file sharing mode, single directory sharing mode, and recursive directory sharing mode. The data sharing method may specifically include the following steps:
[0068] Step S310: Display the first target control corresponding to the single file sharing mode, the second target control corresponding to the single directory sharing mode, and the third target control corresponding to the recursive directory sharing mode.
[0069] In this embodiment, multiple data sharing modes include single file sharing mode, single directory (folder) sharing mode, and recursive directory sharing mode. Specifically, single file sharing mode means sharing only the selected file; single directory sharing mode means sharing only the selected directory, and subdirectories within that directory will not be recursively shared; recursive directory sharing mode means sharing the selected directory, and all subdirectories within that directory are also shared.
[0070] In some implementations, the first electronic device may pre-configure a first target control corresponding to a single file sharing mode, a second target control corresponding to a single directory sharing mode, and a third target control corresponding to a recursive sharing mode. Based on this, the first electronic device may display the first target control corresponding to the single file sharing mode, the second target control corresponding to the single directory sharing mode, and the third target control corresponding to the recursive directory sharing mode.
[0071] As one possible approach, the first target control, the second target control, and the third target control can be displayed side by side, for example, they can be displayed horizontally or vertically, etc., without any limitation.
[0072] Step S320: When a touch operation is detected acting on the first target control, the single file sharing mode is determined as the target data sharing mode from the plurality of data sharing modes.
[0073] In this embodiment, during the display of the first target control, the second target control, and the third target control, the first electronic device can detect touch operations applied to the first target control, the second target control, or the third target control. Specifically, the first electronic device can detect touch operations applied to the first target control, the second target control, or the third target control in real time, or at preset time intervals, etc., without limitation.
[0074] In some implementations, upon detecting a touch operation applied to the first target control, the system can respond to the touch operation by determining the single file sharing mode corresponding to the first target control as the target data sharing mode from among single file sharing mode, single directory sharing mode, and recursive directory sharing mode. The touch operation applied to the first target control can include: a click operation, a press operation, a swipe operation, etc., and is not limited thereto.
[0075] Step S330: When a touch operation is detected acting on the second target control, the single directory sharing mode is determined as the target data sharing mode from the plurality of data sharing modes.
[0076] In some implementations, upon detecting a touch operation applied to the second target control, the system can respond to the touch operation by determining the single directory sharing mode of the corresponding second target control as the target data sharing mode from among single file sharing mode, single directory sharing mode, and recursive directory sharing mode. The touch operation applied to the second target control can include: a click operation, a press operation, a swipe operation, etc., and is not limited thereto.
[0077] Step S340: When a touch operation is detected acting on the third target control, the recursive directory sharing mode is determined as the target data sharing mode from the plurality of data sharing modes.
[0078] In some implementations, upon detecting a touch operation applied to the third target control, the system can respond to the touch operation by determining the recursive directory sharing mode of the corresponding third target control as the target data sharing mode from among single file sharing mode, single directory sharing mode, and recursive directory sharing mode. The touch operation applied to the third target control can include: a click operation, a press operation, a swipe operation, etc., and is not limited thereto.
[0079] Step S350: Based on the target data sharing mode, determine the target data to be shared from multiple data to be shared.
[0080] For a detailed description of step S350, please refer to step S120, which will not be repeated here.
[0081] Please see Figure 5 , Figure 5 This application shows Figure 4 The flowchart shown illustrates step S350 of the data sharing method. The following will focus on... Figure 5 The process shown will be described in detail, and the method may specifically include the following steps:
[0082] Step S351: If the target data sharing mode is the single file sharing mode, then the corresponding target file is determined as the target data to be shared.
[0083] In some implementations, if the target data sharing mode is determined to be a single file sharing mode, the selected file can be shared; that is, the corresponding target file (the selected file) can be identified as the target data to be shared. Based on this, the attribute information of the target file, that is, the metadata of the target file, can be encapsulated and sent to the second electronic device. The second electronic device can obtain the metadata of the target file and determine the storage location of the target file on the first electronic device, thus triggering cross-device operation.
[0084] Step S352: If the target data sharing mode is the single directory sharing mode, then the corresponding target directory and the files under the target directory are determined as the target data to be shared.
[0085] In some implementations, if the target data sharing mode is determined to be a single directory sharing mode, the selected directory can be shared. Subdirectories within this directory will not be recursively shared. That is, the corresponding target directory (the selected directory) and the files within it can be identified as the target data to be shared. Based on this, all files within the target directory can be shared individually. This involves encapsulating the metadata of the target directory and all files within it, and sending it to the second electronic device. The second electronic device obtains the metadata of the target directory and its files, thus determining the storage location of the target directory and its files on the first electronic device and triggering cross-device operations.
[0086] Step S353: If the target data sharing mode is the recursive directory sharing mode, then the target directory, the files under the target directory, the subdirectories under the target directory, and the files under the subdirectories are determined as the target data to be shared.
[0087] In some implementations, if the target data sharing mode is determined to be a recursive directory sharing mode, the selected directory can be shared. If there are subdirectories under this directory, sharing will be recursively set. That is, the corresponding target directory (selected directory), the files under the target directory, the subdirectories under the target directory, and the files under the subdirectories can be identified as the target data to be shared. Based on this, all files and subdirectories under the target directory can be shared. That is, the metadata of the target directory, the files under the target directory, the subdirectories under the target directory, and the files under the subdirectories is encapsulated and sent to the second electronic device. The second electronic device obtains the metadata of the target directory, the files under the target directory, the subdirectories under the target directory, and the files under the subdirectories, and can then determine the storage location of the target directory, the files under the target directory, the subdirectories under the target directory, and the files under the subdirectories on the first electronic device, and trigger cross-device operation.
[0088] Please see Figure 6 , Figure 6 This application shows Figure 5 The flowchart shown illustrates step S353 of the data sharing method. The following will focus on... Figure 6 The process shown will be described in detail, and the method may specifically include the following steps:
[0089] Step S3531: If the target data sharing mode is the recursive directory sharing mode, then obtain the data type of the data under the target directory.
[0090] Please refer to Figure 7 , Figure 7A flowchart illustrating the recursive directory sharing mode provided in an embodiment of this application is shown. Figure 7 As shown, if the target data sharing mode is recursive directory sharing mode, the type of all files / directories under the target directory is determined. If the current determined data type is a directory, the path is updated to a subdirectory, and the subdirectory is shared. If the current determined data type is a file, the metadata of the file is encapsulated, and it is analyzed whether there are any unprocessed files in the directory. If not, the entire process ends, and the metadata of all files and directories has been encapsulated and is ready to be sent to the second electronic device. If there is still data that has not been determined and encapsulated, the determination process continues. It should be noted that when determining whether there is still unprocessed data, it includes not only files in the current directory but also files in its parent directories. This is mainly because recursive sharing may involve subdirectories, and after the files in the subdirectories are processed, it is necessary to return to the parent directory to process the remaining data.
[0091] In some implementations, if the target data sharing mode is determined to be a recursive directory sharing mode, the data type of the data in the target directory is obtained. This data type includes either a file type or a directory type. As one approach, for the data in the target directory, the first electronic device can pre-set the data to be associated with a first identifier or a second identifier, where the first identifier represents a file type and the second identifier represents a directory type. Based on this, the identifier associated with the data in the target directory can be obtained, and the data type of the data in the target directory can be determined based on this identifier. If the identifier associated with the data in the target directory is determined to be the first identifier, then the data type of the data in the target directory can be determined to be a file type; if the identifier associated with the data in the target directory is determined to be the second identifier, then the data type of the data in the target directory can be determined to be a directory type.
[0092] Step S3532: If the data type is a file type, then the data in the target directory is determined as the target data to be shared.
[0093] In some implementations, if the data type of the data in the target directory is determined to be file type, the data in the target directory can be identified as the target data to be shared, that is, the metadata of the data in the target directory can be encapsulated and sent to the second electronic device.
[0094] Step S3533: If the data type is a directory type, then the data under the target directory is determined as a subdirectory of the target directory, and the data under the target directory is marked as the recursive directory sharing mode.
[0095] In some implementations, if the data type of the data under the target directory is determined to be a directory type, the data under the target directory can be identified as a subdirectory of the target directory, and the data under the target directory can be marked as a recursive directory sharing mode to achieve recursive sharing of the data under the target directory.
[0096] Step S360: Send the metadata corresponding to the target data to be shared to the second electronic device, so as to instruct the second electronic device to determine the data structure of the target data to be shared in the first electronic device based on the metadata corresponding to the target data to be shared.
[0097] For a detailed description of step S360, please refer to steps S130-S140, which will not be repeated here.
[0098] An embodiment of this application provides a data sharing method that displays a first target control corresponding to a single file sharing mode, a second target control corresponding to a single directory sharing mode, and a third target control corresponding to a recursive directory sharing mode. When a touch operation is detected on the first target control, a single file sharing mode is determined as the target data sharing mode from multiple data sharing modes. When a touch operation is detected on the second target control, a single directory sharing mode is determined as the target data sharing mode from multiple data sharing modes. When a touch operation is detected on the third target control, a recursive directory sharing mode is determined as the target data sharing mode from multiple data sharing modes. Based on the target data sharing mode, target data to be shared is determined from multiple data to be shared. The metadata corresponding to the target data to be shared is sent to a second electronic device to instruct the second electronic device to determine the data structure of the target data to be shared on the first electronic device based on the metadata corresponding to the target data to be shared. Compared to... Figure 3 The data sharing method shown in this embodiment also includes single file sharing mode, single directory sharing mode, and recursive directory sharing mode for data sharing, which can enhance the protection of user data and increase the flexibility of data sharing.
[0099] Please see Figure 8 , Figure 8 A flowchart illustrating a data sharing method according to an embodiment of this application is shown. The method is applied to a first electronic device connected to a second electronic device. The following will focus on... Figure 8 The process shown will be described in detail, and the data sharing method may specifically include the following steps:
[0100] Step S410: Upon receiving a data sharing instruction, determine the target data sharing mode from multiple data sharing modes.
[0101] Step S420: Based on the target data sharing mode, determine the target data to be shared from multiple data to be shared.
[0102] Step S430: Send the metadata corresponding to the target data to be shared to the second electronic device, so as to instruct the second electronic device to determine the data structure of the target data to be shared in the first electronic device based on the metadata corresponding to the target data to be shared.
[0103] For a detailed description of steps S410-S430, please refer to steps S110-S140, which will not be repeated here.
[0104] Step S440: Upon receiving a permission setting instruction, obtain permission setting information.
[0105] In this embodiment, after setting the target data sharing mode and determining the target data to be shared through the above steps, the metadata of the target data to be shared is sent to the second electronic device. The second electronic device can then see the data structure formed by the target data to be shared and perform cross-device data access through this data structure. This means that when there are multiple second electronic devices, different users can receive the same metadata for different second electronic devices, and the file attributes they can see are the same. Therefore, the operation permissions of different second electronic devices for the target data to be shared are exactly the same. In this case, if the user wants to define the operation permissions of different second electronic devices for the target data to be shared locally, so that the operation permissions of different second electronic devices are different, this cannot be achieved by modifying the attributes of the target data to be shared locally on the first electronic device. Based on this, in this embodiment, the first electronic device transmits the operation permissions to the second electronic devices, and different second electronic devices are given different operation permissions. After receiving the permission setting information, the second electronic device modifies its saved metadata (file attributes), which can change the operation permissions of the second electronic device for the target data to be shared.
[0106] In this embodiment, upon receiving a permission setting instruction, permission setting information can be obtained.
[0107] In some implementations, the first electronic device can determine that it has received a permission setting instruction upon receiving voice information from the second target; or, the first electronic device can determine that it has received a permission setting instruction upon receiving a touch operation from the second target, without limitation. As one possible implementation, the first electronic device displays a second target interface, wherein the second target interface includes a second control used to trigger permission setting. Based on this, upon detecting a touch operation applied to the second control, it can be determined that a permission setting instruction has been received.
[0108] In some implementations, obtaining permission setting information may include: obtaining permission setting information input by the user via voice, obtaining permission setting information input by the user via text, or obtaining permission setting information input by the user via selection, etc., without limitation.
[0109] As an implementable approach, operation permissions may include: file unique identifier information (inode), file read, write and execute permissions, number of hard links, user ID, group ID, file size, file time of last access, and file time of last status change, etc., without being limited here.
[0110] Step S450: Send the permission setting information to the second electronic device to instruct the second electronic device to modify the metadata corresponding to the target data to be shared according to the permission setting information, and determine the operation permissions for the target data to be shared according to the modified metadata.
[0111] In this embodiment, when the permission setting information is obtained, the first electronic device can send the permission setting information to the second electronic device. Accordingly, after receiving the permission setting information, the second electronic device can modify the metadata (file attributes) corresponding to the stored target data to be shared according to the permission setting information, and determine the operation permissions for the target data to be shared according to the modified metadata. This enables the first electronic device to customize sharing and editing permissions, thereby enhancing security and scenario applicability.
[0112] In some implementations, it is assumed that the second electronic device is logged into with multiple user accounts. Sending permission setting information to the second electronic device to instruct it to modify the metadata corresponding to the target data to be shared according to the permission setting information, and determining the operation permissions for the target data to be shared based on the modified metadata, can include: sending permission setting information to the second electronic device to instruct it to modify the metadata corresponding to the target data to be shared according to the permission setting information, and determining the operation permissions for each of the multiple user accounts logged into the second electronic device for the target data to be shared based on the modified metadata. This allows for different permission settings for different accounts, improving the granularity of permission settings and enhancing the applicability of the scenario. For example, assuming the second electronic device is logged into with a first account and a second account, permission settings for the first account can allow the first account on the second electronic device to access files, and permission settings for the second account can allow the second account on the second electronic device to edit and rename files.
[0113] In some implementations, assuming there are multiple second electronic devices, the permission setting information includes permission setting information corresponding to each of the multiple second electronic devices. Then, sending the permission setting information to the second electronic devices to instruct them to modify the metadata corresponding to the target data to be shared according to the permission setting information, and determining the operation permissions for the target data to be shared based on the modified metadata, can include: sending the permission setting information corresponding to each of the multiple second electronic devices to the multiple second electronic devices respectively, instructing them to modify the metadata corresponding to the target data to be shared according to their respective permission setting information, and determining their respective operation permissions for the target data to be shared based on the modified metadata. This allows for different permission settings for different electronic devices, improving the granularity of permission settings and enhancing the applicability of the scenario. For example, assuming the multiple second electronic devices include device B and device C, permission setting information for device B can grant device B permissions similar to a root user, and permission setting information for device C can grant device C read, write, rename, move, and delete files, etc., without further limitation.
[0114] Please see Figure 9 , Figure 9This illustration shows a schematic diagram of cross-device sharing provided in an embodiment of this application. Assume the first electronic device is device A, and multiple second electronic devices include device B and device C. Device A shares two files (file A and file B) and one directory (directory C), but the shared files are configured differently for each device. Device B receives the shares of file A and file B, while device C receives the shares of file A and directory C. Furthermore, the permissions configured for each device are different. For example, device B and device C have different access permissions to file A, which is stored separately on device B and device C, respectively. Device B might have edit permissions for file A, while device C might only have read permissions. However, regardless of how the permissions of device B and device C change for file A, it will not affect the permissions of device A for file A; that is, the permissions of the original file will not be modified.
[0115] An embodiment of this application provides a data sharing method that, upon receiving a data sharing instruction, determines a target data sharing mode from multiple data sharing modes; based on the target data sharing mode, determines target data to be shared from multiple data to be shared; sends the metadata corresponding to the target data to be shared to a second electronic device, instructing the second electronic device to determine the data structure of the target data to be shared in the first electronic device based on the metadata corresponding to the target data to be shared; upon receiving a permission setting instruction, obtains permission setting information, sends the permission setting information to the second electronic device, instructing the second electronic device to modify the metadata corresponding to the target data to be shared according to the permission setting information, and determines the operation permissions for the target data to be shared based on the modified metadata. Compared to... Figure 3 The data sharing method shown in this embodiment can also set operation permissions for the shared data on the second electronic device, which can limit the operation capabilities of the second electronic device on the common data and further protect the security of the original data.
[0116] Please see Figure 10 , Figure 10 A flowchart illustrating a data sharing method according to an embodiment of this application is shown. This method allows for data sharing by selecting from multiple data sharing modes, enhancing the protection of user data and increasing the flexibility of data sharing. In specific embodiments, this data sharing method is applied to, for example... Figure 12 The data sharing device 400 and the second electronic device 200 configured with the data sharing device 400 are shown. Figure 13 The following will address... Figure 10 The process shown will be described in detail. In this embodiment, the second electronic device is connected to the first electronic device, and the data sharing method may specifically include the following steps:
[0117] Step S510: Receive metadata corresponding to the target data to be shared sent by the first electronic device, wherein the target data to be shared is determined by the first electronic device from multiple data to be shared based on a target data sharing mode, and the target data sharing mode is determined by the first electronic device from multiple data sharing modes upon receiving a data sharing instruction.
[0118] Step S520: Determine the data structure of the target data to be shared in the first electronic device based on the metadata corresponding to the target data to be shared.
[0119] For a detailed description of steps S510-S520, please refer to steps S110-S140, which will not be repeated here.
[0120] An embodiment of this application provides a data sharing method that receives metadata corresponding to target data to be shared sent by a first electronic device. The target data to be shared is determined by the first electronic device from multiple data to be shared based on a target data sharing mode. The target data sharing mode is determined by the first electronic device from multiple data sharing modes upon receiving a data sharing instruction. The data structure of the target data to be shared in the first electronic device is determined based on the metadata corresponding to the target data to be shared. By setting multiple data sharing modes for data sharing, the protection of user data can be enhanced and the flexibility of data sharing can be increased.
[0121] Please see Figure 11 , Figure 11 This diagram illustrates a block diagram of a data sharing device according to an embodiment of the present application. The data sharing device 300 is applied to the aforementioned first electronic device, which is connected to a second electronic device. The following will describe... Figure 11 The block diagram shown illustrates that the data sharing device 300 includes: a sharing mode determination module 310, a shared data determination module 320, and a data sending module 330, wherein:
[0122] The sharing mode determination module 310 is used to determine the target data sharing mode from multiple data sharing modes when a data sharing instruction is received.
[0123] Furthermore, the multiple data sharing modes include a single file sharing mode, a single directory sharing mode, and a recursive directory sharing mode. The sharing mode determination module 310 includes: a target control display submodule, a first sharing mode determination submodule, a second sharing mode determination submodule, and a third sharing mode determination submodule, wherein:
[0124] The target control display submodule is used to display a first target control corresponding to the single file sharing mode, a second target control corresponding to the single directory sharing mode, and a third target control corresponding to the recursive directory sharing mode.
[0125] The first sharing mode determination submodule is used to determine the single file sharing mode as the target data sharing mode from the plurality of data sharing modes when a touch operation is detected acting on the first target control.
[0126] The second sharing mode determination submodule is used to determine the single directory sharing mode as the target data sharing mode from the plurality of data sharing modes when a touch operation is detected acting on the second target control.
[0127] The third sharing mode determination submodule is used to determine the recursive directory sharing mode as the target data sharing mode from the plurality of data sharing modes when a touch operation is detected acting on the third target control.
[0128] The shared data determination module 320 is used to determine the target data to be shared from multiple data to be shared based on the target data sharing mode.
[0129] Further, the shared data determination module 320 includes: a first shared data determination submodule, a second shared data determination submodule, and a third shared data determination submodule, wherein:
[0130] The first shared data determination submodule is used to determine the corresponding target file as the target data to be shared if the target data sharing mode is the single file sharing mode.
[0131] The second shared data determination submodule is used to determine the corresponding target directory and the files under the target directory as the target data to be shared if the target data sharing mode is the single directory sharing mode.
[0132] The third shared data determination submodule is used to determine the target directory, the files under the target directory, the subdirectories under the target directory, and the files under the subdirectories as the target data to be shared if the target data sharing mode is the recursive directory sharing mode.
[0133] Furthermore, the third shared data determination submodule includes: a data type acquisition unit, a first shared data determination unit, and a second shared data determination unit, wherein:
[0134] The data type acquisition unit is used to acquire the data type of the data under the target directory if the target data sharing mode is the recursive directory sharing mode.
[0135] The first shared data determination unit is used to determine the data in the target directory as the target data to be shared if the data type is a file type.
[0136] The second shared data determination unit is used to determine the data under the target directory as a subdirectory of the target directory if the data type is a directory type, and to mark the data under the target directory as the recursive directory sharing mode.
[0137] The data sending module 330 is used to send the metadata corresponding to the target data to be shared to the second electronic device, so as to instruct the second electronic device to determine the data structure of the target data to be shared in the first electronic device based on the metadata corresponding to the target data to be shared.
[0138] Furthermore, the number of the second electronic devices is multiple, and the target data to be shared includes target data to be shared corresponding to each of the multiple second electronic devices. The data sending module 330 includes: a data sending submodule, wherein:
[0139] The data sending submodule is used to send metadata corresponding to the target data to be shared by each of the plurality of second electronic devices to the plurality of second electronic devices, so as to instruct the plurality of second electronic devices to determine the data structure of their respective target data to be shared in the first electronic device based on the metadata corresponding to their respective target data to be shared.
[0140] Furthermore, the data sharing device 300 further includes: a permission setting information acquisition module and a permission setting information sending module, wherein:
[0141] The permission setting information acquisition module is used to acquire permission setting information upon receiving a permission setting instruction.
[0142] The permission setting information sending module is used to send the permission setting information to the second electronic device, so as to instruct the second electronic device to modify the metadata corresponding to the target data to be shared according to the permission setting information, and to determine the operation permissions for the target data to be shared according to the modified metadata.
[0143] Furthermore, the second electronic device is logged into with multiple user accounts, and the permission setting information sending module includes: a first permission setting information sending submodule, wherein:
[0144] The first permission setting information sending submodule is used to send the permission setting information to the second electronic device, so as to instruct the second electronic device to modify the metadata corresponding to the target data to be shared according to the permission setting information, and to determine the operation permissions of the multiple user accounts logged in by the second electronic device for the target data to be shared according to the modified metadata.
[0145] Furthermore, the number of the second electronic devices is multiple, and the permission setting information includes permission setting information corresponding to each of the multiple second electronic devices. The permission setting information sending module includes: a second permission setting information sending submodule, wherein:
[0146] The second permission setting information sending submodule is used to send the permission setting information corresponding to each of the plurality of second electronic devices to the plurality of second electronic devices respectively, so as to instruct the plurality of second electronic devices to modify the metadata corresponding to the target data to be shared according to their respective permission setting information, and to determine their respective operation permissions for the target data to be shared according to the modified metadata.
[0147] Please see Figure 12 , Figure 12 A block diagram of a data sharing device according to an embodiment of this application is shown. This data sharing device 400 is applied to the aforementioned second electronic device, which is connected to the first electronic device. The following will describe... Figure 12 The block diagram shown illustrates that the data sharing device 400 includes: a data receiving module 410 and a data structure determination module 420, wherein:
[0148] The data receiving module 410 is used to receive metadata corresponding to the target data to be shared sent by the first electronic device, wherein the target data to be shared is determined by the first electronic device from multiple data to be shared based on a target data sharing mode, and the target data sharing mode is determined by the first electronic device from multiple data sharing modes upon receiving a data sharing instruction.
[0149] The data structure determination module 420 is used to determine the data structure of the target data to be shared in the first electronic device based on the metadata corresponding to the target data to be shared.
[0150] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the above-described device and module can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0151] In the several embodiments provided in this application, the coupling between modules can be electrical, mechanical, or other forms of coupling.
[0152] Furthermore, the functional modules in the various embodiments of this application can be integrated into one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The integrated modules described above can be implemented in hardware or as software functional modules.
[0153] Please see Figure 13 This diagram illustrates a structural block diagram of an electronic device 500 provided in an embodiment of this application. The electronic device 500 can be a smartphone, tablet computer, e-reader, or other electronic device capable of running applications. The electronic device 500 may include a first electronic device 100 or a second electronic device 200. The electronic device 500 in this application may include one or more of the following components: a processor 510, a memory 520, and one or more applications. The one or more applications may be stored in the memory 520 and configured to be executed by one or more processors 510. The one or more applications are configured to perform the methods described in the foregoing method embodiments.
[0154] The processor 510 may include one or more processing cores. The processor 510 connects to various parts of the electronic device 500 using various interfaces and lines, and performs various functions and processes data of the electronic device 500 by running or executing instructions, programs, code sets, or instruction sets stored in the memory 520, and by calling data stored in the memory 520. Optionally, the processor 510 may be implemented using at least one hardware form of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), or Programmable Logic Array (PLA). The processor 510 may integrate one or a combination of several of the following: Central Processing Unit (CPU), Graphics Processing Unit (GPU), and modem. The CPU primarily handles the operating system, user interface, and applications; the GPU is responsible for rendering and drawing the content to be displayed; and the modem handles wireless communication. It is understood that the modem may also not be integrated into the processor 510 and may be implemented separately through a communication chip.
[0155] The memory 520 may include random access memory (RAM) or read-only memory (ROM). The memory 520 can be used to store instructions, programs, code, code sets, or instruction sets. The memory 520 may include a program storage area and a data storage area. The program storage area may store instructions for implementing an operating system, instructions for implementing functions (such as touch functionality, sound playback functionality, image playback functionality, etc.), and instructions for implementing the various method embodiments described below. The data storage area may also store data created by the electronic device 500 during use (such as phonebook data, audio and video data, chat log data, etc.).
[0156] Please see Figure 14 This diagram illustrates a structural block diagram of a computer-readable storage medium provided in an embodiment of this application. The computer-readable medium 600 stores program code that can be called by a processor to execute the methods described in the above method embodiments.
[0157] The computer-readable storage medium 600 may be an electronic memory such as flash memory, EEPROM (Electrically Erasable Programmable Read-Only Memory), EPROM, hard disk, or ROM. Optionally, the computer-readable storage medium 600 includes a non-transitory computer-readable storage medium. The computer-readable storage medium 600 has storage space for program code 610 that performs any of the method steps described above. This program code can be read from or written to one or more computer program products. The program code 610 may be compressed, for example, in a suitable form.
[0158] In summary, the data sharing method, apparatus, electronic device, and storage medium provided in this application, upon receiving a data sharing instruction, determine a target data sharing mode from multiple data sharing modes, determine target data to be shared from multiple data to be shared based on the target data sharing mode, and send the metadata corresponding to the target data to be shared to a second electronic device to instruct the second electronic device to determine the data structure of the target data to be shared in the first electronic device based on the metadata corresponding to the target data to be shared. Thus, by setting multiple data sharing modes for data sharing, the protection of user data can be enhanced and the flexibility of data sharing can be increased.
[0159] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.
Claims
1. A data sharing method, characterized in that, Applied to a first electronic device, wherein the first electronic device is connected to a second electronic device, the method includes: Upon receiving a data sharing instruction, a target data sharing mode is determined from multiple data sharing modes, including a single file sharing mode, a single directory sharing mode, and a recursive directory sharing mode. The data sharing instruction is triggered by a touch operation on one of the multiple target controls. Each of the multiple data sharing modes corresponds one-to-one with the multiple target controls. Specifically, the single file sharing mode is used to identify the corresponding target file as the target data to be shared; the single directory sharing mode is used to identify the corresponding target directory and the files under the target directory as the target data to be shared, and if the target directory has subdirectories, sharing will not be recursively set; the recursive directory sharing mode is used to identify the target directory, the files under the target directory, the subdirectories under the target directory, and the files under the subdirectories as the target data to be shared, and if the target directory has subdirectories, sharing will be recursively set. Based on the target data sharing mode, the target data to be shared is determined from multiple data to be shared. The metadata corresponding to the target data to be shared is sent to the second electronic device to instruct the second electronic device to determine the data structure of the target data to be shared in the first electronic device based on the metadata corresponding to the target data to be shared. Wherein, if the data sharing mode is the recursive directory sharing mode, then determining the target data to be shared from multiple data to be shared based on the target data sharing mode includes: If the target data sharing mode is the recursive directory sharing mode, then obtain the data type of the data under the corresponding target directory; If the data type is a file type, then the data in the target directory is determined as the target data to be shared; If the data type is a directory type, then the data under the target directory is determined as a subdirectory of the target directory, and the data under the target directory is marked as the recursive directory sharing mode.
2. The method according to claim 1, characterized in that, Upon receiving a data sharing instruction, determining the target data sharing mode from multiple data sharing modes includes: Display a first target control corresponding to the single file sharing mode, a second target control corresponding to the single directory sharing mode, and a third target control corresponding to the recursive directory sharing mode; Upon detecting a touch operation applied to the first target control, the single file sharing mode is determined as the target data sharing mode from the plurality of data sharing modes; or Upon detecting a touch operation applied to the second target control, the single directory sharing mode is determined as the target data sharing mode from the plurality of data sharing modes; or Upon detecting a touch operation applied to the third target control, the recursive directory sharing mode is determined as the target data sharing mode from among the multiple data sharing modes.
3. The method according to claim 1 or 2, characterized in that, After sending the metadata corresponding to the target data to be shared to the second electronic device, the method further includes: Upon receiving a permission setting instruction, retrieve the permission setting information; The permission setting information is sent to the second electronic device to instruct the second electronic device to modify the metadata corresponding to the target data to be shared according to the permission setting information, and to determine the operation permissions for the target data to be shared based on the modified metadata.
4. The method according to claim 3, characterized in that, The second electronic device has multiple user accounts logged in. Sending the permission setting information to the second electronic device instructs it to modify the metadata corresponding to the target data to be shared according to the permission setting information, and to determine the operation permissions for the target data to be shared based on the modified metadata, including: The permission setting information is sent to the second electronic device to instruct the second electronic device to modify the metadata corresponding to the target data to be shared according to the permission setting information, and to determine the operation permissions of each of the multiple user accounts logged in by the second electronic device for the target data to be shared according to the modified metadata.
5. The method according to claim 3, characterized in that, The number of second electronic devices is multiple, and the permission setting information includes permission setting information corresponding to each of the multiple second electronic devices. Sending the permission setting information to the second electronic devices to instruct them to modify the metadata corresponding to the target data to be shared according to the permission setting information, and determining the operation permissions for the target data to be shared based on the modified metadata, includes: The permission setting information corresponding to each of the plurality of second electronic devices is sent to the plurality of second electronic devices respectively, so as to instruct the plurality of second electronic devices to modify the metadata corresponding to the target data to be shared according to their respective permission setting information, and to determine their respective operation permissions for the target data to be shared according to the modified metadata.
6. The method according to claim 1 or 2, characterized in that, The number of second electronic devices is multiple, and the target data to be shared includes target data corresponding to each of the multiple second electronic devices. The step of sending the metadata corresponding to the target data to be shared to the second electronic devices to instruct the second electronic devices to determine the data structure of the target data to be shared in the first electronic devices based on the metadata corresponding to the target data to be shared includes: Metadata corresponding to the target data to be shared for each of the plurality of second electronic devices is sent to the plurality of second electronic devices, so as to instruct the plurality of second electronic devices to determine the data structure of their respective target data to be shared in the first electronic device based on the metadata corresponding to their respective target data to be shared.
7. A data sharing method, characterized in that, Applied to a second electronic device connected to a first electronic device, the method includes: The system receives metadata corresponding to the target data to be shared sent by the first electronic device. The target data to be shared is determined by the first electronic device from multiple data sets based on a target data sharing mode. The target data sharing mode is determined by the first electronic device from multiple data sharing modes upon receiving a data sharing instruction. These multiple data sharing modes include a single file sharing mode, a single directory sharing mode, and a recursive directory sharing mode. The data sharing instruction is triggered by a touch operation on one of the multiple target controls. Each of the multiple data sharing modes corresponds one-to-one with the multiple target controls. Specifically, the single file sharing mode is used to determine the corresponding target file as the target data to be shared, and the single directory sharing mode is used to share the corresponding target directory and the files within that target directory. The data is determined to be the target data to be shared. If there are subdirectories under the target directory, sharing will not be recursively set. The recursive directory sharing mode is used to determine the target directory, the files under the target directory, the subdirectories under the target directory, and the files under the subdirectories as the target data to be shared. If there are subdirectories under the target directory, sharing will be recursively set. If the data sharing mode is the recursive directory sharing mode, the first electronic device obtains the data type of the data under the corresponding target directory. If the data type is a file type, the data under the target directory is determined to be the target data to be shared; if the data type is a directory type, the data under the target directory is determined to be a subdirectory of the target directory, and the data under the target directory is marked as the recursive directory sharing mode. The data structure of the target data to be shared in the first electronic device is determined based on the metadata corresponding to the target data to be shared.
8. A data sharing device, characterized in that, Applied to a first electronic device, wherein the first electronic device is connected to a second electronic device, the device includes: A sharing mode determination module is used to determine a target data sharing mode from multiple data sharing modes upon receiving a data sharing instruction. These multiple data sharing modes include a single file sharing mode, a single directory sharing mode, and a recursive directory sharing mode. The data sharing instruction is triggered by a touch operation on one of the multiple target controls. Each of the multiple data sharing modes corresponds one-to-one with the multiple target controls. Specifically, the single file sharing mode identifies the corresponding target file as the target data to be shared; the single directory sharing mode identifies the corresponding target directory and the files within that target directory as the target data to be shared, and if the target directory has subdirectories, sharing will not be recursively set; the recursive directory sharing mode identifies the target directory, the files within that target directory, the subdirectories within that target directory, and the files within those subdirectories as the target data to be shared, and if the target directory has subdirectories, sharing will be recursively set. The shared data determination module is used to: if the target data sharing mode is the recursive directory sharing mode, obtain the data type of the data under the corresponding target directory; if the data type is a file type, determine the data under the target directory as the target data to be shared; if the data type is a directory type, determine the data under the target directory as a subdirectory of the target directory, and mark the data under the target directory as the recursive directory sharing mode. The data sending module is used to send the metadata corresponding to the target data to be shared to the second electronic device, so as to instruct the second electronic device to determine the data structure of the target data to be shared in the first electronic device based on the metadata corresponding to the target data to be shared.
9. A data sharing device, characterized in that, The device is applied to a second electronic device, which is connected to the first electronic device, and includes: The data receiving module is used to receive metadata corresponding to the target data to be shared sent by the first electronic device. The target data to be shared is determined by the first electronic device from multiple data sets based on a target data sharing mode. The target data sharing mode is determined by the first electronic device from multiple data sharing modes upon receiving a data sharing instruction. The multiple data sharing modes include a single file sharing mode, a single directory sharing mode, and a recursive directory sharing mode. The data sharing instruction is triggered by a touch operation on one of the multiple target controls. Each of the multiple data sharing modes corresponds one-to-one with the multiple target controls. Specifically, the single file sharing mode is used to determine the corresponding target file as the target data to be shared, and the single directory sharing mode is used to determine the corresponding target directory and the target data to be shared. The recorded files are identified as the target data to be shared. If the target directory contains subdirectories, sharing will not be recursively set. The recursive directory sharing mode is used to identify the target directory, files within the target directory, subdirectories within the target directory, and files within the subdirectories as the target data to be shared. If the target directory contains subdirectories, sharing will be recursively set. Specifically, if the data sharing mode is the recursive directory sharing mode, the first electronic device obtains the data type of the data in the corresponding target directory. If the data type is a file, the data in the target directory is identified as the target data to be shared; if the data type is a directory, the data in the target directory is identified as a subdirectory of the target directory, and the data in the target directory is marked as the recursive directory sharing mode. A data structure determination module is used to determine the data structure of the target data to be shared in the first electronic device based on the metadata corresponding to the target data to be shared.
10. An electronic device, characterized in that, The method includes a memory and a processor, the memory being coupled to the processor, the memory storing instructions, and when the instructions are executed by the processor, the processor performing the method as described in any one of claims 1-6 or as described in claim 7.
11. A computer-readable storage medium, characterized in that, The computer-readable storage medium contains program code that can be invoked by a processor to execute the method as described in any one of claims 1-6 or as described in claim 7.
Citation Information
Patent Citations
Data sharing method and apparatus
CN106034282A
File sharing method of cross-end equipment and related products
CN114356872A