Method and device for managing external storage device, equipment and medium
By detecting the insertion event of the external storage device and obtaining access modes, providing unique notifications, it solves the complexity and user experience of external storage device management, and realizes efficient and secure external storage device management.
Patent Information
- Application Number
- CN202311477138.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-07
- Publication Date
- 2025-05-09
AI Technical Summary
When managing external storage devices, the prior art has problems such as damage to file security and privacy, and the management complexity is high and the user experience is poor.
By detecting the insertion event of the external storage device, the access mode of the terminal device is obtained, and unique notification is provided based on this mode, independent management of the external storage device is realized, the complexity of management and control is reduced, and the user experience is improved.
It effectively reduces the complexity of external storage device management, improves usage efficiency, improves user experience, and ensures file security and privacy in terminal devices.
Smart Images

Figure CN119960837A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present disclosure generally relate to the field of computers, and more particularly, to a method, an apparatus, a device, and a computer-readable storage medium for managing an external storage device. Background Art
[0002] With the continuous development of computer technology, terminal devices such as laptops have become important tools for people's daily life and study and office. Users can create files of various confidentiality levels in the terminal devices they use. In order to meet the needs of spreading files between different users, terminal devices often support the insertion and reading of files from external storage devices such as mobile hard disks. However, this may undermine the security and privacy of files in terminal devices, because users can arbitrarily copy various files in terminal devices to external storage devices, making these files out of the control of terminal devices, thereby creating the risk of information insecurity. Therefore, how to provide hierarchical management and control for external storage devices has become an urgent problem to be solved. Summary of the invention
[0003] In a first aspect of the present disclosure, a method for managing an external storage device is provided. In the method, an insertion event of an external storage device being inserted into a terminal device is detected, and an access mode of the terminal device to the external storage device is obtained based on the insertion event. Further, based on the access mode, a unique notification associated with mounting the external storage device to the terminal device is provided.
[0004] In a second aspect of the present disclosure, a device for managing an external storage device is provided. The device includes a detection module, an acquisition module, and a notification module. The detection module is configured to detect an insertion event in which an external storage device is inserted into a terminal device. The acquisition module is configured to: based on the insertion event, acquire an access mode of the terminal device to the external storage device. The notification module is configured to: based on the access mode, provide a unique notification associated with mounting the external storage device to the terminal device.
[0005] In a third aspect of the present disclosure, an electronic device is provided. The electronic device includes: at least one processing unit; and at least one memory, the at least one memory is coupled to the at least one processing unit and stores instructions for execution by the at least one processing unit, and when the instructions are executed by the at least one processing unit, the electronic device executes the method according to the first aspect of the present disclosure.
[0006] In a fourth aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the processor implements the method according to the first aspect of the present disclosure.
[0007] It should be understood that the contents described in this content section are not intended to limit the key features or important features of the embodiments of the present disclosure, nor are they intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0008] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent in the following detailed description in conjunction with the accompanying drawings. In the accompanying drawings, the same or similar reference numerals represent the same or similar elements, wherein:
[0009] Figure 1 A schematic block diagram of an existing solution for managing an external storage device is shown;
[0010] Figure 2 A schematic diagram showing an example environment in which various embodiments of the present disclosure can be implemented;
[0011] Figure 3 A schematic diagram showing a process for managing an external storage device according to some embodiments of the present disclosure;
[0012] Figure 4 A flowchart of a method for managing an external storage device according to some embodiments of the present disclosure is shown;
[0013] Figure 5 A block diagram illustrating an example apparatus for managing an external storage device according to some embodiments of the present disclosure; and
[0014] Figure 6 A block diagram is shown of a device in which one or more embodiments of the present disclosure may be implemented. DETAILED DESCRIPTION
[0015] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments set forth herein. On the contrary, these embodiments are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.
[0016] In the description of the embodiments of the present disclosure, the term "including" and similar terms should be understood as open inclusion, that is, "including but not limited to". The term "based on" should be understood as "based at least in part on". The term "one embodiment" or "the embodiment" should be understood as "at least one embodiment". The term "some embodiments" should be understood as "at least some embodiments". The following may also include other explicit and implicit definitions. As used herein, the term "model" can represent the association relationship between various data. For example, the above-mentioned association relationship can be obtained based on a variety of technical solutions currently known and / or to be developed in the future.
[0017] As used herein, the term "in response to" refers to a state in which a corresponding event occurs or a condition is satisfied. It will be understood that the timing of executing a subsequent action executed in response to the event or condition is not necessarily strongly related to the time when the event occurs or the condition is satisfied. For example, in some cases, the subsequent action may be executed immediately when the event occurs or the condition is satisfied; while in other cases, the subsequent action may be executed some time after the event occurs or the condition is satisfied.
[0018] It is understandable that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and relevant provisions.
[0019] It is understandable that before using the technical solutions disclosed in the embodiments of the present disclosure, the types, scope of use, usage scenarios, etc. of the personal information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.
[0020] For example, in response to receiving an active request from a user, a prompt message is sent to the user to clearly prompt the user that the operation requested to be performed will require obtaining and using the user's personal information. Thus, the user can autonomously choose whether to provide personal information to software or hardware such as an electronic device, application, server, or storage medium that performs the operation of the technical solution of the present disclosure according to the prompt message.
[0021] As an optional but non-limiting embodiment, in response to receiving an active request from the user, the prompt information is sent to the user in a manner such as a pop-up window, in which the prompt information can be presented in text form. In addition, the pop-up window can also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device.
[0022] It is understandable that the above notification and the process of obtaining user authorization are merely illustrative and do not constitute a limitation to the embodiments of the present disclosure. Other methods that meet relevant laws and regulations may also be applied to the embodiments of the present disclosure.
[0023] As mentioned above, the use of external storage devices may damage the security and privacy of files in the terminal device, so it is expected to achieve hierarchical management and control of external storage devices. The existing technical solutions often read the inserted external storage device in user mode, and remount the external storage device as read-only mode or cancel the mount according to the inserted device list, so as to achieve hierarchical management and control of external storage devices.
[0024] Figure 1 A schematic block diagram 100 of an existing solution for managing external storage devices is shown. Figure 1 As shown, the terminal device 120 is installed with an operating system 130 and a management application 140. The management application 140 is located in the application layer, while the operating system 130 is located in the lower system service layer, so the operating system 130 has higher access rights. After detecting that the external storage device 110 is inserted into the terminal device 120, the operating system 130 can mount the external storage device 110 into the file system, update the mount information, and prompt the user that the external storage device 110 is mounted successfully. At the same time, the management application 140 detects that the external storage device 110 is mounted to the file system by monitoring the mount information.
[0025] Further, the management application 140 can obtain the access policy 122 to determine the access mode for the external storage device 110. If the determined access mode for the external storage device 110 is the read-write mode, the current mounting state of the external storage device 110 is maintained. If the determined access mode for the external storage device 110 is the read-only mode, the management application 140 controls the operating system 130 to remount the external storage device 110 in a read-only manner, and prompts the user that the external storage device 110 is currently in a read-only state. If the determined access mode for the external storage device 110 is the disabled mode, the management application 140 controls the operating system 130 to unmount the external storage device 110, and prompts the user that the external storage device 110 has been disabled.
[0026] It can be seen that in the existing solution, after the external storage device 110 has been mounted to the file system by the operating system 130, the management application 140 and the operating system 130 will perform the control operation on the external storage device 110. This solution has at least the following problems: on the one hand, the process of mounting first and then controlling will increase the complexity of device control, resulting in low efficiency in the use of the external storage device 110. On the other hand, in the case of read-only mode or disabled mode, the user will be prompted multiple times, resulting in a poor user experience. Especially in the disabled mode, the user is first prompted that the mounting is successful, and then prompted that the external storage device 110 is disabled, which will cause unnecessary trouble to the user.
[0027] To this end, an embodiment of the present disclosure proposes a solution for independently managing an external storage device 110. Specifically, according to an embodiment of the present disclosure, a solution for managing an external storage device 110 is proposed, and an access mode can be obtained based on an insertion event in which the external storage device 110 is detected to be inserted into a terminal device 120, and a unique notification associated with mounting the external storage device 110 to the terminal device 120 is provided based on the access mode.
[0028] It will be more clearly understood through the following description that according to an embodiment of the present disclosure, the management and control of the external storage device 110 can be independently completed by, for example, the operating system of the terminal device 120, and the relevant notification is provided only once. In this way, on the one hand, the complexity of device management can be effectively reduced, thereby improving the efficiency of the use of the external storage device 110. On the other hand, the unique notification can directly provide a notification of the management and control results for the external storage device 110, so as to achieve the management and control of the external storage device 110 without the user's perception, thereby improving the user experience.
[0029] Example Environment
[0030] Various exemplary embodiments of the solution will be described in detail below with reference to the accompanying drawings. Figure 2 , which shows a schematic diagram of an example environment 200 in which the various embodiments of the present disclosure can be implemented. The example environment 200 may generally include an external storage device 110, a terminal device 120, and a user 202. Examples of the external storage device 110 include, but are not limited to, a USB flash drive, a mobile hard disk, an optical disk, and the like. Examples of the terminal device 120 include, but are not limited to, a laptop computer, a notebook computer, a netbook computer, a tablet computer, a media computer, a multimedia tablet, a personal communication system (PCS) device, a personal navigation device, a personal digital assistant (PDA), a digital camera / camcorder, a gaming device, and the like. For illustrative and non-limiting purposes, in Figure 2 1 shows one external storage device 110. It should be understood that the number of the external storage devices 110 may be any other suitable value, and the scope of the present disclosure is not limited in this respect.
[0031] like Figure 2As shown in , user 202 can interact with terminal device 120. User 202 can insert external storage device 110 into terminal device 120. After detecting the insertion event, the access mode for the external storage device 110 can be obtained, and a notification for mounting the external storage device 110 is provided to user 202. This will be described in further detail below. It should be understood that the structure and function of environment 200 are described only for exemplary purposes, and do not imply any limitation on the scope of the present disclosure.
[0032] Example Process
[0033] Reference below Figure 3 An overview of an exemplary embodiment according to the present disclosure is described. Figure 3 A schematic diagram 300 is shown of a process for managing an external storage device 110 according to some embodiments of the present disclosure. It should be understood that the process may include additional blocks not shown and / or may omit one (or some) of the blocks shown, and the scope of the present disclosure is not limited in this respect.
[0034] In some embodiments, the process may be performed as follows: Figure 2 and Figure 3 The process is performed at the terminal device 120 shown in the figure. Exemplarily, it can be performed in the system service layer, such as the operating system 330. For example, a functional module for implementing the process can be embedded in the operating system 330. In some embodiments, Figure 3 The operating system 330 in may be different from Figure 1 An operating system 130 in the prior art solution is shown.
[0035] In some embodiments, after the terminal device 120 is turned on, the operating system 330 can start a daemon process. Further, the daemon process can create: (1) an object for communicating with an application, such as GDBus; (2) an object for communicating with the kernel, such as provider; and (3) a device object or a file system object, such as udev_device. After being created, the daemon process can monitor the device status by polling. It should be understood that the above examples are only for illustrative purposes and not for restrictive purposes.
[0036] like Figure 2As shown in , an insertion event of an external storage device 110 being inserted into a terminal device 120 can be detected. In some embodiments, the file manager of the terminal device 120 can monitor the number of device interfaces of the terminal device 120. The monitored number can be received, and based on the number, it is determined whether an insertion event occurs. If it is determined that the number of device interfaces has increased, it is determined that an insertion event has been detected. In some other embodiments, for example, based on the uevent mechanism, after the external storage device 110 is inserted into the terminal device 120, the kernel can, for example, send a string through a socket. The object used to communicate with the kernel can then receive and parse the string, thereby determining that an insertion event has been detected, and obtaining information about the external storage device 110. In this way, the insertion event of the external storage device 110 can be efficiently detected, thereby facilitating the subsequent execution of corresponding management and control operations. It should be understood that the insertion event can also be detected in any other suitable manner, and the scope of the present disclosure is not limited in this respect.
[0037] Further, the access mode 340 of the terminal device 120 for the external storage device 110 can be obtained based on the insertion event. In some embodiments, the attribute information of the external storage device 110 can be determined based on the insertion event. Exemplarily, the attribute information of the external storage device 110 may include manufacturer information, product number, owner information, and / or a combination of these information. As described above, for example, the attribute information of the external storage device 110 can be parsed from the string sent by the kernel with the help of the uevent mechanism. For another example, after detecting the insertion event, the operating system 330 can directly obtain its attribute information from the external storage device 110. It should be understood that the attribute information of the external storage device 110 can also be determined by any other suitable means, and the scope of the present disclosure is not limited in this respect.
[0038] Then, based on the determined attribute information, an access mode 340 may be determined in the access policy 122 of the terminal device 120. In some embodiments, the access policy 122 may define the access mode 340 of the terminal device 120 for each different external storage device 110. Examples of the access mode 340 include, but are not limited to: a read-write access mode 342 (also referred to as a read-write mode), a read-only access mode 344 (also referred to as a read-only mode), and a prohibited access mode 346 (also referred to as a prohibited mode). In the read-write access mode 342, the terminal device 120 may read data from the external storage device 110 and write data to the external storage device 110. In the read-only access mode 344, the terminal device 120 may only read data from the external storage device 110 and is prohibited from writing data to the external storage device 110. In the prohibited access mode 346, the terminal device 120 is prohibited from interacting with the external storage device 110.
[0039] In some embodiments, the access policy 122 may be implemented in the form of a blacklist. In other embodiments, the access policy 122 may be implemented in the form of a whitelist. In still other embodiments, the access policy 122 may be implemented in the form of a permission list. It should be understood that the access policy 122 may also be implemented in any other suitable manner (e.g., any combination of the above three manners), and the scope of the present disclosure is not limited in this respect.
[0040] Exemplarily, the access policy 122 may be stored and managed at a server (not shown) different from the terminal device 120. The server may be, for example, a device with computing and communication functions such as a workstation, a cloud server, etc. The terminal device 120 may, for example, request an access mode 340 corresponding to the external storage device 110 from the server based on the attribute information of the external storage device 110. The server may then search for the corresponding access mode 340 in the access policy 122 based on the attribute information and send it to the terminal device 120. In this way, it is convenient to centrally and uniformly manage the access policies 122 for a large number of external storage devices, thereby improving the utilization efficiency of computer resources.
[0041] Alternatively, the access policy 122 may also be stored locally in the terminal device 120. In this case, the access pattern 340 corresponding to the external storage device 110 may be directly searched in the stored access policy 122. It should be understood that the access pattern 340 may also be obtained in any other suitable manner, and the scope of the present disclosure is not limited in this respect.
[0042] Further, corresponding management and control operations can be performed on the inserted external storage device 110 based on the obtained access mode 340, and a unique notification 350 associated with mounting the external storage device 110 to the terminal device 120 is provided to the user 202. It should be noted that providing a unique notification 350 means that in the scheme according to each embodiment of the present disclosure, only one notification 350 is provided for the management of the external storage device 110. Exemplarily, the notification 350 can be implemented in the form of a new message floating layer, a pop-up window, a voice reminder, etc.
[0043] In some embodiments, if the access mode 340 obtained is the access prohibition mode 346, the external storage device 110 can be directly prohibited from being mounted to the terminal device 120, and a notification 356 that the external storage device 110 is prohibited from being mounted to the terminal device 120 can be provided to the user 202. It can be seen that in the solution according to the embodiment of the present disclosure, in the case of the prohibition mode 346, the external storage device 110 will not be mounted to the terminal device 120 at all, so that one mounting operation and one unmounting operation can be reduced compared with the existing solution, and only the notification 356 about the prohibition of mounting is provided to the user 202. In this way, on the one hand, the disabled external storage device 110 can be prevented from being mounted to the terminal device 120, thereby improving the security and privacy of the terminal device 120. On the other hand, the notification 350 provided to the user 202 can be streamlined to avoid disturbing the user 202, thereby improving the user experience.
[0044] In some embodiments, if the acquired access mode 340 is an allowed access mode (e.g., a read-only access mode 344 or a read-write access mode 342), the external storage device 110 may be mounted to the terminal device 120 based on the allowed access mode. Exemplarily, a file system object describing the external storage device 110 may be generated based on an insertion event. For example, the attribute information of the external storage device 110 described above may be used to generate a file system object describing the external storage device 110. The file system object may, for example, describe information such as the type, capacity, available space, and / or used space of the external storage device 110.
[0045] Further, the parent node of the external storage device 110 in the file system can be obtained, and the mount point of the external storage device 110 can be determined based on the child nodes of the parent node. Exemplarily, at least one child node of the parent node can be traversed to determine the terminal child node in at least one child node, and the mount point is determined based on the adjacent position of the terminal child node. For example, assuming that the root directory of the current file system already has drive letters C, D, and E, then based on drive letter E at the end of the drive letter sequence, it can be determined that the mount point (i.e., drive letter) for the external storage device 110 is drive letter F immediately following drive letter E. Then, a file system object corresponding to the external storage device 110 can be added to the file system of the terminal device 120 at the mount point. In this way, the mount point for the external storage device 110 can be determined more regularly, and the corresponding file system objects can be added more efficiently, thereby improving the user experience.
[0046] Additionally, the mount parameters associated with the external storage device 110 may be determined based on the allowed access mode. Examples of mount parameters include, but are not limited to, parameters for specifying a character set used to access a file system, parameters for mounting the external storage device 110 as a hard disk partition, parameters for indicating the access mode 340, and the like.
[0047] In some embodiments, it can be determined whether the obtained allowed access mode is a read-only access mode 344 or a read-write access mode 342. If the obtained allowed access mode is a read-only access mode 344, the mount parameters for the read-only mode 344 can be directly used to add a file system object to the file system at the mount point. In addition, a notification 354 that the external storage device 110 is mounted to the terminal device 120 in a read-only mode 344 can be provided to the user 202. It can be seen that in the solution according to the embodiment of the present disclosure, in the case of the read-only mode 344, the external storage device 110 can be directly mounted to the terminal device 120 in the read-only mode 344, thereby reducing one unmount operation and one mount operation compared to the existing solution, and only providing the user 202 with a notification 354 about the read-only mount. In this way, on the one hand, the mount process can be simplified, thereby improving the use efficiency of the external storage device 110. On the other hand, the notification 350 provided to the user 202 can be optimized to avoid disturbing the user 202, thereby improving the user experience.
[0048] In some embodiments, if the obtained allowed access mode is the read-write access mode 342, the mount parameters for the read-write mode 342 can be directly used to add a file system object to the file system at the mount point. Additionally, a notification 352 that the external storage device 110 is mounted to the terminal device 120 in the read-write mode 342 can be provided to the user 202. It can be seen that in the solution according to the embodiment of the present disclosure, in the case of the read-write mode 342, the external storage device 110 can be directly mounted to the terminal device 120 in the read-write mode 342, and only the notification 352 about the read-write mount is provided to the user 202. In this way, on the one hand, the mounting process can be simplified, thereby improving the use efficiency of the external storage device 110. On the other hand, the notification 350 provided to the user 202 can be optimized to avoid disturbing the user 202, thereby improving the user experience.
[0049] In some embodiments, if it is detected that the external storage device 110 is removed from the terminal device 120, the file system object can be deleted, and the user 202 can be prompted that the external storage device 110 has been safely removed. In this way, the user 202 can be informed of the status change of the external storage device 110 in a timely manner, thereby further improving the user experience.
[0050] Through the above combination Figure 2 and Figure 3 It can be seen from the description that in the scheme for managing external storage devices according to the various embodiments of the present disclosure, the control of the mounting process of the external storage device can be independently completed by the operating system of the terminal device, for example, and the relevant notification is provided only once. In this way, on the one hand, the complexity of device management can be effectively reduced, thereby improving the use efficiency of the external storage device. On the other hand, notifications of the control results for the external storage device can be directly provided so that the external storage device can be controlled without the user's perception, thereby improving the user experience.
[0051] Example Process
[0052] Figure 4 A flowchart of a method 400 for managing an external storage device according to some embodiments of the present disclosure is shown. In some embodiments, the method 400 may be implemented as follows: Figure 2 and Figure 3 The method 400 is executed at the terminal device 120 shown. Exemplarily, it can be executed in the operating system 330. For example, a functional module for implementing the method 400 can be embedded in the operating system 330. It should be understood that the method 400 may also include additional blocks not shown and / or may omit one (or some) of the blocks shown, and the scope of the present disclosure is not limited in this respect.
[0053] In block 402, an insertion event of an external storage device being inserted into a terminal device is detected. In block 404, an access mode of the terminal device to the external storage device is obtained based on the insertion event. In block 406, a unique notification associated with mounting the external storage device to the terminal device is provided based on the access mode.
[0054] According to an exemplary embodiment of the present disclosure, detecting an insertion event includes: receiving the number of device interfaces of the terminal device monitored by a file manager of the terminal device; and in response to determining that the number of device interfaces increases, determining that an insertion event is detected.
[0055] According to an exemplary embodiment of the present disclosure, acquiring the access mode includes: determining attribute information of the external storage device based on the insertion event; and determining the access mode in an access policy of the terminal device based on the attribute information.
[0056] According to an exemplary embodiment of the present disclosure, the method 400 further includes: in response to determining that the access mode is the prohibited access mode, prohibiting the external storage device from being mounted to the terminal device, and notifying that the external storage device is not mounted to the terminal device.
[0057] According to an exemplary embodiment of the present disclosure, method 400 further includes: in response to determining that the access mode is the allowed access mode, mounting the external storage device to the terminal device based on the allowed access mode, and notifying that the external storage device has been mounted to the terminal device based on the allowed access mode.
[0058] According to an exemplary embodiment of the present disclosure, mounting an external storage device includes: generating a file system object describing the external storage device based on an insertion event; and adding the file system object to a file system of a terminal device.
[0059] According to an exemplary embodiment of the present disclosure, adding a file system object includes: obtaining a parent node of an external storage device in a file system; determining a mount point of the external storage device based on child nodes of the parent node; and adding a file system object at the mount point.
[0060] According to an exemplary embodiment of the present disclosure, determining the mounting point includes: traversing at least one child node of a parent node to determine a terminal child node in the at least one child node; and determining the mounting point based on an adjacent position of the terminal child node.
[0061] According to an exemplary embodiment of the present disclosure, adding a file system object further includes: determining a mount parameter associated with an external storage device based on an allowed access mode, the allowed access mode including any one of a read-only access mode and a read-write access mode; and adding the file system object to the file system based on the mount parameter.
[0062] According to an exemplary embodiment of the present disclosure, the method 400 further includes: in response to detecting that the external storage device is removed from the terminal device, deleting the file system object.
[0063] According to an exemplary embodiment of the present disclosure, the method 400 is executed in an operating system of a terminal device.
[0064] Example devices and equipment
[0065] The embodiments of the present disclosure also provide corresponding devices and apparatuses for implementing the above methods or processes. Figure 5A block diagram of an example apparatus 500 for managing an external storage device according to some embodiments of the present disclosure is shown. The apparatus 500 may be used, for example, to implement the methods according to the embodiments of the present disclosure. The apparatus 500 may include a detection module 502, an acquisition module 504, and a notification module 506. The detection module 502 is configured to detect an insertion event in which an external storage device is inserted into a terminal device. The acquisition module 504 is configured to acquire an access mode of the terminal device for the external storage device based on the insertion event. The notification module 506 is configured to provide a unique notification associated with mounting the external storage device to the terminal device based on the access mode.
[0066] According to an exemplary embodiment of the present disclosure, the detection module 502 may include a receiving module and an event determination module. The receiving module is configured to receive the number of device interfaces of the terminal device monitored by the file manager of the terminal device. The event determination module is configured to: in response to determining that the number of device interfaces increases, determine that an insertion event is detected.
[0067] According to an exemplary embodiment of the present disclosure, the acquisition module 504 may include an information determination module and a mode determination module. The information determination module is configured to determine attribute information of the external storage device based on the insertion event. The mode determination module is configured to determine the access mode in the access policy of the terminal device based on the attribute information.
[0068] According to an exemplary embodiment of the present disclosure, the apparatus 500 may further include a prohibition module, which is configured to: in response to determining that the access mode is the prohibited access mode, prohibit mounting the external storage device to the terminal device, and notify that the external storage device is not mounted to the terminal device.
[0069] According to an exemplary embodiment of the present disclosure, the device 500 may further include an allowing module, which is configured to: in response to determining that the access mode is the allowing access mode, mount the external storage device to the terminal device based on the allowing access mode, and notify that the external storage device has been mounted to the terminal device based on the allowing access mode.
[0070] According to an exemplary embodiment of the present disclosure, the enabling module may include a generating module and an adding module. The generating module is configured to generate a file system object describing the external storage device based on the insertion event. The adding module is configured to add the file system object to the file system of the terminal device.
[0071] According to an exemplary embodiment of the present disclosure, the adding module may include a node acquisition module, a mount point module, and an object adding module. The node acquisition module is configured to acquire a parent node of the external storage device in the file system. The mount point module is configured to determine the mount point of the external storage device based on the child nodes of the parent node. The object adding module is configured to add a file system object at the mount point.
[0072] According to an exemplary embodiment of the present disclosure, the mount point module may include a traversal module and a mount point determination module. The traversal module is configured to: traverse at least one child node of a parent node to determine a terminal child node in at least one child node. The mount point determination module is configured to determine a mount point based on an adjacent position of the terminal child node.
[0073] According to an exemplary embodiment of the present disclosure, the adding module may include a parameter determination module and a mounting module. The parameter determination module is configured to: determine the mounting parameters associated with the external storage device based on the allowed access mode, the allowed access mode including any one of the read-only access mode and the read-write access mode. The mounting module is configured to add the file system object to the file system based on the mounting parameters.
[0074] According to an exemplary embodiment of the present disclosure, the apparatus may further include a deleting module configured to: in response to detecting that the external storage device is removed from the terminal device, delete the file system object.
[0075] According to an exemplary embodiment of the present disclosure, the apparatus 500 may be used to implement an operating system of a terminal device.
[0076] The modules and / or units included in the device 500 can be implemented in various ways, including software, hardware, firmware, or any combination thereof. In some embodiments, one or more units can be implemented using software and / or firmware, such as machine executable instructions stored on a storage medium. In addition to or as an alternative to machine executable instructions, some or all of the units in the device 500 can be implemented at least in part by one or more hardware logic components. As an example and not limitation, exemplary types of hardware logic components that can be used include field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.
[0077] Figure 5 The modules and / or units shown in the can be partially or completely implemented as hardware modules, software modules, firmware modules or any combination thereof. In particular, in some embodiments, the processes, methods or procedures described above can be implemented by hardware in the storage system or a host corresponding to the storage system or other computing devices independent of the storage system.
[0078] Figure 6 6 shows a block diagram of a device 600 in which one or more embodiments of the present disclosure may be implemented. It should be understood that Figure 6 The computing device 600 shown is merely exemplary and should not constitute any limitation on the functionality and scope of the embodiments described herein. Figure 6 The computing device 600 shown may be used to implement the methods described above.
[0079] like Figure 6 As shown, computing device 600 is in the form of a general-purpose computing device. Components of computing device 600 may include, but are not limited to, one or more processors or processing units 610, memory 620, storage device 630, one or more communication units 640, one or more input devices 650, and one or more output devices 660. Processing unit 610 may be an actual or virtual processor and is capable of performing various processes according to a program stored in memory 620. In a multi-processor system, multiple processing units execute computer executable instructions in parallel to increase the parallel processing capabilities of computing device 600.
[0080] The computing device 600 typically includes a plurality of computer storage media. Such media may be any available media accessible to the computing device 600, including but not limited to volatile and non-volatile media, removable and non-removable media. The memory 620 may be a volatile memory (e.g., registers, caches, random access memory (RAM)), a non-volatile memory (e.g., a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), flash memory), or some combination thereof. The storage device 630 may be a removable or non-removable medium, and may include a machine-readable medium, such as a flash drive, a disk, or any other medium, which may be capable of being used to store information and / or data (e.g., training data for training) and may be accessed within the computing device 600.
[0081] The computing device 600 may further include additional removable / non-removable, volatile / non-volatile storage media. Figure 6 As shown in , a disk drive for reading or writing from a removable, non-volatile disk (e.g., a "floppy disk") and an optical drive for reading or writing from a removable, non-volatile optical disk may be provided. In these cases, each drive may be connected to the bus (not shown) by one or more data media interfaces. The memory 620 may include a computer program product 625 having one or more program modules that are configured to perform various methods or actions of various embodiments of the present disclosure.
[0082] The communication unit 640 enables communication with other computing devices via a communication medium. Additionally, the functions of the components of the computing device 600 can be implemented in a single computing cluster or multiple computing machines that can communicate via a communication connection. Therefore, the computing device 600 can operate in a networked environment using a logical connection with one or more other servers, a network personal computer (PC), or another network node.
[0083] Input device 650 may be one or more input devices, such as a mouse, keyboard, trackball, etc. Output device 660 may be one or more output devices, such as a display, speaker, printer, etc. Computing device 600 may also communicate with one or more external devices (not shown) through communication unit 640 as needed, such as storage devices, display devices, etc., communicate with one or more devices that allow a user to interact with computing device 600, or communicate with any device that allows computing device 600 to communicate with one or more other computing devices (e.g., a network card, a modem, etc.). Such communication may be performed via an input / output (I / O) interface (not shown).
[0084] According to an exemplary embodiment of the present disclosure, a computer-readable storage medium is provided, on which computer-executable instructions are stored, wherein the computer-executable instructions are executed by a processor to implement the method described above. According to an exemplary embodiment of the present disclosure, a computer program product is also provided, the computer program product is tangibly stored on a non-transitory computer-readable medium and includes computer-executable instructions, and the computer-executable instructions are executed by a processor to implement the method described above. According to an exemplary embodiment of the present disclosure, a computer program product is provided, on which a computer program is stored, and when the program is executed by a processor, the method described above is implemented.
[0085] Various aspects of the present disclosure are described herein with reference to the flowcharts and / or block diagrams of the methods, devices, equipment, and computer program products implemented according to the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer-readable program instructions.
[0086] These computer-readable program instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processing unit of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0087] Computer-readable program instructions can be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operational steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, so that the instructions executed on the computer, other programmable data processing apparatus, or other device implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0088] The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to multiple implementations of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a part of a module, program segment or instruction, and a part of a module, program segment or instruction includes one or more executable instructions for realizing the logical function of the specification. In some implementations as replacements, the function marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous square boxes can actually be executed substantially in parallel, and they can sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be realized by a special hardware-based system that performs the function or action of the specification, or can be realized by a combination of special hardware and computer instructions.
[0089] The above descriptions of various implementations of the present disclosure are exemplary, non-exhaustive, and not limited to the disclosed implementations. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described implementations. The selection of terms used herein is intended to best explain the principles of the implementations, practical applications, or improvements to the technology in the marketplace, or to enable other persons of ordinary skill in the art to understand the various embodiments disclosed herein.
Claims
1. A method for managing an external storage device, comprising: Detecting an insertion event of the external storage device being inserted into the terminal device; Based on the insertion event, obtaining an access mode of the terminal device to the external storage device; as well as Based on the access pattern, a unique notification associated with mounting the external storage device to the terminal device is provided.
2. The method of claim 1 , wherein detecting the insertion event comprises: receiving a number of device interfaces of the terminal device monitored by a file manager of the terminal device; as well as In response to determining that the number of device interfaces has increased, it is determined that the insertion event is detected.
3. The method according to claim 1, wherein obtaining the access mode comprises: determining attribute information of the external storage device based on the insertion event; as well as The access mode is determined in an access policy of the terminal device based on the attribute information.
4. The method according to claim 1, further comprising: In response to determining that the access mode is the access prohibited mode, mounting the external storage device to the terminal device is prohibited, and the notification indicates that the external storage device is not mounted to the terminal device.
5. The method according to claim 1, further comprising: In response to determining that the access mode is the access-allowed mode, the external storage device is mounted to the terminal device based on the access-allowed mode, and the notification indicates that the external storage device has been mounted to the terminal device based on the access-allowed mode.
6. The method according to claim 5, wherein mounting the external storage device comprises: generating a file system object describing the external storage device based on the insertion event; as well as The file system object is added to the file system of the terminal device.
7. The method of claim 6, wherein adding the file system object comprises: Obtaining a parent node of the external storage device in the file system; Determine a mount point of the external storage device based on the child nodes of the parent node; as well as The file system object is added at the mount point.
8. The method according to claim 7, wherein determining the mount point comprises: Traversing at least one child node of the parent node to determine a terminal child node in the at least one child node; as well as The mounting point is determined based on the adjacent position of the terminal child node.
9. The method of claim 6, wherein adding the file system object further comprises: determining a mount parameter associated with the external storage device based on the allowed access mode, wherein the allowed access mode includes any one of a read-only access mode and a read-write access mode; as well as The file system object is added to the file system based on the mount parameters.
10. The method according to claim 6, further comprising: In response to detecting that the external storage device is removed from the terminal device, the file system object is deleted.
11. The method according to claim 1, wherein the method is executed in an operating system of the terminal device.
12. An apparatus for managing an external storage device, comprising: The detection module is configured to: detect an insertion event in which an external storage device is inserted into a terminal device; The acquisition module is configured to: acquire an access mode of the terminal device to the external storage device based on the insertion event; as well as The notification module is configured to provide a unique notification associated with mounting the external storage device to the terminal device based on the access mode.
13. An electronic device, comprising: at least one processing unit; as well as At least one memory, the at least one memory being coupled to the at least one processing unit and storing instructions for execution by the at least one processing unit, the instructions causing the electronic device to perform the method according to any one of claims 1 to 11 when executed by the at least one processing unit.
14. A computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the processor is caused to implement the method according to any one of claims 1 to 11.