CN113272785A - Method for mounting file system, terminal equipment and storage medium - Google Patents
Method for mounting file system, terminal equipment and storage medium Download PDFInfo
- Publication number
- CN113272785A CN113272785A CN201880098828.1A CN201880098828A CN113272785A CN 113272785 A CN113272785 A CN 113272785A CN 201880098828 A CN201880098828 A CN 201880098828A CN 113272785 A CN113272785 A CN 113272785A
- Authority
- CN
- China
- Prior art keywords
- memory
- file system
- partition
- configuration
- mounting
- 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.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 56
- 230000015654 memory Effects 0.000 claims abstract description 210
- 238000005192 partition Methods 0.000 claims abstract description 154
- 230000007334 memory performance Effects 0.000 claims description 31
- 238000004088 simulation Methods 0.000 claims description 27
- 238000011156 evaluation Methods 0.000 claims description 24
- 238000004590 computer program Methods 0.000 claims description 21
- 238000000638 solvent extraction Methods 0.000 claims description 6
- 238000011084 recovery Methods 0.000 claims description 4
- 230000006870 function Effects 0.000 description 8
- 238000010586 diagram Methods 0.000 description 6
- 230000008569 process Effects 0.000 description 5
- 230000004044 response Effects 0.000 description 4
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 238000012545 processing Methods 0.000 description 3
- 230000004888 barrier function Effects 0.000 description 2
- 238000004891 communication Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 238000013459 approach Methods 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000001514 detection method Methods 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000007781 pre-processing Methods 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Stored Programmes (AREA)
Abstract
A method for mounting a file system, a terminal device and a computer readable storage medium, the method comprising: when the file system is mounted for the partition of the terminal device, the hardware parameter of the memory corresponding to the partition is acquired (S101), the configuration information matched with the partition is determined based on the hardware parameter of the memory corresponding to the partition (S102), and the file system is mounted for the partition based on the configuration information matched with the partition (S103).
Description
The present application belongs to the technical field of file systems, and in particular, to a method for mounting a file system, a terminal device, and a computer-readable storage medium.
A file system is a method and data structure used by an operating system to specify files on a memory or partition, i.e., a method of organizing files on a memory. The software mechanism in the operating system that is responsible for managing and storing file information is called a file management system, referred to as a file system for short. The file system is responsible for establishing files for users, storing, reading, modifying and dumping the files, controlling the access of the files, revoking the files when the users are not used any more, and the like.
Disclosure of Invention
The application provides a method for mounting a file system, a terminal device and a computer readable storage medium, which are used for providing proper file system parameters for a memory or a partition of the terminal device.
A first aspect of the present application provides a method for mounting a file system, which is applied to a terminal device, and the method includes:
when the file system is mounted for the partition of the terminal equipment, acquiring the hardware parameter of a memory corresponding to the partition;
determining configuration information matched with the partition based on hardware parameters of a memory corresponding to the partition;
and mounting the file system for the partition based on the configuration information matched with the partition.
A second aspect of the present application provides a terminal device, comprising:
a hardware parameter obtaining unit, configured to obtain a hardware parameter of a memory corresponding to a partition when a file system is mounted in the partition of the terminal device;
the configuration information determining unit is used for determining configuration information matched with the partitions based on the hardware parameters of the memories corresponding to the partitions;
and the mounting unit is used for mounting the file system for the partition based on the configuration information matched with the partition.
A third aspect of an embodiment of the present application provides a terminal device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the steps of the method provided in the first aspect of the embodiment of the present application when executing the computer program.
A fourth aspect of embodiments of the present application provides a computer-readable storage medium storing a computer program which, when executed by one or more processors, performs the steps of the method provided by the first aspect of embodiments of the present application.
A fifth aspect of embodiments of the present application provides a computer program product comprising a computer program that, when executed by one or more processors, performs the steps of the method provided by the first aspect of embodiments of the present application.
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described 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 flowchart illustrating an implementation flow of a method for mounting a file system according to an embodiment of the present application;
fig. 2 is a schematic flow chart illustrating an implementation of a method for obtaining a configured white list according to an embodiment of the present application;
FIG. 3 is a schematic flowchart illustrating an implementation of another method for mounting a file system according to an embodiment of the present application;
fig. 4 is a schematic block diagram of a terminal device provided in an embodiment of the present application;
fig. 5 is a schematic block diagram of another terminal device provided in an embodiment of the present application.
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It is also to be understood that the terminology used in the description of the present application herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in the specification of the present application and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It should be further understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
As used in this specification and the appended claims, the term "if" may be interpreted contextually as "when", "upon" or "in response to a determination" or "in response to a detection". Similarly, the phrase "if it is determined" or "if a [ described condition or event ] is detected" may be interpreted contextually to mean "upon determining" or "in response to determining" or "upon detecting [ described condition or event ]" or "in response to detecting [ described condition or event ]".
In order to explain the technical solution described in the present application, the following description will be given by way of specific examples.
Fig. 1 is a schematic implementation flow diagram of a method for mounting a file system according to an embodiment of the present application, and as shown in the drawing, the method applied to a terminal device may include the following steps:
step S101, when the file system is mounted for the partition of the terminal equipment, acquiring the hardware parameter of the memory corresponding to the partition.
In this embodiment of the present application, the partitioning of the terminal device includes: a partition of a non-volatile memory of the terminal device. The partitioning of the terminal device may also include: the terminal equipment comprises an internal SD card and an external SD card. Of course, in practical applications, the terminal device may be another storage medium connected to the terminal device.
And if the user needs to perform related operation on the file in the partition of the terminal equipment, mounting a file system for the partition. Generally, a file system of a partition of a terminal device is mounted at a boot stage, and mounting parameters are generally configured in advance for different partitions, for example, a default configuration table fstab may be configured in advance, where the mounting parameters in the configuration table are all native experience values of an android system.
In the embodiment of the application, in order to provide appropriate file system parameters for the memory or the partition of the terminal device, different file system parameters may be determined according to hardware parameters of the memory or the partition, and the hardware parameters of the memory corresponding to the partition may be a certain model of a certain product of a certain manufacturer.
Step S102, determining configuration information matched with the partition based on the hardware parameter of the memory corresponding to the partition.
In the embodiment of the present application, different configuration information may be set in advance for a plurality of models of a plurality of products of a plurality of manufacturers, respectively, and the configuration information may be set in a table form. And searching configuration information corresponding to the hardware parameters of the memory corresponding to the partition in a table.
As another embodiment of the present application, before determining configuration information matching the partition based on hardware parameters of a memory corresponding to the partition, the method further includes:
pre-storing a configuration white list, wherein the configuration white list comprises: a first profile of at least one class of memory.
In this embodiment, the configuration information may also be in a file form, for example, a first configuration file is generated according to the configuration file, and a configuration white list is stored in advance, where the configuration white list includes first configuration files of memories of multiple categories. The class of memory may be a vendor class of memory such that different first profiles are set according to different vendors of memory. The method avoids the complex white list configuration caused by continuously dividing different manufacturers into different products and different models.
The determining, based on the hardware parameters of the memory corresponding to the partition, configuration information that matches the partition includes:
determining the category of the memory corresponding to the partition according to the hardware parameters of the memory corresponding to the partition;
determining whether a first configuration file of the category of the memory corresponding to the partition exists in the configuration white list;
if the first configuration file of the category of the memory corresponding to the partition exists in the configuration white list, taking the first configuration file of the category of the memory corresponding to the partition as the configuration information matched with the partition;
and if the first configuration file of the type of the memory corresponding to the partition does not exist in the configuration white list, taking a second configuration file as the configuration information matched with the partition, wherein the second configuration file is a default configuration file of the current file system.
In this embodiment of the application, configuration information of the android system native experience may be used as the second configuration file, and configuration information set in advance for hardware parameters of different memories may be used as the first configuration file. After obtaining the hardware parameter of the memory corresponding to the partition, a category (e.g., a vendor) of the memory corresponding to the partition may be determined for the hardware parameter (e.g., a model) of the memory; then determining whether a first configuration file of the category of the memory corresponding to the partition exists in the configuration white list; if the first configuration file of the category of the memory corresponding to the partition exists in the configuration white list, taking the first configuration file of the category of the memory corresponding to the partition as the configuration information matched with the partition; and if the first configuration file of the type of the memory corresponding to the partition does not exist in the configuration white list, taking a second configuration file as the configuration information matched with the partition, wherein the second configuration file is a default configuration file of the current file system. The first configuration file may be set in advance for a part of the manufacturers' memories, and if the first configuration file is not set in the memory corresponding to the current partition, the second configuration file, that is, the default configuration file, may be selected.
And step S103, mounting the file system for the partition based on the configuration information matched with the partition.
In this embodiment of the present application, the configuration information matched with the partition includes: and mounting parameters matched with the storage corresponding to the partition.
The mounting parameters may include:
a notime: the parameter means that the file access time is not updated.
Nobarrier/barrier: barrier means that metadata is written to the log before writing a new data block to disk. Writing metadata into the journal in advance can ensure that once an error occurs before and after real data is written, the journal function can control the disk to easily roll back to the state before change. This approach ensures that no file system crash situation occurs. Nobarrier refers to disabling this functionality.
Disc/nodiscard: whether the drive layer actively performs disk defragmentation.
The file system may be mounted for the partition based on mounting parameters in the first configuration file or the second configuration file.
According to the method and the device, different first configuration files can be preset according to the types of the memories, when the file system is mounted on the partitions of the terminal equipment, whether the first configuration files of the memories corresponding to the partitions are stored in advance is judged, if the first configuration files are stored, the file system is mounted on the partitions based on the preset first configuration files, and if the first configuration files are not stored, the file system is mounted on the partitions based on the original second configuration files, so that appropriate file system parameters can be set for the memories according to different types of the memories.
Fig. 2 is a schematic flow chart of an implementation of a method for obtaining a configuration white list according to an embodiment of the present application, where as shown in the figure, the method includes the following steps:
in this embodiment of the present application, the performance of the memory of at least one category of memory under multiple sets of mounting parameters may be obtained first, refer to steps S201 to S203, and after the performance of the memory of at least one category of memory under multiple sets of mounting parameters is obtained, for each category of memory, a set of mounting parameters whose memory performance meets a preset condition may be selected to generate a first configuration file, and refer to steps S204 to S205.
Step S201, based on each group of mounting parameters, mounting a file system for each type of memory;
step S202, after the mounting is finished, a simulation instruction is sent to the memory to obtain a simulation result;
and step S203, obtaining the memory performance of each type of memory after the file system is mounted based on each group of mounting parameters based on the simulation result.
In this embodiment of the present application, multiple sets of mount parameters may be preset, and then, based on each set of mount parameters, the file systems are respectively mounted for multiple categories of memories. As an example, 5 sets of mount parameters are set in advance: the mounting parameters a, b, c and d are 4 types of memories, namely, manufacturer 1, manufacturer 2, manufacturer 3 and manufacturer 4. When mounting the file system for each type of memory, the following may be done:
the memory of the manufacturer 1 is used for mounting the file system based on the mounting parameter a;
the memory of the manufacturer 1 is used for mounting the file system based on the mounting parameter b;
a memory of vendor 1, mounting a file system based on a mounting parameter c;
the memory of the manufacturer 1 is used for mounting the file system based on the mounting parameter d;
a memory of vendor 1, mounting a file system based on a mounting parameter f;
the memory of the manufacturer 2 is used for mounting the file system based on the mounting parameter a;
……
the memory of vendor 4 mounts the file system based on the mount parameter f.
Taking the memory of the manufacturer 1 as an example, after the file system is mounted based on each mounting parameter, a simulation instruction may be sent to the memory to obtain a simulation result. The simulation instructions may include: the storage command, the reading command, the modification command, etc. may be, of course, other simulation commands related to operations responsible for the file system of the memory in practical applications. Based on the simulation result corresponding to the simulation instruction, the performance of the memory of the current type can be obtained after the file system is mounted on the basis of each group of mounting parameters.
Step S204, setting at least one evaluation parameter for the memory performance;
step S205, for each type of memory, selecting a group of mounting parameters with the highest evaluation parameter or the highest weighted sum of evaluation parameters of the memory performance to generate a first configuration file.
In order to determine which mounting parameter is more suitable for the current class of memory, in the embodiments of the present application, at least one evaluation parameter may be set for the memory performance,
the memory performance includes at least one of the following evaluation parameters: access time, storage period, storage bandwidth, mount time, memory usage, power failure recovery.
The access time is the time that elapses from the start to the completion of one memory operation. I.e., the time that elapses from the issuance of a read operation command to the completion of the operation to read data into the data buffer register.
The storage period is the minimum time of the interval required for starting two operations consecutively.
The memory bandwidth is the amount of information accessed by the memory per unit time.
Mount time is the time required to mount a file system.
The memory usage is the memory usage rate when the file system is mounted in the memory.
And the power failure recovery is to determine whether the solid state disk can recover from the power failure after the power failure, and to continue normal work.
For the memory of the current category, the pre-selected evaluation parameters may be pre-processed, for example, when the evaluation parameters are access time, the values corresponding to the evaluation parameters are set according to the access time, so that the selected multiple evaluation parameters may be set to corresponding values respectively, then the weighted sum of each group of mounting parameters is calculated according to the weight corresponding to each evaluation parameter, and the group of mounting parameters with the highest weighted sum result is generated into the first configuration file. Of course, in practical application, an evaluation parameter may also be set, a value corresponding to the evaluation parameter is obtained after preprocessing, and a group of mounting parameters with the highest evaluation parameter is used to generate the first configuration file. The obtained first configuration file is the first configuration file corresponding to the current category of the memories, and the first configuration files of the plurality of categories of the memories form a configuration white list.
Fig. 3 is a schematic implementation flow diagram of another method for mounting a file system according to an embodiment of the present application, where as shown in the figure, the method applied to a terminal device may include the following steps:
step S301, when the file system is mounted to the partition of the terminal device, acquiring the hardware parameter of the memory corresponding to the partition.
The content of this step is the same as that of step S101, and the description of step S101 may be specifically referred to, and is not repeated here.
Step S302, determining the category of the memory corresponding to the partition according to the hardware parameters of the memory corresponding to the partition.
Step S303, determining whether a first configuration file of the category of the storage corresponding to the partition in the current file system exists in the configuration white list.
Step S304, if there is a first configuration file of the category of the memory corresponding to the partition under the current file system in the configuration white list, taking the first configuration file of the category of the memory corresponding to the partition under the current file system as the configuration information of the partition matching.
Step S305, if the first configuration file of the type of the memory corresponding to the partition in the current file system does not exist in the configuration white list, taking a second configuration file as the configuration information of the partition matching, where the second configuration file is a default configuration file of the current file system.
In an embodiment of the present application, the configuring the white list includes: a first configuration file of at least one class of memory under at least one file system. Each type of memory may mount a plurality of file systems, and in the embodiment of the present application, a first configuration file may be preset for each type of file system that each type of memory may mount. As described in the embodiment shown in fig. 1, after determining the category (for example, vendor) of the memory corresponding to the partition according to the hardware parameter of the memory corresponding to the partition, it may be determined whether a first configuration file of the category of the memory corresponding to the partition under the current file system exists in the configuration white list. When mounting a file system to a partition, it may be looked up from a configuration white list based on the currently mounted file system whether a first configuration file corresponding to the current file system of the current memory exists. By way of example, the configuration whitelist may be stored as follows:
vendor 1's memory, file system W1, first configuration file P1;
vendor 1's memory, file system W2, first configuration file P2;
vendor 2's memory, file system W1, first configuration file P3;
vendor 2's memory, file system W3, first configuration file P4;
vendor 3's memory, file system W2, first configuration file P5.
And if the first configuration file (P1) of the type (manufacturer 1) of the memory corresponding to the partition under the current file system (W1) exists in the configuration white list, taking the first configuration file P1 of the type of the memory corresponding to the partition under the current file system as the configuration information of the partition matching. And if the first configuration file of the type (manufacturer 2) of the memory corresponding to the partition under the current file system (W2) does not exist in the configuration white list, taking a second configuration file as the configuration information matched with the partition, wherein the second configuration file is a default configuration file of the current file system (W2).
Step S306, based on the configuration information matched with the partition, mounting the file system for the partition.
As another embodiment of the present application, the configuration white list is obtained by:
and acquiring the memory performance of at least one type of memory when the file system is mounted based on the second configuration file of each file system, and generating a first configuration file of each type of memory when each file system is mounted based on the memory performance of each type of memory when each file system is mounted.
In the embodiment of the application, the file system can be mounted on the basis of the second configuration file of each file system through each type of memory; after mounting is completed, sending a simulation instruction to the memory to obtain a simulation result; and obtaining the memory performance of each type of memory when the file system is mounted based on the second configuration file of each type of file system based on the simulation result. Determining mounting parameters of the memory of the current category to be adjusted under the current file system based on the obtained memory performance and the preset standard performance; and modifying the second configuration file based on the mounting parameters to be adjusted, and taking the modified second configuration file as the first configuration file of the current file system.
By way of example, when mounting a file system for each type of memory, the following may be followed:
vendor 1's memory, mounting file system W1 based on the second configuration file M1 of file system W1;
vendor 1's memory, mounting file system W2 based on the second configuration file M2 of file system W2;
vendor 1's memory, mounting file system W3 based on the third configuration file M3 of file system W3;
vendor 2's memory, mounting file system W1 based on the second configuration file M1 of file system W1;
vendor 2's memory, mounting file system W2 based on the second configuration file M2 of file system W2;
……
the vendor 4's memory mounts the file system W3 based on the third configuration file M3 of the file system W3.
After mounting is completed, sending a simulation instruction to the memory to obtain a simulation result; and obtaining the memory performance of each type of memory when the file system is mounted based on the second configuration file of each type of file system based on the simulation result. It is also possible to set a standard performance for each file system, and the obtained memory performance and the standard performance use the same evaluation parameters. Determining mounting parameters of the memory of the current category to be adjusted under the current file system based on the obtained evaluation parameters in the memory performance and the evaluation parameters in the preset standard performance; and modifying the second configuration file based on the mounting parameters to be adjusted, and taking the modified second configuration file as the first configuration file of the current file system.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
Fig. 4 is a schematic block diagram of a terminal device provided in an embodiment of the present application, and only a part related to the embodiment of the present application is shown for convenience of description.
The terminal device 4 may be a software unit, a hardware unit or a combination of software and hardware unit built in a mobile phone, a tablet computer, a notebook computer, a computer, and the like, or may be integrated into the mobile phone, the tablet computer, the notebook computer, the computer, and the like as an independent pendant.
The terminal device 4 includes:
a hardware parameter obtaining unit 41, configured to obtain a hardware parameter of a memory corresponding to a partition when a file system is mounted in the partition of the terminal device;
a configuration information determining unit 42, configured to determine configuration information matching the partition based on the hardware parameter of the memory corresponding to the partition;
and a mount unit 43, configured to mount the file system for the partition based on the configuration information matched with the partition.
As another embodiment of the present application, the terminal device further includes:
a storage unit 44, configured to store a configuration white list in advance, where the configuration white list includes: a first profile of at least one class of memory.
As another embodiment of the present application, the configuration information determining unit 42 includes:
a memory type determining module 421, configured to determine the type of the memory corresponding to the partition according to the hardware parameter of the memory corresponding to the partition;
a determining module 422, configured to determine whether a first configuration file of a category of a memory corresponding to the partition exists in the configuration white list;
a first configuration information determining module 423, configured to, if a first configuration file of the category of the memory corresponding to the partition exists in the configuration white list, use the first configuration file of the category of the memory corresponding to the partition as the configuration information for partition matching.
A second configuration information determining module 424, configured to, if the first configuration file of the category of the memory corresponding to the partition does not exist in the configuration white list, use a second configuration file as the configuration information matched with the partition, where the second configuration file is a default configuration file of a current file system.
As another embodiment of the present application, the configuration information matched with the partition includes: and mounting parameters matched with the storage corresponding to the partition.
As another embodiment of the present application, the configuration white list is obtained by:
acquiring the performance of at least one category of memories under multiple groups of mounting parameters respectively;
and for each type of memory, selecting a group of mounting parameters of which the memory performance meets a preset condition to generate a first configuration file.
As another embodiment of the present application, when obtaining the configuration white list, mount a file system for each type of memory based on each set of mount parameters; after mounting is completed, sending a simulation instruction to the memory to obtain a simulation result; and obtaining the performance of each type of memory after the file system is mounted on the basis of each group of mounting parameters based on the simulation result.
As another embodiment of the present application, when obtaining a configuration white list, setting at least one evaluation parameter for the memory performance; and for each type of memory, selecting a group of mounting parameters with the highest evaluation parameter or the highest weighted sum of the evaluation parameters of the memory performance to generate a first configuration file.
As another embodiment of the present application, the configuration white list includes: a first configuration file of at least one class of memory under at least one file system.
As an alternative embodiment of the present application,
the memory class determination module 421 is further configured to: determining the category of the memory corresponding to the partition according to the hardware parameters of the memory corresponding to the partition;
the determining module 422 is further configured to: determining whether a first configuration file of the category of the storage corresponding to the partition under the current file system exists in the configuration white list;
the first configuration information determining module 423 is further configured to: and if the first configuration file of the type of the memory corresponding to the partition under the current file system exists in the configuration white list, taking the first configuration file of the type of the memory corresponding to the partition under the current file system as the configuration information matched with the partition.
The second configuration information determining module 424 is further configured to: and if the configuration white list does not have a first configuration file of the type of the memory corresponding to the partition under the current file system, taking a second configuration file as the configuration information matched with the partition, wherein the second configuration file is a default configuration file of the current file system.
As another embodiment of the present application, the configuration white list is obtained by:
obtaining the performance of the memory when the at least one category of memory mounts the file system based on the second configuration file of each file system;
and generating a first configuration file of each type of memory when each type of file system is mounted on the basis of the memory performance of each type of memory when each type of file system is mounted respectively.
As another embodiment of the present application, when obtaining the configuration white list, mount the file system based on the second configuration file of each file system through each type of memory; after mounting is completed, sending a simulation instruction to the memory to obtain a simulation result; and obtaining the memory performance of each type of memory when the file system is mounted based on the second configuration file of each type of file system based on the simulation result.
As another embodiment of the present application, when a configuration white list is obtained, mount parameters to be adjusted of a current class of memory under a current file system are determined based on obtained memory performance and preset standard performance; and modifying the second configuration file based on the mounting parameters to be adjusted, and taking the modified second configuration file as the first configuration file of the current file system.
The memory performance includes at least one of the following evaluation parameters: access time, storage period, storage bandwidth, mount time, memory usage, power failure recovery.
The partitioning of the terminal device comprises: a partition of a non-volatile memory of the terminal device.
The partitioning of the terminal device comprises: the terminal equipment comprises an internal SD card and an external SD card.
It is obvious to those skilled in the art that, for convenience and simplicity of description, the foregoing division of the functional units and modules is merely used as an example, and in practical applications, the foregoing function distribution may be performed by different functional units and modules as needed, that is, the internal structure of the terminal device is divided into different functional units or modules to perform all or part of the above-described functions. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working processes of the units and modules in the terminal device may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
Fig. 5 is a schematic block diagram of a terminal device according to another embodiment of the present application. As shown in fig. 5, the terminal device 5 of this embodiment includes: one or more processors 50, a memory 51 and a computer program 52 stored in said memory 51 and executable on said processors 50. The processor 50, when executing the computer program 52, implements the steps in the various method embodiments described above, such as the steps S101 to S103 shown in fig. 1. Alternatively, the processor 50, when executing the computer program 52, implements the functions of the modules/units in the terminal device embodiment described above, such as the functions of the modules 41 to 43 shown in fig. 4.
Illustratively, the computer program 52 may be partitioned into one or more modules/units, which are stored in the memory 51 and executed by the processor 50 to accomplish the present application. The one or more modules/units may be a series of computer program instruction segments capable of performing specific functions, which are used to describe the execution process of the computer program 52 in the terminal device 5. For example, the computer program 52 may be divided into a hardware parameter obtaining unit, a configuration information determining unit, and a mounting unit, which are exemplarily:
a hardware parameter obtaining unit, configured to obtain a hardware parameter of a memory corresponding to a partition when a file system is mounted in the partition of the terminal device;
the configuration information determining unit is used for determining configuration information matched with the partitions based on the hardware parameters of the memories corresponding to the partitions;
and the mounting unit is used for mounting the file system for the partition based on the configuration information matched with the partition.
Other units or modules can be referred to the description of the embodiment shown in fig. 4, and are not described again here.
The terminal device includes, but is not limited to, a processor 50 and a memory 51. Those skilled in the art will appreciate that fig. 5 is only one example of a terminal device 5, and does not constitute a limitation to the terminal device 5, and may include more or less components than those shown, or combine some components, or different components, for example, the terminal device may further include an input device, an output device, a network access device, a bus, a touch display screen, etc.
The Processor 50 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 51 may be an internal storage unit of the terminal device 5, such as a hard disk or a memory of the terminal device 5. The memory 51 may also be an external memory of the terminal device 5, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the terminal device 5. Further, the memory 51 may also include both an internal storage unit and an external memory of the terminal device 5. The memory 51 is used for storing the computer program and other programs and data required by the terminal device. The memory 51 may also be used to temporarily store data that has been output or is to be output.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiments provided in the present application, it should be understood that the disclosed terminal device and method may be implemented in other ways. For example, the above-described terminal device embodiments are merely illustrative, and for example, the division of the modules or units is only one logical function division, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated modules/units, if implemented in the form of software functional units and sold or used as separate products, may be stored in a computer readable storage medium. Based on such understanding, all or part of the flow in the method of the embodiments described above can be realized by a computer program, which can be stored in a computer-readable storage medium and can realize the steps of the embodiments of the methods described above when the computer program is executed by a processor. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution medium, and the like. It should be noted that the computer readable storage medium may contain content that is subject to appropriate increase or decrease as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, computer readable storage media that does not include electrical carrier signals and telecommunications signals in accordance with legislation and patent practice.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present application and are intended to be included within the scope of the present application.
Claims (20)
- A method for mounting a file system is applied to a terminal device, and comprises the following steps:when the file system is mounted for the partition of the terminal equipment, acquiring the hardware parameter of a memory corresponding to the partition;determining configuration information matched with the partition based on hardware parameters of a memory corresponding to the partition;and mounting the file system for the partition based on the configuration information matched with the partition.
- The method of mounting a file system according to claim 1, prior to determining configuration information that matches the partition based on hardware parameters of a memory to which the partition corresponds, further comprising:pre-storing a configuration white list, wherein the configuration white list comprises: a first profile of at least one class of memory.
- The method of mounting a file system according to claim 2, wherein the determining configuration information that matches the partition based on hardware parameters of a memory to which the partition corresponds comprises:determining the category of the memory corresponding to the partition according to the hardware parameters of the memory corresponding to the partition;determining whether a first configuration file of the category of the memory corresponding to the partition exists in the configuration white list;and if the first configuration file of the type of the memory corresponding to the partition exists in the configuration white list, taking the first configuration file of the type of the memory corresponding to the partition as the configuration information matched with the partition.
- The method of mounting a file system according to claim 3, further comprising, after determining whether a first configuration file for the class of memory to which the partition corresponds exists in the configuration whitelist:and if the first configuration file of the type of the memory corresponding to the partition does not exist in the configuration white list, taking a second configuration file as the configuration information matched with the partition, wherein the second configuration file is a default configuration file of the current file system.
- The method of mounting a file system according to claim 2, wherein the configuration information matching the partition comprises: and mounting parameters matched with the storage corresponding to the partition.
- The method of mounting a file system according to claim 5, wherein the configuration white list is obtained by:acquiring the performance of at least one category of memories under multiple groups of mounting parameters respectively;and for each type of memory, selecting a group of mounting parameters of which the memory performance meets a preset condition to generate a first configuration file.
- The method of mounting a file system according to claim 6, wherein said obtaining memory performance of at least one class of memory under a plurality of sets of mounting parameters, respectively, comprises:mounting a file system for each type of memory based on each set of mounting parameters;after mounting is completed, sending a simulation instruction to the memory to obtain a simulation result;and obtaining the performance of each type of memory after the file system is mounted on the basis of each group of mounting parameters based on the simulation result.
- The method for mounting a file system according to claim 6, wherein for each type of memory, selecting a set of mounting parameters whose memory performance meets a preset condition to generate a first configuration file comprises:setting at least one evaluation parameter for the memory performance;and for each type of memory, selecting a group of mounting parameters with the highest evaluation parameter or the highest weighted sum of the evaluation parameters of the memory performance to generate a first configuration file.
- The method of mounting a file system of claim 2, wherein the configuring the whitelist comprises: a first configuration file of at least one class of memory under at least one file system.
- The method of mounting a file system according to claim 9, wherein the determining configuration information that matches the partition based on hardware parameters of a memory to which the partition corresponds comprises:determining the category of the memory corresponding to the partition according to the hardware parameters of the memory corresponding to the partition;determining whether a first configuration file of the category of the storage corresponding to the partition under the current file system exists in the configuration white list;and if the first configuration file of the type of the memory corresponding to the partition under the current file system exists in the configuration white list, taking the first configuration file of the type of the memory corresponding to the partition under the current file system as the configuration information matched with the partition.
- The method of mounting a file system according to claim 10, after determining whether a first configuration file of the category of the memory corresponding to the partition under a current file system exists in the configuration white list, further comprising:and if the configuration white list does not have a first configuration file of the type of the memory corresponding to the partition under the current file system, taking a second configuration file as the configuration information matched with the partition, wherein the second configuration file is a default configuration file of the current file system.
- The method of mounting a file system according to claim 11, wherein the configuration white list is obtained by:obtaining the performance of the memory when the at least one category of memory mounts the file system based on the second configuration file of each file system;and generating a first configuration file of each type of memory when each type of file system is mounted on the basis of the memory performance of each type of memory when each type of file system is mounted respectively.
- The method of mounting a file system according to claim 12, wherein said obtaining at least one class of memory comprises, based on memory performance when mounting the file system for the second configuration file of each file system:mounting the file system based on a second configuration file of each file system through each type of memory;after mounting is completed, sending a simulation instruction to the memory to obtain a simulation result;and obtaining the memory performance of each type of memory when the file system is mounted based on the second configuration file of each type of file system based on the simulation result.
- The method of mounting a file system according to claim 12, wherein generating the first configuration file for each type of memory at the time of mounting each type of file system based on the memory performance at the time of mounting each type of file system separately for each type of memory comprises:determining mounting parameters of the memory of the current category to be adjusted under the current file system based on the obtained memory performance and the preset standard performance;and modifying the second configuration file based on the mounting parameters to be adjusted, and taking the modified second configuration file as the first configuration file of the current file system.
- The method of mounting a file system according to any of claims 6 to 8, 12 to 14, wherein the memory performance comprises at least one evaluation parameter selected from the group consisting of: access time, storage period, storage bandwidth, mount time, memory usage, power failure recovery.
- The method of mounting a file system according to claim 1, wherein the partitioning of the terminal device comprises: a partition of a non-volatile memory of the terminal device.
- The method of mounting a file system according to claim 1, wherein the partitioning of the terminal device comprises: the terminal equipment comprises an internal SD card and an external SD card.
- A terminal device, comprising:a hardware parameter obtaining unit, configured to obtain a hardware parameter of a memory corresponding to a partition when a file system is mounted in the partition of the terminal device;the configuration information determining unit is used for determining configuration information matched with the partitions based on the hardware parameters of the memories corresponding to the partitions;and the mounting unit is used for mounting the file system for the partition based on the configuration information matched with the partition.
- A terminal device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the steps of the method according to any of claims 1 to 17 when executing the computer program.
- A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program which, when executed by one or more processors, implements the steps of the method according to any one of claims 1 to 17.
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/CN2018/119177 WO2020113421A1 (en) | 2018-12-04 | 2018-12-04 | Method for mounting file system, terminal device, and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113272785A true CN113272785A (en) | 2021-08-17 |
CN113272785B CN113272785B (en) | 2024-02-27 |
Family
ID=70974863
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201880098828.1A Active CN113272785B (en) | 2018-12-04 | 2018-12-04 | Method for mounting file system, terminal equipment and storage medium |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN113272785B (en) |
WO (1) | WO2020113421A1 (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114443582A (en) * | 2021-12-22 | 2022-05-06 | 科东(广州)软件科技有限公司 | File system mounting method, device, equipment and medium on operating system |
CN115168300A (en) * | 2022-09-05 | 2022-10-11 | 山东正中信息技术股份有限公司 | Portable mobile working method and system based on file system filtering |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102541475A (en) * | 2012-03-12 | 2012-07-04 | 成都市华为赛门铁克科技有限公司 | Data storage method and data storage device |
CN105242885A (en) * | 2015-10-30 | 2016-01-13 | 北京奇艺世纪科技有限公司 | Network storage change method and device |
CN105549914A (en) * | 2015-12-25 | 2016-05-04 | 惠州Tcl移动通信有限公司 | Mounting method and system of external storage equipment |
CN106873921A (en) * | 2017-03-24 | 2017-06-20 | 努比亚技术有限公司 | A kind of hanging method and device of multi partition external storage |
CN107391157A (en) * | 2017-07-31 | 2017-11-24 | 北京小米移动软件有限公司 | Mobile terminal and the method for identifying movable storage device |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102609741B (en) * | 2012-01-31 | 2016-03-09 | 上海艾尚通讯科技有限公司 | A kind of method of exchanges data between mobile device and inside and outside portion storage card thereof |
CN105183517A (en) * | 2015-09-14 | 2015-12-23 | 广东欧珀移动通信有限公司 | Method and device for mounting external storage equipment in recovery mode and electronic device |
CN106406768A (en) * | 2016-09-28 | 2017-02-15 | 努比亚技术有限公司 | Android system user data partitioning adjustment method and device |
CN107506496B (en) * | 2017-09-28 | 2021-10-22 | 北京小米移动软件有限公司 | Defragmentation method, defragmentation device and computer-readable storage medium |
-
2018
- 2018-12-04 CN CN201880098828.1A patent/CN113272785B/en active Active
- 2018-12-04 WO PCT/CN2018/119177 patent/WO2020113421A1/en active Application Filing
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102541475A (en) * | 2012-03-12 | 2012-07-04 | 成都市华为赛门铁克科技有限公司 | Data storage method and data storage device |
CN105242885A (en) * | 2015-10-30 | 2016-01-13 | 北京奇艺世纪科技有限公司 | Network storage change method and device |
CN105549914A (en) * | 2015-12-25 | 2016-05-04 | 惠州Tcl移动通信有限公司 | Mounting method and system of external storage equipment |
CN106873921A (en) * | 2017-03-24 | 2017-06-20 | 努比亚技术有限公司 | A kind of hanging method and device of multi partition external storage |
CN107391157A (en) * | 2017-07-31 | 2017-11-24 | 北京小米移动软件有限公司 | Mobile terminal and the method for identifying movable storage device |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114443582A (en) * | 2021-12-22 | 2022-05-06 | 科东(广州)软件科技有限公司 | File system mounting method, device, equipment and medium on operating system |
CN115168300A (en) * | 2022-09-05 | 2022-10-11 | 山东正中信息技术股份有限公司 | Portable mobile working method and system based on file system filtering |
CN115168300B (en) * | 2022-09-05 | 2022-12-09 | 山东正中信息技术股份有限公司 | Portable mobile working method and system based on file system filtering |
Also Published As
Publication number | Publication date |
---|---|
CN113272785B (en) | 2024-02-27 |
WO2020113421A1 (en) | 2020-06-11 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104699423B (en) | The method and apparatus that drive is bound in linux system | |
US10402222B2 (en) | Task migration method and apparatus | |
EP3252592A1 (en) | Method and device for storing and reading data | |
CN110908682B (en) | Firmware upgrading method and system for vehicle controller, vehicle and storage medium | |
CN105095078A (en) | Systematic automation testing device and method and calculating device | |
CN110515917B (en) | Method, device and medium for controlling reconstruction speed | |
CN104375933A (en) | Unit testing method and device | |
CN109451098A (en) | FPGA accelerator card MAC Address configuration method, device and accelerator card | |
CN108701080A (en) | It is effective to ensure that storage device acts using reference value | |
CN111104178A (en) | Dynamic library loading method, terminal device and storage medium | |
CN113272785B (en) | Method for mounting file system, terminal equipment and storage medium | |
CN110515671B (en) | Initialization method, initialization device, terminal device and readable storage medium | |
CN113051105A (en) | Data processing method, device, equipment and storage medium | |
CN108228611B (en) | Document information copying method and device | |
CN111143092B (en) | Fault recording data processing method, system and terminal equipment | |
CN112015459A (en) | Method and device for upgrading image file, terminal and readable storage medium | |
CN112114978A (en) | Electronic scale data updating method, device, equipment and readable storage medium | |
CN111897760A (en) | Electronic product, expansion device thereof, control method and control device | |
CN114995770B (en) | Data processing method, device, equipment, system and readable storage medium | |
CN111782474A (en) | Log processing method and device, electronic equipment and medium | |
CN111045741A (en) | Firmware loading method for flash-memory-free touch screen of intelligent terminal | |
CN111444117A (en) | Method and device for realizing fragmentation of storage space, storage medium and electronic equipment | |
CN116049030A (en) | Method and device for data access, electronic equipment and storage medium | |
US7962796B2 (en) | State testing device and methods thereof | |
CN112527276A (en) | Data updating method and device in visual programming tool and terminal equipment |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |