File storage method and electronic device
By intelligently storing files to multiple heterogeneous storage devices, and selecting the most suitable storage device for storage and reading based on the file's latency and bandwidth requirements, it solves the problem of insufficient performance of multiple heterogeneous storage devices in the existing technology. Utilization issues improve file access efficiency and storage device utilization.
Patent Information
- Application Number
- PCT/CN2023/143363
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-04-15
- Filing Date
- 2023-12-29
- Publication Date
- 2024-10-24
AI Technical Summary
Existing technology is difficult to fully utilize the performance of multiple heterogeneous storage devices, resulting in low file access speeds and prone to stuck or frame loss problems.
By obtaining the performance requirement information of the file, the file is intelligently stored in multiple heterogeneous storage devices. According to the delay and bandwidth requirements of the file, the most suitable storage device is selected for storage and reading, and multi-copy storage is implemented to improve reliability. and speed.
It effectively reduces the impact of heterogeneous storage device performance differences on file processing speed, improves file access efficiency, shortens latency, and improves storage device utilization.
Smart Images

Figure CN2023143363_24102024_PF_FP_ABST
Abstract
Description
File storage method and electronic device
[0001] This application claims priority from the Chinese patent application filed with the State Intellectual Property Office on April 15, 2023, with application number 202310418130.6 and application name “File Storage Method and Electronic Device,” the entire contents of which are incorporated herein by reference. Technical Field
[0002] The present application relates to the field of storage technology, and in particular to a file storage method and an electronic device. Background Art
[0003] As users' demand for storage space increases, the storage space of a single storage device cannot meet their needs. In this case, electronic devices can use two or more storage devices. How to maximize the performance of two or more storage devices has become an urgent problem to be solved.
[0004] Summary of the Invention
[0005] The present application provides a file storage method and electronic device, which can give full play to the performance of storage devices.
[0006] In order to achieve the above objectives, the embodiments of the present application provide the following technical solutions:
[0007] In a first aspect, a file storage method is provided, which is applied to an electronic device or component (such as a chip system), and the method includes:
[0008] Obtaining information associated with the performance requirements of the file, the information associated with the performance requirements of the file including one or more of the following information: frequency of use of the file, duration of use of the file, information about the process using the file, scenarios in which the file is used, read and write I / O types of the file, freezes or frame drops when reading and writing the file, classification of the file, and time periods during which the file is accessed;
[0009] According to the information associated with the performance requirements of the file, the file is stored in a target storage device among multiple storage devices; the multiple storage devices include a first storage device and a second storage device, and the first storage device and the second storage device are heterogeneous storage devices.
[0010] In this method, the electronic device can identify the performance requirements of a file and discriminately store the file in a storage device that meets the performance requirements of the file in a heterogeneous storage device, thereby fully utilizing the performance of the heterogeneous device, meeting the file access requirements, and improving the file access effect. For example, for a file with low latency requirements, the file is stored in a high-speed storage device in the heterogeneous storage device to reduce the performance bottleneck of the storage device, shorten the access latency, and improve the access speed. The storage device with faster storage speed in the heterogeneous device can be called a high-speed storage device, and the storage device with slower storage speed can be called a low-speed storage device.
[0011] Optionally, the high-speed storage device and the low-speed storage device may be determined based on performance information of the storage device, where the performance information may include dynamic information and static information.
[0012] Optionally, the high-speed storage device and the low-speed storage device may be different storage devices at different times. For example, based on the performance information of the first storage device and the performance information of the second storage device, if at a first moment the number of inflights on the first storage device is small and the storage speed of the first storage device is fast, then the first storage device is the high-speed storage device. If at a second moment the number of inflights on the second storage device is small and the storage speed of the second storage device is fast, then the second storage device is the high-speed storage device.
[0013] Optionally, the heterogeneous storage device may be, for example, UFS, EMMC, or other heterogeneous storage devices.
[0014] In one possible design, the information associated with the performance requirements of the file also includes: the application status of the application that calls the file.
[0015] In one possible design, it also includes:
[0016] Acquire performance information of the first storage device and / or the second storage device;
[0017] storing the file in the target storage device according to the performance information of the first storage device and / or the second storage device and information associated with the performance requirement of the file;
[0018] The performance information of the first storage device includes one or more of the following: processing latency, bandwidth, total storage space, total lifespan, busyness, used storage space, remaining storage space, service life, and remaining lifespan of the first storage device;
[0019] The performance information of the second storage device includes one or more of the following: processing delay, bandwidth, total storage space, total lifespan, busyness, used storage space, remaining storage space, service life, and remaining lifespan of the second storage device.
[0020] In this method, the electronic device can intelligently determine the performance requirements of the file and the performance information of the storage device, and intelligently allocate storage space for the file accordingly.
[0021] In one possible design, storing the file in a target storage device among the plurality of storage devices according to the information associated with the performance requirement of the file includes:
[0022] If the information associated with the performance requirement of the file meets the first condition, storing the file in the first storage device;
[0023] The performance of the first storage device is better than the performance of the second type of storage device; the performance of the storage device is determined according to the latency and / or bandwidth of the storage device;
[0024] The first condition includes at least one of the following conditions: the file usage frequency is greater than or equal to the first frequency, the file classification belongs to the first preset classification, the file usage duration is greater than or equal to the first usage duration, the scenario in which the file is used is the first preset scenario, the type of the process using the file is the first preset type, the IO type of the file is synchronous IO, the file has experienced freezes or frame drops when being read and written, the file IO type is file reading, and the time period in which the file is accessed belongs to the first preset time period.
[0025] In the embodiment of the present application, the file that meets the first condition may be a delay-sensitive file.
[0026] For example, if the first condition is met and the file is a delay-sensitive file, the file can be stored in a high-speed storage device (an example of the first storage device) to improve the access efficiency of the file and thereby improve the performance of the electronic device.
[0027] Latency-sensitive files can be divided into multiple levels. For example, based on the latency requirements of the files, they can be divided into N (positive integer) levels. Some files require an access latency of xms, while others require an access latency of yms.
[0028] In one possible design, if the information associated with the performance requirement of the file meets the first condition, the method further includes:
[0029] The file is stored in the second storage device.
[0030] For example, if the first condition determines that a file is a performance-critical file, multiple copies of the file can be stored. For example, the file can be stored on multiple storage devices within heterogeneous devices to reduce performance losses caused by accidental deletion of the file. Furthermore, storing a file on multiple devices allows the file to be read concurrently from the storage devices storing it, thereby increasing file read speed and reducing file read latency.
[0031] For example, a file is stored in a first storage device and a second storage device. When an electronic device needs to read the file, it can read the first part of the file in the first storage device and the second part of the file in the second storage device, thereby reading the entire file.
[0032] For example, a file is stored in a first storage device and a second storage device. The electronic device can read the complete file in both the first storage device and the second storage device. Thus, the electronic device can use the file that is read out faster, thereby improving the file processing speed.
[0033] For another example, the electronic device may select a relatively idle storage device to read a file based on the busyness of the storage device. For example, the first storage device is a relatively busy storage device, and correspondingly, the second storage device is a relatively idle storage device.
[0034] As another example, the storage device further includes a third storage device, and the electronic device determines that the third storage device is the most idle storage device among the storage devices, and then the electronic device reads the file from the third storage device.
[0035] Optionally, key performance files include but are not limited to system files, or other files that require multiple copies to be stored.
[0036] In one possible design, storing the file in a first storage device includes: storing part of the data in the file in the first storage device according to performance information of the first storage device;
[0037] Also includes:
[0038] The other portion of data in the file is stored in the second storage device.
[0039] For example, if the first condition is met and the file is a latency-sensitive file, the file is preferentially stored in a high-speed storage device. In this case, if the high-speed storage device is insufficient to store all the data of the file, the electronic device stores part of the file data in the high-speed storage device (an example of the first storage device) and stores the remaining part of the file data in another storage device (an example of the second storage device) in the heterogeneous storage device.
[0040] In one possible design, if the first condition is not met, the file is stored in a second storage device.
[0041] If the first condition isn't met, and the file isn't latency-sensitive or bandwidth-sensitive, the file can be stored on a lower-performance heterogeneous storage device, such as a slow-speed storage device. This reduces the space occupied by such files on high-performance storage devices, freeing them up for more demanding files, such as latency-sensitive files, and enabling them to better utilize their performance.
[0042] In one possible design, storing the file in a second storage device includes: storing part of the data in the file in the second storage device according to performance information of the second storage device;
[0043] Also includes:
[0044] Another portion of the data in the file is stored in the first storage device.
[0045] For example, if the first condition is not met, which means that the file is neither latency-sensitive nor bandwidth-sensitive, the file can be stored in a storage device with poorer performance in the heterogeneous storage device, such as a low-speed storage device. If the storage space of the low-speed storage device is insufficient to store all the data of the file, the remaining data of the file can be stored in another storage device (such as a high-speed storage device) in the heterogeneous storage device.
[0046] In one possible design, storing the file in a target storage device among the plurality of storage devices according to the information associated with the performance requirement of the file includes:
[0047] If the information associated with the performance requirement of the file satisfies a second condition, storing part of the data in the file in a first storage device, and storing another part of the data in the file in a second storage device;
[0048] The second condition includes at least one of the following conditions: the file usage frequency is greater than or equal to the second frequency, the file classification belongs to the second preset classification, the file usage time is greater than or equal to the second usage time, the scenario in which the file is used is the second preset scenario, the type of the process using the file is the second preset type, the IO type of the file is synchronous IO, the file has experienced freezes or frame drops when being read and written, the file IO type is file reading, and the time period in which the file is accessed belongs to the second preset time period.
[0049] In the embodiment of the present application, the file that meets the second condition may be a bandwidth-sensitive file.
[0050] For example, according to the second condition, if the file is bandwidth-sensitive, the file can be split into multiple parts and stored separately on multiple storage devices in heterogeneous storage devices, such as storing part of the data on UFS and part of the data on EMMC. In this way, the high bandwidth requirements of the file can be met.
[0051] In one possible design, the information about the process using the file includes: the type of the process using the file;
[0052] and / or, the first preset classification includes classification of the file as a library file;
[0053] And / or, the first preset scene includes one or more of the following scenes: a game scene, a photo-taking scene;
[0054] And / or, the first preset type of process includes at least one of the following processes: a process related to the user interface, and a process related to the response delay of the electronic device.
[0055] Optionally, the first preset scenario may be a scenario in which a file of the first preset classification is accessed. The process of the first preset type may be a process that accesses a file of the first preset classification. Alternatively, the first preset scenario is other scenarios that require high-performance reading or writing of files. For example, the first preset scenario is other scenarios that require low-latency reading or writing of files. The process of the first preset type is other processes that require high-performance reading or writing of files. The embodiments of the present application do not impose any restrictions on the first preset classification, the process of the first preset type, and the first preset scenario, as long as the classification, process, and scenario require high-performance reading or writing of files.
[0056] Exemplarily, the file is a so library file (an example of the first preset type). Considering that the application randomly accesses certain segments of the so library file, low reading latency is required. The electronic device can store the so library file in a high-speed storage device in a heterogeneous device to reduce the reading latency of the so library file.
[0057] In one possible design, the second preset classification includes classification of the file as a media file.
[0058] And / or, the second preset scene includes one or more of the following scenes: a video scene;
[0059] And / or, the second preset type of process includes at least one of the following processes: a process related to the user interface, and a process related to the response delay of the electronic device.
[0060] The second preset category can also include other files requiring high-bandwidth reading or writing. The second preset scenario can also include other scenarios requiring high-bandwidth file reading or writing. The second preset type of process can also include other processes requiring high-bandwidth file reading or writing. The present embodiment of the application does not restrict the second preset category, the second preset type of process, or the second preset scenario; any category, process, or scenario requiring high-performance file reading or writing is eligible.
[0061] In a possible design, the IO type includes: synchronous IO and asynchronous IO;
[0062] Alternatively, the IO type includes: reading a file and writing a file.
[0063] In one possible design, based on the performance information of the first storage device, part of the data in the file is stored in the first storage device, including: sending a first write request and / or a second write request to the first storage device, the first write request and / or the second write request carrying part of the data in the file; and storing another part of the data in the file in the second storage device, including: sending a third write request and / or a fourth write request to the second storage device, the third write request and / or the fourth write request carrying another part of the data in the file.
[0064] In one possible design, storing portion of the data in the file to the first storage device includes: sending a first write request to the first storage device, the first write request carrying portion of the data in the file; and storing another portion of the data in the file to the second storage device includes: sending a second write request to the second storage device, the second write request carrying the another portion of the data in the file. The electronic device can use the write request to transfer file data to the storage device.
[0065] In one possible design, the first write request and the second write request are obtained by splitting the third write request. For example, if the write request for a file is large, the write request can be split into multiple smaller write requests, so that the electronic device can send the multiple smaller write requests to different storage devices.
[0066] In one possible design, the performance requirements of the file include but are not limited to: delay requirements and / or bandwidth requirements.
[0067] In one possible design, the method also includes: reading the remaining capacity of the first storage device and the second storage device, and if the remaining capacity of the first storage device and / or the remaining capacity of the second storage device meets the first migration condition, migrating part of the files in the first storage device to the second storage device.
[0068] In one possible design, the method also includes: reading the remaining capacity of the first storage device and the second storage device, and if the remaining capacity of the first storage device and / or the remaining capacity of the second storage device meets the second migration condition, migrating part of the files in the second storage device to the first storage device.
[0069] In one possible design, the first migration condition includes one or more of the following: the remaining space of the first storage device is less than the preset migration space, the remaining life of the first storage device is less than the preset remaining life, and the processing delay of the first storage device is less than the processing delay of the second storage device.
[0070] In one possible design, the second migration condition includes one or more of the following: the remaining space of the second storage device is less than the preset migration space, the remaining life of the second storage device is less than the preset remaining life, and the processing delay of the second storage device is less than the processing delay of the first storage device.
[0071] In a second aspect, a file storage device is provided, which is applied to an electronic device or component (such as a chip system), and the method includes:
[0072] a processing module configured to obtain information associated with a performance requirement of a file, the information associated with the performance requirement of the file including one or more of the following information: a frequency of use of the file, a duration of use of the file, information about a process using the file, a scenario in which the file is used, a read / write I / O type of the file, a freeze or frame drop condition when the file is read or written, a classification of the file, and a time period during which the file is accessed;
[0073] The processing module is also used to store the file in a target storage device among multiple storage devices based on the information associated with the performance requirements of the file; the multiple storage devices include a first storage device and a second storage device, and the first storage device and the second storage device are heterogeneous storage devices.
[0074] In a possible design, the processing module is further configured to:
[0075] Acquire performance information of the first storage device and / or the second storage device;
[0076] storing the file in the target storage device according to the performance information of the first storage device and / or the second storage device and information associated with the performance requirement of the file;
[0077] The performance information of the first storage device includes one or more of the following: processing latency, bandwidth, total storage space, total lifespan, busyness, used storage space, remaining storage space, service life, and remaining lifespan of the first storage device;
[0078] The performance information of the second storage device includes one or more of the following: processing delay, bandwidth, total storage space, total lifespan, busyness, used storage space, remaining storage space, service life, and remaining lifespan of the second storage device.
[0079] In one possible design, storing the file in a target storage device among the plurality of storage devices according to the information associated with the performance requirement of the file includes:
[0080] If the information associated with the performance requirement of the file meets the first condition, storing the file in the first storage device;
[0081] The performance of the first storage device is better than the performance of the second type of storage device; the performance of the storage device is determined according to the latency and / or bandwidth of the storage device;
[0082] The first condition includes at least one of the following conditions: the file usage frequency is greater than or equal to the first frequency, the file classification belongs to the first preset classification, the file usage duration is greater than or equal to the first usage duration, the scenario in which the file is used is the first preset scenario, the type of the process using the file is the first preset type, the IO type of the file is synchronous IO, the file has experienced freezes or frame drops when being read and written, the file IO type is file reading, and the time period in which the file is accessed belongs to the first preset time period.
[0083] In one possible design, if the information associated with the performance requirement of the file meets the first condition, the method further includes:
[0084] The file is stored in the second storage device.
[0085] In one possible design, storing the file in a first storage device includes: storing part of the data in the file in the first storage device according to performance information of the first storage device;
[0086] The processing module is further configured to:
[0087] The other portion of data in the file is stored in the second storage device.
[0088] In one possible design, the processing module is further used to store the file in a second storage device if the first condition is not met.
[0089] In one possible design, storing the file in a second storage device includes: storing part of the data in the file in the second storage device according to performance information of the second storage device;
[0090] The processing module is further configured to:
[0091] Another portion of the data in the file is stored in the first storage device.
[0092] In one possible design, storing the file in a target storage device among the plurality of storage devices according to the information associated with the performance requirement of the file includes:
[0093] If the information associated with the performance requirement of the file satisfies a second condition, storing part of the data in the file in a first storage device, and storing another part of the data in the file in a second storage device;
[0094] The second condition includes at least one of the following conditions: the file usage frequency is greater than or equal to the second frequency, the file classification belongs to the second preset classification, the file usage time is greater than or equal to the second usage time, the scenario in which the file is used is the second preset scenario, the type of the process using the file is the second preset type, the IO type of the file is synchronous IO, the file has experienced freezes or frame drops when being read and written, the file IO type is file reading, and the time period in which the file is accessed belongs to the second preset time period.
[0095] In one possible design, the information about the process using the file includes: the type of the process using the file;
[0096] and / or, the first preset classification includes classification of the file as a library file;
[0097] And / or, the first preset scene includes one or more of the following scenes: a game scene, a photo-taking scene;
[0098] And / or, the first preset type of process includes at least one of the following processes: a process related to the user interface, and a process related to the response delay of the electronic device.
[0099] In a possible design, the IO type includes: synchronous IO and asynchronous IO;
[0100] Alternatively, the IO type includes: reading a file and writing a file.
[0101] In one possible design, the performance requirements of the file include but are not limited to: delay requirements and / or bandwidth requirements.
[0102] In a third aspect, an electronic device is provided, comprising a memory and a processor; the memory and the processing unit are coupled; the memory is used to store computer program code, and the computer program code comprises computer instructions, and when the processing unit executes the computer instructions, the electronic device executes the method as described in the first aspect and any one of its implementations.
[0103] In a fourth aspect, a chip system is provided, comprising: a processor and an interface circuit; the processor and the interface circuit are interconnected through a line; the interface circuit is used to read instructions stored in a memory, and when the instructions are executed by the processor, the chip system executes the method described in the first aspect and any one of its implementations.
[0104] In a fifth aspect, a chip system is provided, comprising a processor configured to support an electronic device in implementing the functions described in the first aspect. In one possible design, the chip system further comprises a memory configured to store program instructions and data necessary for the electronic device. The chip system may consist solely of a chip or may include a chip and other discrete components.
[0105] In a sixth aspect, an electronic device is provided, which has the function of implementing any of the methods described in the first aspect. The function can be implemented through hardware or through hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above functions.
[0106] In a seventh aspect, an electronic device is provided, comprising: a processor; the processor is configured to be coupled to a memory, and after reading instructions in the memory, execute any one of the methods in the first aspect described above according to the instructions.
[0107] In an eighth aspect, a computer-readable storage medium is provided, comprising computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes the method as described in the first aspect and any one of its implementations.
[0108] In a ninth aspect, a computer program product is provided. When the computer program product is run on a computer, the computer is caused to execute the method as described in the above aspects and any possible implementation thereof.
[0109] It can be understood that the beneficial effects that can be achieved by the methods, devices, computer-readable storage media, and computer program products provided in the second to ninth aspects above can be referred to the beneficial effects in the first aspect and any possible implementation method provided above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0110] Figure 1 is a software architecture diagram of a linearly mapped logical volume device connected to multiple storage devices;
[0111] FIG2 is a software architecture diagram of a stripe-mapped logical volume device connected to multiple storage devices;
[0112] FIG3 is an architectural diagram of a storage system;
[0113] FIG4 is a schematic diagram of the hardware structure of the electronic device 100;
[0114] FIG5 is a schematic diagram of the connection between the software architecture of the electronic device and the storage device;
[0115] FIG6 is a schematic diagram of a file storage method according to an embodiment of the present application;
[0116] FIG7 is another schematic diagram of the file storage method according to an embodiment of the present application;
[0117] FIG8 is a schematic diagram of a flow chart of a file storage method according to an embodiment of the present application;
[0118] FIG9 is a schematic diagram of obtaining information associated with file performance requirements and obtaining performance information of a storage device according to an embodiment of the present application;
[0119] FIG10 is a schematic diagram of obtaining information associated with file performance requirements according to an embodiment of the present application;
[0120] 11 is a schematic diagram of storing a file in a target storage device among multiple storage devices according to information associated with file performance requirements;
[0121] 12 is a schematic diagram of storing a file in a target storage device among multiple storage devices based on information associated with file performance requirements and performance information of the storage device;
[0122] FIG13 is another schematic flow chart of the file storage method according to an embodiment of the present application;
[0123] FIG14 is a schematic structural diagram of a device provided in an embodiment of the present application;
[0124] FIG15 is a schematic structural diagram of a chip system provided in an embodiment of the present application. DETAILED DESCRIPTION
[0125] The terms "first" and "second" in the specification and drawings of this application are used to distinguish objects or to distinguish the processing of the same object. Words such as "first" and "second" can distinguish identical or similar items with substantially the same functions and effects. For example, the first device and the second device are merely used to distinguish different devices and do not limit their order. Those skilled in the art will understand that words such as "first" and "second" do not limit the quantity or execution order, and words such as "first" and "second" do not necessarily mean different.
[0126] "At least one" means one or more, and "a plurality" means two or more.
[0127] "And / or" describes the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can mean: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or plural.
[0128] Furthermore, the terms "including," "having," and any variations thereof, as used in the description of this application are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or apparatus comprising a series of steps or units is not limited to the listed steps or units, but may optionally include other steps or units not listed, or may optionally include other steps or units inherent to the process, method, product, or apparatus.
[0129] It should be noted that in the embodiments of this application, words such as "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of this application should not be interpreted as being more preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner.
[0130] First, some of the terms and related technologies involved in the embodiments of this application are explained to facilitate understanding by those skilled in the art. First, the relevant technologies and technical terms involved in the embodiments of this application are introduced:
[0131] Heterogeneous storage devices: Electronic devices can store files in storage devices. Storing files can include the following two operations: writing files to a storage device and reading files from a storage device. For example, storage devices can include embedded multimedia cards (EMMC) and universal flash memory (UFS) devices. In the embodiments of the present application, storage devices can also be understood as storage devices.
[0132] In some embodiments, an electronic device may use multiple storage devices. If two of the multiple storage devices are different, the two storage devices are considered heterogeneous storage devices. The different storage devices may be different in performance, manufacturer, or driver. For example, UFS and EMMC are considered heterogeneous storage devices.
[0133] Application: Application software or system services can write data to or read data from storage devices at the file level to maintain program operation. Application software or system services can call different files when performing different operations. In the embodiments of the present application, application software or system services can be collectively referred to as applications. In the embodiments of the present application, application software or system services can also be referred to as businesses. Applications can call files through processes.
[0134] In the embodiments of the present application, calling a file, accessing a file, and using a file have the same meaning.
[0135] File performance requirements: Indicates the read and write performance that the application expects when reading files from a storage device or writing files to a storage device. Read and write performance includes but is not limited to the latency and bandwidth of the storage device reading and writing files. An application may have different performance requirements for different files. For example, depending on the performance requirements of different files, files may include bandwidth-sensitive files and latency-sensitive files. In an embodiment of the present application, reading and writing files may also be referred to as accessing files, and read and write performance may also be referred to as access performance.
[0136] Bandwidth-sensitive files: This indicates that when an application reads and writes files on a storage device, input and output (IO) bandwidth is the primary performance requirement.
[0137] Latency-sensitive files: This indicates that when an application accesses or stores files, I / O latency is the primary performance requirement.
[0138] Currently, related technologies include the following technologies for electronic devices to use multiple storage devices for storage:
[0139] Related technology 1: Using a linearly mapped logical volume device to control the storage of files in multiple storage devices.
[0140] Device Mapper linear device (DM-linear, also known as linear logical volume): A group of storage devices is abstracted into a logical volume manager (LVM) device based on a linear address space. The file system can access the storage devices in the group through the overall address space of the virtual volume device. Each storage device in the group has its own logical address space range.
[0141] Referring to Figure 1, Figure 1 is a software architecture diagram of a linearly mapped logical volume device connected to multiple storage devices. Exemplarily, the storage devices that provide storage space are heterogeneous storage devices UFS devices and EMMC devices. The software architecture of the electronic device includes a service (application, APP) layer, a file system (file system, FS) layer, a linear logical volume (DM-linear) layer, and a block layer (block devices). The block layer connects heterogeneous devices. Among them, the file system layer uses the logical volume device obtained by the linear mapping as an ordinary device and is unaware of the existence of multiple devices. The linear logical volume layer includes a linearly mapped logical volume device. The application of the APP layer reads and writes to multiple devices through the file system layer. The linear logical volume layer determines which specific storage device to operate on and feeds back the logical address corresponding to the storage device to the file system layer.
[0142] While this technology can uniformly utilize the space of multiple storage devices, because the linear logical volume layer separates the file system layer from the underlying storage devices, the file system layer is unaware of the existence of multiple devices. Therefore, when using the disk space of a storage device, it can only access it through a single channel, making it difficult to access the disk space of multiple devices. In other words, the file system can only operate on one device at a time and cannot operate on multiple devices concurrently. When the performance of the storage devices corresponding to the logical volume devices varies, the performance of the higher-performing device is limited, making it difficult to achieve optimal file access performance.
[0143] Related technology 2: Using stripe mapping logical volume device control files to be stored in multiple storage devices.
[0144] Device mapper strip device (DM-raid): Also known as a striped logical volume or striped logical volume, a striped logical volume maps a group of storage devices into one logical device and writes data evenly (stripping) across a group of storage devices. When data is written to a striped logical volume, the data is evenly distributed across all disks, thereby improving IO performance.
[0145] Refer to Figure 2, which is a software architecture diagram of a stripe-mapped logical volume device connecting multiple storage devices. Exemplarily, the storage devices that provide storage space are heterogeneous storage devices UFS devices and EMMC devices. The software architecture of the electronic device includes a service layer, a file system layer, a stripe logical volume layer, and a block layer in sequence. The block layer connects heterogeneous devices. Among them, the stripe logical volume layer includes a stripe-mapped logical volume, and the two devices form a new stripe-mapped virtual logical volume device in the stripe logical volume layer. The stripe logical volume layer creates a file system layer based on the stripe-mapped logical volume, and the file system layer uses the stripe-mapped logical volume as an ordinary device and is unaware of the existence of multiple devices. The application of the service layer reads and writes to multiple devices through the file system layer, and the stripe logical volume layer determines which device to operate on. The stripe logical volume layer can evenly distribute files to the two storage devices for storage. In other words, the files are distributed to the two storage devices in a 1:1 ratio for storage.
[0146] However, the uniform allocation method used by the striped logical volume layer has its drawbacks. Constrained by the I / O performance bottleneck of a single storage device, concurrent performance is limited to slower devices, and performance is only good on multiple devices with similar performance. For example, if the EMMC storage speed is slow, the speed of files stored on the EMMC will also be slow. Even after the UFS has stored a file, the EMMC has not yet finished processing the file, and the EMMC storage speed affects the storage speed of the entire storage device group.
[0147] Related technology three: Using a flash-friendly file system to control file storage in multiple storage devices.
[0148] Flash-friendly file system (F2FS): A flash-friendly file system supported by the Linux kernel that manages multiple devices as a single address space, with each device having its own logical address space range. F2FS is implemented in the file system layer. Compared to Related Art 1, Related Art 3 does not have a logical volume layer. However, some of the functions implemented in the logical volume layer can be implemented by F2FS in the file system layer.
[0149] Referring to Figure 3, Figure 3 is an architectural diagram of a storage system, which includes an electronic device and a storage device. Exemplarily, the devices providing disk space are heterogeneous devices UFS devices and EMMC devices, and the architecture includes a service layer, a file system layer, and a block layer in sequence. The block layer connects heterogeneous devices. Among them, the APP reads and writes the disk space of the storage device through the F2FS layer, and the F2FS layer decides which storage device that provides the disk space to operate on. The file system layer includes the F2FS system, which is created based on multiple (for example, two) devices. F2FS splices multiple devices into an overall address space management. The implementation method and function of the block layer can be found in other related technologies, such as the descriptions in Related Technologies 1 and 2. The storage device can be located in the electronic device, or the storage device can exist independently of the electronic device.
[0150] This storage method also targets only one storage device at a time; files are not stored on two storage devices concurrently. This only reflects the performance of one device. When the performance of the devices differs significantly, operations can vary significantly. For example, a UFS device has a storage speed of 500 Mbps, while an EMMC device has a storage speed of 10 Mbps. When a system uses a UPS to store files, the file storage speed is very fast, but when the system uses an EMMC device, the file storage speed is very slow. Users will directly feel the difference in storage speed, which affects their user experience.
[0151] While the three aforementioned technologies can expand the storage capacity of electronic devices to a certain extent, they fail to consider the performance differences between different storage devices and cannot fully utilize the performance of multiple storage devices. For example, in the presence of heterogeneous storage devices, the performance bottleneck of a single storage device is easily affected, resulting in slow file access speeds, lags, or frame drops.
[0152] An embodiment of the present application provides a file storage method, which is used by an operating system to store files in heterogeneous storage devices. The operating system can allocate files to storage devices for processing based on information associated with the performance requirements of the files, thereby reducing the impact of performance differences of heterogeneous storage devices on the processing speed of files.
[0153] The file storage method of the embodiment of the present application can be applied to electronic devices. For example, the electronic device can be a mobile phone, tablet computer, personal computer (PC), netbook, or other device that needs to access files. The specific form of the electronic device is not particularly limited in the present application.
[0154] Taking a mobile phone as an example, FIG4 shows a schematic diagram of the hardware structure of the electronic device 100. The structures of other electronic devices can refer to the structure of the electronic device 100.
[0155] The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0156] It should be understood that the structure illustrated in the embodiments of the present invention does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0157] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). The different processing units may be independent devices or integrated into one or more processors.
[0158] The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of instruction fetching and execution.
[0159] Processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in processor 110 is a cache memory. This memory can store instructions or data that have just been used or are being recycled by processor 110. If processor 110 needs to use the same instruction or data again, it can directly access the memory. This avoids duplicate accesses, reduces processor 110 latency, and thus improves system efficiency.
[0160] In some embodiments, the processor 110 may include one or more interfaces. The interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface.
[0161] The USB interface 130 is an interface that complies with USB standards and specifications, and may be a Mini USB interface, a Micro USB interface, a USB Type-C interface, or the like. The USB interface 130 can be used to connect a charger to charge the electronic device 100, or to transfer data between the electronic device 100 and peripheral devices. It can also be used to connect headphones to play audio. This interface can also be used to connect other electronic devices, such as augmented reality devices.
[0162] It is understood that the interface connection relationship between the modules illustrated in the embodiment of the present invention is merely an illustrative illustration and does not constitute a structural limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection methods from the above embodiments, or a combination of multiple interface connection methods.
[0163] The charging management module 140 is configured to receive charging input from a charger. The charger can be either a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 can receive charging input from the wired charger via the USB interface 130. In some wireless charging embodiments, the charging management module 140 can receive wireless charging input via the wireless charging coil of the electronic device 100. While charging the battery 142, the charging management module 140 can also provide power to the terminal via the power management module 141.
[0164] The power management module 141 is used to connect the battery 142, the charging management module 140, and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, and provides power to the processor 110, the internal memory 121, the display 194, the camera 193, and the wireless communication module 160. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle count, and battery health status (leakage, impedance). In some other embodiments, the power management module 141 can also be set in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 can also be set in the same device.
[0165] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.
[0166] Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In other embodiments, the antennas can be used in conjunction with a tuning switch.
[0167] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G applied to the electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.
[0168] The modem processor may include a modulator and a demodulator. The modulator is used to modulate the low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After being processed by the baseband processor, the low-frequency baseband signal is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to the speaker 170A, the receiver 170B, etc.) or displays an image or video through the display screen 194. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 110 and be set in the same device as the mobile communication module 150 or other functional modules.
[0169] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the electronic device 100. The wireless communication module 160 can be one or more devices that integrate at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, frequency modulate it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.
[0170] In some embodiments of the present application, the electronic device 100 can establish a wireless connection with other electronic devices through the wireless communication module 160 and the antenna 2 to achieve communication between the electronic device 100 and the other electronic devices.
[0171] In some embodiments, the antenna 1 of the electronic device 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the electronic device 100 can communicate with a network and other devices through wireless communication technologies. The wireless communication technologies may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology. The GNSS may include a global positioning system (GPS), a global navigation satellite system (GLONASS), a Beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS) and / or a satellite based augmentation system (SBAS).
[0172] Electronic device 100 implements display functionality through a GPU, display screen 194, and an application processor. A GPU is a microprocessor for image processing that connects display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or modify display information.
[0173] Display screen 194 is used to display images, videos, and the like. Display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a MiniLED, a MicrOLED, a Micro-OLED, or a quantum dot light-emitting diode (QLED). In some embodiments, electronic device 100 may include one or N display screens 194, where N is a positive integer greater than one.
[0174] The electronic device 100 can implement a shooting function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, and an application processor.
[0175] The ISP processes data fed back by camera 193. For example, when taking a photo, the shutter is opened, and light is transmitted through the lens to the camera's photosensitive element. The light signal is converted into an electrical signal, which is then passed to the ISP for processing and converted into a visible image. The ISP can also perform algorithmic optimization on image noise and brightness. It can also optimize parameters such as exposure and color temperature of the captured scene. In some embodiments, the ISP can be located within camera 193.
[0176] The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, and then passes the electrical signal to the ISP for conversion into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the electronic device 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.
[0177] The digital signal processor is used to process digital signals. In addition to processing digital image signals, it can also process other digital signals. For example, when the electronic device 100 selects a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.
[0178] Video codecs are used to compress or decompress digital video. Electronic device 100 may support one or more video codecs. This allows electronic device 100 to play or record videos in various encoding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, and MPEG4.
[0179] The NPU is a neural network (NN) computing processor. Drawing on the structure of biological neural networks, such as the transmission patterns between neurons in the human brain, it rapidly processes input information and can continuously self-learn. The NPU can enable intelligent cognitive applications in electronic device 100, such as image recognition, face recognition, speech recognition, and text comprehension.
[0180] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 via the external memory interface 120 to implement data storage functions. For example, files such as music and videos can be stored on the external memory card.
[0181] The internal memory 121 can be used to store computer executable program codes, which include instructions. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created during the use of the electronic device 100 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc. The processor 110 executes various functional applications and data processing of the electronic device 100 by running instructions stored in the internal memory 121 and / or instructions stored in a memory provided in the processor.
[0182] The electronic device 100 can implement audio functions such as music playback and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.
[0183] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be provided in the processor 110, or some functional modules of the audio module 170 can be provided in the processor 110.
[0184] The speaker 170A, also called a "speaker", is used to convert audio electrical signals into sound signals. The electronic device 100 can listen to music or listen to hands-free calls through the speaker 170A.
[0185] The receiver 170B, also called a "handset", is used to convert audio electrical signals into sound signals. When the electronic device 100 receives a call or a voice message, the user can place the receiver 170B close to the ear to hear the voice.
[0186] Microphone 170C, also known as "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or sending a voice message, the user can speak by putting their mouth close to the microphone 170C to input the sound signal into the microphone 170C. The electronic device 100 can be provided with at least one microphone 170C. In other embodiments, the electronic device 100 can be provided with two microphones 170C, which can not only collect sound signals but also realize noise reduction function. In other embodiments, the electronic device 100 can also be provided with three, four or more microphones 170C to collect sound signals, reduce noise, identify the source of sound, realize directional recording function, etc.
[0187] The headphone jack 170D is used to connect a wired headphone and can be the USB interface 130 or a 3.5mm open mobile terminal platform (OMTP) standard interface or a cellular telecommunications industry association of the USA (CTIA) standard interface.
[0188] The buttons 190 include a power button, a volume button, and the like. The buttons 190 may be mechanical buttons or touch buttons. The electronic device 100 may receive key inputs and generate key signal inputs related to user settings and function control of the electronic device 100.
[0189] Motor 191 can generate vibration prompts. Motor 191 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback. For example, touch operations acting on different applications (such as taking pictures, audio playback, etc.) can correspond to different vibration feedback effects. For touch operations acting on different areas of the display screen 194, motor 191 can also correspond to different vibration feedback effects. Different application scenarios (for example: time reminders, receiving messages, alarm clocks, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also support customization.
[0190] The indicator 192 may be an indicator light, which may be used to indicate the charging status, power level changes, messages, missed calls, notifications, etc.
[0191] The SIM card interface 195 is used to connect a SIM card. The SIM card can be connected to and separated from the electronic device 100 by inserting it into or removing it from the SIM card interface 195. The electronic device 100 can support 1 or N SIM card interfaces, where N is a positive integer greater than 1. The SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, etc. Multiple cards can be inserted into the same SIM card interface 195 at the same time. The types of the multiple cards can be the same or different. The SIM card interface 195 can also be compatible with different types of SIM cards. The SIM card interface 195 can also be compatible with external memory cards. The electronic device 100 interacts with the network through the SIM card to implement functions such as calls and data communications. In some embodiments, the electronic device 100 uses an eSIM. The eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100.
[0192] It should be noted that the electronic device may have more or fewer components than the structure shown in Figure 2, or some components may be combined or separated, or the components may be arranged differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0193] In some embodiments, the software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture. Taking the system as an example, the software structure of the electronic device 100 is exemplarily described.
[0194] For example, FIG5 is a software structure block diagram of the electronic device 100 according to an embodiment of the present invention.
[0195] A layered architecture divides software into several layers, each with distinct roles and responsibilities. Layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into two layers: the service layer and the kernel layer, from top to bottom. The service layer can also be called the application layer. In some examples, applications and services in the service layer run in user mode.
[0196] As shown in Figure 5, the service layer may include applications such as camera, gallery, and mobile manager.
[0197] In an embodiment of the present application, the service layer may also include services such as application behavior and scenario recognition services. Application behavior and scenario recognition services are used to obtain information associated with the performance requirements of files. The information associated with the performance requirements of files includes at least one of the following information: the frequency of file use (also referred to as the frequency of file access), the length of time the file is used (also referred to as the length of time the file is accessed), information about the process that uses the file (also referred to as information about the process / application that accesses the file), the scenario in which the file is used, the read and write IO type of the file, the freeze or frame loss when the file is read and written, the classification of the file, and the time period when the file is accessed.
[0198] The scenario in which the file is used can also be called the file usage scenario, which can be understood as the scenario corresponding to the electronic device when the file is accessed. For example, scenarios such as gaming and taking photos. It should be understood that different scenarios have different performance requirements for file access, and electronic devices can allocate storage space for files used in corresponding scenarios according to the scenarios. For example, for files used in high-performance demanding scenarios such as games, electronic devices store these files in high-speed storage devices. In this way, in the gaming scenario, the electronic device can quickly access files related to the gaming scenario from the high-speed storage device to support the gaming scenario and improve the operating performance of the electronic device in the gaming scenario.
[0199] As a possible implementation method, the electronic device can determine the frequency of file access by the application, the time period of file access by the application, information about the process / application accessing the file, and other information related to file access by the application by learning user behavior.
[0200] Optionally, scenarios of the electronic device when the file is accessed include but are not limited to gaming and photo-taking scenarios.
[0201] The kernel layer is the layer between hardware and software. In some examples, modules in the kernel layer run in kernel mode. The kernel layer includes the virtual file system (VFS) layer, the F2FS layer, and the block layer.
[0202] The kernel layer provides security management, memory management, process management, network protocol stack, and driver model management for Android's system servers. System service processes can call on kernel layer resources to provide various system services, such as AMS, PMS, WMS, etc.
[0203] In some embodiments, the VFS layer includes an input output control (IOCTL) interface for transmitting IOCTL instructions between the service layer and the file system layer.
[0204] Optionally, the VFS layer may further include a read and write (W / R) interface for transmitting read and write data between the service layer and the file system layer.
[0205] In some embodiments, the F2FS layer includes a file performance requirement identification module, a read / write module, a space allocation module, a multi-device management module, a file management module, and the like.
[0206] The file performance requirement identification module is used to determine information associated with the performance requirements of the file.
[0207] The file performance requirement identification module is further configured to determine the performance requirement of the file based on the at least one item of information related to the file performance.
[0208] For example, media files require high read consistency, occupy a large amount of space, and require greater bandwidth for storage. The file performance requirement identification module determines such files as bandwidth-sensitive files based on at least one of the aforementioned information related to file performance. Media files include but are not limited to audio-related files and video-related files (such as video streaming data).
[0209] The space allocation module is used to determine the storage device to which the file is to be allocated based on the performance requirements of the file. Exemplarily, the storage device includes eMMC), where UFS has faster read and write speeds than eMMC. When the file is latency-sensitive, the space allocation module allocates the file to UFS for processing. When the file does not have high latency requirements, the space allocation module can allocate the file to eMMC, thereby balancing the files processed by the two storage devices.
[0210] The space allocation module is further used to determine the storage device that meets the performance requirements of the file to be allocated based on the performance requirements of the file and the performance information of the storage device.
[0211] The read / write module is used to read files from or write files to the storage device.
[0212] The multi-device management module is used to obtain performance information of storage devices. The performance information of storage devices may include static information and / or dynamic information.
[0213] Optionally, the static information of the storage device includes at least one of the following information: processing latency of the storage device, bandwidth of the storage device, storage capacity, and total lifespan.
[0214] Optionally, the dynamic information of the storage device includes at least one of the following information: the busyness of the storage device, the remaining storage space of the storage device, the service life (or used service life) of the storage device, the remaining service life of the storage device, etc.
[0215] The remaining lifespan of a storage device is equal to the total lifespan minus the used lifespan.
[0216] Optionally, the busyness of a storage device can be determined based on one or more of the following metrics: number of inflight requests and I / O latency. The remaining storage space of a storage device can refer to the storage capacity (or total storage space) excluding the used storage space. Inflight requests can refer to files waiting to be processed, such as files waiting to be read or written.
[0217] The block layer interfaces with hardware storage devices.
[0218] In some embodiments, the block layer includes a multi-device scheduling module and a read / write status monitoring module.
[0219] The multi-device scheduling module is used to schedule multiple storage devices and cooperate with the read-write module to read and write files.
[0220] The IO status monitoring module is used to monitor the IO status of the storage device, such as monitoring the reading or writing of the storage device.
[0221] Optionally, the block layer is further configured to allocate the file to the storage device according to the storage device determined by the space allocation module.
[0222] The above is only an example of a possible software architecture of the electronic device. The software architecture of the electronic device can also be other architectures, which are not limited in the embodiments of this application. For example, the software architecture of the system is described above using the read / write module and the multi-device management module as an example, but in other embodiments, these modules can also be located in other layers. Alternatively, these modules can be located in different layers. Alternatively, some modules can be combined into one module or split into multiple functional modules, and different functional modules can be located in the same layer or different layers. For example, some modules located in the FS layer can also be located in other layers, which can be existing layers or newly added layers.
[0223] The file storage method provided in the embodiment of the present application can allocate files to target storage devices that meet the file performance requirements for processing based on the file performance requirements. The performance requirements of files can include: delay sensitivity and non-delay sensitivity. The performance requirements are determined based on at least one of the following information: the frequency of file use, the length of time the file is used, information about the process using the file, the scenario in which the file is used, the read and write IO type of the file, the freeze or frame loss when the file is read and written, the classification of the file, and the time period in which the file is accessed. In the embodiment of the present application, the storage device that processes the file can be referred to as the target storage device.
[0224] Optionally, the storage device includes but is not limited to: a high-speed storage device and a low-speed storage device.
[0225] In some embodiments, the storage device may be wired to the processor of the electronic device.
[0226] In other embodiments, the storage device may be a distributed storage device, and the distributed storage device may be connected to the processor of the electronic device via a wired connection or a wireless connection.
[0227] In an embodiment of the present application, a file can be allocated to a storage device that meets the performance requirements of the file based on the performance requirements of the file. For example, refer to Figure 6, which is a schematic diagram of the file storage method of an embodiment of the present application. If the frequency of a file being accessed by an application exceeds a preset threshold, it is determined that the file is a delay-sensitive file, and the electronic device can allocate the delay-sensitive file to a high-speed storage device for processing. In this way, the high-speed access characteristics of the high-speed storage device can be fully utilized, and delay-sensitive files can be read or written faster, thereby improving the efficiency of accessing delay-sensitive files.
[0228] For another example, if the file is not delay-sensitive, the electronic device may assign the file to a low-speed storage device for processing.
[0229] Exemplarily, delay-sensitive files may be important files.
[0230] For another example, as shown in Figure 7, which is another schematic diagram of the file storage method according to an embodiment of the present application, if a file is latency-sensitive but the high-speed storage device is out of space, the electronic device may allocate 25% of the data in the file to the high-speed storage device for processing and allocate 75% of the data in the file to the low-speed storage device for processing.
[0231] The file storage method of the embodiment of the present application can also be applied to devices such as servers that use the above-mentioned software system. The embodiment of the present application does not limit the hardware device that uses the software system. The following is a detailed description of the embodiment of the present application using the file storage method of the embodiment of the present application in a mobile phone.
[0232] As shown in FIG8 , FIG8 is a flowchart of a file storage method according to an embodiment of the present application. The file storage method according to an embodiment of the present application may include the following steps:
[0233] S101: A mobile phone determines at least one piece of information associated with a file performance requirement.
[0234] Optionally, file performance requirements include but are not limited to latency requirements and bandwidth requirements.
[0235] For example, referring to Figures 9 and 10, Figure 9 is a schematic diagram of obtaining information associated with file performance requirements and obtaining storage device performance information according to an embodiment of the present application, and Figure 10 is a schematic diagram of obtaining information associated with file performance requirements according to an embodiment of the present application. Depending on the performance requirements of a file, files may include at least one of the following categories: read-write sensitive files; read-insensitive and write-sensitive files; read-sensitive and write-insensitive files; and read-write insensitive files.
[0236] Optionally, read and write sensitivity can mean: sensitivity to both read and write latency, sensitivity to both read and write bandwidth, or sensitivity to both read and write bandwidth and read and write latency.
[0237] Optionally, read and write insensitivity can mean: insensitive to both read and write latency, insensitive to both read and write bandwidth, or insensitive to both read and write bandwidth and read and write latency.
[0238] As another example, the files may include at least one of the following categories: performance-critical files, files with high latency requirements, files with low latency requirements, files with high bandwidth requirements, and files with low bandwidth requirements.
[0239] Optionally, key performance files may refer to files with high latency and bandwidth requirements.
[0240] In another embodiment, the key performance file can be understood as a file that is frequently read by a high-priority application, and the key performance file is sensitive to read latency or read bandwidth.
[0241] Files with high latency or bandwidth requirements are considered latency-sensitive or high-performance files. Conversely, files with low latency or bandwidth requirements are considered latency-insensitive or low-performance files.
[0242] Optionally, the information associated with the file performance requirement includes at least one of the following: file access frequency, file access duration, file access time period, information about the process / application accessing the file, the electronic device scenario when the file is accessed, the file's function, the file's corresponding I / O type, and any lag or frame loss experienced by the electronic device when the file is accessed. In other words, at least one of the above information is related to the file's latency or bandwidth requirement.
[0243] For example, if a file is accessed frequently, then the file is a read-write sensitive file. For another example, a file that needs to be read and written by a foreground application is considered a read-write sensitive file. For another example, a file whose IO type frequently requires synchronous IO reading and writing is considered a read-write sensitive file. For another example, a file function is a system file, and the file system metadata (such as Superblock) and file metadata (such as inode) may have a large amount of random reading and writing, so the system file is considered a read-write sensitive file. Directory files are read-write sensitive files because they are frequently searched and written, and have a large amount of random IO.
[0244] Optionally, the information about the process / application accessing the file includes, but is not limited to, the status of the process / application accessing the file and the identifier of the process / application accessing the file. Optionally, the status of the process / application includes, but is not limited to, foreground and background status. In some examples, a file may be accessed by one application / process. Alternatively, a file may be accessed by multiple applications / processes. When a file is accessed by multiple applications / processes, it may also be referred to as being shared by multiple applications / processes. At least one application that shares a file may constitute an application group, and similarly, at least one process that shares a file may constitute a process group.
[0245] In the embodiment of the present application, VIP processes and VIP applications can be identified, and files accessed by VIP processes / VIP applications can be treated as important files. The important files can be delay-sensitive files or bandwidth-sensitive files, or the important files can be delay-sensitive and bandwidth-sensitive files.
[0246] Optionally, files may be classified according to their functions. For example, files may include at least one of the following: system files, directory files, media files, and other files. System files contain content related to system functions. Directory files contain content related to directories. Media files contain content related to media functions.
[0247] The classification of a file is a type of file attribute information. Optionally, in an embodiment of the present application, other attribute information of the file may also be obtained, and the performance requirements of the file may be determined based on the attribute information of the file (which may be combined with other information).
[0248] Optionally, the file being accessed may be implemented as: the file being accessed by an application / process. The application / process may be a system application / system process or other application / process.
[0249] In some embodiments, the access information of the application / process, such as the frequency of file access, the duration of file access, the time period of file access, and information of the process / application accessing the file, can be obtained by statistics and analysis of the behavior of the application / process by the mobile phone.
[0250] As a possible implementation, the mobile phone may record the frequency with which the file is accessed over at least a period of time.
[0251] The mobile phone can also record the total duration of file access within the corresponding time period or the average duration of each file access. The mobile phone can also record the time period when the file is accessed.
[0252] For example, the mobile phone reads the historical records for the 72 hours preceding the current time and determines that file A has been accessed 20 times for a total of 5 hours, between 5:00 PM and 7:00 PM daily. File B has been accessed 4 times for a total of 10 minutes, between 5:00 AM and 5:30 AM on one particular day.
[0253] The status of the process / application accessing the file may be that the process belongs to a foreground application and the application is a foreground application, or that the process belongs to a background application and the application is a background application.
[0254] In some embodiments, the mobile phone can identify the IO type of the file based on the file's suffix and attributes, synchronization, asynchrony and other information.
[0255] In some embodiments, the mobile phone can record any freezes or frame drops that occur during file access. The freezes or frame drops include one or more of the following: freezes during file access, frame drops during file access, freezes during file access, and frame drops during file access.
[0256] S102: The mobile phone stores the file in a target storage device in the heterogeneous storage device according to information associated with the file performance requirement.
[0257] The mobile phone may record at least one piece of information related to file performance in the aforementioned manner or other feasible manner. When a storage device needs to be allocated for a file, the mobile phone may determine the performance requirements of the file based on the at least one piece of information related to file performance, and store the file in the corresponding storage device based on the performance requirements.
[0258] In some embodiments, the more frequently an application / process accesses a file, the more likely the mobile phone is to classify the file as a latency-sensitive file. Conversely, the mobile phone classifies a file with a low access frequency as a non-latency-sensitive file.
[0259] The frequency of file access by an application / process may refer to the frequency of file access by a certain type of application / process, or may refer to the frequency of file access by all applications / processes.
[0260] Similarly, the longer an application / process accesses a file, the more important the file is, and the phone can classify it as latency-sensitive. Conversely, the shorter an application / process accesses a file, the less important the file is, and the phone can classify it as non-latency-sensitive.
[0261] Similarly, most processes accessing files are foreground processes. Considering that foreground processes have a greater impact on the smoothness of the mobile phone, the mobile phone can treat the file as a delay-sensitive file.
[0262] Similarly, considering that users have high requirements for performance in scenarios such as games, when at least one file is accessed in a game scenario, the mobile phone can treat the at least one file as a delay-sensitive file.
[0263] Similarly, considering that the function of a file is a system file, the file has a significant impact on maintaining the normal operation of the system, and the mobile phone may treat the file as a delay-sensitive file.
[0264] Similarly, when the IO type corresponding to a file is synchronous IO, the file needs to obtain feedback results before proceeding to the next step. The file is greatly affected by latency, and the mobile phone may treat the file as a latency-sensitive file.
[0265] Similarly, electronic devices may experience lag or frame drops when accessing files. These files are often accessed by foreground applications, and the speed at which they are read significantly impacts the user experience. When lag or frame drops occur, the phone's processing of the file may not meet the file's requirements. In this case, the processing speed needs to be increased, and the phone may consider the file to be latency-sensitive.
[0266] In some embodiments, the mobile phone can combine multiple pieces of information related to file performance to determine the file type. For example, if a file is accessed more frequently, each access takes longer, and most processes accessing the file are foreground processes, then the file is considered latency-sensitive.
[0267] The phone determines the performance requirements of the file and assigns it to a storage device that meets these requirements. As a possible implementation, if a file has high performance requirements, it is considered a high-performance file (or latency-sensitive file), and the phone can assign this latency-sensitive file to a high-speed storage device for processing. If a file has low performance requirements, it is considered a low-performance file (or non-latency-sensitive file), and the phone can assign this non-latency-sensitive file to a low-speed storage device for processing.
[0268] In some embodiments, if the file is a latency-sensitive file, a storage device may be allocated to the file according to at least one of the following policies:
[0269] If the phone determines a file is critical based on performance information, it can allocate space for multiple copies. This ensures file stability and prevents performance loss caused by the loss of critical files. Furthermore, storing a file on multiple devices allows it to be read concurrently from all storage devices, improving file read speed and reducing latency.
[0270] For example, a file is stored in a first storage device and a second storage device. When an electronic device needs to read the file, it can read the first part of the file in the first storage device and the second part of the file in the second storage device, thereby reading the entire file.
[0271] For example, a file is stored in a first storage device and a second storage device. The electronic device can read the complete file in both the first storage device and the second storage device. Thus, the electronic device can use the file that is read out faster, thereby improving the file processing speed.
[0272] Multiple copies store the same file on multiple storage devices. Figure 11 shows how files are stored on target storage devices among multiple storage devices based on information related to file performance requirements. The phone creates copies of the file, storing it on both a high-speed and a low-speed storage device.
[0273] 2. If the mobile phone determines that a file has high latency requirements based on at least one piece of information related to file performance, it can allocate the file to a high-speed storage device. This improves file access efficiency. As shown in Figure 11, the mobile phone allocates the file to a high-speed storage device.
[0274] 3. If the file is delay-insensitive (non-delay-sensitive), it can be allocated to the low-speed storage device first, so as to ensure the normal processing of the file by the mobile phone. In addition, it can also save the storage space of the high-speed storage device, so that the mobile phone can use the high-speed storage device when processing delay-sensitive files, thereby having a faster processing speed.
[0275] 4. If a file requires high bandwidth, it can be split and distributed across multiple devices in a certain ratio. For example, a high-speed storage device can store data three times faster than a low-speed device. For example, if a mobile phone needs to store a large video file, and it takes two minutes to store the video file using only the high-speed device, 25% of the video file data can be allocated to the low-speed device. This means the high-speed device can store the video file in one minute and 30 seconds, while the low-speed device can also store the video file in one minute and 30 seconds. Because the low-speed and high-speed devices are working in parallel, the mobile phone saves 30 seconds of total storage time for the video file.
[0276] As another example, when a file requests to read data, a lower latency is required (for example, a library file). The file that needs to read data is set as a latency-sensitive file and is assigned to a high-speed storage device for processing.
[0277] As another example, when a file requests to write data, a larger bandwidth is required, and the file is set as a bandwidth-sensitive file. Part of the file is allocated to a high-speed storage device for processing, and the other part is allocated to a low-speed storage device for processing.
[0278] The embodiment of the present application also provides a file storage method, whereby a mobile phone can obtain performance information of a storage device, and store the file in a storage device that meets the file performance requirements in combination with the performance information of the storage device and the performance requirements of the file.
[0279] Taking the example of a storage device whose performance information includes the remaining space of the storage device, refer to Figure 12, which is a schematic diagram of storing files in a target storage device among multiple storage devices based on information associated with file performance requirements and the performance information of the storage device. The file system layer in the mobile phone allocates the file to the high-speed storage device for processing based on the performance requirements of the file, and the block layer allocates all the data of the file to the high-speed storage device for processing. Subsequently, when the file system layer in the mobile phone obtains that the space on the high-speed storage device is insufficient, half of the file data is adjusted to the low-speed storage device for processing, that is, the block layer is re-controlled to adjust half of the file data to the low-speed storage device for processing. In this example, the amount of file data processed by the high-speed storage device: the amount of file data processed by the low-speed storage device = 1:1.
[0280] Taking the example of a storage device whose performance information includes the remaining space on the storage device, as shown in Figure 12, the file system layer in the mobile phone preliminarily determines to allocate the file to a high-speed storage device based on the file's performance requirements. However, since the high-speed storage device, as transmitted by the block layer, has insufficient space, the file system layer in the mobile phone determines to allocate half of the file's data to a low-speed storage device for storage. In this example, the block layer allocates the file data to the high-speed storage device in a 1:1 ratio, with the amount of file data stored on the low-speed storage device equal to the amount of file data stored on the high-speed storage device.
[0281] Taking the performance information of storage devices, including their busyness, as an example, referring to Figure 12, the file system layer in the mobile phone allocates 75% of the file's data to the high-speed storage device for processing and 25% of the file's data to the low-speed storage device based on the file's performance requirements. The block layer then allocates the file to high-speed and low-speed storage devices for processing, following the instructions of the file system layer. Subsequently, the file system layer in the mobile phone detects that the high-speed storage device is busy, indicating that the high-speed storage device is taking a long time to process the file. The file system layer then adjusts the ratio of heterogeneous storage devices processing the file and reallocates the ratio of heterogeneous storage devices storing the file to the block layer. Following the instructions of the file system layer, the block layer adjusts 25% of the file's data to the low-speed storage device for processing. At this point, the amount of file data processed by the high-speed storage device: the amount of file data processed by the low-speed storage device = 1:1.
[0282] Taking storage device performance information, including the level of busyness, as an example, as shown in Figure 12, the file system layer in the mobile phone preliminarily determines, based on the file's performance requirements, to allocate 75% of the file's data to the high-speed storage device for processing and 25% of the file's data to the low-speed storage device for processing. However, the file system layer, by reading data from the block layer, determines that the high-speed storage device is busy, indicating that the high-speed storage device is taking a long time to process the file. Therefore, the 25% of the file's data is adjusted to the low-speed storage device for processing. The block layer controls the allocation of file data to heterogeneous storage devices in a ratio of 1:1, with the amount of file data processed by the high-speed storage device equal to the amount of file data processed by the low-speed storage device.
[0283] Taking the performance information of storage devices, including their busyness, as an example, as shown in Figure 12, the file system layer in the mobile phone allocates 75% of the file's data to the low-speed storage device and 25% to the high-speed storage device based on the file's performance requirements. If the mobile phone detects that the low-speed storage device is busy, indicating that it is taking a long time to process the file, it will then reassign 25% of the file's data to the high-speed storage device. At this point, the ratio of the file's data volume processed by the high-speed storage device to the file's data volume processed by the low-speed storage device is 1:1.
[0284] Taking the performance information of a storage device, including its busyness, as an example, as shown in Figure 12, the mobile phone allocates 75% of the file's data to the low-speed storage device and 25% to the high-speed storage device based on the file's performance requirements. If the mobile phone detects that the low-speed storage device is busy, indicating that it will take a long time to process the file, it will then adjust the 25% of the file's data to the high-speed storage device. At this point, the ratio of the file's data volume processed by the high-speed storage device to the file's data volume processed by the low-speed storage device is 1:1.
[0285] Taking the storage device performance information, including the remaining lifespan, as an example, as shown in Figure 12, the mobile phone allocates the file to the low-speed storage device based on the file's performance requirements. If the mobile phone detects that the low-speed storage device's lifespan is insufficient, allocations should be minimized to prevent the device from reaching the end of its storage capacity. The mobile phone then reassigns 75% of the file's data to the high-speed storage device. At this point, the ratio of the file's data volume processed by the high-speed storage device to the file's data volume processed by the low-speed storage device is 3:1.
[0286] Taking the storage device performance information, including the remaining lifespan, as an example, as shown in Figure 12, the mobile phone allocates the file to the low-speed storage device based on the file's performance requirements. If the mobile phone detects that the low-speed storage device's lifespan is insufficient, allocations should be minimized to prevent the device from reaching the end of its storage capacity. The mobile phone then reassigns 75% of the file's data to the high-speed storage device. At this point, the ratio of the file's data volume processed by the high-speed storage device to the file's data volume processed by the low-speed storage device is 3:1.
[0287] As another example, the performance information of the storage device includes the remaining space of the storage device. When the remaining space of the storage device is insufficient, allocation should be reduced as much as possible to prevent the device from reaching the end of its life.
[0288] It can be understood that, referring to Figures 7, 11, and 12, the above-mentioned file space allocation ratio can be achieved by splitting a large IO into small IOs. For example, if the size of an IO is greater than a preset IO threshold, the IO can be split into multiple small IOs, which are used to carry the file data and are allocated to different storage devices.
[0289] The space allocation ratio of the above files can also be directly allocated to different devices according to the IO ratio without splitting the IO.
[0290] The above example uses heterogeneous devices as storage device 1 and storage device 2. In other embodiments, the mobile phone may further include more storage devices, such as storage device 3 and storage device 4.
[0291] 9 , in an embodiment of the present application, the file system layer can also read the capacity of the storage device and control the block layer to migrate files stored in the storage device across storage devices.
[0292] For example, the block layer can migrate files from a storage device with less remaining storage capacity to a storage device with more remaining storage capacity. This allows data to be stored simultaneously on multiple storage devices when storing bandwidth-sensitive files, reducing the time required to store files.
[0293] As another example, the block layer may migrate files stored in a high-speed storage device to a low-speed storage device, thereby providing the storage device with more storage space for storing latency-sensitive files and enabling faster storage of latency-sensitive files.
[0294] Referring to Figure 13, Figure 13 is another schematic flow chart of the file storage method according to an embodiment of the present application. In conjunction with Figures 5 and 9, when a user uses an application, the application needs to access a file. The service layer sends a message to the file system layer requesting access to the file. The file system layer then allocates a storage device for the file or reads the file from the storage device.
[0295] Among them, the service layer can obtain user behavior (such as user operation behavior on the application) and obtain information about the frequency of file calls, the length of time the file is used, whether the file is called by the foreground application or the background application, etc. based on the user behavior. The file system layer obtains whether the IO type of the file is synchronous IO or asynchronous IO. The file system layer or the service layer records the historical information of the file, that is, whether the file has experienced lag, frame loss, etc. The file system layer allocates the performance requirements of the file to the file based on the above information related to the file performance requirements. For example, the file is a bandwidth-sensitive file. The file system layer allocates storage devices to the file based on the performance requirements of the file. For example, 80% of the file's data is stored in a high-speed storage device, and 20% of the file's data is stored in a low-speed storage device.
[0296] The file system layer then retrieves the storage device status and determines whether the file is suitable for storage on the assigned storage device. For example, if dynamic information about high-speed storage devices indicates longer latency, the file system layer adjusts the storage device assigned to the file, storing 60% of the file's data on the high-speed device and 40% on the low-speed device. Based on the storage space allocation rules for files derived from statistical analysis of user behavior and storage device status, the file system layer instructs the block layer to allocate the file's data to storage devices according to these rules.
[0297] It should be noted that the above-mentioned multiple embodiments can be combined and the combined scheme can be implemented. Optionally, some operations in the process of each method embodiment are optionally combined, and / or the order of some operations is optionally changed. In addition, the execution order between the steps of each process is only exemplary and does not constitute a limitation on the execution order between the steps. There can also be other execution orders between the steps. It is not intended to indicate that the execution order is the only order in which these operations can be performed. Ordinary technicians in this field will think of many ways to reorder the operations described herein. In addition, it should be pointed out that the process details involved in a certain embodiment of this article are also applicable to other embodiments in a similar manner, or different embodiments can be used in combination.
[0298] In addition, some steps in the method embodiment may be equivalently replaced with other possible steps. Alternatively, some steps in the method embodiment may be optional and may be deleted in certain usage scenarios. Alternatively, other possible steps may be added to the method embodiment. Alternatively, the execution entities (such as functional modules) of some steps in the method embodiment may be replaced with other execution entities.
[0299] Furthermore, the above method embodiments may be implemented separately or in combination.
[0300] Other embodiments of the present application provide a device, which may be the above-mentioned electronic device, etc. The device may include: a memory and one or more processors. Optionally, the device may also include a display screen. The display screen, memory, and processor are coupled. The memory is used to store computer program code, which includes computer instructions. When the processor executes the computer instructions, the device may perform the various functions or steps performed by the corresponding device in the above-mentioned method embodiment. The structure of the device can refer to the electronic device (device) shown in Figure 14.
[0301] The core structure of the device can be represented as the structure shown in FIG. 14 , and the device includes: a processing module 1301 , an input module 1302 , a storage module 1303 and a display module 1304 .
[0302] The processing module 1301 may include at least one of a central processing unit (CPU), an application processor (AP), or a communication processor (CP). The processing module 1301 may perform operations or data processing related to the control and / or communication of at least one of the other components of the user electronic device. Specifically, the processing module 1301 may be used to control the content displayed on the main screen based on certain trigger conditions. The processing module 1301 is also used to process input instructions or data and determine a display style based on the processed data.
[0303] The input module 1302 is used to obtain user input instructions or data and transmit the obtained instructions or data to other modules of the electronic device. Specifically, the input method of the input module 1302 may include touch, gestures, proximity to the screen, etc., or voice input. For example, the input module can be the screen of the electronic device, obtain the user's input operation and generate an input signal based on the obtained input operation, and transmit the input signal to the processing module 1301.
[0304] Storage module 1303 may include volatile memory and / or non-volatile memory. The storage module is used to store instructions or data related to at least one of the other modules of the user equipment. Specifically, the storage module may record information related to processes, services, transactions, and sub-modules.
[0305] The display module 1304 may include, for example, a liquid crystal display (LCD), a light emitting diode (LED) display, an organic light emitting diode (OLED) display, a microelectromechanical system (MEMS) display, or an electronic paper display, and is used to display user-viewable content (e.g., text, images, videos, icons, symbols, etc.).
[0306] Optionally, a communication module 1305 is also included to support the device to communicate with other devices (via a communication network). For example, the communication module can be connected to a network via wireless communication or wired communication to communicate with other devices or a network server. Wireless communication can adopt at least one of cellular communication protocols, such as Long Term Evolution (LTE), Advanced Long Term Evolution (LTE-A), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Universal Mobile Telecommunications System (UMTS), Wireless Broadband (WiBro) or Global System for Mobile Communications (GSM). Wireless communication may include, for example, short-range communication. Short-range communication may include at least one of Wireless Fidelity (Wi-Fi), Bluetooth, Near Field Communication (NFC), Magnetic Stripe Transmission (MST) or GNSS.
[0307] It should be noted that each functional module of the device can execute one or more steps in the above method embodiment.
[0308] An embodiment of the present application also provides a chip system, as shown in Figure 15, which includes at least one processor 1401 and at least one interface circuit 1402. The processor 1401 and the interface circuit 1402 can be interconnected via lines. For example, the interface circuit 1402 can be used to receive signals from other devices (such as the memory of an electronic device). For another example, the interface circuit 1402 can be used to send signals to other devices (such as the processor 1401). Exemplarily, the interface circuit 1402 can read instructions stored in the memory and send the instructions to the processor 1401. When the instructions are executed by the processor 1401, the electronic device can perform the various steps in the above embodiments. Of course, the chip system can also include other discrete devices, which is not specifically limited in the embodiment of the present application.
[0309] An embodiment of the present application further provides a computer storage medium, which includes computer instructions. When the computer instructions are executed on the above-mentioned electronic device, the electronic device executes the various functions or steps executed by the mobile phone in the above-mentioned method embodiment.
[0310] The embodiment of the present application further provides a computer program product, which, when executed on a computer, enables the computer to execute the functions or steps executed by the mobile phone in the above method embodiment.
[0311] Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0312] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0313] The units described as separate components may or may not be physically separate, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple places. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0314] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0315] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0316] The above content is only a specific embodiment of this application, but the scope of protection of this application is not limited to this. Any changes or replacements within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.
Claims
1. A file storage method, characterized in that: Applied to electronic equipment, the method comprises: Acquire information associated with the performance requirement of the file, wherein the information associated with the performance requirement of the file includes one or more of the following information: the frequency of use of the file, the duration of use of the file, information of the process using the file, the scenario in which the file is used, the read and write IO type of the file, the jamming or frame loss when the file is read and written, the classification of the file, and the time period in which the file is accessed; According to the information associated with the performance requirement of the file, the file is stored in a target storage device among multiple storage devices; the multiple storage devices include a first storage device and a second storage device, and the first storage device and the second storage device are heterogeneous storage devices.
2. The file storage method according to claim 1, characterized in that: Also includes: Acquire performance information of the first storage device and / or the second storage device; storing the file in the target storage device according to the performance information of the first storage device and / or the second storage device and the information associated with the performance requirement of the file; The performance information of the first storage device includes one or more of the following: processing latency, bandwidth, total storage space, total life, busyness, used storage space, remaining storage space, service life, and remaining life of the first storage device; The performance information of the second storage device includes one or more of the following: processing delay, bandwidth, total storage space, total life, busyness, used storage space, remaining storage space, service life, and remaining life of the second storage device.
3. The file storage method according to claim 1 or 2, characterized in that: According to the information associated with the performance requirement of the file, storing the file in a target storage device among the plurality of storage devices comprises: If the information associated with the performance requirement of the file meets the first condition, storing the file in the first storage device; The performance of the first storage device is better than the performance of the second storage device; the performance of the storage device is determined according to the latency and / or bandwidth of the storage device; The first condition includes at least one of the following conditions: the usage frequency of the file is greater than or equal to the first frequency, the classification of the file belongs to the first preset classification, the usage time of the file is greater than or equal to the first usage time, the scenario in which the file is used is the first preset scenario, the type of the process using the file is the first preset type, the IO type of the file is synchronous IO, the file has experienced freezes or frame drops when being read and written, the IO type of the file is file reading, and the time period in which the file is accessed belongs to the first preset time period.
4. The file storage method according to claim 3, characterized in that: If the information associated with the performance requirement of the file meets the first condition, the method further includes: The file is stored in the second storage device.
5. The file storage method according to claim 3, characterized in that: Storing the file in a first storage device includes: storing part of the data in the file in the first storage device according to the performance information of the first storage device; Also includes: Another portion of the data in the file is stored in the second storage device.
6. The file storage method according to claim 3, characterized in that: If the first condition is not met, the file is stored in a second storage device.
7. The file storage method according to claim 6, characterized in that: Storing the file in a second storage device includes: storing part of the data in the file in the second storage device according to the performance information of the second storage device; Also includes: Another portion of the data in the file is stored in the first storage device.
8. The file storage method according to claim 1 or 2, characterized in that: According to the information associated with the performance requirement of the file, storing the file in a target storage device among the plurality of storage devices comprises: If the information associated with the performance requirement of the file satisfies a second condition, storing part of the data in the file in a first storage device, and storing another part of the data in the file in a second storage device; The second condition includes at least one of the following conditions: the file usage frequency is greater than or equal to the second frequency, the file classification belongs to the second preset classification, the file usage time is greater than or equal to the second usage time, the file usage scenario is the second preset scenario, the type of the process using the file is the second preset type, and the IO type of the file It is synchronous IO, freeze or frame loss occurred when the file was read and written, the IO type of the file is reading the file, and the time period when the file was accessed belongs to the second preset time period.
9. The file storage method according to claim 3 or 8, characterized in that: The information about the process using the file includes: the type of the process using the file; and / or, the first preset classification includes classification of the file as a system file; And / or, the first preset scene includes one or more of the following scenes: a game scene, a photo-taking scene; And / or, the first preset type of process includes at least one of the following processes: a process related to the user interface, and a process related to the response delay of the electronic device.
10. The file storage method according to claim 3, characterized in that: The IO types include: synchronous IO and asynchronous IO; Alternatively, the IO type includes: reading a file and writing a file.
11. The file storage method according to claim 5, characterized in that: Storing part of the data in the file to the first storage device according to the performance information of the first storage device includes: Sending a first write request and / or a second write request to the first storage device, wherein the first write request and / or the second write request carries part of the data in the file; Storing another portion of the data in the file to the second storage device includes: sending a third write request and / or a fourth write request to the second storage device, wherein the third write request and / or the fourth write request carries the other portion of the data in the file.
12. The file storage method according to claim 5, characterized in that: Storing part of the data in the file to the first storage device according to the performance information of the first storage device includes: Sending a first write request to the first storage device, where the first write request carries part of the data in the file; Storing another portion of the data in the file to the second storage device comprises: sending a second write request to the second storage device, wherein the second write request carries the other portion of the data in the file.
13. The file storage method according to claim 12, characterized in that: The first write request and the second write request are obtained by splitting the fifth write request.
14. The file storage method according to any one of claims 1 to 13, characterized in that: The performance requirements of the file include, but are not limited to: latency requirements and / or bandwidth requirements.
15. An electronic device, characterized in that: The electronic device includes a memory and a processor; the memory and the processor are coupled; the memory is used to store computer program code, and the computer program code includes computer instructions. When the processing unit executes the computer instructions, the electronic device executes the method described in any one of claims 1-14.
16. A chip system, characterized in that: include: processor and interface circuits; The processor and the interface circuit are interconnected via a line; The interface circuit is used to read instructions stored in the memory, and when the instructions are executed by the processor, the chip system implements the method according to any one of claims 1 to 14.
17. A computer-readable storage medium, characterized in that: The method comprises computer instructions, which, when executed on an electronic device, cause the electronic device to execute the method as claimed in any one of claims 1 to 14.
18. A computer program product, characterized in that When the computer program product runs on an electronic device, the electronic device is enabled to execute the method according to any one of claims 1 to 14.
Citation Information
Patent Citations
Method and device for storing file
CN101281542A
Transparent hybrid data storage
CN107750355A
A data distribution method under a heterogeneous HDFS cluster
CN109033298A
Data classified storage method based on hybrid storage system
CN110362277A
Distributed storage system and data storage method thereof
CN114489475A
Cited By
Storage resource allocation method and apparatus, and device
WO2026157829A1
