WO2018028321A1 - Method and apparatus for managing virtual external storage device, and terminal - Google Patents

Method and apparatus for managing virtual external storage device, and terminal Download PDF

Info

Publication number
WO2018028321A1
WO2018028321A1 PCT/CN2017/090396 CN2017090396W WO2018028321A1 WO 2018028321 A1 WO2018028321 A1 WO 2018028321A1 CN 2017090396 W CN2017090396 W CN 2017090396W WO 2018028321 A1 WO2018028321 A1 WO 2018028321A1
Authority
WO
WIPO (PCT)
Prior art keywords
storage device
external storage
virtual external
physical
information
Prior art date
Application number
PCT/CN2017/090396
Other languages
French (fr)
Chinese (zh)
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 中兴通讯股份有限公司
Publication of WO2018028321A1 publication Critical patent/WO2018028321A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45579I/O management, e.g. providing access to device drivers or storage

Definitions

  • the present invention relates to the field of mobile communication technologies, and in particular, to a method, an apparatus, and a terminal for managing a virtual external storage device.
  • the Android M system introduces the function of SD card (Secure Digital Memory Card) formatted as built-in storage. After the user inserts the SD card, you can choose to format the SD card as a built-in storage device.
  • SD card formatted as internal storage will be used as part of the system's internal storage to expand the internal storage space of the system.
  • the Android system virtualizes the system's /data/media directory into an external type of emulated by sharing the data partition.
  • the storage device is then mounted to the external storage device mount point for access by the upper layer application through the file system in Userspace (FUSE) virtual drive (daemon) service process.
  • FUSE file system in Userspace
  • daemon virtual drive
  • the user can choose to format the SD card as a built-in storage device.
  • the system will create a new media directory on the root directory of the SD card, and then virtualize the media directory into another external storage device of the emulated type. Subsequent systems can be mounted by the FUSE daemon. Access the external storage device.
  • the default is the embedded type external storage device that is virtualized through the system /data/media directory during the boot process. If you want to save user data to SD card formatted as internal storage device after SD
  • the external storage device of the emulated type virtualized by the media directory of the Kagan directory the user needs to select the mobile operation through the transfer data menu of the SD card or the process of formatting the built-in storage on the SD card, and firstly externally the target emulated type on the SD card.
  • the content of the storage device is deleted, and then the content of the external storage device corresponding to the source of the /data/media directory is copied to the external storage device of the target emulated type, and then the content of the external storage device of the source emulated type is deleted, and finally The target emulated type external storage device is mounted to the external storage device mount point through the FUSE daemon service process.
  • the external storage device of the emulated type corresponding to the SD card is selected, if the user uninstalls the SD card, the external storage device without the emulated type is in the mounted state. If the system uses the external storage device as the primary storage device of the system, the system does not exist. The upper application cannot save user data.
  • An object of the present invention is to provide a method, an apparatus, and a terminal for managing a virtual external storage device, which are used to solve the problem that the virtual external storage device of the mobile terminal system cannot be accessed at the same time.
  • an embodiment of the present invention provides a method for managing a virtual external storage device, including:
  • the physical storage device that is allowed to access is confirmed according to the currently available virtual external storage device information, and the storage device access request is sent to the physical storage device.
  • the method further includes:
  • Corresponding formatting processing is performed on the physical storage device according to the formatting request.
  • the step of performing a basic processing operation of the file system on the virtual external storage device corresponding to the physical storage device according to the state change of the physical storage device includes:
  • the first virtual external storage device is mounted to the first preset mount point;
  • the step of updating the path information of the virtual external storage device after the completion of the basic processing operation, and obtaining the currently available virtual external storage device information includes:
  • the step of performing a basic processing operation of the file system on the virtual external storage device corresponding to the physical storage device according to the state change of the physical storage device includes:
  • the virtual external storage device corresponding to the physical external storage device is mounted to the second preset mount point;
  • the step of updating the path information of the virtual external storage device after the completion of the basic processing operation, and obtaining the currently available virtual external storage device information includes:
  • the step of performing a basic processing operation of the file system on the virtual external storage device corresponding to the physical storage device according to the state change of the physical storage device includes:
  • the step of updating the path information of the virtual external storage device after the completion of the basic processing operation, and obtaining the currently available virtual external storage device information includes:
  • the path information corresponding to the virtual external storage device is deleted, and the currently available virtual external storage device information is obtained.
  • the step of sending the storage device access request to the physical storage device includes:
  • the method further includes:
  • the embodiment of the invention further provides a management device for a virtual external storage device, comprising:
  • a first listening module configured to monitor a state change of the physical storage device
  • the processing module is configured to perform a basic processing operation of the file system on the virtual external storage device corresponding to the physical storage device according to the state change of the physical storage device;
  • An information update module configured to update path information of the virtual external storage device after completing the basic processing operation, to obtain currently available virtual external storage device information
  • the access module is configured to, when receiving the storage device access request, confirm the physical storage device that is allowed to access according to the currently available virtual external storage device information, and send the storage device access request to the physical storage device.
  • the embodiment of the invention further provides a terminal, comprising: a management device of the virtual external storage device as described in the foregoing embodiment.
  • the embodiment of the present invention further provides a storage medium, where the storage medium includes a stored program, wherein the program is executed to perform the method described in any one of the above.
  • An embodiment of the present invention further provides a processor, where the processor is configured to run a program, where the program is executed to perform the method described in any one of the above.
  • the path information after the basic processing operation is performed on the virtual external storage device corresponding to the physical storage device, so as to facilitate multiple virtual external operations on the terminal.
  • Unified management of storage devices enables users to access multiple virtual external storage devices to enhance the user experience.
  • FIG. 1 is a schematic diagram of basic steps of a method for managing a virtual external storage device according to an embodiment of the present invention
  • FIG. 2 is a schematic structural diagram of a management apparatus of a virtual external storage device according to an embodiment of the present invention
  • FIG. 3 is a system frame diagram of a terminal of a management device including a virtual external storage device according to an embodiment of the present invention.
  • the present invention is directed to the problem that the virtual external storage device of the prior art mobile terminal system cannot be accessed at the same time, and provides a method for managing the virtual external storage device, which facilitates unified management of multiple virtual external storage devices on the terminal. This allows users to access multiple virtual external storage devices to enhance the user experience.
  • an embodiment of the present invention provides a method for managing a virtual external storage device, including:
  • Step 11 Monitor a state change of the physical storage device.
  • the physical storage device includes: a physical external storage device and a physical internal storage device.
  • the physical external storage device may be an SD card or the like
  • the physical internal storage device may be a built-in memory soldered on the terminal motherboard or the like.
  • Step 12 Perform basic processing operations on the file system on the virtual external storage device corresponding to the physical storage device according to the state change of the physical storage device.
  • the basic processing operations of the file system include: a mount operation or an unload operation.
  • mounting refers to mounting a storage device to an existing directory.
  • Step 13 Update path information of the virtual external storage device after completing the basic processing operation, to obtain currently available virtual external storage device information;
  • the path information of the virtual external storage device refers to the mount directory of the virtual external storage device, that is, the mount path, that is, the mount point information of the virtual external storage device.
  • the user can access the content in the virtual external storage device through the path information.
  • Step 14 Upon receiving the storage device access request, confirm the physical storage device that is allowed to access according to the currently available virtual external storage device information, and send the storage device access request to the physical storage device.
  • the storage device access request may be initiated by the user through the application, or may be initiated by the operating system itself of the terminal.
  • the storage device access request is typically an access request to a virtual external storage device.
  • the storage device access request may include: a request for reading, writing, deleting, copying, and creating a file.
  • the camera application of the terminal adds the image file request for the photo completion, that is, to the virtual external storage device.
  • the method for managing the virtual external storage device provided by the embodiment of the present invention is to update the path information after the basic processing operation of the virtual external storage device corresponding to the physical storage device in a timely manner when the state of the physical storage device changes.
  • Uniform management of multiple virtual external storage devices on the terminal enables users to access multiple virtual external storage devices to enhance the user experience.
  • the management method of the virtual external storage device in the embodiment of the present invention may further include:
  • the terminal may also monitor the physical external storage device that is initiated by the user through the application for storage device management. Formatted as a formatted request for a built-in storage device.
  • Corresponding formatting processing is performed on the physical storage device according to the formatting request.
  • a partition of a physical external storage device may divide a physical external storage device mounted to the terminal into a storage area space for storing different types of file systems.
  • the state change of the physical storage device may include: the physical internal storage device is created as the first virtual external storage device, the addition of the physical external storage device, and the removal of the physical external storage device.
  • the flow of the execution steps of these three cases will be specifically described below.
  • step 12 of the embodiment of the present invention may specifically include:
  • the first virtual external storage device is mounted to the first preset mount point.
  • a virtual external storage device is created in the preset directory, and then mounted to the external storage device mount point configured by the system through the preset service process.
  • the operating system of the terminal is an Android M system.
  • an external storage device of the emulated type is created in the multimedia directory of the shared data partition, and is mounted to the external storage configured by the system through the FUSE service process. The device is mounted on the point.
  • step 13 of the embodiment of the present invention may specifically include:
  • the currently available virtual external storage device information may store the records in the form of a list.
  • the step 12 of the embodiment of the present invention may further include:
  • the physical external storage device When the physical external storage device is added, the physical external storage device is correspondingly The virtual external storage device is mounted to the second preset mount point.
  • the addition of the physical external storage device is monitored, that is, the terminal listens to a physical external storage device, such as an SD card, and inserts it onto the terminal.
  • a physical external storage device such as an SD card
  • the virtual external storage device corresponding to the physical storage device is mounted.
  • step 13 of the embodiment of the present invention may further include:
  • step 12 of the embodiment of the present invention may further include:
  • the virtual external storage device corresponding to the physical external storage device is uninstalled.
  • the physical external storage device is monitored for removal, that is, the terminal monitors a physical external storage device, such as an SD card, installed on the terminal, and is extracted from the terminal.
  • a physical external storage device such as an SD card
  • step 13 of the embodiment of the present invention may further include:
  • the path information corresponding to the virtual external storage device is deleted, and the currently available virtual external storage device information is obtained.
  • the step 14 in the embodiment of the present invention may further include:
  • the storage device access request may be initiated by the user through the application, or may be initiated by the operating system itself of the terminal.
  • the storage device access request is typically an access request to a virtual external storage device.
  • the currently available virtual external storage device information may include: the number of virtual external storage devices, the capacity of the virtual external storage device, and the path information of the virtual external storage device.
  • the capacity of the virtual external storage device may specifically include the remaining capacity of the virtual external storage device, and may of course include the total capacity or the used capacity of the virtual external storage device.
  • the path information may include virtual path information of the virtual external storage device and actual physical path information.
  • the virtual path information here is the mount point information of the virtual external storage device.
  • the currently available virtual external storage device information may be displayed to the user in the form of an image interface on the application for the user storage setting for the user to view, and set the current user storage device access policy.
  • the current user storage device access policy is mainly to set the user storage device access priority, that is, when receiving the storage device access request, the priority access among the plurality of virtual external storage devices may be determined according to the current user storage device access policy.
  • Virtual external storage device is mainly to set the user storage device access priority, that is, when receiving the storage device access request, the priority access among the plurality of virtual external storage devices may be determined according to the current user storage device access policy.
  • the current user storage device access policy includes metadata information of the virtual external storage device, that is, the actual physical path of the physical storage device corresponding to the virtual external storage device.
  • the storage device access request of the embodiment of the present invention is a write request, that is, requesting to write data to the storage device.
  • the storage device access request can also be a read request, that is, requesting to read data from the storage device to be accessed. It should be noted that, when the storage device access request is a read request, the physical storage device corresponding to the read request is obtained according to the metadata information of the currently recorded virtual external storage device, and the read request is sent to the physical storage device. .
  • the management method of the virtual external storage device in the embodiment of the present invention may further include:
  • the terminal can receive a graphical interface provided by the user through the application for the user storage setting for the user to view the currently available virtual external storage device list. Initiated storage device query request.
  • the method for managing the virtual external storage device provided by the embodiment of the present invention is to update the path information after the basic processing operation of the virtual external storage device corresponding to the physical storage device in a timely manner when the state of the physical storage device changes.
  • Uniform management of multiple virtual external storage devices on the terminal enables users to access multiple virtual external storage devices to enhance the user experience.
  • an embodiment of the present invention provides a management device for a virtual external storage device, including:
  • the first monitoring module 21 is configured to monitor a state change of the physical storage device
  • the physical storage device includes: a physical external storage device and a physical internal storage device.
  • the physical external storage device may be an SD card or the like
  • the physical internal storage device may be a built-in memory soldered on the terminal motherboard or the like.
  • the execution processing module 22 is configured to perform a basic processing operation of the file system on the virtual external storage device corresponding to the physical storage device according to the state change of the physical storage device;
  • the basic processing operations of the file system include: a mount operation or an unload operation.
  • mounting refers to mounting a storage device to an existing directory.
  • the information update module 23 is configured to update path information of the virtual external storage device after completing the basic processing operation, to obtain currently available virtual external storage device information;
  • the path information of the virtual external storage device refers to the mount directory of the virtual external storage device, that is, the mount path, that is, the mount point information of the virtual external storage device.
  • the user can access the content in the virtual external storage device through the path information.
  • the access module 24 is configured to, when receiving the storage device access request, confirm the physical storage device that is allowed to access according to the currently available virtual external storage device information, and send the storage device access request to the physical storage device.
  • the storage device access request may be initiated by the user through the application, or may be initiated by the operating system itself of the terminal.
  • the storage device access request is generally An access request to a virtual external storage device.
  • the storage device access request may include: a request for reading, writing, deleting, copying, and creating a file.
  • the camera application of the terminal adds the image file request for the photo completion, that is, to the virtual external storage device.
  • the management device of the virtual external storage device in the embodiment of the present invention may further include:
  • a second listening module configured to monitor a user-initiated formatting request for the physical storage device
  • the terminal may also monitor a formatting request initiated by the user for formatting the physical external storage device as the built-in storage device by the application for storage device management.
  • the formatting processing module is configured to perform a corresponding formatting process on the physical storage device according to the formatting request.
  • the second listening module can also monitor the partition change of the physical storage device.
  • a partition of a physical external storage device may divide a physical external storage device mounted to the terminal into a storage area space for storing different types of file systems.
  • the state change of the physical storage device may include: the physical internal storage device is created as the first virtual external storage device, the addition of the physical external storage device, and the removal of the physical external storage device.
  • execution processing module 22 may specifically include:
  • the first execution processing unit is configured to: when the physical internal storage device is configured to be the first virtual external storage device, mount the first virtual external storage device to the first preset mount point.
  • the first execution processing unit creates a virtual external storage device in the preset directory, and then mounts it to the external storage device mount point configured by the system through the preset service process.
  • the operating system of the terminal is an Android M system.
  • the first execution processing unit creates an external storage device of the emulated type in the multimedia directory of the shared data partition, and mounts the system through the FUSE service process. Configured external storage device Mount point.
  • the information update module 23 of the embodiment of the present invention may specifically include:
  • the first information updating unit is configured to add the path information of the first virtual external storage device after the mounting operation is completed, and obtain the currently available virtual external storage device information.
  • the currently available virtual external storage device information may store the records in the form of a list.
  • the execution processing module 22 may further include:
  • the second execution processing unit is configured to mount the virtual external storage device corresponding to the physical external storage device to the second preset mount point when the addition of the physical external storage device is monitored.
  • the addition of the physical external storage device is monitored, that is, the terminal listens to a physical external storage device, such as an SD card, and inserts it onto the terminal.
  • a physical external storage device such as an SD card
  • the virtual external storage device corresponding to the physical storage device is mounted.
  • the information update module 23 of the embodiment of the present invention may specifically include:
  • the second information updating unit is configured to add the path information of the virtual external storage device after the mounting operation is completed, and obtain the currently available virtual external storage device information.
  • the execution processing module 22 may further include:
  • the third execution processing unit is configured to uninstall the virtual external storage device corresponding to the physical external storage device when the physical external storage device is removed.
  • the physical external storage device is monitored for removal, that is, the terminal monitors a physical external storage device, such as an SD card, installed on the terminal, and is extracted from the terminal.
  • a physical external storage device such as an SD card
  • the information update module 23 of the embodiment of the present invention may specifically include:
  • the third information update unit is configured to delete the path information corresponding to the virtual external storage device, and obtain the currently available virtual external storage device information.
  • the access module 24 of the embodiment of the present invention may further include:
  • Query unit configured to query the currently available when a storage device access request is received Virtual external storage device information, obtaining a current user storage device access policy
  • the storage device access request may be initiated by the user through the application, or may be initiated by the operating system itself of the terminal.
  • the storage device access request is typically an access request to a virtual external storage device.
  • the currently available virtual external storage device information may include: the number of virtual external storage devices, the capacity of the virtual external storage device, and the path information of the virtual external storage device.
  • the capacity of the virtual external storage device may specifically include the remaining capacity of the virtual external storage device, and may of course include the total capacity or the used capacity of the virtual external storage device.
  • the path information may include virtual path information of the virtual external storage device and actual physical path information.
  • the virtual path information here is the mount point information of the virtual external storage device.
  • the currently available virtual external storage device information may be displayed to the user in the form of an image interface on the application for the user storage setting for the user to view, and set the current user storage device access policy.
  • a path conversion unit configured to convert the virtual access path of the storage device access request into an actual physical path according to the current user storage device access policy
  • the current user storage device access policy is mainly to set the user storage device access priority, that is, when receiving the storage device access request, the priority access among the plurality of virtual external storage devices may be determined according to the current user storage device access policy.
  • Virtual external storage device is mainly to set the user storage device access priority, that is, when receiving the storage device access request, the priority access among the plurality of virtual external storage devices may be determined according to the current user storage device access policy.
  • the current user storage device access policy includes metadata information of the virtual external storage device, that is, the actual physical path of the physical storage device corresponding to the virtual external storage device.
  • the access unit is configured to send the storage device access request to a physical storage device corresponding to the actual physical path.
  • the storage device access request of the embodiment of the present invention is a write request, that is, requesting to write data to the storage device.
  • the storage device access request can also be a read request, that is, requesting to read data from the storage device to be accessed. It should be noted that when the storage device access request is a read request, The physical storage device corresponding to the read request is obtained according to the metadata information of the currently recorded virtual external storage device, and the read request is sent to the physical storage device.
  • the device of the virtual external storage device of the embodiment of the present invention may further include:
  • Receiving a module receiving a storage device query request initiated by the user
  • the terminal can receive a storage device query request initiated by the user through a graphical interface provided by the application for the user storage setting for the user to view the currently available virtual external storage device list.
  • the information return module returns the currently available virtual external storage device information to the user.
  • the embodiment of the invention further provides a terminal, comprising the management device of the virtual external storage device as described in the above embodiments.
  • FIG. 3 it is a system framework diagram of a terminal of a management device including a virtual external storage device according to an embodiment of the present invention.
  • the management device of the virtual external storage device includes: a listening module, an access module, an execution processing module, an information update module, and an application (not shown) for displaying a user storage setting.
  • the information update module is respectively connected to the access module and the execution processing module, and the monitoring module is connected to the execution processing module.
  • the information update module stores the currently available storage device in a list form, that is, the information update module includes a storage device list.
  • the listening module includes the first listening module and the second listening module described in the second embodiment, that is, the listening module has the functions of the first listening module and the second listening module at the same time.
  • the monitoring module monitors the state change of the physical external storage device
  • the state change of the physical external storage device is notified to the execution processing module in the form of a notification message, and the execution processing module performs the file system according to the state change of the physical external storage device.
  • the execution processing module parses the notification message sent by the listening module to determine its message class.
  • the storage device is added, the storage device is mounted.
  • the execution processing module sends a message notification message update module to add the virtual external storage device path corresponding to the storage device to the current storage device list.
  • the user initiates a storage device access request to the access module through the application APP;
  • the storage device access request is transmitted to the access module through the FUSE service process via the function library Libc.
  • the message update module queries the storage device list according to the storage device access request to obtain the current user storage device access policy.
  • the access module converts the virtual access path of the storage device access request into an actual physical path according to the current user storage device access policy, and sends the storage device access request to the physical storage device corresponding to the actual physical path;
  • the storage device access request is transmitted to the physical storage device corresponding to the actual physical path through the storage device driver through the log file system EXT4 according to the actual physical path.
  • the physical storage device responds to the user-initiated storage device access request and returns a response result to the user.
  • the physical storage device stores the image file according to the storage device access request, and if the storage is successful, the storage success result is returned to the user. If the storage fails, the result of the storage failure is returned to the user.
  • the device of the virtual external storage device performs the basic processing operation after the processing module performs the basic processing operation on the virtual external storage device corresponding to the physical storage device when the state of the physical storage device changes.
  • the update module updates the path information of the virtual external storage device in time to facilitate unified management of multiple virtual external storage devices on the terminal, so that the user can access multiple virtual external storage devices through the access module to improve the user experience.
  • Embodiments of the present invention also provide a storage medium including a stored program, wherein the program described above executes the method of any of the above.
  • the foregoing storage medium may include, but is not limited to, a USB flash drive, a Read-Only Memory (ROM), and a Random Access Memory (RAM).
  • ROM Read-Only Memory
  • RAM Random Access Memory
  • Embodiments of the present invention also provide a processor for running a program, wherein the program is executed to perform the steps of any of the above methods.
  • modules or steps of the present invention described above can be implemented by a general-purpose computing device that can be centralized on a single computing device or distributed across a network of multiple computing devices. Alternatively, they may be implemented by program code executable by the computing device such that they may be stored in the storage device by the computing device and, in some cases, may be different from the order herein.
  • the steps shown or described are performed, or they are separately fabricated into individual integrated circuit modules, or a plurality of modules or steps thereof are fabricated as a single integrated circuit module.
  • the invention is not limited to any specific combination of hardware and software.
  • the path information of the virtual external storage device corresponding to the physical storage device is updated in time, which is convenient for the terminal.
  • Unified management of multiple virtual external storage devices enables users to access multiple virtual external storage devices to enhance the user experience.

Abstract

Disclosed are a method and apparatus for managing a virtual external storage device, and a terminal. The method comprises: monitoring a state change of a physical storage device (11); according to the state change of the physical storage device, performing a basic file system processing operation on a virtual external storage device corresponding to the physical storage device (12); updating path information about the virtual external storage device after completing the basic processing operation, and obtaining currently-available virtual external storage device information (13); and when a request for accessing a storage device is received, according to the currently-available virtual external storage device information, determining a physical storage device capable of being accessed, and sending, to the physical storage device, the request for accessing the storage device (14). In the method, it is convenient to manage a plurality of virtual external storage devices on a terminal by means of updating path information when the state of a physical storage device changes and after a processing operation is performed on a virtual external storage device corresponding thereto, so that a user can access a plurality of virtual external storage devices and the user experience is improved.

Description

一种虚拟外置存储设备的管理方法、装置及终端Management method, device and terminal for virtual external storage device 技术领域Technical field
本发明涉及移动通信技术领域,特别是涉及一种虚拟外置存储设备的管理方法、装置及终端。The present invention relates to the field of mobile communication technologies, and in particular, to a method, an apparatus, and a terminal for managing a virtual external storage device.
背景技术Background technique
Android M系统引入了SD卡(Secure Digital Memory Card,安全数码卡)格式化为内置存储的功能。用户插入SD卡后,可以选择将SD卡格式化为内置存储设备。格式化为内部存储的SD卡将作为系统内部存储的一部分,用于扩展系统内部存储空间大小。The Android M system introduces the function of SD card (Secure Digital Memory Card) formatted as built-in storage. After the user inserts the SD card, you can choose to format the SD card as a built-in storage device. The SD card formatted as internal storage will be used as part of the system's internal storage to expand the internal storage space of the system.
在插入SD卡之前,为了提供应用保存用户数据的功能,安卓(Android)系统通过共享数据(data)分区的方式,将系统的/data/媒体(media)目录虚拟成一个类型为emulated的外置存储设备,然后通过用户空间文件系统(Filesystem in Userspace,简称FUSE)虚拟光驱(daemon)服务进程挂载到外置存储设备挂载点供上层应用访问。由于系统采用共享data分区的方案,虚拟出来的emulated类型的外置存储设备的容量大小为data分区的大小。Before inserting the SD card, in order to provide the function of the application to save the user data, the Android system virtualizes the system's /data/media directory into an external type of emulated by sharing the data partition. The storage device is then mounted to the external storage device mount point for access by the upper layer application through the file system in Userspace (FUSE) virtual drive (daemon) service process. Because the system adopts a shared data partitioning scheme, the size of the virtualized external storage device is the size of the data partition.
插入SD卡后,当SD卡挂载后,用户可以选择将SD卡格式化为内置存储设备。当SD卡被格式化为内部存储后,系统会在SD卡根目录上面新建一个media目录,然后将该media目录虚拟成另外一个emulated类型的外置存储设备,后续系统可以通过FUSE daemon挂载并访问该外置存储设备。After inserting the SD card, when the SD card is mounted, the user can choose to format the SD card as a built-in storage device. When the SD card is formatted as internal storage, the system will create a new media directory on the root directory of the SD card, and then virtualize the media directory into another external storage device of the emulated type. Subsequent systems can be mounted by the FUSE daemon. Access the external storage device.
由于当前系统只支持挂载一个emulated类型的外置存储设备,默认是开机过程中通过系统/data/media目录虚拟出来的emulated类型外置存储设备。如果希望将用户数据保存到SD卡格式化为内置存储设备后通过SD 卡根目录的media目录虚拟出来的emulated类型外置存储设备,用户需要通过SD卡的转移数据菜单或者在SD卡格式化内置存储的过程中选择移动操作,先将SD卡上目标emulated类型外置存储设备的内容删除,然后将/data/media目录对应源emulated类型外置存储设备的内容拷贝到目标emulated类型外置存储设备上,然后再将源emulated类型外置存储设备的内容删除,最后再通过FUSE daemon服务进程将目标emulated类型外置存储设备挂载到外置存储设备挂载点。Because the current system only supports mounting an external storage device of the emulated type, the default is the embedded type external storage device that is virtualized through the system /data/media directory during the boot process. If you want to save user data to SD card formatted as internal storage device after SD The external storage device of the emulated type virtualized by the media directory of the Kagan directory, the user needs to select the mobile operation through the transfer data menu of the SD card or the process of formatting the built-in storage on the SD card, and firstly externally the target emulated type on the SD card. The content of the storage device is deleted, and then the content of the external storage device corresponding to the source of the /data/media directory is copied to the external storage device of the target emulated type, and then the content of the external storage device of the source emulated type is deleted, and finally The target emulated type external storage device is mounted to the external storage device mount point through the FUSE daemon service process.
此外,当选择挂载SD卡对应的emulated类型外置存储设备后,如果用户卸载SD卡,此时系统中将无emulated类型的外置存储设备处于挂载状态。如果系统将emulated类型外置存储设备作为系统的主存储设备,则会导致系统主存储设备不存在,上层应用无法保存用户数据的问题。In addition, when the external storage device of the emulated type corresponding to the SD card is selected, if the user uninstalls the SD card, the external storage device without the emulated type is in the mounted state. If the system uses the external storage device as the primary storage device of the system, the system does not exist. The upper application cannot save user data.
发明内容Summary of the invention
本发明的目的在于提供一种虚拟外置存储设备的管理方法、装置及终端,用以解决现有技术中移动终端系统的虚拟外置存储设备无法同时被访问的问题。An object of the present invention is to provide a method, an apparatus, and a terminal for managing a virtual external storage device, which are used to solve the problem that the virtual external storage device of the mobile terminal system cannot be accessed at the same time.
为了解决上述技术问题,本发明实施例提供一种虚拟外置存储设备的管理方法,包括:In order to solve the above technical problem, an embodiment of the present invention provides a method for managing a virtual external storage device, including:
监听物理存储设备的状态变化;Monitor the state change of the physical storage device;
根据所述物理存储设备的状态变化,对所述物理存储设备对应的虚拟外置存储设备进行文件系统的基本处理操作;Performing a basic processing operation of the file system on the virtual external storage device corresponding to the physical storage device according to the state change of the physical storage device;
更新所述虚拟外置存储设备在完成所述基本处理操作后的路径信息,得到当前可用的虚拟外置存储设备信息;Updating the path information of the virtual external storage device after completing the basic processing operation, to obtain currently available virtual external storage device information;
在接收到存储设备访问请求时,根据所述当前可用的虚拟外置存储设备信息,确认允许访问的物理存储设备,向所述物理存储设备发送所述存储设备访问请求。Upon receiving the storage device access request, the physical storage device that is allowed to access is confirmed according to the currently available virtual external storage device information, and the storage device access request is sent to the physical storage device.
其中,所述方法还包括: The method further includes:
监听用户发起的对所述物理存储设备的格式化请求;Monitoring a user-initiated formatting request for the physical storage device;
根据所述格式化请求对所述物理存储设备进行对应的格式化处理。Corresponding formatting processing is performed on the physical storage device according to the formatting request.
其中,根据所述物理存储设备的状态变化,对所述物理存储设备对应的虚拟外置存储设备进行文件系统的基本处理操作的步骤包括:The step of performing a basic processing operation of the file system on the virtual external storage device corresponding to the physical storage device according to the state change of the physical storage device includes:
当监听到物理内置存储设备被创建为第一虚拟外置存储设备时,将所述第一虚拟外置存储设备挂载至第一预设挂载点;When the physical internal storage device is configured to be the first virtual external storage device, the first virtual external storage device is mounted to the first preset mount point;
所述更新所述虚拟外置存储设备在完成所述基本处理操作后的路径信息,得到当前可用的虚拟外置存储设备信息的步骤包括:The step of updating the path information of the virtual external storage device after the completion of the basic processing operation, and obtaining the currently available virtual external storage device information includes:
添加所述第一虚拟外置存储设备在完成挂载操作后的路径信息,得到当前可用的虚拟外置存储设备信息。Adding the path information of the first virtual external storage device after the mounting operation is completed, and obtaining the currently available virtual external storage device information.
其中,根据所述物理存储设备的状态变化,对所述物理存储设备对应的虚拟外置存储设备进行文件系统的基本处理操作的步骤包括:The step of performing a basic processing operation of the file system on the virtual external storage device corresponding to the physical storage device according to the state change of the physical storage device includes:
当监听到物理外置存储设备的添加时,将所述物理外置存储设备对应的虚拟外置存储设备挂载至第二预设挂载点;When the physical external storage device is added, the virtual external storage device corresponding to the physical external storage device is mounted to the second preset mount point;
所述更新所述虚拟外置存储设备在完成所述基本处理操作后的路径信息,得到当前可用的虚拟外置存储设备信息的步骤包括:The step of updating the path information of the virtual external storage device after the completion of the basic processing operation, and obtaining the currently available virtual external storage device information includes:
添加所述虚拟外置存储设备在完成挂载操作后的路径信息,得到当前可用的虚拟外置存储设备信息。Adding the path information of the virtual external storage device after the mounting operation is completed, and obtaining the currently available virtual external storage device information.
其中,根据所述物理存储设备的状态变化,对所述物理存储设备对应的虚拟外置存储设备进行文件系统的基本处理操作的步骤包括:The step of performing a basic processing operation of the file system on the virtual external storage device corresponding to the physical storage device according to the state change of the physical storage device includes:
当监听到物理外置存储设备的移除时,将所述物理外置存储设备对应的虚拟外置存储设备卸载;When the physical external storage device is removed, the virtual external storage device corresponding to the physical external storage device is uninstalled;
所述更新所述虚拟外置存储设备在完成所述基本处理操作后的路径信息,得到当前可用的虚拟外置存储设备信息的步骤包括:The step of updating the path information of the virtual external storage device after the completion of the basic processing operation, and obtaining the currently available virtual external storage device information includes:
删除所述虚拟外置存储设备对应的路径信息,得到当前可用的虚拟外置存储设备信息。The path information corresponding to the virtual external storage device is deleted, and the currently available virtual external storage device information is obtained.
其中,在接收到存储设备访问请求时,根据所述当前可用的虚拟外置 存储设备信息,确认允许访问的物理存储设备,向所述物理存储设备发送所述存储设备访问请求的步骤包括:Wherein, when receiving a storage device access request, according to the currently available virtual external device The device information is stored, and the physical storage device that is allowed to access is confirmed, and the step of sending the storage device access request to the physical storage device includes:
在接收到存储设备访问请求时,查询所述当前可用的虚拟外置存储设备信息,获取当前用户存储设备访问策略;When the storage device access request is received, querying the currently available virtual external storage device information to obtain a current user storage device access policy;
根据所述当前用户存储设备访问策略,将所述存储设备访问请求的虚拟访问路径转换为实际物理路径;Converting the virtual access path of the storage device access request into an actual physical path according to the current user storage device access policy;
向所述实际物理路径对应的物理存储设备发送所述存储设备访问请求。Sending the storage device access request to a physical storage device corresponding to the actual physical path.
其中,所述方法还包括:The method further includes:
接收用户发起的存储设备查询请求;Receiving a storage device query request initiated by the user;
向所述用户返回当前可用的虚拟外置存储设备信息。Returning the currently available virtual external storage device information to the user.
本发明实施例还提供一种虚拟外置存储设备的管理装置,包括:The embodiment of the invention further provides a management device for a virtual external storage device, comprising:
第一监听模块,设置为监听物理存储设备的状态变化;a first listening module configured to monitor a state change of the physical storage device;
执行处理模块,设置为根据所述物理存储设备的状态变化,对所述物理存储设备对应的虚拟外置存储设备进行文件系统的基本处理操作;The processing module is configured to perform a basic processing operation of the file system on the virtual external storage device corresponding to the physical storage device according to the state change of the physical storage device;
信息更新模块,设置为更新所述虚拟外置存储设备在完成所述基本处理操作后的路径信息,得到当前可用的虚拟外置存储设备信息;An information update module, configured to update path information of the virtual external storage device after completing the basic processing operation, to obtain currently available virtual external storage device information;
访问模块,设置为在接收到存储设备访问请求时,根据所述当前可用的虚拟外置存储设备信息,确认允许访问的物理存储设备,向所述物理存储设备发送所述存储设备访问请求。The access module is configured to, when receiving the storage device access request, confirm the physical storage device that is allowed to access according to the currently available virtual external storage device information, and send the storage device access request to the physical storage device.
本发明实施例还提供一种终端,包括:如上述实施例所述的虚拟外置存储设备的管理装置。The embodiment of the invention further provides a terminal, comprising: a management device of the virtual external storage device as described in the foregoing embodiment.
本发明实施例还提供一种存储介质,所述存储介质包括存储的程序,其中,所述程序运行时执行上述任一项所述的方法。The embodiment of the present invention further provides a storage medium, where the storage medium includes a stored program, wherein the program is executed to perform the method described in any one of the above.
本发明实施例还提供一种处理器,所述处理器用于运行程序,其中,所述程序运行时执行上述任一项所述的方法。An embodiment of the present invention further provides a processor, where the processor is configured to run a program, where the program is executed to perform the method described in any one of the above.
本发明的上述技术方案的有益效果如下: The beneficial effects of the above technical solution of the present invention are as follows:
本发明的上述方案中,通过在物理存储设备的状态发生变化时,对物理存储设备对应的虚拟外置存储设备进行基本处理操作后的路径信息的及时更新,便于对终端上的多个虚拟外置存储设备的统一管理,使得用户可访问多个虚拟外置存储设备,提升用户体验。In the above solution of the present invention, when the state of the physical storage device changes, the path information after the basic processing operation is performed on the virtual external storage device corresponding to the physical storage device, so as to facilitate multiple virtual external operations on the terminal. Unified management of storage devices enables users to access multiple virtual external storage devices to enhance the user experience.
附图说明DRAWINGS
图1为本发明实施例的虚拟外置存储设备的管理方法的基本步骤示意图;1 is a schematic diagram of basic steps of a method for managing a virtual external storage device according to an embodiment of the present invention;
图2为本发明实施例的虚拟外置存储设备的管理装置的组成结构示意图;2 is a schematic structural diagram of a management apparatus of a virtual external storage device according to an embodiment of the present invention;
图3为本发明实施例的包括虚拟外置存储设备的管理装置的终端的系统框架图。3 is a system frame diagram of a terminal of a management device including a virtual external storage device according to an embodiment of the present invention.
具体实施方式detailed description
为使本发明要解决的技术问题、技术方案和优点更加清楚,下面将结合附图及具体实施例进行详细描述。The technical problems, the technical solutions, and the advantages of the present invention will be more clearly described in the following description.
本发明针对现有技术移动终端系统的虚拟外置存储设备无法同时被访问的问题,提供一种虚拟外置存储设备的管理方法,便于对终端上的多个虚拟外置存储设备的统一管理,使得用户可访问多个虚拟外置存储设备,提升用户体验。The present invention is directed to the problem that the virtual external storage device of the prior art mobile terminal system cannot be accessed at the same time, and provides a method for managing the virtual external storage device, which facilitates unified management of multiple virtual external storage devices on the terminal. This allows users to access multiple virtual external storage devices to enhance the user experience.
第一实施例First embodiment
如图1所示,本发明实施例提供一种虚拟外置存储设备的管理方法,包括:As shown in FIG. 1 , an embodiment of the present invention provides a method for managing a virtual external storage device, including:
步骤11,监听物理存储设备的状态变化;Step 11: Monitor a state change of the physical storage device.
需要说明的是,物理存储设备包括:物理外置存储设备和物理内置存储设备。例如,物理外置存储设备可以是SD卡等,物理内置存储设备可以是焊接在终端主板上的内置存储器等。 It should be noted that the physical storage device includes: a physical external storage device and a physical internal storage device. For example, the physical external storage device may be an SD card or the like, and the physical internal storage device may be a built-in memory soldered on the terminal motherboard or the like.
步骤12,根据所述物理存储设备的状态变化,对所述物理存储设备对应的虚拟外置存储设备进行文件系统的基本处理操作;Step 12: Perform basic processing operations on the file system on the virtual external storage device corresponding to the physical storage device according to the state change of the physical storage device.
这里,文件系统的基本处理操作包括:挂载操作或卸载操作。Here, the basic processing operations of the file system include: a mount operation or an unload operation.
这里,挂载是指将一个存储设备挂载到一个已存在的目录上。Here, mounting refers to mounting a storage device to an existing directory.
步骤13,更新所述虚拟外置存储设备在完成所述基本处理操作后的路径信息,得到当前可用的虚拟外置存储设备信息;Step 13: Update path information of the virtual external storage device after completing the basic processing operation, to obtain currently available virtual external storage device information;
需要说明的是,虚拟外置存储设备的路径信息是指虚拟外置存储设备的挂载目录,也就是挂载路径,也就是,虚拟外置存储设备的挂载点信息。用户通过路径信息可以访问到虚拟外置存储设备中的内容。It should be noted that the path information of the virtual external storage device refers to the mount directory of the virtual external storage device, that is, the mount path, that is, the mount point information of the virtual external storage device. The user can access the content in the virtual external storage device through the path information.
步骤14,在接收到存储设备访问请求时,根据所述当前可用的虚拟外置存储设备信息,确认允许访问的物理存储设备,向所述物理存储设备发送所述存储设备访问请求。Step 14: Upon receiving the storage device access request, confirm the physical storage device that is allowed to access according to the currently available virtual external storage device information, and send the storage device access request to the physical storage device.
这里需要说明的是,存储设备访问请求可以是用户通过应用程序发起的,也可以是,终端的操作系统本身发起的。该存储设备访问请求一般是对虚拟外置存储设备的访问请求。It should be noted that the storage device access request may be initiated by the user through the application, or may be initiated by the operating system itself of the terminal. The storage device access request is typically an access request to a virtual external storage device.
需要说明的是,存储设备访问请求可以包括:文件的读写、删除、拷贝、新建等请求。例如,终端的相机应用将拍照完成的图像文件请求添加,也就是写入至虚拟外置存储设备。It should be noted that the storage device access request may include: a request for reading, writing, deleting, copying, and creating a file. For example, the camera application of the terminal adds the image file request for the photo completion, that is, to the virtual external storage device.
本发明实施例提供的虚拟外置存储设备的管理方法,通过在物理存储设备的状态发生变化时,对物理存储设备对应的虚拟外置存储设备进行基本处理操作后的路径信息的及时更新,便于对终端上的多个虚拟外置存储设备的统一管理,使得用户可访问多个虚拟外置存储设备,提升用户体验。The method for managing the virtual external storage device provided by the embodiment of the present invention is to update the path information after the basic processing operation of the virtual external storage device corresponding to the physical storage device in a timely manner when the state of the physical storage device changes. Uniform management of multiple virtual external storage devices on the terminal enables users to access multiple virtual external storage devices to enhance the user experience.
优选地,本发明实施例的虚拟外置存储设备的管理方法还可进一步包括:Preferably, the management method of the virtual external storage device in the embodiment of the present invention may further include:
监听用户发起的对所述物理存储设备的格式化请求;Monitoring a user-initiated formatting request for the physical storage device;
需要说明的是,终端在监听物理存储设备的状态变化的同时,还可监听用户通过用于存储设备管理的应用程序发起的将物理外置存储设备格 式化为内置存储设备的格式化请求。It should be noted that, while listening to the state change of the physical storage device, the terminal may also monitor the physical external storage device that is initiated by the user through the application for storage device management. Formatted as a formatted request for a built-in storage device.
根据所述格式化请求对所述物理存储设备进行对应的格式化处理。Corresponding formatting processing is performed on the physical storage device according to the formatting request.
这里,终端还可监听到物理存储设备的分区变化。物理外置存储设备的分区可以将安装至终端上的物理外置存储设备划分为用于存储不同类型文件系统的存储区域空间。Here, the terminal can also listen to the partition change of the physical storage device. A partition of a physical external storage device may divide a physical external storage device mounted to the terminal into a storage area space for storing different types of file systems.
需要说明的是,物理存储设备的状态变化可以包括:物理内置存储设备被创建为第一虚拟外置存储设备、物理外置存储设备的添加以及物理外置存储设备的移除三种情况。下面分别具体说明这三种情况的执行步骤流程。It should be noted that the state change of the physical storage device may include: the physical internal storage device is created as the first virtual external storage device, the addition of the physical external storage device, and the removal of the physical external storage device. The flow of the execution steps of these three cases will be specifically described below.
也就是说,具体地,在物理内置存储设备被创建为第一虚拟外置存储设备时,本发明实施例的步骤12可具体包括:That is, in particular, when the physical internal storage device is created as the first virtual external storage device, step 12 of the embodiment of the present invention may specifically include:
当监听到物理内置存储设备被创建为第一虚拟外置存储设备时,将所述第一虚拟外置存储设备挂载至第一预设挂载点。When the physical internal storage device is detected as being created as the first virtual external storage device, the first virtual external storage device is mounted to the first preset mount point.
需要说明的是,终端系统初始化时,会在预设目录下新建一个虚拟外置存储设备,之后通过预设服务进程挂载到系统配置的外置存储设备挂载点上。It should be noted that when the terminal system is initialized, a virtual external storage device is created in the preset directory, and then mounted to the external storage device mount point configured by the system through the preset service process.
例如,终端的操作系统为安卓M系统,在系统初始化的过程中,会在共享数据分区的多媒体目录下新建一个emulated类型的外置存储设备,通过FUSE服务进程挂载到系统配置的外置存储设备挂载点上。For example, the operating system of the terminal is an Android M system. During the system initialization process, an external storage device of the emulated type is created in the multimedia directory of the shared data partition, and is mounted to the external storage configured by the system through the FUSE service process. The device is mounted on the point.
此时,本发明实施例的步骤13可具体包括:At this time, step 13 of the embodiment of the present invention may specifically include:
添加所述第一虚拟外置存储设备在完成挂载操作后的路径信息,得到当前可用的虚拟外置存储设备信息。Adding the path information of the first virtual external storage device after the mounting operation is completed, and obtaining the currently available virtual external storage device information.
需要说明的是,当前可用的虚拟外置存储设备信息可以以列表的形式存储记录。It should be noted that the currently available virtual external storage device information may store the records in the form of a list.
具体地,在物理外置存储设备添加时,本发明实施例的步骤12还可具体包括:Specifically, when the physical external storage device is added, the step 12 of the embodiment of the present invention may further include:
当监听到物理外置存储设备的添加时,将所述物理外置存储设备对应 的虚拟外置存储设备挂载至第二预设挂载点。When the physical external storage device is added, the physical external storage device is correspondingly The virtual external storage device is mounted to the second preset mount point.
这里,监听到物理外置存储设备的添加,也就是终端监听到有物理外置存储设备,如SD卡,插入至终端上。Here, the addition of the physical external storage device is monitored, that is, the terminal listens to a physical external storage device, such as an SD card, and inserts it onto the terminal.
需要说明的是,当监听到物理外置存储设备的添加,且该物理外置存储设备支持被创建为虚拟外置存储设备时,对该物理存储设备对应的虚拟外置存储设备进行挂载。It should be noted that when the physical external storage device is added and the physical external storage device is created as a virtual external storage device, the virtual external storage device corresponding to the physical storage device is mounted.
此时,本发明实施例的步骤13还可具体包括:At this time, step 13 of the embodiment of the present invention may further include:
添加所述虚拟外置存储设备在完成挂载操作后的路径信息,得到当前可用的虚拟外置存储设备信息。Adding the path information of the virtual external storage device after the mounting operation is completed, and obtaining the currently available virtual external storage device information.
具体地,在物理外置存储设备被移除时,本发明实施例的步骤12还可具体包括:Specifically, when the physical external storage device is removed, step 12 of the embodiment of the present invention may further include:
当监听到物理外置存储设备的移除时,将所述物理外置存储设备对应的虚拟外置存储设备卸载。When the removal of the physical external storage device is detected, the virtual external storage device corresponding to the physical external storage device is uninstalled.
需要说明的是,监听到物理外置存储设备的移除,也就是,终端监听到有安装在终端上的物理外置存储设备,如SD卡,从该终端被拔出。It should be noted that the physical external storage device is monitored for removal, that is, the terminal monitors a physical external storage device, such as an SD card, installed on the terminal, and is extracted from the terminal.
此时,本发明实施例的步骤13还可具体包括:At this time, step 13 of the embodiment of the present invention may further include:
删除所述虚拟外置存储设备对应的路径信息,得到当前可用的虚拟外置存储设备信息。The path information corresponding to the virtual external storage device is deleted, and the currently available virtual external storage device information is obtained.
优选地,本发明实施例中所述步骤14还可进一步包括:Preferably, the step 14 in the embodiment of the present invention may further include:
在接收到存储设备访问请求时,查询所述当前可用的虚拟外置存储设备信息,获取当前用户存储设备访问策略;When the storage device access request is received, querying the currently available virtual external storage device information to obtain a current user storage device access policy;
这里需要说明的是,存储设备访问请求可以是用户通过应用程序发起的,也可以是,终端的操作系统本身发起的。该存储设备访问请求一般是对虚拟外置存储设备的访问请求。It should be noted that the storage device access request may be initiated by the user through the application, or may be initiated by the operating system itself of the terminal. The storage device access request is typically an access request to a virtual external storage device.
这里需要说明的是,当前可用的虚拟外置存储设备信息可以包括:虚拟外置存储设备的数量、虚拟外置存储设备的容量、以及虚拟外置存储设备的路径信息等。 It should be noted that the currently available virtual external storage device information may include: the number of virtual external storage devices, the capacity of the virtual external storage device, and the path information of the virtual external storage device.
这里,虚拟外置存储设备的容量具体可包括虚拟外置存储设备的剩余容量,当然还可包括虚拟外置存储设备的总容量或已使用容量。Here, the capacity of the virtual external storage device may specifically include the remaining capacity of the virtual external storage device, and may of course include the total capacity or the used capacity of the virtual external storage device.
路径信息可以包括虚拟外置存储设备的虚拟路径信息以及实际物理路径信息。这里的虚拟路径信息,也就是虚拟外置存储设备的挂载点信息。The path information may include virtual path information of the virtual external storage device and actual physical path information. The virtual path information here is the mount point information of the virtual external storage device.
需要说明的是,当前可用的虚拟外置存储设备信息可以在用于用户存储设置的应用程序上以图像界面的形式显示给用户,供用户查看,以及设置当前用户存储设备访问策略。It should be noted that the currently available virtual external storage device information may be displayed to the user in the form of an image interface on the application for the user storage setting for the user to view, and set the current user storage device access policy.
根据所述当前用户存储设备访问策略,将所述存储设备访问请求的虚拟访问路径转换为实际物理路径;Converting the virtual access path of the storage device access request into an actual physical path according to the current user storage device access policy;
这里,当前用户存储设备访问策略主要是设置用户存储设备访问优先级,也就是,在接收到存储设备访问请求时,可根据当前用户存储设备访问策略确定在多个虚拟外置存储设备中优先访问的虚拟外置存储设备。Here, the current user storage device access policy is mainly to set the user storage device access priority, that is, when receiving the storage device access request, the priority access among the plurality of virtual external storage devices may be determined according to the current user storage device access policy. Virtual external storage device.
这里,当前用户存储设备访问策略包括有虚拟外置存储设备的元数据信息,也就是虚拟外置存储设备对应的物理存储设备的实际物理路径。Here, the current user storage device access policy includes metadata information of the virtual external storage device, that is, the actual physical path of the physical storage device corresponding to the virtual external storage device.
向所述实际物理路径对应的物理存储设备发送所述存储设备访问请求。Sending the storage device access request to a physical storage device corresponding to the actual physical path.
这里,本发明实施例的存储设备访问请求为写入请求,也就是,请求写入数据到存储设备。Here, the storage device access request of the embodiment of the present invention is a write request, that is, requesting to write data to the storage device.
当然,存储设备访问请求还可以是读取请求,也就是,请求从要访问的存储设备中读取数据。需说明的是,当存储设备访问请求为读取请求时,根据当前记录的虚拟外置存储设备的元数据信息,获取读取请求对应的物理存储设备,向该物理存储设备发送该读取请求。Of course, the storage device access request can also be a read request, that is, requesting to read data from the storage device to be accessed. It should be noted that, when the storage device access request is a read request, the physical storage device corresponding to the read request is obtained according to the metadata information of the currently recorded virtual external storage device, and the read request is sent to the physical storage device. .
优选地,本发明实施例的虚拟外置存储设备的管理方法还可进一步包括:Preferably, the management method of the virtual external storage device in the embodiment of the present invention may further include:
接收用户发起的存储设备查询请求;Receiving a storage device query request initiated by the user;
这里需要说明的是,终端可接收用户通过在用于用户存储设置的应用程序提供的供用户查看当前可用的虚拟外置存储设备列表的图形界面上 发起的存储设备查询请求。It should be noted here that the terminal can receive a graphical interface provided by the user through the application for the user storage setting for the user to view the currently available virtual external storage device list. Initiated storage device query request.
向所述用户返回当前可用的虚拟外置存储设备信息。Returning the currently available virtual external storage device information to the user.
本发明实施例提供的虚拟外置存储设备的管理方法,通过在物理存储设备的状态发生变化时,对物理存储设备对应的虚拟外置存储设备进行基本处理操作后的路径信息的及时更新,便于对终端上的多个虚拟外置存储设备的统一管理,使得用户可访问多个虚拟外置存储设备,提升用户体验。The method for managing the virtual external storage device provided by the embodiment of the present invention is to update the path information after the basic processing operation of the virtual external storage device corresponding to the physical storage device in a timely manner when the state of the physical storage device changes. Uniform management of multiple virtual external storage devices on the terminal enables users to access multiple virtual external storage devices to enhance the user experience.
第二实施例Second embodiment
如图2所示,本发明实施例提供一种虚拟外置存储设备的管理装置,包括:As shown in FIG. 2, an embodiment of the present invention provides a management device for a virtual external storage device, including:
第一监听模块21,设置为监听物理存储设备的状态变化;The first monitoring module 21 is configured to monitor a state change of the physical storage device;
需要说明的是,物理存储设备包括:物理外置存储设备和物理内置存储设备。例如,物理外置存储设备可以是SD卡等,物理内置存储设备可以是焊接在终端主板上的内置存储器等。It should be noted that the physical storage device includes: a physical external storage device and a physical internal storage device. For example, the physical external storage device may be an SD card or the like, and the physical internal storage device may be a built-in memory soldered on the terminal motherboard or the like.
执行处理模块22,设置为根据所述物理存储设备的状态变化,对所述物理存储设备对应的虚拟外置存储设备进行文件系统的基本处理操作;The execution processing module 22 is configured to perform a basic processing operation of the file system on the virtual external storage device corresponding to the physical storage device according to the state change of the physical storage device;
这里,文件系统的基本处理操作包括:挂载操作或卸载操作。Here, the basic processing operations of the file system include: a mount operation or an unload operation.
这里,挂载是指将一个存储设备挂载到一个已存在的目录上。Here, mounting refers to mounting a storage device to an existing directory.
信息更新模块23,设置为更新所述虚拟外置存储设备在完成所述基本处理操作后的路径信息,得到当前可用的虚拟外置存储设备信息;The information update module 23 is configured to update path information of the virtual external storage device after completing the basic processing operation, to obtain currently available virtual external storage device information;
需要说明的是,虚拟外置存储设备的路径信息是指虚拟外置存储设备的挂载目录,也就是挂载路径,也就是,虚拟外置存储设备的挂载点信息。用户通过路径信息可以访问到虚拟外置存储设备中的内容。It should be noted that the path information of the virtual external storage device refers to the mount directory of the virtual external storage device, that is, the mount path, that is, the mount point information of the virtual external storage device. The user can access the content in the virtual external storage device through the path information.
访问模块24,设置为在接收到存储设备访问请求时,根据所述当前可用的虚拟外置存储设备信息,确认允许访问的物理存储设备,向所述物理存储设备发送所述存储设备访问请求。The access module 24 is configured to, when receiving the storage device access request, confirm the physical storage device that is allowed to access according to the currently available virtual external storage device information, and send the storage device access request to the physical storage device.
这里需要说明的是,存储设备访问请求可以是用户通过应用程序发起的,也可以是,终端的操作系统本身发起的。该存储设备访问请求一般是 对虚拟外置存储设备的访问请求。It should be noted that the storage device access request may be initiated by the user through the application, or may be initiated by the operating system itself of the terminal. The storage device access request is generally An access request to a virtual external storage device.
需要说明的是,存储设备访问请求可以包括:文件的读写、删除、拷贝、新建等请求。例如,终端的相机应用将拍照完成的图像文件请求添加,也就是写入至虚拟外置存储设备。It should be noted that the storage device access request may include: a request for reading, writing, deleting, copying, and creating a file. For example, the camera application of the terminal adds the image file request for the photo completion, that is, to the virtual external storage device.
具体地,本发明实施例的虚拟外置存储设备的管理装置还可具体包括:Specifically, the management device of the virtual external storage device in the embodiment of the present invention may further include:
第二监听模块,设置为监听用户发起的对所述物理存储设备的格式化请求;a second listening module, configured to monitor a user-initiated formatting request for the physical storage device;
需要说明的是,终端在监听物理存储设备的状态变化的同时,还可监听用户通过用于存储设备管理的应用程序发起的将物理外置存储设备格式化为内置存储设备的格式化请求。It should be noted that, while listening to the state change of the physical storage device, the terminal may also monitor a formatting request initiated by the user for formatting the physical external storage device as the built-in storage device by the application for storage device management.
格式化处理模块,设置为根据所述格式化请求对所述物理存储设备进行对应的格式化处理。The formatting processing module is configured to perform a corresponding formatting process on the physical storage device according to the formatting request.
这里,第二监听模块还可监听到物理存储设备的分区变化。物理外置存储设备的分区可以将安装至终端上的物理外置存储设备划分为用于存储不同类型文件系统的存储区域空间。Here, the second listening module can also monitor the partition change of the physical storage device. A partition of a physical external storage device may divide a physical external storage device mounted to the terminal into a storage area space for storing different types of file systems.
需要说明的是,物理存储设备的状态变化可以包括:物理内置存储设备被创建为第一虚拟外置存储设备、物理外置存储设备的添加以及物理外置存储设备的移除三种情况。It should be noted that the state change of the physical storage device may include: the physical internal storage device is created as the first virtual external storage device, the addition of the physical external storage device, and the removal of the physical external storage device.
也就是说,具体地,所述执行处理模块22可具体包括:In other words, the execution processing module 22 may specifically include:
第一执行处理单元,设置为监听到物理内置存储设备被创建为第一虚拟外置存储设备时,将所述第一虚拟外置存储设备挂载至第一预设挂载点。The first execution processing unit is configured to: when the physical internal storage device is configured to be the first virtual external storage device, mount the first virtual external storage device to the first preset mount point.
需要说明的是,终端系统初始化时,第一执行处理单元会在预设目录下新建一个虚拟外置存储设备,之后通过预设服务进程挂载到系统配置的外置存储设备挂载点上。It should be noted that, when the terminal system is initialized, the first execution processing unit creates a virtual external storage device in the preset directory, and then mounts it to the external storage device mount point configured by the system through the preset service process.
例如,终端的操作系统为安卓M系统,在系统初始化的过程中,第一执行处理单元会在共享数据分区的多媒体目录下新建一个emulated类型的外置存储设备,通过FUSE服务进程挂载到系统配置的外置存储设备 挂载点上。For example, the operating system of the terminal is an Android M system. During the system initialization process, the first execution processing unit creates an external storage device of the emulated type in the multimedia directory of the shared data partition, and mounts the system through the FUSE service process. Configured external storage device Mount point.
此时,本发明实施例的信息更新模块23可具体对应包括:At this time, the information update module 23 of the embodiment of the present invention may specifically include:
第一信息更新单元,设置为添加所述第一虚拟外置存储设备在完成挂载操作后的路径信息,得到当前可用的虚拟外置存储设备信息。The first information updating unit is configured to add the path information of the first virtual external storage device after the mounting operation is completed, and obtain the currently available virtual external storage device information.
需要说明的是,当前可用的虚拟外置存储设备信息可以以列表的形式存储记录。It should be noted that the currently available virtual external storage device information may store the records in the form of a list.
具体地,所述执行处理模块22还可具体包括:Specifically, the execution processing module 22 may further include:
第二执行处理单元,设置为当监听到物理外置存储设备的添加时,将所述物理外置存储设备对应的虚拟外置存储设备挂载至第二预设挂载点。The second execution processing unit is configured to mount the virtual external storage device corresponding to the physical external storage device to the second preset mount point when the addition of the physical external storage device is monitored.
这里,监听到物理外置存储设备的添加,也就是终端监听到有物理外置存储设备,如SD卡,插入至终端上。Here, the addition of the physical external storage device is monitored, that is, the terminal listens to a physical external storage device, such as an SD card, and inserts it onto the terminal.
需要说明的是,当监听到物理外置存储设备的添加,且该物理外置存储设备支持被创建为虚拟外置存储设备时,对该物理存储设备对应的虚拟外置存储设备进行挂载。It should be noted that when the physical external storage device is added and the physical external storage device is created as a virtual external storage device, the virtual external storage device corresponding to the physical storage device is mounted.
此时,本发明实施例的信息更新模块23可具体对应包括:At this time, the information update module 23 of the embodiment of the present invention may specifically include:
第二信息更新单元,设置为添加所述虚拟外置存储设备在完成挂载操作后的路径信息,得到当前可用的虚拟外置存储设备信息。The second information updating unit is configured to add the path information of the virtual external storage device after the mounting operation is completed, and obtain the currently available virtual external storage device information.
具体地,所述执行处理模块22还可具体包括:Specifically, the execution processing module 22 may further include:
第三执行处理单元,设置为当监听到物理外置存储设备的移除时,将所述物理外置存储设备对应的虚拟外置存储设备卸载。The third execution processing unit is configured to uninstall the virtual external storage device corresponding to the physical external storage device when the physical external storage device is removed.
需要说明的是,监听到物理外置存储设备的移除,也就是,终端监听到有安装在终端上的物理外置存储设备,如SD卡,从该终端被拔出。It should be noted that the physical external storage device is monitored for removal, that is, the terminal monitors a physical external storage device, such as an SD card, installed on the terminal, and is extracted from the terminal.
此时,本发明实施例的信息更新模块23可具体对应包括:At this time, the information update module 23 of the embodiment of the present invention may specifically include:
第三信息更新单元,设置为删除所述虚拟外置存储设备对应的路径信息,得到当前可用的虚拟外置存储设备信息。The third information update unit is configured to delete the path information corresponding to the virtual external storage device, and obtain the currently available virtual external storage device information.
具体地,本发明实施例的访问模块24还可具体包括:Specifically, the access module 24 of the embodiment of the present invention may further include:
查询单元,设置为在接收到存储设备访问请求时,查询所述当前可用 的虚拟外置存储设备信息,获取当前用户存储设备访问策略;Query unit, configured to query the currently available when a storage device access request is received Virtual external storage device information, obtaining a current user storage device access policy;
这里需要说明的是,存储设备访问请求可以是用户通过应用程序发起的,也可以是,终端的操作系统本身发起的。该存储设备访问请求一般是对虚拟外置存储设备的访问请求。It should be noted that the storage device access request may be initiated by the user through the application, or may be initiated by the operating system itself of the terminal. The storage device access request is typically an access request to a virtual external storage device.
这里需要说明的是,当前可用的虚拟外置存储设备信息可以包括:虚拟外置存储设备的数量、虚拟外置存储设备的容量、以及虚拟外置存储设备的路径信息等。It should be noted that the currently available virtual external storage device information may include: the number of virtual external storage devices, the capacity of the virtual external storage device, and the path information of the virtual external storage device.
这里,虚拟外置存储设备的容量具体可包括虚拟外置存储设备的剩余容量,当然还可包括虚拟外置存储设备的总容量或已使用容量。Here, the capacity of the virtual external storage device may specifically include the remaining capacity of the virtual external storage device, and may of course include the total capacity or the used capacity of the virtual external storage device.
路径信息可以包括虚拟外置存储设备的虚拟路径信息以及实际物理路径信息。这里的虚拟路径信息,也就是虚拟外置存储设备的挂载点信息。The path information may include virtual path information of the virtual external storage device and actual physical path information. The virtual path information here is the mount point information of the virtual external storage device.
需要说明的是,当前可用的虚拟外置存储设备信息可以在用于用户存储设置的应用程序上以图像界面的形式显示给用户,供用户查看,以及设置当前用户存储设备访问策略。It should be noted that the currently available virtual external storage device information may be displayed to the user in the form of an image interface on the application for the user storage setting for the user to view, and set the current user storage device access policy.
路径转换单元,设置为根据所述当前用户存储设备访问策略,将所述存储设备访问请求的虚拟访问路径转换为实际物理路径;a path conversion unit, configured to convert the virtual access path of the storage device access request into an actual physical path according to the current user storage device access policy;
这里,当前用户存储设备访问策略主要是设置用户存储设备访问优先级,也就是,在接收到存储设备访问请求时,可根据当前用户存储设备访问策略确定在多个虚拟外置存储设备中优先访问的虚拟外置存储设备。Here, the current user storage device access policy is mainly to set the user storage device access priority, that is, when receiving the storage device access request, the priority access among the plurality of virtual external storage devices may be determined according to the current user storage device access policy. Virtual external storage device.
这里,当前用户存储设备访问策略包括有虚拟外置存储设备的元数据信息,也就是虚拟外置存储设备对应的物理存储设备的实际物理路径。Here, the current user storage device access policy includes metadata information of the virtual external storage device, that is, the actual physical path of the physical storage device corresponding to the virtual external storage device.
访问单元,设置为向所述实际物理路径对应的物理存储设备发送所述存储设备访问请求。The access unit is configured to send the storage device access request to a physical storage device corresponding to the actual physical path.
这里,本发明实施例的存储设备访问请求为写入请求,也就是,请求写入数据到存储设备。Here, the storage device access request of the embodiment of the present invention is a write request, that is, requesting to write data to the storage device.
当然,存储设备访问请求还可以是读取请求,也就是,请求从要访问的存储设备中读取数据。需说明的是,当存储设备访问请求为读取请求时, 根据当前记录的虚拟外置存储设备的元数据信息,获取读取请求对应的物理存储设备,向该物理存储设备发送该读取请求。Of course, the storage device access request can also be a read request, that is, requesting to read data from the storage device to be accessed. It should be noted that when the storage device access request is a read request, The physical storage device corresponding to the read request is obtained according to the metadata information of the currently recorded virtual external storage device, and the read request is sent to the physical storage device.
优选地,本发明实施例的虚拟外置存储设备的装置还可具体包括:Preferably, the device of the virtual external storage device of the embodiment of the present invention may further include:
接收模块,接收用户发起的存储设备查询请求;Receiving a module, receiving a storage device query request initiated by the user;
这里需要说明的是,终端可接收用户通过在用于用户存储设置的应用程序提供的供用户查看当前可用的虚拟外置存储设备列表的图形界面上发起的存储设备查询请求。It should be noted here that the terminal can receive a storage device query request initiated by the user through a graphical interface provided by the application for the user storage setting for the user to view the currently available virtual external storage device list.
信息返回模块,向所述用户返回当前可用的虚拟外置存储设备信息。The information return module returns the currently available virtual external storage device information to the user.
本发明实施例还提供一种终端,包括如上述实施例所述的虚拟外置存储设备的管理装置。The embodiment of the invention further provides a terminal, comprising the management device of the virtual external storage device as described in the above embodiments.
如图3所示,为本发明实施例的包括虚拟外置存储设备的管理装置的终端的系统框架图。As shown in FIG. 3, it is a system framework diagram of a terminal of a management device including a virtual external storage device according to an embodiment of the present invention.
下面就该图简单说明一下该终端的系统框架图中组成虚拟外置存储设备的管理装置的模块的连接关系。The following is a brief description of the connection relationship of the modules constituting the management device of the virtual external storage device in the system frame diagram of the terminal.
虚拟外置存储设备的管理装置包括:监听模块、访问模块、执行处理模块、信息更新模块以及用于显示用户存储设置情况的应用程序(图中未显示)。The management device of the virtual external storage device includes: a listening module, an access module, an execution processing module, an information update module, and an application (not shown) for displaying a user storage setting.
其中,信息更新模块分别连接访问模块和执行处理模块,监听模块与执行处理模块连接。The information update module is respectively connected to the access module and the execution processing module, and the monitoring module is connected to the execution processing module.
需要说明的是,信息更新模块中以列表形式存储有当前可用的存储设备,也就是,信息更新模块中包括有存储设备列表。It should be noted that the information update module stores the currently available storage device in a list form, that is, the information update module includes a storage device list.
这里,监听模块包括第二实施例中所述的第一监听模块和第二监听模块,也就是说,该监听模块同时具有第一监听模块和第二监听模块的功能。Here, the listening module includes the first listening module and the second listening module described in the second embodiment, that is, the listening module has the functions of the first listening module and the second listening module at the same time.
当监听模块监听到物理外置存储设备的状态变化时,将物理外置存储设备的状态变化以通知消息的形式通知给执行处理模块,执行处理模块根据物理外置存储设备的状态变化进行文件系统的基本处理操作。When the monitoring module monitors the state change of the physical external storage device, the state change of the physical external storage device is notified to the execution processing module in the form of a notification message, and the execution processing module performs the file system according to the state change of the physical external storage device. The basic processing operations.
例如,执行处理模块解析监听模块发来的通知消息,判断出其消息类 型为添加存储设备时,则挂载该存储设备。For example, the execution processing module parses the notification message sent by the listening module to determine its message class. When the storage device is added, the storage device is mounted.
之后,执行处理模块发送消息通知消息更新模块将该存储设备对应的虚拟外置存储设备路径加入到当前的存储设备列表中。Then, the execution processing module sends a message notification message update module to add the virtual external storage device path corresponding to the storage device to the current storage device list.
下面就该图具体说明用户通过应用程序发起存储设备访问请求的实施过程。The following is a detailed description of the implementation process of the user initiating a storage device access request through the application.
首先,用户通过应用程序APP向访问模块发起存储设备访问请求;First, the user initiates a storage device access request to the access module through the application APP;
需要说明的是,该存储设备访问请求经函数库Libc,通过FUSE服务进程传送至访问模块。It should be noted that the storage device access request is transmitted to the access module through the FUSE service process via the function library Libc.
接着,消息更新模块根据存储设备访问请求查询存储设备列表,获得当前用户存储设备访问策略;Then, the message update module queries the storage device list according to the storage device access request to obtain the current user storage device access policy.
之后,访问模块根据当前用户存储设备访问策略将存储设备访问请求的虚拟访问路径转换为实际物理路径,并向所述实际物理路径对应的物理存储设备发送所述存储设备访问请求;Afterwards, the access module converts the virtual access path of the storage device access request into an actual physical path according to the current user storage device access policy, and sends the storage device access request to the physical storage device corresponding to the actual physical path;
这里需要说明的是,存储设备访问请求按照实际物理路径通过日志文件系统EXT4经存储设备驱动传送至实际物理路径对应的物理存储设备。It should be noted that the storage device access request is transmitted to the physical storage device corresponding to the actual physical path through the storage device driver through the log file system EXT4 according to the actual physical path.
最后,物理存储设备对用户发起的存储设备访问请求进行响应处理,并返回响应结果给所述用户。Finally, the physical storage device responds to the user-initiated storage device access request and returns a response result to the user.
例如,用户通过应用程序发起的存储设备访问请求为存储,也就是写入图像文件,则物理存储设备根据存储设备访问请求对图像文件进行存储,若成功存储,则将存储成功的结果返回给用户;若存储失败,则将存储失败的结果返回给用户。For example, if the storage device access request initiated by the application is stored, that is, the image file is written, the physical storage device stores the image file according to the storage device access request, and if the storage is successful, the storage success result is returned to the user. If the storage fails, the result of the storage failure is returned to the user.
本发明实施例提供的虚拟外置存储设备的装置,通过第一监听模块在物理存储设备的状态发生变化时,执行处理模块对物理存储设备对应的虚拟外置存储设备进行基本处理操作后,信息更新模块对虚拟外置存储设备的路径信息的及时更新,便于对终端上的多个虚拟外置存储设备的统一管理,使得用户可通过访问模块访问多个虚拟外置存储设备,提升用户体验。The device of the virtual external storage device provided by the embodiment of the present invention performs the basic processing operation after the processing module performs the basic processing operation on the virtual external storage device corresponding to the physical storage device when the state of the physical storage device changes. The update module updates the path information of the virtual external storage device in time to facilitate unified management of multiple virtual external storage devices on the terminal, so that the user can access multiple virtual external storage devices through the access module to improve the user experience.
第三实施例 Third embodiment
本发明的实施例还提供了一种存储介质,该存储介质包括存储的程序,其中,上述程序运行时执行上述任一项所述的方法。Embodiments of the present invention also provide a storage medium including a stored program, wherein the program described above executes the method of any of the above.
可选地,在本实施例中,上述存储介质可以包括但不限于:U盘、只读存储器(Read-Only Memory,简称为ROM)、随机存取存储器(Random Access Memory,简称为RAM)、移动硬盘、磁碟或者光盘等各种可以存储程序代码的介质。Optionally, in the embodiment, the foregoing storage medium may include, but is not limited to, a USB flash drive, a Read-Only Memory (ROM), and a Random Access Memory (RAM). A variety of media that can store program code, such as a hard disk, a disk, or an optical disk.
本发明的实施例还提供了一种处理器,该处理器用于运行程序,其中,该程序运行时执行上述任一项方法中的步骤。Embodiments of the present invention also provide a processor for running a program, wherein the program is executed to perform the steps of any of the above methods.
可选地,本实施例中的具体示例可以参考上述实施例及可选实施方式中所描述的示例,本实施例在此不再赘述。For example, the specific examples in this embodiment may refer to the examples described in the foregoing embodiments and the optional embodiments, and details are not described herein again.
显然,本领域的技术人员应该明白,上述的本发明的各模块或各步骤可以用通用的计算装置来实现,它们可以集中在单个的计算装置上,或者分布在多个计算装置所组成的网络上,可选地,它们可以用计算装置可执行的程序代码来实现,从而,可以将它们存储在存储装置中由计算装置来执行,并且在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤,或者将它们分别制作成各个集成电路模块,或者将它们中的多个模块或步骤制作成单个集成电路模块来实现。这样,本发明不限制于任何特定的硬件和软件结合。It will be apparent to those skilled in the art that the various modules or steps of the present invention described above can be implemented by a general-purpose computing device that can be centralized on a single computing device or distributed across a network of multiple computing devices. Alternatively, they may be implemented by program code executable by the computing device such that they may be stored in the storage device by the computing device and, in some cases, may be different from the order herein. The steps shown or described are performed, or they are separately fabricated into individual integrated circuit modules, or a plurality of modules or steps thereof are fabricated as a single integrated circuit module. Thus, the invention is not limited to any specific combination of hardware and software.
以上所述仅为本发明的优选实施例而已,并不用于限制本发明,对于本领域的技术人员来说,本发明可以有各种更改和变化。凡在本发明的原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。The above description is only the preferred embodiment of the present invention, and is not intended to limit the present invention, and various modifications and changes can be made to the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the scope of the present invention are intended to be included within the scope of the present invention.
工业实用性Industrial applicability
基于本发明实施例提供的上述技术方案,通过在物理存储设备的状态发生变化时,对物理存储设备对应的虚拟外置存储设备进行基本处理操作后的路径信息的及时更新,便于对终端上的多个虚拟外置存储设备的统一管理,使得用户可访问多个虚拟外置存储设备,提升用户体验。 According to the foregoing technical solution provided by the embodiment of the present invention, when the state of the physical storage device changes, the path information of the virtual external storage device corresponding to the physical storage device is updated in time, which is convenient for the terminal. Unified management of multiple virtual external storage devices enables users to access multiple virtual external storage devices to enhance the user experience.

Claims (11)

  1. 一种虚拟外置存储设备的管理方法,A method for managing a virtual external storage device,
    监听物理存储设备的状态变化;Monitor the state change of the physical storage device;
    根据所述物理存储设备的状态变化,对所述物理存储设备对应的虚拟外置存储设备进行文件系统的基本处理操作;Performing a basic processing operation of the file system on the virtual external storage device corresponding to the physical storage device according to the state change of the physical storage device;
    更新所述虚拟外置存储设备在完成所述基本处理操作后的路径信息,得到当前可用的虚拟外置存储设备信息;Updating the path information of the virtual external storage device after completing the basic processing operation, to obtain currently available virtual external storage device information;
    在接收到存储设备访问请求时,根据所述当前可用的虚拟外置存储设备信息,确认允许访问的物理存储设备,向所述物理存储设备发送所述存储设备访问请求。Upon receiving the storage device access request, the physical storage device that is allowed to access is confirmed according to the currently available virtual external storage device information, and the storage device access request is sent to the physical storage device.
  2. 根据权利要求1所述的虚拟外置存储设备的管理方法,其中,所述方法还包括:The method for managing a virtual external storage device according to claim 1, wherein the method further comprises:
    监听用户发起的对所述物理存储设备的格式化请求;Monitoring a user-initiated formatting request for the physical storage device;
    根据所述格式化请求对所述物理存储设备进行对应的格式化处理。Corresponding formatting processing is performed on the physical storage device according to the formatting request.
  3. 根据权利要求1所述的虚拟外置存储设备的管理方法,其中,根据所述物理存储设备的状态变化,对所述物理存储设备对应的虚拟外置存储设备进行文件系统的基本处理操作的步骤包括:The method for managing a virtual external storage device according to claim 1, wherein the step of performing a basic processing operation of the file system on the virtual external storage device corresponding to the physical storage device according to the state change of the physical storage device include:
    当监听到物理内置存储设备被创建为第一虚拟外置存储设备时,将所述第一虚拟外置存储设备挂载至第一预设挂载点;When the physical internal storage device is configured to be the first virtual external storage device, the first virtual external storage device is mounted to the first preset mount point;
    所述更新所述虚拟外置存储设备在完成所述基本处理操作后的路径信息,得到当前可用的虚拟外置存储设备信息的步骤包括:The step of updating the path information of the virtual external storage device after the completion of the basic processing operation, and obtaining the currently available virtual external storage device information includes:
    添加所述第一虚拟外置存储设备在完成挂载操作后的路径信息,得到当前可用的虚拟外置存储设备信息。Adding the path information of the first virtual external storage device after the mounting operation is completed, and obtaining the currently available virtual external storage device information.
  4. 根据权利要求1所述的虚拟外置存储设备的管理方法,其中,根据所述物理存储设备的状态变化,对所述物理存储设备对应的虚拟外置存储设备进行文件系统的基本处理操作的步骤包括:The method for managing a virtual external storage device according to claim 1, wherein the step of performing a basic processing operation of the file system on the virtual external storage device corresponding to the physical storage device according to the state change of the physical storage device include:
    当监听到物理外置存储设备的添加时,将所述物理外置存储设备对应的虚拟外置存储设备挂载至第二预设挂载点; When the physical external storage device is added, the virtual external storage device corresponding to the physical external storage device is mounted to the second preset mount point;
    所述更新所述虚拟外置存储设备在完成所述基本处理操作后的路径信息,得到当前可用的虚拟外置存储设备信息的步骤包括:The step of updating the path information of the virtual external storage device after the completion of the basic processing operation, and obtaining the currently available virtual external storage device information includes:
    添加所述虚拟外置存储设备在完成挂载操作后的路径信息,得到当前可用的虚拟外置存储设备信息。Adding the path information of the virtual external storage device after the mounting operation is completed, and obtaining the currently available virtual external storage device information.
  5. 根据权利要求1所述的虚拟外置存储设备的管理方法,其中,根据所述物理存储设备的状态变化,对所述物理存储设备对应的虚拟外置存储设备进行文件系统的基本处理操作的步骤包括:The method for managing a virtual external storage device according to claim 1, wherein the step of performing a basic processing operation of the file system on the virtual external storage device corresponding to the physical storage device according to the state change of the physical storage device include:
    当监听到物理外置存储设备的移除时,将所述物理外置存储设备对应的虚拟外置存储设备卸载;When the physical external storage device is removed, the virtual external storage device corresponding to the physical external storage device is uninstalled;
    所述更新所述虚拟外置存储设备在完成所述基本处理操作后的路径信息,得到当前可用的虚拟外置存储设备信息的步骤包括:The step of updating the path information of the virtual external storage device after the completion of the basic processing operation, and obtaining the currently available virtual external storage device information includes:
    删除所述虚拟外置存储设备对应的路径信息,得到当前可用的虚拟外置存储设备信息。The path information corresponding to the virtual external storage device is deleted, and the currently available virtual external storage device information is obtained.
  6. 根据权利要求1所述的虚拟外置存储设备的管理方法,其中,在接收到存储设备访问请求时,根据所述当前可用的虚拟外置存储设备信息,确认允许访问的物理存储设备,向所述物理存储设备发送所述存储设备访问请求的步骤包括:The method for managing a virtual external storage device according to claim 1, wherein, when receiving the storage device access request, confirming the physical storage device that is allowed to access according to the currently available virtual external storage device information, The step of the physical storage device sending the storage device access request includes:
    在接收到存储设备访问请求时,查询所述当前可用的虚拟外置存储设备信息,获取当前用户存储设备访问策略;When the storage device access request is received, querying the currently available virtual external storage device information to obtain a current user storage device access policy;
    根据所述当前用户存储设备访问策略,将所述存储设备访问请求的虚拟访问路径转换为实际物理路径;Converting the virtual access path of the storage device access request into an actual physical path according to the current user storage device access policy;
    向所述实际物理路径对应的物理存储设备发送所述存储设备访问请求。Sending the storage device access request to a physical storage device corresponding to the actual physical path.
  7. 根据权利要求1所述的虚拟外置存储设备的管理方法,其中,所述方法还包括:The method for managing a virtual external storage device according to claim 1, wherein the method further comprises:
    接收用户发起的存储设备查询请求;Receiving a storage device query request initiated by the user;
    向所述用户返回当前可用的虚拟外置存储设备信息。 Returning the currently available virtual external storage device information to the user.
  8. 一种虚拟外置存储设备的管理装置,包括:A management device for a virtual external storage device, comprising:
    第一监听模块,设置为监听物理存储设备的状态变化;a first listening module configured to monitor a state change of the physical storage device;
    执行处理模块,设置为根据所述物理存储设备的状态变化,对所述物理存储设备对应的虚拟外置存储设备进行文件系统的基本处理操作;The processing module is configured to perform a basic processing operation of the file system on the virtual external storage device corresponding to the physical storage device according to the state change of the physical storage device;
    信息更新模块,设置为更新所述虚拟外置存储设备在完成所述基本处理操作后的路径信息,得到当前可用的虚拟外置存储设备信息;An information update module, configured to update path information of the virtual external storage device after completing the basic processing operation, to obtain currently available virtual external storage device information;
    访问模块,设置为在接收到存储设备访问请求时,根据所述当前可用的虚拟外置存储设备信息,确认允许访问的物理存储设备,向所述物理存储设备发送所述存储设备访问请求。The access module is configured to, when receiving the storage device access request, confirm the physical storage device that is allowed to access according to the currently available virtual external storage device information, and send the storage device access request to the physical storage device.
  9. 一种终端,包括:如权利要求8所述的虚拟外置存储设备的管理装置。A terminal comprising: the management device of the virtual external storage device according to claim 8.
  10. 一种存储介质,所述存储介质包括存储的程序,其中,所述程序运行时执行权利要求1至7中任一项所述的方法。A storage medium, the storage medium comprising a stored program, wherein the program is executed to perform the method of any one of claims 1 to 7.
  11. 一种处理器,所述处理器用于运行程序,其中,所述程序运行时执行权利要求1至7中任一项所述的方法。 A processor for running a program, wherein the program is executed to perform the method of any one of claims 1 to 7.
PCT/CN2017/090396 2016-08-09 2017-06-27 Method and apparatus for managing virtual external storage device, and terminal WO2018028321A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610647943.2A CN107704307A (en) 2016-08-09 2016-08-09 A kind of management method, device and the terminal of virtual external storage
CN201610647943.2 2016-08-09

Publications (1)

Publication Number Publication Date
WO2018028321A1 true WO2018028321A1 (en) 2018-02-15

Family

ID=61162662

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/090396 WO2018028321A1 (en) 2016-08-09 2017-06-27 Method and apparatus for managing virtual external storage device, and terminal

Country Status (2)

Country Link
CN (1) CN107704307A (en)
WO (1) WO2018028321A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113296758A (en) * 2021-03-15 2021-08-24 上海爱数信息技术股份有限公司 Front-end component library construction method and device and storage medium

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109213447A (en) * 2018-08-23 2019-01-15 郑州云海信息技术有限公司 A kind of SAN storage volume carry, discharging method and system

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101882058A (en) * 2010-05-26 2010-11-10 孟智平 Method for virtually dividing storage device into a plurality of devices
CN102541475A (en) * 2012-03-12 2012-07-04 成都市华为赛门铁克科技有限公司 Data storage method and data storage device
CN103686379A (en) * 2013-12-18 2014-03-26 青岛海信电器股份有限公司 Playing method and device for multi-media file, and television
CN104021047A (en) * 2014-03-05 2014-09-03 威盛电子股份有限公司 Virtual function distribution system, method and management host thereof
CN104699508A (en) * 2015-03-25 2015-06-10 南京大学 System and method for quickly arranging and updating virtual environment in cloud computing platform
CN104778222A (en) * 2015-03-23 2015-07-15 四川长虹电器股份有限公司 Media library establishing and updating method on basis of USB (Universal Serial Bus) storage equipment

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010079626A (en) * 2008-09-26 2010-04-08 Hitachi Ltd Load distribution method and system for computer system
CN104951243B (en) * 2014-03-28 2018-04-27 伊姆西公司 Storage extended method and device in virtual storage system

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101882058A (en) * 2010-05-26 2010-11-10 孟智平 Method for virtually dividing storage device into a plurality of devices
CN102541475A (en) * 2012-03-12 2012-07-04 成都市华为赛门铁克科技有限公司 Data storage method and data storage device
CN103686379A (en) * 2013-12-18 2014-03-26 青岛海信电器股份有限公司 Playing method and device for multi-media file, and television
CN104021047A (en) * 2014-03-05 2014-09-03 威盛电子股份有限公司 Virtual function distribution system, method and management host thereof
CN104778222A (en) * 2015-03-23 2015-07-15 四川长虹电器股份有限公司 Media library establishing and updating method on basis of USB (Universal Serial Bus) storage equipment
CN104699508A (en) * 2015-03-25 2015-06-10 南京大学 System and method for quickly arranging and updating virtual environment in cloud computing platform

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113296758A (en) * 2021-03-15 2021-08-24 上海爱数信息技术股份有限公司 Front-end component library construction method and device and storage medium
CN113296758B (en) * 2021-03-15 2022-11-25 上海爱数信息技术股份有限公司 Front-end component library construction method and device and storage medium

Also Published As

Publication number Publication date
CN107704307A (en) 2018-02-16

Similar Documents

Publication Publication Date Title
JP5496254B2 (en) Converting a machine to a virtual machine
US10185627B2 (en) Synchronized test master
CN102799464B (en) Virtual machine creation method and system, virtual machine reloading method and system
US10154112B1 (en) Cloud-to-cloud data migration via cache
CN107870968B (en) Performing real-time updates to a file system volume
JP6309969B2 (en) Application programming interface for data synchronization in online storage systems
US8433890B2 (en) Preparing and preserving a system configuration during a hot upgrade
CN101650660B (en) Booting a computer system from central storage
CN102402446A (en) Method and device for installing application software
TW201211800A (en) Migration of metadata and storage management of data in a first storage environment to a second storage environment
CN104182257B (en) The installation method of application software and the erecting device of application software
CN107797767A (en) One kind is based on container technique deployment distributed memory system and its storage method
US10346150B2 (en) Computerized system and method for patching an application by separating executables and working data using different images
WO2014190806A1 (en) Application backup and restore
US9436494B2 (en) Preserving an independent virtual disk
CN104216801A (en) Data copying method oriented to virtual environment and data copying system oriented to virtual environment
US9032402B2 (en) Managing an independent virtual disk
JP2011248658A (en) Virtual server deployment management apparatus and method, and program for the same
WO2018028321A1 (en) Method and apparatus for managing virtual external storage device, and terminal
US11080909B2 (en) Image layer processing method and computing device
CN112559127B (en) Virtual machine creation method, device, host and storage medium
US10372557B2 (en) Versioning and recovery of workloads
CN115562590A (en) Method, system, equipment and storage medium for using cloud hard disk by cloud host
CN111399753B (en) Method and device for writing pictures
US10102020B2 (en) Methods, systems, and computer readable media for virtual machine (VM) deployment using read-only memory

Legal Events

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

Ref document number: 17838451

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 17838451

Country of ref document: EP

Kind code of ref document: A1