External storage device mounting method and device, electronic device, and storage medium
By providing users with prompts during system switching and allowing them to mount or unmount external storage devices based on their choices, the problem of external storage devices not being able to be continuously mounted during system switching is solved, improving user experience and meeting data security isolation requirements.
Patent Information
- Application Number
- CN202211184943.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-27
- Publication Date
- 2025-10-21
- Estimated Expiration
- 2042-09-27
AI Technical Summary
When switching systems, external storage devices cannot be continuously mounted by the same operating system, resulting in cumbersome use and a poor user experience.
By providing users with prompts during system switching, users can confirm whether the external storage device will continue to be used by the operating system before or after the switch. After determining the status of the external storage device, the system performs the corresponding mounting or unmounting operations to ensure that the external storage device is mounted by the same system after the system switch.
It improves the user experience, avoids data transmission interruptions of external storage devices and manual plugging/unplugging operations during system switching, and meets the data security isolation requirements between different systems.
Smart Images

Figure CN115562735B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of operating systems. Specifically, the present application relates to a method and apparatus for mounting an external storage device, an electronic device, and a storage medium. Background Art
[0002] Currently, many electronic devices, such as mobile terminals, can install two or more operating systems. When using these electronic devices, external storage devices can often only be mounted on the operating system in the foreground, and the operating system in the background cannot know about and use the external storage device. When switching systems, the operating system that mounts the external storage device will perform an unmount operation and cause the kernel to generate an unplug event. Therefore, if the user needs to continue using the external storage device, the external storage device can only be unplugged and then reinserted to allow the operating system in the foreground to mount the external device. This results in the same operating system being unable to always mount external devices in scenarios such as system switching, making the operation of using external devices cumbersome and the user experience poor. Summary of the Invention
[0003] The embodiments of the present application provide a method, apparatus, electronic device, and storage medium for mounting an external storage device, which can solve the problem of not being able to ensure that the same operating system can always mount an external device after a system switch. The technical solution is as follows:
[0004] According to one aspect of an embodiment of the present application, a method for mounting an external storage device is provided, the method comprising:
[0005] In response to the system switching operation, displaying a first prompt message, wherein the first prompt message is used to confirm whether the first operating system in the foreground before the switching continues to use the external storage device;
[0006] If, based on the operation on the first prompt information, it is determined that the first operating system continues to use the external storage device, then when it is determined that the external storage device is in an idle state, a second prompt information is displayed, wherein the second prompt information is used to confirm whether the second operating system in the foreground after the switch is to use the external storage device;
[0007] If it is determined that the second operating system uses the external storage device based on the operation on the second prompt information, the external storage device mounted on the first operating system is uninstalled and the external storage device is mounted on the second operating system.
[0008] As an optional embodiment, the displaying of the first prompt information further includes:
[0009] Determining whether the external storage device is in use or idle state;
[0010] The displaying of the first prompt information includes:
[0011] If it is determined that the external storage device is in use, the first prompt information is displayed.
[0012] As an optional embodiment, the determining whether the external storage device is in use or idle state further includes:
[0013] If it is determined that the external storage device is in an idle state, the external storage device mounted on the first operating system is unmounted, and the external storage device is mounted on the second operating system.
[0014] As an optional embodiment, the displaying of the first prompt information further includes:
[0015] If it is determined that the first operating system does not continue to use the external storage device according to the operation in response to the first prompt information, the external storage device mounted on the first operating system is unmounted, and the external storage device is mounted on the second operating system;
[0016] If it is determined that the second operating system does not use the external storage device according to the operation on the second prompt information, the first operating system is instructed to keep mounting the external storage device.
[0017] As an optional embodiment, the determination that the first operating system continues to use the external storage device then includes, when it is determined that the external storage device is in use, instructing the first operating system to keep mounting the external storage device until it is determined that the external storage device is in an idle state.
[0018] As an optional embodiment, the displaying of the first prompt information in response to the system switching operation further includes:
[0019] In response to the insertion of the external storage device, an insertion event is sent to the two operating systems, so that the first operating system mounts the external storage device and the second operating system saves mounting information, where the mounting information is used to indicate that the external storage device is mounted on the first operating system.
[0020] As an optional embodiment, the method further includes:
[0021] Instruction information is sent to the two operating systems, where the instruction information is used to instruct the operating system in the foreground to mount the external storage device after receiving the insertion event, and the operating system in the background to save the mounting information after receiving the insertion event.
[0022] According to another aspect of an embodiment of the present application, a device for mounting an external storage device is provided, the device comprising:
[0023] A first display module is configured to display a first prompt message in response to a system switching operation, wherein the first prompt message is used to confirm whether the first operating system in the foreground before the switching continues to use the external storage device;
[0024] A second display module is configured to display a second prompt message when it is determined that the first operating system continues to use the external storage device and that the external storage device is in an idle state, wherein the second prompt message is used to confirm whether the second operating system in the foreground after the switch is to use the external storage device;
[0025] An execution module is used to determine that the external storage device is used by the second operating system based on an operation on the second prompt information, then uninstall the external storage device mounted on the first operating system, and mount the external storage device on the second operating system.
[0026] According to another aspect of an embodiment of the present application, an electronic device is provided, which includes a memory, a processor, and a computer program stored in the memory, and the processor executes the computer program to implement the steps of the above-mentioned external storage device mounting method.
[0027] According to another aspect of an embodiment of the present application, a storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the external storage device mounting method described above are implemented.
[0028] The beneficial effects of the technical solution provided by the embodiments of the present application are as follows: the embodiments of the present application provide a method, apparatus, electronic device and storage medium for mounting an external storage device. When switching systems, the user is provided with a first prompt message indicating whether the first operating system in the foreground before the switch continues to use the external storage device, and the user is provided with a second prompt message indicating whether the second operating system uses the external storage device. This ensures that after the system is switched, the user can choose whether to always mount the external device by the same system or to change the system for mounting the external storage device according to the user's needs, thereby improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for describing the embodiments of the present application.
[0030] Figure 1 A schematic diagram of the system architecture for implementing a method for mounting an external storage device provided in an embodiment of the present application;
[0031] Figure 2 A flowchart of a method for mounting an external storage device provided in an embodiment of the present application;
[0032] Figure 3 A schematic diagram of the structure of a dual system provided in an embodiment of the present application;
[0033] Figure 4 A flowchart of a method for mounting an external storage device provided in an embodiment of the present application;
[0034] Figure 5 A schematic diagram of the structure of an external storage device mounting device provided in an embodiment of the present application;
[0035] Figure 6 A structural diagram of an electronic device for implementing a method for mounting an external storage device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0036] The following describes the embodiments of the present application in conjunction with the accompanying drawings. It should be understood that the embodiments described below in conjunction with the accompanying drawings are exemplary descriptions for explaining the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions of the embodiments of the present application.
[0037] Those skilled in the art will understand that, unless otherwise stated, the singular forms "a", "an" and "the" used herein may also include plural forms. It should be further understood that the terms "including" and "comprising" used in the embodiments of the present application mean that the corresponding features can be implemented as the presented features, information, data, steps, operations, elements and / or components, but do not exclude implementation as other features, information, data, steps, operations, elements, components and / or combinations thereof supported by the present technical field. It should be understood that when we say that an element is "connected" or "coupled" to another element, the element can be directly connected or coupled to the other element, or it can refer to that the element and the other element establish a connection relationship through an intermediate element. In addition, the "connection" or "coupling" used here can include wireless connection or wireless coupling. The term "and / or" used here indicates at least one of the items defined by the term, for example, "A and / or B" can be implemented as "A", or as "B", or as "A and B".
[0038] In order to make the objectives, technical solutions and advantages of this application clearer, the implementation methods of this application will be further described in detail below with reference to the accompanying drawings.
[0039] The external storage device mounting method, apparatus, electronic device, storage medium, and computer program product provided in this application are intended to solve the above technical problems in the prior art.
[0040] The following describes several exemplary embodiments to illustrate the technical solutions of the embodiments of the present application and the technical effects produced by the technical solutions of the present application. It should be noted that the following embodiments can refer to, draw on, or combine with each other, and the same terms, similar features, and similar implementation steps in different embodiments will not be repeated.
[0041] Figure 1 The system architecture diagram of the external storage device mounting method provided in the embodiment of the present application includes a terminal 110 and an external storage device 120. The external storage device 120 can be connected to the terminal 110 to realize data transmission between the external storage device 120 and the terminal 110.
[0042] Terminal 110 is provided with two operating systems, which may also be referred to as a dual system if there is no ambiguity. Optionally, terminal 110 includes but is not limited to at least one of a smartphone, a tablet computer, an e-book reader, a Moving Picture Experts Group Audio Layer III (MP3) player, a Moving Picture Experts Group Audio Layer IV (MP4) player, a laptop computer, and a desktop computer, as long as it is equipped with a dual system.
[0043] Optionally, the external storage device 120 includes but is not limited to at least one of a USB flash drive and an SD card.
[0044] The external storage device 120 can be connected to the terminal 110, and can be a USB flash drive inserted into a computer, or an SD card inserted into a smart phone.
[0045] The embodiment of the present application provides a method for mounting an external storage device, such as Figure 2 As shown, the method includes:
[0046] S100: In response to a system switching operation, display a first prompt message, where the first prompt message is used to confirm whether the first operating system in the foreground before the switching continues to use the external storage device.
[0047] Among them, the two operating systems in a dual system (i.e., the first system and the second system) are often divided according to different uses and confidentiality levels. For example, the first system is a security system with high confidentiality requirements, and the second system is a normal system with low confidentiality requirements. The security system is often used for office work and therefore has high confidentiality requirements, while the normal system is usually used in daily life scenarios such as leisure and entertainment, and has low confidentiality requirements. Based on different user needs, it is often necessary to switch between different systems.
[0048] For example, if the first operating system currently in the foreground is the security system and the second operating system in the background is the ordinary system, the user can click the switch system icon on the security system to perform the system switching operation, so that the security system switches to the background according to the system switching operation, and the ordinary system switches to the foreground according to the system switching operation. Taking into account the possibility that the security system is using an external storage device during the system switching (i.e., data is being transmitted between the security system and the external storage device), the first prompt message is displayed on the ordinary system in the foreground at this time, so that the user can choose whether to allow the security system in the background to continue to use the external storage device. This avoids the data transmission interruption caused by directly mounting the external storage device in the prior art, realizes interaction with the user, and improves the user experience.
[0049] S101. If, based on the operation on the first prompt information, it is determined that the first operating system continues to use the external storage device, then when it is determined that the external storage device is in an idle state, a second prompt information is displayed, and the second prompt information is used to confirm whether the second operating system in the foreground after switching uses the external storage device.
[0050] For example, continuing with the previous example, if the user chooses the security system to continue using the external storage device, data transmission continues between the security system in the background and the external storage device even after the switch to avoid data transmission interruption, then when the data transmission is completed, that is, when the external storage device is in an idle state, a second prompt message is displayed through the ordinary system to allow the user to choose whether to use the external storage device by the ordinary system, avoiding the existing technology of directly mounting the external storage device after the system switch, and the user cannot make the corresponding choice, thereby realizing the interaction between the operating system and the user and improving the user experience.
[0051] S102: If it is determined that the second operating system uses the external storage device based on the operation in response to the second prompt information, the external storage device mounted on the first operating system is unmounted and the external storage device is mounted on the second operating system.
[0052] For example, continuing with the previous example, if the user chooses to use the external storage device by the normal system, the security system will first uninstall the external storage device, and then the normal system will mount the external storage device. This avoids the problem in the prior art that when the external storage device still needs to be used after the system is switched, the user must manually unplug and reinsert the external storage device, thereby realizing the interaction between the operating system and the user and improving the user experience.
[0053] It can be understood that when switching systems, by providing the user with a first prompt message on whether the first operating system in the foreground before the switch continues to use the external storage device, and providing the user with a second prompt message on whether the second operating system uses the external storage device, it is ensured that after the system is switched, the user can choose whether to always mount the external device by the same system or to change the system that mounts the external storage device according to the user's needs, thereby improving the user experience.
[0054] Based on the above embodiments, as an optional embodiment, the first prompt information is displayed, and the following is also included before:
[0055] Determine whether the external storage device is in use or idle state;
[0056] Display the first prompt information, including:
[0057] If it is determined that the external storage device is in use, the first prompt information is displayed.
[0058] It is understandable that when switching systems, considering that the external storage device is mounted on the first operating system in the foreground before the switch, but it is not certain whether data is being transmitted between the external storage device and the first operating system at this time (that is, whether the external storage device is in use or idle), it is necessary to first determine whether the external storage device is performing data transmission. If the external storage device is performing data transmission (that is, the external storage device is in use), it is necessary to display the first prompt information so that the user can choose whether to continue to use the external storage device through the security system in the background at this time.
[0059] Based on the above embodiments, as an optional embodiment, determining whether the external storage device is in use or idle state further includes:
[0060] If it is determined that the external storage device is in an idle state, the external storage device mounted on the first operating system is unmounted, and the external storage device is mounted on the second operating system.
[0061] For example, when switching systems, considering that the external storage device is mounted on the first operating system that is in the foreground before the switch, but it is not certain whether data is being transmitted between the external storage device and the first operating system at this time (that is, whether the external storage device is in use or idle), it is necessary to first determine whether the external storage device is performing data transmission. If the external storage device is not performing data transmission (that is, the external storage device is in idle state), the external storage device is directly uninstalled from the first operating system and mounted on the second operating system.
[0062] Based on the above embodiments, as an optional embodiment, the first prompt information is displayed, and then the following is further included:
[0063] If it is determined that the first operating system does not continue to use the external storage device according to the operation on the first prompt information, the external storage device mounted on the first operating system is uninstalled and mounted on the second operating system.
[0064] It is understandable that when switching systems, if the external storage device is transmitting data (i.e., the external storage device is in use), and the user chooses not to allow the security system in the background to continue using the external storage device based on the first prompt information displayed, the external storage device will be directly uninstalled from the first operating system and mounted on the second operating system.
[0065] Based on the above embodiments, as an optional embodiment, the second prompt information is displayed, and then the following is further included:
[0066] If it is determined that the second operating system does not use the external storage device according to the operation on the second prompt information, the first operating system is instructed to keep mounting the external storage device.
[0067] For example, when switching, according to the first display information, if the user chooses the first operating system to continue using the external storage device, that is, data transmission continues between the first operating system located in the background after the switch and the external storage device to avoid data transmission interruption, then when the data transmission is completed, that is, the external storage device is in an idle state, the second prompt information is displayed through the second operating system. According to the second prompt information, the user chooses not to allow the second operating system to use the external storage device, then the first operating system is instructed to keep the external storage device mounted, and the second operating system does not mount the external storage device, and the status quo is maintained.
[0068] Based on the above embodiments, as an optional embodiment, it is determined that the first operating system continues to use the external storage device, and then includes, when it is determined that the external storage device is in use, instructing the first operating system to keep mounting the external storage device until it is determined that the external storage device is in an idle state.
[0069] It can be understood that if the external storage device is transmitting data (i.e., the external storage device is in use), if the user chooses to continue using the external storage device by the first operating system in the background at this time according to the first prompt information displayed, the first operating system is instructed to keep mounting the external storage device until it is determined that the external storage device is in an idle state (i.e., the external storage device is not transmitting data), and then the second prompt information is displayed for the user to choose.
[0070] Based on the above embodiments, as an optional embodiment, in response to the system switching operation, the first prompt information is displayed, and the following is also included:
[0071] In response to the insertion of the external storage device, an insertion event is sent to the two operating systems, so that the first operating system mounts the external storage device and the second operating system saves the mounting information, which is used to indicate that the external storage device is mounted on the first operating system.
[0072] It is understandable that when an external storage device is inserted into an electronic device, an insertion event is sent to the first operating system and the second operating system respectively, so that the first operating system currently in the foreground mounts the external storage device, and the second operating system currently in the background only saves the mounting information.
[0073] Based on the above embodiments, as an optional embodiment, the external storage device mounting method further includes:
[0074] Instruction information is sent to the two operating systems, where the instruction information is used to instruct the operating system in the foreground to mount the external storage device after receiving the insertion event, and the operating system in the background to save the mounting information after receiving the insertion event.
[0075] It is understandable that when an external storage device is inserted into the terminal, after the first operating system and the second operating system receive the insertion event, they respectively choose whether to mount the external storage device or save the mounting information according to the indication information and whether they are in the foreground or background.
[0076] Optionally, the indication information may be recorded in the insertion event, or may be sent to the two operating systems in advance, which is not specifically limited in this embodiment.
[0077] Specifically, if Figure 3As shown, it exemplarily shows a structural diagram of a dual system, that is, a software architecture diagram, the dual system includes a first operating system and a second operating system, the first operating system and the second operating system are built on the kernel (kernel), and can be in the form of a container operating system or the like. The first operating system includes a first vold (Volume Daemon, abbreviated as vold) process, a first mount service (such as a Storage Manager Service), and a first interactive application. The second operating system includes a second vold process, a second mount service, and a second interactive program. The kernel is used to obtain an insertion event of an external storage device and send it to the first vold process and the second vold process. The first vold process and the second vold process can transmit messages and instructions through the kernel. The first vold process and the first mount service can transmit messages and instructions to each other. The first mount service and the first interactive application can transmit messages and instructions to each other. The second vold process and the second mount service can transmit messages and instructions to each other. The second mount service and the second interactive application can transmit messages and instructions to each other. The first vold process and the second vold process respectively implement mounting and unmounting of the external storage device. The first mount service and the second mount service are used to determine whether the external storage device is in an idle state or in use when mounted. The first interactive application and the second interactive application are used to display first indication information and second indication information to the user.
[0078] Specifically, when an external storage device is inserted, the first vold process of the first operating system in the foreground and the second vold process of the second operating system in the background both receive the insertion event reported by the kernel. After receiving the insertion event, the first vold process notifies the first mount service, which then issues a mount instruction to the first vold process. The first operating system then mounts the external device, allowing the first operating system to read and write to the external storage device. Simultaneously, after receiving the insertion event, the second vold process saves the mount information within itself without notifying the second mount service.
[0079] When the first operating system switches to the background, if the external storage device is in use, a first prompt message is displayed to allow the user to select whether the first operating system should continue to use the external storage device. If the user selects yes, the first mount service maintains the mounted state and simultaneously notifies the second vold process via a message channel (channel service) that the external storage device is occupied by the first operating system. If the user selects no, the first mount service forces the first operating system to unmount the external storage device and notifies the second vold process via a message channel that the external storage device is now mountable.
[0080] If the external storage device is in an idle state, the first mounting service forces the first operating system to unmount the external storage device and notifies the second operating system that the external storage device is available.
[0081] When the second operating system switches to the foreground, the second vold process determines whether the external storage device can be mounted. If so, the second vold process sends an insert event to the second mount service, which executes the mount command, causing the second operating system to mount the external storage device. If not, the first operating system still mounts the external storage device and continues copying or writing to the external storage device.
[0082] It is understandable that by allowing the user to decide whether to mount the external storage device using the first operating system or the second operating system, some usage scenarios can be met. For example, the first operating system is a security system and the second operating system is a normal system. If the security system is writing to the external storage device, the user can switch the system to the normal system to run games or some applications such as WeChat that do not require high security. At the same time, the security isolation specifications of the data between the two systems are met. That is, at this time, only the security system can mount the external storage device and has read and write permissions to the external storage device.
[0083] After the first operating system completes the read and write operations on the external storage device, that is, after the external storage device is in an idle state, the first vold process sends a message to the second operating system through the message channel, causing the second interactive application to display a second prompt message, prompting the user whether the second operating system needs to mount the external storage device.
[0084] If so, the first mount service sends an unmount command to the first vold process, causing the first operating system to unmount the external storage device. At the same time, it sends a message to the second vold process via the message channel, causing the second operating system to mount the external storage device. If not, no action is taken. The first mount service maintains the mounted state and notifies the second vold process via the message channel that the external storage device is occupied by the first operating system.
[0085] The message channel can be established based on the kernel. The message transmission between the first operating system and the second operating system is controlled by the kernel. The first operating system and the second operating system are not allowed to send messages to each other bypassing the kernel to ensure the security of message transmission.
[0086] This embodiment increases the response speed of the first operating system and the second operating system in mounting or unmounting the external storage device by adding an identifier indicating whether the external storage device is mountable in the first vold process and the second vold process respectively.
[0087] In this way, although data isolation exists between the first operating system and the second operating system, the synchronization of the external storage device status information between the two systems is completed through the message channel. The first user interaction program and the second interactive application program added to the first mount service and the second mount service are used to display prompt information to the user and receive user feedback. This ensures that the insertion of the external storage device can meet both security isolation specifications and more personalized usage scenario requirements. In addition, even if the system is switched, as long as the user does not actively unplug the external storage device, the kernel will not generate an unplug event, eliminating the need for the user to unplug and reinsert the external storage device when they need to continue using it, thereby improving the user experience.
[0088] Furthermore, in response to the external storage device being unplugged, the kernel sends an unplug event to the two operating systems, so that the first operating system and the second operating system respectively cancel the saved mounting information.
[0089] Based on the above embodiments, as an optional embodiment, Figure 4 , which exemplarily shows a flow chart of a method for mounting an external storage device, the method comprising:
[0090] S200: In response to the insertion of an external storage device, an insertion event is sent to each of the two operating systems, so that the first operating system currently in the foreground mounts the external storage device and the second operating system currently in the background saves the mounting information;
[0091] S300, in response to a system switching operation, so that the first operating system is in the background and the second operating system is in the foreground, determining whether the external storage device is in use or idle state;
[0092] S301: If the external storage device is in an idle state, the external storage device mounted on the first operating system is unmounted, and the external storage device is mounted on the second operating system;
[0093] S302: If the external storage device is in use, a first prompt message is displayed to confirm whether the first operating system in the foreground before the switch continues to use the external storage device;
[0094] S401: If yes, determine whether the external storage device is in use or idle state;
[0095] S501: When it is determined that the external storage device is in use, instruct the first operating system to keep mounting the external storage device until it is determined that the external storage device is in an idle state, and then proceed to step S502;
[0096] S502: When it is determined that the external storage device is in an idle state, display a second prompt message to confirm whether the second operating system in the foreground after switching will use the external storage device;
[0097] S402: If not, uninstall the external storage device mounted on the first operating system and mount the external storage device on the second operating system;
[0098] S601: If yes, uninstall the external storage device mounted on the first operating system and mount the external storage device on the second operating system;
[0099] S602: If not, instruct the first operating system to keep mounting the external storage device.
[0100] The embodiment of the present application provides an external storage device mounting device, such as Figure 5 As shown, the external storage device mounting device may include: a first display module 701, a second display module 702 and an execution module 703, wherein the first display module 701 is used to display a first prompt message in response to a system switching operation, and the first prompt message is used to confirm whether the first operating system in the foreground before the switching continues to use the external storage device; the second display module 702 is used to determine that the first operating system continues to use the external storage device, and when it is determined that the external storage device is in an idle state, display a second prompt message, and the second prompt message is used to confirm whether the second operating system in the foreground after the switching uses the external storage device; the execution module 703 is used to determine that the second operating system uses the external storage device based on an operation on the second prompt message, then uninstall the external storage device mounted on the first operating system, and mount the external storage device on the second operating system.
[0101] Based on the above embodiments, as an optional embodiment, the external storage device mounting apparatus further includes a judgment module for determining whether the external storage device is in use or idle state;
[0102] The specific method for the first display module to display the first prompt information includes: the judgment module determines that the external storage device is in use, and the first display module displays the first prompt information.
[0103] Based on the above embodiments, as an optional embodiment, after the judgment module determines that the external storage device is in an idle state, the execution module uninstalls the external storage device mounted on the first operating system and mounts the external storage device on the second operating system.
[0104] Based on the above embodiments, as an optional embodiment, the execution module is also used to uninstall the external storage device mounted on the first operating system and mount the external storage device on the second operating system if it is determined that the first operating system will no longer use the external storage device based on the operation of the first prompt information.
[0105] Based on the above embodiments, as an optional embodiment, the execution module is further configured to instruct the first operating system to keep mounting the external storage device if it is determined that the second operating system does not use the external storage device based on the operation on the first prompt information.
[0106] Based on the above embodiments, as an optional embodiment, the execution module is also used to, when it is determined that the first operating system continues to use the external storage device, and when it is determined that the external storage device is in use, instruct the first operating system to keep the external storage device mounted until it is determined that the external storage device is in an idle state.
[0107] Based on the above embodiments, as an optional embodiment, the external storage device mounting device also includes a sending module, which is used to send an insertion event to the two operating systems in response to the external storage device being inserted into the terminal, so that the first operating system mounts the external storage device and the second operating system saves the mounting information, and the mounting information is used to indicate that the external storage device is mounted on the first operating system.
[0108] Based on the above embodiments, as an optional embodiment, the sending module is also used to send indication information to the two operating systems, and the indication information is used to instruct the operating system in the foreground to mount the external storage device after receiving the insertion event, and the operating system in the background to save the mounting information after receiving the insertion event.
[0109] The device of the embodiment of the present application can execute the method provided by the embodiment of the present application, and its implementation principle is similar. The actions performed by each module in the device of each embodiment of the present application correspond to the steps in the method of each embodiment of the present application. For the detailed functional description of each module of the device, please refer to the description in the corresponding method shown in the previous text, and will not be repeated here.
[0110] In an embodiment of the present application, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory. The processor executes the above-mentioned computer program to implement the steps of the external storage device mounting method. Compared with the related art, it can achieve: when switching systems, by providing the user with first prompt information on whether the first operating system in the foreground before the switch continues to use the external storage device, and providing the user with second prompt information on whether the second operating system uses the external storage device, it is ensured that after the system is switched, the user can choose whether to always mount the external device by the same system or to change the system for mounting the external storage device according to the user's needs, thereby improving the user experience.
[0111] In an alternative embodiment, an electronic device is provided, such as Figure 6 As shown, Figure 6 The electronic device 4000 shown includes: a processor 4001 and a memory 4003. The processor 4001 and the memory 4003 are connected, for example, via a bus 4002. Optionally, the electronic device 4000 may further include a transceiver 4004, which may be used for data exchange between the electronic device and other electronic devices, such as data transmission and / or data reception. It should be noted that in actual applications, the number of transceivers 4004 is not limited to one, and the structure of the electronic device 4000 does not constitute a limitation on the embodiments of the present application.
[0112] Processor 4001 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It may implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. Processor 4001 may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, and the like.
[0113] Bus 4002 may include a path for transmitting information between the above components. Bus 4002 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. Bus 4002 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 6 Only one thick line is used in the diagram, but this does not mean that there is only one bus or one type of bus.
[0114] The memory 4003 can be a ROM (Read Only Memory) or other types of static storage devices that can store static information and instructions, a RAM (Random Access Memory) or other types of dynamic storage devices that can store information and instructions, or an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical disk storage, optical disk storage (including compact discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.), magnetic disk storage media, other magnetic storage devices, or any other medium that can be used to carry or store computer programs and can be read by a computer, without limitation here.
[0115] The memory 4003 is used to store the computer program for executing the embodiment of the present application, and the execution is controlled by the processor 4001. The processor 4001 is used to execute the computer program stored in the memory 4003 to implement the steps shown in the above method embodiment.
[0116] An embodiment of the present application provides a storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps and corresponding contents of the aforementioned method embodiment can be implemented.
[0117] An embodiment of the present application also provides a computer program product, including a computer program, which can implement the steps and corresponding contents of the aforementioned method embodiment when executed by a processor.
[0118] The terms "first," "second," "third," "fourth," "1," "2," and the like (if any) in the specification and claims of this application and the accompanying drawings are used to distinguish similar objects and are not necessarily used to describe a particular order or sequential sequence. It should be understood that the terms used in this manner are interchangeable where appropriate, so that the embodiments of the application described herein can be implemented in an order other than that shown or described in the drawings.
[0119] It should be understood that, although each operation step is indicated by arrows in the flowchart of the embodiment of the present application, the order of implementation of these steps is not limited to the order indicated by the arrows. Unless otherwise clearly stated herein, in some implementation scenarios of the embodiment of the present application, the implementation steps in each flowchart can be performed in other orders according to demand. In addition, some or all of the steps in each flowchart can include multiple sub-steps or multiple stages based on actual implementation scenarios. Some or all of these sub-steps or stages can be executed at the same time, and each sub-step or stage in these sub-steps or stages can also be executed at different times respectively. Under different scenarios at the execution time, the execution order of these sub-steps or stages can be flexibly configured according to demand, and the embodiment of the present application does not limit this.
[0120] The above description is only an optional implementation method for some implementation scenarios of this application. It should be pointed out that for ordinary technicians in this technical field, without departing from the technical concept of the solution of this application, the use of other similar implementation methods based on the technical ideas of this application also falls within the protection scope of the embodiments of this application.
Claims
1. A method for mounting an external storage device, characterized in that: include: In response to the system switching operation, displaying a first prompt message, wherein the first prompt message is used to confirm whether the first operating system in the foreground before the switching continues to use the external storage device; If, based on the operation in response to the first prompt information, it is determined that the first operating system continues to use the external storage device, a second prompt information is displayed when the first operating system ends using the external storage device, the second prompt information being used to confirm whether the second operating system in the foreground after the switch will use the external storage device; If it is determined that the second operating system uses the external storage device based on the operation on the second prompt information, the external storage device mounted on the first operating system is uninstalled and the external storage device is mounted on the second operating system.
2. The external storage device mounting method according to claim 1, characterized in that: The display of the first prompt information further includes: Determining whether the external storage device is in use or idle state; The displaying of the first prompt information includes: If it is determined that the external storage device is in use, the first prompt information is displayed.
3. The external storage device mounting method according to claim 2, characterized in that: The step of determining whether the external storage device is in use or idle state further includes: If it is determined that the external storage device is in an idle state, the external storage device mounted on the first operating system is unmounted, and the external storage device is mounted on the second operating system.
4. The external storage device mounting method according to claim 1, wherein: The display of the first prompt information further includes: If it is determined that the first operating system does not continue to use the external storage device according to the operation in response to the first prompt information, the external storage device mounted on the first operating system is unmounted, and the external storage device is mounted on the second operating system; If it is determined that the second operating system does not use the external storage device according to the operation on the second prompt information, the first operating system is instructed to keep mounting the external storage device.
5. The external storage device mounting method according to claim 1, wherein: The determining that the first operating system continues to use the external storage device then includes, when it is determined that the external storage device is in use, instructing the first operating system to keep mounting the external storage device until it is determined that the external storage device is in an idle state.
6. The external storage device mounting method according to any one of claims 1 to 5, characterized in that: The method of displaying the first prompt information in response to the system switching operation also includes: In response to the insertion of the external storage device, an insertion event is sent to the two operating systems, so that the first operating system mounts the external storage device and the second operating system saves mounting information, where the mounting information is used to indicate that the external storage device is mounted on the first operating system.
7. The external storage device mounting method according to claim 6, characterized in that: Also includes: Instruction information is sent to the two operating systems, where the instruction information is used to instruct the operating system in the foreground to mount the external storage device after receiving the insertion event, and the operating system in the background to save the mounting information after receiving the insertion event.
8. An external storage device mounting device, characterized in that: A first display module is configured to display a first prompt message in response to a system switching operation, wherein the first prompt message is used to confirm whether the first operating system in the foreground before the switching continues to use the external storage device; a second display module configured to, if it is determined based on an operation on the first prompt information that the first operating system continues to use the external storage device, display a second prompt information when the first operating system ends using the external storage device, the second prompt information being used to confirm whether the second operating system in the foreground after the switch will use the external storage device; An execution module is used to determine that the external storage device is used by the second operating system based on an operation on the second prompt information, then uninstall the external storage device mounted on the first operating system, and mount the external storage device on the second operating system.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory, wherein: The processor executes the computer program to implement the steps of the external storage device mounting method according to any one of claims 1 to 7.
10. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the external storage device mounting method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Method for time-sharing using fixed t peripheral device for multiple operating systems
CN101452405A
Computer and method for dynamically switching equipment in virtual environment
CN101685404A