CN114675786A - Large-capacity storage mounting method, device, terminal and medium - Google Patents

Large-capacity storage mounting method, device, terminal and medium Download PDF

Info

Publication number
CN114675786A
CN114675786A CN202210327913.9A CN202210327913A CN114675786A CN 114675786 A CN114675786 A CN 114675786A CN 202210327913 A CN202210327913 A CN 202210327913A CN 114675786 A CN114675786 A CN 114675786A
Authority
CN
China
Prior art keywords
directory
terminal
user
media
under
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210327913.9A
Other languages
Chinese (zh)
Inventor
孙哲
孙晓
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hisense Mobile Communications Technology Co Ltd
Original Assignee
Hisense Mobile Communications Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hisense Mobile Communications Technology Co Ltd filed Critical Hisense Mobile Communications Technology Co Ltd
Priority to CN202210327913.9A priority Critical patent/CN114675786A/en
Publication of CN114675786A publication Critical patent/CN114675786A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0604Improving or facilitating administration, e.g. storage management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0629Configuration or reconfiguration of storage systems
    • G06F3/0631Configuration or reconfiguration of storage systems by allocating resources to storage systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • G06F3/0644Management of space entities, e.g. partitions, extents, pools

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Telephone Function (AREA)

Abstract

The embodiment of the application provides a method, a device, a terminal and a medium for mounting mass storage, and the embodiment of the application only relates to a media directory of the terminal, and an Android system does not depend on the media directory during operation, so that the embodiment of the application can be used as a directory structure of mass storage. Creating a first directory under a data directory, mounting a preset first target partition under the first directory, and mounting a second directory created under the first directory under a media directory, so as to display the media directory of a terminal in a computer based on the first target partition; and by mapping the first directory to the user directory, the stored files are mapped to the user directory no matter the computer directly stores the files in the first directory or stores the files in any subdirectory of the first directory, and even if the computer exits from the mass storage mode, the application in the terminal can access the stored files, thereby improving the mass storage effect.

Description

Large-capacity storage mounting method, device, terminal and medium
Technical Field
The present application relates to the field of user interaction technologies, and in particular, to a method, an apparatus, a terminal, and a medium for mass storage mounting.
Background
The connection mode between a terminal using an Android (Android) system and a computer at present includes: USB debug mode and mass storage mode (USB disk mode). In the mass storage mode, the terminal functions as a U disk, and a user can browse files in the terminal in the computer by operating the computer.
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, the prior art can realize the following steps:
the first method is as follows: the terminal divides an independent partition from the built-in memory and mounts the partition under the media directory of the terminal to realize a directory structure as a large-capacity storage. And displaying a second user directory and other directories under the media directory of the terminal in the computer, and adding or deleting files under the media directory, the second user directory or the other directories by the computer. However, if the computer copies the file to another directory during the mass storage process, the file will be mapped to the storage directory after the mass storage of the terminal is finished, and the application in the terminal will not be able to access the file.
The second method comprises the following steps: an independent partition is partitioned from the built-in memory, and the partition is mounted under a user directory of the terminal to realize a directory structure as a large-capacity storage. In this case, files or other sub-directories under the user directory of the terminal are displayed in the computer, but other directories except the user directory under the media directory of the terminal cannot be displayed, i.e., the effect of large-capacity storage is poor. And the media directory of the terminal further includes a file in a file format (Opaque Binary Blob, obb) for storing a special public data packet of an application in the terminal, the memory occupied by the obb file is large, and since the partition is mounted to the user directory of the terminal, the obb file is still stored in the media directory and is not stored in the partition, so that the resource of the partition is not fully utilized.
Disclosure of Invention
The application provides a method, a device, a terminal and a medium for mounting a large-capacity storage, which are used for solving the problems that the built-in memory of the terminal in the prior art does not support the large-capacity storage and the large-capacity storage effect is poor.
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:
creating a first directory under a data directory of a terminal, and mounting a first target partition preset in the terminal under the first directory, so that the first target partition comprises contents under the first directory;
creating a second directory under the first directory, and mounting the second directory under a media directory, so that the second directory contains contents under the media directory;
and 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.
In a second aspect, an embodiment of the present application further provides a mass storage mounting apparatus, which is applied to a terminal, and the apparatus includes:
the mounting module is used for creating a first directory under a data directory of a terminal and mounting a first target partition preset in the terminal under the first directory, so that the first target partition comprises contents under the first directory; creating a second catalog under the first catalog, and mounting the second catalog under a media catalog, so that the second catalog contains contents under the media catalog;
and the mapping module is 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.
In a third aspect, an embodiment of the present application further provides a terminal, where the terminal includes at least a processor and a memory, and the processor is configured to implement the steps of the mass storage mounting method described in any one of the foregoing when executing the computer program stored in the memory.
In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, which stores a computer program, and the computer program, when executed by a processor, implements the steps of the mass storage mounting method described in any one of the above.
In this embodiment of the present application, a first directory is created under a data directory of a terminal, a first target partition preset in the terminal is mounted to the first directory, so that the first target partition includes content under the first directory, a second directory is created under the first directory, the second directory is mounted to a media directory, so that the second directory includes content under the media directory, and the first directory is mapped to a user directory under the media directory, so that the user directory includes content in the first target partition. In the embodiment of the application, only the media directory of the terminal is involved in the large-capacity storage, wherein the media directory is not relied on by the Android system of the terminal in the operation, so that the embodiment of the application can realize a directory structure as the large-capacity storage. In addition, a first directory is created under the data directory, a first target partition preset in the terminal is mounted 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 media directory of the terminal is displayed in the computer on the basis of the first target partition; and mapping the first directory to the user directory realizes that the application in the terminal can access the saved file even if the computer exits the mass storage mode and the saved file is mapped to the user directory no matter whether the computer directly saves the file in the first directory or saves the file in any subdirectory of the first directory, thereby improving the effect of mass storage.
Drawings
In order to more clearly illustrate the technical solutions of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings without creative efforts.
Fig. 1 is a schematic structural diagram of a terminal 100 according to an embodiment of the present disclosure;
fig. 2 is a block diagram of a software structure of a terminal 100 according to an embodiment of the present disclosure;
FIG. 3 is a diagram illustrating a mass storage mount process according to an embodiment of the present application;
FIG. 4 is a schematic diagram illustrating a saving path of obb files in a computer display interface according to an embodiment of the present application;
FIG. 5 is a schematic diagram of a computer display interface provided by an embodiment of the present application;
FIG. 6 is a schematic diagram illustrating a mass storage mount process according to an embodiment of the present application;
FIG. 7 is a schematic structural diagram of a mass storage mounting device according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of a terminal provided in the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application clearer, the present application will be described in further detail with reference to the accompanying drawings, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
In the embodiment of the application, a first directory is created under a data directory of a terminal, a first target partition preset in the terminal is mounted to the first directory, so that the first target partition contains content under the first directory, a second directory is created under the first directory, the second directory is mounted to a media directory, so that the second directory contains 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 content under the first target partition.
In order to realize the mass storage of the terminal and improve the effect of the mass storage, the embodiment of the application provides a mass storage mounting method, a mass storage mounting device, a terminal and a medium.
The following describes a mass storage mounting method applied to a terminal according to an embodiment of the present application with reference to the drawings.
First, fig. 1 is a schematic structural diagram of a terminal 100 according to an embodiment of the present disclosure.
The following describes an embodiment specifically by taking the terminal 100 as an example. It should be understood that the terminal 100 shown in fig. 3 is merely an example, and that the terminal 100 may have more or fewer components than shown in the figures, may combine two or more components, or may have a different configuration of components. The various components shown in the figures 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.
A block diagram of a hardware configuration of the terminal 100 according to an exemplary embodiment is exemplarily shown in fig. 1. As shown in fig. 1, 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.
The RF circuit 110 may be used for receiving and transmitting signals during information transmission and reception or during a call, and may receive downlink data of a base station and then send the downlink data to the processor 180 for processing; the uplink data may be transmitted to the base station. Typically, the RF circuitry includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, and the like.
The memory 120 may be used to store software programs and data. The processor 180 performs various functions of the terminal 100 and data processing by executing software programs or data stored in the memory 120. The memory 120 may include high speed random access memory and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device. The memory 120 stores an operating system that enables the terminal 100 to operate. The memory 120 may store an operating system and various application programs, and may also store program codes for performing the methods described in the embodiments of the present application.
The display unit 100 may be used to receive input numeric or character information and generate signal input related to user settings and function control of the terminal 100, and particularly, the display unit 130 may include a touch screen 131 disposed on the front surface of the terminal 100 and may collect touch operations of a user thereon or nearby, such as clicking a button, dragging a scroll box, and the like.
The display unit 130 may also be used to display a Graphical User Interface (GUI) of information input by or provided to the user and various menus of the terminal 100. Specifically, the display unit 130 may include a display screen 132 disposed on the front surface of the terminal 100. The display screen 132 may be configured in the form of a liquid crystal display, a light emitting diode, or the like. The display unit 130 may be configured to display a font color configuration interface in the present application, so as to implement uniform configuration of font colors of multiple/all applications.
The touch screen 131 may cover the display screen 132, or the touch screen 131 and the display screen 132 may be integrated to implement the input and output functions of the terminal 100, and after the integration, the touch screen may be referred to as a touch display screen for short. In the present application, the display unit 130 may display the application programs and the corresponding operation steps.
The camera 140 may be used to capture still images or video. The object generates an optical image through the lens and projects the optical image to the photosensitive element. The photosensitive element may be a Charge Coupled Device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The light sensing elements convert the light signals into electrical signals which are then passed to the processor 180 for conversion into digital image signals.
The terminal 100 may further comprise at least one sensor 150, such as an acceleration sensor 151, a distance sensor 152, a fingerprint sensor 153, a temperature sensor 154. The terminal 100 may also be configured with other sensors such as a gyroscope, barometer, hygrometer, thermometer, infrared sensor, light sensor, motion sensor, etc.
Audio circuitry 160, speaker 161, and microphone 162 may provide an audio interface between a user and terminal 100. The audio circuit 160 may transmit the electrical signal converted from the received audio data to the speaker 161, and convert the electrical signal into a sound signal for output by the speaker 161. The terminal 100 may also be provided 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, converts the electrical signal into audio data after being received by the audio circuit 160, and outputs the audio data to the RF circuit 110 to be transmitted to, for example, another terminal or outputs the audio data to the memory 120 for further processing. In this application, the microphone 162 may capture the voice of the user.
Wi-Fi belongs to a short-distance wireless transmission technology, and the terminal 100 can help a user to send and receive e-mails, browse webpages, access streaming media, and the like through the Wi-Fi module 170, and provides wireless broadband internet access for the user.
The processor 180 is a control center of the terminal 100, connects various parts of the entire terminal using various interfaces and lines, and performs 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, processor 180 may include one or more processing units; the processor 180 may also integrate an application processor, which mainly handles operating systems, user interfaces, applications, etc., and a baseband processor, which mainly handles wireless communications. It will be appreciated that the baseband processor described above may not be integrated into the processor 180. In the present application, the processor 180 may run an operating system, an application program, a user interface display, and a touch response, and the font color control method described in the embodiments of the present application. Further, the processor 180 is coupled with the display unit 130.
And the bluetooth module 181 is configured to perform information interaction with other bluetooth devices having bluetooth modules through a bluetooth protocol. For example, the terminal 100 may establish a bluetooth connection with a wearable electronic device (e.g., a smart watch) having a bluetooth module via the bluetooth module 181, so as to perform data interaction.
The terminal 100 also includes a power supply 190 (e.g., a battery) to power the various components. The power supply may be logically connected to the processor 180 through a power management system to manage charging, discharging, power consumption, etc. through the power management system. The terminal 100 may also be configured with power buttons for powering the terminal on and off, and locking the screen.
Fig. 2 is a block diagram of a software structure of a terminal 100 according to an embodiment of the present disclosure.
The layered architecture divides the software into several layers, each layer having a clear role and division of labor. The layers communicate with each other through a software interface. In some embodiments, the Android system may be divided into four layers, an application layer, an application framework layer, an Android runtime (Android runtime) and system library, and a kernel layer, from top to bottom, respectively.
The application layer may include a series of application packages.
As shown in fig. 2, the application package may include applications such as camera, gallery, calendar, phone call, map, navigation, WLAN, bluetooth, music, video, short message, etc.
The application framework layer provides an Application Programming Interface (API) and a programming framework for the application program of the application layer. The application framework layer includes a number of predefined functions.
As shown in FIG. 2, the application framework layers may include a window manager, content provider, view system, phone manager, resource manager, notification manager, and the like.
The window manager is used for managing window programs. The window manager can obtain the size of the display screen, judge whether a status bar exists, lock the screen, intercept the screen and the like.
The content provider is used to store and retrieve data and make it accessible to applications. The data may include video, images, audio, dialed and answered calls, browsing history and bookmarks, phone books, short messages, etc.
The view system includes visual controls such as controls to display a photograph, controls to display text, controls to display pictures, and the like. The view system may be used to build applications. The display interface may be composed of one or more views. For example, a display interface including an application for capturing images may include a view displaying text and a view displaying pictures.
The phone manager is used to provide a communication function of the terminal 100. Such as management of call status (including on, off, etc.).
The resource manager provides various resources, such as localized strings, icons, pictures, layout files, video files, etc., to the application.
The notification manager allows the application to display notification information (e.g., message digest of short message, message content) in the status bar, can be used to convey notification-type messages, and can automatically disappear after a short dwell without user interaction. Such as a notification manager used to inform download completion, message alerts, etc. The notification manager may also be a notification that appears in the form of a chart or scroll bar text at the top status bar of the system, such as a notification of a background running application, or a notification that appears on the screen in the form of a dialog window. For example, text information is prompted in the status bar, a prompt tone is given, the terminal vibrates, an indicator light flashes, and the like.
The Android Runtime comprises a core library and a virtual machine. The Android runtime is responsible for scheduling and managing an Android system.
The core library comprises two parts: one part is a function which needs to be called by java language, and the other part is a core library of android.
The application layer and the application framework layer run in a virtual machine. And executing java files of the application program layer and the application program framework layer into a binary file by the virtual machine. The virtual machine is used for performing the functions of object life cycle management, stack management, thread management, safety and exception management, garbage collection and the like.
The system library may include a plurality of functional modules. For example: surface managers (surface managers), Media Libraries (Media Libraries), three-dimensional graphics processing Libraries (e.g., OpenGL ES), 2D graphics engines (e.g., SGL), and the like.
The surface manager is used to manage the display subsystem and provide fusion of 2D and 3D layers for multiple applications.
The media library supports a variety of commonly used audio, video format playback and recording, and still image files, among others. The media library may support a variety of audio-video encoding formats, such as MPEG4, h.264, MP3, AAC, AMR, JPG, PNG, and the like.
The three-dimensional graphic processing library is used for realizing three-dimensional graphic drawing, image rendering, synthesis, layer processing and the like.
A 2D (an animation mode) graphics engine is a drawing engine for 2D drawing.
The kernel layer is a layer between hardware and software. The inner core layer at least comprises a display driver, a camera driver, an audio driver and a sensor driver.
The terminal 100 in the embodiment of the present application may be a mobile phone.
Fig. 3 is a schematic diagram of a mass storage mount process provided in an embodiment of the present application, where the process includes:
s301: creating a first directory under a data directory of a terminal, and mounting a first target partition preset in the terminal under the first directory, so that the first target partition comprises contents under the first directory.
The method for mounting the large-capacity storage is applied to the terminal, and the terminal is a terminal using an Android system.
In the embodiment of the application, a technician divides a blank independent first target partition from a built-in memory of a terminal in advance, the terminal is connected with a computer and starts mass storage, and after entering a mass storage mode, only the content in the first target partition can be displayed in the computer.
In order to be able to display in the computer the contents under the media directory of the terminal and the contents of files etc. saved by the computer into the terminal in the mass storage mode, after the mass storage is finished, it is still available to the applications installed in the terminal. In the embodiment of the application, after the terminal starts the mass storage and enters the mass storage mode, a first directory is created under the data directory of the terminal, and a first target partition preset in the terminal and used for mass storage is mounted under the first directory, so that the first target partition contains the content under the first directory, and the content under the first directory is displayed in the computer.
Specifically, in the implementation of the present application, a terminal creates a new folder under a data directory, determines a storage path of the folder as a first directory, and mounts the first target partition under the first directory, so that the first target partition includes content under the first directory. In the embodiment of the present application, the data directory is/data/.
It should be noted that, in the embodiment of the present application, since the first target partition is an independent partition that is preset by a technician for mass storage and does not store any content, no content exists in the first target partition before the first target partition is mounted to the first directory, and based on this, after the first target partition is mounted to the first directory, the content in the first target partition is the content in the first directory. However, since the first directory is a newly created directory and no content is currently stored in the first directory, no content exists in the first target partition if no content exists in the first directory.
For example, in the embodiment of the present application, the first target partition preset in the terminal is/dev/block/mmcblk 0p 21. After the terminal starts mass storage, a new folder is created in the data directory, and the new folder is named as media _ ext, so that 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 the first directory is created, the terminal mounts the first target partition into the first directory, i.e.,/dev/block/mmcblk 0p21 into/data/media _ ext.
S302: and creating a second directory under the first directory, and mounting the second directory under a media directory, so that the second directory contains the contents under the media directory.
In this embodiment, in order to enable the computer to display the content in the media directory when displaying the content in the first target partition, in this embodiment, the terminal creates a second directory in the first directory, and mounts the second directory under the media directory, so that the second directory contains the content in the media directory.
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 in the media directory, and based on this, after the second directory is mounted in the media directory, the content in the second directory is the content in the media directory.
In the embodiment of the present application, as can be seen from the foregoing S101, when the terminal mounts the first target partition in the first directory, and the content in the first target partition is the content in the first directory, after the mass storage is started, 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. The first directory contains contents in the second directory, and the second directory contains contents in the media directory, so that the media directory is a subdirectory in the first target partition, and when the computer displays the contents, the displayed contents are contents in the media directory, and the computer can display the contents in the media directory of the terminal after the terminal starts the large-capacity storage.
In addition, in the embodiment of the present application, since the media directory is a subdirectory in the first target partition, after the large-capacity storage is started, the obb file originally stored in the media directory is equivalently stored in the first target partition, so that the resource utilization rate of the first target partition is improved.
Fig. 4 is a schematic diagram of a storage path of obb files in a computer display interface according to an embodiment of the present application, where, as shown in fig. 4, UsbStorage (G:) is a name of a first target partition in a computer, a user-root is a second directory, and since the second directory is mounted in a media directory, content stored in the second directory is content in the media directory. Also, since the obb file is stored under the media directory, the obb file is stored in the first target partition in this embodiment of the application.
For example, in this embodiment of the present application, a first directory in the terminal is/data/media _ ex, the terminal creates a second directory under the first directory, and names the second directory as/data/media _ ext/user-root. After the second directory is created, the terminal mounts the second directory under the media directory, wherein the media directory is/data/media, that is, the terminal mounts/data/media _ ext/user-root under/data/media.
S303: and 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.
The application installed in the terminal can only access the user directory in the terminal, and based on this, in order to make the contents such as the files saved in the terminal by the computer in the mass storage mode still available for the application installed in the terminal after the mass storage is finished, in the embodiment of the present application, the files saved in the terminal by the computer must be saved in the user directory.
Specifically, in the embodiment of the present application, in order to store the file stored in the terminal by the computer in the user directory, the terminal maps the first directory to the user directory. Wherein, the user directory is under the media directory, and the user can be/data/media/0.
That is, in this embodiment of the application, after the terminal opens the mass storage, the content displayed in the computer is the content in the first directory, and when the computer saves a file, the file is saved in the first directory, and after the first directory is mapped to the user directory, no matter whether the computer directly saves the file in the first directory or saves the file in any subdirectory of the first directory, the saved file will be mapped to the user directory, and even if the terminal exits the mass storage mode, the application in the terminal can access the saved file.
For example, in the embodiment of the present application, if the first directory of the terminal is/data/media _ ext, and the user directory of the terminal is/data/media/0, the first directory is mapped to the user directory under the media directory, that is, the/data/media _ ext is mapped to the/data/media/0.
In the embodiment of the application, only the media directory of the terminal is involved in the large-capacity storage, wherein the media directory is not relied on by the Android system of the terminal in the operation, so that the embodiment of the application can realize a directory structure as the large-capacity storage. In addition, the media directory of the terminal is displayed in the computer on the basis of the first target partition by creating the first directory under the data directory, mounting a 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; and mapping the first directory to the user directory realizes that the saved files are mapped to the user directory no matter the computer directly saves the files in the first directory or saves the files in any subdirectory of the first directory, so that the application in the terminal can access the saved files even if the terminal exits the mass storage mode, and the mass storage effect is improved.
On the basis of the foregoing embodiment, in this embodiment, in order to implement that a file saved in the first target partition by the computer can be accessed by an application in the terminal after the mass storage is finished, the mapping the first directory to a user directory below the media directory includes:
and if the user directory comprises a main user directory, mapping the first directory to the main user directory.
In the embodiment of the application, some terminals may support a multi-user mode, that is, one master user and at least one slave user exist in one terminal, wherein the master user has all authorities, but the authorities of the slave users can be configured by users; some terminals may only support single-user mode, i.e. there is only one primary user in one terminal. The user directory of the terminal comprises a main user directory and at least one secondary user directory; for a terminal supporting single-user mode, the user directory of the terminal includes only one main user directory. Generally, in the embodiment of the application, the master user directory is/data/media/0.
In the prior art, when a terminal prepares a storage directory structure of the terminal, a media directory/data/media/is mapped to a storage directory/storage/embedded. Specifically, the terminal virtualizes the media directory as 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 is generated in the media directory. Moreover, because of the mapping relationship between the storage directory and the media directory, when a user directory corresponding to any user exists in the media directory, the user directory corresponding to the user can be seen in the storage directory, and the contents stored in the two user directories are the same. If the master user id is 0, the master user directory corresponding to the master user in the media directory is/data/media/0, and the user directory corresponding to the master user directory in the storage directory is/storage/organized/0; if the slave user id is 10, the slave user directory in the media directory is/data/media/10, and the user directory corresponding to the slave user directory in the media directory is/storage/organized/10.
In the using process of the terminal, the content that the terminal allows the application in the terminal to access is the content in the user directory under the storage directory, such as the content under/storage/organized/0, that is, the content in the user directory under the media directory. Therefore, in the embodiment of the present application, in order to implement the file saved in the first target partition by the computer, after the mass storage is finished, the file can be accessed by the application in the terminal, and the first directory needs to be mapped to the user directory under the media directory.
Since the user directory of the terminal includes the master user directory regardless of whether the terminal supports the multi-user mode or the single-user mode, and the master user directory has all the rights, in the embodiment of the present application, for any terminal, when mapping the first directory to the user directory under the media directory, mapping the first directory to the master user directory, so that if the computer stores a file in the first target partition, after the terminal finishes the mass storage, the application installed in the terminal under the user directory can access the file.
For example, in the embodiment of the application, if the master 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 mapping the/data/media _ ext to the/data/media/0.
In order to further realize that the file saved in the first target partition by the computer can be accessed by the application in the terminal after the mass storage is finished, on the basis of the foregoing embodiments, in an embodiment of the present application, the method further includes:
if the user directory also comprises at least one slave user directory, acquiring the access right for pre-configuring the slave user directory aiming at each slave user directory, and determining whether the slave user directory has the right to access the media directory according to the access right; and if so, mapping the first directory to the slave user directory.
If the terminal is a terminal supporting a multi-user mode, in this embodiment of the present application, when mapping the first directory to the user directory in the media directory, it is necessary to determine whether to map the first directory to the user directory of the terminal for each slave user directory of the terminal.
In the embodiment of the application, the terminal is pre-configured with access rights corresponding to each slave user directory, where the access rights are rights for accessing the media directory from the slave user directory, rights for accessing call content, and the like. Wherein the terminal may map the first directory to a slave user directory having access rights to the media directory.
Specifically, in this embodiment of the application, if the user directory further includes at least one slave user directory, for each slave user directory, obtaining a pre-configured access right corresponding to the slave user directory, then searching for a right to access the media directory corresponding to the slave user directory from the access right, and if the slave user directory has the right to access the media directory, mapping the first directory to the slave user directory.
In order to implement creating the second directory under the first directory, on the basis of the foregoing embodiments, in an embodiment of the present application, the creating the second directory under the first directory includes:
and newly establishing a target folder under the first directory, and determining the storage path of the folder as the second directory.
In the embodiment of the application, when a second directory is created under a first directory, a terminal creates a new target folder under the first directory, and determines a storage path of the target folder as the second directory.
For example, in this embodiment of the present application, a first directory in a terminal is/data/media _ ex, the terminal creates a target folder under the first directory, and names the target folder as a user-root, where a saving path of the target folder is/data/media _ ext/user-root, that is, a second directory created by the terminal under the first directory is/data/media _ ext/user-root.
In order to mount the second directory into the media directory, on the basis of the foregoing embodiments, in this embodiment, the mounting the second directory into the media directory includes:
virtualizing the target folder into a second target partition, and mounting the second target partition under a media directory.
Due to the limitation of the mounting function, only one partition of the terminal can be mounted under 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 the second directory is mounted in the media directory, the second directory needs to be virtualized as an independent partition, and then the second directory is mounted in the media directory.
Specifically, in this embodiment of the present application, the second directory is virtualized into a partition, and in order to distinguish the second directory from the preset first target partition, in this embodiment of the present application, the partition obtained by virtualizing the second directory is made into 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 the prior art that can be currently implemented by the terminal, and is not described herein again.
Fig. 5 is a schematic diagram of a computer display interface provided in an embodiment of the present application, and as shown in fig. 5, UsbStorage (G:) is a name of a first target partition in a computer, a user-root file is a newly created target folder in a first directory, where, since the target folder is virtualized as a second target partition and is mounted under a media directory, a content stored in the user-root is a content stored under the media directory of a terminal, and the computer also stores a config.txt file in the first target partition and maps the config.txt file to the user directory based on the first directory.
Fig. 6 is a schematic diagram of a mass storage mount process provided in an embodiment of the present application, and as shown in fig. 6, the process includes:
s601: a first directory/data/media _ ext is created under a data directory of a terminal.
S602: and mounting a first target partition/dev/block/mmcblk 0p21 preset in the terminal to a first directory/data/media _ ext.
S603: and newly building a target folder user-root under the first directory/data/media _ ext.
S604: virtualizing the target folder user-root as a second target partition, and mounting the second target partition to a media directory/data/media.
S605: and mapping the first directory/data/media _ ext to a user directory/data/media/0 under the media directory/data/media.
Fig. 7 is a schematic structural diagram of a mass storage mounting device according to an embodiment of the present application, and as shown in fig. 7, the mass storage mounting device includes:
a mount module 701, configured to create a first directory in 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 includes content in the first directory; creating a second directory under the first directory, and mounting the second directory under a media directory, so that the second directory contains contents under the media directory;
a mapping module 702, configured to map the first directory to a user directory in the media directory, so that the user directory contains the content in the first target partition.
In a possible implementation manner, the mapping module 702 is specifically configured to map the first directory to the primary user directory if the user directory includes a primary user directory.
In a possible implementation manner, the mapping module 702 is further configured to, if the user directory further includes at least one slave user directory, obtain, for each slave user directory, an access right preconfigured for the slave user directory, and determine whether the slave user directory has a right to access the media directory according to the access right; and if so, mapping the first directory to the slave user directory.
In a possible implementation manner, the mounting module 701 is specifically configured to create a target folder under the first directory, and determine a saving path of the folder as the second directory.
In a possible implementation manner, the mounting module 701 is specifically configured to virtualize the target folder as a second target partition, and mount the second target partition under a media directory.
Fig. 8 is a schematic structural diagram of a terminal provided in the present application, and on the basis of the foregoing embodiments, the present application further provides a terminal, as shown in fig. 8, including: the system comprises 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 complete mutual communication through the communication bus 804;
the memory 803 has stored therein a computer program which, when executed by the processor 801, causes the processor 801 to perform the steps of the method described above.
Since the principle of the above terminal to solve the problem is similar to the mass storage mount, the implementation of the above terminal can refer to the above embodiment, and repeated details are not described again.
The communication bus mentioned in the above terminal may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this 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-described 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. Alternatively, the memory may be at least one memory device located remotely from the processor. The Processor may be a general-purpose Processor, including a central processing unit, a Network Processor (NP), and the like; but may also be a Digital instruction processor (DSP), an application specific integrated circuit, a field programmable gate array or other programmable logic device, discrete gate or transistor logic, discrete hardware components, etc.
On the basis of the foregoing embodiments, some embodiments of the present application further provide a computer-readable storage medium, in which a computer program executable by a processor is stored, and when the program is run on the processor, the processor is caused to execute the steps of the foregoing method.
Since the principle of solving the problem of the computer-readable storage medium is similar to that of the mass storage mounting method, the implementation of the computer-readable storage medium can be referred to the embodiment of the method, and repeated details are not repeated.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present application without departing from the spirit and scope of the application. Thus, if such 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 intended to include such modifications and variations as well.

Claims (10)

1. A mass storage mounting method is applied to a terminal, and is characterized by comprising the following steps:
creating a first directory under a data directory of a terminal, and mounting a first target partition preset in the terminal under the first directory, so that the first target partition comprises contents under the first directory;
creating a second directory under the first directory, and mounting the second directory under a media directory, so that the second directory contains contents under the media directory;
and 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.
2. The method of claim 1, wherein mapping the first directory to a user directory below the media directory comprises:
and if the user directory comprises a main user directory, mapping the first directory to the main user directory.
3. The method of claim 2, further comprising:
if the user directory also comprises at least one slave user directory, acquiring the access right for pre-configuring the slave user directory aiming at each slave user directory, and determining whether the slave user directory has the right to access the media directory according to the access right; and if so, mapping the first directory to the slave user directory.
4. The method of claim 1, wherein creating a second directory under the first directory comprises:
and newly establishing a target folder under the first directory, and determining the storage path of the folder as the second directory.
5. The method of claim 4, wherein said mounting the second directory under a media directory comprises:
virtualizing the target folder into a second target partition, and mounting the second target partition under a media directory.
6. A mass storage mounting device applied to a terminal, the device comprising:
the mounting module is used for creating a first directory under a data directory of a terminal and mounting a first target partition preset in the terminal under the first directory, so that the first target partition comprises contents under the first directory; creating a second directory under the first directory, and mounting the second directory under a media directory, so that the second directory contains contents under the media directory;
and the mapping module is 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.
7. The apparatus of claim 6, wherein the mapping module is configured to map the first directory to the primary user directory if the user directory comprises a primary user directory.
8. The apparatus of claim 7, wherein the mapping module is further configured to, if the user directory further includes at least one slave user directory, obtain, for each slave user directory, an access right for pre-configuring the slave user directory, and determine whether the slave user directory has a right to access the media directory according to the access right; and if so, mapping the first directory to the slave user directory.
9. A terminal, characterized in that it comprises at least a processor and a memory, said processor being adapted to implement the steps of the mass storage mounting method of any of claims 1-5 when executing a computer program stored in the memory.
10. A computer-readable storage medium, characterized in that it stores a computer program which, when being executed by a processor, carries out the steps of the mass storage mounting method according to any one of claims 1 to 5.
CN202210327913.9A 2022-03-30 2022-03-30 Large-capacity storage mounting method, device, terminal and medium Pending CN114675786A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210327913.9A CN114675786A (en) 2022-03-30 2022-03-30 Large-capacity storage mounting method, device, terminal and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210327913.9A CN114675786A (en) 2022-03-30 2022-03-30 Large-capacity storage mounting method, device, terminal and medium

Publications (1)

Publication Number Publication Date
CN114675786A true CN114675786A (en) 2022-06-28

Family

ID=82076245

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210327913.9A Pending CN114675786A (en) 2022-03-30 2022-03-30 Large-capacity storage mounting method, device, terminal and medium

Country Status (1)

Country Link
CN (1) CN114675786A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117349236A (en) * 2023-12-04 2024-01-05 深圳市科力锐科技有限公司 File reading method, device, equipment and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117349236A (en) * 2023-12-04 2024-01-05 深圳市科力锐科技有限公司 File reading method, device, equipment and storage medium
CN117349236B (en) * 2023-12-04 2024-03-29 深圳市科力锐科技有限公司 File reading method, device, equipment and storage medium

Similar Documents

Publication Publication Date Title
CN110865837B (en) Method and terminal for system upgrade
CN113835569A (en) Terminal device, quick start method for internal function of application and storage medium
CN111857531A (en) Mobile terminal and file display method thereof
CN113835571A (en) Terminal device, information display method and storage medium
CN114675786A (en) Large-capacity storage mounting method, device, terminal and medium
CN113055585B (en) Thumbnail display method of shooting interface and mobile terminal
CN111158735B (en) Hot patch file processing method and communication terminal
CN114595203A (en) File synchronization method based on dual systems, terminal device and storage medium
CN113642010B (en) Method for acquiring data of extended storage device and mobile terminal
CN114035870A (en) Terminal device, application resource control method and storage medium
CN111159734A (en) Communication terminal and multi-application data inter-access processing method
CN113760164A (en) Display device and response method of control operation thereof
CN112929858B (en) Method and terminal for simulating access control card
CN114020379B (en) Terminal equipment, information feedback method and storage medium
CN114501389A (en) Mobile terminal, network sharing method and storage medium
CN114528125A (en) Method for reserving application data and terminal equipment
CN112764832A (en) Application program installing and uninstalling method and communication terminal
CN115334604A (en) Terminal device, network control method and storage medium
CN114968013A (en) Terminal device, function setting method and storage medium
CN114896009A (en) Terminal device, server, theme recommendation method and storage medium
CN114154180A (en) Data sharing method and terminal equipment
CN113014792A (en) Terminal equipment and camera resource sharing method
CN111142648A (en) Data processing method and intelligent terminal
CN113691568A (en) Terminal and method for acquiring file information
CN111913772A (en) Terminal and desktop display method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination