File sharing method and device and storage medium

By modifying and querying the extended attributes of files in the file system interface, the flexibility of multi-user file sharing is achieved, and the problem of additional components and global sharing authorization in the prior art is solved, and the efficiency and flexibility of file sharing is improved.

CN119474035APending Publication Date: 2025-02-18GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311018148.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-08-11
Publication Date
2025-02-18

AI Technical Summary

Technical Problem

When implementing multi-user file sharing, the prior art requires the deployment of additional components, and can only implement the sharing authorization of all files in the global path, and cannot perform sharing authorization at a single file level.

Method used

By calling the file system interface, modify the extended attributes of the shared file in the first user operation mode and add authorization information; in the second user operation mode, by obtaining the extended attributes of the file, it is determined that the file carrying authorization information is displayed. Share files.

Benefits of technology

Without adding additional components, the first user operation mode shares a single or multiple files to the second user operation mode, which improves file sharing flexibility and reduces resource and performance overhead.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119474035A_ABST
    Figure CN119474035A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a file sharing method and device and a storage medium, and belongs to a data sharing technology in the field of electronic equipment. The method comprises the following steps: in a first user operation mode, modifying an extension attribute of a shared file of a first user by calling a file system interface, and adding authorization information in the extension attribute; and in a second user operation mode, acquiring the extension attribute of each file by calling the file system interface, and determining the file with the authorization information carried in the extension attribute as the shared file which can be displayed in the second user operation mode. According to the technical scheme provided by the embodiment of the invention, a single file or a plurality of files can be shared from the first user operation mode to the second user operation mode without adding extra components, so that the file sharing flexibility is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to data sharing technology in the field of electronic devices, and more particularly to a file sharing method, device and storage medium. Background Art

[0002] At present, some electronic devices such as Android system devices can support the creation of multiple users to achieve cross-user file sharing. However, in order to achieve multi-user file sharing, the relevant technical solutions need to deploy additional components in the system, and can only achieve sharing authorization for all files in the global path, and cannot perform sharing authorization at the level of a single file. Summary of the invention

[0003] The embodiments of the present application provide a file sharing method, device and storage medium, which can realize sharing of a single file or multiple files from a first user operation mode to a second user operation mode without adding additional components, thereby improving the flexibility of file sharing.

[0004] The present application provides a file sharing method, which is applied to an electronic device, wherein the electronic device supports multiple user operation modes, and the method includes:

[0005] In the first user running mode, modifying the extended attribute of the shared file of the first user by calling the file system interface, and adding the authorization information to the extended attribute;

[0006] In the second user operation mode, the extended attribute of each file is obtained by calling the file system interface, and the file carrying the authorization information in the extended attribute is determined as a shared file that can be displayed in the second user operation mode.

[0007] The embodiment of the present application provides a file sharing device, which is applied to an electronic device, wherein the electronic device supports multiple user operation modes, and the device includes:

[0008] A sharing setting unit, configured to modify, in a first user operation mode, an extended attribute of a shared file of the first user by calling a file system interface, and add authorization information to the extended attribute;

[0009] The shared display unit is used to obtain the extended attributes of each file by calling the file system interface in the second user operation mode, and determine the file carrying the authorization information in the extended attribute as a shared file that can be displayed in the second user operation mode.

[0010] The embodiment of the present application provides an electronic device, including: a processor and a memory. The memory is used to store a computer program, and the processor is used to call and run the computer program stored in the memory, so that the electronic device executes the file sharing method in the embodiment of the present application.

[0011] The embodiment of the present application provides a chip for implementing the above-mentioned file sharing method.

[0012] Specifically, the chip includes: a processor, which is used to call and run a computer program from a memory, so that a device equipped with the chip executes the file sharing method in the embodiment of the present application.

[0013] An embodiment of the present application provides a computer-readable storage medium for storing a computer program. When the computer program is executed by a device, the device executes the file sharing method in the embodiment of the present application.

[0014] An embodiment of the present application provides a computer program product, including computer program instructions, which enable a computer to execute the file sharing method in the embodiment of the present application.

[0015] An embodiment of the present application provides a computer program, which, when executed on a computer, enables the computer to execute the file sharing method in the embodiment of the present application.

[0016] In the embodiment of the present application, in the first user operation mode, the extended attributes of the shared files of the first user are modified by calling the file system interface, and the authorization information is added to the extended attributes; in the second user operation mode, the extended attributes of each file are obtained by calling the file system interface, and the files carrying the authorization information in the extended attributes are determined as shared files that can be displayed in the second user operation mode. In this way, the authorization information of the file is marked by the extended attributes of the file, and when other user modes are running, the authorization information of the file is queried to determine whether to authorize access, without adding additional components, avoiding the resource and performance overhead caused by the need to add additional components. Since the extended attributes of a single or multiple shared files can be modified through the file system interface, the first user operation mode can share a single file or multiple files to the second user operation mode, that is, the sharing settings of single files and multiple files can be realized, which improves the flexibility of file sharing. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present application.

[0018] Figure 1 It is a flowchart of a file sharing method provided in an embodiment of the present application;

[0019] Figure 2is a schematic diagram of modifying the extended attributes of a shared file provided in an embodiment of the present application;

[0020] Figure 3 is a schematic diagram of a multi-user operation mode of an electronic device provided in an embodiment of the present application;

[0021] Figure 4 This is a schematic diagram of the display of a shared file provided in an embodiment of the present application. Figure 1 ;

[0022] Figure 5 This is a schematic diagram of the display of a shared file provided in an embodiment of the present application. Figure 2 ;

[0023] Figure 6 is a schematic diagram of obtaining extended attributes of a file provided in an embodiment of the present application;

[0024] Figure 7 It is a schematic diagram of a process of sharing files among multiple users provided in an embodiment of the present application;

[0025] Figure 8 is a schematic diagram of the structure of a file sharing device 800 provided in an embodiment of the present application;

[0026] Fig. 9 is a schematic structural diagram of an electronic device 900 according to an embodiment of the present application;

[0027] Fig.10 is a schematic structural diagram of a chip 1000 according to an embodiment of the present application. DETAILED DESCRIPTION

[0028] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.

[0029] The technical solution of the embodiment of the present application can be applied to various electronic devices, which can be terminal devices or servers.

[0030] It should be understood that the term "and / or" in this article is only a description of the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.

[0031] It should be understood that the "indication" mentioned in the embodiments of the present application can be a direct indication, an indirect indication, or an indication of an association relationship. For example, A indicates B, which can mean that A directly indicates B, for example, B can be obtained through A; it can also mean that A indirectly indicates B, for example, A indicates C, and B can be obtained through C; it can also mean that there is an association relationship between A and B.

[0032] In the description of the embodiments of the present application, the term "corresponding" may indicate a direct or indirect correspondence between two items, or an association relationship between the two items, or a relationship between indication and being indicated, configuration and being configured, and the like.

[0033] To facilitate understanding of the technical solutions of the embodiments of the present application, the relevant technologies of the embodiments of the present application are described below. The following related technologies can be arbitrarily combined with the technical solutions of the embodiments of the present application as optional solutions, and they all belong to the protection scope of the embodiments of the present application.

[0034] In order to achieve more flexible permission management and protect user data, Android system terminals use the user space file system (Filesystem in Userspace, Fuse) system to manage and maintain external storage files. Among them, the media storage (MediaProvider) component integrates the Fuse user state background process (Fuse Daemon) to handle all file access requests.

[0035] For example, multiple users can be created on an Android terminal, but each user can only access his own files, and cross-user file sharing cannot be achieved. In order to achieve cross-user file sharing, someone proposed the following solution: (1) Create multiple users on the terminal; (2) Bind the common service component of the terminal to the multiple users; (3) Use the common service component to perform cross-user external storage authorization processing between the multiple users. This solution proposes the concept of public service, uses the common service binder to the storage manager service (StorageManagerService) of multiple users, and performs cross-user storage permission management between different users to achieve data sharing in the Fuse system. However, this solution has at least the following disadvantages: (1) It is necessary to deploy an additional common service component in the Android system, and when performing file sharing authorization, it is necessary to bind with the common service component to achieve cross-process interaction, which increases system overhead and affects performance; (2) This solution can only achieve sharing authorization for all files in the entire global path, and cannot achieve sharing authorization at the level of a single file.

[0036] The present application embodiment provides a file sharing method. Figure 1 1 is a flowchart of a file sharing method according to an embodiment of the present application. The file sharing method can be applied to an electronic device that supports multiple user operation modes. In some possible implementations, the method can also be implemented by a processor calling a computer-readable instruction stored in a memory. Figure 1 As shown, the file sharing method may include:

[0037] S101: In a first user operation mode, an extended attribute of a shared file of the first user is modified by calling a file system interface, and authorization information is added to the extended attribute;

[0038] S102: In the second user running mode, the extended attribute of each file is obtained by calling the file system interface, and the file carrying the authorization information in the extended attribute is determined as a shared file that can be displayed in the second user running mode.

[0039] In an embodiment of the present application, the electronic device supports the creation of multiple users, and the electronic device is only allowed to run in one user mode at the same time. Exemplarily, if the electronic device supports the creation of two users, respectively recorded as User 1 and User 2, the electronic device is only allowed to run User 1 mode or User 2 mode at the same time. Another exemplary embodiment, if the electronic device supports the creation of three users, respectively recorded as User 1, User 2, and User 3, the electronic device is only allowed to run User 1 mode, User 2 mode, or User 3 mode at the same time.

[0040] In an embodiment of the present application, the first user operation mode and the second user operation mode are two operation modes in the multi-user operation mode supported by the electronic device. The first user operation mode may be any operation mode in the multi-user operation mode, and in the first user operation mode, the user selects the files shared by the user with other users. The second user operation mode may be any operation mode in the multi-user operation mode, and in the second user operation mode, the user can view the files shared by other users. In practical applications, in the first user operation mode, files shared with other users (such as the second user) can be selected, and files shared by other users (such as the second user) can be viewed. Similarly, in the second user operation mode, files shared with other users (such as the first user) can be selected, and files shared by other users (such as the first user) can be viewed.

[0041] In the embodiment of the present application, the file system interface refers to the file system interface of the operating system of the electronic device. Here, the operating system can be an Android operating system, or other operating systems that support multi-user operation mode. The operating system provides a set of functions to facilitate application programs to control electronic devices. One of the important purposes of the input / output (I / O) subsystem of the operating system is to provide the simplest interface for other parts of the system, and the file system interface is one of the interfaces.

[0042] In the embodiment of the present application, extended attributes (xattr for short) are a function in the file system that can add more metadata to files or directories. The present application uses the defined newly added extended attributes to describe multi-user authorization information.

[0043] In the embodiment of the present application, the file may be a file under a file manager such as a picture, audio, video, movie, document, etc. The present application does not impose a mandatory restriction on the type of the file.

[0044] In the embodiment of the present application, the shared file of the first user can be understood as a file shared by the first user to other users.

[0045] Exemplarily, the shared file may be a file of the target application, multiple files of the target application, or all files of the target application. Here, the target application may be an application under a file manager such as an album application, an audio application, a video application, a movie application, or a document application.

[0046] It should be noted that in the first user operation mode, the files shared with other users can be set according to user needs. In other words, the files shared by the first user with other users can be a single file of the target application, multiple files of the target application, or all files of the target application.

[0047] The technical solution of the embodiment of the present application is that in the first user operation mode, the extended attributes of the shared files of the first user are modified by calling the file system interface, and the authorization information is added to the extended attributes; in the second user operation mode, the extended attributes of each file are obtained by calling the file system interface, and the file carrying the authorization information in the extended attributes is determined as a shared file that can be displayed in the second user operation mode. The authorization information of the file is marked by the extended attributes of the file, and when other user modes are running, the authorization information of the file is queried to determine whether to authorize access. There is no need to add additional components, which avoids the resource and performance overhead problems caused by the need to add additional components. Since the extended attributes of a single or multiple shared files can be modified through the file system interface, the first user operation mode can share a single file or multiple files to the second user operation mode, and the sharing settings of single files and multiple files can be realized, which improves the flexibility of file sharing.

[0048] In some embodiments, in a first user operation mode, the extended attributes of the first user's shared files are modified by calling a file system interface, including: in the first user operation mode, in response to detecting a sharing operation for the first user's shared files, sending a file sharing request to a media storage component; calling the file system interface through the media storage component to modify the extended attributes of the first user's shared files.

[0049] Figure 2 is a schematic diagram of modifying the extended attributes of a shared file according to an embodiment of the present application, such as Figure 2As shown, a file sharing request is sent to a media storage component, and the file system interface is called by the media storage component to modify the extended attributes of the shared file.

[0050] Here, the media storage component can be the MediaProvider component of the Android system. Specifically, the MediaProvider component is a system-level application in the Android system, which is responsible for managing the access and management of multimedia files, including multiple types such as audio, video, and pictures. These multimedia files may be stored in different locations of the file system, such as internal memory, external memory, or private directories of other applications. The MediaProvider component uses a database to store and manage metadata of multimedia files, such as file path, size, timestamp, and other information. The MediaProvider component provides a variety of methods for querying multimedia files, and can query different types of multimedia files based on different conditions.

[0051] In some implementations, modifying the extended attributes of the first user's shared file by calling the file system interface can be understood as: modifying the extended attributes of the first user's shared file by calling the file system extended attribute operation (setxattr).

[0052] In this way, only a small amount of logic needs to be added to the media storage component of the operating system itself, and the extended attributes of the shared files can be modified by using the file system interface of the operating system, so that the modified extended attributes are defined as files that can be shared in other user running modes. This not only reduces the resource and performance overhead problems caused by the need to add additional components in the original solution, but also realizes the sharing settings of single files and multiple files, increasing the flexibility of sharing.

[0053] In some implementations, the authorization information includes a user identification of the authorized user. In a multi-user operation mode supported by the electronic device, each user in the multi-user operation mode has a different corresponding user identification.

[0054] In some embodiments, a file that carries authorization information in an extended attribute is determined as a shared file from the first user that can be displayed in the second user operation mode, including: a file that carries authorization information in an extended attribute and includes a user identifier of the second user in the authorization information is determined as a shared file from the first user that can be displayed in the second user operation mode.

[0055] Figure 3 A schematic diagram showing a multi-user operation mode of an electronic device is shown, such as Figure 3As shown, the three user operation modes supported by the electronic device are respectively recorded as the first user operation mode, the second user operation mode and the third user operation mode. Different user operation modes can be switched at will.

[0056] For example, in the first user operation mode, the photo album application includes 100 pictures, and pictures 1, 3, and 5 in the photo album application are set to be shared with the second user, and pictures 1, 3, and 5 all carry authorization information, and the authorization information carries the user ID of the authorized user, i.e., the second user; pictures 2, 4, and 6 in the photo album application are set to be shared with the third user, and pictures 2, 4, and 6 all carry authorization information, and the authorization information carries the user ID of the authorized user, i.e., the third user; then, when the electronic device is in the second user operation mode, pictures 1, 3, and 5 carrying the user ID of the authorized user, i.e., the second user, are used as shared files from the first user that can be displayed in the second user operation mode. When the electronic device is in the third user operation mode, pictures 2, 4, and 6 carrying the user ID of the authorized user, i.e., the third user, are used as shared files from the first user that can be displayed in the third user operation mode.

[0057] In some embodiments, the user identification of the authorized user can be represented in the form of a string, for example, the authorization information is represented as "user: 002, 003", where 002 and 003 respectively represent the identification (IdentityDocument, ID) of the authorized user, i.e., the authorized user with ID=002 and the authorized user with ID=003.

[0058] In some embodiments, the user identification of the authorized user exists in the form of a list. Specifically, a key-value pair is added to the list, and the key-value pair can be interpreted as two linked data items, in which the "key" represents the identified user and the "value" represents the user identification of the authorized user.

[0059] In this way, storing the user IDs of authorized users in the form of a list can facilitate the media storage component to quickly obtain the user IDs of authorized users, thereby quickly querying the files shared with the current user's running mode from the list, thereby increasing the display rate of shared files and improving the user experience.

[0060] In some embodiments, the authorization information also includes identification information of the authorized user. Here, if the first user shares one or some files of the first user with the second user, the first user is the authorized user and the second user is the authorized user. If the third user shares one or some files of the third user with the second user, the third user is the authorized user and the second user is the authorized user.

[0061] Exemplarily, the three user operation modes supported by the electronic device are respectively recorded as the first user operation mode, the second user operation mode and the third user operation mode. In the first user operation mode, the album application includes 100 pictures, and pictures 1, 3 and 5 in the album application are set to be shared with the second user. Pictures 1, 3 and 5 all carry authorization information, and the authorization information carries the user ID of the authorized user, i.e., the first user, and the user ID of the authorized user, i.e., the second user; pictures 2, 4 and 6 in the album application are set to be shared with the third user, and pictures 2, 4 and 6 all carry authorization information, and the authorization information carries the user ID of the authorized user, i.e., the first user, and the user ID of the authorized user, i.e., the third user. In the third user operation mode, the album application includes 80 pictures, and pictures 7, 8 and 9 in the album application are set to be shared with the second user. Pictures 7, 8 and 9 all carry authorization information, and the authorization information carries the user ID of the authorized user, i.e., the third user, and the user ID of the authorized user, i.e., the second user. Then, when the electronic device is in the second user operation mode, pictures 1, 3 and 5, 7, 8 and 9 carrying the user identification of the authorized user, ie, the second user, will be used as shared files that can be displayed in the second user operation mode.

[0062] Figure 4 Shows the display of shared files Figure 1 ,like Figure 4 As shown, in the second user operation mode, in order to facilitate better management of each user's files, it can be clearly shown that pictures 1, 3 and 5 are from the first user, and pictures 7, 8 and 9 are from the third user.

[0063] In this way, by displaying the source of the current shared file, it is convenient to further manage the file, such as deleting, blocking, sharing, etc.

[0064] In some embodiments, the method may further include:

[0065] In the second user operation mode, in response to detecting an information viewing request for the presentable shared file, a source of the presentable shared file is displayed.

[0066] Exemplarily, the three user operation modes supported by the electronic device are respectively recorded as the first user operation mode, the second user operation mode and the third user operation mode. In the first user operation mode, the album application includes 100 pictures, and pictures 1, 3 and 5 in the album application are set to be shared with the second user. Pictures 1, 3 and 5 all carry authorization information, and the authorization information carries the user ID of the authorized user, i.e., the first user, and the user ID of the authorized user, i.e., the second user; pictures 2, 4 and 6 in the album application are set to be shared with the third user, and pictures 2, 4 and 6 all carry authorization information, and the authorization information carries the user ID of the authorized user, i.e., the first user, and the user ID of the authorized user, i.e., the third user. In the third user operation mode, the album application includes 80 pictures, and pictures 7, 8 and 9 in the album application are set to be shared with the second user. Pictures 7, 8 and 9 all carry authorization information, and the authorization information carries the user ID of the authorized user, i.e., the third user, and the user ID of the authorized user, i.e., the second user. Then, when the electronic device is in the second user operation mode, pictures 1, 3 and 5, 7, 8 and 9 carrying the user identification of the authorized user, ie, the second user, will be used as shared files that can be displayed in the second user operation mode. Figure 5 Shows the display of shared files Figure 2 ,like Figure 5 As shown, in the second user operation mode, pictures 1, 3, 5, 7, 8 and 9 are displayed, and the source of the picture is displayed only when a picture is clicked and a request to view the detailed information of the picture is received. For example, when picture 1 is clicked and a request to view the detailed information of picture 1 is received, it is displayed that picture 1 comes from the first user.

[0067] In this way, when a request for viewing information of the displayable shared file is detected, the source of the displayable shared file is displayed, which is conducive to customized management of the file, such as deletion, blocking, sharing, etc.

[0068] In some embodiments, in the second user operation mode, the extended attributes of each file are obtained by calling the file system interface, including: in the second user operation mode, in response to detecting a file viewing request for a target application of the second user, sending a file viewing request to a media storage component; calling the file system interface through the media storage component, traversing all files under the target application to obtain the extended attributes of each file under the target application.

[0069] In some implementations, calling the file system interface to obtain the extended attributes of each file can be understood as: obtaining the extended attributes of each file by calling the file system extended attribute operation (getxattr).

[0070] In this way, only a small amount of logic needs to be added to the media storage component of the operating system itself, and the extended attributes of each file under the target application can be obtained by using the file system interface of the operating system. This not only reduces the resource and performance overhead problems caused by the need to add additional components in the original solution, but also realizes the sharing settings of single files and multiple files, increasing the flexibility of sharing.

[0071] In some implementations, in the second user running mode, after acquiring the extended attribute of each file by calling the file system interface, the method further includes:

[0072] The extended attribute of each file is sent to the user space file system background (ie, Fuse Daemon) process of the media storage component through the file system interface, so that the user space file system background process determines the file shared with the second user.

[0073] Figure 6 is a schematic diagram of obtaining extended attributes of a file according to an embodiment of the present application, such as Figure 6 As shown, the media storage component sends a file viewing request, calls the file system interface through the media storage component, traverses all files under the target application to obtain the extended attributes of each file under the target application; and sends the extended attributes of each file to the user space file system background process of the media storage component through the file system interface.

[0074] In this way, the files shared with the second user can be determined by using Fuse Daemon in the media storage component of the operating system without adding additional components, thereby reducing the resource and performance overhead problems caused by the need to add additional components in the original solution.

[0075] Figure 7 A schematic diagram of a process of sharing a file among multiple users provided in an embodiment of the present application is shown, such as Figure 7 As shown, the process includes:

[0076] S701: Multiple users have been created on the Android device, including User 1 and User 2;

[0077] S702: The Android device runs in user 1 mode;

[0078] S703: In user 1 mode, enter the photo album APP, select several photos that you want to share with user 2, and the photo album APP will call the interface provided by the media storage component;

[0079] S704: After receiving the sharing request, the media storage component in user 1 mode calls the file system interface to set the extended attributes of all selected files and add the authorization information to the extended attributes;

[0080] Specifically, the authorization information is represented in the form of a key-value pair. The key is represented by a fixed string "Users", and the value is a list. Adding the UserID number of user 2 to the list (for example, the UserID number of user 2 is 10) indicates authorization to access these selected photos in the user 2 mode.

[0081] Here, the file system interface is called to set the extended attributes of all selected files, including: setting the extended attributes of all selected files by calling the setxattr operation of the file system interface.

[0082] S705: Switching from user 1 mode to user 2 mode;

[0083] S706: In user 2 mode, enter the photo album APP and initiate a request to view photos shared by other users;

[0084] S707: After receiving the request, the media storage component in the user 2 mode traverses all files in the mounted directory and calls the file system interface to obtain the extended attributes of each file;

[0085] Here, the file system interface is called to obtain the extended attributes of each file, including: obtaining the extended attributes of each file by calling the getxattr operation of the file system interface.

[0086] S708: The photo album APP sends the extended attributes of each file to the user space file system background process in the media storage component through the file system interface of the operating system, and the user space file system background process determines the photos that are authorized for user 2 to access;

[0087] Specifically, if the extended attribute of photo 001 carries UserID=10, it means that user 2 is authorized to access photo 001.

[0088] S709: In the user 2 mode, several photos shared with user 2 are displayed in the photo album APP.

[0089] In this way, in a certain user operation mode, the authorization information of the shared file is marked by the file's extended attributes. When switching to another user operation mode, the authorization information of the file is queried to determine whether to authorize access. The above functions can be realized by adding a small amount of logic in the media storage component. The solution described in this application not only reduces the resource and performance overhead caused by the need to add additional components in the original solution, but also realizes the sharing settings of single files and multiple files, increasing flexibility.

[0090] It should be understood that Figures 2 to 7 The application schematic diagram shown is only illustrative, and those skilled in the art can Figures 2 to 7Various obvious changes and / or substitutions may be made to the examples.

[0091] Figure 8 800 is a schematic diagram of the structure of a file sharing device according to an embodiment of the present application, which is applied to an electronic device that supports multiple user operation modes, such as Figure 8 As shown, the file sharing device 800 includes:

[0092] The sharing setting unit 801 is used to modify the extended attributes of the shared file of the first user by calling the file system interface in the first user running mode, and add the authorization information in the extended attributes;

[0093] The shared display unit 802 is used to obtain the extended attributes of each file by calling the file system interface in the second user operation mode, and determine the files carrying authorization information in the extended attributes as shared files that can be displayed in the second user operation mode.

[0094] In some implementations, the sharing setting unit 801 is configured to:

[0095] In the first user operation mode, in response to detecting a sharing operation for a shared file of the first user, sending a file sharing request to the media storage component;

[0096] The file system interface is called by the media storage component to modify the extended attribute of the shared file of the first user.

[0097] In some implementations, the authorization information includes a user identification of the authorized user.

[0098] The shared display unit 802 is used for:

[0099] A file having authorization information in its extended attributes and including a user identification of the second user in the authorization information is determined as a shared file that can be displayed in the second user operation mode.

[0100] In some implementations, the user identities of authorized users exist in a list form.

[0101] In some implementations, the authorization information also includes identification information of the authorized user.

[0102] In some implementations, the shared display unit 802 is further configured to:

[0103] In the second user operation mode, in response to detecting an information viewing request for the presentable shared file, a source of the presentable shared file is displayed.

[0104] In some implementations, the shared display unit 802 is further configured to:

[0105] In the second user operation mode, in response to detecting a file viewing request for a target application of the second user, sending the file viewing request to the media storage component;

[0106] The file system interface is called by the media storage component to traverse all files under the target application to obtain the extended attribute of each file under the target application.

[0107] In some embodiments, the shared display unit 802 is also used to obtain the extended attributes of each file by calling the file system interface, and then send the extended attributes of each file to the user space file system background process of the media storage component through the file system interface, so that the user space file system background process can determine the files shared with the second user.

[0108] The file sharing device 800 of the embodiment of the present application can realize the corresponding functions of the file sharing device in the aforementioned method embodiment. The corresponding processes, functions, implementation methods and beneficial effects of each module (sub-module, unit or component, etc.) in the file sharing device 800 can be found in the corresponding description in the aforementioned method embodiment, and will not be repeated here. It should be noted that the functions described by each module (sub-module, unit or component, etc.) in the file sharing device 800 of the embodiment of the application can be realized by different modules (sub-module, unit or component, etc.) or by the same module (sub-module, unit or component, etc.).

[0109] In an embodiment of the present application, each unit of the above-mentioned file sharing device can implement the functions of each unit in the form of software, hardware, or a combination of software and hardware. In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of modules or units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units 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 units, which can be electrical, mechanical or other forms.

[0110] The units described as separate components may or may not be physically separated, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0111] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0112] The file sharing device of the embodiment of the present application does not need to add additional components, thus avoiding the resource and performance overhead caused by the need to add additional components. Since the extended attributes of a single or multiple shared files can be modified through the file system interface, it is possible to share a single file or multiple files from the first user running mode to the second user running mode, and it is possible to implement single-file and multi-file sharing settings, thereby improving the flexibility of file sharing.

[0113] Fig. 9 9 is a schematic structural diagram of an electronic device 900 according to an embodiment of the present application. The electronic device 900 includes a processor 910 and a memory 920. The processor 910 can call and run a computer program from the memory 920 to enable the electronic device 900 to implement the method in the embodiment of the present application.

[0114] The memory 920 may be a separate device independent of the processor 910 , or may be integrated into the processor 910 .

[0115] In one implementation, the electronic device 900 may further include a transceiver 930, and the processor 910 may control the transceiver 930 to communicate with other devices, specifically, may send information or data to other devices, or receive information or data sent by other devices.

[0116] The transceiver 930 may include a transmitter and a receiver. The transceiver 930 may further include an antenna, and the number of antennas may be one or more.

[0117] In one implementation, the electronic device 900 may be the electronic device of the embodiment of the present application, and the electronic device 900 may implement the corresponding processes implemented by the electronic device in each method of the embodiment of the present application, which will not be described in detail here for the sake of brevity.

[0118] Fig.10 1 is a schematic structural diagram of a chip 1000 according to an embodiment of the present application. The chip 1000 includes a processor 1010, and the processor 1010 can call and run a computer program from a memory to implement the method in the embodiment of the present application.

[0119] In one implementation, the chip 1000 may further include a memory 1020. The processor 1010 may call and run a computer program from the memory 1020 to implement the method executed by the electronic device in the embodiment of the present application.

[0120] The memory 1020 may be a separate device independent of the processor 1010 , or may be integrated into the processor 1010 .

[0121] In one implementation, the chip 1000 may further include an input interface 1030. The processor 1010 may control the input interface 1030 to communicate with other devices or chips, and specifically, may obtain information or data sent by other devices or chips.

[0122] In one implementation, the chip 1000 may further include an output interface 1040. The processor 1010 may control the output interface 1040 to communicate with other devices or chips, and specifically, may output information or data to other devices or chips.

[0123] In one implementation, the chip can be applied to the electronic device in the embodiments of the present application, and the chip can implement the corresponding processes implemented by the electronic device in each method of the embodiments of the present application, which will not be described in detail here for the sake of brevity.

[0124] The chips applied to the electronic device may be the same chip or different chips.

[0125] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.

[0126] The processor mentioned above may be a general-purpose processor, a digital signal processor (DSP), a field programmable gate array (FPGA), an application specific integrated circuit (ASIC) or other programmable logic devices, transistor logic devices, discrete hardware components, etc. The general-purpose processor mentioned above may be a microprocessor or any conventional processor, etc.

[0127] The memory mentioned above may be a volatile memory or a nonvolatile memory, or may include both volatile and nonvolatile memories. Among them, the nonvolatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM).

[0128] It should be understood that the above-mentioned memory is exemplary but not restrictive. For example, the memory in the embodiments of the present application may also be static random access memory (static RAM, SRAM), dynamic random access memory (dynamic RAM, DRAM), synchronous dynamic random access memory (synchronous DRAM, SDRAM), double data rate synchronous dynamic random access memory (double data rate SDRAM, DDRSDRAM), enhanced synchronous dynamic random access memory (enhanced SDRAM, ESDRAM), synchronous link dynamic random access memory (synch link DRAM, SLDRAM) and direct memory bus random access memory (Direct Rambus RAM, DRRAM), etc. That is to say, the memory in the embodiments of the present application is intended to include but not limited to these and any other suitable types of memory.

[0129] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, 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 in accordance with the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions can 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-readable storage medium can be any available medium that a computer can access or a data storage device such as a server, a data center, etc. that contains one or more available media integrations. The available medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a DVD), or a semiconductor medium (eg, a solid state disk (SSD)).

[0130] 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.

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

[0132] 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 file sharing method, applied to an electronic device, wherein the electronic device supports multiple user operation modes, characterized in that: The method comprises: In the first user running mode, modifying the extended attribute of the shared file of the first user by calling the file system interface, and adding the authorization information to the extended attribute; In the second user operation mode, the extended attribute of each file is obtained by calling the file system interface, and the file carrying the authorization information in the extended attribute is determined as a shared file that can be displayed in the second user operation mode.

2. The method according to claim 1, characterized in that: In the first user running mode, the extended attributes of the first user's shared files are modified by calling the file system interface, including: In the first user operation mode, in response to detecting a sharing operation for a shared file of the first user, sending a file sharing request to a media storage component; The file system interface is called by the media storage component to modify the extended attribute of the shared file of the first user.

3. The method according to claim 1, characterized in that The authorization information includes the user identification of the authorized user; The step of determining the file carrying the authorization information in the extended attribute as a shared file that can be displayed in the second user running mode includes: The file that carries the authorization information in the extended attribute and includes the user identification of the second user in the authorization information is determined as the shareable file that can be displayed in the second user operation mode.

4. The method according to claim 3, characterized in that The user identifications of the authorized users exist in the form of a list.

5. The method according to claim 1, characterized in that The authorization information also includes identification information of the authorized user.

6. The method according to claim 5, characterized in that The method further comprises: In the second user operation mode, in response to detecting an information viewing request for the presentable shared file, a source of the presentable shared file is displayed.

7. The method according to claim 1, characterized in that The step of obtaining the extended attribute of each file by calling the file system interface in the second user operation mode includes: In the second user operation mode, in response to detecting a file viewing request for a target application of the second user, sending the file viewing request to a media storage component; The file system interface is called by the media storage component to traverse all files under the target application to obtain the extended attribute of each file under the target application.

8. The method according to claim 7, characterized in that In the second user running mode, after acquiring the extended attribute of each file by calling the file system interface, the method further includes: The extended attribute of each file is sent to the user space file system background process of the media storage component through the file system interface, so that the user space file system background process determines the files shared with the second user based on the extended attribute of each file.

9. A file sharing device, applied to an electronic device, the electronic device supports multiple user operation modes, characterized in that: The device comprises: A sharing setting unit, configured to modify, in a first user operation mode, an extended attribute of a shared file of the first user by calling a file system interface, and add authorization information to the extended attribute; The shared display unit is used to obtain the extended attributes of each file by calling the file system interface in the second user operation mode, and determine the file carrying the authorization information in the extended attribute as a shared file that can be displayed in the second user operation mode.

10. An electronic device comprising: A processor and a memory, the memory being used to store a computer program, and the processor being used to call and run the computer program stored in the memory so that the electronic device executes the method as claimed in any one of claims 1 to 8.

11. A chip, comprising: A processor, configured to call and run a computer program from a memory, so that a device equipped with the chip executes a method as claimed in any one of claims 1 to 8.

12. A computer-readable storage medium for storing a computer program, which, when executed by a device, causes the device to perform the method according to any one of claims 1 to 8.

13. A computer program product comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 8.