WO2020113421A1 - 一种挂载文件系统的方法、终端设备及存储介质 - Google Patents

一种挂载文件系统的方法、终端设备及存储介质 Download PDF

Info

Publication number
WO2020113421A1
WO2020113421A1 PCT/CN2018/119177 CN2018119177W WO2020113421A1 WO 2020113421 A1 WO2020113421 A1 WO 2020113421A1 CN 2018119177 W CN2018119177 W CN 2018119177W WO 2020113421 A1 WO2020113421 A1 WO 2020113421A1
Authority
WO
WIPO (PCT)
Prior art keywords
memory
partition
file system
configuration
mounting
Prior art date
Application number
PCT/CN2018/119177
Other languages
English (en)
French (fr)
Inventor
彭学锋
Original Assignee
深圳市欢太科技有限公司
Oppo广东移动通信有限公司
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 深圳市欢太科技有限公司, Oppo广东移动通信有限公司 filed Critical 深圳市欢太科技有限公司
Priority to CN201880098828.1A priority Critical patent/CN113272785B/zh
Priority to PCT/CN2018/119177 priority patent/WO2020113421A1/zh
Publication of WO2020113421A1 publication Critical patent/WO2020113421A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating

Definitions

  • This 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 clarify files on a storage or partition, that is, a method of organizing files on a storage.
  • the software organization responsible for managing and storing file information in the operating system is called a file management system, or file system for short.
  • the file system is responsible for creating files for users, storing, reading, modifying, and dumping files, controlling file access, and revoking files when users are no longer in use.
  • the present application provides a method for mounting a file system, a terminal device, and a computer-readable storage medium to provide appropriate file system parameters for a memory or partition of a terminal device.
  • the 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:
  • the second aspect of the present application provides a terminal device, including:
  • a hardware parameter acquisition unit used to acquire hardware parameters of the memory corresponding to the partition when mounting a file system for the partition of the terminal device
  • a configuration information determining unit configured to determine configuration information matching the partition based on the hardware parameters of the memory corresponding to the partition
  • the mounting unit is configured to mount a file system for the partition based on the configuration information matching the partition.
  • a third aspect of the embodiments 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, when the processor executes the computer program
  • the steps of the method provided in the first aspect of the embodiments of the present application are implemented.
  • a fourth aspect of the embodiments of the present application provides a computer-readable storage medium that stores a computer program, and the computer program is executed by one or more processors to implement the first embodiment of the present application.
  • a fifth aspect of the embodiments of the present application provides a computer program product.
  • the computer program product includes a computer program, and the computer program is executed by one or more processors to implement the first aspect of the present application. Method steps.
  • FIG. 1 is a schematic diagram of an implementation process of a method for mounting a file system provided by an embodiment of the present application
  • FIG. 2 is a schematic diagram of an implementation process of a method for obtaining a white list configuration provided by an embodiment of the present application
  • FIG. 3 is a schematic diagram of an implementation process of another method for mounting a file system provided by an embodiment of the present application.
  • FIG. 4 is a schematic block diagram of a terminal device provided by an embodiment of the present application.
  • FIG. 5 is a schematic block diagram of another terminal device provided by an embodiment of the present application.
  • the term “if” may be interpreted as “when” or “once” or “in response to determination” or “in response to detection” depending on the context .
  • the phrase “if determined” or “if [described condition or event] is detected” may be interpreted in the context to mean “once determined” or “in response to determination” or “once detected [described condition or event ]” or “In response to detection of [the described condition or event]”.
  • FIG. 1 is a schematic diagram of an implementation process of a method for mounting a file system provided by an embodiment of the present application. As shown in the figure, the method is applied to a terminal device and may include the following steps:
  • Step S101 When mounting a file system for a partition of the terminal device, obtain hardware parameters of a memory corresponding to the partition.
  • the partition of the terminal device includes: a partition of a non-volatile memory of the terminal device.
  • the partition of the terminal device may also include: an internal SD card and an external SD card of the terminal device. Of course, in practical applications, it may be other storage media that are connected to the terminal device.
  • a file system needs to be mounted for the partition.
  • the file system of the partition of the terminal device is mounted during the startup phase.
  • Mounting parameters are generally pre-configured for different partitions.
  • the default configuration table fstab can be pre-configured.
  • the mounting parameters in the configuration table are all It is the native experience value of the android system.
  • different file system parameters may be determined according to the hardware parameters of the memory or partition.
  • the hardware parameters of the memory corresponding to the partition may be a certain A model of a product.
  • Step S102 Based on the hardware parameters of the memory corresponding to the partition, determine the configuration information that matches the partition.
  • different configuration information may be set in advance for multiple models of multiple products of multiple manufacturers, and the configuration information may be set in a table form. Look up the configuration information corresponding to the hardware parameters of the memory corresponding to the partition in the table.
  • the method before determining the configuration information matching the partition based on the hardware parameters of the memory corresponding to the partition, the method further includes:
  • the configuration white list is stored in advance, and the configuration white list includes: a first configuration file of at least one category of memory.
  • the configuration information may also be in the form of a file, for example, a first configuration file is generated according to the configuration file, and a configuration white list is stored in advance, and the configuration white list includes multiple categories of memory The first configuration file.
  • the category of the memory may be the category of the manufacturer of the memory, so that different first configuration files are set according to memories of different manufacturers. It avoids the tedious and complicated configuration of the white list when different manufacturers continue to be divided into different products and models.
  • the determining the configuration information matching the partition based on the hardware parameters of the memory corresponding to the partition includes:
  • the first configuration file of the category of the memory corresponding to the partition exists in the configuration whitelist, the first configuration file of the category of the memory corresponding to the partition is used as the configuration information matching the partition;
  • the second configuration file is used as configuration information matching the partition, and the second configuration file is the default of the current file system Configuration file.
  • the configuration information of the native experience of the android system may be used as the second configuration file, and the configuration information set in advance for hardware parameters of different memories may be used as the first configuration file.
  • the type of the memory corresponding to the partition for example, the manufacturer
  • the hardware parameters for example, model
  • the partition exists in the configuration whitelist The first configuration file of the corresponding memory category; if there is a first configuration file of the memory category corresponding to the partition in the configuration whitelist, the first configuration file of the memory category corresponding to the partition is used as the The configuration information of the partition matching; if there is no first configuration file of the category of the memory corresponding to the partition in the configuration whitelist, the second configuration file is used as the configuration information of the partition matching, the second configuration
  • the file is the default configuration file of the current file system.
  • the first configuration file may be set in advance for the memory of some manufacturers. If the memory corresponding to the current partition is not set with
  • Step S103 Mount a file system for the partition based on the configuration information matching the partition.
  • the configuration information matching the partition includes: mounting parameters matching the memory corresponding to the partition.
  • the mounting parameters may include:
  • noatime This parameter means that the file access time is not updated.
  • Nobarrier/barrier barrier means that metadata is written to the log before writing new data blocks to disk. Writing metadata to the log in advance can ensure that if an error occurs before and after writing real data, the log function can control the disk to easily roll back to the state before the change. This method ensures that no file system crashes will occur. Nobarrier means to disable this function.
  • Discard/nodiscard Whether the driver layer actively performs disk defragmentation.
  • the file system may be mounted for the partition based on the mounting parameters in the first configuration file or the second configuration file.
  • different first configuration files may be preset according to the type of memory.
  • FIG. 2 is a schematic diagram of an implementation process of a method for obtaining a white list configuration provided by an embodiment of the present application. As shown in the figure, the method includes the following steps:
  • the memory performance of at least one type of memory under multiple sets of mounting parameters can be obtained first.
  • steps S201 to S203 when at least one type of memory is obtained under multiple sets of mounting parameters After the memory performance is lowered, for each type of memory, a set of mounting parameters whose memory performance meets a preset condition may be selected to generate a first configuration file, and reference may be made to step S204 to step S205.
  • Step S201 Mount a file system for each type of storage based on each set of mounting parameters
  • Step S202 After the mounting is completed, send a simulation instruction to the memory to obtain a simulation result
  • Step S203 Based on the simulation result, obtain the memory performance of each type of memory after mounting the file system based on each set of mounting parameters.
  • multiple sets of mounting parameters may be set in advance, and then, based on each set of mounting parameters, file systems may be separately mounted for multiple types of storage.
  • 5 sets of mounting parameters are pre-set: mounting parameter a, mounting parameter b, mounting parameter c, mounting parameter d, 4 types of memory are set, manufacturer 1, manufacturer 2, manufacturer 3, manufacturer 4.
  • the memory of manufacturer 1 mounts the file system based on the mounting parameter a;
  • the memory of vendor 1 mounts the file system based on the mounting parameter b;
  • the memory of vendor 1 mounts the file system based on the mounting parameter c;
  • the memory of vendor 1 mounts the file system based on the mounting parameter d;
  • the memory of manufacturer 1 mounts the file system based on the mounting parameter f;
  • the memory of vendor 2 mounts the file system based on the mounting parameter a;
  • the memory of the manufacturer 4 mounts the file system based on the mounting parameter f.
  • a simulation instruction may be sent to the memory to obtain a simulation result.
  • the simulation instruction may include: a storage instruction, a read instruction, a modification instruction, etc. Of course, in practical applications, it may also be other simulation instructions related to operations that the file system of the memory is responsible for. Based on the simulation result corresponding to the simulation instruction, the memory performance of the current type of memory after mounting the file system based on each set of mounting parameters can be obtained.
  • Step S204 Set at least one evaluation parameter for the memory performance
  • Step S205 For each type of memory, a set of mounting parameters with the highest evaluation parameter or the highest weighted sum of evaluation parameters of the memory performance is selected to generate a first configuration file.
  • 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, memory bandwidth, mount time, memory usage, and power-down recovery.
  • the access time is the time elapsed from startup to completion of a memory operation. That is, the time elapsed from the time a read operation command is issued until the operation is completed, and data is read into the data buffer register.
  • the storage period is the minimum time required to start two consecutive operations.
  • the memory bandwidth is the amount of information accessed by the memory per unit time.
  • the mount time is the time required to mount the file system.
  • Memory usage is the memory usage rate when the memory mounts the file system.
  • Power failure recovery is whether the solid state drive can recover from power failure after power failure and continue normal work.
  • pre-selected evaluation parameters can be pre-processed, for example, when the evaluation parameter is the access time, the value corresponding to the evaluation parameter is set according to the access time, so that multiple selected evaluation parameters can be Set the corresponding values respectively, and then calculate the weighted sum of each set of mounting parameters according to the weight corresponding to each evaluation parameter, and generate the first configuration file for the set of mounting parameters with the highest weighted sum result.
  • an evaluation parameter may also be set, and the value corresponding to the evaluation parameter may be obtained after preprocessing, and a set of mounting parameters with the highest evaluation parameter may be used to generate a first configuration file.
  • the obtained first configuration file is the first configuration file corresponding to the current category of storage, and the first configuration files of multiple categories of storage constitute a configuration whitelist.
  • FIG. 3 is a schematic flowchart of another method for mounting a file system provided by an embodiment of the present application. As shown in the figure, the method is applied to a terminal device and may include the following steps:
  • Step S301 When mounting a file system for a partition of the terminal device, obtain hardware parameters of a memory corresponding to the partition.
  • step S101 This step is consistent with the content of step S101. For details, reference may be made to the description of step S101, and details are not described herein again.
  • Step S302 Determine the type of the memory corresponding to the partition through the hardware parameters of the memory corresponding to the partition.
  • Step S303 Determine whether there is a first configuration file in the configuration whitelist under the current file system for the type of memory corresponding to the partition.
  • Step S304 if there is a first configuration file in the configuration whitelist that corresponds to the type of memory of the partition under the current file system, then a first configuration file of the type of memory corresponding to the partition under the current file system As the configuration information of the partition matching.
  • Step S305 if there is no first configuration file in the configuration whitelist that corresponds to the type of memory of the partition under the current file system, the second configuration file is used as configuration information matching the partition, and the second The configuration file is the default configuration file of the current file system.
  • the configuration whitelist includes: a first configuration file of at least one type of storage under at least one file system.
  • a plurality of file systems may be mounted on each type of storage.
  • the embodiment of the present application may preset a first configuration file for each file system that can be mounted on each type of storage.
  • the configuration whitelist may be used to find out whether there is a first configuration file corresponding to the current file system of the current storage based on the currently mounted file system.
  • the configuration whitelist can be stored as follows:
  • first configuration file (P1) of the type of memory corresponding to the partition (vendor 1) in the current file system (W1) in the configuration whitelist the type of memory corresponding to the partition is placed in the current file
  • the first configuration file P1 under the system serves as configuration information matching the partition.
  • the second configuration file is used as configuration information matching the partition,
  • the second configuration file is the default configuration file of the current file system (W2).
  • Step S306 Mount a file system for the partition based on the configuration information matching the partition.
  • the configuration whitelist is obtained in the following manner:
  • the file system may be mounted based on the second configuration file of each file system through each type of memory; after the mounting is completed, a simulation instruction is sent to the memory to obtain a simulation result; based on the simulation result
  • a simulation instruction is sent to the memory to obtain a simulation result
  • the simulation result To obtain the memory performance of each type of memory when mounting the file system based on the second configuration file of each file system.
  • Based on the obtained memory performance and the preset standard performance determine the mounting parameters of the memory of the current category to be adjusted under the current file system; modify the second configuration file based on the mounting parameters to be adjusted, and modify the modified first
  • the second configuration file serves as the first configuration file of the current file system.
  • the memory of vendor 1 mounts the file system W1 based on the second configuration file M1 of the file system W1;
  • the memory of the manufacturer 1 mounts the file system W2 based on the second configuration file M2 of the file system W2;
  • the memory of manufacturer 1 mounts the file system W3 based on the third configuration file M3 of the file system W3;
  • the memory of manufacturer 2 mounts the file system W1 based on the second configuration file M1 of the file system W1;
  • the memory of the manufacturer 2 mounts the file system W2 based on the second configuration file M2 of the file system W2;
  • the memory of the manufacturer 4 mounts the file system W3 based on the third configuration file M3 of the file system W3.
  • a simulation instruction is sent to the memory to obtain a simulation result; based on the simulation result, the memory performance of each type of memory when mounting the file system based on the second configuration file of each file system is obtained.
  • Based on the obtained evaluation parameters in the memory performance and the pre-set evaluation parameters in the standard performance determine the mounting parameters of the memory of the current category to be adjusted under the current file system; modify the second configuration based on the mounting parameters to be adjusted File, and use the modified second configuration file as the first configuration file of the current file system.
  • FIG. 4 is a schematic block diagram of a terminal device provided by an embodiment of the present application. For ease of description, only parts related to the embodiment of the present application are shown.
  • the terminal device 4 may be a software unit, a hardware unit, or a combination of software and hardware built into terminal devices such as mobile phones, tablet computers, notebooks, and computers, or may be integrated as an independent pendant into the mobile phone, tablet computer, notebook, In computer and other terminal equipment.
  • the terminal device 4 includes:
  • the hardware parameter acquisition unit 41 is configured to acquire the hardware parameters of the memory corresponding to the partition when mounting the file system for the partition of the terminal device;
  • the configuration information determining unit 42 is configured to determine configuration information matching the partition based on the hardware parameters of the memory corresponding to the partition;
  • the mounting unit 43 is configured to mount a file system for the partition based on the configuration information matching the partition.
  • the terminal device further includes:
  • the storage unit 44 is configured to store the configuration whitelist in advance, and the configuration whitelist includes: a first configuration file of at least one category of memory.
  • the configuration information determining unit 42 includes:
  • the memory type determining module 421 is configured to determine the type of the memory corresponding to the partition through the hardware parameters of the memory corresponding to the partition;
  • the determining module 422 is configured to determine whether the first configuration file of the category of the memory corresponding to the partition exists in the configuration whitelist;
  • the first configuration information determining module 423 is configured to, if there is a first configuration file of the type of memory corresponding to the partition in the configuration whitelist, use the first configuration file of the type of memory corresponding to the partition as the Partition matching configuration information.
  • the second configuration information determination module 424 is configured to use the second configuration file as the configuration information matching the partition if the first configuration file of the type of the memory corresponding to the partition does not exist in the configuration whitelist.
  • the second configuration file is the default configuration file of the current file system.
  • the configuration information matching the partition includes: mounting parameters matching the memory corresponding to the partition.
  • the configuration whitelist is obtained in the following manner:
  • a set of mounting parameters whose memory performance meets a preset condition is selected to generate a first configuration file.
  • the file system when obtaining the configuration whitelist, is mounted for each type of memory based on each set of mounting parameters; after the mounting is completed, a simulation instruction is sent to the memory to obtain a simulation result Based on the simulation results, the memory performance of each type of memory after mounting the file system based on each set of mounting parameters is obtained.
  • At least one evaluation parameter is set for the memory performance; for each type of memory, the one with the highest evaluation parameter or the highest weighted sum of evaluation parameters for the memory performance is selected.
  • the group mounting parameter generates a first configuration file.
  • the configuration whitelist includes: a first configuration file of at least one type of storage under at least one file system.
  • the memory category determination module 421 is further configured to: determine the category of the memory corresponding to the partition through the hardware parameters of the memory corresponding to the partition;
  • the determining module 422 is further configured to: determine whether there is a first configuration file of the category of the memory corresponding to the partition in the current file system in the configuration whitelist;
  • the first configuration information determining module 423 is further configured to: if there is a first configuration file in the configuration whitelist that corresponds to the type of memory corresponding to the partition under the current file system, change the type of memory corresponding to the partition The first configuration file under the current file system is used as configuration information for the partition matching.
  • the second configuration information determination module 424 is further configured to: if there is no first configuration file in the configuration whitelist that corresponds to the type of memory of the partition under the current file system, use the second configuration file as the For configuration information of partition matching, the second configuration file is a default configuration file of the current file system.
  • the configuration whitelist is obtained in the following manner:
  • a first configuration file for each type of memory when mounting each file system is generated.
  • the file system when obtaining the configuration whitelist, is mounted based on the second configuration file of each file system through each type of memory; after the mounting is completed, a simulation instruction is sent to the memory to obtain the simulation Results; based on the simulation results, the memory performance of each type of memory when mounting the file system based on the second configuration file of each file system is obtained.
  • the configuration whitelist when obtaining the configuration whitelist, based on the obtained memory performance and the preset standard performance, determine the mounting parameters of the current type of memory to be adjusted under the current file system; based on the mounting to be adjusted The parameter modifies the second configuration file, and uses 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, memory bandwidth, mount time, memory usage, and power-down recovery.
  • the partition of the terminal device includes: a partition of the non-volatile memory of the terminal device.
  • the partition of the terminal device includes: an internal SD card and an external SD card of the terminal device.
  • each functional unit and module is used as an example for illustration.
  • the above-mentioned functions may be allocated by different functional units,
  • the module is completed, that is, the internal structure of the terminal device is divided into different functional units or modules to complete all or part of the functions described above.
  • the functional units and modules in the embodiments may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
  • the above integrated unit may use hardware It can also be implemented in the form of software functional units.
  • the specific names of each functional unit and module are only for the purpose of distinguishing each other, and are not used to limit the protection scope of the present application.
  • For the specific working processes of the units and modules in the foregoing terminal device reference may be made to the corresponding processes in the foregoing method embodiments, and details are not described herein again.
  • FIG. 5 is a schematic block diagram of a terminal device provided by another embodiment of the present application.
  • the terminal device 5 of this embodiment includes: one or more processors 50, a memory 51, and a computer program 52 stored in the memory 51 and executable on the processor 50.
  • the processor 50 executes the computer program 52, the steps in the above method embodiments are implemented, for example, steps S101 to S103 shown in FIG. 1.
  • the processor 50 executes the computer program 52
  • the functions of each module/unit in the foregoing embodiment of the terminal device are realized, for example, the functions of the modules 41 to 43 shown in FIG. 4.
  • the computer program 52 may be divided into one or more modules/units, and the one or more modules/units are stored in the memory 51 and executed by the processor 50 to complete This application.
  • the one or more modules/units may be a series of computer program instruction segments capable of performing specific functions, and the instruction segments are used to describe the execution process of the computer program 52 in the terminal device 5.
  • the computer program 52 may be divided into a hardware parameter acquisition unit, a configuration information determination unit, and a mounting unit. Exemplary:
  • a hardware parameter acquisition unit used to acquire hardware parameters of the memory corresponding to the partition when mounting a file system for the partition of the terminal device
  • a configuration information determining unit configured to determine configuration information matching the partition based on the hardware parameters of the memory corresponding to the partition
  • the mounting unit is configured to mount a file system for the partition based on the configuration information matching the partition.
  • the terminal device includes but is not limited to the processor 50 and the memory 51. Those skilled in the art may understand that FIG. 5 is only an example of the terminal device 5 and does not constitute a limitation on the terminal device 5. It may include more or fewer components than the illustration, 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 screen, and so on.
  • the processor 50 may be a central processing unit (Central Processing Unit, CPU), or other general-purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), Ready-made programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
  • the 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 equipped on the terminal device 5, a smart memory card (Smart, Media, Card, SMC), and a secure digital (SD) card , Flash card (Flash Card), etc.
  • the memory 51 may also include both an internal storage unit of the terminal device 5 and an external memory.
  • the memory 51 is used to store the computer program and other programs and data required by the terminal device.
  • the memory 51 can also be used to temporarily store data that has been or will be output.
  • the disclosed terminal device and method may be implemented in other ways.
  • the terminal device embodiments described above are only schematic.
  • the division of the modules or units is only a division of logical functions.
  • the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may be in electrical, mechanical or other forms.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
  • the above integrated unit may be implemented in the form of hardware or software functional unit.
  • the integrated module/unit is implemented in the form of a software functional unit and sold or used as an independent product, it may be stored in a computer-readable storage medium.
  • the present application can implement all or part of the processes in the methods of the above embodiments, and can also be completed by a computer program instructing relevant hardware.
  • the computer program can be stored in a computer-readable storage medium. When the program is executed by the processor, the steps of the foregoing method embodiments may be implemented.
  • the computer program includes computer program code, and the computer program code may be in the form of source code, object code, executable file, or some intermediate form.
  • the computer-readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a mobile hard disk, a magnetic disk, an optical disk, a computer memory, a read-only memory (ROM, Read-Only Memory) , Random Access Memory (RAM, Random Access Memory), electrical carrier signals, telecommunications signals and software distribution media, etc.
  • ROM Read-Only Memory
  • RAM Random Access Memory
  • electrical carrier signals telecommunications signals and software distribution media, etc.

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

一种挂载文件系统的方法、终端设备及计算机可读存储介质,所述方法包括:在为终端设备的分区挂载文件系统时,获取所述分区对应的存储器的硬件参数(S101),基于所述分区对应的存储器的硬件参数,确定与所述分区匹配的配置信息(S102),基于与所述分区匹配的配置信息,为所述分区挂载文件系统(S103)。通过上述方法可以为终端设备的存储器或分区提供合适的文件系统参数。

Description

一种挂载文件系统的方法、终端设备及存储介质 技术领域
本申请属于文件系统技术领域,尤其涉及一种挂载文件系统的方法、终端设备及计算机可读存储介质。
背景技术
文件系统是操作系统用于明确存储器或分区上的文件的方法和数据结构,即在存储器上组织文件的方法。操作系统中负责管理和存储文件信息的软件机构称为文件管理系统,简称文件系统。文件系统负责为用户建立文件,存入、读出、修改、转储文件,控制文件的存取,当用户不再使用时撤销文件等。
发明内容
本申请提供一种挂载文件系统的方法、终端设备及计算机可读存储介质,为终端设备的存储器或分区提供合适的文件系统参数。
本申请的第一方面提供了一种挂载文件系统的方法,应用于终端设备,所述方法包括:
在为所述终端设备的分区挂载文件系统时,获取所述分区对应的存储器的硬件参数;
基于所述分区对应的存储器的硬件参数,确定与所述分区匹配的配置信息;
基于与所述分区匹配的配置信息,为所述分区挂载文件系统。
本申请的第二方面提供了一种终端设备,包括:
硬件参数获取单元,用于在为所述终端设备的分区挂载文件系统时,获取所述分区对应的存储器的硬件参数;
配置信息确定单元,用于基于所述分区对应的存储器的硬件参数,确定与所述分区匹配的配置信息;
挂载单元,用于基于与所述分区匹配的配置信息,为所述分区挂载文件系统。
本申请实施例的第三方面提供了一种终端设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现本申请实施例第一方面提供的所述方法的步骤。
本申请实施例的第四方面提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被一个或多个处理器执行时实现本申请实施例第一方面提供的所述方法的步骤。
本申请实施例的第五方面提供了一种计算机程序产品,所述计算机程序产品包括计算机程序,所述计算机程序被一个或多个处理器执行时实现本申请实施例第一方面提供的所述方法的步骤。
附图说明
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1是本申请实施例提供的一种挂载文件系统的方法的实现流程示意图;
图2是本申请实施例提供的一种配置白名单的获取方法的实现流程示意图;
图3是本申请实施例提供的另一种挂载文件系统的方法的实现流程示意图;
图4是本申请实施例提供的一种终端设备的示意框图;
图5是本申请实施例提供的另一种终端设备的示意框图。
具体实施方式
以下描述中,为了说明而不是为了限定,提出了诸如特定系统结构、技术之类的具体细节,以便透彻理解本申请实施例。然而,本领域的技术人员应当清楚,在没有这些具体细节的其它实施例中也可以实现本申请。在其它情况中,省略对众所周知的系统、装置、电路以及方法的详细说明,以免不必要的细节妨碍本申请的描述。
应当理解,当在本说明书和所附权利要求书中使用时,术语“包括”指示所描述特征、整体、步骤、操作、元素和/或组件的存在,但并不排除一个或多个其它特征、整体、步骤、操作、元素、组件和/或其集合的存在或添加。
还应当理解,在此本申请说明书中所使用的术语仅仅是出于描述特定实施例的目的而并不意在限制本申请。如在本申请说明书和所附权利要求书中所使用的那样,除非上下文清楚地指明其它情况,否则单数形式的“一”、“一个”及“该”意在包括复数形式。
还应当进一步理解,在本申请说明书和所附权利要求书中使用的术语“和/或”是指相关联列出的项中的一个或多个的任何组合以及所有可能组合,并且包括这些组合。
如在本说明书和所附权利要求书中所使用的那样,术语“如果”可以依据上下文被解释为“当...时”或“一旦”或“响应于确定”或“响应于检测到”。类似地,短语“如果确定”或“如果检测到[所描述条件或事件]”可以依据上下文被解释为意指“一旦确定”或“响应于确定”或“一旦检测到[所描述条件或事件]”或“响应于检测到[所描述条件或事件]”。
为了说明本申请所述的技术方案,下面通过具体实施例来进行说明。
图1是本申请实施例提供的一种挂载文件系统的方法的实现流程示意图,如图所示,该方法应用于终端设备,可以包括以下步骤:
步骤S101,在为所述终端设备的分区挂载文件系统时,获取所述分区对应的存储器的 硬件参数。
在本申请实施例中,所述终端设备的分区包括:所述终端设备的非易失性存储器的分区。所述终端设备的分区也可以包括:所述终端设备的内置SD卡、外置SD卡。当然,实际应用中,还可以是与所述终端设备存在连接的其它存储介质。
若用户需要对所述终端设备的分区中的文件进行相关的操作,需要为所述分区挂载文件系统。通常,终端设备的分区的文件系统是在开机阶段挂载的,针对不同的分区一般都会预先配置好挂载参数,例如,可以预先配置好默认配置表fstab,该配置表中的挂载参数都是android系统原生经验值。
本申请实施例为了为终端设备的存储器或分区提供合适的文件系统参数,可以根据存储器或分区的硬件参数确定不同的文件系统参数,所述分区对应的存储器的硬件参数可以是某个厂商的某个产品的某个型号。
步骤S102,基于所述分区对应的存储器的硬件参数,确定与所述分区匹配的配置信息。
在本申请实施例中,可以预先为多个厂商的多个产品的多个型号分别设置不同的配置信息,并将配置信息设置为表格形式。在表格中查找所述分区对应的存储器的硬件参数对应的配置信息。
作为本申请另一实施例,在基于所述分区对应的存储器的硬件参数,确定与所述分区匹配的配置信息之前,还包括:
预先存储配置白名单,所述配置白名单包括:至少一个类别的存储器的第一配置文件。
在本申请实施例中,所述配置信息还可以是文件形式的,例如,根据配置文件生成第一配置文件,预先存储一份配置白名单,所述配置白名单中包括多个类别的存储器的第一配置文件。所述存储器的类别可以是存储器的厂商类别,这样,根据不同厂商的存储器设置不同的第一配置文件。避免了针对不同厂商继续分为不同产品不同型号时导致配置白名单繁琐复杂。
所述基于所述分区对应的存储器的硬件参数,确定与所述分区匹配的配置信息包括:
通过所述分区对应的存储器的硬件参数确定所述分区对应的存储器的类别;
确定所述配置白名单中是否存在所述分区对应的存储器的类别的第一配置文件;
若所述配置白名单中存在所述分区对应的存储器的类别的第一配置文件,则将所述分区对应的存储器的类别的第一配置文件作为所述分区匹配的配置信息;
若所述配置白名单中不存在所述分区对应的存储器的类别的第一配置文件,则将第二配置文件作为所述分区匹配的配置信息,所述第二配置文件为当前文件系统的默认配置文件。
在本申请实施例中,android系统原生经验的配置信息可以作为第二配置文件,预先 针对不同存储器的硬件参数设置的配置信息可以作为第一配置文件。在获取所述分区对应的存储器的硬件参数后,可以针对存储器的硬件参数(例如型号)确定所述分区对应的存储器的类别(例如厂商);然后确定所述配置白名单中是否存在所述分区对应的存储器的类别的第一配置文件;若所述配置白名单中存在所述分区对应的存储器的类别的第一配置文件,则将所述分区对应的存储器的类别的第一配置文件作为所述分区匹配的配置信息;若所述配置白名单中不存在所述分区对应的存储器的类别的第一配置文件,则将第二配置文件作为所述分区匹配的配置信息,所述第二配置文件为当前文件系统的默认配置文件。可以预先为部分厂商的存储器设置第一配置文件,若当前分区对应的存储器未设置第一配置文件,就可以选用第二配置文件,即默认配置文件。
步骤S103,基于与所述分区匹配的配置信息,为所述分区挂载文件系统。
在本申请实施例中,所述与所述分区匹配的配置信息包括:与所述分区对应的存储器匹配的挂载参数。
所述挂载参数可以包括:
noatime:该参数的意思是不更新文件访问时间。
Nobarrier/barrier:barrier的意思是在写入新的数据块到磁盘之前,会先将元数据写入日志。预先将元数据写入日志可以保证在写入真实数据前后一旦发生错误,日志功能能控制磁盘很容易地回滚到更改之前的状态。这个方法确保了不会发生文件系统崩溃的情况。Nobarrier是指禁用该功能。
Discard/nodiscard:驱动层是否主动做磁盘碎片整理。
可以基于第一配置文件或第二配置文件中的挂载参数,为所述分区挂载文件系统。
本申请实施例可以根据存储器的类别预先设置不同的第一配置文件,在为终端设备的分区挂载文件系统时,先判断是否预先存储了所述分区对应的存储器的第一配置文件,若存储了,则基于预先设置的第一配置文件为所述分区挂载文件系统,若未存储,则基于原始的第二配置文件为所述分区挂载文件系统,这样,就可以根据不同的存储器类别为所述存储器设置合适的文件系统参数。
图2是本申请实施例提供的一种配置白名单的获取方法的实现流程示意图,如图所示,该方法包括以下步骤:
在本申请实施例中,可以先获取至少一个类别的存储器分别在多组挂载参数下的存储器性能,可参照步骤S201至步骤S203,在获取了至少一个类别的存储器分别在多组挂载参数下的存储器性能之后,就可以对于每类存储器,选取所述存储器性能符合预设条件的一组挂载参数生成第一配置文件,可参照步骤S204至步骤S205。
步骤S201,基于每组挂载参数,为每类存储器挂载文件系统;
步骤S202,在挂载完成后,向所述存储器发送模拟指令,获得模拟结果;
步骤S203,基于所述模拟结果,获得每类存储器基于每组挂载参数挂载文件系统后的存储器性能。
在本申请实施例中,可以预先设置多组挂载参数,然后,基于每组挂载参数,为多个类别的存储器分别挂载文件系统。作为举例,预先设置了5组挂载参数:挂载参数a、挂载参数b、挂载参数c、挂载参数d,设置了4个类别的存储器,厂商1、厂商2、厂商3、厂商4。在为每类存储器挂载文件系统时,可以按照如下方式:
厂商1的存储器,基于挂载参数a挂载文件系统;
厂商1的存储器,基于挂载参数b挂载文件系统;
厂商1的存储器,基于挂载参数c挂载文件系统;
厂商1的存储器,基于挂载参数d挂载文件系统;
厂商1的存储器,基于挂载参数f挂载文件系统;
厂商2的存储器,基于挂载参数a挂载文件系统;
……
厂商4的存储器,基于挂载参数f挂载文件系统。
以厂商1的存储器为例,在基于每种挂载参数挂载文件系统后,可以向所述存储器发送模拟指令,获得模拟结果。所述模拟指令可以包括:存入指令、读出指令、修改指令等,当然,实际应用中,还可以是其它与存储器的文件系统负责的操作相关的模拟指令。基于所述模拟指令对应的模拟结果,就可以获得当前类别的存储器基于每组挂载参数挂载文件系统后的存储器性能。
步骤S204,为所述存储器性能设置至少一个评价参数;
步骤S205,对于每类存储器,选取所述存储器性能的评价参数最高或评价参数加权和最高的一组挂载参数生成第一配置文件。
在本申请实施例中,为了确定哪种挂载参数更适合当前类别的存储器,可以为所述存储器性能设置至少一个评价参数,
所述存储器性能包括以下至少一项评价参数:存取时间、存储周期、存储器带宽、挂载时间、内存使用、掉电恢复。
所述存取时间为从启动到完成一次存储器操作所经历的时间。即从一次读操作命令发出到该操作完成,将数据读入数据缓冲寄存器为止所经历的时间。
所述存储周期为连续启动两次操作所需间隔的最小时间。
所述存储器带宽为单位时间内存储器所存取的信息量。
挂载时间为挂载文件系统所需要的时间。
内存使用为内存挂载文件系统时的内存使用率。
掉电恢复为固态硬盘在掉电后,是否能够从掉电中恢复过来,继续正常的工作。
对于当前类别的存储器,可以先把预先选取的评价参数进行预处理,例如,评价参数为存取时间时,根据存取时间设置评价参数对应的值,这样,就可以将选取的多个评价参数分别设置相应的值,然后再根据每个评价参数对应的权重计算每组挂载参数的加权和,将加权和结果最高的一组挂载参数生成第一配置文件。当然,实际应用中,也可以设置一个评价参数,在预处理后获得该评价参数对应的值,将评价参数最高的一组挂载参数生成第一配置文件。获得的第一配置文件就为当前类别的存储器对应的第一配置文件,多个类别的存储器的第一配置文件组成了配置白名单。
图3是本申请实施例提供的另一种挂载文件系统的方法的实现流程示意图,如图所示,该方法应用于终端设备,可以包括以下步骤:
步骤S301,在为所述终端设备的分区挂载文件系统时,获取所述分区对应的存储器的硬件参数。
该步骤与步骤S101内容一致,具体可参照步骤S101的描述,在此不再赘述。
步骤S302,通过所述分区对应的存储器的硬件参数确定所述分区对应的存储器的类别。
步骤S303,确定配置白名单中是否存在所述分区对应的存储器的类别在当前文件系统下的第一配置文件。
步骤S304,若所述配置白名单中存在所述分区对应的存储器的类别在当前文件系统下的第一配置文件,则将所述分区对应的存储器的类别在当前文件系统下的第一配置文件作为所述分区匹配的配置信息。
步骤S305,若所述配置白名单中不存在所述分区对应的存储器的类别在当前文件系统下的第一配置文件,则将第二配置文件作为所述分区匹配的配置信息,所述第二配置文件为当前文件系统的默认配置文件。
在本申请实施例中,所述配置白名单包括:至少一个类别的存储器在至少一种文件系统下的第一配置文件。每个类别的存储器可能会挂载多种文件系统,本申请实施例可以为每个类别的存储器可以挂载的每种文件系统均预先设置第一配置文件。如图1所示实施例的描述,通过所述分区对应的存储器的硬件参数确定所述分区对应的存储器的类别(例如厂商)后,就可以确定配置白名单中是否存在所述分区对应的存储器的类别在当前文件系统下的第一配置文件。在对分区挂载文件系统时,可以基于当前挂载的文件系统从配置白名单中查找是否存在与当前的存储器当前的文件系统对应的第一配置文件。作为举例,配 置白名单可以按照如下形式存储:
厂商1的存储器,文件系统W1,第一配置文件P1;
厂商1的存储器,文件系统W2,第一配置文件P2;
厂商2的存储器,文件系统W1,第一配置文件P3;
厂商2的存储器,文件系统W3,第一配置文件P4;
厂商3的存储器,文件系统W2,第一配置文件P5。
若所述配置白名单中存在所述分区对应的存储器的类别(厂商1)在当前文件系统(W1)下的第一配置文件(P1),则将所述分区对应的存储器的类别在当前文件系统下的第一配置文件P1作为所述分区匹配的配置信息。若所述配置白名单中不存在所述分区对应的存储器的类别(厂商2)在当前文件系统(W2)下的第一配置文件,则将第二配置文件作为所述分区匹配的配置信息,所述第二配置文件为当前文件系统(W2)的默认配置文件。
步骤S306,基于与所述分区匹配的配置信息,为所述分区挂载文件系统。
作为本申请另一实施例,所述配置白名单通过以下方式获取:
获取至少一个类别的存储器基于每种文件系统的第二配置文件挂载文件系统时的存储器性能,基于每类存储器分别挂载每种文件系统时的存储器性能,生成每类存储器在挂载每种文件系统时的第一配置文件。
在本申请实施例中,可以通过每类存储器基于每种文件系统的第二配置文件挂载文件系统;在挂载完成后,向所述存储器发送模拟指令,获得模拟结果;基于所述模拟结果,获得每类存储器基于每种文件系统的第二配置文件挂载文件系统时的存储器性能。基于获得的存储器性能与预先设置的标准性能,确定当前类别的存储器在当前文件系统下待调整的挂载参数;基于待调整的挂载参数修改所述第二配置文件,并将修改后的第二配置文件作为当前文件系统的第一配置文件。
作为举例,在为每类存储器挂载文件系统时,可以按照如下方式:
厂商1的存储器,基于文件系统W1的第二配置文件M1挂载文件系统W1;
厂商1的存储器,基于文件系统W2的第二配置文件M2挂载文件系统W2;
厂商1的存储器,基于文件系统W3的第三配置文件M3挂载文件系统W3;
厂商2的存储器,基于文件系统W1的第二配置文件M1挂载文件系统W1;
厂商2的存储器,基于文件系统W2的第二配置文件M2挂载文件系统W2;
……
厂商4的存储器,基于文件系统W3的第三配置文件M3挂载文件系统W3。
在挂载完成后,向所述存储器发送模拟指令,获得模拟结果;基于所述模拟结果,获得每类存储器基于每种文件系统的第二配置文件挂载文件系统时的存储器性能。还可以为 每种文件系统设置标准性能,获得的存储器性能和标准性能采用相同的评价参数。基于获得的存储器性能中的评价参数与预先设置的标准性能中的评价参数,确定当前类别的存储器在当前文件系统下待调整的挂载参数;基于待调整的挂载参数修改所述第二配置文件,并将修改后的第二配置文件作为当前文件系统的第一配置文件。
应理解,上述实施例中各步骤的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。
图4是本申请一实施例提供的终端设备的示意框图,为了便于说明,仅示出与本申请实施例相关的部分。
该终端设备4可以是内置于手机、平板电脑、笔记本、计算机等终端设备内的软件单元、硬件单元或者软硬结合的单元,也可以作为独立的挂件集成到所述手机、平板电脑、笔记本、计算机等终端设备中。
所述终端设备4包括:
硬件参数获取单元41,用于在为所述终端设备的分区挂载文件系统时,获取所述分区对应的存储器的硬件参数;
配置信息确定单元42,用于基于所述分区对应的存储器的硬件参数,确定与所述分区匹配的配置信息;
挂载单元43,用于基于与所述分区匹配的配置信息,为所述分区挂载文件系统。
作为本申请另一实施例,所述终端设备还包括:
存储单元44,用于预先存储配置白名单,所述配置白名单包括:至少一个类别的存储器的第一配置文件。
作为本申请另一实施例,所述配置信息确定单元42包括:
存储器类别确定模块421,用于通过所述分区对应的存储器的硬件参数确定所述分区对应的存储器的类别;
确定模块422,用于确定所述配置白名单中是否存在所述分区对应的存储器的类别的第一配置文件;
第一配置信息确定模块423,用于若所述配置白名单中存在所述分区对应的存储器的类别的第一配置文件,则将所述分区对应的存储器的类别的第一配置文件作为所述分区匹配的配置信息。
第二配置信息确定模块424,用于若所述配置白名单中不存在所述分区对应的存储器的类别的第一配置文件,则将第二配置文件作为所述分区匹配的配置信息,所述第二配置 文件为当前文件系统的默认配置文件。
作为本申请另一实施例,所述与所述分区匹配的配置信息包括:与所述分区对应的存储器匹配的挂载参数。
作为本申请另一实施例,所述配置白名单通过以下方式获取:
获取至少一个类别的存储器分别在多组挂载参数下的存储器性能;
对于每类存储器,选取所述存储器性能符合预设条件的一组挂载参数生成第一配置文件。
作为本申请另一实施例,所述在获取配置白名单时,基于每组挂载参数,为每类存储器挂载文件系统;在挂载完成后,向所述存储器发送模拟指令,获得模拟结果;基于所述模拟结果,获得每类存储器基于每组挂载参数挂载文件系统后的存储器性能。
作为本申请另一实施例,所述在获取配置白名单时,为所述存储器性能设置至少一个评价参数;对于每类存储器,选取所述存储器性能的评价参数最高或评价参数加权和最高的一组挂载参数生成第一配置文件。
作为本申请另一实施例,所述配置白名单包括:至少一个类别的存储器在至少一种文件系统下的第一配置文件。
作为本申请另一实施例,
所述存储器类别确定模块421还用于:通过所述分区对应的存储器的硬件参数确定所述分区对应的存储器的类别;
所述确定模块422还用于:确定所述配置白名单中是否存在所述分区对应的存储器的类别在当前文件系统下的第一配置文件;
所述第一配置信息确定模块423还用于:若所述配置白名单中存在所述分区对应的存储器的类别在当前文件系统下的第一配置文件,则将所述分区对应的存储器的类别在当前文件系统下的第一配置文件作为所述分区匹配的配置信息。
所述第二配置信息确定模块424还用于:若所述配置白名单中不存在所述分区对应的存储器的类别在当前文件系统下的第一配置文件,则将第二配置文件作为所述分区匹配的配置信息,所述第二配置文件为当前文件系统的默认配置文件。
作为本申请另一实施例,所述配置白名单通过以下方式获取:
获取至少一个类别的存储器基于每种文件系统的第二配置文件挂载文件系统时的存储器性能;
基于每类存储器分别挂载每种文件系统时的存储器性能,生成每类存储器在挂载每种文件系统时的第一配置文件。
作为本申请另一实施例,在获取配置白名单时,通过每类存储器基于每种文件系统的 第二配置文件挂载文件系统;在挂载完成后,向所述存储器发送模拟指令,获得模拟结果;基于所述模拟结果,获得每类存储器基于每种文件系统的第二配置文件挂载文件系统时的存储器性能。
作为本申请另一实施例,在获取配置白名单时,基于获得的存储器性能与预先设置的标准性能,确定当前类别的存储器在当前文件系统下待调整的挂载参数;基于待调整的挂载参数修改所述第二配置文件,并将修改后的第二配置文件作为当前文件系统的第一配置文件。
所述存储器性能包括以下至少一项评价参数:存取时间、存储周期、存储器带宽、挂载时间、内存使用、掉电恢复。
所述终端设备的分区包括:所述终端设备的非易失性存储器的分区。
所述终端设备的分区包括:所述终端设备的内置SD卡、外置SD卡。
所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,仅以上述各功能单元、模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能单元、模块完成,即将所述终端设备的内部结构划分成不同的功能单元或模块,以完成以上描述的全部或者部分功能。实施例中的各功能单元、模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中,上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。另外,各功能单元、模块的具体名称也只是为了便于相互区分,并不用于限制本申请的保护范围。上述终端设备中单元、模块的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
图5是本申请又一实施例提供的终端设备的示意框图。如图5所示,该实施例的终端设备5包括:一个或多个处理器50、存储器51以及存储在所述存储器51中并可在所述处理器50上运行的计算机程序52。所述处理器50执行所述计算机程序52时实现上述各个方法实施例中的步骤,例如图1所示的步骤S101至S103。或者,所述处理器50执行所述计算机程序52时实现上述终端设备实施例中各模块/单元的功能,例如图4所示模块41至43的功能。
示例性的,所述计算机程序52可以被分割成一个或多个模块/单元,所述一个或者多个模块/单元被存储在所述存储器51中,并由所述处理器50执行,以完成本申请。所述一个或多个模块/单元可以是能够完成特定功能的一系列计算机程序指令段,该指令段用于描述所述计算机程序52在所述终端设备5中的执行过程。例如,所述计算机程序52可以被 分割成硬件参数获取单元、配置信息确定单元、挂载单元,示例性的:
硬件参数获取单元,用于在为所述终端设备的分区挂载文件系统时,获取所述分区对应的存储器的硬件参数;
配置信息确定单元,用于基于所述分区对应的存储器的硬件参数,确定与所述分区匹配的配置信息;
挂载单元,用于基于与所述分区匹配的配置信息,为所述分区挂载文件系统。
其它单元或者模块可参照图4所示的实施例中的描述,在此不再赘述。
所述终端设备包括但不仅限于处理器50、存储器51。本领域技术人员可以理解,图5仅仅是终端设备5的一个示例,并不构成对终端设备5的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件,例如所述终端设备还可以包括输入设备、输出设备、网络接入设备、总线、触控显示屏等。
所述处理器50可以是中央处理单元(Central Processing Unit,CPU),还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。
所述存储器51可以是所述终端设备5的内部存储单元,例如终端设备5的硬盘或内存。所述存储器51也可以是所述终端设备5的外部存储器,例如所述终端设备5上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。进一步地,所述存储器51还可以既包括所述终端设备5的内部存储单元也包括外部存储器。所述存储器51用于存储所述计算机程序以及所述终端设备所需的其他程序和数据。所述存储器51还可以用于暂时地存储已经输出或者将要输出的数据。
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。
在本申请所提供的实施例中,应该理解到,所揭露的终端设备和方法,可以通过其它的方式实现。例如,以上所描述的终端设备实施例仅仅是示意性的,例如,所述模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元 或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通讯连接可以是通过一些接口,装置或单元的间接耦合或通讯连接,可以是电性,机械或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。
所述集成的模块/单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请实现上述实施例方法中的全部或部分流程,也可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于一计算机可读存储介质中,该计算机程序在被处理器执行时,可实现上述各个方法实施例的步骤。其中,所述计算机程序包括计算机程序代码,所述计算机程序代码可以为源代码形式、对象代码形式、可执行文件或某些中间形式等。所述计算机可读介质可以包括:能够携带所述计算机程序代码的任何实体或装置、记录介质、U盘、移动硬盘、磁碟、光盘、计算机存储器、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、电载波信号、电信信号以及软件分发介质等。需要说明的是,所述计算机可读存储介质包含的内容可以根据司法管辖区内立法和专利实践的要求进行适当的增减,例如在某些司法管辖区,根据立法和专利实践,计算机可读存储介质不包括电载波信号和电信信号。
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述或记载的部分,可以参见其它实施例的相关描述。
以上所述实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围,均应包含在本申请的保护范围之内。

Claims (20)

  1. 一种挂载文件系统的方法,其特征在于,应用于终端设备,所述方法包括:
    在为所述终端设备的分区挂载文件系统时,获取所述分区对应的存储器的硬件参数;
    基于所述分区对应的存储器的硬件参数,确定与所述分区匹配的配置信息;
    基于与所述分区匹配的配置信息,为所述分区挂载文件系统。
  2. 如权利要求1所述的挂载文件系统的方法,其特征在于,在基于所述分区对应的存储器的硬件参数,确定与所述分区匹配的配置信息之前,还包括:
    预先存储配置白名单,所述配置白名单包括:至少一个类别的存储器的第一配置文件。
  3. 如权利要求2所述的挂载文件系统的方法,其特征在于,所述基于所述分区对应的存储器的硬件参数,确定与所述分区匹配的配置信息包括:
    通过所述分区对应的存储器的硬件参数确定所述分区对应的存储器的类别;
    确定所述配置白名单中是否存在所述分区对应的存储器的类别的第一配置文件;
    若所述配置白名单中存在所述分区对应的存储器的类别的第一配置文件,则将所述分区对应的存储器的类别的第一配置文件作为所述分区匹配的配置信息。
  4. 如权利要求3所述的挂载文件系统的方法,其特征在于,在确定所述配置白名单中是否存在所述分区对应的存储器的类别的第一配置文件之后,还包括:
    若所述配置白名单中不存在所述分区对应的存储器的类别的第一配置文件,则将第二配置文件作为所述分区匹配的配置信息,所述第二配置文件为当前文件系统的默认配置文件。
  5. 如权利要求2所述的挂载文件系统的方法,其特征在于,所述与所述分区匹配的配置信息包括:与所述分区对应的存储器匹配的挂载参数。
  6. 如权利要求5所述的挂载文件系统的方法,其特征在于,所述配置白名单通过以下方式获取:
    获取至少一个类别的存储器分别在多组挂载参数下的存储器性能;
    对于每类存储器,选取所述存储器性能符合预设条件的一组挂载参数生成第一配置文件。
  7. 如权利要求6所述的挂载文件系统的方法,其特征在于,所述获取至少一个类别的存储器分别在多组挂载参数下的存储器性能包括:
    基于每组挂载参数,为每类存储器挂载文件系统;
    在挂载完成后,向所述存储器发送模拟指令,获得模拟结果;
    基于所述模拟结果,获得每类存储器基于每组挂载参数挂载文件系统后的存储器性能。
  8. 如权利要求6所述的挂载文件系统的方法,其特征在于,所述对于每类存储器,选 取所述存储器性能符合预设条件的一组挂载参数生成第一配置文件包括:
    为所述存储器性能设置至少一个评价参数;
    对于每类存储器,选取所述存储器性能的评价参数最高或评价参数加权和最高的一组挂载参数生成第一配置文件。
  9. 如权利要求2所述的挂载文件系统的方法,其特征在于,所述配置白名单包括:至少一个类别的存储器在至少一种文件系统下的第一配置文件。
  10. 如权利要求9所述的挂载文件系统的方法,其特征在于,所述基于所述分区对应的存储器的硬件参数,确定与所述分区匹配的配置信息包括:
    通过所述分区对应的存储器的硬件参数确定所述分区对应的存储器的类别;
    确定所述配置白名单中是否存在所述分区对应的存储器的类别在当前文件系统下的第一配置文件;
    若所述配置白名单中存在所述分区对应的存储器的类别在当前文件系统下的第一配置文件,则将所述分区对应的存储器的类别在当前文件系统下的第一配置文件作为所述分区匹配的配置信息。
  11. 如权利要求10所述的挂载文件系统的方法,其特征在于,在确定所述配置白名单中是否存在所述分区对应的存储器的类别在当前文件系统下的第一配置文件之后,还包括:
    若所述配置白名单中不存在所述分区对应的存储器的类别在当前文件系统下的第一配置文件,则将第二配置文件作为所述分区匹配的配置信息,所述第二配置文件为当前文件系统的默认配置文件。
  12. 如权利要求11所述的挂载文件系统的方法,其特征在于,所述配置白名单通过以下方式获取:
    获取至少一个类别的存储器基于每种文件系统的第二配置文件挂载文件系统时的存储器性能;
    基于每类存储器分别挂载每种文件系统时的存储器性能,生成每类存储器在挂载每种文件系统时的第一配置文件。
  13. 如权利要求12所述的挂载文件系统的方法,其特征在于,所述获取至少一个类别的存储器基于每种文件系统的第二配置文件挂载文件系统时的存储器性能包括:
    通过每类存储器基于每种文件系统的第二配置文件挂载文件系统;
    在挂载完成后,向所述存储器发送模拟指令,获得模拟结果;
    基于所述模拟结果,获得每类存储器基于每种文件系统的第二配置文件挂载文件系统时的存储器性能。
  14. 如权利要求12所述的挂载文件系统的方法,其特征在于,所述基于每类存储器分 别挂载每种文件系统时的存储器性能,生成每类存储器在挂载每种文件系统时的第一配置文件包括:
    基于获得的存储器性能与预先设置的标准性能,确定当前类别的存储器在当前文件系统下待调整的挂载参数;
    基于待调整的挂载参数修改所述第二配置文件,并将修改后的第二配置文件作为当前文件系统的第一配置文件。
  15. 如权利要求6至8、12至14任一项所述的挂载文件系统的方法,其特征在于,所述存储器性能包括以下至少一项评价参数:存取时间、存储周期、存储器带宽、挂载时间、内存使用、掉电恢复。
  16. 如权利要求1所述的挂载文件系统的方法,其特征在于,所述终端设备的分区包括:所述终端设备的非易失性存储器的分区。
  17. 如权利要求1所述的挂载文件系统的方法,其特征在于,所述终端设备的分区包括:所述终端设备的内置SD卡、外置SD卡。
  18. 一种终端设备,其特征在于,包括:
    硬件参数获取单元,用于在为所述终端设备的分区挂载文件系统时,获取所述分区对应的存储器的硬件参数;
    配置信息确定单元,用于基于所述分区对应的存储器的硬件参数,确定与所述分区匹配的配置信息;
    挂载单元,用于基于与所述分区匹配的配置信息,为所述分区挂载文件系统。
  19. 一种终端设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机程序,其特征在于,所述处理器执行所述计算机程序时实现如权利要求1至17任一项所述方法的步骤。
  20. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质存储有计算机程序,所述计算机程序被一个或多个处理器执行时实现如权利要求1至17任一项所述方法的步骤。
PCT/CN2018/119177 2018-12-04 2018-12-04 一种挂载文件系统的方法、终端设备及存储介质 WO2020113421A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201880098828.1A CN113272785B (zh) 2018-12-04 2018-12-04 一种挂载文件系统的方法、终端设备及存储介质
PCT/CN2018/119177 WO2020113421A1 (zh) 2018-12-04 2018-12-04 一种挂载文件系统的方法、终端设备及存储介质

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2018/119177 WO2020113421A1 (zh) 2018-12-04 2018-12-04 一种挂载文件系统的方法、终端设备及存储介质

Publications (1)

Publication Number Publication Date
WO2020113421A1 true WO2020113421A1 (zh) 2020-06-11

Family

ID=70974863

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/119177 WO2020113421A1 (zh) 2018-12-04 2018-12-04 一种挂载文件系统的方法、终端设备及存储介质

Country Status (2)

Country Link
CN (1) CN113272785B (zh)
WO (1) WO2020113421A1 (zh)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114443582B (zh) * 2021-12-22 2022-11-29 科东(广州)软件科技有限公司 一种操作系统上文件系统挂载方法、装置、设备及介质
CN115168300B (zh) * 2022-09-05 2022-12-09 山东正中信息技术股份有限公司 一种基于文件系统过滤的便携式移动工作方法及系统

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102609741A (zh) * 2012-01-31 2012-07-25 上海艾尚通讯科技有限公司 一种移动设备及其内、外部存储卡间数据交换的方法
US20140013051A1 (en) * 2012-03-12 2014-01-09 Huawei Technologies Co., Ltd Data Storage Method and Data Storage Apparatus
CN105183517A (zh) * 2015-09-14 2015-12-23 广东欧珀移动通信有限公司 在recovery模式下挂载外部存储设备的方法、装置及电子装置
CN106406768A (zh) * 2016-09-28 2017-02-15 努比亚技术有限公司 安卓系统用户数据分区调整方法及装置
CN107506496A (zh) * 2017-09-28 2017-12-22 北京小米移动软件有限公司 碎片整理方法、装置及计算机可读存储介质

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105242885B (zh) * 2015-10-30 2019-03-26 北京奇艺世纪科技有限公司 一种网络存储的变更方法及装置
CN105549914A (zh) * 2015-12-25 2016-05-04 惠州Tcl移动通信有限公司 一种外置存储设备的挂载方法及系统
CN106873921A (zh) * 2017-03-24 2017-06-20 努比亚技术有限公司 一种多分区外置存储设备的挂载方法及装置
CN107391157B (zh) * 2017-07-31 2020-07-31 北京小米移动软件有限公司 移动终端以及识别移动存储设备的方法

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102609741A (zh) * 2012-01-31 2012-07-25 上海艾尚通讯科技有限公司 一种移动设备及其内、外部存储卡间数据交换的方法
US20140013051A1 (en) * 2012-03-12 2014-01-09 Huawei Technologies Co., Ltd Data Storage Method and Data Storage Apparatus
CN105183517A (zh) * 2015-09-14 2015-12-23 广东欧珀移动通信有限公司 在recovery模式下挂载外部存储设备的方法、装置及电子装置
CN106406768A (zh) * 2016-09-28 2017-02-15 努比亚技术有限公司 安卓系统用户数据分区调整方法及装置
CN107506496A (zh) * 2017-09-28 2017-12-22 北京小米移动软件有限公司 碎片整理方法、装置及计算机可读存储介质

Also Published As

Publication number Publication date
CN113272785B (zh) 2024-02-27
CN113272785A (zh) 2021-08-17

Similar Documents

Publication Publication Date Title
CN104040516B (zh) 用于数据去重的方法、设备和系统
US20220197818A1 (en) Method and apparatus for performing operations to namespaces of a flash memory device
EP3252592A1 (en) Method and device for storing and reading data
CN108427649B (zh) Usb接口的接入管理方法、终端设备、系统及存储介质
CN104699423B (zh) Linux系统中绑定盘符的方法和装置
CN104541280A (zh) 用于利用非易失性存储器装置的备选引导路径支持
CN100456224C (zh) 数据控制设备
US8265919B1 (en) Emulating a peripheral mass storage device with a portable device
CN109376126B (zh) 一种文件或文件夹处理方法、移动终端及存储介质
WO2020113421A1 (zh) 一种挂载文件系统的方法、终端设备及存储介质
CN111984557A (zh) 数据处理方法、装置和系统
CN112996020A (zh) 一种基于蓝牙的自动化测试方法、装置及蓝牙测试终端
CN115562738A (zh) 一种端口配置方法、组件及硬盘扩展装置
CN103092648A (zh) 一种镜像升级方法、系统及用户设备和个人计算机
CN110569038B (zh) 随机验证参数设计方法、装置、计算机设备及存储介质
CN111897760A (zh) 电子产品及其扩展装置、控制方法与控制装置
CN108399076A (zh) 一种基于uefi的固件更新方法与装置
CN108156310A (zh) 一种指纹处理的方法和系统、终端设备及计算机可读介质
CN111782474A (zh) 日志处理方法、装置、电子设备和介质
CN110019040B (zh) 一种文件夹处理方法、移动终端及存储介质
CN109271266B (zh) 文件传输方法、装置及终端设备
CN109104481B (zh) 文件完整性检测方法、文件完整性检测装置及终端设备
CN111352641A (zh) 借助批处理的自动打包方法、装置、计算机设备及存储介质
WO2022188417A1 (zh) 数据处理方法、装置、设备及存储介质
CN112015459A (zh) 一种镜像文件的升级方法、装置、终端及可读存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18941969

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 19.10.2021)

122 Ep: pct application non-entry in european phase

Ref document number: 18941969

Country of ref document: EP

Kind code of ref document: A1