File access method and device, electronic device, and storage medium
By introducing the file system daemon in the Android system and managing application access to the shared storage area based on policies, the problem of lack of refined access control of the shared storage area is solved, flexible file access rights management and policy updates are realized, and the system is improved. portability and scalability.
Patent Information
- Application Number
- CN202110366477.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-04-06
- Publication Date
- 2024-09-17
- Estimated Expiration
- 2041-04-06
AI Technical Summary
The access control of the shared storage area in the existing Android system lacks refinement, which results in the application's access to the entire shared area being either completely open or completely prohibited. Fine permission management for specific files cannot be achieved, and the file access policy does not have good visibility. Portability and dynamic update capabilities, lack of user involvement.
By introducing a daemon process in the first file system, it receives the application's file operation instructions, determines the application's permissions to access the file based on the current file access policy, responds to the access method, allows or denies access, and supports dynamic updates of the file access policy. and flexible management.
It achieves refined control over shared area files, provides strategic access permissions, improves the portability and scalability of file access, and allows users to set and update access policies according to needs.
Smart Images

Figure CN113268450B
Abstract
Description
Technical Field
[0001] Embodiments of the present application relate to system file access technology, and more particularly to a file access method and device, an electronic device, and a storage medium. Background Art
[0002] In existing Android systems, the shared storage area solution has the problem of being unable to be finely controlled. Specifically, an application's access to the entire shared area can either access all files or not have access to any files. Figure 1 The following is a schematic diagram of the architecture of data storage in a mobile device based on the Android system. Figure 1 As shown, the Android system supports various applications such as WPS, Instant Messaging (IM) and Email, etc. Correspondingly, the storage area is roughly divided into private storage area and shared storage area. Among them, the private storage area is mainly the application sandbox, that is, the Android system supports various applications to have their own exclusive storage space, and other applications have no right to access; the shared storage area is a common storage area, and the file data stored in it is visible to all applications.
[0003] Figure 1 The architecture shown in the figure mainly manages file access control based on the identification of file objects, such as WPS, IM, and Email. The specific implementation of the identification can be the owner of the file, or some file extension attributes that cannot be tampered with at will. The file object identification generated in different areas is different. The file identification generated in the private sandbox area is the identification of the application that generated the file; when other applications access it, they cannot access it because the file identification and the visitor identification are incompatible. For files generated in the shared area, regardless of the identity of the generator, the generated file identification is unified as a shared identification, not an application identification.
[0004] Figure 1 The architecture shown has the obvious disadvantage of lacking fine-grained control over the shared storage area when managing files. Once an application is allowed to access the shared area, all files in the shared area will be allowed to access. If access to the shared area is prohibited, the application will lose the data sharing function.
[0005] At present, file access control mainly includes two methods: autonomous access control and mandatory access control. The basic idea of autonomous access control is that an application can only access files whose owner and the application have the same identity or whose file group contains the application's group identity; while the basic idea of mandatory access control is to label each file and each application with a label that cannot be changed at will. Which files an application can access is determined by the access policy library.
[0006] The above file access control technologies have the following problems:
[0007] Poor portability: File control policies are customized locally according to system characteristics. For example, only tags set in the policy will work. The tags for files and applications are written in advance. If there are applications outside the policy in a new system, the permission control system will not work. Dynamic update of access policies is inconvenient: Many policies can only be loaded when the computer is turned on. Once the policy is updated, the current policy needs to be stopped and reloaded. Lack of user participation: The above file access policies directly allow or deny a certain application's access to files based on the preset policy, and users cannot participate. Summary of the invention
[0008] In view of this, embodiments of the present application provide a file access method and device, an electronic device, and a storage medium.
[0009] According to a first aspect of an embodiment of the present application, a file access method is provided, including:
[0010] The access interface of the first file system receives a file operation instruction of an application for a file, and sends the file operation instruction to the daemon process of the first file system through the kernel;
[0011] The daemon process of the first file system determines the permission of the application for the file to be accessed based on the current file access policy, determines the access method of the application to the file to be accessed in response to the permission of the file to be accessed, and responds to the application through the access interface of the kernel and the first file system based on the access method.
[0012] In one embodiment, responding to the application through the kernel and the access interface of the first file system based on the access mode includes:
[0013] When the access mode is access denial, sending an access failure response message to the application through the kernel and the interface unit, or sending a re-authentication response message to the application;
[0014] When the access mode is to allow access, the daemon process of the first file system responds to the file operation instruction and sends the file operation instruction to the second file system through the system interface, so that the second file system calls the corresponding file and performs the corresponding operation on the file to be accessed according to the file operation instruction, and stores the operation result in the corresponding file directory in the second file system; wherein the operation process and operation result for the file to be accessed are transparently transmitted to the application through the kernel and the access interface of the first file system.
[0015] In one embodiment, the method further comprises:
[0016] The daemon process of the first file system stores a file access policy for a corresponding file in the second file system;
[0017] The daemon process of the first file system receives an update request for the file access policy, and updates the file access policy in response to the update request.
[0018] In one embodiment, the method further comprises:
[0019] The directory and file attribute information of the files stored in the storage area are set in the second file system, and are transparently transmitted to the daemon process of the first file system through the system interface;
[0020] The daemon of the first file system displays the file directory and file attribute information of at least part of the files through the access interface of the first file system based on the file access policy, the access rights of the application, and at least one of the access levels of the files stored in the set storage area.
[0021] In one embodiment, the method further comprises:
[0022] The first file system is installed or mounted in the set storage area of the second file system;
[0023] At least some of the shared files of the application in the second file system are stored in the setting storage area and associated with the file directory in the setting storage area; wherein the attribute information of at least some of the shared files retains the identification information of the creator of the file.
[0024] In one embodiment, the file operation instruction includes at least one of instructions for opening, closing, reading, writing, and viewing attributes of a file.
[0025] According to a second aspect of an embodiment of the present application, a file access device is provided, which is applied to a first file system, and the device includes:
[0026] An interface unit, configured to receive a file operation instruction from an application for a file, and send the file operation instruction to a daemon process of the first file system through the kernel;
[0027] The daemon unit is used to determine the authority of the application to the file to be accessed based on the current file access policy, determine the access method of the application to the file to be accessed in response to the authority of the file to be accessed, and respond to the application through the kernel and the interface unit based on the access method.
[0028] In one embodiment, the daemon process unit is further used to:
[0029] When the access mode is access denial, sending an access failure response message to the application through the kernel and the interface unit, or sending a re-authentication response message to the application;
[0030] When the access mode is to allow access, the daemon process of the first file system responds to the file operation instruction and sends the file operation instruction to the second file system through the system interface, so that the second file system calls the corresponding file and performs the corresponding operation on the file to be accessed according to the file operation instruction, and stores the operation result in the corresponding file directory in the second file system; wherein the operation process and the operation result for the file to be accessed are transparently transmitted to the application through the kernel and the access interface of the first file system.
[0031] In one embodiment, the daemon unit further stores a file access policy for a corresponding file in the second file system;
[0032] The daemon unit is further configured to: receive an update request for the file access policy, and update the file access policy in response to the update request.
[0033] In one embodiment, the directory and file attribute information of the files stored in the storage area are set in the second file system and transparently transmitted to the daemon unit through the system interface;
[0034] The daemon unit is also used to display the file directory and file attribute information of at least part of the files through the interface unit based on the file access policy, the access rights of the application, and at least one of the access levels of the files stored in the set storage area.
[0035] In one embodiment, the first file system is installed or mounted in the set storage area of the second file system;
[0036] At least some of the shared files of the application in the second file system are stored in the setting storage area and associated with the file directory in the setting storage area; wherein the attribute information of at least some of the shared files retains the identification information of the creator of the file.
[0037] In one embodiment, the file operation instruction includes at least one of instructions for opening, closing, reading, writing, and viewing attributes of a file.
[0038] According to a third aspect of an embodiment of the present application, an electronic device is provided, comprising a processor, a memory, and an executable program stored in the memory and capable of being run by the processor, wherein the processor executes the steps of the file access method when running the executable program.
[0039] According to a fourth aspect of an embodiment of the present application, a storage medium is provided, on which an executable program is stored, and when the executable program is executed by a processor, the steps of the file access method are implemented.
[0040] In an embodiment of the present application, when the first file system receives an access request for a file, it converts it into a file operation instruction, and does not immediately execute the file operation instruction, but sends the file operation instruction to the daemon of the first file system. The daemon of the first file system instructs the second file system to call the file to be accessed based on the current file access policy, and performs corresponding operations on the file to be accessed based on the file operation instruction, and transparently transmits the operation process and operation results to the application. The embodiment of the present application realizes the refined control of files in the shared area of the second file system by the first file system, provides strategic access to shared files of each application in the shared area, and the file access policy is very flexible and can be set and updated according to the user's file management needs. The file access method of the embodiment of the present application has good portability and strong scalability. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following is a brief introduction to the drawings required for use in the embodiments or the prior art descriptions. Obviously, the drawings described below are some embodiments of the present invention, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0042] Figure 1 This is a schematic diagram of the architecture for data storage in an Android-based mobile device;
[0043] Figure 2 A flowchart of a file access method according to an embodiment of the present application;
[0044] Figure 3 Schematic diagram of the implementation architecture of the file access system of the present application embodiment
[0045] Figure 4 A schematic diagram of a user-mode file system framework according to an embodiment of the present application;
[0046] Figure 5 A schematic diagram of the structure of a file access device according to an embodiment of the present application;
[0047] Figure 6 A structural diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0048] The essence of the technical solution of the embodiment of the present application is explained in detail below in conjunction with the accompanying drawings.
[0049] Figure 2 Schematic diagram of the process of accessing files according to the embodiment of the present application. Figure 2 As shown, the file access method of the embodiment of the present application includes the following processing steps:
[0050] Step 201: An access interface of a first file system receives a file operation instruction from an application for a file, and sends the file operation instruction to a daemon process of the first file system through a kernel.
[0051] In the embodiment of the present application, the application is various application systems installed in the second file system, such as WPS, IM and Email, etc. The file operation instruction includes at least one of the instructions of opening, closing, reading, writing and viewing properties of a file.
[0052] In the embodiment of the present application, the first file system is installed or mounted in the setting storage area of the second file system; at least part of the shared files of the application in the second file system are stored in the setting storage area and associated with the file directory in the setting storage area; wherein the creator identification information of the file is retained in the attribute information of at least part of the shared files. That is to say, the first file system is a system installed in the second file system for performing permission management on the shared files in the second file system, which can be installed / mounted in the second file system, and provides the directory of shared files to the user through the first file system. After the first file system is installed / mounted, the access to the shared file directory is the access to the first file system, not the access to the original file directory of the second file system, and the second file system covers the original file directory of the second file system. Here, the second file system can be an operating system, such as an Android system, a Window system or an Apple operating system. The first file system is specifically set in the second file system, and performs permission management on the shared files of various applications in the second file system, so that the shared file management of various applications is more refined, and the shared files of various applications in the shared storage area in the second file system can be managed accordingly based on the file access policy set by the user.
[0053] When an application initiates a request to access a file, the corresponding file operation instruction is directly sent to the first file system, that is, although the file is visible to each application, the file operation instruction is directly sent to the first file system, and the first file system parses the operation instruction based on the file access policy, determines the application's authority for the file to be accessed, and performs corresponding operations on the file to be accessed based on the authority. If the application does not have the authority to access the file to be accessed, a rejection message is sent to the application or the application is prompted to perform corresponding identity authentication.
[0054] In step 202, the daemon process of the first file system determines the authority of the application to the file to be accessed based on the current file access policy, determines the access method of the application to the file to be accessed in response to the authority of the file to be accessed, and responds to the application through the access interface of the kernel and the first file system based on the access method.
[0055] In the embodiment of the present application, based on the access mode, responding to the application through the access interface of the kernel and the first file system includes:
[0056] When the access mode is access denial, an access failure response message is sent to the application through the access interface of the kernel and the first file system, or a re-authentication response message is sent to the application.
[0057] When an application initiates a request to access a file, a corresponding file operation instruction is directly sent to the first file system. When the first file system determines that the application does not have permission to access the file, a prompt message of access failure or re-authentication is sent to the application. The relevant application can re-authenticate, such as through a password, user biometric features such as fingerprints, palm prints or eye irises, etc. Only after the authentication is passed can the corresponding operation be performed on the file to be accessed.
[0058] When the access mode is to allow access, the daemon process of the first file system responds to the file operation instruction and sends the file operation instruction to the second file system through the system interface, so that the second file system calls the corresponding file and performs the corresponding operation on the file to be accessed according to the file operation instruction, and stores the operation result in the corresponding file directory in the second file system; wherein the operation process and operation result of the file to be accessed are transparently transmitted to the application through the kernel and the access interface of the first file system.
[0059] In the embodiment of the present application, the daemon process of the first file system stores the file access policy for the corresponding file in the second file system; the daemon process of the first file system receives an update request for the file access policy, and updates the file access policy in response to the update request. In other words, the file access policy in the first file system can be changed or set according to user needs, and when the user updates the file access policy accordingly, it is synchronized to the first file system, or the file access policy of the first file system is directly updated and saved.
[0060] In the embodiment of the present application, when the daemon process of the first file system determines that the application has the permission to access the file, the file operation instruction is sent to the second file system through the system interface, so that the second file system opens or closes the corresponding file, or reads the corresponding file, or writes the file in the corresponding file directory, or updates and replaces the file under the directory, or checks the attribute information of the relevant file, etc. In the embodiment of the present application, all operations of the second file system on the file are transparently transmitted to the first file system through the system interface, and the relevant application can learn the relevant operation process of the second file system on the file based on the first file system.
[0061] In an embodiment of the present application, the directory and file attribute information of the files stored in the storage area set in the second file system are transparently transmitted to the daemon of the first file system through the system interface; the daemon of the first file system displays the file directory and file attribute information of at least part of the files through the access interface of the first file system based on the file access policy, the access rights of the application, and at least one of the access levels of the files stored in the set storage area. The first file system can call the attribute information of the relevant file directory and files of the second file system, and display them to the relevant applications through the system interface. When displaying the file directory or attribute information to the application, it is necessary to determine the access rights of the application based on the file access policy, and only display the file directory that matches the application permissions to the relevant application.
[0062] The essence of the technical solution of the embodiment of the present application is further illustrated by specific examples below.
[0063] Figure 3 Schematic diagram of the implementation architecture of the file access system of the present application embodiment. Figure 3As shown, the embodiment of the present application implements a user-state file system, which is installed on the shared area (directory) of the existing operating system to achieve more refined file access control. As an example, the user-state file system can be an existing framework on the Linux platform. The embodiment of the present application is to implement a user-state file system instance for permission management of shared files based on the Linux framework. System applications are applications installed in the second file system, including various applications such as WPS, IM and Email. The installation files of these applications are stored in the application sandbox storage area, and shared files are stored in the shared storage area. The user-state file system is covered on the shared storage area, which is equivalent to the interface or communication tunnel between the system application and the shared storage area. The directory and attribute information of the files stored in the shared storage area are transparently transmitted to the user-state file system. The user-state file system of the embodiment of the present application is also provided with a file access policy, and the corresponding file directory is displayed to the system application based on the access policy. The files displayed by the user-state file system retain the creator identification information of the file.
[0064] The user-mode file system of the present application embodiment has the following features or characteristics:
[0065] The user-mode file system can achieve fine-grained control over files in the shared storage area, and shared file resources can control file access permissions based on access policies.
[0066] The user-mode file system has low resource usage and is only a "thin" file system that is only responsible for access control of file objects. The actual storage work still depends on the lower-level file system, that is, the second file system. The lower-level file system can be the Android system, Window system, or Apple operating system, etc.
[0067] For shared files in a shared storage area, the file creator ID can be retained. Figure 3 As shown, system applications can access related files in the shared storage area based on the user-mode file system. Related files in the shared storage area still retain the identity of the file creator application, such as file 1, file 2 and file 3 in the figure are marked as internal use of the file system.
[0068] Introduce file access policies. The user-mode file system can intercept all file "open" actions, temporarily suspend and block the file opener application, and quickly query the access policy with the visitor identity and the access file object identifier as parameters. After obtaining the corresponding access policy for the file, it will determine whether the "open" action of this file is successful or failed. The access policy is relatively flexible. The access policy is not limited to the database service form. It can introduce user dynamic authorization such as passwords, user biometrics or hardware credentials, and can also use cloud authorization and other methods to manage file permissions.
[0069] Figure 4 This is a schematic diagram of the user mode file system framework of the embodiment of the present application, such as Figure 4 As shown, the user-mode file system framework and its working principle of the embodiment of the present application are as follows:
[0070] The user-state file system is installed / mounted on the original file system directory. After the installation / mounting is completed, the access to the file directory of the original file system is converted to the access to the user-state file system of the embodiment of the present application, rather than the access to the file directory of the original file system. The user-state file system is overwritten on the file directory of the original file system.
[0071] Any access to the user-mode file system will be translated into standard file operation instructions and sent to the kernel, such as opening, closing, reading, writing, viewing file attributes, etc.
[0072] The kernel does not process file operation instructions, but sends them to the user-mode file system daemon, which ultimately responds to the corresponding file operation instructions. For example, when the file operation instruction is a read instruction, the user-mode file system daemon calls the relevant files in the shared storage area through the original file system, prepares the relevant file data, and prepares the file list for directory browsing. In short, any content seen by other applications from the user-mode file system comes from the user-mode file system daemon. The user-mode file system daemon corresponds to the user-mode file system one-to-one. The interface for the user-mode file system daemon to communicate with the kernel can be the / dev / fuse device node.
[0073] The user-mode file system daemon can provide data services for the new user-mode file system with the original contents of the installation directory of the user-mode file system (content before installation). In this way, the content seen by the new user-mode file system is still the relevant file directory content of the original file system, but it has been converted by the user-mode file system daemon. The user-mode file system daemon can selectively control the original files in the original file system, such as hiding, encrypting, and access authorization intervention. Users can modify or update the corresponding file access policy according to the management needs of the files.
[0074] like Figure 4 As shown, the working steps of the user-mode file system daemon process of the embodiment of the present application are as follows:
[0075] The user-mode file system instance is installed using the user-mode file system basic framework. The mount point of the user-mode file system instance is the file directory of the shared storage area to be finely controlled.
[0076] Transmit all file operations of each application on the user-mode file system instance. For example, when an application writes a file in the user-mode file system instance, the user-mode file system daemon writes the content that the application wants to write to the file corresponding to the original directory of the original file system. When an application wants to read a file, the user-mode file system daemon reads the corresponding file content in the original directory of the original file system and sends it to the application.
[0077] The user-mode file system transparently transmits all file operations. Before the "open" file operation instruction, the user-mode file system adds a check on the application's access rights to the file, that is, identity authentication is required. If the check succeeds, the application's file opening action continues normally. If the check fails, the application's file opening action is terminated in the user-mode file system daemon, and the application receives an error message from the user-mode file system daemon that it does not have permission to open the file.
[0078] In the embodiment of the present application, since the user-mode file system daemon performs file permission management based on file access policies, the form of permission verification for file access is relatively flexible. Identity verification can be performed by querying a database, or a user dialog box can be used to prompt the application for identity authentication. Identity recognition can also be performed based on the user's biometrics, or network communication technology can be used to perform identity verification in the cloud, and so on.
[0079] The embodiment of the present application realizes the refined control of files in the shared area on the second file system, provides strategic access to the shared files of each application in the shared area, and the file access policy is very flexible and can be set and updated according to the user's file management needs. The file access method of the embodiment of the present application has good portability and strong scalability.
[0080] Figure 5 Schematic diagram of the structure of the file access device of the embodiment of the present application. Figure 5 As shown, the file access device of the embodiment of the present application includes:
[0081] The interface unit 50 is used to receive a file operation instruction from an application for a file, and send the file operation instruction to the daemon process of the first file system through the kernel;
[0082] The daemon unit 51 is used to determine the authority of the application to the accessed file based on the current file access policy, determine the access method of the application to the accessed file in response to the authority of the accessed file, and respond to the application through the kernel and the interface unit based on the access method.
[0083] In one embodiment, the daemon unit 51 is further configured to:
[0084] When the access mode is access denial, sending an access failure response message to the application through the kernel and the interface unit, or sending a re-authentication response message to the application;
[0085] When the access mode is to allow access, the daemon process of the first file system responds to the file operation instruction and sends the file operation instruction to the second file system through the system interface, so that the second file system calls the corresponding file and performs the corresponding operation on the file to be accessed according to the file operation instruction, and stores the operation result in the corresponding file directory in the second file system; wherein the operation process and the operation result for the file to be accessed are transparently transmitted to the application through the kernel and the access interface of the first file system.
[0086] In one embodiment, the daemon unit 51 also stores a file access policy for a corresponding file in the second file system;
[0087] The daemon unit 51 is further configured to: receive an update request for the file access policy, and update the file access policy in response to the update request.
[0088] In one embodiment, the directory and file attribute information of the files stored in the storage area are set in the second file system and transparently transmitted to the daemon unit through the system interface;
[0089] The daemon unit 51 is also used to display the file directory and file attribute information of at least part of the files through the interface unit based on the file access policy, the access rights of the application, and at least one of the access levels of the files stored in the set storage area.
[0090] In one embodiment, the first file system is installed or mounted in the set storage area of the second file system;
[0091] At least some of the shared files of the application in the second file system are stored in the setting storage area and associated with the file directory in the setting storage area; wherein the attribute information of at least some of the shared files retains the identification information of the creator of the file.
[0092] In one embodiment, the file operation instruction includes at least one of instructions for opening, closing, reading, writing, and viewing attributes of a file.
[0093] In an exemplary embodiment, the interface unit 50, the daemon unit 51, etc. can be implemented by one or more central processing units (CPU), graphics processing units (GPU), baseband processors (BP), application-specific integrated circuits (ASIC), digital signal processors (DSP), programmable logic devices (PLD), complex programmable logic devices (CPLD), field programmable gate arrays (FPGA), general-purpose processors, controllers, microcontrollers (MCU), microprocessors, or other electronic components to execute the steps of the file access method of the aforementioned embodiments.
[0094] In the disclosed embodiment, Figure 5 The specific manner in which each unit in the file access device shown performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0095] Below, reference Figure 6 The electronic device 11 according to an embodiment of the present application is described.
[0096] like Figure 6 As shown, the electronic device 11 includes one or more processors 111 and a memory 112 .
[0097] The processor 111 may be a central processing unit (CPU) or other forms of processing units having data processing capabilities and / or instruction execution capabilities, and may control other components in the electronic device 11 to perform desired functions.
[0098] The memory 112 may include one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may include, for example, a random access memory (RAM) and / or a cache memory (cache), etc. The non-volatile memory may include, for example, a read-only memory (ROM), a hard disk, a flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium, and the processor 111 may run the program instructions to implement the verification method of each embodiment of the present application described above and / or other desired functions. Various contents such as input signals, signal components, noise components, etc. may also be stored in the computer-readable storage medium.
[0099] In one example, the electronic device 11 may further include: an input device 113 and an output device 114 , and these components are interconnected via a bus system and / or other forms of connection mechanisms (not shown).
[0100] The input device 113 may include, for example, a keyboard, a mouse, etc.
[0101] The output device 114 can output various information to the outside, including determined distance information, direction information, etc. The output device 114 can include, for example, a display, a speaker, a printer, a communication network and a remote output device connected thereto, and the like.
[0102] Of course, to simplify, Figure 6 Only some of the components related to the present application in the electronic device 11 are shown, and components such as a bus, an input / output interface, etc. are omitted. In addition, according to specific application situations, the electronic device 11 may also include any other appropriate components.
[0103] The embodiment of the present application also records a storage medium on which an executable program is stored, and the executable program is executed by a processor to execute the steps of the file access method of the aforementioned embodiment.
[0104] In addition to the above-mentioned methods and devices, an embodiment of the present application may also be a computer program product, which includes computer program instructions, which, when executed by a processor, enable the processor to execute the steps of the method according to various embodiments of the present application described in the above-mentioned "Exemplary Method" section of this specification.
[0105] The computer program product may be written in any combination of one or more programming languages to write program codes for performing the operations of the embodiments of the present application, including object-oriented programming languages, such as Java, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as an independent software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0106] In addition, an embodiment of the present application may also be a computer-readable storage medium on which computer program instructions are stored. When the computer program instructions are executed by a processor, the processor executes the steps of the method according to various embodiments of the present application described in the above "Exemplary Method" section of this specification.
[0107] The computer readable storage medium can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can include, for example, but is not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0108] The basic principles of the present application are described above in conjunction with specific embodiments. However, it should be noted that the advantages, strengths, effects, etc. mentioned in the present application are only examples and not limitations, and it cannot be considered that these advantages, strengths, effects, etc. are required by each embodiment of the present application. In addition, the specific details disclosed above are only for the purpose of illustration and ease of understanding, not for limitation, and the above details do not limit the present application to being implemented by adopting the above specific details.
[0109] The block diagrams of the devices, apparatuses, equipment, and systems involved in this application are only illustrative examples and are not intended to require or imply that they must be connected, arranged, and configured in the manner shown in the block diagram. As will be appreciated by those skilled in the art, these devices, apparatuses, equipment, and systems can be connected, arranged, and configured in any manner. Words such as "including", "comprising", "having", etc. are open words, referring to "including but not limited to", and can be used interchangeably with them. The words "or" and "and" used here refer to the words "and / or" and can be used interchangeably with them, unless the context clearly indicates otherwise. The words "such as" used here refer to the phrase "such as but not limited to", and can be used interchangeably with them.
[0110] It should also be noted that in the apparatus, device and method of the present application, each component or each step can be decomposed and / or recombined. Such decomposition and / or recombination should be regarded as equivalent solutions of the present application.
[0111] The above description of the disclosed aspects is provided to enable any person skilled in the art to make or use the present application. Various modifications to these aspects will be readily apparent to those skilled in the art, and the general principles defined herein may be applied to other aspects without departing from the scope of the present application. Therefore, the present application is not intended to be limited to the aspects shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
[0112] The above description has been given for the purpose of illustration and description. In addition, this description is not intended to limit the embodiments of the present application to the forms disclosed herein. Although multiple example aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, changes, additions and sub-combinations thereof.
Claims
1. A file access method, characterized in that: The method comprises: The access interface of the first file system receives a file operation instruction from an application in the second file system for a file in the second file system, and sends the file operation instruction to the daemon process of the first file system through the kernel; the first file system includes a user-mode file system; the second file system includes an operating system; the first file system is set in the second file system; The daemon of the first file system determines the authority of the application for the file to be accessed based on the current file access policy stored in the daemon of the first file system, determines an access method of the application to the file to be accessed in response to the authority of the file to be accessed, and responds to the application through the kernel and the access interface of the first file system based on the access method.
2. The method according to claim 1, characterized in that The responding to the application through the kernel and the access interface of the first file system based on the access mode includes: When the access mode is access denial, sending an access failure response message to the application through the kernel and the access interface of the first file system, or sending a re-authentication response message to the application; When the access mode is to allow access, the daemon process of the first file system responds to the file operation instruction and sends the file operation instruction to the second file system through the system interface, so that the second file system calls the corresponding file and performs the corresponding operation on the file to be accessed according to the file operation instruction, and stores the operation result in the corresponding file directory in the second file system; wherein the operation process and operation result for the file to be accessed are transparently transmitted to the application through the kernel and the access interface of the first file system.
3. The method according to claim 2, characterized in that The method further comprises: The daemon process of the first file system stores a file access policy for a corresponding file in the second file system; The daemon process of the first file system receives an update request for the file access policy, and updates the file access policy in response to the update request.
4. The method according to claim 3, characterized in that The method further comprises: The directory and file attribute information of the files stored in the storage area are set in the second file system, and are transparently transmitted to the daemon process of the first file system through the system interface; The daemon of the first file system displays the file directory and file attribute information of at least part of the files through the access interface of the first file system based on the file access policy, the access rights of the application, and at least one of the access levels of the files stored in the set storage area.
5. The method according to claim 1, characterized in that: The method further comprises: The first file system is installed or mounted in a set storage area of the second file system; At least some of the shared files of the application in the second file system are stored in the setting storage area and associated with the file directory in the setting storage area; wherein the attribute information of at least some of the shared files retains the identification information of the creator of the file.
6. The method according to any one of claims 1 to 5, characterized in that: The file operation instruction includes at least one of instructions for opening, closing, reading, writing and viewing attributes of a file.
7. A file access device, applied to a first file system, characterized in that: The device comprises: an interface unit, configured to receive a file operation instruction from an application in a second file system for a file in the second file system, and send the file operation instruction to a daemon process of the first file system through a kernel; the first file system includes a user-mode file system; the second file system includes an operating system; the first file system is set in the second file system; The daemon unit is used to determine the authority of the application for the file to be accessed based on the current file access policy stored in the daemon of the first file system, determine the access method of the application to the file to be accessed in response to the authority of the file to be accessed, and respond to the application through the kernel and the interface unit based on the access method.
8. The device according to claim 7, characterized in that The daemon unit is further used for: When the access mode is access denial, sending an access failure response message to the application through the kernel and the interface unit, or sending a re-authentication response message to the application; When the access mode is to allow access, the daemon process of the first file system responds to the file operation instruction and sends the file operation instruction to the second file system through the system interface, so that the second file system calls the corresponding file and performs the corresponding operation on the file to be accessed according to the file operation instruction, and stores the operation result in the corresponding file directory in the second file system; wherein the operation process and operation result for the file to be accessed are transparently transmitted to the application through the kernel and the access interface of the first file system.
9. The device according to claim 8, characterized in that The daemon unit also stores a file access policy for the corresponding file in the second file system; The daemon unit is further configured to: receive an update request for the file access policy, and update the file access policy in response to the update request.
10. The device according to claim 9, characterized in that The directory and file attribute information of the files stored in the storage area are set in the second file system and transparently transmitted to the daemon process unit through the system interface; The daemon unit is also used to display the file directory and file attribute information of at least part of the files through the interface unit based on the file access policy, the access rights of the application, and at least one of the access levels of the files stored in the set storage area.
11. The device according to claim 7, characterized in that The first file system is installed or mounted in a set storage area of the second file system; At least some of the shared files of the application in the second file system are stored in the setting storage area and associated with the file directory in the setting storage area; wherein the attribute information of at least some of the shared files retains the identification information of the creator of the file.
12. The device according to any one of claims 7 to 11, characterized in that The file operation instruction includes at least one of instructions for opening, closing, reading, writing and viewing attributes of a file.
13. An electronic device comprising a processor, a memory, and an executable program stored in the memory and capable of being run by the processor, wherein the processor executes the steps of the file access method according to any one of claims 1 to 6 when running the executable program.
14. A storage medium storing an executable program, wherein the executable program, when executed by a processor, implements the steps of the file access method as described in any one of items 1 to 6.
