WO2014026343A1 - 一种用于终端的文件访问方法及终端 - Google Patents

一种用于终端的文件访问方法及终端 Download PDF

Info

Publication number
WO2014026343A1
WO2014026343A1 PCT/CN2012/080194 CN2012080194W WO2014026343A1 WO 2014026343 A1 WO2014026343 A1 WO 2014026343A1 CN 2012080194 W CN2012080194 W CN 2012080194W WO 2014026343 A1 WO2014026343 A1 WO 2014026343A1
Authority
WO
WIPO (PCT)
Prior art keywords
file
path
storage
file path
access
Prior art date
Application number
PCT/CN2012/080194
Other languages
English (en)
French (fr)
Inventor
陈磊
Original Assignee
华为终端有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为终端有限公司 filed Critical 华为终端有限公司
Priority to CN201280038101.7A priority Critical patent/CN103748565A/zh
Priority to PCT/CN2012/080194 priority patent/WO2014026343A1/zh
Priority to EP12878645.6A priority patent/EP2733616A4/en
Priority to US14/142,406 priority patent/US20140115021A1/en
Publication of WO2014026343A1 publication Critical patent/WO2014026343A1/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/1727Details of free space management performed by the file system
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/18File system types
    • G06F16/188Virtual file systems
    • G06F16/192Implementing virtual folder structures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems
    • G06F16/168Details of user interfaces specifically adapted to file systems, e.g. browsing and visualisation, 2d or 3d GUIs

Definitions

  • the present invention relates to the field of terminals, and in particular to a file access method and terminal for a terminal.
  • EMMC embedded Multi Media Card
  • the EMMC chip is commonly used as a built-in storage medium. Due to the large storage capacity of the EMMC chip, the system files of the intelligent terminal often do not need to use such a large space, so generally the system files of the EMMC chip are used.
  • a separate area is divided for file storage. This storage area is often referred to as a built-in SD card.
  • smart terminals In response to this, in order to ensure the scalability of the user's storage space, smart terminals generally support external SD cards.
  • An embodiment of the present invention provides a file access method and a terminal for a terminal, which are used to solve the problem of low storage efficiency of the current storage system.
  • the terminal includes a user space file system, and when at least two storage areas are set in the terminal, the user space file system is configured to manage the at least two storage areas, and the method includes: receiving a pair An access request of the file, where the access request includes a first file path; wherein, the first file path is an access path of the file; when the first file path points to the user space file system, Converting the first file path to a second file path by using a path mapping list of the user space file system; wherein, the second file The piece path is an actual storage path of the file in the at least two storage areas; the file is accessed according to the second file path.
  • the access request includes at least one of a read request and a write request.
  • the method further includes: when the path mapping list does not include the second file path related to the first file path, and When the access request is a write request, assigning a second file path to the file and writing a mapping relationship between the first file path and the allocated second file path to the path mapping list; The available storage space in the storage area pointed to by the allocated second file path is not less than the storage space required for the file to be written in the write request.
  • the allocating the second file path to the file includes: storing, in the write request, a storage space required for the file to be written When the storage space is larger than the storage space of any storage area, the first file path is allocated at least two second file paths in the path mapping list, so that at least two of the at least two second file paths are pointed to The sum of available storage spaces of the storage area is not less than the storage space required for the file to be written in the write request.
  • the terminal includes a user space file system, and when at least two storage areas are set in the terminal, the user space file system is used to manage the at least two storage areas, and the terminal further includes: a request receiving unit, configured to receive an access request for a file, where the access request includes a first file path, where the first file path is an access path of the file, and a path conversion unit is configured to be used by the When a file path is directed to the user space file system, the first file path is converted into a second file path according to the path mapping list of the user space file system; wherein the second file path is the file An actual storage path of the at least two storage areas; a file access unit, configured to access the file according to the second file path.
  • the access request includes at least one of a read request and a write request.
  • the terminal further includes: a path mapping list determining unit, configured to: when the first file path points to When the user space file system is described, it is determined whether the path mapping list includes a second file path related to the first file path; when the determination result is no, the path mapping list determining unit allocates to the second file path
  • the unit sends an execution instruction;
  • the second file path allocation unit is configured to: when the path mapping list determining unit determines that the result is no
  • the access request is a write request, assigning a second file path to the file and writing a mapping relationship between the first file path and the allocated second file path to the path map list;
  • the available storage space in the storage area pointed to by the allocated second file path is not less than the storage space required for the file to be written in the write request.
  • the second file path allocation unit includes: a second file path allocation subunit, configured to: when the write request is to be written When the storage space required for the input file is larger than the available storage space of any storage area, at least two second file paths are allocated to the first file path in the path mapping list, so that the at least two second files are The sum of the available storage spaces of the at least two storage areas pointed to by the path is not less than the storage space required for the file to be written in the write request.
  • the terminal includes a processor and a memory, where the memory includes a user space file system, and when the memory includes at least two storage areas, the at least two storages are managed by the user space file system.
  • the processor is configured to: perform an access request to the file, where the access request includes a first file path; wherein, the first file path is an access path of the file; When the file path is directed to the user space file system, the first file path is converted into a second file path according to the path mapping list of the user space file system; wherein the second file path is the file in the file Depicting an actual storage path in at least two storage areas; accessing the file according to the second file path.
  • the access request includes at least one of a read request and a write request.
  • the processor is executed after the first file path is directed to the user space file system, and Before converting the first file path to the second file path according to the path mapping list of the user space file system, the method further includes: when the path mapping list does not include the first file path a second file path, and when the access request is a write request, assigning a second file path to the file and writing a mapping relationship between the first file path and the allocated second file path Entering the path mapping list; wherein, the available storage space in the storage area pointed by the allocated second file path is not less than the storage space required for the file to be written in the write request.
  • the process of the processor executing the second file path for the file includes: when the file is to be written in the write request When the required storage space is larger than the available storage space of any storage area, the first file path is allocated in the path mapping list. And at least two second file paths, wherein a sum of available storage spaces of at least two storage areas pointed by the at least two second file paths is not less than a storage required for the file to be written in the write request space.
  • the method and the terminal provided in the embodiment of the present invention can be configured to set a path mapping list in the user space file system, and when the file is accessed, the original virtual path of the file, that is, the first file path, is performed according to the path mapping list. Converting, obtaining the actual storage path pointed to by the access request, that is, the second file path. Since the actual storage path is uniformly allocated according to the situation of the built-in SD card and the external SD card, instead of being allocated only according to a certain memory card, the unified SD card and the external SD card in the smart terminal can be realized. Management, effectively improve the utilization efficiency of smart terminal storage space.
  • FIG. 1 is a flowchart of a file access method for a terminal according to Embodiment 1 of the present invention
  • FIG. 2 is a flowchart of a file access method for a terminal according to Embodiment 2 of the present invention
  • FIG. 3 is a schematic structural diagram of a terminal according to Embodiment 3 of the present invention.
  • FIG. 4 is a schematic structural diagram of a terminal according to Embodiment 4 of the present invention.
  • FIG. 5 is a structural diagram of a terminal according to Embodiment 5 of the present invention.
  • FIG. 6 is a structural diagram of a terminal according to Embodiment 6 of the present invention. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS In order to make the objects, technical solutions and advantages of the present invention more comprehensible, the detailed description of the embodiments of the present invention will be further described below.
  • Embodiment 1
  • a first embodiment of the present invention provides a file access method for an intelligent terminal, where the terminal includes a user space file system, and when at least two storage areas are set in the terminal, the user space file system is used to manage the At least two storage areas.
  • 1 is a flowchart of a method according to Embodiment 1 of the present invention. A method according to Embodiment 1 of the present invention will be described in detail below with reference to FIG. 5101. Receive an access request for a file, where the access request includes a first file path, where the first file path is an access path of the file.
  • the access path of the file refers to a virtual path of the file under the management of the user space file system.
  • the first file path When the first file path is directed to the user space file system, the first file path is converted into a second file path according to the path mapping list of the user space file system; wherein, the second file is The path is the actual storage path of the file in the at least two storage areas.
  • the at least two storage areas may include a built-in SD card and an external SD card in the terminal.
  • the original virtual path of the file that is, the first file path
  • the path mapping list is converted according to the path mapping list.
  • a second embodiment of the present invention provides a file access method for an intelligent terminal, where the terminal includes a user space file system, and when at least two storage areas are set in the terminal, the user space file system is used to manage the At least two storage areas.
  • 2 is a flowchart of a method according to Embodiment 2 of the present invention. The method of Embodiment 2 of the present invention will be described in detail below with reference to FIG.
  • the S10K receives an access request for the file, where the access request includes a first file path, where the first file path is an access path of the file.
  • the access request to the file is an access request to a file in the terminal memory, where the access request includes an access path and an access instruction of the file, and the access path of the file is the file in the user.
  • the access path is usually
  • the first file path is included in an access request received by the terminal and belongs to a part of the received input value.
  • the source of the access request may be either an application of the terminal or a third-party program external to the terminal, which is not limited by the embodiment of the present invention.
  • the access request may include a read request and a write request. In an actual application, for example, the access request may occur when the user opens the application by clicking the application icon, and the access request is the application accessing the application file stored in the terminal storage area. request.
  • the access request may also occur in a case where the application needs to access other files in the terminal storage area, and the other files may be files such as pictures, music, videos, or user information.
  • the embodiment of the present invention does not limit the relationship between the access subject and the access object in the access request.
  • the virtual file system ie, VFS, English is Virtual File System
  • the VFS sends the access request to the user space file system. That is, the first file path is directed to the user space file system, which is determined by the virtual file system, and the first file path is virtualized by the user space file system, and needs to pass through the user space.
  • the file system can be accessed only after address translation.
  • the first file path when the first file path is virtual managed by the user space file system, the first file path is a virtual path and does not point to an actual storage area. At this point, the first file path needs to be converted using the path mapping list, and converted into the actual storage path, that is, the second file path.
  • the user space file system, FUSE, and English, Filesystem in Userspace is a file system implemented entirely in user mode.
  • the memory of the Android system is divided into kernel space and user space.
  • FUSE is characterized in that free conversion can be performed between the kernel space and the user space, and the kernel space portion is used to complete the core.
  • the user space portion is used to complete functions related to user space. Therefore, when the present invention is implemented, after receiving the access request, the processor first sends the VFS to the kernel space for positioning.
  • the VFS determines that the first file path in the access request points to the FUSE, the VFS does not Has the right to freely convert in kernel space and user space, so the VFS first sends the access request to the kernel space portion of the FUSE system, and then the kernel space portion of the FUSE system sends the user space portion of the FUSE Then, the first file path is converted into a second file path in the user space by the path mapping list, and is again sent to the VFS located in the kernel space to implement secondary access according to the second file path.
  • the path mapping list is a list of mapping relationships between the first file path and the second file path associated therewith, which is added in the user space file system in the embodiment of the present invention.
  • the path mapping list can be Pre-setting according to the initial value of the storage area of the terminal, and updating when the storage area of the terminal changes, the process of pre-setting and updating is for each of the path mapping list not including the mapping relationship
  • the first file path is configured to allocate a second file path to the file to be accessed corresponding thereto, and the corresponding relationship between the first file path and the allocated second file path is included in the path mapping list.
  • the change of the storage area includes, but is not limited to, an increase of the storage area, a change of the storage content in the storage area, and the change of the storage content in the storage area includes but is not limited to the increase or decrease of the folder and the folder or the modification of the name. Wait.
  • the path mapping list may be stored in the memory of the user space as part of the FUSE system during daily application and maintenance, and performed in a storage area of the terminal. Backing up; and performing a synchronous backup of the path mapping list of the storage area when the path mapping list changes; or periodically backing up the path mapping list.
  • a separate file can be created in the system backup folder of the built-in SD card of the terminal as a backup file of the path mapping list, and synchronous backup is performed when the path mapping list changes.
  • the memory can restore the path mapping list according to the backup file.
  • the path mapping list may also be stored in the storage area of the terminal, and the access is accessed each time it needs to be used.
  • step S105 when the path mapping list does not include a second file path related to the first file path, and the access request is a write request, assigning a second file path to the file, and The mapping relationship between the first file path and the allocated second file path is written into the path mapping list, and step S102 is performed.
  • the second file path is an actual storage path of the file in the at least two storage areas, and the available storage space in the storage area pointed by the allocated second file path is not less than the access request.
  • the storage space required to write to the file is not limited by the embodiment of the present invention.
  • a storage policy may be preset, for example, a storage policy with a built-in SD card priority may be preset, or a storage with a larger remaining space may be preferentially written.
  • the storage policy of the area and the like are not limited in this embodiment of the present invention.
  • the available storage space in the storage area pointed to by the second file path is required to be not less than that required to be written in the write request. Empty Storage Between.
  • the available storage space of any storage area of the terminal is smaller than the storage space required for the file to be written in the write request, the following processing may be performed according to different situations:
  • At least two second file paths may be allocated to the file, so that the at least two second The sum of available storage spaces of at least two storage areas pointed to by the file path is not less than the storage space required for the file to be written in the write request.
  • an application data folder of an application is built on a built-in SD card.
  • the adjustment of the folder may be performed between the storage areas, such as converting the application data directory folder of the application into another storage area with sufficient available storage space (or the built-in SD card)
  • the other folders are transferred to another storage area, and can be flexibly adjusted according to the principle that the same application folder is saved in the same storage area. This ensures that all application data of the application is stored in the same storage area, which ensures the efficiency of the application accessing the application data. On the other hand, it does not need to split the application directory of the application, and can be minimized. Increase the storage efficiency by the size of the path map list.
  • the application data folder of an application is built on the built-in SD card. Assuming that the application is a download program at this time, it requires a lot of space to store the downloaded file, so the application data folder requires a lot of space.
  • the capacity of the built-in SD card of the terminal is 2G at this time
  • the capacity of the external SD card is 2G
  • the application folder requires a capacity of 3G.
  • the storage space required for the file to be written in the write request is larger than the original storage space of any storage area, and at least two second file paths can be allocated to the first file path, and the application file is used.
  • the clips are separated and placed in different storage areas.
  • the first file path is /SDcard/file.
  • the first file path corresponds to two second file paths, for example, /internal_SD/file_a and /external-SD respectively. /file-b.
  • the converting refers to converting the first file path in the access request into a second file path corresponding thereto.
  • the embodiment of the present invention does not limit the content of the path mapping list, as long as the second file path corresponding to the first file path can be obtained according to the content of the path mapping list.
  • the content saved in the path mapping list may be: For each first file path, the second file path expressed in the form of a complete path corresponds to it. For example, when the first file path is /SDcard/ttchat, the corresponding second file path may be queried in the path mapping list.
  • the second file path saved in the path mapping list may also be:
  • the second file path expressed in the form of an abbreviated path corresponds to the first file path.
  • the abbreviated path may only reflect the path of the first file path as a path of the built-in SD card or the path of the external SD card, that is, the abbreviated path may only The name of the actual storage area embodying the second file path.
  • the corresponding second file path may be queried in the path mapping list to be /internal-SD.
  • the abbreviated path needs to be extended to obtain the second file path.
  • the extension replaces the SDcard in the first file path with the internal-SD to obtain a converted second file path of /internal-SD/ttchat. In this way, the storage efficiency and access efficiency of the path mapping list can be effectively improved compared with the manner of saving the full path.
  • the accessing the file refers to executing an access instruction part in the access request in the second file path.
  • the first file path has been converted to the second file path, that is, the virtual path is converted into the actual storage path, and the actual storage area that the access request actually needs to access can be confirmed.
  • the storage area refers to different hardware storage areas, such as a built-in SD card and an external SD card belonging to different storage areas. Since the second file path is the actual path at this time, the access request may be directly executed according to the second file path.
  • Embodiments 3 to 6 are embodiments of the apparatus of the present invention, and methods for performing the first to second implementations of the method of the present invention are provided. For the convenience of description, only parts related to the embodiments of the present invention are shown, and the specific technical details are not disclosed. Please refer to Embodiment 1 and Embodiment 2 of the present invention.
  • Embodiment 3 of the present invention provides a terminal, which is used to perform the method described in Embodiment 1-2 of the present invention.
  • FIG. 3 is a device diagram of Embodiment 3 of the present invention.
  • the terminal of Embodiment 3 of the present invention will be described in detail below with reference to FIG.
  • the terminal provided by the third embodiment of the present invention includes a user space file system. When at least two storage areas are set in the terminal, the user space file system is used to manage the at least two storage areas; The request receiving unit 301, the path converting unit 302, and the file access unit 303.
  • the access request receiving unit 301 is configured to receive an access request for a file, where the access request includes a first file path, where the first file path is an access path of the file.
  • the access path of the file refers to a virtual path of the file under the management of the user space file system.
  • the path conversion unit 302 is configured to convert the first file path to a second file path according to a path mapping list of the user space file system when the first file path points to the user space file system;
  • the second file path is an actual storage path of the file in the at least two storage areas.
  • the file access unit 303 is configured to access the file according to the second file path.
  • the terminal by setting a path mapping list in the user space file system, when the file is accessed, the original virtual path of the file, that is, the first file path is converted according to the path mapping list. Obtaining the actual storage path pointed to by the access request, that is, the second file path. Since the actual storage path is uniformly allocated according to the situation of the built-in SD card and the external SD card, instead of being allocated only according to a certain memory card, the unified SD card and the external SD card in the smart terminal can be realized. Management, effectively improve the utilization efficiency of smart terminal storage space.
  • Embodiment 4 is a path mapping list in the user space file system, when the file is accessed, the original virtual path of the file, that is, the first file path is converted according to the path mapping list. Obtaining the actual storage path pointed to by the access request, that is, the second file path. Since the actual storage path is uniformly allocated according to the situation of the built-in SD card and the external SD card, instead of being allocated only according to a certain memory card, the unified
  • the fourth embodiment of the present invention provides a terminal 400 for performing the method described in Embodiment 1-2 of the present invention.
  • 4 is a device diagram of Embodiment 4 of the present invention.
  • the terminal of Embodiment 4 of the present invention will be described in detail below with reference to FIG.
  • the terminal provided by the fourth embodiment of the present invention includes a user space file system.
  • the user space file system is used to manage the at least two storage areas;
  • the access request receiving unit 301 is configured to receive an access request for a file, where the access request includes a first file path, where the first file path is an access path of the file.
  • the access request to the file is an access request to a file in the terminal memory, where the access request includes an access path and an access instruction of the file, and the access path of the file is the file in the user.
  • the access path is usually
  • the first file path is included in an access request received by the terminal and belongs to a part of the received input value.
  • the source of the access request may be either an application of the terminal or a third-party program external to the terminal, which is not limited by the embodiment of the present invention.
  • the access request may include a read request and a write request.
  • the access request may occur when the user opens the application by clicking the application icon, and the access request is the application accessing the application file stored in the terminal storage area. request.
  • the access request may also occur when the application needs to access other files in the terminal storage area, and the other files may be files such as pictures, music, videos, or user information.
  • the embodiment of the present invention does not limit the relationship between the access subject and the access object in the access request.
  • the path mapping list determining unit 304 is configured to determine, when the first file path points to the user space file system, whether the path mapping list of the user space file system includes a path related to the first file path.
  • the second file path is an actual storage path of the access request.
  • the path map list determining unit 304 sends an execution instruction to path conversion unit 302.
  • the path map list determining unit 304 transmits an execution instruction to the second file path allocating unit 305.
  • the virtual file system ie, VFS, English is Virtual File System
  • the VFS sends the access request to the user space file system.
  • the first file path is directed to the user space file system, which is determined by the virtual file system, that is, the first file path is virtual managed by the user space file system, and needs to be user-passed.
  • the spatial file system can be accessed only after address translation.
  • the first file path is virtual managed by the user space file system
  • the first file path is a virtual path and does not point to an actual storage area.
  • the first file path needs to be converted using the path mapping list, and converted into an actual storage path, that is, a second file path.
  • the user space file system, FUSE, and English, Filesystem in Userspace is a file system implemented entirely in user mode.
  • the memory of the Android system is divided into kernel space and user space.
  • FUSE is characterized in that free conversion can be performed between the kernel space and the user space, and the kernel space portion is used to complete the core.
  • the user space portion is used to complete functions related to user space. Therefore, when the present invention is implemented, after receiving the access request, the processor first sends the VFS to the kernel space for positioning.
  • the VFS determines that the first file path in the access request points to the FUSE, the VFS does not Has the right to freely convert in kernel space and user space, so the VFS first sends the access request to the kernel space portion of the FUSE system, and then the kernel space portion of the FUSE system sends the user space portion of the FUSE Then, the first file path is converted into a second file path by the path mapping list, and is again sent to the VFS located in the kernel space to implement secondary access according to the second file path.
  • the path mapping list is a list of mapping relationships between the first file path and the second file path associated therewith, which is added in the user space file system in the embodiment of the present invention.
  • the path mapping list may be preset according to an initial value of the storage area of the terminal, and updated when the storage area of the terminal changes, and the process of pre-setting and updating is not included in the path mapping list.
  • Each first file path of the mapping relationship is a second file path assigned to the file to be accessed corresponding thereto, and the corresponding relationship between the first file path and the allocated second file path is included in the A list of path maps.
  • the change of the storage area includes, but is not limited to, an increase of the storage area, a change of the storage content in the storage area, and the change of the storage content in the storage area includes but is not limited to the increase or decrease of the folder and the folder or the modification of the name. Wait.
  • the path mapping list may be used as the FUSE system during daily application and maintenance. And storing, in the memory of the user space, a backup in the storage area of the terminal; and performing synchronous backup on the path mapping list of the storage area when the path mapping list changes; or periodically Back up the list of path maps.
  • a separate file can be created in the system backup folder of the built-in SD card of the terminal as a backup file of the path mapping list, and synchronous backup is performed when the path mapping list changes.
  • the memory can restore the path mapping list according to the backup file.
  • the path mapping list may also be stored in the storage area of the terminal, and the access is accessed each time it needs to be used.
  • the second file path allocation unit 305 is configured to: when the path mapping list does not include a second file path related to the first file path, and when the access request is a write request, The file allocates a second file path, and writes a mapping relationship between the first file path and the second file path allocated by the second file path allocation unit to the path map list.
  • the second file path is an actual storage path of the file in the at least two storage areas, and the available storage space in the storage area pointed by the allocated second file path is not less than the access request.
  • the storage space required to write to the file is not limited by the embodiment of the present invention.
  • a storage policy may be preset, for example, a storage policy with a built-in SD card priority may be preset, or a storage with a larger remaining space may be preferentially written.
  • the storage strategy of the space and the like are not limited in this embodiment of the present invention.
  • the available storage space in the storage area pointed to by the second file path is required to be not less than that required to be written in the write request. Storage space.
  • the available storage space of any storage area of the terminal is smaller than the storage space required for the file to be written in the write request, the following processing may be performed according to different situations:
  • At least two second file paths may be allocated to the file, so that the at least two second The sum of available storage spaces of at least two storage areas pointed to by the file path is not less than the storage space required for the file to be written in the write request.
  • an application data folder of an application is built on a built-in SD card.
  • the adjustment of the folder may be performed between the storage areas, such as converting the application data directory folder of the application into another storage area with sufficient available storage space (or the built-in SD card)
  • the other folders are transferred to another storage area, and the same application storage area can be flexibly adjusted in the same storage area as the basic principle. This ensures that all application data of the application is stored in the same storage area, which ensures the efficiency of the application accessing the application data.
  • it does not need to split the application directory of the application, and can be minimized. Increase the storage efficiency by the size of the path map list.
  • the capacity of the built-in SD card of the terminal is 2G at this time, the capacity of the external SD card is 2G, and the application folder requires 3G capacity.
  • the storage space required for the file to be written in the write request is larger than the original storage space of any storage area, and at least two second file paths can be allocated to the first file path, and the application file is used.
  • the clips are separated and placed in different storage areas.
  • the first file path is /SDcard/file.
  • the first file path corresponds to two second file paths, for example, /internal_SD/file_a and /external-SD respectively. /file-b. In this way, an application folder can be saved on two storage media, and the application can still be accessed normally.
  • the second file path allocation unit 304 may include: a second file path allocation sub-unit 304A for storing the storage space required for the file to be written in the write request.
  • the first file path is allocated at least two second file paths in the path mapping list, so that at least two of the at least two second file paths are pointed to The sum of available storage spaces of the storage area is not less than the storage space required for the file to be written in the write request.
  • the path conversion unit 302 is configured to convert the first file path to a second file path according to the path mapping list of the user space file system when the first file path points to the user space file system.
  • the second file path is an actual storage path of the file in the at least two storage areas.
  • the converting refers to converting the first file path in the access request into a second file path corresponding thereto.
  • the embodiment of the present invention does not limit the content of the path mapping list, as long as the second file path corresponding to the first file path can be obtained according to the content of the path mapping list.
  • the content saved in the path mapping list may be: For each first file path, the second file path expressed in the form of a complete path corresponds to it. For example, when the first file path is
  • the second file path saved in the path mapping list may also be:
  • the second file path expressed in the form of an abbreviated path corresponds to the first file path.
  • the abbreviated path may only reflect the path of the first file path as a path of the built-in SD card or the path of the external SD card, that is, the abbreviated path may only The name of the actual storage area embodying the second file path.
  • the corresponding second file path may be queried in the path mapping list to be /internal-SD.
  • the abbreviated path needs to be extended to obtain the second file path.
  • the extension replaces the SDcard in the first file path with the internal-SD to obtain a converted second file path of /internal-SD/ttchat. In this way, the storage efficiency and access efficiency of the path mapping list can be effectively improved compared with the manner of saving the full path.
  • the file access unit 303 is configured to access the file according to the second file path.
  • the accessing the file refers to executing an access instruction part in the access request in the second file path.
  • the first file path has been converted to the second file path, that is, the virtual path is converted into the actual storage path, and the actual storage area that the access request actually needs to access can be confirmed.
  • the storage area refers to different hardware storage areas, such as a built-in SD card and an external SD card belonging to different storage areas. Since the second file path is the actual path at this time, the access request may be directly executed according to the second file path.
  • the terminal by setting a path mapping list in the user space file system, when the file is accessed, the original virtual path of the file, that is, the first file path is converted according to the path mapping list. Obtaining the actual storage path pointed to by the access request, that is, the second file path. Due to reality The internal storage path is uniformly allocated according to the built-in SD card and the external SD card, instead of being allocated only according to a certain memory card, so that unified management of the built-in SD card and the external SD card in the smart terminal can be realized. , effectively improve the utilization efficiency of the intelligent terminal storage space.
  • the fourth embodiment of the present invention is used for the terminal, various situations that may occur when the access is performed through the path mapping list are described, and the technical solutions of the embodiments of the present invention are described in detail. Embodiment 5
  • the fifth embodiment of the present invention provides a terminal, which can be used to perform the method described in Embodiment 1-2 of the present invention.
  • FIG. 5 shows the structure of a terminal 500 according to Embodiment 5 of the present invention.
  • the terminal may be a terminal device including a mobile phone, a tablet computer, a PDA (Personal Digital Assistant), a POS (Point of Sales), an in-vehicle computer, and the terminal is a mobile phone as an example
  • FIG. 5 shows A block diagram of a partial structure of a mobile phone 500 related to a terminal provided by an embodiment of the present invention.
  • the mobile phone 500 includes an RF (Radio Frequency) circuit 510, a memory 520, an input unit 530, a display unit 540, a sensor 550, an audio circuit 560, a WiFi (Wireless Fidelity) module 570, and a processor 580. And power supply 590 and other components.
  • RF Radio Frequency
  • FIG. 5 is only an example of implementation, and does not constitute a limitation on the mobile phone, and may include more or less components than those illustrated, or may be combined with some components, or Different parts are arranged.
  • the components of the mobile phone 500 will be specifically described below with reference to FIG. 5:
  • the RF circuit 510 can be used for receiving and transmitting signals during the transmission or reception of information or during a call. Specifically, after receiving the downlink information of the base station, it is processed by the processor 580. In addition, the uplink data is designed to be sent to the base station.
  • RF circuits include, but are not limited to, an antenna, at least one amplifier, a transceiver, a coupler, an LNA (Low No s e Amp i i i i i i i i i i i
  • the wireless communication may use any communication standard or protocol, including but not limited to GSM (Global System of Mobi le communication), GPRS (General Packet Radio Service), CDMA (Code Division Multiple) Access, Code Division Multiple Access), WCDMA (Wideband Code Division Multiple Access), LTE (Long Term Evolution), e-mail, SMS (Short Messaging Service), and so on.
  • GSM Global System of Mobi le communication
  • GPRS General Packet Radio Service
  • CDMA Code Division Multiple
  • Code Division Multiple Access Code Division Multiple Access
  • WCDMA Wideband Code Division Multiple Access
  • LTE Long Term Evolution
  • e-mail Short Messaging Service
  • the memory 520 can be used to store software programs and modules, and the processor 580 executes various functional applications and data processing of the mobile phone 500 by running software programs and modules stored in the memory 520.
  • the memory 520 can mainly include a storage program area and a storage data area, wherein the storage program area can store an operating system, at least one function required The application (such as a sound playing function, an image playing function, etc.), etc.; the storage data area can store data (such as audio data, phone book, etc.) created according to the use of the mobile phone 500.
  • memory 520 can include high speed random access memory, and can also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
  • Input unit 530 can be used to receive input numeric or character information, as well as to generate key signal inputs related to user settings and function controls of handset 500.
  • the input unit 530 can include a touch panel 531 and other input devices 532.
  • the touch panel 531 also referred to as a touch screen, can collect touch operations on or near the user (such as a user using a finger, a stylus, or the like on the touch panel 531 or near the touch panel 531. Operation), and drive the corresponding connecting device according to a preset program.
  • the touch panel 531 can include two parts: a touch detecting device and a touch controller.
  • the touch detection device detects the touch orientation of the user, and detects a signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts the touch information into contact coordinates, and sends the touch information
  • the processor 580 is provided and can receive commands from the processor 580 and execute them.
  • the touch panel 531 can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic waves.
  • the input unit 530 can also include other input devices 532.
  • other input devices 532 may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control buttons, switch buttons, etc.), trackballs, mice, joysticks, and the like.
  • the display unit 540 can be used to display information input by the user or information provided to the user and various menus of the mobile phone 500.
  • the display unit 540 can include a display panel 541.
  • the display panel 541 can be configured in the form of an LCD (Liquid Crystal Di splay), an OLED (Organic Light-Emitt ing Diode), or the like.
  • the touch panel 531 can cover the display panel 541. When the touch panel 531 detects a touch operation on or near it, the touch panel 531 transmits to the processor 580 to determine the type of the touch event, and then the processor 580 according to the touch event. The type provides a corresponding visual output on display panel 541.
  • the touch panel 531 and the display panel 541 are used as two independent components to implement the input and input functions of the mobile phone 500, in some embodiments, the touch panel 531 may be integrated with the display panel 541. The input and output functions of the mobile phone 500 are implemented.
  • the handset 500 can also include at least one type of sensor 550, such as a light sensor, motion sensor, and other sensors.
  • the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display panel 541 according to the brightness of the ambient light, and the proximity sensor may close the display panel 541 when the mobile phone 500 moves to the ear. / or backlight.
  • the accelerometer sensor can detect the magnitude of acceleration in all directions (usually three axes). When it is stationary, it can detect the magnitude and direction of gravity. It can be used to identify the attitude of the mobile phone.
  • the mobile phone 500 can also be configured with gyroscopes, barometers, hygrometers, thermometers, infrared Other sensors such as sensors will not be described here.
  • An audio circuit 560, a speaker 561, and a microphone 562 provide an audio interface between the user and the handset 500.
  • the audio circuit 560 can transmit the converted electrical data of the received audio data to the speaker 561, and convert it into a sound signal output by the speaker 561.
  • the microphone 562 converts the collected sound signal into an electrical signal, and the audio circuit 560 is used by the audio circuit 560. After receiving, it is converted into audio data, and then processed by the audio data output processor 580, sent to the other mobile phone via the RF circuit 510, or outputted to the memory 520 for further processing.
  • WiFi is a short-range wireless transmission technology.
  • the mobile phone 500 can help users to send and receive e-mail, browse web pages and access streaming media through the WiFi module 570, which provides users with wireless broadband Internet access.
  • FIG. 5 shows the WiFi module 570, it can be understood that it does not belong to the essential configuration of the mobile phone 500, and can be omitted as needed within the scope of not changing the essence of the invention.
  • Processor 580 is the control center of handset 500, which connects various portions of the entire handset using various interfaces and lines, by running or executing software programs and/or modules stored in memory 520, and recalling data stored in memory 520, The various functions and processing data of the mobile phone 500 are performed to perform overall monitoring of the mobile phone.
  • the processor 580 may include one or more processing units.
  • the processor 580 may integrate an application processor and a modem processor, where the application processor mainly processes an operating system, a user interface, an application, and the like.
  • the modem processor primarily handles wireless communications. It will be appreciated that the above described modem processor may also not be integrated into the processor 580.
  • the handset 500 also includes a power source 590 (e.g., a battery) that powers the various components.
  • a power source 590 e.g., a battery
  • the power source can be logically coupled to the processor 580 via a power management system to manage charging, discharging, and power management functions through the power management system.
  • the mobile phone 500 may further include a camera, a Bluetooth module, and the like, and details are not described herein.
  • the memory 520 included in the terminal includes a user space file system, and when the memory includes at least two storage areas, the at least two storage areas are managed by the user space file system.
  • the processor 580 has the following functions:
  • the access request includes a first file path, where the first file path is an access path of the file;
  • the first file path is converted into a second file path according to the path mapping list of the user space file system; wherein, the second file path is An actual storage path of the file in the at least two storage areas;
  • the access path of the file refers to a virtual path of the file under the management of the user space file system; the at least two storage areas may include a built-in SD card and an external SD card in the terminal.
  • the terminal by setting a path mapping list in the user space file system, when the file is accessed, the original virtual path of the file, that is, the first file path is converted according to the path mapping list. Obtaining the actual storage path pointed to by the access request, that is, the second file path. Since the actual storage path is uniformly allocated according to the situation of the built-in SD card and the external SD card, instead of being allocated only according to a certain memory card, the unified SD card and the external SD card in the smart terminal can be realized. Management, effectively improve the utilization efficiency of smart terminal storage space.
  • Embodiment 6 Embodiment 6
  • the sixth embodiment of the present invention provides a terminal, which can be used to perform the method described in Embodiment 1-2 of the present invention.
  • FIG. 6 shows the structure of the terminal 600 according to the fifth embodiment of the present invention.
  • the sixth embodiment of the present invention uses the terminal 500 of the fifth embodiment of the present invention, except that the processor 680 is used instead of the processor 580 of the terminal 500.
  • the memory 520 of the terminal 600 includes a user space file system, and when the memory includes at least two storage areas, the at least two storage areas are managed by the user space file system;
  • the processor 680 includes the following functions:
  • the path mapping list of the user space file system includes a second file path related to the first file path
  • the path mapping list does not include a second file path related to the first file path, and when the access request is a write request, assigning a second file path to the file, and Writing a mapping relationship between a file path and the allocated second file path to the path mapping list;
  • the path mapping list includes a second file path related to the first file path, converting the first file path to a second file path according to the path mapping list; wherein, the second file The path is an actual storage path of the file in the at least two storage areas; Accessing the file according to the second file path.
  • the access request to the file is an access request to a file in the terminal memory, where the access request includes an access path and an access instruction of the file, and the access path of the file is the file in the user.
  • the virtual path under the management of the spatial file system that is, the first file path.
  • the access request includes a read request and a write request.
  • the access request please refer to the second embodiment of the present invention.
  • the path mapping list is a list that stores a mapping relationship between the first file path and a second file path corresponding thereto; the path mapping list is preset according to an initial value of a storage area of the terminal, and is Update when the storage area of the terminal changes.
  • the path mapping list refers to the second embodiment of the present invention.
  • the method for determining whether the first file path is directed to the user space file system, and determining whether the path mapping list includes a second file path related to the first file path, refer to this Inventive embodiment two.
  • the manner in which the second file path is allocated to the file is referred to the second embodiment of the present invention. It should be noted that the available storage space in the storage area pointed to by the allocated second file path should be not less than the storage space required for the file to be written in the write request. When the storage space required for the file to be written in the write request is larger than the available storage space of any storage area, different processing manners may be used for different situations. For details, refer to Embodiment 2 of the present invention. In either case, one method may be adopted: assigning at least two second file paths to the first file path, so that at least two storage areas pointed by the at least two second file paths are available The sum of the storage spaces is not less than the storage space required for the file to be written in the write request.
  • the terminal by setting a path mapping list in the user space file system, when the file is accessed, the original virtual path of the file, that is, the first file path is converted according to the path mapping list. Obtaining the actual storage path pointed to by the access request, that is, the second file path. Since the actual storage path is uniformly allocated according to the situation of the built-in SD card and the external SD card, instead of being allocated only according to a certain memory card, the unified SD card and the external SD card in the smart terminal can be realized. Management, effectively improve the utilization efficiency of smart terminal storage space.
  • the sixth embodiment of the present invention describes various situations that may occur when accessing the path mapping list, and the technical solutions of the embodiments of the present invention are described in detail.
  • the program may be stored in a computer readable storage medium, which may be a read only memory, a flash memory, a magnetic disk, an optical disk, or a hard disk.
  • the method includes the following steps: receiving an access request for a file, where the access request includes a first file path, where the first file path is an access path of the file;
  • the first file path is converted into a second file path according to the path mapping list of the user space file system; wherein the second file path is the file in the Depicting an actual storage path in at least two storage areas; accessing the file according to the second file path.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本发明实施例涉及一种用于终端的文件访问方法及终端,可以实现对智能终端中内置SD卡和外置SD卡的统一管理,有效提高智能终端存储空间的利用效率。所述终端包含用户空间文件系统,当所述终端中设置至少两个存储区域时,所述用户空间文件系统用于管理所述至少两个存储区域,所述方法包括:接收对文件的访问请求,所述访问请求中包含第一文件路径;其中,所述第一文件路径为所述文件的访问路径;当所述第一文件路径指向所述用户空间文件系统时,根据所述用户空间文件系统的路径映射列表将所述第一文件路径转换为第二文件路径;其中,所述第二文件路径是所述文件在所述至少两个存储区域中的实际存储路径;根据所述第二文件路径访问所述文件。

Description

种用于终端的文件访问方法及终端 技术领域 本发明实施例涉终端领域, 特别是一种用于终端的文件访问方法及终端。 背景技术 随着移动通信技术的发展, 移动终端的功能也在不断的复杂化和高效化, 智能终端 越来越普遍的出现在人们的生活中。目前智能终端普遍使用 EMMC( Embedded Multi Media Card) 芯片作为内置存储介质, 由于 EMMC芯片存储容量较大, 智能终端的系统文件往 往不需要使用这么大的空间, 因此一般会在 EMMC芯片的系统文件之外单独划分一个区 域用于文件存储。 业界常将这个存储区域称为内置 SD卡。 与此相呼应, 为了保证用户 存储空间的可扩展性, 智能终端普遍支持外置 SD卡。
因此, 这就意味着在智能手机上同时存在内置 SD卡和外置 SD卡两个存储区域, 这 就面临着主副卡选择的问题。 因为对于绝大多数的第三方应用程序来说, 它只认为 /SDcard目录对应于手机的 SD卡, 并没有内置 SD卡和外置 SD卡的区分, 因此只能有一 个存储区域映射到 /SDcard目录下, 我们将其称为主卡, 通常为内置 SD卡。而另外一张 卡, 即外置 SD 卡作为副卡, 只能映射到第三方应用程序无法识别的目录下, 例如 /SDcard/eXternal。 这种方案存在的问题为: 按照当前的文件访问方法, 第三方应用程 序无法访问所述副卡的目录,所述副卡的扩展空间无法有效应用于第三方应用程序的使 用, 存在存储空间的浪费、 利用效率低的情况。 发明内容
本发明的实施例提供一种用于终端的文件访问方法及终端,用于解决当前存储系统 存储效率低的问题。
第一方面, 所述终端包含用户空间文件系统, 当所述终端中设置至少两个存储区域 时, 所述用户空间文件系统用于管理所述至少两个存储区域, 所述方法包括: 接收对文 件的访问请求, 所述访问请求中包含第一文件路径; 其中, 所述第一文件路径为所述文 件的访问路径; 当所述第一文件路径指向所述用户空间文件系统时, 根据所述用户空间 文件系统的路径映射列表将所述第一文件路径转换为第二文件路径; 其中, 所述第二文 件路径是所述文件在所述至少两个存储区域中的实际存储路径; 根据所述第二文件路径 访问所述文件。
在第一方面的第一种可能的实现方式中,所述访问请求包含读取请求和写入请求中 至少一种。
结合第一方面或第一方面的第一种可能实现方式, 在第二种可能的实现方式中, 所 述方法在当所述第一文件路径指向所述用户空间文件系统之后, 且所述根据用户空间文 件系统的路径映射列表将所述第一文件路径转换为第二文件路径之前, 还包括: 当所述 路径映射列表中不包含与所述第一文件路径相关的第二文件路径, 且当所述访问请求为 写入请求时, 为所述文件分配第二文件路径并将所述第一文件路径与所述分配的第二文 件路径之间的映射关系写入所述路径映射列表; 其中, 所述分配的第二文件路径指向的 存储区域中的可用存储空间不小于所述写入请求中待写入文件所需的存储空间。
结合第二种可能的实现方式, 在第三种可能的实现方式中, 所述为所述文件分配第 二文件路径包括: 当所述写入请求中所述待写入文件所需的存储空间大于任一存储区域 的可用存储空间时,在所述路径映射列表中为所述第一文件路径分配至少两个第二文件 路径,使所述至少两个第二文件路径所指向的至少两个存储区域的可用存储空间之和不 小于所述写入请求中所述待写入文件所需的存储空间。
第二方面, 所述终端包括用户空间文件系统, 当所述终端中设置至少两个存储区域 时, 所述用户空间文件系统用于管理所述至少两个存储区域, 所述终端还包括: 访问请 求接收单元, 用于接收对文件的访问请求, 所述访问请求中包含第一文件路径; 其中, 所述第一文件路径为所述文件的访问路径; 路径转换单元, 用于当所述第一文件路径指 向所述用户空间文件系统时,根据所述用户空间文件系统的路径映射列表将所述第一文 件路径转换为第二文件路径; 其中, 所述第二文件路径是所述文件在所述至少两个存储 区域的实际存储路径; 文件访问单元, 用于根据所述第二文件路径访问所述文件。
在第二方面的第一种可能的实现方式中,所述访问请求包含读取请求和写入请求中 至少一种。
结合第二方面或第二方面的第一种可能的实现方式, 在第二种可能的实现方式中, 所述终端还包括: 路径映射列表判断单元, 用于当所述第一文件路径指向所述用户空间 文件系统时,判断所述路径映射列表中是否包含与所述第一文件路径相关的第二文件路 径; 当判断结果为否时, 所述路径映射列表判断单元向第二文件路径分配单元发送执行 指令; 所述第二文件路径分配单元, 用于当所述路径映射列表判断单元判断结果为否且 当所述访问请求为写入请求, 为所述文件分配第二文件路径并将所述第一文件路径与所 述分配的第二文件路径之间的映射关系写入所述路径映射列表; 其中, 所述分配的第二 文件路径指向的存储区域中的可用存储空间不小于所述写入请求中待写入文件所需的 存储空间。
结合第二种可能的实现方式, 在第三种可能的实现方式中, 所述第二文件路径分配 单元包括: 第二文件路径分配子单元, 用于当所述写入请求中所述待写入文件所需的存 储空间大于任一存储区域的可用存储空间时,在所述路径映射列表中为所述第一文件路 径分配至少两个第二文件路径,使所述至少两个第二文件路径所指向的至少两个存储区 域的可用存储空间之和不小于所述写入请求中所述待写入文件所需的存储空间。
第三方面, 所述终端包括处理器和存储器, 所述存储器中包含用户空间文件系统, 当所述存储器中包含至少两个存储区域时, 由所述用户空间文件系统管理所述至少两个 存储区域; 所述处理器用于执行以下过程: 接收对文件的访问请求, 所述访问请求中包 含第一文件路径; 其中, 所述第一文件路径为所述文件的访问路径; 当所述第一文件路 径指向所述用户空间文件系统时,根据所述用户空间文件系统的路径映射列表将所述第 一文件路径转换为第二文件路径; 其中, 所述第二文件路径是所述文件在所述至少两个 存储区域中的实际存储路径; 根据所述第二文件路径访问所述文件。
在第三方面的第一种可能的实现方式中,所述访问请求包含读取请求和写入请求中 至少一种。
结合第三方面或第三方面的第一种可能的实现方式, 在第二种可能的实现方式中, 所述处理器在执行当所述第一文件路径指向所述用户空间文件系统之后, 且根据所述用 户空间文件系统的路径映射列表将所述第一文件路径转换为第二文件路径之前,还用于 执行以下过程: 当所述路径映射列表中不包含与所述第一文件路径相关的第二文件路 径, 且当所述访问请求为写入请求时, 为所述文件分配第二文件路径并将所述第一文件 路径与所述分配的第二文件路径之间的映射关系写入所述路径映射列表; 其中, 所述分 配的第二文件路径指向的存储区域中的可用存储空间不小于所述写入请求中待写入文 件所需的存储空间。
结合第二种可能的实现方式, 在第三种可能的实现方式中, 所述处理器执行为所述 文件分配第二文件路径的过程包括: 当所述写入请求中所述待写入文件所需的存储空间 大于任一存储区域的可用存储空间时,在所述路径映射列表中为所述第一文件路径分配 至少两个第二文件路径,使所述至少两个第二文件路径所指向的至少两个存储区域的可 用存储空间之和不小于所述写入请求中所述待写入文件所需的存储空间。
通过本发明实施例中提供的方法及终端,通过在用户空间文件系统中设置路径映射 列表, 可以实现在文件访问时, 根据所述路径映射列表对文件原始的虚拟路径, 即第一 文件路径进行转换, 获得所述访问请求所指向的实际存储路径, 即第二文件路径。 由于 实际存储路径是根据内置 SD卡和外置 SD卡的情况统一分配的, 而不是只根据某一个存储 卡进行分配, 这样, 就可以实现对智能终端中内置 SD卡和外置 SD卡的统一管理, 有效提 高智能终端存储空间的利用效率。 附图说明 为了更清楚地说明本发明实施例的技术方案, 下面将对实施例描述中所需要使用的 附图作简单地介绍, 显而易见地, 下面描述中的附图仅仅是本发明的一些实施例, 对于 本领域普通技术人员来讲, 在不付出创造性劳动的前提下, 还可以根据这些附图获得其 他的附图。
图 1 本发明实施例一提供的一种用于终端的文件访问方法的流程图;
图 2 本发明实施例二提供的一种用于终端的文件访问方法的流程图;
图 3 本发明实施例三提供的一种终端的结构示意图;
图 4 本发明实施例四提供的一种终端的结构示意图;
图 5 本发明实施例五提供的一种终端的结构图;
图 6 本发明实施例六提供的一种终端的结构图。 具体实施方式 为使本发明的目的、 技术方案和优点更加清楚, 下面结合附图对本发明具体实施例 做进一步的详细描述。 实施例一
本发明实施例一提供一种用于智能终端的文件访问方法,所述终端包含用户空间文 件系统, 当所述终端中设置至少两个存储区域时, 所述用户空间文件系统用于管理所述 至少两个存储区域。 图 1为本发明实施例一的方法流程图, 下面将结合图 1对本发明实施 例一的方法进行详细说明。 5101、 接收对文件的访问请求, 所述访问请求中包含第一文件路径; 其中, 所述第 一文件路径为所述文件的访问路径。 其中, 所述文件的访问路径是指所述文件在所述用 户空间文件系统管理下的虚拟路径。
5102、 当所述第一文件路径指向所述用户空间文件系统时, 根据所述用户空间文件 系统的路径映射列表将所述第一文件路径转换为第二文件路径; 其中, 所述第二文件路 径是所述文件在所述至少两个存储区域中的实际存储路径。 例如, 所述至少两个存储区 域可以包括终端中的内置 SD卡和外置 SD卡。
5103、 根据所述第二文件路径访问所述文件。
通过本发明实施例一中提供的方法, 通过在用户空间文件系统中设置路径映射列 表, 可以实现在文件访问时, 根据所述路径映射列表对文件原始的虚拟路径, 即第一文 件路径进行转换, 获得所述访问请求所指向的实际存储路径, 即第二文件路径。 由于实 际存储路径是根据内置 SD卡和外置 SD卡的情况统一分配的, 而不是只根据某一个存储卡 进行分配, 这样, 就可以实现对智能终端中内置 SD卡和外置 SD卡的统一管理, 有效提高 智能终端存储空间的利用效率。 实施例二
本发明实施例二提供一种用于智能终端的文件访问方法,所述终端包含用户空间文 件系统, 当所述终端中设置至少两个存储区域时, 所述用户空间文件系统用于管理所述 至少两个存储区域。 图 2为本发明实施例二的方法流程图, 下面将结合图二对本发明实 施例二的方法进行详细说明。
S10K 接收对文件的访问请求, 所述访问请求中包含第一文件路径; 其中, 所述第 一文件路径为所述文件的访问路径。
其中, 所述对文件的访问请求是指向终端存储器中的文件的访问请求, 所述访问请 求中包含所述文件的访问路径和访问指令,所述文件的访问路径即所述文件在所述用户 空间文件系统管理下的虚拟路径, 也即第一文件路径。 例如, 所述访问路径通常以
/SDcard作为根菜单, 例如可以为 /SDcard/ttchat。 所述第一文件路径是终端接收的访 问请求中包含的, 属于接收的输入值的一部分。 所述访问请求的来源既可以为终端的应 用程序,也可以为终端外部的第三方程序,本发明实施例对此并不进行限定。进一步的, 所述访问请求可以包括读取请求和写入请求。 在实际应用中, 例如, 所述访问请求可以发生在用户通过点击应用程序图标打开应 用程序时,此时所述访问请求为所述应用程序访问终端存储区域中存储的所述应用程序 自身文件的请求。所述访问请求也可以发生在应用程序需要访问终端存储区域中其他文 件的情形, 所述其他文件可以是图片、 音乐、 视频或用户信息等文件。 本发明实施例并 不对所述访问请求中访问主体和访问对象之间的关系进行限定。
S104、 当所述第一文件路径指向所述用户空间文件系统时, 判断所述用户空间文件 系统的路径映射列表中是否包含与所述第一文件路径相关的第二文件路径。 如包含, 执 行步骤 102; 如不包含, 执行步骤 105。
具体的, 判断所述第一文件路径是否为指向所述用户空间文件系统的方式, 以 Android系统为例, 在接收到所述访问请求后, 由虚拟文件系统(即 VFS, 英文为 Virtual File System) 对所述第一文件路径是否为指向所述用户空间文件系统进行判断。 当所 述第一文件路径指向所述用户空间文件系统时, 所述 VFS将所述访问请求发送给所述用 户空间文件系统。 即是说, 所述第一文件路径指向所述用户空间文件系统是指经过所述 虚拟文件系统判断, 所述第一文件路径是由所述用户空间文件系统进行虚拟管理的, 需 要经由用户空间文件系统进行地址转换后才能进行访问。 实际上, 当所述第一文件路径 是由所述用户空间文件系统进行虚拟管理时, 所述第一文件路径为一个虚拟路径, 并不 指向实际的存储区域。 此时就需要使用路径映射列表对所述第一文件路径进行转换, 将 其转换为实际存储路径, 即第二文件路径。
所述用户空间文件系统即 FUSE, 英文为 Filesystem in Userspace, 是一种完全在 用户态实现的文件系统。 继续以 Android系统为例, Android系统的内存分为内核空间和 用户空间, FUSE的特点在于可以在所述内核空间和所述用户空间之间进行自由转换, 所 述内核空间部分用于完成跟内核相关的功能,所述用户空间部分用于完成跟用户空间相 关的功能。 因此, 本发明在实现时, 处理器接收到访问请求后, 首先发送给内核空间的 所述 VFS进行定位,当 VFS判定所述访问请求中的第一文件路径指向所述 FUSE时,由于 VFS 不具有在内核空间和用户空间自由转换的权限, 因此 VFS首先将所述访问请求发送给所 述 FUSE系统的内核空间部分, 再由所述 FUSE系统的内核空间部分发送给所述 FUSE的用户 空间部分, 之后由路径映射列表在用户空间将所述第一文件路径转换为第二文件路径, 并再次发送给位于内核空间的 VFS, 实现根据第二文件路径的二次访问。
所述路径映射列表为存储第一文件路径及与其相关的第二文件路径之间映射关系 的列表, 是本发明实施例在所述用户空间文件系统中增加的内容。 所述路径映射列表可 以根据终端的存储区域的初始值进行预先设置, 并在所述终端的存储区域发生变化的时 候进行更新,所述预先设置及更新的过程即针对在路径映射列表中不包含映射关系的每 个第一文件路径, 均为与其对应的待访问文件分配第二文件路径, 并将所述第一文件路 径和所述分配的第二文件路径之间的对应关系计入所述路径映射列表。 当然, 上述描述 仅为描述本发明实施例的可实现性, 并不对本发明实施例构成限制。 其中, 所述存储区 域的变化包括但不限于存储区域的增加、 存储区域中存储内容的变化, 所述存储区域中 存储内容的变化包括但不限于文件夹及文件夹的增减或名称的修改等。 优选的, 为保证 日常使用的查询速率, 所述路径映射列表在日常应用及维护时, 可以作为所述 FUSE系统 的一部分存放在所述用户空间的内存中, 并在所述终端的存储区域进行备份; 并在所述 路径映射列表发生变化时, 对所述存储区域的路径映射列表进行同步备份; 或周期性的 对所述路径映射列表进行备份。 例如, 可以在终端的内置 SD卡的系统备份文件夹中创建 一个独立的文件作为所述路径映射列表的备份文件, 并在路径映射列表发生变化时进行 同步备份。 这样, 在终端断电重启后, 内存可以根据所述备份文件恢复路径映射列表。 当然可选的, 所述路径映射列表也可以存放在所述终端的存储区域中, 在每次需要使用 的时候进行调取访问。
S 105 : 当所述路径映射列表中不包含与所述第一文件路径相关的第二文件路径, 且 所述访问请求为写入请求时, 为所述文件分配第二文件路径, 并将所述第一文件路径与 所述分配的第二文件路径之间的映射关系写入所述路径映射列表, 并执行步骤 S 102。 其 中, 所述第二文件路径是所述文件在所述至少两个存储区域中的实际存储路径, 所述分 配的第二文件路径指向的存储区域中的可用存储空间不小于所述访问请求中待写入文 件所需的存储空间。 可选的, 当所述访问请求为读取请求时, 返回路径无效信息, 以提 示终端并进一步提示用户所述路径无效, 本发明实施例对此并不进行限定。
可选的, 在为所述文件分配所述第二文件路径时, 可以预先设定存储策略, 如可以 预先设定采用内置 SD卡优先的存储策略, 或者采取优先写入剩余空间较大的存储区域的 存储策略等,本发明实施例对此并不进行限定。在为所述文件分配第二文件路径完成后, 将所述第一文件路径与所述分配的第二文件路径之间的映射关系写入所述路径映射列 表, 具体的写入格式由所述路径映射列表的当前格式决定, 详见步骤 S 102中关于路径映 射列表的内容的论述。
另外, 需要注意的是, 在为所述文件分配第二文件路径时, 需要所述第二文件路径 所指向的存储区域中的可用存储空间不小于所述写入请求中待写入文件所需的存储空 间。当所述终端的任一存储区域的可用存储空间均小于所述写入请求中待写入文件所需 的存储空间时, 可以根据不同情况进行如下处理:
当所述存储区域的原始存储空间不小于所述写入请求中待写入文件所需的存储空 间时, 可以对所述文件分配至少两个第二文件路径, 使所述至少两个第二文件路径所指 向的至少两个存储区域的可用存储空间之和不小于所述写入请求中待写入文件所需的 存储空间。 当然优选的, 也可以在所述存储区域之间进行文件存放位置的调整, 以保证 至少有一个存储区域的可用存储空间不小于所述写入请求中待写入文件所需的存储空 间。 例如, 某应用程序的应用数据文件夹建立在内置 SD卡上, 随着应用数据越来越多, 所述内置 SD卡的剩余空间会越来越少, 会出现可用存储空间不足的问题。 此时, 可以在 存储区域之间进行文件夹的调整, 如将所述应用程序的应用数据目录文件夹整体转换到 另一个可用存储空间较充足的存储区域中(或者将所述内置 SD卡中的其他文件夹转移到 另一存储区域中,此时可以以同一个应用程序的文件夹保存在同一个存储区域为原则进 行灵活调整) 。 这样做可以保证应用程序的所有应用数据都保存在同一个存储区域中, 一方面可以保证应用程序访问应用数据的效率, 另一方面不需要对应用程序的应用目录 进行分拆, 可以尽量减小路径映射列表的大小, 提高存储效率。
当所述存储区域的原始存储空间小于所述写入请求中待写入文件所需的存储空间 时, 此时, 即使调整文件存放位置也无法满足至少有一个存储区域的可用存储空间不小 于所述写入请求中待写入文件所需的存储空间。 因此, 此时需对所述第一文件路径分配 至少两个第二文件路径,使所述至少两个第二文件路径所指向的至少两个存储区域的可 用存储空间之和不小于所述写入请求中待写入文件所需的存储空间。 例如, 某应用程序 的应用数据文件夹建立在内置 SD卡上, 假设此时的应用程序为下载程序, 需要很多空间 来存放下载的文件, 因此其应用数据文件夹需要很大的空间。 假设此时终端的内置 SD卡 的容量为 2G, 外置 SD卡的容量为 2G, 而所述应用程序文件夹需要 3G的容量。 此时所述写 入请求中待写入文件所需的存储空间大于任一存储区域的原始存储空间, 只能为所述第 一文件路径分配至少两个第二文件路径,将其应用程序文件夹分拆后放入不同的存储区 域。 例如该第一文件路径为 /SDcard/file, 在路径映射列表中, 所述第一文件路径会对 应两个第二文件路径, 例如可以分别为 /internal— SD/file— a和 /external— SD/file—b。 这样, 一个应用程序文件夹就可以分别保存在两个存储介质上, 而应用程序还是能正常 访问。 S102、根据所述用户空间文件系统的路径映射列表将所述第一文件路径转换为第二 文件路径。 其中, 所述第二文件路径是所述文件在所述至少两个存储区域中的实际存储 路径。
所述转换是指将所述访问请求中的第一文件路径转换为与其相应的第二文件路径。 本发明实施例并不对所述路径映射列表的内容进行限制, 只要能够根据所述路径映射列 表的内容获取与所述第一文件路径对应的第二文件路径即可。
例如, 所述路径映射列表中保存的内容可以为: 对于每个第一文件路径, 均包含以 完整路径的形式表达的第二文件路径与其相对应。 例如, 当所述第一文件路径为 /SDcard/ttchat时, 可以在路径映射列表中查询其对应的第二文件路径为
/internal_SD/ttchat , 此时可以直接使用路径映射列表中保存的第二文件路径作为转 换后的第二文件路径。 所述路径映射列表中保存的内容也可以为: 对于每个第一文件路 径, 均包含以縮写路径的形式表达的第二文件路径与其相对应。 例如, 对于终端包含内 置 SD卡和外置 SD卡的情形,所述縮写路径可以仅体现所述第一文件路径为内置 SD卡的路 径或外置 SD卡的路径, 即所述縮写路径可以仅体现所述第二文件路径的实际存储区域的 名称。 例如, 当所述第一文件路径为 /SDcard/ttchat时, 可以在路径映射列表中查询其 对应的第二文件路径为 /internal— SD,此时需将縮写路径进行扩展才能得到第二文件路 径, 所述扩展即用所述 internal— SD替代所述第一文件路径中的 SDcard, 以得到转换后 的第二文件路径为 /internal— SD/ttchat。 利用这种方式与保存完整路径的方式相比, 可以有效的提高所述路径映射列表的存储效率和访问效率。
S103、 根据所述第二文件路径访问所述文件。
进一步可选的,所述访问所述文件是指在所述第二文件路径中执行所述访问请求中 的访问指令部分。
根据前面几个步骤, 此时已经将第一文件路径转换为第二文件路径, 即将虚拟路径 转换为了实际存储路径, 此时能够确认所述访问请求所实际需要访问的实际存储区域。 所述存储区域是指不同的硬件存储区域, 例如内置 SD卡和外置 SD卡属于不同的存储区 域。 由于此时第二文件路径为实际路径, 直接根据所述第二文件路径执行所述访问请求 即可。
另外, 在实际应用中, 可能会出现不同存储区域之间包含重名文件夹的情况。 此时 可以直接对重名文件夹进行名称的修改, 并在路径映射列表中修改相应的第二文件路径 即可。 通过本发明实施例二中提供的方法, 通过在用户空间文件系统中设置路径映射列 表, 可以实现在文件访问时, 根据所述路径映射列表对文件原始的虚拟路径, 即第一文 件路径进行转换, 获得所述访问请求所指向的实际存储路径, 即第二文件路径。 由于实 际存储路径是根据内置 SD卡和外置 SD卡的情况统一分配的, 而不是只根据某一个存储卡 进行分配, 这样, 就可以实现对智能终端中内置 SD卡和外置 SD卡的统一管理, 有效提高 智能终端存储空间的利用效率。本发明实施例二并对在通过所述路径映射列表进行访问 时可能发生的各种情况进行了说明, 对本发明实施例的技术方案进行了详尽的描述。 实施例三至六为本发明装置实施例,提供了用于执行本发明方法实施例一至二实现 的方法,为了便于说明,仅示出了与本发明实施例相关的部分,具体技术细节未揭示的, 请参照本发明实施例一与实施例二。
实施例三
本发明实施例三提供一种终端, 用于执行本发明实施例 1-2中所述的方法。 图三为 本发明实施例三的装置图, 下面将结合图三对本发明实施例三的终端进行详细说明。 本 发明实施例三提供的终端包括用户空间文件系统, 当所述终端中设置至少两个存储区域 时, 所述用户空间文件系统用于管理所述至少两个存储区域; 所述终端还包括访问请求 接收单元 301、 路径转换单元 302和文件访问单元 303。
其中, 所述访问请求接收单元 301用于接收对文件的访问请求, 所述访问请求中包 含第一文件路径; 其中, 所述第一文件路径为所述文件的访问路径。 其中, 所述文件的 访问路径是指所述文件在所述用户空间文件系统管理下的虚拟路径。
所述路径转换单元 302用于当所述第一文件路径指向所述用户空间文件系统时, 根 据所述用户空间文件系统的路径映射列表将所述第一文件路径转换为第二文件路径; 其 中, 所述第二文件路径是所述文件在所述至少两个存储区域的实际存储路径。
所述文件访问单元 303用于根据所述第二文件路径访问所述文件。
通过本发明实施例三中提供的终端, 通过在用户空间文件系统中设置路径映射列 表, 可以实现在文件访问时, 根据所述路径映射列表对文件原始的虚拟路径, 即第一文 件路径进行转换, 获得所述访问请求所指向的实际存储路径, 即第二文件路径。 由于实 际存储路径是根据内置 SD卡和外置 SD卡的情况统一分配的, 而不是只根据某一个存储卡 进行分配, 这样, 就可以实现对智能终端中内置 SD卡和外置 SD卡的统一管理, 有效提高 智能终端存储空间的利用效率。 实施例四
本发明实施例四提供一种终端 400, 用于执行本发明实施例 1-2中所述的方法。 图四 为本发明实施例四的装置图, 下面将结合图四对本发明实施例四的终端进行详细说明。
本发明实施例四提供的终端包括用户空间文件系统, 当所述终端中设置至少两个存 储区域时, 所述用户空间文件系统用于管理所述至少两个存储区域; 所述终端还包括访 问请求接收单元 301、 路径映射列表判断单元 304、 第二文件路径分配单元 305、 路径转 换单元 302和文件访问单元 303。
其中, 所述访问请求接收单元 301用于接收对文件的访问请求, 所述访问请求中包 含第一文件路径; 其中, 所述第一文件路径为所述文件的访问路径。
其中, 所述对文件的访问请求是指向终端存储器中的文件的访问请求, 所述访问请 求中包含所述文件的访问路径和访问指令,所述文件的访问路径即所述文件在所述用户 空间文件系统管理下的虚拟路径, 也即第一文件路径。 例如, 所述访问路径通常以
/SDcard作为根菜单, 例如可以为 /SDcard/ttchat。 所述第一文件路径是终端接收的访 问请求中包含的, 属于接收的输入值的一部分。 所述访问请求的来源既可以为终端的应 用程序,也可以为终端外部的第三方程序,本发明实施例对此并不进行限定。进一步的, 所述访问请求可以包括读取请求和写入请求。
在实际应用中, 例如, 所述访问请求可以发生在用户通过点击应用程序图标打开应 用程序时,此时所述访问请求为所述应用程序访问终端存储区域中存储的所述应用程序 自身文件的请求。所述访问请求也可以发生在应用程序需要访问终端存储区域中其他文 件的情形, 所述其他文件可以是图片、 音乐、 视频或用户信息等文件。 本发明实施例并 不对所述访问请求中访问主体和访问对象之间的关系进行限定。
所述路径映射列表判断单元 304, 用于当所述第一文件路径指向所述用户空间文件 系统时,判断所述用户空间文件系统的路径映射列表中是否包含与所述第一文件路径相 关的第二文件路径。 其中, 所述第二文件路径是所述访问请求的实际存储路径。 当所述 判断结果为所述路径映射列表中包含所述第二文件路径时,所述路径映射列表判断单元
304向路径转换单元 302发送执行指令。当所述判断结果为所述路径映射列表中不包含所 述第二文件路径时,所述路径映射列表判断单元 304向第二文件路径分配单元 305发送执 行指令。 具体的, 判断所述第一文件路径是否为指向所述用户空间文件系统的方式, 以 Android系统为例, 在接收到所述访问请求后, 由虚拟文件系统(即 VFS, 英文为 Virtual File System) 对所述第一文件路径是否为指向所述用户空间文件系统进行判断。 当所 述第一文件路径指向所述用户空间文件系统时, 所述 VFS将所述访问请求发送给所述用 户空间文件系统。 即是说, 所述第一文件路径指向所述用户空间文件系统是指经过所述 虚拟文件系统判断, 即所述第一文件路径是由所述用户空间文件系统进行虚拟管理的, 需要经由用户空间文件系统进行地址转换后才能进行访问。 实际上, 当所述第一文件路 径是由所述用户空间文件系统进行虚拟管理时, 所述第一文件路径为一个虚拟路径, 并 不指向实际的存储区域。 此时就需要使用路径映射列表对所述第一文件路径进行转换, 将其转换为实际存储路径, 即第二文件路径。
所述用户空间文件系统即 FUSE, 英文为 Filesystem in Userspace, 是一种完全在 用户态实现的文件系统。 继续以 Android系统为例, Android系统的内存分为内核空间和 用户空间, FUSE的特点在于可以在所述内核空间和所述用户空间之间进行自由转换, 所 述内核空间部分用于完成跟内核相关的功能,所述用户空间部分用于完成跟用户空间相 关的功能。 因此, 本发明在实现时, 处理器接收到访问请求后, 首先发送给内核空间的 所述 VFS进行定位,当 VFS判定所述访问请求中的第一文件路径指向所述 FUSE时,由于 VFS 不具有在内核空间和用户空间自由转换的权限, 因此 VFS首先将所述访问请求发送给所 述 FUSE系统的内核空间部分, 再由所述 FUSE系统的内核空间部分发送给所述 FUSE的用户 空间部分, 之后由路径映射列表将所述第一文件路径转换为第二文件路径, 并再次发送 给位于内核空间的 VFS, 实现根据第二文件路径的二次访问。
所述路径映射列表为存储第一文件路径及与其相关的第二文件路径之间映射关系 的列表, 是本发明实施例在所述用户空间文件系统中增加的内容。 所述路径映射列表可 以根据终端的存储区域的初始值进行预先设置, 并在所述终端的存储区域发生变化的时 候进行更新,所述预先设置及更新的过程即针对在路径映射列表中不包含映射关系的每 个第一文件路径, 均为与其对应的待访问文件分配第二文件路径, 并将所述第一文件路 径和所述分配的第二文件路径之间的对应关系计入所述路径映射列表。 当然, 上述描述 仅为描述本发明实施例的可实现性, 并不对本发明实施例构成限制。 其中, 所述存储区 域的变化包括但不限于存储区域的增加、 存储区域中存储内容的变化, 所述存储区域中 存储内容的变化包括但不限于文件夹及文件夹的增减或名称的修改等。 优选的, 为保证 日常使用的查询速率, 所述路径映射列表在日常应用及维护时, 可以作为所述 FUSE系统 的一部分存放在所述用户空间的内存中, 并在所述终端的存储区域进行备份; 并在所述 路径映射列表发生变化时, 对所述存储区域的路径映射列表进行同步备份; 或周期性的 对所述路径映射列表进行备份。 例如, 可以在终端的内置 SD卡的系统备份文件夹中创建 一个独立的文件作为所述路径映射列表的备份文件, 并在路径映射列表发生变化时进行 同步备份。 这样, 在终端断电重启后, 内存可以根据所述备份文件恢复路径映射列表。 当然可选的, 所述路径映射列表也可以存放在所述终端的存储区域中, 在每次需要使用 的时候进行调取访问。
所述第二文件路径分配单元 305, 用于当所述路径映射列表中不包含与所述第一文 件路径相关的第二文件路径, 且当所述访问请求为写入请求时, 为所述文件分配第二文 件路径, 并将所述第一文件路径与所述第二文件路径分配单元分配的第二文件路径之间 的映射关系写入所述路径映射列表。 其中, 所述第二文件路径是所述文件在所述至少两 个存储区域中的实际存储路径,所述分配的第二文件路径指向的存储区域中的可用存储 空间不小于所述访问请求中待写入文件所需的存储空间。 可选的, 当所述访问请求为读 取请求时, 返回路径无效信息, 以提示终端并进一步提示用户所述路径无效, 本发明实 施例对此并不进行限定。
可选的, 在为所述文件分配所述第二文件路径时, 可以预先设定存储策略, 如可以 预先设定采用内置 SD卡优先的存储策略, 或者采取优先写入剩余空间较大的存储空间的 存储策略等,本发明实施例对此并不进行限定。在为所述文件分配第二文件路径完成后, 将所述第一文件路径与所述分配的第二文件路径之间的映射关系写入所述路径映射列 表, 具体的写入格式由所述路径映射列表的当前格式决定, 详见访问请求执行单元 303 中关于路径映射列表的内容的论述。
另外, 需要注意的是, 在为所述文件分配第二文件路径时, 需要所述第二文件路径 所指向的存储区域中的可用存储空间不小于所述写入请求中待写入文件所需的存储空 间。当所述终端的任一存储区域的可用存储空间均小于所述写入请求中待写入文件所需 的存储空间时, 可以根据不同情况进行如下处理:
当所述存储区域的原始存储空间不小于所述写入请求中待写入文件所需的存储空 间时, 可以对所述文件分配至少两个第二文件路径, 使所述至少两个第二文件路径所指 向的至少两个存储区域的可用存储空间之和不小于所述写入请求中待写入文件所需的 存储空间。 当然优选的, 也可以在所述存储区域之间进行文件存放位置的调整, 以保证 至少有一个存储区域的可用存储空间不小于所述写入请求中待写入文件所需的存储空 间。 例如, 某应用程序的应用数据文件夹建立在内置 SD卡上, 随着应用数据越来越多, 所述内置 SD卡的剩余空间会越来越少, 会出现可用存储空间不足的问题。 此时, 可以在 存储区域之间进行文件夹的调整, 如将所述应用程序的应用数据目录文件夹整体转换到 另一个可用存储空间较充足的存储区域中(或者将所述内置 SD卡中的其他文件夹转移到 另一存储区域中,此时可以以同一个应用程序的文件夹保存在同一个存储区域为基本原 则进行灵活调整) 。 这样做可以保证应用程序的所有应用数据都保存在同一个存储区域 中, 一方面可以保证应用程序访问应用数据的效率, 另一方面不需要对应用程序的应用 目录进行分拆, 可以尽量减小路径映射列表的大小, 提高存储效率。
当所述存储区域的原始存储空间小于所述写入请求中待写入文件所需的存储空间 时, 此时, 即使调整文件存放位置也无法满足至少有一个存储区域的可用存储空间不小 于所述写入请求中待写入文件所需的存储空间。 因此, 此时需对所述第一文件路径分配 至少两个第二文件路径,使所述至少两个第二文件路径所指向的至少两个存储区域的可 用存储空间之和不小于所述写入请求中待写入文件所需的存储空间。 例如, 某应用程序 的应用数据文件夹建立在内置 SD卡上, 假设此时的应用程序为下载程序, 需要很多空间 来存放下载的文件, 因此其应用数据文件夹需要很大的空间。 假设此时终端的内置 SD卡 的容量为 2G, 外置 SD卡的容量为 2G, 而所述应用程序文件夹需要 3G的容量。 此时所述写 入请求中待写入文件所需的存储空间大于任一存储区域的原始存储空间, 只能为所述第 一文件路径分配至少两个第二文件路径,将其应用程序文件夹分拆后放入不同的存储区 域。 例如该第一文件路径为 /SDcard/file, 在路径映射列表中, 所述第一文件路径会对 应两个第二文件路径, 例如可以分别为 /internal— SD/file— a和 /external— SD/file—b。 这样, 一个应用程序文件夹就可以分别保存在两个存储介质上, 而应用程序还是能正常 访问。
因此, 无论针对上述哪种情况, 所述第二文件路径分配单元 304都可以包括: 第二 文件路径分配子单元 304A,用于所述写入请求中所述待写入文件所需的存储空间大于任 一存储区域的可用存储空间时,在所述路径映射列表中为所述第一文件路径分配至少两 个第二文件路径,使所述至少两个第二文件路径所指向的至少两个存储区域的可用存储 空间之和不小于所述写入请求中所述待写入文件所需的存储空间。
所述路径转换单元 302用于当所述第一文件路径指向用户空间文件系统时, 根据所 述用户空间文件系统的路径映射列表将所述第一文件路径转换为第二文件路径。 其中, 所述第二文件路径是所述文件在所述至少两个存储区域中的实际存储路径。 所述转换是指将所述访问请求中的第一文件路径转换为与其相应的第二文件路径。 本发明实施例并不对所述路径映射列表的内容进行限制, 只要能够根据所述路径映射列 表的内容获取与所述第一文件路径对应的第二文件路径即可。
例如, 所述路径映射列表中保存的内容可以为: 对于每个第一文件路径, 均包含以 完整路径的形式表达的第二文件路径与其相对应。 例如, 当所述第一文件路径为
/SDcard/ttchat时, 可以在路径映射列表中查询其对应的第二文件路径为
/internal_SD/ttchat , 此时可以直接使用路径映射列表中保存的第二文件路径作为转 换后的第二文件路径。 所述路径映射列表中保存的内容也可以为: 对于每个第一文件路 径, 均包含以縮写路径的形式表达的第二文件路径与其相对应。 例如, 对于终端包含内 置 SD卡和外置 SD卡的情形,所述縮写路径可以仅体现所述第一文件路径为内置 SD卡的路 径或外置 SD卡的路径, 即所述縮写路径可以仅体现所述第二文件路径的实际存储区域的 名称。 例如, 当所述第一文件路径为 /SDcard/ttchat时, 可以在路径映射列表中查询其 对应的第二文件路径为 /internal— SD,此时需将縮写路径进行扩展才能得到第二文件路 径, 所述扩展即用所述 internal— SD替代所述第一文件路径中的 SDcard, 以得到转换后 的第二文件路径为 /internal— SD/ttchat。 利用这种方式与保存完整路径的方式相比, 可以有效的提高所述路径映射列表的存储效率和访问效率。
所述文件访问单元 303用于根据所述第二文件路径访问所述文件。
进一步可选的,所述访问所述文件是指在所述第二文件路径中执行所述访问请求中 的访问指令部分。
根据前面几个步骤, 此时已经将第一文件路径转换为第二文件路径, 即将虚拟路径 转换为了实际存储路径, 此时能够确认所述访问请求所实际需要访问的实际存储区域。 所述存储区域是指不同的硬件存储区域, 例如内置 SD卡和外置 SD卡属于不同的存储区 域。 由于此时第二文件路径为实际路径, 直接根据所述第二文件路径执行所述访问请求 即可。
另外, 在实际应用中, 可能会出现不同存储区域之间包含重名文件夹的情况。 此时 可以直接对重名文件夹进行名称的修改, 并在路径映射列表中修改相应的第二文件路径 即可。
通过本发明实施例四中提供的终端, 通过在用户空间文件系统中设置路径映射列 表, 可以实现在文件访问时, 根据所述路径映射列表对文件原始的虚拟路径, 即第一文 件路径进行转换, 获得所述访问请求所指向的实际存储路径, 即第二文件路径。 由于实 际存储路径是根据内置 SD卡和外置 SD卡的情况统一分配的, 而不是只根据某一个存储卡 进行分配, 这样, 就可以实现对智能终端中内置 SD卡和外置 SD卡的统一管理, 有效提高 智能终端存储空间的利用效率。 本发明实施例四并对终端使用时, 通过所述路径映射列 表进行访问时可能发生的各种情况进行了说明,对本发明实施例的技术方案进行了详尽 的描述。 实施例五
本发明实施例五提供一种终端, 可用于执行本发明实施例 1-2中所述的方法。 图 5示 出了本发明实施例五提供的终端 500的结构。
该终端可以为包括手机、 平板电脑、 PDA (Personal Digital Assistant , 个人数 字助理) 、 POS (Point of Sales , 销售终端) 、 车载电脑等终端设备, 以终端为手机 为例, 图 5示出的是与本发明实施例提供的终端相关的手机 500的部分结构的框图。 参考 图 5, 手机 500包括 RF ( Radio Frequency, 射频) 电路 510、 存储器 520、 输入单元 530、 显示单元 540、 传感器 550、 音频电路 560、 WiFi (wireless fidelity, 无线保真)模块 570、 处理器 580、 以及电源 590等部件。 本领域技术人员可以理解, 图 5中示出的手机结构只 做实现方式的举例, 并不构成对手机的限定, 可以包括比图示更多或更少的部件, 或者 组合某些部件, 或者不同的部件布置。
下面结合图 5对手机 500的各个构成部件进行具体的介绍:
RF电路 510可用于收发信息或通话过程中, 信号的接收和发送, 特别地, 将基站的 下行信息接收后, 给处理器 580处理; 另外, 将设计上行的数据发送给基站。 通常, RF 电路包括但不限于天线、至少一个放大器、收发信机、耦合器、 LNA ( Low No i s e Amp 1 i f i er, 低噪声放大器) 、 双工器等。 此外, RF电路 510还可以通过无线通信与网络和其他设备 通信。所述无线通信可以使用任一通信标准或协议,包括但不限于 GSM (Global System of Mobi le communication, 全球移动通讯系统)、 GPRS (General Packet Radio Service, 通用分组无线服务)、 CDMA (Code Division Multiple Access,码分多址)、 WCDMA (Wideband Code Division Multiple Access, 宽带码分多址)、 LTE (Long Term Evolution,长期演 进)、 电子邮件、 SMS (Short Messaging Service, 短消息服务)等。
存储器 520可用于存储软件程序以及模块, 处理器 580通过运行存储在存储器 520的 软件程序以及模块, 从而执行手机 500的各种功能应用以及数据处理。 存储器 520可主要 包括存储程序区和存储数据区, 其中, 存储程序区可存储操作系统、 至少一个功能所需 的应用程序(比如声音播放功能、 图像播放功能等)等; 存储数据区可存储根据手机 500 的使用所创建的数据 (比如音频数据、 电话本等) 等。 此外, 存储器 520可以包括高速 随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、 或其他易失性固态存储器件。
输入单元 530可用于接收输入的数字或字符信息, 以及产生与手机 500的用户设置以 及功能控制有关的键信号输入。 具体地, 输入单元 530可包括触控面板 531以及其他输入 设备 532。 触控面板 531, 也称为触摸屏, 可收集用户在其上或附近的触摸操作 (比如用 户使用手指、触笔等任何适合的物体或附件在触控面板 531上或在触控面板 531附近的操 作) , 并根据预先设定的程式驱动相应的连接装置。 可选的, 触控面板 531可包括触摸 检测装置和触摸控制器两个部分。 其中, 触摸检测装置检测用户的触摸方位, 并检测触 摸操作带来的信号, 将信号传送给触摸控制器; 触摸控制器从触摸检测装置上接收触摸 信息, 并将它转换成触点坐标, 再送给处理器 580, 并能接收处理器 580发来的命令并加 以执行。 此外, 可以采用电阻式、 电容式、 红外线以及表面声波等多种类型实现触控面 板 531。 除了触控面板 531, 输入单元 530还可以包括其他输入设备 532。 具体地, 其他输 入设备 532可以包括但不限于物理键盘、 功能键 (比如音量控制按键、 开关按键等) 、 轨迹球、 鼠标、 操作杆等中的一种或多种。
显示单元 540可用于显示由用户输入的信息或提供给用户的信息以及手机 500的各 种菜单。 显示单元 540可包括显示面板 541, 可选的, 可以采用 LCD (Liquid Crystal Di splay, 液晶显示器)、 OLED (Organic Light-Emitt ing Diode,有机发光二极管)等形 式来配置显示面板 541。 进一步的, 触控面板 531可覆盖显示面板 541, 当触控面板 531检 测到在其上或附近的触摸操作后, 传送给处理器 580以确定触摸事件的类型, 随后处理 器 580根据触摸事件的类型在显示面板 541上提供相应的视觉输出。 虽然在图 5中, 触控 面板 531与显示面板 541是作为两个独立的部件来实现手机 500的输入和输入功能, 但是 在某些实施例中, 可以将触控面板 531与显示面板 541集成而实现手机 500的输入和输出 功能。
手机 500还可包括至少一种传感器 550,比如光传感器、运动传感器以及其他传感器。 具体地, 光传感器可包括环境光传感器及接近传感器, 其中, 环境光传感器可根据环境 光线的明暗来调节显示面板 541的亮度, 接近传感器可在手机 500移动到耳边时, 关闭显 示面板 541和 /或背光。 作为运动传感器的一种, 加速计传感器可检测各个方向上(一般 为三轴)加速度的大小, 静止时可检测出重力的大小及方向, 可用于识别手机姿态的应 用 (比如横竖屏切换、相关游戏、磁力计姿态校准)、振动识别相关功能(比如计步器、 敲击) 等; 至于手机 500还可配置的陀螺仪、 气压计、 湿度计、 温度计、 红外线传感器 等其他传感器, 在此不再赘述。
音频电路 560、 扬声器 561, 传声器 562可提供用户与手机 500之间的音频接口。 音频 电路 560可将接收到的音频数据转换后的电信号, 传输到扬声器 561, 由扬声器 561转换 为声音信号输出; 另一方面, 传声器 562将收集的声音信号转换为电信号, 由音频电路 560接收后转换为音频数据, 再将音频数据输出处理器 580处理后, 经 RF电路 510以发送 给比如另一手机, 或者将音频数据输出至存储器 520以便进一步处理。
WiFi属于短距离无线传输技术,手机 500通过 WiFi模块 570可以帮助用户收发电子邮 件、 浏览网页和访问流式媒体等, 它为用户提供了无线的宽带互联网访问。 虽然图 5示 出了 WiFi模块 570, 但是可以理解的是, 其并不属于手机 500的必须构成, 完全可以根据 需要在不改变发明的本质的范围内而省略。
处理器 580是手机 500的控制中心, 利用各种接口和线路连接整个手机的各个部分, 通过运行或执行存储在存储器 520内的软件程序和 /或模块, 以及调用存储在存储器 520 内的数据, 执行手机 500的各种功能和处理数据, 从而对手机进行整体监控。 可选的, 处理器 580可包括一个或多个处理单元; 优选的, 处理器 580可集成应用处理器和调制解 调处理器, 其中, 应用处理器主要处理操作系统、 用户界面和应用程序等, 调制解调处 理器主要处理无线通信。可以理解的是,上述调制解调处理器也可以不集成到处理器 580 中。
手机 500还包括给各个部件供电的电源 590 (比如电池) , 优选的, 电源可以通过电 源管理系统与处理器 580逻辑相连, 从而通过电源管理系统实现管理充电、 放电、 以及 功耗管理等功能。
尽管未示出, 手机 500还可以包括摄像头、 蓝牙模块等, 在此不再赘述。
在本发明实施例中, 该终端所包括的存储器 520中包含用户空间文件系统, 当所述 存储器中包含至少两个存储区域时, 由所述用户空间文件系统管理所述至少两个存储区 域所述处理器 580具有以下功能:
接收对文件的访问请求, 所述访问请求中包含第一文件路径; 其中, 所述第一文件 路径为所述文件的访问路径; 当所述第一文件路径指向所述用户空间文件系统时,根据所述用户空间文件系统的 路径映射列表将所述第一文件路径转换为第二文件路径; 其中, 所述第二文件路径是所 述文件在所述至少两个存储区域中的实际存储路径;
根据所述第二文件路径访问所述文件。
其中,所述文件的访问路径是指所述文件在所述用户空间文件系统管理下的虚拟路 径; 所述至少两个存储区域可以包括终端中的内置 SD卡和外置 SD卡。
通过本发明实施例五中提供的终端, 通过在用户空间文件系统中设置路径映射列 表, 可以实现在文件访问时, 根据所述路径映射列表对文件原始的虚拟路径, 即第一文 件路径进行转换, 获得所述访问请求所指向的实际存储路径, 即第二文件路径。 由于实 际存储路径是根据内置 SD卡和外置 SD卡的情况统一分配的, 而不是只根据某一个存储卡 进行分配, 这样, 就可以实现对智能终端中内置 SD卡和外置 SD卡的统一管理, 有效提高 智能终端存储空间的利用效率。 实施例六
本发明实施例六提供一种终端, 可用于执行本发明实施例 1-2中所述的方法。 图 6示 出了本发明实施例五提供的终端 600的结构, 本发明实施例六沿用本发明实施例五的终 端 500, 只是使用处理器 680代替了终端 500的处理器 580。
与实施例五相同, 所述终端 600的存储器 520中包含用户空间文件系统, 当所述存储 器中包含至少两个存储区域时, 由所述用户空间文件系统管理所述至少两个存储区域; 所述处理器 680包含以下功能:
接收对文件的访问请求, 所述访问请求中包含第一文件路径; 其中, 所述第一文件 路径为所述文件的访问路径;
当所述第一文件路径指向所述用户空间文件系统时,判断所述用户空间文件系统的 路径映射列表中是否包含与所述第一文件路径相关的第二文件路径;
当所述路径映射列表中不包含与所述第一文件路径相关的第二文件路径, 且当所述 访问请求为写入请求时, 为所述文件分配第二文件路径, 并将所述第一文件路径与所述 分配的第二文件路径之间的映射关系写入所述路径映射列表;
当所述路径映射列表中包含与所述第一文件路径相关的第二文件路径时,根据所述 路径映射列表将所述第一文件路径转换为第二文件路径; 其中, 所述第二文件路径是所 述文件在所述至少两个存储区域中的实际存储路径; 根据所述第二文件路径访问所述文件。
其中, 所述对文件的访问请求是指向终端存储器中的文件的访问请求, 所述访问请 求中包含所述文件的访问路径和访问指令,所述文件的访问路径即所述文件在所述用户 空间文件系统管理下的虚拟路径, 也即第一文件路径。 进一步的, 所述访问请求包括读 取请求和写入请求。 关于访问请求的详细情况, 具体请参照本发明实施例二。
其中,所述路径映射列表为存储所述第一文件路径及与其相应的第二文件路径之间 映射关系的列表; 所述路径映射列表根据终端的存储区域的初始值进行预先设置, 并在 所述终端的存储区域发生变化的时候进行更新。 关于路径映射列表的详细情况和内容, 具体请参照本发明实施例二。
其中, 所述判断所述第一文件路径是否为指向所述用户空间文件系统的方式, 及判 断路径映射列表中是否包含与所述第一文件路径相关的第二文件路径的方式,请参照本 发明实施例二。
其中, 所述为所述文件分配第二文件路径的方式参照本发明实施例二。 需要说明的 是,所述分配的第二文件路径指向的存储区域中的可用存储空间应不小于所述写入请求 中待写入文件所需的存储空间。当所述写入请求中所述待写入文件所需的存储空间大于 任一存储区域的可用存储空间时, 针对不同情况有不同的处理方式, 具体请参照本发明 实施例二。 无论哪种情况, 均可以采用的一种方法为: 为所述第一文件路径分配至少两 个第二文件路径,使所述至少两个第二文件路径所指向的至少两个存储区域的可用存储 空间之和不小于所述写入请求中所述待写入文件所需的存储空间。
通过本发明实施例六中提供的终端, 通过在用户空间文件系统中设置路径映射列 表, 可以实现在文件访问时, 根据所述路径映射列表对文件原始的虚拟路径, 即第一文 件路径进行转换, 获得所述访问请求所指向的实际存储路径, 即第二文件路径。 由于实 际存储路径是根据内置 SD卡和外置 SD卡的情况统一分配的, 而不是只根据某一个存储卡 进行分配, 这样, 就可以实现对智能终端中内置 SD卡和外置 SD卡的统一管理, 有效提高 智能终端存储空间的利用效率。本发明实施例六并对在通过所述路径映射列表进行访问 时可能发生的各种情况进行了说明, 对本发明实施例的技术方案进行了详尽的描述。 以上实施例仅用以说明本发明的技术方案, 而非对其限制; 尽管参照前述实施例对 本发明进行了详细的说明, 本领域的普通技术人员应当理解: 其依然可以对前述各实施 例所记载的技术方案进行修改, 或者对其中部分技术特征进行等同替换; 而这些修改或 者替换, 并不使相应技术方案的本质脱离本发明各实施例技术方案的精神和范围。 需要说明的是,本领域普通技术人员可以理解实现上述方法实施例中的全部或部分 步骤可以通过硬件来完成, 也可以通过程序来指令相关的硬件完成。 所述的程序可以存 储于一种计算机可读存储介质中, 所述存储介质可以是只读存储器、 闪存、 磁盘、 光盘 或硬盘等。 所述程序在执行时, 包括如下步骤: 接收对文件的访问请求, 所述访问请求 中包含第一文件路径; 其中, 所述第一文件路径为所述文件的访问路径; 当所述第一文 件路径指向所述用户空间文件系统时,根据所述用户空间文件系统的路径映射列表将所 述第一文件路径转换为第二文件路径; 其中, 所述第二文件路径是所述文件在所述至少 两个存储区域中的实际存储路径; 根据所述第二文件路径访问所述文件。

Claims

权利要求
1、 一种用于终端的文件访问方法, 其特征在于, 所述终端包含用户空间文件系统, 当所述终端中设置至少两个存储区域时,所述用户空间文件系统用于管理所述至少两个 存储区域, 所述方法包括:
接收对文件的访问请求, 所述访问请求中包含第一文件路径; 其中, 所述第一文件 路径为所述文件的访问路径;
当所述第一文件路径指向所述用户空间文件系统时,根据所述用户空间文件系统的 路径映射列表将所述第一文件路径转换为第二文件路径; 其中, 所述第二文件路径是所 述文件在所述至少两个存储区域中的实际存储路径;
根据所述第二文件路径访问所述文件。
2、 如权利要求 1所述的方法, 其特征在于, 所述访问请求包含读取请求和写入请求 中至少一种。
3、 如权利要求 1或 2所述的方法, 其特征在于, 所述方法在当所述第一文件路径指 向所述用户空间文件系统之后, 且根据所述用户空间文件系统的路径映射列表将所述第 一文件路径转换为第二文件路径之前, 还包括:
当所述路径映射列表中不包含与所述第一文件路径相关的第二文件路径, 且当所述 访问请求为写入请求时, 为所述文件分配第二文件路径并将所述第一文件路径与所述分 配的第二文件路径之间的映射关系写入所述路径映射列表;
其中,所述分配的第二文件路径指向的存储区域中的可用存储空间不小于所述写入 请求中待写入文件所需的存储空间。
4、如权利要求 3所述的方法,其特征在于,所述为所述文件分配第二文件路径包括: 当所述写入请求中所述待写入文件所需的存储空间大于任一存储区域的可用存储 空间时, 在所述路径映射列表中为所述第一文件路径分配至少两个第二文件路径, 使所 述至少两个第二文件路径所指向的至少两个存储区域的可用存储空间之和不小于所述 写入请求中所述待写入文件所需的存储空间。
5、 一种终端, 其特征在于, 所述终端包括用户空间文件系统, 当所述终端中设置 至少两个存储区域时, 所述用户空间文件系统用于管理所述至少两个存储区域, 所述终 端还包括:
访问请求接收单元, 用于接收对文件的访问请求, 所述访问请求中包含第一文件路 径; 其中, 所述第一文件路径为所述文件的访问路径; 路径转换单元, 用于当所述第一文件路径指向所述用户空间文件系统时, 根据所述 用户空间文件系统的路径映射列表将所述第一文件路径转换为第二文件路径; 其中, 所 述第二文件路径是所述文件在所述至少两个存储区域的实际存储路径;
文件访问单元, 用于根据所述第二文件路径访问所述文件。
6、 如权利要求 5所述的终端, 其特征在于, 所述访问请求包含读取请求和写入请求 中至少一种。
7、 如权利要求 5或 6所述的终端, 其特征在于, 所述终端还包括:
路径映射列表判断单元, 用于当所述第一文件路径指向所述用户空间文件系统时, 判断所述路径映射列表中是否包含与所述第一文件路径相关的第二文件路径; 当判断结 果为否时, 所述路径映射列表判断单元向第二文件路径分配单元发送执行指令;
所述第二文件路径分配单元,用于当所述路径映射列表判断单元判断结果为否且当 所述访问请求为写入请求时, 为所述文件分配第二文件路径并将所述第一文件路径与所 述分配的第二文件路径之间的映射关系写入所述路径映射列表; 其中, 所述分配的第二 文件路径指向的存储区域中的可用存储空间不小于所述写入请求中待写入文件所需的 存储空间。
8、 如权利要求 7所述的终端, 其特征在于, 所述第二文件路径分配单元包括: 第二文件路径分配子单元,用于当所述写入请求中所述待写入文件所需的存储空间 大于任一存储区域的可用存储空间时,在所述路径映射列表中为所述第一文件路径分配 至少两个第二文件路径,使所述至少两个第二文件路径所指向的至少两个存储区域的可 用存储空间之和不小于所述写入请求中所述待写入文件所需的存储空间。
9、 一种终端, 包括处理器和存储器, 其特征在于, 所述存储器中包含用户空间文 件系统, 当所述存储器中包含至少两个存储区域时, 由所述用户空间文件系统管理所述 至少两个存储区域; 所述处理器用于执行以下过程:
接收对文件的访问请求, 所述访问请求中包含第一文件路径; 其中, 所述第一文件 路径为所述文件的访问路径;
当所述第一文件路径指向所述用户空间文件系统时,根据所述用户空间文件系统的 路径映射列表将所述第一文件路径转换为第二文件路径; 其中, 所述第二文件路径是所 述文件在所述至少两个存储区域中的实际存储路径;
根据所述第二文件路径访问所述文件。
10、 如权利要求 9所述的终端, 其特征在于, 所述访问请求包含读取请求和写入请 求中至少一种。
11、 如权利要求 9或 10所述的终端, 其特征在于, 所述处理器在执行当所述第一文 件路径指向所述用户空间文件系统之后, 且根据所述用户空间文件系统的路径映射列表 将所述第一文件路径转换为第二文件路径之前, 还用于执行以下过程:
当所述路径映射列表中不包含与所述第一文件路径相关的第二文件路径, 且当所述 访问请求为写入请求时, 为所述文件分配第二文件路径并将所述第一文件路径与所述分 配的第二文件路径之间的映射关系写入所述路径映射列表;
其中,所述分配的第二文件路径指向的存储区域中的可用存储空间不小于所述写入 请求中待写入文件所需的存储空间。
12、 如权利要求 11所述的终端, 其特征在于, 所述处理器执行为所述文件分配第二 文件路径的过程包括:
当所述写入请求中所述待写入文件所需的存储空间大于任一存储区域的可用存储 空间时, 在所述路径映射列表中为所述第一文件路径分配至少两个第二文件路径, 使所 述至少两个第二文件路径所指向的至少两个存储区域的可用存储空间之和不小于所述 写入请求中所述待写入文件所需的存储空间。
PCT/CN2012/080194 2012-08-16 2012-08-16 一种用于终端的文件访问方法及终端 WO2014026343A1 (zh)

Priority Applications (4)

Application Number Priority Date Filing Date Title
CN201280038101.7A CN103748565A (zh) 2012-08-16 2012-08-16 一种用于终端的文件访问方法及终端
PCT/CN2012/080194 WO2014026343A1 (zh) 2012-08-16 2012-08-16 一种用于终端的文件访问方法及终端
EP12878645.6A EP2733616A4 (en) 2012-08-16 2012-08-16 TERMINAL AND METHOD FOR ACCESSING A FILE
US14/142,406 US20140115021A1 (en) 2012-08-16 2013-12-27 Method and Terminal for Accessing a File of a Terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2012/080194 WO2014026343A1 (zh) 2012-08-16 2012-08-16 一种用于终端的文件访问方法及终端

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US14/142,406 Continuation US20140115021A1 (en) 2012-08-16 2013-12-27 Method and Terminal for Accessing a File of a Terminal

Publications (1)

Publication Number Publication Date
WO2014026343A1 true WO2014026343A1 (zh) 2014-02-20

Family

ID=50101200

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2012/080194 WO2014026343A1 (zh) 2012-08-16 2012-08-16 一种用于终端的文件访问方法及终端

Country Status (4)

Country Link
US (1) US20140115021A1 (zh)
EP (1) EP2733616A4 (zh)
CN (1) CN103748565A (zh)
WO (1) WO2014026343A1 (zh)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104408053A (zh) * 2014-10-29 2015-03-11 上海斐讯数据通信技术有限公司 一种移动终端存储卡扩展方法
CN113254383A (zh) * 2021-06-18 2021-08-13 湖南博匠信息科技有限公司 基于飞腾和fpga的嵌入式板卡的数据存储方法及系统
CN117349236A (zh) * 2023-12-04 2024-01-05 深圳市科力锐科技有限公司 文件读取方法、装置、设备及存储介质

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105580010B (zh) 2014-09-01 2019-02-19 华为技术有限公司 访问文件的方法、装置和存储系统
CN105579977B (zh) 2014-09-01 2020-04-14 华为技术有限公司 访问文件的方法、装置及存储系统
CN106484719B (zh) * 2015-08-28 2020-10-16 南京中兴新软件有限责任公司 一种扩展手机存储的方法及终端
CN108629395A (zh) * 2017-03-24 2018-10-09 国民技术股份有限公司 一种数据卡及终端
CN112445414B (zh) * 2019-08-30 2023-02-03 青岛海信移动通信技术股份有限公司 数据处理方法及装置
US11656951B2 (en) * 2020-10-28 2023-05-23 Commvault Systems, Inc. Data loss vulnerability detection
CN112637281B (zh) * 2020-12-08 2023-07-18 北京嘀嘀无限科技发展有限公司 终端设备数据访问方法、装置、电子设备及存储介质
CN114553931B (zh) * 2022-02-23 2024-03-08 广州小鹏汽车科技有限公司 车辆共享存储空间的处理方法、设备、车辆及系统
CN114979119A (zh) * 2022-05-23 2022-08-30 深圳市云语科技有限公司 一种在文件传输系统通过虚拟路径支持多存储的方法

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1297197A (zh) * 2000-12-28 2001-05-30 大唐电信科技股份有限公司微电子分公司 在一个物理存储器内架构多逻辑分区及不同用途的ic卡
US20080263222A1 (en) * 2007-04-20 2008-10-23 Keiichi Matsuzawa Computer system, root node, and log management method for access path conversion
CN101853207A (zh) * 2007-05-14 2010-10-06 巴比禄股份有限公司 存储装置
CN102567244A (zh) * 2011-12-13 2012-07-11 清华大学 闪存和磁盘转换存取方法

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6408298B1 (en) * 1999-12-15 2002-06-18 Microsoft Corporation Methods and systems for copying and moving across virtual namespaces
US6195650B1 (en) * 2000-02-02 2001-02-27 Hewlett-Packard Company Method and apparatus for virtualizing file access operations and other I/O operations
FI119664B (fi) * 2004-12-08 2009-01-30 Open Invention Network Llc Menetelmä elektronisissa laitteissa oleviin tiedostoihin pääsemiseksi
US8296495B2 (en) * 2010-07-22 2012-10-23 Sandisk Il Ltd. Using an add-on storage device for extending the storage capacity of a storage device in a host device
US9152548B2 (en) * 2012-01-17 2015-10-06 Vmware, Inc. Controlling access to a privileged resource in user-mode system level mobile virtualization using a ptrace () system call

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1297197A (zh) * 2000-12-28 2001-05-30 大唐电信科技股份有限公司微电子分公司 在一个物理存储器内架构多逻辑分区及不同用途的ic卡
US20080263222A1 (en) * 2007-04-20 2008-10-23 Keiichi Matsuzawa Computer system, root node, and log management method for access path conversion
CN101853207A (zh) * 2007-05-14 2010-10-06 巴比禄股份有限公司 存储装置
CN102567244A (zh) * 2011-12-13 2012-07-11 清华大学 闪存和磁盘转换存取方法

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP2733616A4 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104408053A (zh) * 2014-10-29 2015-03-11 上海斐讯数据通信技术有限公司 一种移动终端存储卡扩展方法
CN113254383A (zh) * 2021-06-18 2021-08-13 湖南博匠信息科技有限公司 基于飞腾和fpga的嵌入式板卡的数据存储方法及系统
CN117349236A (zh) * 2023-12-04 2024-01-05 深圳市科力锐科技有限公司 文件读取方法、装置、设备及存储介质
CN117349236B (zh) * 2023-12-04 2024-03-29 深圳市科力锐科技有限公司 文件读取方法、装置、设备及存储介质

Also Published As

Publication number Publication date
US20140115021A1 (en) 2014-04-24
EP2733616A4 (en) 2014-11-05
EP2733616A1 (en) 2014-05-21
CN103748565A (zh) 2014-04-23

Similar Documents

Publication Publication Date Title
WO2014026343A1 (zh) 一种用于终端的文件访问方法及终端
US11892953B2 (en) Interprocess communication method and interprocess communications system
KR102064952B1 (ko) 수신 데이터를 이용하여 어플리케이션을 운영하는 전자 장치
EP2989538B1 (en) Method and device for managing memory of user device
CN110888821B (zh) 一种内存管理方法及装置
CN112055424B (zh) 电子装置以及切换电子装置的方法
US9740671B2 (en) Method and apparatus of generating a webpage from an original design file comprising layers
AU2018430027B2 (en) Method for browsing application folder and electronic device
US20150128079A1 (en) Method for executing function in response to touch input and electronic device implementing the same
US10209915B2 (en) Electronic device and file read and write method thereof
CN111427853A (zh) 一种数据加载方法和相关装置
JP7136416B2 (ja) モデルファイル管理方法および端末デバイス
JP2016500178A (ja) 文字選出方法、文字選出装置、端末装置、プログラム及び記録媒体
CN109144723B (zh) 一种分配存储空间的方法和终端
WO2019128571A1 (zh) 资源管理方法、装置、移动终端及计算机可读存储介质
CN114817120A (zh) 一种跨域数据共享方法、系统级芯片、电子设备及介质
KR20150061475A (ko) 전자 장치 및 전자 장치의 메모리 관리 방법
TW202248866A (zh) 對功能進行管理的方法及系統、以及電腦可讀取媒體
WO2018032743A1 (zh) 一种文件碎片评估方法及终端
EP4099177A1 (en) Garbage data scrubbing method, and device
EP2973008A1 (en) Grouping files for optimized file operations
WO2022227997A1 (zh) 内存申请方法及相关设备
KR20220108710A (ko) 연산 저장 장치에 대한 데이터 전송을 위한 시스템 및 방법
WO2019071616A1 (zh) 一种处理方法及装置
CN109308164B (zh) 一种系统迁移的方法和装置

Legal Events

Date Code Title Description
REEP Request for entry into the european phase

Ref document number: 2012878645

Country of ref document: EP

WWE Wipo information: entry into national phase

Ref document number: 2012878645

Country of ref document: EP

121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 12878645

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE