Data storage method and device, electronic equipment and computer readable storage medium

By identifying acceleration indications in the memory device and generating target data migration requests, using acceleration tags to map to the fast-accessed data stream channel and storage space, the application operation lag caused by insufficient I/O performance of the memory device is solved, and efficient storage and access of application data is achieved.

CN120010743APending Publication Date: 2025-05-16GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311514568.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-11-14
Publication Date
2025-05-16

AI Technical Summary

Technical Problem

The input/output performance of existing memory devices is difficult to meet the needs of application operation, resulting in application operation lag and reducing application operation speed and performance.

Method used

Receive system calls initiated by the application layer through the file system of the electronic device, identify acceleration indications and generate target data migration requests, and map data to faster access data stream channels and storage spaces using acceleration tags.

Benefits of technology

It achieves acceleration of access to application data, improves application running speed and performance, and reduces application loading or lag time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120010743A_ABST
    Figure CN120010743A_ABST
Patent Text Reader

Abstract

The invention discloses a data storage method and device, electronic equipment and a computer readable storage medium. The application running speed and performance can be improved. The method comprises the following steps: receiving a system call initiated by an application layer and used for storing first application data through a file system of the electronic equipment; determining target to-be-accelerated data based on the first application data under the condition that the system call contains an acceleration instruction, and generating a target data shift-in request corresponding to the target to-be-accelerated data; the target data shift-in request comprises an acceleration mark; sending the target data shift-in request to a storage device of the electronic equipment through a first data flow channel corresponding to the acceleration mark; determining a first storage space corresponding to the target data shift-in request according to the first data flow channel through the storage device, and storing the target to-be-accelerated data into the first storage space according to the target data shift-in request; the access speed of the first storage space is greater than that of a second storage space in the storage device.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of storage technology, and in particular to a data storage method, device, electronic device and computer-readable storage medium. Background Art

[0002] At present, applications need to interact with storage devices during operation and obtain various data required for operation from storage devices. Therefore, the running speed and performance of applications are restricted by the input / output (I / O) performance of storage devices. When the I / O performance of storage devices cannot meet the running needs of applications, it may cause the running of applications to be stuck, thereby reducing the running speed and performance of applications. Summary of the invention

[0003] The present application hopes to provide a data storage method, device, electronic device and computer-readable storage medium, which can improve the application running speed and performance.

[0004] The technical solution of this application is implemented as follows:

[0005] In a first aspect, the present application provides a data storage method, applied to an electronic device, the method comprising:

[0006] Receiving, through the file system of the electronic device, a system call initiated by the application layer for storing the first application data;

[0007] In the case where the system call includes an acceleration indication, determining target data to be accelerated based on the first application data, and generating a target data move-in request corresponding to the target data to be accelerated; the target data move-in request includes an acceleration mark;

[0008] Sending the target data move-in request to the storage device of the electronic device through a first data flow channel; the first data flow channel is a data flow channel corresponding to the acceleration mark among at least two data flow channels;

[0009] Through the storage device, according to the first data flow channel, the first storage space corresponding to the target data move-in request is determined, and according to the target data move-in request, the target data to be accelerated is stored in the first storage space; the access speed of the first storage space is greater than the access speed of the second storage space in the storage device.

[0010] In a second aspect, the present application provides a data storage device, applied to an electronic device, the device comprising:

[0011] A receiving module, configured to receive, through a file system of the electronic device, a system call initiated by the application layer for storing the first application data;

[0012] a generating module, configured to determine target data to be accelerated based on the first application data, and generate a target data move-in request corresponding to the target data to be accelerated, when the system call includes an acceleration indication; the target data move-in request includes an acceleration mark;

[0013] A sending module, configured to send the target data move-in request to a storage device of the electronic device through a first data flow channel; the first data flow channel is a data flow channel corresponding to the acceleration mark among at least two data flow channels;

[0014] A storage module is used to determine, through the storage device and according to the first data flow channel, a first storage space corresponding to the target data move-in request, and store the target data to be accelerated into the first storage space according to the target data move-in request; an access speed of the first storage space is greater than an access speed of a second storage space in the storage device.

[0015] In a third aspect, the present application provides an electronic device, including a memory and a processor; wherein:

[0016] The memory is used to store executable instructions;

[0017] The processor is used to implement the data storage method provided in the embodiment of the present application when executing the executable instructions stored in the memory.

[0018] In a fourth aspect, the present application provides a readable storage medium storing executable instructions for causing a processor to execute and implement the data storage method provided in an embodiment of the present application.

[0019] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program or instructions, which, when executed by a processor, implements the data storage method provided in the embodiment of the present application.

[0020] The present application provides a data storage method, device, electronic device and computer-readable storage medium, which receive a system call initiated by an application layer for storing first application data through the file system of the electronic device; when the system call includes an acceleration indication, determine the target data to be accelerated based on the first application data and generate a corresponding target data move-in request; and map the target data move-in request to the first data flow channel of at least two data flow channels and send it to a storage device according to the acceleration mark of the target data move-in request. In this way, the storage device can identify the target data move-in request received from the first data flow channel as a data request that needs to be accelerated, and store the target acceleration data in the target data move-in request in the first storage space with a faster access speed, thereby realizing accelerated access to application data and improving the application running speed and performance. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Figure 1 It is a schematic diagram of the structure of the storage stack of the current multi-data diversion mechanism;

[0022] Figure 2 Schematic diagram of the data storage method provided in the embodiment of the present application Figure 1 ;

[0023] Figure 3 A schematic diagram of a data storage method process of a storage stack based on a multi-data diversion mechanism according to an embodiment of the present application;

[0024] Figure 4 Schematic diagram of the interaction process of each layer of the storage stack in the electronic device provided in the embodiment of the present application Figure 1 ;

[0025] Figure 5 Schematic diagram of the interaction process of each layer of the storage stack in the electronic device provided in the embodiment of the present application Figure 2 ;

[0026] Figure 6 A schematic diagram of the system structure of a data storage method of a storage stack based on a multi-data offloading mechanism provided in an embodiment of the present application;

[0027] Figure 7 A schematic diagram of the working process of the data acceleration decision module provided in the embodiment of the present application;

[0028] Figure 8 Schematic diagram of the data storage method provided in the embodiment of the present application Figure 2 ;

[0029] Fig. 9 Schematic diagram of the data storage method provided in the embodiment of the present application Figure 3 ;

[0030] Fig.10 An optional structural diagram of a data storage device provided in an embodiment of the present application;

[0031] Fig.11 An optional structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0032] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings. The described embodiments should not be regarded as limiting the present application. All other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of this application.

[0033] In the following description, reference is made to “some embodiments”, which describe a subset of all possible embodiments, but it will be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0034] In the following description, the terms "first\second\third" involved are merely used to distinguish similar objects and do not represent a specific ordering of the objects. It can be understood that "first\second\third" can be interchanged with a specific order or sequence where permitted, so that the embodiments of the present application described here can be implemented in an order other than that illustrated or described here.

[0035] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.

[0036] At present, during the use of electronic devices, as data is continuously written into the storage device, valid data will gradually be dispersed throughout the storage device. In order to ensure the availability of free storage blocks, it is necessary to perform garbage collection operations (i.e., move valid data of at least one storage block to another storage block) and erase operations on the storage blocks in the storage device. However, the storage device stores both cold data (cold data) that is not frequently updated and hot data (hot data) that is frequently updated. If the cold data and the hot data are stored in the same storage block, then as the hot data is frequently updated and garbage collection is performed, the cold data has to be moved to other storage blocks and copied several times, resulting in a decrease in the efficiency of garbage collection, and garbage collection is frequently performed, which in turn leads to a reduction in the life of the storage device.

[0037] At present, the multi-stream mechanism of the terminal device storage stack provides multiple data channels from top to bottom, which enables the storage device to identify or perceive different types of hot and cold data and classify and process them. Figure 1 As shown, the storage stack in the system of the terminal device may include a user state part and a kernel state part, wherein the user state part includes an application layer, and the kernel state part includes: a file system, a block input / output (Block In / Out, Block I / O) layer, a driver layer, and a storage device. Through the storage stack, different types of data, such as file system metadata and file data, read-only data and read-write data, data with different life cycles, data with different access frequencies, etc., can be written into the corresponding storage device through the shunt interface of the storage device.

[0038] based on Figure 1In the typical application scenario of multi-data diversion in the current storage stack, when writing data, the application in the application layer can write a hint (hint) of the data life cycle of the data to be written to the file system through the system call interface for device input and output operations. Exemplarily, the hint of the data life cycle may include: at least one of WRITE LIFESHORT, WRITE LIFE MEDIUM, WRITE_LIFE_LONG, or WRITE_LIFE_EXTREAM. The file system includes a multi-data diversion decision module, and the file system receives the data to be written sent by the application layer application through the system call interface for device input and output operations, and identifies the data type of the data to be written through the decision module.

[0039] Exemplarily, the multi-data flow decision module in the Flash Friendly File System (F2FS) maps the hint of the data to be written to the corresponding hot and cold data types, and marks the hot and cold data types respectively. For example, WRITE_LIFE_SHORT is mapped to hot data; WRITE_LIFE_EXTREAM is mapped to cold data; and other types of hints are mapped to warm data. Alternatively, the multi-data flow decision module can also distinguish hot and cold data according to the file type or data type of the data to be written. Exemplarily, for the data segment in the data to be written, the hot and cold data of the file type can be distinguished based on the file extension, for example, the data blocks of media type files such as mp3, jpg, and mp4 are marked as cold data; the data blocks of files such as db and tmp are marked as hot data; and the data blocks of directory items are marked as hot data. For the node segment in the data to be written, the hot and cold data types of the node segment can be divided according to the type of the node segment (such as whether the node segment is a direct index or an indirect index), or according to whether the node segment is a directory or a file, the hot and cold data types of the node segment can also be divided. As shown in Table 1. Table 1 shows the F2FS hot and cold data division rules.

[0040] Table 1

[0041]

[0042] Figure 1In the process, the file system creates a synchronous blocking I / O (BIO) request for the data to be written, and sets the corresponding hot and cold data type tags for the BIO request; the data to be written and its corresponding hot and cold data type tags are sent to the block input and output module through the BIO request, and the block input and output module passes the hot and cold data type tags to the driver layer. The driver layer merges the requests according to the hot and cold data type tags in the received BIO request. BIO requests with the same hot and cold data type tags and continuous logical block addresses (LBA) are merged, and BIO requests with different hot and cold data type tags are not merged even if the LBA is continuous. The driver layer sends the BIO request from different shunt channels to the storage device according to the different hot and cold data type tags, and the storage device classifies and processes the data to be written in the BIO requests received by different shunt channels.

[0043] It can be seen that the hot and cold data identification in the current multi-data diversion mechanism can only realize the hot and cold identification of some types of data. A large number of ordinary file data blocks are still considered to be warm data and will not be classified and processed on the storage device side, thereby reducing the efficiency of garbage collection and the life of the storage device.

[0044] Moreover, the current multi-data diversion mechanism is only used for the diversion of cold and hot data, which has poor flexibility and fails to give full play to the role of the multi-data diversion mechanism based on the storage stack in various key scenarios such as application startup and application acceleration.

[0045] The embodiments of the present application provide a data storage method, device, electronic device, and computer-readable storage medium, which can use the system processing flow of the multi-data diversion mechanism to achieve data acceleration customized by the application, thereby improving the application startup and running speed, reducing the application loading or freezing time, and improving the user experience in key scenarios. In addition, the embodiments of the present application can achieve more sophisticated cold and hot data identification based on the update frequency of file data, thereby improving garbage collection efficiency and storage device service life.

[0046] The present application provides a data storage method, such as Figure 2 As shown, including S101-S104, as follows:

[0047] S101. Receive, through a file system of an electronic device, a system call initiated by an application layer for storing first application data.

[0048] In an embodiment of the present application, the electronic device includes a file system, and the file system is used to manage and organize files in the storage device. The file system can manage files in units of data units, and in some embodiments, the data unit can be a data block.

[0049] In the embodiment of the present application, the electronic device includes an application layer, applications are running in the application layer, and application data required for the application running is stored in a storage device.

[0050] In the embodiment of the present application, the storage device may include an electronic storage device. Exemplarily, the storage device may include a solid-state drive (SSD), an embedded multimedia storage card (eMMC), a universal flash storage (UFS), etc., and the specific selection is made according to the actual situation, and the embodiment of the present application does not limit it.

[0051] In some embodiments, the application layer may indicate the file name and data block range of the first application data in the system call, or indicate the file directory containing the first application data in the system call to initiate a system call for the first application data.

[0052] In an embodiment of the present application, the application can, according to the needs of its own operation, use some key data, such as frequently called data, as the first application data, and instruct the file system to store the first application data in the fast access area of ​​the storage device, so that it can be quickly obtained from the storage device when the first application data needs to be called. In an embodiment of the present application, the application layer can initiate a system call to the file system, and store the first application data in the storage device through the file system. Exemplarily, an (input / output control, ioctl) system call can be performed by the application in the application layer, and the first application data and indication information can be passed to the file system through the ioctl system call. The file system can respond to the ioctl system call and control the I / O channel between the storage device according to the indication information to store the first application data.

[0053] S102: When the system call includes an acceleration indication, determine target data to be accelerated based on the first application data, and generate a target data move-in request corresponding to the target data to be accelerated; the target data move-in request includes an acceleration mark.

[0054] In an embodiment of the present application, an application at the application layer can pass the instruction information of the system call to the file system in the form of a system call parameter in the system call. When the instruction information of the system call includes an acceleration instruction, the file system can recognize that the application layer instructs to accelerate the first application data, that is, the application layer instructs to store the first application data in a fast access area of ​​the storage device. The file system makes an acceleration decision based on the first application data, determines the target data to be accelerated, and generates a target data move-in request corresponding to the target data to be accelerated.

[0055] In some embodiments, the file system can make an acceleration decision based on at least one of the priority of the indication information, other data that currently needs to be accelerated, and the usage of the fast access area in the storage device to determine the target data to be accelerated. The specific selection is made according to the actual situation, and the embodiments of this application are not limited.

[0056] In an embodiment of the present application, the file system generates a data move-in request corresponding to the target data to be accelerated, and sets an acceleration flag for the data move-in request to obtain the target data move-in request. In some embodiments, the file system can create a BIO request or a synchronous non-blocking I / O (NIO) request according to the target data to be accelerated, and set an acceleration flag in the BIO request or the NIO request as the target data move-in request.

[0057] In the embodiment of the present application, the data move-in request corresponding to the target data to be accelerated includes the logical storage unit address corresponding to the target data to be accelerated.

[0058] S103, sending a target data move-in request to a storage device of the electronic device through a first data flow channel; the first data flow channel is a data flow channel corresponding to the acceleration mark among the at least two data flow channels.

[0059] In an embodiment of the present application, the storage stack of the electronic device may include multiple data channels from the application layer to the storage device from top to bottom, and may support a multiple data channel shunt mechanism. Using the multiple data channel shunt mechanism, the file system may send a target data move-in request to the storage device of the electronic device through the first data channel. The acceleration flag in the target data move-in request may be used to determine the first data flow channel among at least two data flow channels.

[0060] In some embodiments, the electronic device may further include a data unit transmission layer and a driver layer. Exemplarily, the data unit transmission layer may be the block input and output layer described above. The electronic device may send a target data move-in request to the data unit transmission layer of the electronic device through the file system; send the target data move-in request to the driver layer of the electronic device through the data unit transmission layer; determine a first data flow channel in at least two data flow channels according to the acceleration mark through the driver layer, and send the target data move-in request to the storage device through the first data flow channel.

[0061] In some embodiments, the driver layer maps the target data move-in request to the first data stream channel according to the acceleration tag, and sends the target data move-in request to the shunt interface of the storage device through the first data stream channel. Exemplarily, the shunt interface of the storage device can be the write shunt interface SHID (Stream ID & Host Initialed Defragment, SHID) of UFS.

[0062] In some embodiments, the data unit transport layer may merge data move-in requests to further improve storage processing efficiency. The data unit transport layer may receive multiple data move-in requests sent by the file system. The multiple data move-in requests include target data move-in requests. Each of the multiple data move-in requests includes a logical storage unit address of the data targeted by the data move-in request.

[0063] The data unit transmission layer merges the data move-in requests that contain acceleration tags and have continuous logical storage unit addresses in multiple data move-in requests to determine the target merged data move-in request. That is to say, the data unit transmission layer can merge the data move-in requests that contain the same acceleration tag and have continuous logical storage unit addresses in multiple data move-in requests. In this way, the storage device can realize one-time processing of multiple data move-in requests with the same storage space and continuous logical storage unit addresses by processing a merged data move-in request, thereby improving the processing efficiency and data storage efficiency of the storage device. It can be understood that since the multiple data move-in requests received by the data unit transmission layer contain the target data move-in request, and the data unit transmission layer merges the data move-in requests that contain acceleration tags and have continuous logical storage unit addresses, the merged target merged data move-in request contains the target data move-in request. By sending the target merged data move-in request to the storage device, it is possible to send the target data move-in request to the storage device.

[0064] In some embodiments, the data unit transmission layer sends the target merged data move-in request to the driver layer; through the driver layer, the target merged data move-in request is sent to the storage device through the first data stream channel.

[0065] S104. Determine, through the storage device and according to the first data flow channel, a first storage space corresponding to the target data move-in request, and store the target data to be accelerated into the first storage space according to the target data move-in request.

[0066] In the embodiment of the present application, at least two data stream channels correspond to at least two storage spaces in the storage device. The storage device can determine the storage space corresponding to the data in the data move-in request according to the data move-in request received from different data stream channels.

[0067] In an embodiment of the present application, the storage device includes at least a first storage space and a second storage space, wherein the access speed of the first storage space is greater than the access speed of the second storage space, and the first storage space corresponds to the first data flow channel. In this way, when the storage device receives a target data move-in request from the first data flow channel, the data in the target data move-in request, that is, the storage location of the target data to be accelerated, can be determined as the first storage space, thereby storing the target data to be accelerated in a storage space with a faster access speed. In this way, when the application accesses or obtains the first application data in the target data to be accelerated from the storage device, faster access or data acquisition can be achieved, thereby speeding up the application operation speed and improving the application performance.

[0068] In some embodiments, the first storage space may be a single-level cell SLC (Single-Level Cell) area in a UFS storage device. The second storage space may be a multi-level cell MLC (Multi-Level Cell) or a triple-level cell TLC (Triple-Level Cell) area in a storage device. The specific selection is made according to the actual situation, and the embodiments of the present application are not limited.

[0069] For example, Figure 3 As shown, the storage stack of the electronic device includes a user state and a kernel state, wherein the user state includes an application layer, and the kernel state includes a file system, a data unit transmission layer, a driver layer, and a storage device. Based on the diversion mechanism of multiple data stream channels of the electronic device, through the data storage method of the embodiment of the present application, the application layer initiates a system call containing an acceleration indication to the file system for the first application data, the file system determines the target data to be accelerated according to the acceleration indication and the first application data, generates a target data move-in request containing an acceleration mark and continues to pass it downward, and sends the target data move-in request to the storage device through the first data stream channel corresponding to the acceleration mark through the data unit transmission layer and the driver layer, and the storage device stores the target data to be accelerated in the first storage space according to the target data move-in request received from the first data stream channel.

[0070] It should be noted that Figure 3 The storage stack of the electronic device can also be used for application data storage in non-acceleration scenarios. The application data in the non-acceleration scenario can be stored in a storage space other than the first storage space in the storage device, such as in the second storage space.

[0071] It can be understood that the embodiment of the present application receives a system call initiated by the application layer for storing the first application data through the file system of the electronic device; when the system call includes an acceleration indication, the target data to be accelerated is determined based on the first application data and a corresponding target data move-in request is generated; according to the acceleration mark of the target data move-in request, the target data move-in request is mapped to the first data flow channel of at least two data flow channels and sent to the storage device. In this way, the storage device can identify the target data move-in request received from the first data flow channel as a data request that needs to be accelerated, and store the target acceleration data in the target data move-in request in the first storage space with a faster access speed, thereby achieving accelerated access to the application data and improving the application running speed and performance.

[0072] In some embodiments, the process of determining the target data to be accelerated based on the first application data in S102 may include:

[0073] In a case where the acceleration instruction includes the first acceleration instruction, target data to be accelerated is determined based on the first application data and the system data to be accelerated in the file system.

[0074] When the acceleration instruction includes the second acceleration instruction, the first application data is determined as the target data to be accelerated.

[0075] In an embodiment of the present application, the acceleration indication may include a first acceleration indication and a second acceleration indication. Among them, the priority of the second acceleration indication is higher than the priority of the first acceleration indication. In some embodiments, the first acceleration indication can be used to indicate the application data that the application layer recommends to be accelerated, and the second acceleration indication can be used to indicate the application data that the application layer specifies must be accelerated. Exemplarily, the first acceleration indication can be a system call parameter in the form of a hint. The second acceleration indication can be a system call parameter in the form of other parameters, which is specifically selected according to the actual situation and is not limited in the embodiment of the present application.

[0076] In the embodiment of the present application, when the acceleration instruction in the system call includes the first acceleration instruction, the file system can make a unified decision to determine the data range for final acceleration based on the first application data corresponding to the system call and the system data to be accelerated that the file system itself needs to accelerate, thereby determining the target data to be accelerated. Exemplarily, the system data to be accelerated may include high-frequency data such as metadata.

[0077] In some embodiments, the file system determines usage information of the first storage space. Here, the usage information of the first storage space represents the usage of the first storage space. Exemplarily, the usage information of the first storage space may include the size of the free storage space in the first storage space.

[0078] In some embodiments, the file system determines the first application data and part or all of the system data to be accelerated as target data to be accelerated based on the usage information and / or the preset application data directory, wherein the preset application data directory contains information of at least one pre-specified application data to be accelerated.

[0079] Exemplarily, the file system can determine whether all the first application data and the system data to be accelerated can be stored in the first storage space according to the size of the free storage space in the first storage space represented by the usage information. If it is determined that all the first application data and the system data to be accelerated can be stored in the first storage space according to the usage information, all the first application data and the system data to be accelerated are determined as target data to be accelerated.

[0080] Exemplarily, when the file system determines, based on usage information, that all the data in the first application data and the system data to be accelerated cannot be stored in the first storage space, such as when there is insufficient free storage space in the first storage space, the file system can determine, in conjunction with the preset application data directory, whether the first application data is included in at least one pre-designated application data to be accelerated. When the first application data is included in at least one pre-designated application data to be accelerated, it means that the priority of the first application data is higher than the system data to be accelerated, and the file system determines the first application data and part of the system data to be accelerated as target data to be accelerated. When the first application data is not included in at least one pre-designated application data to be accelerated, it means that the priority of the first application data is lower, and the file system can determine part of the first application data and part of the system data to be accelerated, or part of the first application data and the system data to be accelerated as target data to be accelerated. The specific selection is made according to the actual situation, and the embodiments of the present application are not limited thereto.

[0081] In some embodiments, when the acceleration indication includes a first acceleration indication, the file system can determine the logical storage unit currently corresponding to the target data to be accelerated; create a data write request corresponding to the logical storage unit, and obtain a target data move-in request based on the data write request and the acceleration flag. The data write request is used to instruct the storage device to store the target data to be accelerated into the first storage space in a write manner. The file system sets an acceleration flag for the data write request corresponding to the target data to be accelerated, obtains a target data move-in request, and sends the target data move-in request to the storage device through the first data flow channel through the data unit transmission layer and the driver layer.

[0082] In some embodiments, when the storage device receives a target data move-in request from the first data flow channel, the storage device reads the target data to be accelerated from the currently corresponding logical storage unit to a preset cache space according to the data write request, and writes the target data from the preset cache space to the first storage space.

[0083] In an embodiment of the present application, the storage space corresponding to the logical storage unit currently corresponding to the target data to be accelerated in the storage device belongs to the second storage space. The writing process of the data write request includes: firstly, a read instruction for the target data to be accelerated is sent to the storage device through the driver layer, and the target data to be accelerated in the second storage space is read out to the preset cache space, and the storage device side responds to the read instruction and provides the target data to be accelerated in the second storage space to the preset cache space. The driver layer sends a write instruction to the storage device to write the target data to be accelerated in the preset cache space into the first storage space. In this way, the target data to be accelerated is stored in the first storage space.

[0084] Exemplarily, when the acceleration instruction includes the first acceleration instruction, the interaction process of each layer of the storage stack in the electronic device may be as follows: Figure 4 As shown below:

[0085] S401. The application layer indicates first application data that needs to be accelerated to the file system in a hint manner through an ioctl system call.

[0086] S402: The file system records the first application data that needs to be accelerated as indicated by the application layer according to the hint in the system call.

[0087] S403: The file system records the system data to be accelerated that needs to be accelerated within itself.

[0088] S404: The file system determines the acceleration data range and the target data to be accelerated based on the first application data and the system data to be accelerated.

[0089] S405: The file system creates a BIO request corresponding to the target data to be accelerated, sets an acceleration mark for the BIO request corresponding to the target data to be accelerated, obtains a target data move-in request, and sends it to the data unit transport layer.

[0090] S406: The data unit transmission layer continues to send the target data move-in request to the driver layer.

[0091] In S406, when the data unit transmission layer sends the target data move-in request to the driver layer, it will merge the target data move-in request with other data move-in requests that contain the same acceleration tag and have continuous logical unit storage addresses. For data move-in requests that do not contain acceleration tags, they will not be merged even if the logical unit storage addresses corresponding to the target data move-in requests are continuous.

[0092] S407 . The driver layer maps the target data move-in request to the first data stream channel according to the acceleration tag, and sends it to the storage device.

[0093] S408: The storage device moves the target data received from the first data stream channel into the target to-be-accelerated data in the request and stores it in the first storage space.

[0094] In some embodiments, when the acceleration indication includes a second acceleration indication, the file system determines the logical storage unit to which the target data to be accelerated currently corresponds; creates a data copy request corresponding to the logical storage unit, and obtains a target data move-in request according to the data copy request and the acceleration mark. The data copy request is used to copy data inside the storage device. In this way, when the storage device receives the target data move-in request including the data copy request, the storage device copies the target data to be accelerated from the currently corresponding logical storage unit to the first storage space according to the data copy request.

[0095] Exemplarily, a data copy request can be implemented by executing an XCOPY instruction. The XCOPY instruction is a data copy capability provided by a customized storage device. It can directly copy data from an original address to a target address inside the storage device, thereby saving the process of transferring data from the device to the host side and then from the host side to the device, saving protocol layer overhead and improving data migration efficiency.

[0096] For example, when the application layer explicitly specifies to accelerate the first application data through the second acceleration instruction, the interaction process of each layer of the storage stack in the electronic device can be as follows: Figure 5 As shown below:

[0097] S501: The application layer indicates to the file system first application data that needs to be accelerated in the form of system call parameters through an ioctl system call, wherein the system call parameters include a data range of the first application data that needs to be accelerated.

[0098] S502: The file system converts the data range of the first application data in the system call parameter into a logical storage unit range.

[0099] S502 is equivalent to the process of determining the logical storage unit currently corresponding to the target data to be accelerated. Exemplarily, the file system may convert the data range of the first application data into a logical block address (Logical Block Address, LBA) range.

[0100] S503: The file system generates an XCOPY BIO request including an acceleration tag for the logical storage unit range and sends the request to the data unit transport layer.

[0101] In S503, the XCOPY BIO request including the acceleration flag is equivalent to the target data move-in request. The process of S503 is equivalent to the process of obtaining the target data move-in request according to the data copy request and the acceleration flag.

[0102] S504: The data unit transport layer determines whether to merge XCOPY BIO requests with the same acceleration flag and continuous logical storage unit addresses according to the acceleration flag of the received data move-in request.

[0103] S505: The data unit transport layer passes the XCOPY BIO request downward to the driver layer.

[0104] S506: The driver layer sends the XCOPY BIO request with the acceleration tag to the storage device from the first data flow channel corresponding to the acceleration tag.

[0105] S507: The storage device copies the target data to be accelerated to the first storage space in an XCOPY manner according to the XCOPY BIO request received from the first data stream channel.

[0106] In some embodiments, based on Figure 3 The system architecture of the data storage method based on the multi-data diversion mechanism provided in the embodiment of the present application can be as follows Figure 6 As shown, it includes: a data acceleration decision module, a first storage space management module, an accelerated data transmission module and an accelerated implementation module.

[0107] Among them, for the data acceleration decision module, such as Figure 7As shown, the user can update the whitelist (equivalent to the preset application data directory) in a self-set manner. Exemplarily, the user can store the files or directories that need to be accelerated by the specified application into the whitelist. The files or directories that need to be accelerated can also be written to the whitelist by server update. The data acceleration decision module can obtain the files or directories that need to be accelerated from the whitelist; or, the data acceleration decision module can also receive the files, directories and specific data units (such as data blocks) that need to be accelerated preloaded by the application. In addition, the file system can perform statistics on the usage of the first storage space, obtain the first storage space usage information and report it to the data acceleration decision module. The file system can also report the data unit creation or update notification to the data acceleration decision module. In this way, the data decision module monitors the file tag decision parsing whitelist, obtains the files / directories / data blocks that need to be accelerated (equivalent to obtaining the first application data), receives the notification of file creation or update from the kernel state (equivalent to obtaining the system data to be accelerated), and also obtains the first storage space usage information, and makes the final decision on the acceleration data range, that is, determines the target data to be accelerated, to perform data acceleration.

[0108] for Figure 6 The first storage space management module in the first storage space management module can maintain the usage of the first storage space, update it according to the situation of data written into the first storage space, and provide the information to the above-mentioned data decision module in the form of nodes in the file system.

[0109] for Figure 6 The accelerated data transfer module is implemented in the file system, data transmission layer, driver layer and storage device in the storage stack. The accelerated data transfer module is based on the majority of the diversion channels of the storage stack, and performs data diversion when data is written. The tag transfer can be achieved by carrying an acceleration tag in the tag bit of the request structure when sending an I / O request. When creating a target data move-in request, such as a BIO request, the file system sets the acceleration tag on the tag variable in the BIO structure. The data unit transmission layer does not merge BIO requests with different acceleration tags, and passes them to the driver layer separately. The driver layer sends the BIO request with the acceleration tag from the first data flow channel to the storage device.

[0110] The firmware of the storage device contains Figure 6 The acceleration implementation module is used to accelerate data access by moving data into the first storage space of the storage device, such as (SLC area).

[0111] It is understandable that the data storage method based on storage stack multi-data diversion provided in the embodiment of the present application can improve the performance of commonly used applications (such as instant messaging applications, game applications, etc.), improve the scene experience, and avoid the jamming caused by poor I / O performance. The application can add key files of key scenes or startup-related files as the first application data to the first storage space, so that the startup-related files can be identified in advance, the application startup time can be optimized, the I / O performance can be improved, the jamming of the application operation can be reduced, and the application running speed can be increased.

[0112] In some embodiments, the data storage method provided by the embodiments of the present application can also be as follows: Figure 8 As shown, including S801-S805, as follows:

[0113] S801. Receive, through a file system, a cancellation acceleration instruction for second application data in a first storage space sent by an application layer.

[0114] In an embodiment of the present application, the application layer may also send a cancel acceleration indication for the second application data in the first storage space to the file system to inform the file system that the second application data is not needed and release the space occupied by the second application data in the first storage space.

[0115] S802: Generate a data removal request corresponding to the second application data according to the acceleration cancellation indication through the file system and send it to the data unit transmission layer; the data removal request includes an acceleration cancellation mark.

[0116] S803: Send the data removal request to the driver layer through the data unit transmission layer.

[0117] In the embodiment of the present application, the file system can generate a data removal request corresponding to the second application data according to the cancellation acceleration indication; the data removal request includes a cancellation acceleration mark.

[0118] The file system sends the data removal request to the data unit transport layer, and the data unit transport layer sends the data removal request to the driver layer.

[0119] S804 . Determine, through the driver layer, a second data flow channel from at least two data flow channels according to the cancellation acceleration mark, and send a data removal request to the storage device through the second data flow channel.

[0120] S805 . Receive a data removal request from the second data flow channel through the storage device, and move the second application data from the first storage space to the second storage space according to the data removal request.

[0121] In the embodiment of the present application, the storage device moves the second application data from the first storage space to the second storage space with a lower access speed according to the data removal request received from the second data flow channel, that is, cancels the acceleration of the second application data.

[0122] It is understandable that the embodiments of the present application can also cancel acceleration of data by transmitting a cancellation acceleration mark based on a multi-data diversion mechanism of a storage stack, thereby improving the flexibility of data storage.

[0123] In some embodiments, when the system call does not include an acceleration instruction, the data storage method provided in the embodiment of the present application can also achieve the separation of hot and cold data. Fig. 9 As shown, including S901-S905, as follows:

[0124] S901. When the system call does not include an acceleration indication, determine an update frequency corresponding to each data unit in the first application data.

[0125] In an embodiment of the present application, when the system call does not include an acceleration indication, the electronic device determines the update frequency corresponding to each data unit in the first application data through the file system.

[0126] In the embodiment of the present application, the update frequency of the data unit does not record the total update time, but the update frequency of the data unit is represented by the continuously accumulated average interval time of each update, thereby avoiding inaccurate update frequency caused by uneven update time.

[0127] In some embodiments, the file system can determine the total update duration corresponding to each data unit based on the creation time and the current update time of each data unit; and determine the update frequency corresponding to each data unit based on the total update duration and the number of updates corresponding to each data unit. Exemplarily, when the data unit is currently updated for the Nth time (N is greater than 1), the update frequency of the data unit is determined by formula (1), as follows:

[0128] Temp= T N / N (1)

[0129] Among them, T N is the total update time of the data unit (i.e., the time from the creation of the data unit to the current Nth update), N is the number of updates of the data unit, and Temp is the update frequency. In some embodiments, the application layer initiates a system call when updating the first application data; the file system can record the current time corresponding to each data unit according to the system call caused by the update of the first application data; and increment the number of updates corresponding to each data unit. Thus, the total update time and the number of updates are continuously accumulated.

[0130] Based on formula (1), it can be seen that the larger the Temp is, the longer the average update interval of the data unit is, that is, the less frequent the update is, and the "colder" the data is; conversely, the smaller the Temp is, the more frequent the data unit is updated, and the "hotter" the data is.

[0131] In some embodiments, the total update duration of the data unit may be determined by the following process:

[0132] Determine the current update duration based on the last update time and the current update time corresponding to each data unit; determine the last total update duration based on the creation time and the last update time corresponding to each data unit; determine the product of the preset attenuation coefficient and the last total update duration, and determine the total update duration based on the sum of the product and the current update duration.

[0133] For example, as shown in formula (2), it is as follows:

[0134] T N =α·T N-1 +T detal (2)

[0135] In formula (2), α is a preset attenuation coefficient, which is used to control the influence of the historical update frequency. For example, the value of α can be between 0% and 200%, and the default value is 100%. The specific selection is made according to the actual situation, and the embodiment of the present application is not limited. N-1 is the total update time of the last update, that is, the Nth update of the data unit, T N-1 It is the time from the creation time to the N-1th update of the data unit. detal is the current update duration, that is, the time interval between the current Nth update and the N-1th update.

[0136] S902. Determine the storage type of each data unit according to the update frequency corresponding to each data unit; the storage type represents the hotness or coldness of each data unit.

[0137] In the embodiment of the present application, in order to address the problem that the current file system cannot distinguish the hot and cold differences of ordinary file data blocks in the hot and cold data separation, in order to more accurately separate a large number of ordinary file data blocks into cold and hot blocks, the embodiment of the present application introduces the recording of the update frequency of each data unit in the file data, such as the data block, and distinguishes the hot and cold degrees of the file data blocks by setting a threshold.

[0138] Exemplarily, when the update frequency is greater than or equal to the preset update frequency threshold, the storage type of the corresponding data unit is determined as the hot data type. When the update frequency is less than the preset update frequency threshold, the storage type of the corresponding data unit is determined as the cold data type.

[0139] S903. Generate a data move-in request corresponding to each data unit according to the storage type of each data unit through the file system; the data move-in request corresponding to each data unit includes a type tag corresponding to the storage type of each data unit.

[0140] In an embodiment of the present application, when the storage type of each data unit is identified, the file system can determine the type tag corresponding to the storage type of each data unit. The file system generates a data move-in request corresponding to each data unit, and configures the type tag corresponding to the storage type of the data unit in the data move-in request corresponding to each data unit.

[0141] S904 , determining the target data flow channel corresponding to each data unit according to the type tag of the data move-in request corresponding to each data unit, and sending the data move-in request corresponding to each data unit to the storage device through the target data flow channel corresponding to each data unit.

[0142] In an embodiment of the present application, based on the storage stack of the electronic device, the file system sends the data move-in request corresponding to each data unit to the data unit transmission layer, which is then sent to the driver layer by the data unit transmission layer. The driver layer determines the target data flow channel corresponding to each data unit based on the type mark of the data move-in request corresponding to each data unit, and sends the data move-in request corresponding to each data unit to the storage device through the target data flow channel corresponding to each data unit.

[0143] In the embodiment of the present application, the target data flow channel corresponding to each data unit is a data flow channel corresponding to the type mark of each data unit in at least two data flow channels.

[0144] In the embodiment of the present application, the data-moving request corresponding to each data unit includes the logical storage unit address corresponding to each data unit.

[0145] In some embodiments, the electronic device sends a data-moving-in request corresponding to each data unit to a data unit transmission layer of the electronic device through a file system; merges data-moving-in requests with the same type tag and continuous logical storage unit addresses through the data unit transmission layer to determine at least one merged data-moving-in request; each merged data-moving-in request in at least one merged data-moving-in request includes at least two data-moving-in requests corresponding to at least two data units; sends at least one merged data-moving-in request and / or at least one data-moving-in request corresponding to at least one unmerged data unit to a driver layer of the electronic device; determines a target data flow channel corresponding to each merged data-moving-in request and / or each data-moving-in request in at least one data-moving-in request according to a type tag of each merged data-moving-in request and / or a type tag of each data-moving-in request in at least one data-moving-in request through the driver layer, thereby determining a target data flow channel corresponding to each data unit.

[0146] S905. Determine the target storage space corresponding to each data unit through the storage device according to the data move-in request corresponding to each data unit received from the target data flow channel corresponding to each data unit, and store each data unit into its corresponding target storage space.

[0147] It can be understood that the embodiment of the present application achieves more fine-grained hot and cold data type identification by counting the update frequency of data units, and can perform hot and cold identification on a large number of ordinary files, thereby improving garbage collection efficiency and storage device life.

[0148] The embodiment of the present application also provides a data storage device, which is applied to the electronic device of the embodiment of the present application. Fig.10 This is a schematic diagram of the structure of the data storage device provided in the embodiment of the present application. Fig.10 As shown, the data storage device 1 includes: a receiving module 11, a generating module 12, a sending module 13 and a storage module 14, wherein:

[0149] The receiving module 11 is used to receive a system call initiated by the application layer for storing the first application data through the file system of the electronic device;

[0150] The generating module 12 is configured to determine the target data to be accelerated based on the first application data when the system call includes an acceleration indication, and generate a target data move-in request corresponding to the target data to be accelerated; the target data move-in request includes an acceleration mark;

[0151] The sending module 13 is used to send the target data move-in request to the storage device of the electronic device through a first data flow channel; the first data flow channel is a data flow channel corresponding to the acceleration mark among the at least two data flow channels;

[0152] The storage module 14 is used to determine the first storage space corresponding to the target data move-in request through the storage device according to the first data flow channel, and store the target data to be accelerated into the first storage space according to the target data move-in request; the access speed of the first storage space is greater than the access speed of the second storage space in the storage device.

[0153] In some embodiments, the sending module 13 is also used to send the target data move-in request to the data unit transmission layer of the electronic device through the file system; send the target data move-in request to the driver layer of the electronic device through the data unit transmission layer; determine the first data flow channel among the at least two data flow channels through the driver layer according to the acceleration mark, and send the target data move-in request to the storage device through the first data flow channel.

[0154] In some embodiments, the generating module 12 is further configured to determine the target data to be accelerated based on the first application data and the system data to be accelerated in the file system when the acceleration indication includes a first acceleration indication.

[0155] In some embodiments, the generation module 12 is also used to determine usage information of the first storage space; based on the usage information and / or a preset application data directory, the first application data and part or all of the system data to be accelerated are determined as the target data to be accelerated; the preset application data directory contains information of at least one pre-specified application data to be accelerated.

[0156] In some embodiments, the generating module 12 is further configured to determine the first application data as the target data to be accelerated when the acceleration indication includes a second acceleration indication.

[0157] In some embodiments, the generation module 12 is further used to determine the logical storage unit currently corresponding to the target data to be accelerated; create a data write request corresponding to the logical storage unit, and obtain the target data move-in request based on the data write request and the acceleration mark.

[0158] In some embodiments, the generation module 12 is also used to determine the logical storage unit currently corresponding to the target data to be accelerated; create a data copy request corresponding to the logical storage unit, and obtain the target data move-in request based on the data copy request and the acceleration mark; the data copy request is used to copy data inside the storage device.

[0159] In some embodiments, the storage module 14 is further used to read the target data to be accelerated from the currently corresponding logical storage unit to a preset cache space according to the data write request, and write the target data from the preset cache space to the first storage space.

[0160] In some embodiments, the storage module 14 is further configured to copy the target data to be accelerated from the currently corresponding logical storage unit to the first storage space according to the data copy request.

[0161] In some embodiments, the receiving module 11 is further configured to receive, through the file system, a cancellation acceleration instruction sent by the application layer for the second application data in the first storage space;

[0162] The generating module 12 is further configured to generate, through the file system, a data removal request corresponding to the second application data according to the acceleration cancellation indication; the data removal request includes an acceleration cancellation mark;

[0163] The sending module 13 is further configured to send the data removal request to the data unit transmission layer through the file system; send the data removal request to the driver layer through the data unit transmission layer; determine a second data flow channel in the at least two data flow channels according to the cancellation acceleration mark through the driver layer, and send the data removal request to the storage device through the second data flow channel;

[0164] The storage module 14 is further configured to receive the data removal request from the second data flow channel through the storage device, and move the second application data from the first storage space to the second storage space according to the data removal request.

[0165] In some embodiments, the data unit transmission layer is used to receive multiple data move-in requests sent by the file system; the multiple data move-in requests include the target data move-in request; the sending module 13 is also used to merge the data move-in requests that contain the acceleration mark and have continuous logical storage unit addresses in the multiple data move-in requests through the data unit transmission layer, determine a target merged data move-in request that contains the target data move-in request; send the target merged data move-in request to the driver layer; and send the target merged data move-in request to the storage device through the first data flow channel through the driver layer.

[0166] In some embodiments, the generating module 12 is further used to determine the update frequency corresponding to each data unit in the first application data when the system call does not include the acceleration indication; determine the storage type of each data unit according to the update frequency corresponding to each data unit; the storage type characterizes the hotness or coldness of each data unit; generate a data move-in request corresponding to each data unit according to the storage type of each data unit through the file system; the data move-in request corresponding to each data unit includes a type tag corresponding to the storage type of each data unit;

[0167] The sending module 13 is further used to determine the target data flow channel corresponding to each data unit according to the type tag of the data move-in request corresponding to each data unit, and send the data move-in request corresponding to each data unit to the storage device through the target data flow channel corresponding to each data unit; the target data flow channel corresponding to each data unit is the data flow channel corresponding to the type tag of each data unit in the at least two data flow channels;

[0168] The storage module 14 is also used to determine the target storage space corresponding to each data unit through the storage device according to the data move-in request corresponding to each data unit received from the target data flow channel corresponding to each data unit, and store each data unit into its corresponding target storage space.

[0169] In some embodiments, the generation module 12 is also used to determine the total update duration corresponding to each data unit based on the creation time and the current update time of each data unit; and determine the update frequency corresponding to each data unit based on the total update duration and the number of updates corresponding to each data unit.

[0170] In some embodiments, the generation module 12 is also used to determine the current update duration based on the last update time corresponding to each data unit and the current update time; determine the last total update duration based on the creation time corresponding to each data unit and the last update time; determine the product of a preset attenuation coefficient and the last total update duration, and determine the total update duration based on the sum of the product and the current update duration.

[0171] In some embodiments, the application layer initiates the system call when updating the first application data; the data storage device also includes a recording module, which is used to record the current time as the current update time corresponding to each data unit through the file system; and increment the number of updates corresponding to each data unit.

[0172] In some embodiments, the sending module 13 is also used to send the data move-in request corresponding to each data unit to the data unit transmission layer of the electronic device through the file system; merge the data move-in requests with the same type tag and continuous logical storage unit addresses through the data unit transmission layer to determine at least one merged data move-in request; each merged data move-in request in the at least one merged data move-in request includes at least two data move-in requests corresponding to at least two data units; send the at least one merged data move-in request and / or at least one data move-in request corresponding to at least one unmerged data unit to the driver layer of the electronic device; determine the target data flow channel corresponding to each merged data move-in request and / or each data move-in request in at least one data move-in request through the driver layer according to the type tag of each merged data move-in request and / or the type tag of each data move-in request in at least one data move-in request, thereby determining the target data flow channel corresponding to each data unit.

[0173] It should be noted that the description of the above device embodiment is similar to the description of the above method embodiment, and has similar beneficial effects as the method embodiment. For technical details not disclosed in the device embodiment of the present application, please refer to the description of the method embodiment of the present application for understanding.

[0174] The present application also provides an electronic device, Fig.11 This is an optional structural diagram of an electronic device provided in an embodiment of the present application. Fig.11 As shown, the electronic device 3 includes: a memory 32 and a processor 33. The memory 32 and the processor 33 are connected via a communication bus 34; the memory 32 is used to store executable instructions; the processor 33 is used to implement the data storage method provided in the embodiment of the present application when executing the executable instructions stored in the memory 32.

[0175] An embodiment of the present application provides a computer-readable storage medium storing executable instructions, wherein executable instructions are stored. When the executable instructions are executed by the above-mentioned processor, the above-mentioned processor will execute the data storage method provided by the embodiment of the present application.

[0176] In some embodiments, the computer-readable storage medium (i.e., readable storage medium) may be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, flash memory, magnetic surface storage, optical disk, or CD-ROM; or it may be various devices including one or any combination of the above memories.

[0177] In some embodiments, executable instructions may be in the form of a program, software, software module, script or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as a stand-alone program or as a module, component, subroutine or other unit suitable for use in a computing environment.

[0178] As examples, executable instructions may, but need not, correspond to a file in a file system, may be stored as part of a file storing other programs or data, such as one or more scripts in a Hyper Text Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple coordinated files (e.g., files storing one or more modules, subroutines, or code portions). As examples, executable instructions may be deployed to be executed on one computing device, or on multiple computing devices located at one location, or on multiple computing devices distributed at multiple locations and interconnected by a communication network.

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

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

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

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

[0183] The above is only a preferred embodiment of the present application and is not intended to limit the protection scope of the present application. Any modifications, equivalent substitutions and improvements made within the spirit and scope of the present application are included in the protection scope of the present application.

Claims

1. A data storage method, applied to electronic equipment, characterized in that: include: Receiving, through the file system of the electronic device, a system call initiated by the application layer for storing the first application data; In a case where the system call includes an acceleration indication, determining target data to be accelerated based on the first application data, and generating a target data move-in request corresponding to the target data to be accelerated; The target data move-in request includes an acceleration tag; Sending the target data move-in request to the storage device of the electronic device through a first data flow channel; the first data flow channel is a data flow channel corresponding to the acceleration mark among at least two data flow channels; Through the storage device, according to the first data flow channel, the first storage space corresponding to the target data move-in request is determined, and according to the target data move-in request, the target data to be accelerated is stored in the first storage space; the access speed of the first storage space is greater than the access speed of the second storage space in the storage device.

2. The method according to claim 1, characterized in that The step of sending the target data move-in request to the storage device of the electronic device through the first data stream channel comprises: Sending the target data move-in request to a data unit transmission layer of the electronic device through the file system; Sending the target data move-in request to the driving layer of the electronic device through the data unit transmission layer; The first data flow channel is determined in the at least two data flow channels through the driver layer according to the acceleration tag, and the target data move-in request is sent to the storage device through the first data flow channel.

3. The method according to claim 1 or 2, characterized in that: The determining target data to be accelerated based on the first application data includes: In a case where the acceleration instruction includes a first acceleration instruction, the target data to be accelerated is determined based on the first application data and the system data to be accelerated in the file system.

4. The method according to claim 3, characterized in that The determining the target data to be accelerated based on the first application data and the system data to be accelerated in the file system includes: Determining usage information of the first storage space; According to the usage information and / or the preset application data directory, the first application data and part or all of the system data to be accelerated are determined as the target data to be accelerated; the preset application data directory contains information of at least one pre-specified application data to be accelerated.

5. The method according to claim 1 or 2, characterized in that: The determining target data to be accelerated based on the first application data includes: In a case where the acceleration instruction includes a second acceleration instruction, the first application data is determined as the target data to be accelerated.

6. The method according to claim 3, characterized in that The generating a target data move-in request corresponding to the target data to be accelerated includes: Determine a logical storage unit currently corresponding to the target data to be accelerated; A data write request corresponding to the logical storage unit is created, and the target data move-in request is obtained according to the data write request and the acceleration flag.

7. The method according to claim 5, characterized in that The generating a target data move-in request corresponding to the target data to be accelerated includes: Determine a logical storage unit currently corresponding to the target data to be accelerated; A data copy request corresponding to the logical storage unit is created, and the target data move-in request is obtained according to the data copy request and the acceleration mark; the data copy request is used to copy data inside the storage device.

8. The method according to claim 6, characterized in that According to the target data move-in request, storing the target data to be accelerated into the first storage space includes: According to the data write request, the target data to be accelerated is read from the currently corresponding logical storage unit to a preset cache space, and is written from the preset cache space to the first storage space.

9. The method according to claim 7, characterized in that: According to the target data move-in request, storing the target data to be accelerated into the first storage space includes: According to the data copy request, the target data to be accelerated is copied from the currently corresponding logical storage unit to the first storage space.

10. The method according to claim 1, characterized in that The method further comprises: receiving, through the file system, a cancellation acceleration instruction for the second application data in the first storage space sent by the application layer; Generate, by the file system, a data removal request corresponding to the second application data according to the acceleration cancellation indication and send the request to the data unit transmission layer; the data removal request includes an acceleration cancellation mark; Sending the data removal request to the driver layer through the data unit transmission layer; Determine, by the driver layer, a second data flow channel among the at least two data flow channels according to the cancellation acceleration flag, and send the data removal request to the storage device through the second data flow channel; The data removal request is received from the second data flow channel through the storage device, and the second application data is moved from the first storage space to the second storage space according to the data removal request.

11. The method according to claim 2, characterized in that The data unit transmission layer is used to receive multiple data move-in requests sent by the file system; the multiple data move-in requests include the target data move-in request; The step of sending the target data move-in request to the driving layer of the electronic device through the data unit transmission layer includes: Merging the data move-in requests that contain the acceleration flag and have consecutive logical storage unit addresses among the multiple data move-in requests through the data unit transmission layer to determine a target merged data move-in request that contains the target data move-in request; Sending the target merged data move-in request to the driver layer; The step of sending the target data move-in request to the storage device through the first data flow channel includes: The target merged data move-in request is sent to the storage device through the first data stream channel via the driver layer.

12. The method according to any one of claims 1, 2, 4, 6-11, characterized in that: The method further comprises: In a case where the system call does not include the acceleration indication, determining an update frequency corresponding to each data unit in the first application data; Determine the storage type of each data unit according to the update frequency corresponding to each data unit; the storage type represents the hotness or coldness of each data unit; Generate, by the file system, a data move-in request corresponding to each data unit according to the storage type of each data unit; the data move-in request corresponding to each data unit includes a type tag corresponding to the storage type of each data unit; Determine the target data flow channel corresponding to each data unit according to the type tag of the data move-in request corresponding to each data unit, and send the data move-in request corresponding to each data unit to the storage device through the target data flow channel corresponding to each data unit; the target data flow channel corresponding to each data unit is the data flow channel corresponding to the type tag of each data unit in the at least two data flow channels; Through the storage device, according to the data move-in request corresponding to each data unit received from the target data flow channel corresponding to each data unit, the target storage space corresponding to each data unit is determined, and each data unit is stored in its corresponding target storage space.

13. The method according to claim 12, characterized in that The determining the update frequency corresponding to each data unit in the first application data includes: Determine the total update duration corresponding to each data unit according to the creation time and the current update time of each data unit; The update frequency corresponding to each data unit is determined according to the total update duration and the number of updates corresponding to each data unit.

14. The method according to claim 13, characterized in that Determining the total update duration corresponding to each data unit according to the creation time and the current update time of each data unit includes: Determine the current update duration according to the last update time and the current update time corresponding to each data unit; Determine the total duration of the last update according to the creation time corresponding to each data unit and the last update time; The product of a preset attenuation coefficient and the last total update duration is determined, and the total update duration is determined according to the sum of the product and the current update duration.

15. The method according to claim 13 or 14, characterized in that The application layer initiates the system call when updating the first application data; the method further includes: Through the file system, the current time is recorded as the current update time corresponding to each data unit; and the number of updates corresponding to each data unit is incremented.

16. The method according to claim 12, characterized in that The step of determining the target data stream channel corresponding to each data unit according to the type tag of the data move-in request corresponding to each data unit includes: Sending, through the file system, a data move-in request corresponding to each data unit to a data unit transmission layer of the electronic device; Merging data move-in requests with the same type tag and continuous logical storage unit addresses through the data unit transmission layer to determine at least one merged data move-in request; each merged data move-in request in the at least one merged data move-in request includes at least two data move-in requests corresponding to at least two data units; Sending the at least one merged data move-in request and / or the at least one data move-in request corresponding to the at least one unmerged data unit to a driver layer of the electronic device; Through the driver layer, based on the type tag of each merged data move-in request and / or the type tag of each data move-in request in at least one data move-in request, the target data flow channel corresponding to each merged data move-in request and / or each data move-in request in at least one data move-in request is determined, thereby determining the target data flow channel corresponding to each data unit.

17. A data storage device, applied to electronic equipment, characterized in that: include: A receiving module, configured to receive, through a file system of the electronic device, a system call initiated by the application layer for storing the first application data; a generating module, configured to determine target data to be accelerated based on the first application data and generate a target data move-in request corresponding to the target data to be accelerated when the system call includes an acceleration indication; The target data move-in request includes an acceleration tag; A sending module, used for sending the target data move-in request to the storage device of the electronic device through a first data stream channel; The first data stream channel is a data stream channel corresponding to the acceleration mark among the at least two data stream channels; A storage module is used to determine, through the storage device and according to the first data flow channel, a first storage space corresponding to the target data move-in request, and store the target data to be accelerated into the first storage space according to the target data move-in request; an access speed of the first storage space is greater than an access speed of a second storage space in the storage device.

18. An electronic device, characterized in that: include: A memory for storing executable instructions; A processor, configured to implement the method according to any one of claims 1 to 17 when executing the executable instructions stored in the memory.

19. A computer-readable storage medium, characterized in that: Executable instructions are stored, which are used to cause a processor to execute and implement the method described in any one of claims 1 to 17.