A large-capacity storage mounting method, device, terminal and medium

By creating and mounting specific directories and partitions on the Android system terminal, the problem that the terminal built-in memory does not support large-capacity storage is solved, and efficient large-capacity storage is achieved, and the terminal application can continue to access saved files.

CN114675786BActive Publication Date: 2025-05-13QINGDAO HISENSE MOBILE COMM TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210327913.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-30
Publication Date
2025-05-13
Estimated Expiration
2042-03-30

AI Technical Summary

Technical Problem

In the prior art, the built-in memory of the terminal of the Android system does not support the mass storage function, and the mass storage effect is poor, so it is impossible to effectively utilize memory resources.

Method used

By creating a first directory in the terminal's data directory, mounting the preset first target partition to the directory, creating a second directory under the directory and mounting it to the media directory, and finally mapping the first directory to the user directory under the media directory to realize the directory structure of mass storage.

Benefits of technology

It realizes displaying the media directory contents of the terminal on the computer, and ensures that the terminal application can still access saved files after exiting the mass storage mode, improving the effect of mass storage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114675786B_ABST
    Figure CN114675786B_ABST
Patent Text Reader

Abstract

The embodiment of the present application provides a method, device, terminal and medium for mounting a large-capacity storage. The embodiment of the present application only involves the media directory of the terminal, and the Android system does not rely on the media directory when running, so the embodiment of the present application can realize the directory structure as a large-capacity storage. By creating a first directory under the data directory, mounting the preset first target partition under the first directory, and mounting the second directory created under the first directory under the media directory, the media directory of the terminal is displayed in the computer based on the first target partition; and by mapping the first directory to the user directory, it is realized that whether the computer saves the file directly in the first directory or in any subdirectory of the first directory, the saved file will be mapped to the user directory, and even if the large-capacity storage mode is exited, the application in the terminal can access the saved file, which improves the large-capacity storage effect.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of user interaction technology, and in particular to a method, device, terminal and medium for mounting a large-capacity storage. Background Art

[0002] Currently, the connection modes between terminals using the Android system and computers include: USB debugging mode and mass storage mode (U disk mode). In the mass storage mode, the terminal acts as a U disk, and the user can browse the files in the terminal on the computer by operating the computer.

[0003] However, in the prior art, the built-in memory of the terminal of the Android system does not support the mass storage function. If the built-in memory is required to support the mass storage function, it can be achieved in the prior art by the following methods:

[0004] Method 1: The terminal divides an independent partition from the built-in memory and mounts the partition to the media directory of the terminal to realize the directory structure as mass storage. At this time, the second user directory and other directories under the media directory of the terminal are displayed in the computer, and the computer can add or delete files in the media directory, the second user directory or the other directory. However, if the computer copies a file to another directory during the mass storage process, then when the terminal ends the mass storage, the file will be mapped to the storage directory, and the application in the terminal will not be able to access the file.

[0005] Method 2: An independent partition is divided from the built-in memory, and the partition is mounted to the user directory of the terminal to realize the directory structure as a large-capacity storage. At this time, the computer displays the files or other subdirectories under the user directory of the terminal, but cannot display other directories except the user directory under the media directory of the terminal, that is, the large-capacity storage effect is poor. In addition, the media directory of the terminal also includes a file format (Opaque Binary Blob, obb) file for saving special public data packets of applications in the terminal. The obb file occupies a large amount of memory. Since the partition is mounted to the user directory of the terminal, the obb file is still saved in the media directory and not saved in the partition, resulting in the resources of the partition not being fully utilized. Summary of the invention

[0006] The present application provides a method, device, terminal and medium for mounting a large-capacity storage, so as to solve the problem in the prior art that the built-in memory of the terminal does not support large-capacity storage and the large-capacity storage effect is poor.

[0007] In a first aspect, an embodiment of the present application provides a mass storage mounting method, which is applied to a terminal, and the method includes:

[0008] Creating a first directory under the data directory of the terminal, and mounting a first target partition preset in the terminal to the first directory, so that the first target partition contains the content under the first directory;

[0009] Creating a second directory under the first directory, and mounting the second directory under the media directory, so that the second directory contains the content under the media directory;

[0010] The first directory is mapped to a user directory under the media directory, so that the user directory contains the content in the first target partition.

[0011] In a second aspect, an embodiment of the present application further provides a large-capacity storage mounting device, which is applied to a terminal, and the device includes:

[0012] A mounting module, configured to create a first directory under a data directory of a terminal, and mount a first target partition preset in the terminal to the first directory, so that the first target partition contains the content under the first directory; create a second directory under the first directory, and mount the second directory to a media directory, so that the second directory contains the content under the media directory;

[0013] A mapping module is used to map the first directory to a user directory under the media directory, so that the user directory contains the content in the first target partition.

[0014] In a third aspect, an embodiment of the present application further provides a terminal, which comprises at least a processor and a memory, and the processor is used to implement any of the steps of the above-mentioned mass storage mounting method when executing a computer program stored in the memory.

[0015] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, which stores a computer program, and when the computer program is executed by a processor, the steps of any of the above-mentioned mass storage mounting methods are implemented.

[0016] In the embodiment of the present application, a first directory is created under the data directory of the terminal, and a first target partition preset in the terminal is mounted under the first directory, so that the first target partition contains the content under the first directory, a second directory is created under the first directory, and the second directory is mounted under the media directory, so that the second directory contains the content under the media directory, and the first directory is mapped to the user directory under the media directory, so that the user directory contains the content in the first target partition. In the embodiment of the present application, only the media directory of the terminal is involved in mass storage, wherein the media directory is not relied on by the Android system of the terminal in operation, so the embodiment of the present application can realize a directory structure as mass storage. In addition, by creating a first directory under the data directory, mounting a preset first target partition in the terminal to the first directory, creating a second directory under the first directory, and mounting the second directory to the media directory, the media directory of the terminal is displayed in the computer based on the first target partition; and by mapping the first directory to the user directory, it is achieved that no matter whether the computer saves the file directly in the first directory or in any subdirectory of the first directory, the saved file will be mapped to the user directory, so even if the mass storage mode is exited, the application in the terminal can access the saved file, thereby improving the effect of mass storage. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the technical solution of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0018] Figure 1 A schematic diagram of the structure of a terminal 100 provided in an embodiment of the present application;

[0019] Figure 2 A software structure block diagram of a terminal 100 provided in an embodiment of the present application;

[0020] Figure 3 A schematic diagram of a large-capacity storage mounting process provided in an embodiment of the present application;

[0021] Figure 4 A schematic diagram of the save path of the obb file in the computer display interface provided in the embodiment of the present application;

[0022] Figure 5 A schematic diagram of a computer display interface provided in an embodiment of the present application;

[0023] Figure 6A schematic diagram of a mass storage mounting process provided in an embodiment of the present application;

[0024] Figure 7 A schematic diagram of the structure of a large-capacity storage mounting device provided in an embodiment of the present application;

[0025] Figure 8 A schematic diagram of a terminal structure provided for this application. DETAILED DESCRIPTION

[0026] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present application.

[0027] In an embodiment of the present application, a first directory is created under the data directory of the terminal, and a first target partition preset in the terminal is mounted under the first directory, so that the first target partition contains the content under the first directory, a second directory is created under the first directory, and the second directory is mounted under the media directory, so that the second directory contains the content under the media directory, and the first directory is mapped to a user directory under the media directory, so that the user directory contains the content in the first target partition.

[0028] In order to realize large-capacity storage of a terminal and improve the effect of large-capacity storage, the embodiments of the present application provide a large-capacity storage mounting method, device, terminal and medium.

[0029] The following describes a method for mounting a large-capacity storage device to a terminal provided in an embodiment of the present application in conjunction with the accompanying drawings.

[0030] first, Figure 1 A schematic diagram of the structure of a terminal 100 provided in an embodiment of the present application.

[0031] The embodiment is described in detail below by taking the terminal 100 as an example. It should be understood that: Figure 3 The terminal 100 shown is only an example, and the terminal 100 may have more or less components than those shown in the figure, may combine two or more components, or may have different component configurations. The various components shown in the figure may be implemented in hardware, software, or a combination of hardware and software including one or more signal processing and / or application specific integrated circuits.

[0032] Figure 1 FIG. 1 is a block diagram showing a hardware configuration of the terminal 100 according to an exemplary embodiment. Figure 1As shown, the terminal 100 includes: a radio frequency (RF) circuit 110, a memory 120, a display unit 130, a camera 140, a sensor 150, an audio circuit 160, a wireless fidelity (Wi-Fi) module 170, a processor 180, a Bluetooth module 181, and a power supply 190 and other components.

[0033] The RF circuit 110 can be used to receive and send signals during the process of sending and receiving information or making calls. It can receive downlink data from the base station and hand it over to the processor 180 for processing; it can send uplink data to the base station. Generally, the RF circuit includes but is not limited to antennas, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer and other devices.

[0034] The memory 120 can be used to store software programs and data. The processor 180 executes various functions and data processing of the terminal 100 by running the software programs or data stored in the memory 120. The memory 120 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage device. The memory 120 stores an operating system that enables the terminal 100 to run. In the present application, the memory 120 can store an operating system and various application programs, and can also store program codes for executing the method described in the embodiments of the present application.

[0035] The display unit 100 may be used to receive input digital or character information and generate signal input related to user settings and function control of the terminal 100. Specifically, the display unit 130 may include a touch screen 131 disposed on the front of the terminal 100, which may collect user touch operations on or near it, such as clicking a button, dragging a scroll box, etc.

[0036] The display unit 130 may also be used to display information input by the user or information provided to the user and a graphical user interface (GUI) of various menus of the terminal 100. Specifically, the display unit 130 may include a display screen 132 disposed on the front of the terminal 100. The display screen 132 may be configured in the form of a liquid crystal display, a light emitting diode, etc. The display unit 130 may be used to display the font color configuration interface in the present application to achieve unified configuration of the font colors of multiple / all applications.

[0037] The touch screen 131 may be covered on the display screen 132, or the touch screen 131 and the display screen 132 may be integrated to realize the input and output functions of the terminal 100, and the integrated touch screen may be referred to as a touch display screen. In the present application, the display unit 130 may display the application and the corresponding operation steps.

[0038] The camera 140 can be used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, which is then passed to the processor 180 for conversion into a digital image signal.

[0039] The terminal 100 may further include at least one sensor 150, such as an acceleration sensor 151, a distance sensor 152, a fingerprint sensor 153, and a temperature sensor 154. The terminal 100 may also be configured with other sensors such as a gyroscope, a barometer, a hygrometer, a thermometer, an infrared sensor, a light sensor, and a motion sensor.

[0040] The audio circuit 160, the speaker 161, and the microphone 162 can provide an audio interface between the user and the terminal 100. The audio circuit 160 can transmit the electrical signal converted from the received audio data to the speaker 161, which is converted into a sound signal for output. The terminal 100 can also be configured with a volume button for adjusting the volume of the sound signal. On the other hand, the microphone 162 converts the collected sound signal into an electrical signal, which is received by the audio circuit 160 and converted into audio data, and then the audio data is output to the RF circuit 110 to be sent to, for example, another terminal, or the audio data is output to the memory 120 for further processing. In this application, the microphone 162 can obtain the user's voice.

[0041] Wi-Fi is a short-range wireless transmission technology. The terminal 100 can help users send and receive emails, browse web pages, and access streaming media through the Wi-Fi module 170, which provides users with wireless broadband Internet access.

[0042] The processor 180 is the control center of the terminal 100. It uses various interfaces and lines to connect various parts of the entire terminal. It executes various functions of the terminal 100 and processes data by running or executing software programs stored in the memory 120 and calling data stored in the memory 120. In some embodiments, the processor 180 may include one or more processing units; the processor 180 may also integrate an application processor and a baseband processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the baseband processor mainly processes wireless communications. It is understandable that the above-mentioned baseband processor may not be integrated into the processor 180. In the present application, the processor 180 can run the operating system, application programs, user interface display and touch response, and the font color control method described in the embodiment of the present application. In addition, the processor 180 is coupled to the display unit 130.

[0043] The Bluetooth module 181 is used to exchange information with other Bluetooth devices having Bluetooth modules through the Bluetooth protocol. For example, the terminal 100 can establish a Bluetooth connection with a wearable electronic device (such as a smart watch) that also has a Bluetooth module through the Bluetooth module 181 to exchange data.

[0044] The terminal 100 also includes a power supply 190 (such as a battery) for supplying power to various components. The power supply can be logically connected to the processor 180 through a power management system, so that the power management system can manage functions such as charging, discharging, and power consumption. The terminal 100 can also be configured with a power button for turning on and off the terminal, as well as locking the screen and other functions.

[0045] Figure 2 A software structure block diagram of a terminal 100 provided in an embodiment of the present application.

[0046] The layered architecture divides the software into several layers, each with clear roles and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system can be divided into four layers, from top to bottom: the application layer, the application framework layer, the Android runtime and system library, and the kernel layer.

[0047] The application layer can include a series of application packages.

[0048] like Figure 2 As shown, the application package may include camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message and other applications.

[0049] The application framework layer provides an application programming interface (API) and a programming framework for the applications in the application layer. The application framework layer includes some predefined functions.

[0050] like Figure 2 As shown, the application framework layer may include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, and the like.

[0051] The window manager is used to manage window programs. The window manager can obtain the display screen size, determine whether there is a status bar, lock the screen, capture the screen, etc.

[0052] Content providers are used to store and retrieve data and make it accessible to applications. The data may include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, short messages, etc.

[0053] The view system includes visual controls, such as controls for displaying photos, controls for displaying text, controls for displaying pictures, etc. The view system can be used to build applications. The display interface can be composed of one or more views. For example, the display interface of an application for capturing images can include a view for displaying text and a view for displaying pictures.

[0054] The phone manager is used to provide communication functions of the terminal 100, such as management of call status (including connection, disconnection, etc.).

[0055] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, etc.

[0056] The notification manager enables applications to display notification information (such as message summaries and message contents) in the status bar. It can be used to convey notification-type messages and can automatically disappear after a short stay without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc. The notification manager can also be a notification that appears in the system top status bar in the form of a chart or scroll bar text, such as notifications of applications running in the background, or a notification that appears on the screen in the form of a dialog window. For example, a text message is displayed in the status bar, a prompt sound is emitted, the terminal vibrates, the indicator light flashes, etc.

[0057] Android Runtime includes core libraries and virtual machines. Android runtime is responsible for scheduling and management of the Android system.

[0058] The core library consists of two parts: one part is the function that needs to be called by the Java language, and the other part is the Android core library.

[0059] The application layer and the application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.

[0060] The system library may include multiple functional modules, such as surface manager, media library, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.

[0061] The surface manager is used to manage the display subsystem and provide the fusion of 2D and 3D layers for multiple applications.

[0062] The media library supports playback and recording of a variety of commonly used audio and video formats, as well as static image files, etc. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.

[0063] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.

[0064] A 2D (animation mode) graphics engine is a drawing engine for 2D drawing.

[0065] The kernel layer is the layer between hardware and software. The kernel layer contains at least display driver, camera driver, audio driver, and sensor driver.

[0066] The terminal 100 in the embodiment of the present application may be a mobile phone or the like.

[0067] Figure 3 A schematic diagram of a mass storage mounting process provided in an embodiment of the present application, the process includes:

[0068] S301: Create a first directory under the data directory of the terminal, and mount a first target partition preset in the terminal to the first directory, so that the first target partition contains the content under the first directory.

[0069] A mass storage mounting method provided in an embodiment of the present application is applied to a terminal, which is a terminal using an Android system.

[0070] In an embodiment of the present application, a technician pre-allocates a blank independent first target partition from the built-in memory of the terminal, connects the terminal to the computer and turns on mass storage, and after entering the mass storage mode, only the content in the first target partition can be displayed in the computer.

[0071] In order to display the contents in the media directory of the terminal in the computer, and the files and other contents saved by the computer to the terminal in the mass storage mode can still be used by the applications installed in the terminal after the mass storage ends. In the embodiment of the present application, after the terminal turns on the mass storage and enters the mass storage mode, a first directory is created in the data directory of the terminal, and a first target partition preset in the terminal for mass storage is mounted to the first directory, so that the first target partition contains the contents in the first directory, thereby realizing the display of the contents in the first directory in the computer.

[0072] Specifically, in the implementation of the present application, the terminal creates a new folder in the data directory, determines the saving path of the folder as the first directory, and then mounts the first target partition to the first directory, so that the first target partition contains the content in the first directory. In the embodiment of the present application, the data directory is / data / .

[0073] It should be noted that in the embodiment of the present application, since the first target partition is an independent partition preset by the technician for large-capacity storage and does not store any content, there is no content in the first target partition before the first target partition is mounted to the first directory. Based on this, after the first target partition is mounted to the first directory, the content in the first target partition is the content under the first directory. However, since the first directory is a newly created directory and no content has been saved in the first directory at present, there is no content under the first directory, and there is no content in the first target partition at present.

[0074] For example, in an embodiment of the present application, the first target partition preset in the terminal is / dev / block / mmcblk0p21. After the terminal turns on mass storage, a new folder is created in the data directory, and the new folder is named media_ext, then the path of the folder is / data / media_ext, that is, the first directory created by the terminal in the data directory is / data / media_ext. After creating the first directory, the terminal mounts the first target partition to the first directory, that is, / dev / block / mmcblk0p21 is mounted to / data / media_ext.

[0075] S302: Create a second directory under the first directory, and mount the second directory to the media directory, so that the second directory contains the content under the media directory.

[0076] In an embodiment of the present application, in order to enable the computer to display the content under the media directory when displaying the content in the first target partition, in an embodiment of the present application, the terminal creates a second directory under the first directory and mounts the second directory to the media directory, so that the second directory contains the content under the media directory.

[0077] It should be noted that in the embodiment of the present application, since the second directory is a newly created directory, there is no content in the second directory before the second directory is mounted to the media directory. Based on this, after the second directory is mounted to the media directory, the content under the second directory is the content under the media directory.

[0078] In the embodiment of the present application, it can be known from the above S101 that the terminal mounts the first target partition to the first directory, and the content in the first target partition is the content in the first directory. Then, after the mass storage is turned on, the content displayed in the computer is the content in the first target partition, that is, the content displayed in the computer is the content in the first directory. Among them, the first directory contains the content in the second directory, and the second directory contains the content in the media directory. The media directory is a subdirectory in the first target partition, so that when the computer displays, the content displayed is the content in the media directory, and it is realized that after the terminal turns on the mass storage, the computer can display the content in the terminal media directory.

[0079] In addition, in the embodiment of the present application, since the media directory is a subdirectory in the first target partition, after the mass storage is enabled, the obb file originally saved in the media directory is equivalent to being saved in the first target partition, thereby improving the resource utilization of the first target partition.

[0080] Figure 4 A schematic diagram of the save path of the obb file in the computer display interface provided in the embodiment of the present application, such as the Figure 4 As shown, UsbStorage(G:) is the name of the first target partition in the computer, and user-root is the second directory. Since the second directory is mounted to the media directory, the content stored in the second directory is the content in the media directory. Since the obb file is stored in the media directory, the obb file is stored in the first target partition in the embodiment of the present application.

[0081] For example, in the embodiment of the present application, the first directory in the terminal is / data / media_ex, and the terminal creates a second directory under the first directory and names the second directory as / data / media_ext / user-root. After creating the second directory, the terminal mounts the second directory under the media directory, where the media directory is / data / media, that is, the terminal mounts / data / media_ext / user-root under / data / media.

[0082] S303: Map the first directory to a user directory under the media directory, so that the user directory contains the content in the first target partition.

[0083] The applications installed in the terminal can only access the user directory in the terminal. Based on this, in order to enable the files and other contents saved by the computer to the terminal in mass storage mode to be still used by the applications installed in the terminal after the mass storage is ended, in an embodiment of the present application, the files saved by the computer to the terminal must be saved in the user directory.

[0084] Specifically, in the embodiment of the present application, in order to save the files saved by the computer to the terminal in the user directory, the terminal maps the first directory to the user directory. Wherein, the user directory is in the media directory, and the user directory can be / data / media / 0.

[0085] That is to say, in the embodiment of the present application, after the terminal turns on mass storage, the content displayed in the computer is the content under the first directory, and when the computer saves a file, it saves the file in the first directory. After mapping the first directory to the user directory, no matter whether the computer saves the file directly in the first directory or in any subdirectory of the first directory, the saved file will be mapped to the user directory. Even if the mass storage mode is exited, the application in the terminal can access the saved file.

[0086] For example, in an embodiment of the present application, the first directory of the terminal is / data / media_ext, and the user directory of the terminal is / data / media / 0. Then, the first directory is mapped to the user directory under the media directory, that is, / data / media_ext is mapped to / data / media / 0.

[0087] In the embodiment of the present application, only the media directory of the terminal is involved in the mass storage, wherein the media directory is not relied on by the terminal's Android system in operation, so the embodiment of the present application can realize the directory structure as mass storage. In addition, by creating a first directory under the data directory, mounting the first target partition preset in the terminal to the first directory, creating a second directory under the first directory, and mounting the second directory to the media directory, the media directory of the terminal is displayed in the computer based on the first target partition; and by mapping the first directory to the user directory, it is realized that no matter whether the computer saves the file directly in the first directory or in any subdirectory of the first directory, the saved file will be mapped to the user directory, so even if the mass storage mode is exited, the application in the terminal can access the saved file, thereby improving the effect of mass storage.

[0088] In order to enable the files saved by the computer in the first target partition to be accessed by the application in the terminal after the mass storage is completed, based on the above embodiment, in the embodiment of the present application, mapping the first directory to the user directory under the media directory includes:

[0089] If the user directory includes a main user directory, the first directory is mapped to the main user directory.

[0090] In the embodiments of the present application, some terminals may support multi-user mode, that is, there is a master user and at least one slave user in a terminal, where the master user has all permissions, but the permissions of the slave user can be configured by the user; some terminals may only support single-user mode, that is, there is only one master user in a terminal. Among them, for a terminal that supports multi-user mode, the user directory of the terminal includes a master user directory and at least one slave user directory; for a terminal that supports single-user mode, the user directory of the terminal includes only a master user directory. Generally, in the embodiments of the present application, the master user directory is / data / media / 0.

[0091] In the prior art, when preparing the storage directory structure of the terminal, the terminal maps the media directory / data / media / to the storage directory / storage / emulated. Specifically, the terminal virtualizes the media directory into an independent partition and maps the partition to the storage directory. When the multi-user mode of the terminal is started, a user directory corresponding to the current user will be generated under the media directory. In addition, due to the mapping relationship between the storage directory and the media directory, when there is a user directory corresponding to any user under the media directory, the user directory corresponding to the user can also be seen under the storage directory, and the contents stored in the two user directories are the same. For example, if the main user id is 0, the main user directory corresponding to the main user under the media directory is / data / media / 0, and the user directory corresponding to the main user directory under the storage directory is / storage / emulated / 0; if the slave user id is 10, the slave user directory corresponding to the slave user under the media directory is / data / media / 10, and the user directory corresponding to the slave user directory under the storage directory is / storage / emulated / 10.

[0092] During the use of the terminal, the terminal allows applications in the terminal to access the content in the user directory under the storage directory, such as the content under / storage / emulated / 0, that is, the content in the user directory under the media directory. Therefore, in the embodiment of the present application, in order to enable the files saved by the computer in the first target partition to be accessed by applications in the terminal after the mass storage is completed, it is necessary to map the first directory to the user directory under the media directory.

[0093] Since no matter whether the terminal supports multi-user mode or single-user mode, the user directory of the terminal includes a main user directory, and the main user directory has all permissions, in an embodiment of the present application, for any terminal, when mapping the first directory to the user directory under the media directory, the first directory is mapped to the main user directory, so that if the computer saves a file in the first target partition, the application installed in the terminal under the user directory can access the file after the terminal completes the mass storage.

[0094] For example, in an embodiment of the present application, the main user directory is / data / media / 0, and the first directory is / data / media_ext. Mapping the first directory to the user directory under the media directory is to map / data / media_ext to / data / media / 0.

[0095] In order to further realize that the files saved by the computer in the first target partition can be accessed by the application in the terminal after the mass storage is completed, based on the above embodiments, in the embodiment of the present application, the method further includes:

[0096] If the user directory also includes at least one slave user directory, for each slave user directory, obtain the access rights pre-configured for the slave user directory, and determine whether the slave user directory has permission to access the media directory based on the access rights; if so, map the first directory to the slave user directory.

[0097] If the terminal is a terminal that supports multi-user mode, in an embodiment of the present application, when mapping the first directory to a user directory under the media directory, for each slave user directory of the terminal, it is necessary to determine whether the first directory needs to be mapped to the slave user directory.

[0098] In the embodiment of the present application, the terminal is pre-configured with access rights corresponding to each slave user directory, wherein the access rights are the access rights of the slave user directory to the media directory, the access rights to the call content, etc. The terminal can map the first directory to the slave user directory having access rights to the media directory.

[0099] Specifically, in an embodiment of the present application, if the user directory also includes at least one slave user directory, then for each slave user directory, the pre-configured access rights corresponding to the slave user directory are obtained, and then the permission to access the media directory corresponding to the slave user directory is searched from the access rights; if the slave user directory has the permission to access the media directory, the first directory is mapped to the slave user directory.

[0100] In order to create a second directory under a first directory, based on the above embodiments, in an embodiment of the present application, the step of creating a second directory under the first directory includes:

[0101] A new target folder is created under the first directory, and the saving path of the folder is determined as the second directory.

[0102] In the embodiment of the present application, when creating the second directory under the first directory, the terminal creates a new target folder under the first directory and determines the saving path of the target folder as the second directory.

[0103] For example, in an embodiment of the present application, the first directory in the terminal is / data / media_ex, the terminal creates a target folder under the first directory, and names the target folder user-root, where the save path of the target folder is / data / media_ext / user-root, that is, the second directory created by the terminal under the first directory is / data / media_ext / user-root.

[0104] In order to mount the second directory to the media directory, based on the above embodiments, in the embodiment of the present application, mounting the second directory to the media directory includes:

[0105] The target folder is virtualized as a second target partition, and the second target partition is mounted under the media directory.

[0106] Due to the limitation of the mount function, only one partition of the terminal can be mounted to the directory during mounting, wherein the partition can be a real partition or a virtual partition. Therefore, in the embodiment of the present application, when mounting the second directory to the media directory, it is necessary to first virtualize the second directory as an independent partition, and then mount the second directory to the media directory.

[0107] Specifically, in the embodiment of the present application, the second directory is virtualized as a partition. In order to distinguish it from the preset first target partition, in the embodiment of the present application, the partition virtualized by the second directory becomes the second target partition, and then the second target partition is mounted under the media directory. The virtualization of the second directory as a partition is an existing technology that can be currently implemented by the terminal, and will not be described in detail here.

[0108] Figure 5 A schematic diagram of a computer display interface provided in an embodiment of the present application, such as the Figure 5 As shown, UsbStorage(G:) is the name of the first target partition in the computer, and the user-root file is a newly created target folder in the first directory. Since the target folder is virtualized as the second target partition and mounted under the media directory, the content saved in the user-root is the content saved in the media directory of the terminal, and the computer also saves the config.txt file in the first target partition and maps the config.txt file to the user directory based on the first directory.

[0109] Figure 6 A schematic diagram of a large-capacity storage mounting process provided in an embodiment of the present application, such as the Figure 6 As shown, the process includes:

[0110] S601: Create a first directory / data / media_ext under the data directory of the terminal.

[0111] S602: Mount the first target partition / dev / block / mmcblk0p21 preset in the terminal to the first directory / data / media_ext.

[0112] S603: Create a new target folder user-root under the first directory / data / media_ext.

[0113] S604: The target folder user-root is virtualized as a second target partition, and the second target partition is mounted to the media directory / data / media.

[0114] S605: Map the first directory / data / media_ext to the user directory / data / media / 0 under the media directory / data / media.

[0115] Figure 7 A schematic diagram of a large-capacity storage mounting device structure provided in an embodiment of the present application, such as the Figure 7 As shown, the device comprises:

[0116] The mounting module 701 is used to create a first directory under the data directory of the terminal, and mount a first target partition preset in the terminal to the first directory, so that the first target partition contains the content under the first directory; create a second directory under the first directory, and mount the second directory to the media directory, so that the second directory contains the content under the media directory;

[0117] The mapping module 702 is used to map the first directory to a user directory under the media directory, so that the user directory contains the content in the first target partition.

[0118] In a possible implementation, the mapping module 702 is specifically configured to map the first directory to the main user directory if the user directory includes a main user directory.

[0119] In a possible implementation, the mapping module 702 is further used to, if the user directory also includes at least one slave user directory, obtain, for each slave user directory, access permissions pre-configured for the slave user directory, and determine, based on the access permissions, whether the slave user directory has permission to access the media directory; if so, map the first directory to the slave user directory.

[0120] In a possible implementation, the mounting module 701 is specifically configured to create a new target folder under the first directory, and determine the saving path of the folder as the second directory.

[0121] In a possible implementation manner, the mounting module 701 is specifically configured to virtualize the target folder into a second target partition, and mount the second target partition to a media directory.

[0122] Figure 8 A schematic diagram of a terminal structure provided by the present application. Based on the above embodiments, the present application also provides a terminal, such as Figure 8 As shown, it includes: a processor 801, a communication interface 802, a memory 803 and a communication bus 804, wherein the processor 801, the communication interface 802, and the memory 803 communicate with each other through the communication bus 804;

[0123] The memory 803 stores a computer program, and when the program is executed by the processor 801, the processor 801 executes the steps of the above method.

[0124] Since the principle of solving the problem by the above terminal is similar to that of mass storage mounting, the implementation of the above terminal can refer to the above embodiment, and the repeated parts will not be repeated.

[0125] The communication bus mentioned in the above terminal can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus. The communication interface 802 is used for communication between the above terminal and other devices. The memory may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor. The above processor may be a general-purpose processor, including a central processing unit, a network processor (NP), etc.; it may also be a digital signal processing processor (DSP), an application-specific integrated circuit, a field programmable gate array or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc.

[0126] Based on the above embodiments, some embodiments of the present application further provide a computer-readable storage medium, which stores a computer program executable by a processor. When the program runs on the processor, the processor implements the steps of the above method when executing.

[0127] Since the principle of solving the problem by the above-mentioned computer-readable storage medium is similar to that of the mass storage mounting method, the implementation of the above-mentioned computer-readable storage medium can refer to the embodiment of the method, and the repeated parts will not be repeated.

[0128] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0129] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0130] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0131] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1The steps for the functions specified in one or more boxes.

[0132] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. A method for mounting a large-capacity storage device, applied to a terminal, characterized in that: The method comprises: Creating a first directory under the data directory of the terminal, and mounting a first target partition preset in the terminal to the first directory, so that the first target partition contains the content under the first directory; Creating a second directory under the first directory, and mounting the second directory under the media directory, so that the second directory contains the content under the media directory; Mapping the first directory to a user directory under the media directory, so that the user directory contains the content in the first target partition; wherein the media directory is a subdirectory in the first target partition; Mapping the first directory to the user directory under the media directory comprises: If the user directory includes a main user directory, mapping the first directory to the main user directory; The method further comprises: If the user directory also includes at least one slave user directory, for each slave user directory, obtain the access rights pre-configured for the slave user directory, and determine whether the slave user directory has permission to access the media directory based on the access rights; if so, map the first directory to the slave user directory.

2. The method according to claim 1, characterized in that The step of creating a second directory under the first directory includes: A new target folder is created under the first directory, and the saving path of the folder is determined as the second directory.

3. The method according to claim 2, characterized in that Mounting the second directory to the media directory includes: The target folder is virtualized as a second target partition, and the second target partition is mounted under the media directory.

4. A large-capacity storage mounting device, applied to a terminal, characterized in that: The device comprises: A mounting module, configured to create a first directory under a data directory of a terminal, and mount a first target partition preset in the terminal to the first directory, so that the first target partition contains the content under the first directory; create a second directory under the first directory, and mount the second directory to a media directory, so that the second directory contains the content under the media directory; A mapping module, used for mapping the first directory to a user directory under the media directory, so that the user directory contains the content in the first target partition; wherein the media directory is a subdirectory in the first target partition; The mapping module is specifically configured to map the first directory to the main user directory if the user directory includes a main user directory; The mapping module is further used to, if the user directory also includes at least one slave user directory, obtain, for each slave user directory, the access rights pre-configured for the slave user directory, and determine, based on the access rights, whether the slave user directory has the authority to access the media directory; if so, map the first directory to the slave user directory.

5. A terminal, characterized in that: The terminal comprises at least a processor and a memory, and the processor is used to implement the steps of the mass storage mounting method described in any one of claims 1 to 3 when executing a computer program stored in the memory.

6. A computer-readable storage medium, characterized in that: It stores a computer program, which, when executed by a processor, implements the steps of the mass storage mounting method described in any one of claims 1 to 3.

Citation Information

Patent Citations

  • Shared file operation method and device for Linux compatible Android system

    CN113986858A

  • Method and system for accessing Linux local directory and file by Android

    CN114185851A