Data access method and apparatus, device, and storage medium
By obtaining and utilizing target prediction information to read data in the cache in advance, the blocking problem caused by random stream access requests in terminal devices is solved, and the efficiency and performance of data access are improved.
Patent Information
- Application Number
- PCT/CN2025/081604
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-05-15
- Filing Date
- 2025-03-10
- Publication Date
- 2025-10-02
AI Technical Summary
In the prior art, during the data access process, terminal devices encounter access request congestion due to excessive data, especially access requests for random streams cannot be effectively predicted and pre-read, making it difficult to alleviate the congestion.
By obtaining target preview information, indicating the storage location of the target data access request in the data storage device, reading data in the cache in advance, and sending data from the cache when receiving the data access request, the high access speed of the cache is used to reduce the load on the storage medium.
It effectively alleviates the scheduling queue pressure in the data access device, improves the processing efficiency of random stream access requests, reduces invalid notices, and improves the overall performance of data access.
Smart Images

Figure CN2025081604_02102025_PF_FP_ABST
Abstract
Description
Data access method, device, equipment, and storage medium
[0001] This application claims priority to Chinese patent application number 202410608815.1 filed on May 15, 2024 and entitled “Data access method and apparatus, equipment, storage medium” and Chinese patent application number 202410384863.7 filed on March 29, 2024 and entitled “Data access method and apparatus, equipment, storage medium”. The entire contents of the above two patent applications are incorporated into this application by reference. Technical Field
[0002] The embodiments of the present application relate to data transmission technology, and relate to but are not limited to a data access method and apparatus, device, and storage medium. Background Art
[0003] When a terminal device is accessing data, there is usually a situation where the access request is blocked due to excessive data that needs to be accessed.
[0004] In order to mitigate the impact of the blocking situation, the accessed memory usually predicts the next access request to be received based on the previous access request, so as to perform data reading in advance.
[0005] However, the memory-based access request prediction method is only applicable to sequential access requests. If the access request is a random stream, no prediction can be performed. Summary of the Invention
[0006] In one aspect of an embodiment of the present application, a data access method is provided, which is applied to a data access device. The method includes:
[0007] Acquire target prediction information, where the target prediction information is used to indicate target storage information of target data accessed by the target data access request in a data storage device, where the target storage information at least includes a target storage location;
[0008] Send target advance information.
[0009] Another aspect of the present application further provides a data access method, which is applied to a data storage device. The method includes:
[0010] receiving a target notification request, the target notification request including target notification information, the target notification information being used to indicate target storage information of the target data accessed by the target data access request of the data access device in the data storage device, the target storage information including at least a target storage location;
[0011] Reading target data from a storage medium of a data storage device according to the target advance information and storing the target data in a cache of the data storage device, where an access speed of the cache is greater than an access speed of the storage medium;
[0012] When a target data access request is received, the target data is obtained from the cache and sent to the data access device.
[0013] In another aspect of the embodiments of the present application, a data access device is provided, the device comprising: an acquisition module and a sending module;
[0014] An acquisition module, configured to acquire target advance information, the target advance information being used to indicate target storage information of target data accessed by the target data access request in the data storage device, the target storage information at least including a target storage location;
[0015] The sending module is used to send target prediction information.
[0016] Another aspect of the embodiments of the present application further provides a data storage device, the device comprising: a receiving module, a reading module, and a returning module;
[0017] A receiving module, configured to receive a target notification request, the target notification request including target notification information, the target notification information being used to indicate target storage information of the target data accessed by the target data access request of the data access device in the data storage device, the target storage information including at least a target storage location;
[0018] a reading module, configured to read target data from a storage medium of a data storage device according to the target prediction information, and store the target data in a cache of the data storage device, wherein an access speed of the cache is greater than an access speed of the storage medium;
[0019] The return module is used to obtain the target data from the cache and send the target data to the data access device when receiving a target data access request.
[0020] The terminal device provided in an embodiment of the present application includes a memory and a processor. The memory stores a computer program that can be run on the processor, and the processor implements the method of the embodiment of the present application when executing the program.
[0021] The computer-readable storage medium provided in the embodiment of the present application stores a computer program thereon, and when the computer program is executed by a processor, the method provided in the embodiment of the present application is implemented. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0023] FIG1 is a software architecture diagram of a data access device provided in an embodiment of the present application;
[0024] FIG2 is a hardware structure diagram of a data access device provided in an embodiment of the present application;
[0025] FIG3 is a hardware structure diagram of a data storage device provided in an embodiment of the present application;
[0026] FIG4 is a flow chart of a data access method applied to a data access device provided in an embodiment of the present application;
[0027] FIG5 is a schematic diagram of a process for obtaining target prediction information applied to a data access device according to an embodiment of the present application;
[0028] FIG6 is a schematic diagram of the overall process of transmitting target notice information from a data access device to a data storage device according to an embodiment of the present application;
[0029] FIG7 is a schematic diagram of a process for obtaining a target preview request provided in an embodiment of the present application;
[0030] FIG8 is a schematic diagram of a process for sending a target notification request according to an embodiment of the present application;
[0031] FIG9 is another flowchart of obtaining a target notification request provided in an embodiment of the present application;
[0032] FIG10 is another flowchart of sending a target notification request according to an embodiment of the present application;
[0033] FIG11 is a flow chart of a data access method applied to a data storage device provided in an embodiment of the present application;
[0034] FIG12 is a schematic diagram of the overall process of returning data in a data storage device provided in an embodiment of the present application;
[0035] FIG13 is a schematic diagram of the interaction between the data access device and the data storage device provided in an embodiment of the present application;
[0036] FIG14 is another schematic diagram of interaction between a data access device and a data storage device provided in an embodiment of the present application;
[0037] FIG15 is a schematic structural diagram of a data access device provided in an embodiment of the present application;
[0038] FIG16 is a schematic structural diagram of a data storage device provided in an embodiment of the present application;
[0039] FIG17 is a schematic diagram of the structure of the terminal device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0040] To make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the specific technical solutions of the present application will be further described in detail below in conjunction with the drawings in the embodiments of the present application. The following embodiments are used to illustrate the present application but are not intended to limit the scope of the present application.
[0041] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which this application pertains. The terms used herein are for the purpose of describing the embodiments of this application only and are not intended to limit this application.
[0042] In the following description, reference is made to “some embodiments”, which describes 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.
[0043] It should be pointed out that the terms "first\second\third" involved in the embodiments of the present application are used to distinguish similar or different 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.
[0044] In an embodiment of the present application, a data access method is provided, which is applied to a data access device. The method includes: obtaining target preview information, where the target preview information is used to indicate target storage information of the target data accessed by the target data access request in the data storage device, where the target storage information includes at least a target storage location; and sending the target preview information.
[0045] In one embodiment, obtaining target preview information includes: obtaining target preview information when preset conditions are met, the preset conditions including at least one of the following conditions: the number of multiple data access requests included in the scheduling queue is greater than or equal to the waiting threshold; the number of random data access requests sent by the data access device is greater than or equal to the access threshold, and the offset of the storage position of the data accessed by the random data access request and the data accessed by the last data access request sent in the data storage device is greater than or equal to the offset threshold.
[0046] In one embodiment, sending the target advance notice information includes: sending the target advance notice information when the number of sent data access requests is greater than or equal to a sending threshold.
[0047] In one embodiment, the target announcement information further includes target identification information, and the target identification information is used to indicate a target data access request.
[0048] In one embodiment, the data access device includes a forecast queue. After obtaining the target forecast information, the method further includes: generating a target forecast request based on the target forecast information, storing the target forecast request in the forecast queue, wherein the target forecast request includes the target forecast information; and sending the target forecast information, including: obtaining and sending the target forecast request from the forecast queue.
[0049] In one embodiment, the data storage device is a universal flash memory UFS, and a target preview request is generated according to the target preview information, including: generating a target UFS protocol information unit UPIU carrying an additional header field EHS area according to the target preview information, the EHS area is used to indicate the target preview information, and the target UPIU is the target preview request.
[0050] In one embodiment, the EHS area includes an EHS data header and an EHS data area. The EHS data header includes a preview quantity field and a preview content field. The preview quantity field is used to indicate the quantity of target preview information, and the preview content field is used to indicate the information type to which the target storage information belongs. The information type includes at least a storage location type. The EHS data area includes the target storage information.
[0051] In one embodiment, the EHS data area includes: a first identification field, where the first identification field is used to indicate target identification information.
[0052] In one embodiment, the preview queue includes at least two, each preview queue is used to store the preview request, the EHS data header also includes a preview type field, the preview type field is used to indicate that the target preview request is stored in one of the at least two preview queues, and storing the target preview request in the preview queue includes: storing the target preview request in the preview queue indicated by the preview type field.
[0053] In one embodiment, the EHS data header further includes a length field, and the UPIU includes a total EHS length field. The total EHS length field included in the UPIU has the same value as the length field in the EHS data header.
[0054] In one embodiment, before sending the target preview information, the method further includes: generating a UTP transmission request descriptor UTRD according to the target preview information, the UTRD including a total EHS length field, and the total EHS length field included in the UTRD has the same value as the length field in the EHS data header.
[0055] In one embodiment, the data storage device is a universal flash memory UFS, and a target notice request is generated according to the target notice information, including: generating a target small computer system interface SCSI command line CMD according to the target notice information, the target SCSI CMD including a data output area, and the data output area is used to indicate the target notice information.
[0056] In one embodiment, the data output area includes: a second identification field, and the second identification field is used for target identification information.
[0057] In one embodiment, the sending priority of the SCSI CMD is higher than the sending priority of the data access request.
[0058] In one embodiment, the method further includes: updating the target data access request, obtaining an updated target data access request, wherein the updated target data access request includes target identification information; and sending the updated target data access request.
[0059] On the other hand, an embodiment of the present application provides a data access method, which is applied to a data storage device, and includes: receiving a target preview request, the target preview request including target preview information, the target preview information being used to indicate the target storage information of the data storage device where the target data accessed by the target data access request of the data access device is located, and the target storage information includes at least a target storage location; according to the target preview information, reading the target data from the storage medium of the data storage device, and storing the target data in a cache of the data storage device, wherein the access speed of the cache is greater than the access speed of the storage medium; upon receiving the target data access request, obtaining the target data from the cache, and sending the target data to the data access device.
[0060] In one embodiment, the target preview request includes a target UFS protocol information unit UPIU carrying an extra header field EHS area, where the EHS area is used to indicate target preview information; or, the target preview request includes a target small computer system interface SCSI command line CMD, where the target SCSI CMD includes a data output area, where the data output area is used to indicate target preview information.
[0061] In one embodiment, the target announcement information further includes target identification information, where the target identification information is used to indicate a target data access request.
[0062] In one embodiment, a target data access request includes: target identification information, and a data storage device includes: a first pre-reading table; the first pre-reading table includes target identification information and a target storage location, and upon receiving a target data access request, obtaining target data from a cache, including: upon receiving a target data access request, determining a target storage location based on the target identification information of the target data access request and the first pre-reading table; obtaining target data from a cache based on the target storage location and a mapping relationship between the target storage location and a storage location in the cache.
[0063] In one embodiment, the data storage device includes: a second pre-reading table; the second pre-reading table includes a target storage location and a storage location of target data in a cache, and upon receiving a target data access request, obtaining the target data from the cache, including: upon receiving a target data access request, determining whether the target data access request hits the second pre-reading table; and obtaining the target data from the cache if the target data access request hits the second pre-reading table.
[0064] In one embodiment, after determining whether the target data access request hits the second pre-reading table, the method further includes: if the target data access request does not hit the second pre-reading table, reading the target data from the storage medium and sending the target data to the data access device.
[0065] When a terminal device is accessing data, there is usually a situation where the access request is blocked due to excessive data that needs to be accessed.
[0066] In order to mitigate the impact of the blocking situation, the accessed memory usually predicts the next access request to be received based on the previous access request, so as to perform data reading in advance.
[0067] However, the memory-based access request prediction method is only applicable to sequential stream access requests. For random stream requests, since there is no correlation between the previous and subsequent access requests in the random stream, the next access request to be received cannot be made based on the previous access request.
[0068] In view of this, an embodiment of the present application provides a data access method, which can be applied to a data access device and a data storage device respectively.
[0069] The data access device can be, for example, a host, which can refer to any type of terminal device such as a mobile phone, wearable device (such as a smart watch, smart bracelet, smart glasses, etc.), tablet computer, laptop computer, vehicle terminal, PC (Personal Computer), etc. These terminal devices have the function of accessing data stored in the memory.
[0070] The data storage device may be, for example, UFS (Universal flash storage), which may be a memory provided in the above-mentioned data access device, or may be a memory provided outside the data access device, and is not specifically limited here.
[0071] If the data storage device is set outside the data access device, access can be achieved through the network; if the data storage device is the internal memory of the data access device, access to the data storage device can be achieved based on sub-units such as the memory driver within the data access device.
[0072] In the embodiment of the present application, the data storage device is explained as an example of an internal memory of a data access device. The software architecture of the data storage device is explained below.
[0073] Figure 1 is a software architecture diagram of the data access device provided in an embodiment of the present application. Please refer to Figure 1. The data access device may include: an application layer 110, a system layer 120, and a kernel layer 130. Among them, the kernel layer 130 may also include: a file system, a block layer, and a driver.
[0074] It should be noted that the application layer 110 may include specific applications for implementing data access in the terminal device, such as camera applications, chat applications, etc.; the system layer 120 may include the operating system used by the terminal device, such as Android system, Windows system, etc.
[0075] Optionally, the data access request can be sent down through the application layer 110, the system layer 120 and the kernel layer 130 in sequence, wherein the kernel layer 130 can perform corresponding processing through the file system and the block layer, and then the driver sends the data access request to the data storage device.
[0076] The software architecture of the data access device is explained above. The hardware structure of the data access device provided in the embodiment of the present application is explained below based on the above software architecture.
[0077] Figure 2 is a hardware structure diagram of the data access device provided in an embodiment of the present application. Please refer to Figure 2. The hardware structure of the data access device may include multiple hardware structures such as a processor 210, driver hardware 220, memory 230, transceiver 240 and scheduler 250.
[0078] Among them, the processor 210 can be a processing chip of the data access device, such as any type of processing chip such as a CPU (Central Processing Unit) or an MCU (Microcontroller Unit). There is no specific limitation here, as long as it can implement the overall control logic. The driving hardware 220 can be a driving unit corresponding to the memory 230, which can realize the driving of the memory 230, that is, realize the driving function in the above-mentioned software architecture. The memory 230 can be any type of storage unit. If the data storage device is an internal memory in the data access device, then the memory 230 can serve as the above-mentioned data storage device.
[0079] The transceiver 240 can send or receive messages to other devices. If the data storage device is an external device of the data access device, the requested transmission can be achieved through the transceiver 240.
[0080] The scheduler 250 may schedule multiple requests, for example, adjusting the order in which the requests are sent and sending the multiple requests in a corresponding order.
[0081] Based on the above software architecture and hardware structure, it is possible to implement the data access device sending an access request to the data storage device.
[0082] In order to more clearly explain the overall process of implementing access request transmission in this application, the specific structure of the data storage device is described below.
[0083] Figure 3 is a hardware structure diagram of the data storage device provided in an embodiment of the present application. Please refer to Figure 3. The data storage device may include: a front end 310, a RAM320 (Random Access Memory), an FTL330 (Flash Translation Layer), a back end 340 and a storage medium 350.
[0084] Among them, the front end 310 can receive the access request sent by the data access device, the RAM 320 can read based on the access request, and parse the reading result to obtain the corresponding physical address, the FTL 330 can query the physical address based on the reading result, and the back end 340 can read data from the corresponding position in the storage medium 350 according to the corresponding physical address, obtain the reading result and return it to the data access device.
[0085] The following further explains the specific implementation process of the data access method provided in the embodiment of the present application based on the above explanation of the software and hardware structure of the data access device and the data storage device.
[0086] FIG4 is a flow chart of a data access method applied to a data access device according to an embodiment of the present application. Referring to FIG4 , the method includes:
[0087] S410: Obtain target forecast information.
[0088] Optionally, the execution subject of the method may be the above-mentioned data access device.
[0089] The preview information may be information for indicating a storage location of target data accessed by the target data access request in a data storage device.
[0090] As an example, the target data access request may be a data access request that is located after the first data access request of the multiple data access requests included in the scheduling queue, thereby enabling a preview of subsequent data access requests. As another example, the target data access request may also be the first data access request. Since the target data access request should be sent to the data storage device later than the target preview information, the later data access request among the multiple data access requests may also be used as the target data access request, for example, the last data access request may be used as the target data access request. In the embodiment of the present application, there is no restriction on the position of the target data access request.
[0091] It should be noted that the scheduling queue can be a queue in the scheduler in the data access device, or it can be a software or hardware queue that sends requests to the device path. The scheduling queue can be a queue that performs scheduling work for multiple data access requests. The scheduling queue can include multiple data access requests, wherein the multiple data access requests will be sent to the driver hardware of the data access device in sequence according to the order in the queue.
[0092] The target data access request may be determined from multiple data access requests. The target data access request may be one data access request or multiple data access requests, without specific limitation. For example, the target data access request may be the last data access request in the scheduling queue.
[0093] Each data access request may be a request for accessing corresponding target data. The target data is stored in a data storage device. Each target data may have a corresponding storage location. The preview information may include information about the storage location of the target data accessed by the data target data access request in the data storage device.
[0094] In one embodiment, there may be a request list in the data access device, and the request list may include multiple access requests. When the data access device needs to obtain data from the data storage device, the corresponding access request can be inserted into the scheduling queue from the request list, and the access request can be issued through the scheduling queue. If the number of access requests that need to be issued is large, it may cause congestion of the scheduling queue, etc. In this case, a target preview request can be obtained from the scheduling queue, wherein the target preview request can include the above-mentioned target preview information, that is, the target preview information for indicating the storage location of the target data accessed by the target data access request in the data storage device can be obtained through the target preview request.
[0095] S420: Send target advance information.
[0096] Optionally, after obtaining the preview information in the above manner, the preview information may be sent to a data storage device. If the data storage device is an internal memory of a data access device, the preview message may be sent to the data storage device via the above driver hardware.
[0097] After receiving the target data access request, the data storage device can read the data and return the corresponding target data to the data access device.
[0098] It should be noted that since the target data access request is a request in the scheduling queue, the target data access request can be read in advance to the data storage device through the target preview information, thereby reducing the transmission pressure of the scheduling queue in the data access device. Moreover, since the preview information is determined based on the target data access request, the preview information has higher accuracy and can also reduce invalid previews of the data storage device.
[0099] In the data access method provided in the embodiment of the present application, target preview information can be obtained and sent, wherein the target preview information is used to indicate the target storage information of the target data accessed by the target data access request in the data storage device, the target storage information at least including the target storage location, and the target data access request is located after the first data access request of at least two data access requests included in the scheduling queue. By means of the target preview information, the data storage device can read data in advance based on the target preview information, thereby accelerating the access request under random flow conditions and reducing the transmission pressure of the scheduling queue in the data access device. Moreover, since the target preview information is sent by the data access device, it has higher accuracy and reduces invalid previews of the data storage device.
[0100] The following explains the specific implementation process of obtaining target preview information for a data access device provided in an embodiment of the present application.
[0101] FIG5 is a schematic diagram of a process for obtaining target prediction information applied to a data access device according to an embodiment of the present application. Referring to FIG5 , obtaining target prediction information includes:
[0102] Obtain target forecast information when a preset condition is met, where the preset condition includes at least one of the following conditions:
[0103] S510: The number of the multiple data access requests included in the scheduling queue is greater than or equal to a waiting threshold.
[0104] It should be noted that the scheduling queue is a queue set in the above-mentioned scheduler. When the data access device needs to obtain one or more data from the data storage device, the data access request can be sent from the request queue to the scheduling queue. The scheduling queue may include multiple data access requests. These access requests can be sorted in the order of input or other orders, and based on the sorting results, each data can be sent to the driver in sequence.
[0105] When the number of data access requests in the scheduling queue is too high, there may be congestion, in which case it can be determined that the preset condition is met.
[0106] For example, if the waiting threshold is 100 data access requests, when the data access requests in the scheduling queue are less than 100, it can be determined that the preset conditions are not met, and the data access requests can be transmitted by issuing the scheduling queue; when the data access requests in the scheduling queue are greater than or equal to 100, it can be determined that the preset conditions are met, and while transmitting the data access requests by issuing the scheduling queue, the target preview information can also be determined and obtained according to the corresponding target data access request.
[0107] It should be noted that there may be multiple preset conditions. The above step is to determine whether the preset conditions are met based on the number of data access requests. In addition to the above method, other methods may also be used, such as:
[0108] S520: The number of random data access requests sent by the data access device is greater than or equal to the access threshold.
[0109] Optionally, the data access request may be a request sent from the request list to the scheduling list by the data access device, wherein the random data access request may be a type of data access request, which means that the correlation between the data access request and the previous data access request is poor, for example: the offset of the storage position of the data accessed by the random data access request and the data accessed by the last sent data access request in the data storage device is greater than or equal to the offset threshold.
[0110] For example: if the data accessed by the data access request sent last time is stored at position A in the data storage device, and the data accessed by the data access request sent this time is stored at position B in the data storage device, if the offset of position A and position B is less than the offset threshold, it can be determined that there is a certain correlation between the two, and the data access request can be a sequential data access request, that is, the data stream composed of such multiple data access requests is a sequential stream; and if the offset of position A and position B is greater than or equal to the offset threshold, it can be determined that the correlation between the two is poor, and the data access request can be a random data access request, that is, the data stream composed of such multiple data access requests is a random stream, and in the embodiment of the present application, prediction can be made for the data stream of the random stream.
[0111] When the number of random data access requests sent by the data access device is greater than or equal to the access threshold, it may cause congestion of the scheduling queue. In this case, it can be determined that the preset condition is met.
[0112] It should be noted that, in actual implementation, only one of the conditions corresponding to S510 and S520 may be satisfied, or the preset condition may be determined to be satisfied when both conditions are satisfied, and no specific limitation is imposed herein.
[0113] In the data access method provided in the embodiment of the present application, target preview information can be obtained when a preset condition is met. The preset condition can be determined to be met when the number of multiple data access requests included in the scheduling queue is greater than or equal to a waiting threshold; or, the preset condition can be determined to be met when the number of random data access requests sent by the data access device is greater than or equal to an access threshold. Acquisition of target preview information when the corresponding preset condition is met can avoid useless data reading on the data storage device side.
[0114] The above explains the conditions for obtaining target notification information. The following explains the conditions for sending target notification information:
[0115] In one embodiment, sending the target advance notice information includes: sending the target advance notice information when the number of sent data access requests is greater than or equal to a sending threshold.
[0116] It should be noted that before sending the target preview information, you can first determine the number of data access requests that have been sent in the scheduling list. If it is greater than or equal to the sending threshold, it can be determined that the scheduling list has issued a part of the data access requests, and then you can send the target preview information; if it is less than the sending threshold, it can be determined that the data access requests issued in the scheduling list are small, and wait until the number of data access requests is greater than or equal to the sending threshold before sending.
[0117] It is understandable that if the data access device sends advance information to the data storage device at a high frequency, the normal operation of data access may not be guaranteed. Therefore, in order to reduce the impact of the advance information on the data access request, the number of data access requests currently sent can be monitored. If the number of data access requests sent is less than a threshold, the advance information can be temporarily not sent. It should be noted that the number of data access requests sent by the data access device is time-limited. For example, the number of data access requests sent within a preset time period can be monitored. Alternatively, a counter can be set. When the count value of the counter reaches a threshold, the count value is cleared and the counting starts again. Of course, other implementation methods can also be included, which are not exemplified here.
[0118] In the case where there are many access requests issued under the scheduling list, target prediction information may be sent, so that the data storage device can read data in advance based on the target prediction information.
[0119] In one embodiment, the data access device includes a prediction queue. After obtaining the target prediction information, the method further includes: generating a target prediction request based on the target prediction information, storing the target prediction request in the prediction queue, wherein the target prediction request includes the target prediction information;
[0120] Correspondingly, sending the target prediction information includes: obtaining and sending a target prediction request from the prediction queue.
[0121] Optionally, the forecast queue can be a queue for generating target forecast requests. The input of the queue can be the target forecast information obtained from the scheduling queue, that is, one of the target data access requests. Then, a target forecast request can be generated based on the target forecast information, and the target forecast request can be stored in the forecast queue. The target forecast requests in the forecast queue are sent to the driver in sequence according to the order in the forecast queue.
[0122] It should be noted that setting up a prediction queue can facilitate the management of multiple target prediction information, so that when there are multiple target prediction information that need to be delivered, the delivery order can be managed.
[0123] In one embodiment, the target notification information further includes target identification information, and the target identification information is used to indicate the target data access request. It is understandable that the target identification information is used to uniquely identify the target access request.
[0124] It should be noted that there are many ways to generate target identification information. For example, each target data access request can be pre-set with a label, for example: a label starting from 0 to N. After generating the target preview information, the above-mentioned target identification information can be obtained according to the label of the target data access request corresponding to the target preview information.
[0125] Alternatively, corresponding identification information may be generated based on partial information in the access request, such as partial fields, using a hash algorithm or other methods.
[0126] Alternatively, after obtaining the target preview information, a label can be generated, and the correspondence between the label and the target preview information and its corresponding target data access request can be recorded. In the subsequent process of sending the target data access request, the corresponding label can also be added to the target data access request, thereby facilitating the data storage device side to more quickly and conveniently determine the relationship between each target preview request and the target data access request.
[0127] In the data access method provided in the embodiment of the present application, the data storage device can more quickly determine the correspondence between each target data access request and the target preview information by setting the target identification information, so that the target data can be returned more quickly and the return efficiency can be improved.
[0128] In order to more clearly explain the transmission process of the target prediction information in the data access method provided in this application, the specific implementation process of the data access device transmitting the target prediction information to the data storage device is explained in detail below.
[0129] Figure 6 is a schematic diagram of the overall process of transmitting target preview information from a data access device to a data storage device provided in an embodiment of the present application. Please refer to Figure 6, wherein the data access device may include: a request list, a scheduling list, and a preview list. In addition, there are also a memory drive unit, a hardware queue, and a host controller interface (HCI).
[0130] Among them, multiple data access requests can be stored in the request list. When the data access device needs to obtain data in the data storage device, it can call the corresponding data access request from the request list and send the data access request to the scheduling list. The scheduling list can send multiple data access requests in sequence to the drive unit of the memory.
[0131] In addition, the target preview information can be obtained based on any one or more data access requests after the first data access request in the scheduling list, and the target preview information can be sent to the preview list. The preview list can obtain the target preview request based on the target preview information, and can send the target preview request to the drive unit of the memory. The drive unit of the memory can send the target preview request to the data storage device through the hardware queue and HCI in turn.
[0132] It should be noted that the drive unit of the memory can receive data access requests and target notification requests, and these requests can be sent to the data storage device through the hardware queue and HCI.
[0133] The following explains the specific transmission format corresponding to the target preview request in the embodiment of the present application based on the above-mentioned overall transmission path.
[0134] In one embodiment, the data storage device is a universal flash memory UFS, and a target preview request is generated according to the target preview information, including: generating a target UFS protocol information unit UPIU carrying an extra header field EHS (Extra Header Segments) area according to the target preview information, the EHS area is used to indicate the target preview information, and the target UPIU is a target preview request.
[0135] It should be noted that the target UPIU refers to an instruction in the UPIU format, that is, the target preview request can be an instruction transmitted in the UPIU format, wherein the UPIU (UFS Protocol Information Unit) may include multiple areas, and the EHS area is one of them.
[0136] It should be noted that the UPIU can be a pre-existing request in the storage area driver unit, which is a request generated by the upper-layer application of the host. The method adopted in this embodiment is to modify the content of the EHS area in the UPIU to achieve the effect of adding target preview information, that is, the EHS area in the existing UPIU can be modified to obtain the target UPIU, which can be used as a target preview request.
[0137] The EHS region may indicate the target advance information. In one embodiment, the EHS region includes an EHS data header and an EHS data area.
[0138] Table 1 is the general field format of the EHS format, please refer to Table 1:
[0139] Table 1
[0140] The area from 0 to 3 is the EHS data header, and the area from 4 to (32×bLength)-1 is the EHS data area.
[0141] It should be noted that the bLength field is a specified field in the UFS4.0 protocol. bLength*32 equals the total byte size of the EHS area. The EHS area size must be aligned to an integer multiple of 32 bytes.
[0142] The bEHSType field is a customized field whose value can be set arbitrarily within the range specified by the UFS4.0 protocol (80h-FFh), but cannot be the same as the value of the Advanced RPMB function (01h). The following is a reference for usage:
[0143] Method 1: Use different values to distinguish whether the transmitted content is "logical address + read length" or only the logical address (only the logical address can be used in 4K random read scenarios, and omitting the read length can increase the amount of preview information).
[0144] Method 2: Use different values to identify whether the "logical address + read length" is repeated or in order.
[0145] Method 3: Used for the host to control the concurrent behavior of device pre-reading: For example, if the device maintains four pre-reading queues, the host can specify the new pre-reading content and put it into the pre-reading queue through different bEHSType values to achieve load balancing.
[0146] The EHS data header includes a preview quantity field and a preview content field. The preview quantity field is used to indicate the quantity of target preview information, and the preview content field is used to indicate the information type to which the target storage information belongs. The information type includes at least the storage location type. The EHS data area includes the target storage information.
[0147] Table 2 shows the EHS fields used in the embodiments of this application. Please refer to Table 2:
[0148] Table 2
[0149] Among them, the contents represented by areas 0 and 1 are the same and will not be explained again here. Area 2 represents the preview quantity field, and area 3 represents the preview content field.
[0150] The foreshow number field foreshow len is used to indicate the quantity of target foreshow information, for example, it may be the number of “logical address + read length” transmitted after the EHS data header.
[0151] The foreshow lun field is used to indicate the information type to which the storage information belongs, for example, it may be the logical unit to which the "logical address + read length" transmitted after the EHS data header belongs.
[0152] The EHS data area includes storage information, LBA is the logical address, and TRANSFER LENGTH is the read length.
[0153] It should be noted that the UFS4.0 protocol requires that the length of the EHS area be identified in the UPIU. Therefore, the host side also needs to modify the UTP transfer request descriptor in the HCI and the total EHS length field in the UPIU. The result of the modification needs to be consistent with the bLength of the EHS area.
[0154] It should be noted that the target identification information can be a tag number, for example, a tag consisting of 0-N numbers, each tag is used to uniquely identify a target data access request. In addition, the target identification information can also record the status of the target data access request, such as whether it has been notified.
[0155] Table 3 is another feasible EHS field used in the embodiment of the present application, please refer to Table 3:
[0156] Table 3
[0157] It should be noted that the Tag can be stored in the EHS data area in the form of a first identification field, wherein the first identification field is used to indicate target identification information.
[0158] Among them, Tag can be used as target identification information, such as any number from 0 to N to represent the corresponding tag. Except for Tag, other contents are the same as those shown in Table 2 and are not repeated here.
[0159] In one embodiment, before sending the target preview information, the method further includes: generating a UTP transmission request descriptor UTRD according to the target preview information, the UTRD including a total EHS length field, and the total EHS length field included in the UTRD has the same value as the length field in the EHS data header.
[0160] It should be noted that when the host sends the target preview request to the HCI, the HCI will convert the target preview request into the form of UTRD and store it in the hardware queue. The format of UTRD is as shown in Table 4, and the UTP transmission request descriptor therein needs to be modified.
[0161] Table 4
[0162] It should be noted that Table 4 may record multiple related information, such as information Command Type indicating the request type, information DUNL (data unit number lower) indicating that the number of data units is reduced, and information Total_EHS_Length indicating the area length.
[0163] Among them, Total_EHS_Length can be modified to be the same as the value of the length field bLength in the EHS data header.
[0164] In one embodiment, the EHS data header further includes a length field, and the UPIU includes a total EHS length field. The total EHS length field included in the UPIU has the same value as the length field in the EHS data header.
[0165] It should be noted that when the HCI sends the target notification request to the data storage device, it is sent in the form of UPIU. The total EHS length field in the UPIU needs to be modified to inform the data storage device. Among them, the UPIU can include the content included in Table 5, please refer to Table 5:
[0166] Table 5
[0167] It should be noted that Table 5 can record multiple related information, such as: information indicating the business type Transaction Type, information indicating the identifier Flags, information indicating the logical unit number LUN, information indicating the task tag Task Tag, information indicating the response status Response, and Total_EHS_Length indicating the area length, etc.
[0168] Among them, Total_EHS_Length can be modified to be the same as the value of the length field bLength in the EHS data header.
[0169] In one embodiment, the preview queue includes at least two, each preview queue is used to store the preview request, the EHS data header also includes a preview type field, the preview type field is used to indicate that the target preview request is stored in one of the at least two preview queues, and storing the target preview request in the preview queue includes: storing the target preview request in the preview queue indicated by the preview type field.
[0170] It should be noted that the preview queue may include multiple ones, for example, two or three, and there is no specific limitation here. Each preview queue may store one or more types of target preview requests. The EHS data header also includes a preview type field, such as the bEHSType field in Table 2 above. The preview queue in which the target preview request is placed can be determined based on the preview type field in the EHS data header in each target preview request.
[0171] For example: the first preview queue supports type 1, and the second preview queue supports type 2. The type of each target preview request can be determined based on the above-mentioned preview type field. If it is type 1, it can be stored in the first preview queue; if it is type 2, it can be stored in the second preview queue.
[0172] In addition to using the EHS field to send the target announcement information, other methods can also be used to send the target announcement information.
[0173] For example, a customized SCSI CMD+data output can be used to transmit target announcement information.
[0174] In one embodiment, the data storage device is a universal flash memory UFS, and a target notice request is generated according to the target notice information, including: generating a target small computer system interface SCSI command line CMD according to the target notice information, the target SCSI CMD including a data output area, and the data output area is used to indicate the target notice information.
[0175] It should be noted that the target SCSI CMD including the data output area can be of various types, for example, a WRITE BUFFER CMD type or a WRITE10 CMD type.
[0176] The specific implementations of these two types of data-carrying output areas are explained below.
[0177] Table 6 shows the SCSI CMD type of WRITE BUFFER CMD that includes the data output area. Please refer to Table 6:
[0178] Table 6
[0179] Among them, it may include information OPERATION CODE used to represent the operation code, information BUFFER ID representing the buffer identifier, information BUFFER OFFSET representing the buffer offset, information PARAMETER LIST LENGTH representing the parameter list length, information CONTROL representing the control instruction, and fields Reserved and MODE that can be used for custom settings.
[0180] The fields Reserved and MODE used for custom settings can be used to carry data output DATA OUT, that is, a data output area for indicating target preview information.
[0181] Table 7 shows the SCSI CMD type of WRITE10 CMD including the data output area. Please refer to Table 7:
[0182] Table 7
[0183] Among them, it may include information OPERATION CODE used to represent the operation code, information WRPROTECT used to represent the write protection, information LOGICAL BLOCK ADDRESS used to represent the logical block address, information TRANSFER LENGTH used to represent the transfer length, information CONTROL used to represent the control instruction, and fields Reserved and GROUP NUMBER that can be used for custom settings.
[0184] The fields Reserved and GROUP NUMBER used for custom settings can be used to carry data output DATA OUT, that is, a data output area for indicating target preview information.
[0185] The following explains the information that the above data output area can carry. For details, please refer to Table 8:
[0186] Table 8
[0187] It should be noted that the data output area DATA OUT may include the total number of the above-mentioned "logical address + read length", LUN, function type and other information as well as each logical address and the corresponding read length.
[0188] In one embodiment, the data output area includes: a second identification field, and the second identification field is used for target identification information.
[0189] In one embodiment, if the content sent in Table 8 includes target identification information, the content in Table 8 may also be expressed in the manner of Table 9. Please refer to Table 9:
[0190] Table 9
[0191] In other words, the last two digits of 20-23, which originally recorded the read length 1, can become the target identification information tag 1. The target identification information tag can be the TAG field explained above. Correspondingly, the last two digits of 28-31, which originally recorded the read length 2, can also become the target identification information tag 2.
[0192] It should be noted that, in actual implementation, any one of the methods in Table 8 or Table 9 can be selected according to actual needs to implement the setting of the information that the data output area can carry, and no specific limitation is made here.
[0193] It should be noted that the first identification field and the second identification field may be fields with the same content, the only difference being that the first identification field is set in the EHS area, while the second identification field is set in the data output area.
[0194] Optionally, for a data storage device that does not support receiving the EHS format, the data access device may use the customized SCSI CMD method to implement the transmission of target preview information. The SCSI CMD may be an additional request, not a request generated by an upper-layer application of the data access device.
[0195] In other words, the EHS-based method appends the EHS field to the end of an existing request in the memory driver unit and modifies the EHS length field of the existing request; while the customized SCSI CMD method generates a new request that is not transmitted from the upper layer.
[0196] You can choose to use any of these methods to transmit target preview information based on actual needs.
[0197] It should be noted that when using a customized SCSI CMD to send the preview information, multiple preview queues can also be set for the CMD. The data access device can determine which preview queue of the multiple preview queues needs to be placed according to preset conditions. For example, the preset condition can be determined based on the upper limit of the number of CMDs that the preview queue can accommodate. When the number of CMDs in a certain preview queue reaches the upper limit, the newly generated CMD needs to be placed in other preview queues. Alternatively, the preset condition can be determined based on the attributes of the target data access request corresponding to the preview information. The attributes can include the type of data accessed by the target data access request, the application type corresponding to the target data access request, etc. Alternatively, the existing fields in the CMD can be reused to indicate the information of the preview queue that needs to be placed through the existing fields, or a new field can be added to the CMD to indicate the information of the preview queue that needs to be placed. The embodiments of the present application do not limit this.
[0198] In one embodiment, the sending priority of the SCSI CMD is higher than the sending priority of the data access request.
[0199] It should be noted that after determining the target preview request, the data requesting device can generate a SCSI CMD, which can be in the aforementioned WriteBuffer CMD or Write10 CMD format. This SCSI CMD does not need to pass through the block layer and can be initiated directly from the memory driver unit. Because this request does not pass through the block layer scheduler, that is, it does not pass through the scheduling queue, it must be sent first to ensure that the target preview information is delivered to the data storage device in a timely manner. In other words, the data storage device must receive the SCSI CMD first. Therefore, the sending priority of the SCSI CMD is higher than the sending priority of the data access request.
[0200] In order to more clearly explain the specific process of obtaining a target forecast request and sending a target forecast request provided in the embodiment of the present application, the process of obtaining a target forecast request and sending a target forecast request is explained below in the case where there is one forecast queue and multiple forecast queues respectively.
[0201] First, let's explain one example implementation process of obtaining a target preview request when there is a preview queue.
[0202] FIG7 is a flow chart of one of the steps of obtaining a target preview request provided in an embodiment of the present application. Referring to FIG7 , the method includes:
[0203] S710: Determine whether a preset condition is met.
[0204] It should be noted that the above preset condition may be that the number of multiple data access requests included in the scheduling queue is greater than or equal to the waiting threshold, and / or the number of random data access requests sent by the data access device is greater than or equal to the access threshold.
[0205] If so, S720: Generate a target preview request based on the data access request to be inserted into the scheduling queue, and insert the target preview request into the preview queue.
[0206] S730: Determine whether the number of target preview requests is greater than or equal to a first threshold. If so, stop determining the target preview requests; if not, continue inserting the target preview requests into the preview queue.
[0207] It should be noted that, when the number of transmitted target preview requests exceeds a first threshold, it means that a large number of preview requests have been sent to the data storage device, and the determination of the target preview requests may be stopped.
[0208] Next, an example implementation process of sending a target preview request when there is a preview queue is explained.
[0209] FIG8 is a schematic diagram of a process for sending a target notification request according to an embodiment of the present application. Referring to FIG8 , the method includes:
[0210] S810: Whether the target preview request is confirmed.
[0211] If yes, S820: Send the target preview request to the drive unit of the memory.
[0212] S830: Determine whether the number of data access requests sent in the scheduling queue is greater than or equal to the sending threshold. If not, stop sending the target notification request.
[0213] If yes, S840: instruct the drive unit of the memory to issue a target preview request.
[0214] It should be noted that S710-S730 and S810-S840 are transmission methods for sending target announcement requests when there is a announcement queue. The specific implementation process has been explained above and will not be repeated here.
[0215] In addition, it should be noted that for data access requests that have been announced, the data access request can be marked. After the data access request is sent to the data storage device, it can be determined based on the mark that a notice has been made, so that the data reading result can be determined more quickly.
[0216] It should be noted that the contents shown in Figures 7 and 8 are the process of using a single preview queue to issue target preview requests. In this case, due to the existence of the scheduling queue in the data access device, the order of data access requests received by the data storage device may be different from the order in the target preview request process. In this case, the firmware processing logic of the data storage device will be more complicated, and the processing logic of the data access device will become simpler.
[0217] The following explains an example implementation process of obtaining a target preview request when there are multiple preview queues.
[0218] FIG9 is another flowchart of obtaining a target preview request provided in an embodiment of the present application. Referring to FIG9 , the method includes:
[0219] S910: Determine whether a preset condition is met.
[0220] It should be noted that this preset condition is the same as the aforementioned preset condition and will not be described in detail here.
[0221] If so, S920: Generate a target preview request based on the data access request to be inserted into the scheduling queue, and insert the target preview request into the preview queue corresponding to the request type according to the request type of the target preview request.
[0222] It should be noted that, for multiple prediction queues, each prediction queue can insert a target prediction request of a corresponding type, and can be inserted into a corresponding prediction sequence based on the type of each target prediction request.
[0223] S930: Determine whether the number of target prediction requests in any prediction queue is greater than or equal to a second threshold. If so, stop determining the target prediction requests; if not, continue inserting the target prediction requests into the corresponding prediction queue.
[0224] It should be noted that if the number of target preview requests in any preview queue is greater than or equal to the second threshold, the determination of the target preview request can be stopped; correspondingly, if the number of target preview requests in all preview queues is less than the second threshold, the target preview request can continue to be inserted into the corresponding preview queue.
[0225] The following explains an example implementation process of sending a target preview request when there are multiple preview queues.
[0226] FIG10 is another flowchart of sending a target notification request according to an embodiment of the present application. Referring to FIG10 , the method includes:
[0227] S1010: Whether to classify target preview requests according to the types of each preview queue.
[0228] If yes, S1020: Send the target advance notice request to the drive unit of the memory.
[0229] S830: Determine whether the number of data access requests sent in the scheduling queue is greater than or equal to the sending threshold. If not, stop sending the target notification request.
[0230] If yes, S840: instruct the drive unit of the memory to issue a target preview request.
[0231] It should be noted that S910-S930 and S1010-S1040 are transmission methods for sending target announcement requests when there are multiple announcement queues. The specific implementation process has been explained above and will not be repeated here.
[0232] It should be noted that the contents shown in Figures 9 and 10 are the process of issuing target preview requests using multiple preview queues. In this case, requests belonging to the same hardware queue can be packaged into the EHS area of the target preview request in the same preview queue, and the hardware queue number can be mapped into bEHSType in the EHS data header. In addition, for the target data access request, the data access device can modify the group number field in the UPIU of the request to make it the same as the hardware queue mapping number written into bEHSType, thereby making the firmware processing logic of the data storage device simpler.
[0233] In one embodiment, the data access device can update each target data access request to be sent to the data storage device. Table 10 shows the content that can be carried in the updated target data access request. Please refer to Table 10:
[0234] Table 10
[0235] Among them, the Reserved in the second row and the Reserved and GROUP NUMBER in the fourth row in Table 10 can be used as target identification information.
[0236] Among them, the Reserved field in the second line can be a reserved field of the UFS protocol, used for placeholder and alignment. In the embodiment of the present application, this field can be used to identify whether the data access request has been announced. For example, it can be binary coded, 0 indicates that the target data access request has been announced, and 1 indicates that the target data access request has not been announced. The Reserved and GROUP NUMBER in the fourth line can be combined to record an index number, which can be used to store the TAG field explained above, or other information that needs to be recorded, such as the queue number, without specific limitation. Except for the Reserved and GROUP NUMBER, the other content maintains the original content of the target data access request without change.
[0237] The method comprises: updating a target data access request, obtaining an updated target data access request, wherein the updated target data access request comprises target identification information; and sending the updated target data access request.
[0238] It should be noted that before sending the target data access request, the target data access request can be updated by modifying a field in the target data access request, such as the field corresponding to the above-mentioned target identification information, and then the target data access request including the target identification information can be sent to the data storage device.
[0239] Among them, the target data access request can be updated after it is generated, and different target data access requests can be recorded based on pre-configured fields, that is, the corresponding target identification information can be recorded. If this method is adopted, the corresponding target identification information can be added to the target identification information corresponding to the target data access request later.
[0240] Alternatively, before sending the target access request to the data storage device, the target data access request can be updated by adding target identification information to the target data access request. If this method is adopted, the added target identification information needs to be the target identification information used in the target identification information corresponding to the target data access request.
[0241] The above explains the various steps performed on the data access device side. After receiving the target preview information, the data storage device will also perform the corresponding steps. The following explains the specific implementation process of the data access method applied to the data storage device provided in the embodiment of the present application.
[0242] FIG11 is a flow chart of a data access method applied to a data storage device provided in an embodiment of the present application. Referring to FIG11 , the method includes:
[0243] S1110: Receive a target preview request.
[0244] The target prediction request includes target prediction information, which is used to indicate target storage information of the target data accessed by the target data access request of the data access device in the data storage device, and the target storage information includes at least a target storage location.
[0245] Optionally, the execution subject of the method may be the above-mentioned data storage device, and the data storage device may receive a target prediction request issued by the data access device, where the target prediction request includes target prediction information.
[0246] In one embodiment, the target preview request includes a target UFS protocol information unit UPIU carrying an extra header field EHS area, where the EHS area is used to indicate target preview information; or, the target preview request includes a target small computer system interface SCSI command line CMD, where the target SCSI CMD includes a data output area, where the data output area is used to indicate target preview information.
[0247] The target notice information may indicate target storage information of the target data accessed by the target data access request of the data access device in the data storage device, and may include, for example, a logical address of the target data.
[0248] The data storage device can determine the physical address where the target data is actually stored based on the target storage information, and can read the target data in the physical address.
[0249] S1120: Read target data from a storage medium of the data storage device according to the target preview information, and store the target data in a cache of the data storage device.
[0250] The access speed of the cache is greater than the access speed of the storage medium.
[0251] Optionally, after the data storage device obtains the target preview information, it can determine the corresponding physical address based on the logical address, that is, the location in the storage medium, and then read the target data from the storage medium. After obtaining the target data, the target data can be stored in a cache, which can be in the RAM of the data storage device.
[0252] It should be noted that, before a target data access request is obtained, the target data may be stored in the cache of the data storage device.
[0253] S1130: When a target data access request is received, the target data is obtained from the cache and sent to the data access device.
[0254] Among them, the received target data access request may be announced or not, and further judgment can be used to determine whether the target data access request has been announced. If so, the target data can be obtained from the cache and sent to the data access device.
[0255] It should be noted that the data access device may issue an access request to the target data through the drive unit of the memory. The access request to the target data is also an access request to generate the target preview information in the data access device.
[0256] It should be noted that each time the data storage device obtains a data access request, it can determine whether it is a target data access request that has been predicted. If so, and the data storage device has successfully completed the pre-reading, the target data can be obtained from the cache and sent to the data access device; if not, or the data storage device has not completed the pre-reading, the target data can be obtained from the storage medium and sent to the data access device.
[0257] Among them, in the actual implementation process, due to insufficient resources of the data storage device, the target preview request is received but no pre-reading work is done. Therefore, in addition to determining whether the target data access request is a preview request, it is also necessary to determine whether the data storage device has successfully completed the pre-reading.
[0258] Optionally, the data storage device can determine whether the target data access request is a pre-announced target data access request through the reserved field in the target data access request, and can determine whether the data has been pre-read by the data storage device itself by searching the pre-read table, that is, whether the corresponding target data is stored in the cache.
[0259] For example, if the reserved field indicates that the target data access request has been predicted, it can be determined that the data storage device has received a target prediction request corresponding to the target data access request before the target data access request is sent.
[0260] In the actual implementation process, for example, the reserved field in the target data access request can be used to determine whether it is a target data access request. If it is a target data access request, the pre-reading table can be searched according to the further instructions of Reserved+Group number in the fourth row, which can reduce the extra consumption of unnecessary pre-reading table searches.
[0261] In the data access method provided in the embodiment of the present application, a data storage device can receive a target prediction request, and based on the target prediction information, read the target data from the storage medium of the data storage device, and store the target data in the cache of the data storage device; when a target data access request is received, the target data is obtained from the cache and sent to the data access device. The target data can be transferred from the storage medium to the cache in advance through the target prediction request. Since the access speed of the cache is greater than the access speed of the storage medium, after receiving the target data access request, the target data can be returned to the data access device more quickly, thereby improving the efficiency of returning the target data. Moreover, since the target prediction request is generated by the data access device based on the target data access request, it also has high accuracy, reducing invalid predictions of the data storage device.
[0262] In one embodiment, the target announcement information includes: target identification information, where the target identification information is used to indicate a target data access request.
[0263] In one embodiment, a data storage device includes a first pre-read table, wherein the first pre-read table includes target identification information and a target storage address. Upon receiving a target data access request, the device retrieves the target data from a cache, including: upon receiving the target data access request, determining a target storage location based on the target identification information in the target data access request and the first pre-read table; and retrieving the target data from the cache based on the target storage location and a mapping relationship between the target storage location and a storage location in the cache.
[0264] Among them, the target storage address can be a logical address stored in the target storage information in the above-mentioned target data request instruction. In the actual implementation process, a first pre-reading table can be established first, so that based on the mapping relationship between the target identification information and the target storage address in the first pre-reading table, the target storage address corresponding to the target identification information can be determined more quickly, and then the target data can be read from the target storage address and stored in the storage location in the cache.
[0265] It should be noted that the target storage location of each target data can be determined according to the target identification information in the above manner. For example, after receiving the target pre-notification request, a first pre-reading table can be established, and after the first pre-reading table is established, data can be read at the corresponding logical address. The first pre-reading table may include relevant information such as the tag number and the logical address. The first pre-reading table can be specifically represented as shown in Table 11. Please refer to Table 11:
[0266] Table 11
[0267] Among them, the tag number can be the target identification information, for example, it can be the same as the aforementioned TAG, and can be any non-repeating label from 0 to N; the logical address can be the target storage address obtained and filled in from the target storage information in the target preview request. In addition to the above two information, other information such as the reading length can also be recorded, and no specific restrictions are made here.
[0268] Accordingly, obtaining target data from the cache and sending the target data to the data access device includes: upon receiving a target data access request, obtaining the target data from the cache according to the target identification information of the target data access request and the first pre-reading table.
[0269] It should be noted that, after receiving a target data access request, the data storage device may obtain the target data from a corresponding position in the cache according to the first pre-read table and send the target data to the data access device.
[0270] In the data access method provided in the embodiment of the present application, the speed of searching the pre-reading table can be made faster by setting a label number column in the first pre-reading table.
[0271] In one embodiment, the method further includes: upon receiving a target data access request, determining whether the target data access request is a predicted target data access request based on target identification information of the target data access request.
[0272] It should be noted that, in addition to the TAG that can record the tag number, the target identification information also includes status information that records whether the target storage data corresponding to the target identification information has been announced.
[0273] After receiving a target data access request, the data storage device can determine whether the target data access request has been pre-announced based on the status information in the target identification information in the target data access request. If so, the target data can be obtained by querying the pre-reading table as mentioned above; if not, the target data can be read from the storage medium and sent to the data access device.
[0274] It should be noted that the above implementation process is the implementation process adopted when the target identification information exists. In the actual implementation process, if the target identification information does not exist, other methods can also be used to obtain the target data. The specific methods are as follows:
[0275] When a target data access request is received, the target data is obtained from the cache, including: when a target data access request is received, determining whether the target data access request hits a second pre-reading table; when the target data access request hits the second pre-reading table, obtaining the target data from the cache.
[0276] The data storage device includes: a second pre-reading table; the second pre-reading table includes a target storage location and a corresponding location of the target data in the cache.
[0277] In one embodiment, the target storage location includes a target logical address, and the corresponding position of the target data in the cache may be, for example, a target physical address. After receiving the target preview information, the method further includes: determining a target physical address corresponding to the target logical address; and establishing a second pre-reading table based on the target logical address and the target physical address.
[0278] It should be noted that the second pre-reading table can be stored in the RAM in the data storage device. After obtaining the target preview information, the data storage device can determine the corresponding physical address based on the target logical address in the target preview information. If the physical address can be accessed normally, the target data in the physical address can be read and stored in the target physical address in the cache.
[0279] After determining the target physical address of the target data, the target logical address and the target physical address of the target data can be stored in the second pre-read table, wherein the target logical address is the target storage address, and the target physical address is the storage location of the target data in the cache.
[0280] It should be noted that if the host performs an operation that affects data content, such as overwriting or erasing the same logical address, but the pre-read information arrives before the overwrite request and the read request arrives after the overwrite request, the target pre-read information will be read inaccurately. To avoid this, the physical address is added to the second pre-read table. The data storage device can determine the reliability of the data by comparing the physical address when reading the target pre-read information with the physical address when the target data access request arrives.
[0281] It should be noted that after receiving the target data access request, it may be determined based on the target logical address in the target data access request whether the multiple target logical addresses recorded in the second pre-reading table are hit.
[0282] If it hits, it can be determined that the target data exists in the cache; if it misses, it can be determined that the target data does not exist in the cache.
[0283] It should be noted that there may be a situation where the logical address of the second pre-read table is hit, but the physical address changes due to overwriting or other reasons. In this case, it is also necessary to read the target data from the storage medium again.
[0284] Optionally, when there is target data in the cache, the target data may be read from the cache according to the corresponding target physical address in the second pre-reading table.
[0285] In one embodiment, after determining whether the target data access request hits the second pre-reading table, the method further includes: if the target data access request does not hit the second pre-reading table, reading the target data from the storage medium and sending the target data to the data access device.
[0286] It should be noted that if the target data access request does not hit the second pre-read table, it can be determined that the target data corresponding to the target data access request does not exist in the cache, and the target data can be read from the storage medium and sent to the data access device.
[0287] The following further explains the overall implementation process of the data access method provided in the embodiment of the present application executed in the data storage device based on the structure of the data storage device provided in Figure 3.
[0288] Figure 12 is a schematic diagram of the overall process of returning data in the data storage device provided in an embodiment of the present application. Please refer to Figure 12. The process includes two parts, wherein the left sub-figure of Figure 12 represents the processing performed after receiving the target preview request, and the right sub-figure of Figure 12 represents the processing performed after receiving the data access request after a period of time. The specific implementation process is as follows.
[0289] After receiving the target preview request: the front end receives the target preview request and reads the target preview information therein through the RAM to determine the logical address, logical unit number, read length and other information of the target preview information, thereby parsing the data access request. The FTL determines the physical address from the storage medium according to the logical address, and transfers the target data from the storage medium to the cache in the RAM. A second pre-reading table can be established based on the logical address of the target preview information and the physical address of the target data in the cache. The second pre-reading table is also stored in the RAM.
[0290] After receiving the data access request: the front end receives the data access request and reads the data access request through the RAM to determine the logical address, logical unit number, read length and other information of the data access request, thereby parsing the data access request. The FTL searches the second pre-read table stored in the RAM to determine whether the logical address of the data access request hits the second pre-read table. If so, the target data is read from the cache in the RAM and returned to the data access device; if not, the FTL determines the physical address based on the logical address, reads the target data from the storage medium, and returns the target data to the data access device.
[0291] It should be noted that the above-mentioned first pre-reading table and the second pre-reading table can be two pre-reading tables with different contents. The first pre-reading table is a pre-reading table used to establish a correspondence between the target identification information and the target logical address, and the second pre-reading table is a pre-reading table used to establish a correspondence between the target logical address and the target physical address. The two are two different pre-reading tables. In the actual implementation process, any one of the pre-reading tables can be maintained, or both pre-reading tables can be maintained at the same time. There is no specific restriction here.
[0292] In the actual implementation process, if only the second pre-reading table is used, after determining the target logical address of the target data access request, the target physical address can be determined based on the second pre-reading table, so that the target data can be read at the target physical address; if the first pre-reading table and the second pre-reading table are used at the same time, the target storage location corresponding to the target data access request can be first determined based on the target identification information and the first pre-reading table, and then the target physical address corresponding to the target storage location can be determined based on the second pre-reading table, so that the target data can be read at the target physical address.
[0293] It should be noted that any of the above two methods can be used to read the target data, and no specific limitation is given here.
[0294] The following is an explanation of one implementation process of the interaction between the data access device and the data storage device provided in the embodiment of the present application. In this process, the data access device issues a target data access request immediately after issuing a target notification request.
[0295] FIG13 is a schematic diagram of the interaction between the data access device and the data storage device provided in an embodiment of the present application. Referring to FIG13 , the method includes:
[0296] The data access device sends a target preview request to the data storage device, and the data storage device stores the target data in the cache according to the target preview request. The data access device sends a target data access request to the data storage device, and the data storage device returns the target data from the cache to the data storage device according to the target data access request.
[0297] It should be noted that if the data access request sent by the data access device to the data storage device is a target data access request, the target data can be returned more quickly from the cache.
[0298] Another implementation process of interaction between the data access device and the data storage device provided in the embodiment of the present application is explained below. In this process, after the data access device issues a target notification request, it also issues other data access requests, and then issues a target data access request.
[0299] FIG14 is another schematic diagram of interaction between a data access device and a data storage device provided in an embodiment of the present application. Referring to FIG14 , the method includes:
[0300] The data access device sends a target preview request to the data storage device, and the data access device sends other data access requests to the data storage device. The data storage device stores the target data into the cache according to the target preview request during the idle period of receiving other data access requests. After a period of time, the data access device sends a target data access request to the data storage device, and the data storage device returns the target data from the cache to the data storage device according to the target data access request.
[0301] It should be noted that if the data storage device can select a corresponding idle time period based on actual operating needs and store the target data into the cache based on the target preview request during the corresponding idle time period, the processing pressure of the data storage device can be appropriately reduced.
[0302] In one embodiment, since the data storage device and the data access device only have the function of transmitting data access requests, if the function of transmitting advance notice requests is to be added, a corresponding interaction design can be added.
[0303] Table 12 shows the memory identification values. New identification values can be added. Please refer to Table 12:
[0304] Table 12
[0305] Among them, 0Ch can be an identifier that the data storage device can work in the pre-read mode, that is, the specific implementation process of using the above steps S1110-S1130 to return the target data.
[0306] Table 13 indicates whether the device supports pre-reading. New pre-reading descriptors can be added. Please refer to Table 13:
[0307] Table 13
[0308] The identifier of the pre-announcement descriptor is 00h, the corresponding length is 1, the corresponding name is bLength, the corresponding value is a specific value, and the corresponding description is as follows:
[0309] bit[0]: Firmware update status; bit[1]: Production status; bit[2]: Device life status; bit[3]: Refresh operation; bit[4]: Overtemperature; bit[5]: Undertemperature; bit[6]: Extended temperature; bit[7]: Extended specification; bit[8]: Write enhancer; bit[9]: Performance limit; bit
[0010] : Advanced limit; bits[11-13]: Reserved information; bit
[0014] : Obstacle information; bit
[0015] : Clear error history function; bit
[0016] : Export information; bit
[0017] : File optimization extended specification; bit
[0018] : Copy command; bit
[0019] : Pre-read function; bits[20-31]: Reserved information.
[0310] Among them, whether the memory supports pre-reading can be determined based on bit
[0019] : pre-reading function, for example: 1 means support, 0 means no support.
[0311] It should be noted that the pre-reading function means that the data storage device can parse and read the corresponding results based on the received target preview information.
[0312] Table 14 shows a more detailed descriptor of the device, please refer to Table 14:
[0313] Table 14
[0314] Among them, for the descriptor identified as 00h, the length is 1, the name is bLength, the value is 07h, and the corresponding description is the size of the descriptor; for the descriptor identified as 01h, the length is 1, the name is DescriptorIDN, the value is 0Ch, and the corresponding description is the pre-read mode descriptor; for the descriptor identified as 03h, the length is 2, the name is wVersion, the value is 0100h, and the corresponding description is the pre-read version; for the descriptor identified as 04h, the length is 1, the name is bPreReadType, the value is a specific value, and the corresponding description is the transmission mode; for the descriptor identified as 05h, the length is 1, the name is bMaxTag, the value is a specific value, and the corresponding description is the maximum tag number identified; for the descriptor identified as 06h, the length is 1, the name is bMaxEHSLength, the value is a specific value, and the corresponding description is the maximum EHS length.
[0315] It should be noted that after the descriptors and identification values are defined based on the above method, the data access device and the data storage device can realize the transmission of the target preview request.
[0316] It should be understood that, although the steps in the above-mentioned flowcharts are shown in sequence according to the instructions of the arrows, these steps are not necessarily performed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be performed in other orders. Moreover, at least a portion of the steps in the above-mentioned flowcharts may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily performed at the same time, but can be performed at different times, and the execution order of these sub-steps or stages is not necessarily to be performed in sequence, but can be performed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
[0317] Based on the foregoing embodiments, the embodiments of the present application provide a data access device and a data storage device, which include the modules included and the units included in each module, and can be implemented by a processor; of course, it can also be implemented by a specific logic circuit; in the implementation process, the processor can be a central processing unit (CPU), a microprocessor (MPU), a digital signal processor (DSP) or a field programmable gate array (FPGA), etc.
[0318] FIG15 is a structural diagram of a data access device provided in an embodiment of the present application. Referring to FIG15 , the data access device includes: an acquisition module 1510 and a sending module 1520;
[0319] An acquisition module 1510 is configured to acquire target prediction information, where the target prediction information indicates target storage information of target data accessed by the target data access request in a data storage device, where the target storage information includes at least a target storage location.
[0320] The sending module 1520 is configured to send target prediction information.
[0321] In one embodiment, the acquisition module 1510 is specifically used to obtain target preview information when preset conditions are met, and the preset conditions include at least one of the following conditions: the number of multiple data access requests included in the scheduling queue is greater than or equal to the waiting threshold; the number of random data access requests sent by the data access device is greater than or equal to the access threshold, and the offset between the storage position of the data accessed by the random data access request and the data accessed by the last data access request sent in the data storage device is greater than or equal to the offset threshold.
[0322] In one embodiment, the sending module 1520 is specifically configured to send the target announcement information when the number of sent data access requests is greater than or equal to a sending threshold.
[0323] In one embodiment, the target announcement information in the device further includes target identification information, and the target identification information is used to indicate a target data access request.
[0324] In one embodiment, the sending module 1520 is specifically configured to generate a target prediction request according to the target prediction information, store the target prediction request in a prediction queue, the target prediction request including the target prediction information, and obtain and send the target prediction request from the prediction queue.
[0325] In one embodiment, the sending module 1520 is specifically configured to generate a target UFS protocol information unit UPIU carrying an extra header field EHS area according to the target announcement information. The EHS area is used to indicate the target announcement information, and the target UPIU is a target announcement request.
[0326] In one embodiment, in the device, the EHS area includes an EHS data header and an EHS data area, the EHS data header includes a preview quantity field and a preview content field, the preview quantity field is used to indicate the quantity of target preview information, and the preview content field is used to indicate the information type to which the target storage information belongs, and the information type includes at least a storage location type; the EHS data area includes the target storage information.
[0327] In one embodiment, in the device, the EHS data area includes: a first identification field, and the first identification field is used to indicate target identification information.
[0328] In one embodiment, the preview queue includes at least two, each preview queue is used to store the preview request, the EHS data header also includes a preview type field, the preview type field is used to indicate that the target preview request is stored in one of the at least two preview queues, and the sending module 1520 is specifically used to store the target preview request in the preview queue indicated by the preview type field.
[0329] In one embodiment, in the device, the EHS data header further includes a length field, the UPIU includes a total EHS length field, and the total EHS length field included in the UPIU has the same value as the length field in the EHS data header.
[0330] In one embodiment, the sending module 1520 is further configured to generate a UTP transmission request descriptor UTRD according to the target announcement information. The UTRD includes a total EHS length field. The total EHS length field included in the UTRD has the same value as the length field in the EHS data header.
[0331] In one embodiment, the data storage device is a universal flash memory UFS, and the sending module 1520 is specifically used to generate a target small computer system interface SCSI command line CMD according to the target notice information. The target SCSI CMD includes a data output area, and the data output area is used to indicate the target notice information.
[0332] In one embodiment, in the device, the data output area includes: a second identification field, and the second identification field is used for target identification information.
[0333] In one embodiment, in the device, the sending priority of the SCSI CMD is higher than the sending priority of the data access request.
[0334] In one embodiment, the sending module 1520 is further configured to update the target data access request, obtain an updated target data access request, where the updated target data access request includes target identification information; and send the updated target data access request.
[0335] FIG16 is a schematic diagram of the structure of a data storage device provided in an embodiment of the present application. Referring to FIG16 , the device includes: a receiving module 1610, a reading module 1620, and a returning module 1630;
[0336] A receiving module 1610 is configured to receive a target notification request, the target notification request including target notification information, the target notification information being used to indicate target storage information of the target data accessed by the target data access request of the data access device in the data storage device, the target storage information including at least a target storage location;
[0337] a reading module 1620 configured to read target data from a storage medium of the data storage device according to the preview information and store the target data in a cache of the data storage device, where the access speed of the cache is greater than the access speed of the storage medium;
[0338] The return module 1630 is configured to obtain target data from the cache upon receiving a target data access request, and send the target data to the data access device.
[0339] In one embodiment, in the device, the target preview request includes a target UFS protocol information unit UPIU carrying an extra header field EHS area, and the EHS area is used to indicate the target preview information; or, the target preview request includes a target small computer system interface SCSI command line CMD, and the target SCSI CMD includes a data output area, and the data output area is used to indicate the target preview information.
[0340] In one embodiment, in the device, the target announcement information includes: target identification information, where the target identification information is used to indicate a target data access request.
[0341] In one embodiment, the return module 1630 is specifically configured to determine the storage location of the target data according to the target identification information of the target data access request and the first pre-reading table when receiving the target data access request;
[0342] Based on the target storage location and the mapping relationship between the target storage location and the storage location in the cache, the target data is obtained from the cache. Wherein, the first pre-reading table includes target identification information and the target storage location.
[0343] In one embodiment, the read module 1620 is further configured to, upon receiving a target data access request, determine whether the target data access request matches a second pre-read table; and if the target data access request matches the second pre-read table, retrieve the target data from the cache. The second pre-read table includes the target storage location and the storage location of the target data in the cache.
[0344] In one embodiment, the return module 1630 is further configured to read the target data from the storage medium and send the target data to the data access device when the target data access request does not hit the second pre-read table.
[0345] 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 this application, please refer to the description of the method embodiment of this application for understanding.
[0346] It should be noted that the module division of the data access device shown in FIG. 15 and the data storage device shown in FIG. 16 in the embodiments of the present application is schematic and is merely a logical functional division. In actual implementation, other division methods may be used. Furthermore, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or 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. They may also be implemented in the form of a combination of software and hardware.
[0347] It should be noted that, in the embodiment of the present application, if the above method is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-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 relevant technology can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for enabling an electronic device to execute all or part 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 U disk, a mobile hard disk, a read-only memory (ROM), a magnetic disk or an optical disk. In this way, the embodiment of the present application is not limited to any specific combination of hardware and software.
[0348] FIG17 is a schematic diagram of the structure of a terminal device provided in an embodiment of the present application. Referring to FIG17 , an embodiment of the present application provides a terminal device, which may be a device comprising a data access device and a data storage device. Its internal structure may be as shown in FIG17 . The terminal device includes a processor 1720, a memory, and a network interface 1740 connected via a system bus 1710. The processor 1720 of the terminal device is used to provide computing and control capabilities. The memory of the terminal device includes a non-volatile storage medium 1731 and an internal memory 1732. The non-volatile storage medium 1731 stores an operating system, a computer program, and a database. The internal memory 1732 provides an environment for the operation of the operating system and computer program in the non-volatile storage medium 1731. The database of the terminal device is used to store data. The network interface 1740 of the terminal device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, the above-described method is implemented.
[0349] An embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps of the method provided in the above embodiment are implemented.
[0350] An embodiment of the present application provides a computer program product containing instructions, which, when executed on a computer, enables the computer to execute the steps of the method provided in the above method embodiment.
[0351] Those skilled in the art will understand that the structure shown in Figure 17 is merely a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the terminal device to which the solution of the present application is applied. The specific terminal device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0352] In one embodiment, the data access device and data storage device provided herein can be implemented as a computer program that can be run on a terminal device as shown in FIG17 . The terminal device's memory can store the various program modules that make up the aforementioned devices. The computer program composed of the various program modules causes a processor to execute the steps of the methods of various embodiments of the present application described in this specification.
[0353] It should be noted that the description of the above storage medium and device embodiments is similar to the description of the above method embodiments and has similar beneficial effects as the method embodiments. For technical details not disclosed in the storage medium, storage medium, and device embodiments of this application, please refer to the description of the method embodiments of this application for understanding.
[0354] It should be understood that "one embodiment" or "an embodiment" or "some embodiments" mentioned throughout the specification means that the specific features, structures or characteristics related to the embodiment are included in at least one embodiment of the present application. Therefore, "in one embodiment" or "in an embodiment" or "in some embodiments" appearing throughout the specification do not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. It should be understood that in the various embodiments of the present application, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application. The above-mentioned serial numbers of the embodiments of the present application are for description only and do not represent the advantages and disadvantages of the embodiments. The above description of the various embodiments tends to emphasize the differences between the various embodiments. The same or similar aspects can be referenced to each other. For the sake of brevity, they will not be repeated here.
[0355] The term "and / or" in this article is only a description of the association relationship between associated objects, indicating that there can be three relationships. For example, object A and / or object B can mean: object A exists alone, object A and object B exist at the same time, and object B exists alone.
[0356] It should be noted that, in this document, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or apparatus comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or apparatus comprising the element.
[0357] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. The embodiments described above are merely illustrative. For example, the division of the modules is merely a logical function division. In actual implementation, there may be other division methods, such as: multiple modules or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of devices or modules can be electrical, mechanical or other forms.
[0358] The modules described above as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules; they may be located in one place or distributed across multiple network units; some or all of the modules may be selected according to actual needs to achieve the purpose of this embodiment.
[0359] In addition, all functional modules in the embodiments of the present application can be integrated into one processing unit, or each module can be a separate unit, or two or more modules can be integrated into one unit; the above-mentioned integrated modules can be implemented in the form of hardware or in the form of hardware plus software functional units.
[0360] Those skilled in the art will understand that all or part of the steps of implementing the above-mentioned method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above-mentioned method embodiment; and the aforementioned storage medium includes: mobile storage devices, read-only memories (ROM), magnetic disks or optical disks, and other media that can store program codes.
[0361] Alternatively, if the above-mentioned integrated unit of the present application is implemented in the form of a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application, or the part that contributes to the relevant technology, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a number of instructions for enabling an electronic device to execute all or part of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROMs, magnetic disks or optical disks.
[0362] The methods disclosed in the several method embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments.
[0363] The features disclosed in the several product embodiments provided in this application can be arbitrarily combined without conflict to obtain new product embodiments.
[0364] The features disclosed in the several method or device embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments or device embodiments.
[0365] The above is merely an embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art 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 data access method, characterized in that: Applied to a data access device, the method includes: Acquire target notice information, where the target notice information is used to indicate target storage information of target data accessed by the target data access request in a data storage device, where the target storage information at least includes a target storage location; The target advance information is sent.
2. The method according to claim 1, characterized in that The obtaining of target advance information includes: When a preset condition is met, the target forecast information is obtained, where the preset condition includes at least one of the following conditions: The number of the plurality of data access requests included in the scheduling queue is greater than or equal to a waiting threshold; The number of random data access requests sent by the data access device is greater than or equal to an access threshold, and the offset between the storage position of the data accessed by the random data access request and the data accessed by the last data access request sent in the data storage device is greater than or equal to the offset threshold.
3. The method according to claim 1, characterized in that The sending of the target advance information includes: When the number of sent data access requests is greater than or equal to a sending threshold, the target advance notice information is sent.
4. The method according to claim 1, wherein The target advance information further includes target identification information, and the target identification information is used to indicate the target data access request.
5. The method according to claim 4, characterized in that The data access device includes a forecast queue. After acquiring the target forecast information, the method further includes: generating a target prediction request according to the target prediction information, and storing the target prediction request in the prediction queue, wherein the target prediction request includes the target prediction information; The sending of the target advance information includes: The target prediction request is obtained from the prediction queue and sent.
6. The method according to claim 5, characterized in that The data storage device is a universal flash memory (UFS), and generating a target prediction request according to the target prediction information includes: A target UFS protocol information unit UPIU carrying an extra header field EHS area is generated according to the target announcement information, where the EHS area is used to indicate the target announcement information, and the target UPIU is the target announcement request.
7. The method according to claim 6, characterized in that The EHS area includes an EHS data header and an EHS data area. The EHS data header includes a preview quantity field and a preview content field. The preview quantity field is used to indicate the quantity of the target preview information, and the preview content field is used to indicate the information type to which the target storage information belongs. The information type includes at least a storage location type. The EHS data area includes the target storage information.
8. The method according to claim 7, characterized in that The EHS data area includes: a first identification field, and the first identification field is used to indicate the target identification information.
9. The method according to claim 8, characterized in that The preview queues include at least two, each preview queue is used to store a preview request, the EHS data header further includes a preview type field, the preview type field is used to indicate that the target preview request is to be stored in one of the at least two preview queues, and the storing of the target preview request in the preview queue includes: The target preview request is stored in the preview queue indicated by the preview type field.
10. The method according to claim 8, characterized in that The EHS data header further includes a length field, and the UPIU includes a total EHS length field. The total EHS length field included in the UPIU has the same value as the length field in the EHS data header.
11. The method according to claim 8, characterized in that Before sending the target advance information, the method further includes: A UTP transmission request descriptor UTRD is generated according to the target preview information, wherein the UTRD includes a total EHS length field, and the total EHS length field included in the UTRD has the same value as the length field in the EHS data header.
12. The method according to claim 5, characterized in that The data storage device is a universal flash memory (UFS), and generating a target prediction request according to the target prediction information includes: A target small computer system interface SCSI command line CMD is generated according to the target advance notice information. The target SCSI CMD includes a data output area. The data output area is used to indicate the target advance notice information.
13. The method according to claim 12, characterized in that The data output area includes: a second identification field, and the second identification field is used for the target identification information.
14. The method according to claim 12, characterized in that The sending priority of the SCSI CMD is higher than the sending priority of the data access request.
15. The method according to claim 4, characterized in that The method further comprises: updating the target data access request to obtain an updated target data access request, where the updated target data access request includes the target identification information; Sending the updated target data access request.
16. A data access method, characterized in that: Applied to a data storage device, the method comprises: receiving a target notification request, the target notification request including target notification information, the target notification information being used to indicate target storage information of the target data accessed by the target data access request of the data access device in the data storage device, the target storage information including at least a target storage location; Reading the target data from a storage medium of the data storage device according to the target advance information, and storing the target data in a cache of the data storage device, wherein an access speed of the cache is greater than an access speed of the storage medium; When the target data access request is received, the target data is obtained from the cache and sent to the data access device.
17. The method according to claim 16, characterized in that The target announcement request includes a target UFS protocol information unit (UPIU) carrying an extra header field (EHS) area, where the EHS area is used to indicate the target announcement information; or The target announcement request includes a target small computer system interface SCSI command line CMD. The target SCSI CMD includes a data output area. The data output area is used to indicate the target announcement information.
18. The method according to claim 17, characterized in that The target announcement information further includes target identification information, where the target identification information is used to indicate the target data access request.
19. The method according to claim 18, characterized in that The target data access request includes target identification information, the data storage device includes a first pre-reading table, the first pre-reading table includes the target identification information and the target storage location, and when the target data access request is received, obtaining the target data from the cache includes: In the case of receiving a target data access request, determining the target storage location according to the target identification information of the target data access request and the first pre-reading table; The target data is obtained from the cache based on the target storage location and a mapping relationship between the target storage location and a storage location in the cache.
20. The method according to claim 16, wherein The data storage device includes: a second pre-reading table; the second pre-reading table includes the target storage location and the storage location of the target data in the cache; when receiving the target data access request, obtaining the target data from the cache includes: Upon receiving the target data access request, determining whether the target data access request hits the second pre-reading table; When the target data access request hits the second pre-read table, the target data is obtained from the cache.
21. The method according to claim 20, characterized in that After determining whether the target data access request hits the second pre-read table, the method further includes: In a case where the target data access request does not hit the second pre-read table, the target data is read from the storage medium and sent to the data access device.
22. A data access device, characterized in that: The device includes: an acquisition module and a sending module; The acquisition module is configured to acquire target prediction information, wherein the target prediction information is used to indicate target storage information of the target data accessed by the target data access request in the data storage device, wherein the target storage information at least includes a target storage location; The sending module is used to send the target prediction information.
23. A data storage device, characterized in that The device includes: a receiving module, a reading module, and a returning module; The receiving module is configured to receive a target notification request, wherein the target notification request includes target notification information, wherein the target notification information is used to indicate target storage information of the target data accessed by the target data access request of the data access device in the data storage device, wherein the target storage information includes at least a target storage location; The reading module is configured to read the target data from a storage medium of the data storage device according to the advance information, and store the target data in a cache of the data storage device, wherein an access speed of the cache is greater than an access speed of the storage medium; The returning module is configured to, upon receiving the target data access request, obtain the target data from the cache and send the target data to the data access device.
24. A terminal device comprising a memory and a processor, wherein the memory stores a computer program that can be run on the processor, characterized in that: When the processor executes the program, the steps of the method according to any one of claims 1 to 15 or 16 to 21 are implemented.
25. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 21 is implemented.
Citation Information
Patent Citations
Graph data prefetching method, processor and electronic equipment
CN114090078A
Method and device for executing memory operation
CN116601594A
Data prefetch for SCSI referrals
US20110225371A1
Techniques for pre-fetching information using pattern detection
US20220350744A1