Data processing method, storage medium, electronic device and program product
By maintaining the access history table and dynamically adjusting the read-out strategy, the problem of low read-out hit rate in the existing technology is solved, and more efficient read-out operation and system response speed are achieved.
Patent Information
- Application Number
- CN202510379918.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-28
- Publication Date
- 2025-04-29
- Estimated Expiration
- 2045-03-28
AI Technical Summary
The prior art cannot accurately predict read-out data that may be accessed in the future, resulting in a low read-out hit rate.
By maintaining the data block access history table and data page access history table, recording the access frequency and weight of each data block and data page, dynamically adjusting the read preview strategy, and prioritizing data blocks and data pages with higher preview weights.
It significantly improves the read preview hit rate, reduces invalid read preview operations, loads the target read preview data into the cache in advance, reduces data access delay, and improves the system response speed.
Smart Images

Figure CN119902720A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a data processing method, a storage medium, an electronic device, and a program product. Background Art
[0002] With the widespread use of solid state drives (SSDs) in computer systems, their performance has become one of the important indicators for measuring the overall performance of the system. Pre-reading technology can be used to load data that may be accessed in the future into the storage medium of the SSD in advance, which can further improve the performance of the SSD.
[0003] At present, the pre-reading mechanism in the related art usually performs actual reading and pre-reading operations based on a simple proportional strategy, and directly uses the subsequent data pages of the actual read data as the pre-reading data. However, this method cannot accurately predict the pre-reading data that may be accessed in the future, resulting in a low pre-reading hit rate. Summary of the invention
[0004] The present disclosure provides a data processing method, a storage medium, an electronic device and a program product, which are mainly intended to solve the problem that the related technology cannot accurately predict the pre-read data that may be accessed in the future, thereby resulting in a low pre-read hit rate.
[0005] In a first aspect, the present application provides a data processing method, comprising: Extract data access information from the solid state drive to determine the data block currently being accessed; Obtain an access history table corresponding to the currently accessed data block, the access history table includes a data block access history table and a data page access history table, the data block access history table is used to record the accessed data blocks and the weights of the accessed data blocks, the data page access history table is used to record the accessed data pages and the weights of the accessed data pages, the weights are used to reflect the probability of data blocks and data pages in the solid state drive being accessed; Determine target pre-read data based on weights of multiple data blocks and weights of multiple data pages in the access history table; If it is detected that the position of the target pre-read data is not in the pre-read position linked list, the target pre-read data is loaded into the cache of the solid state drive.
[0006] In a second aspect, the present application provides a data processing device, comprising: an extraction module configured to extract data access information from the solid state drive and determine a currently accessed data block; an acquisition module, configured to acquire an access history table corresponding to a currently accessed data block, the access history table comprising a data block access history table and a data page access history table, the data block access history table being used to record accessed data blocks and weights of accessed data blocks, the data page access history table being used to record accessed data pages and weights of accessed data pages, the weights being used to reflect the probability of data blocks and data pages in the solid state drive being accessed; A determination module configured to determine target pre-read data based on weights of multiple data blocks and weights of multiple data pages in an access history record table; The loading module is configured to load the target pre-read data into the cache of the solid state drive if it is detected that the position of the target pre-read data is not in the pre-read position linked list.
[0007] In a third aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, which implements the method of the first aspect when the computer program is executed by a processor.
[0008] In a fourth aspect, the present application provides an electronic device, comprising a storage medium, a processor, and a computer program stored on the storage medium and executable on the processor, wherein the processor implements the method of the first aspect when executing the computer program.
[0009] In a fifth aspect, the present application provides a computer program product having a computer program stored thereon, which implements the method of the first aspect when the computer program is executed by a processor.
[0010] The data processing method, storage medium, electronic device and program product provided by the present disclosure include: firstly extracting data access information from a solid state drive to determine the currently accessed data block; obtaining an access history table corresponding to the currently accessed data block, the access history table including a data block access history table and a data page access history table, the data block access history table is used to record the accessed data blocks and the weights of the accessed data blocks, the data page access history table is used to record the accessed data pages and the weights of the accessed data pages, and the weights are used to reflect the probability of the data blocks and data pages in the solid state drive being accessed; based on the weights of multiple data blocks and multiple data pages in the access history table, determining the target pre-read data; if it is detected that the position of the target pre-read data is not in the pre-read position linked list, the target pre-read data is loaded into the cache of the solid state drive. Compared with the current prior art, the present application can more accurately predict the next most likely accessed data block and data page by maintaining the data block access history table and the data page access history table, and then determine the target pre-read data. This dynamic adjustment mechanism based on access patterns can significantly improve the hit rate of pre-reading and reduce invalid pre-reading operations. By loading the target pre-reading data into the cache of the SSD in advance, when the user actually accesses the data, it can be read directly from the cache, thereby significantly reducing the delay of data access and improving the response speed of the system.
[0011] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present application, nor is it intended to limit the scope of the present application. Other features of the present application will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] In order to more clearly illustrate the embodiments of the present application, the following is a brief introduction to 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 paying any creative work.
[0013] Figure 1 A schematic diagram of a data processing method provided in an embodiment of the present application is shown; Figure 2 A schematic diagram showing a flow chart of another data processing method provided in an embodiment of the present application is shown; Figure 3 A schematic diagram of an example process provided by an embodiment of the present application is shown; Figure 4 A schematic diagram of an example process provided by an embodiment of the present application is shown; Figure 5A schematic diagram of an example process provided by an embodiment of the present application is shown; Figure 6 A schematic diagram of an example process provided by an embodiment of the present application is shown; Figure 7 A structural schematic diagram of a data processing device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0014] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0015] It should be noted that, in the description of this application, the terms "include", "comprise" or any other variant thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. The terms "first", "second", etc. in this application are used to distinguish similar objects, and are not used to describe a specific order or sequence.
[0016] At present, traditional pre-reading algorithms generally only allocate the number of actual reads and pre-reads in proportion. For example, 10 actual reads are accompanied by 1 pre-read, and this pre-read is generally the subsequent data page of the actual read. This mechanism has problems such as low hit rate and limited cache pre-reading position buffer size. This is mainly because traditional pre-reading algorithms lack the ability to dynamically learn and adjust actual access patterns, resulting in inaccurate selection of pre-reading positions. Therefore, designing a pre-reading algorithm that can adaptively learn according to actual access patterns to maximize the pre-reading hit efficiency under the premise of limited memory size has become an urgent problem to be solved.
[0017] In order to improve the technical problem that the related art cannot accurately predict the pre-read data that may be accessed in the future, thereby resulting in a low pre-read hit rate. This embodiment provides a data processing method, such as Figure 1 As shown, the method comprises the following steps: Step 101: extract data access information from the solid state drive to determine the data block currently being accessed.
[0018] For example, system tools or dedicated software can be used to obtain SSD access logs or collect data block access records. For example, the currently accessed data block identifier and related access information can be parsed from the access log, thereby accurately tracking which data blocks are being accessed, providing an important basis for subsequent cache management, pre-reading strategy optimization, and overall performance improvement.
[0019] Step 102: Obtain an access history record table corresponding to the currently accessed data block.
[0020] Among them, the access history table includes a data block access history table and a data page access history table. The data block access history table (Blk_AccessHistory) is used to record the accessed data blocks and the weights of the accessed data blocks (recorded in the weight table Blk_Weights). The data page access history table (Pg_AccessHistory) is used to record the accessed data pages and the weights of the accessed data pages (recorded in the weight table Pg_Weights). The weights are used to reflect the probability of data blocks and data pages in the solid state drive being accessed.
[0021] Exemplarily, a data block access history table is a table or data structure that records data block access information, usually including a unique identifier (ID) of each data block and a timestamp (Timestamp) of its most recent access or multiple accesses. It can be used to track which data blocks have been accessed and the specific time points when these accesses occurred, which helps to identify frequently accessed data blocks, thereby providing a basis for cache management; the structure of a data page access history table is similar to that of a data block access history table, and is used to record more fine-grained data page-level access information in a data block.
[0022] In some examples, as the system runs longer, the access history table and weight table are constantly updated, so that the pre-reading strategy can be adaptively adjusted to adapt to new access patterns. This adaptive capability enables the system to maintain efficient performance in the face of dynamically changing data access requirements. By introducing a weight mechanism, the system can dynamically adjust the pre-reading strategy based on access frequency and access pattern, giving priority to pre-reading data blocks and data pages that are more likely to be accessed, thereby improving the pre-reading hit rate.
[0023] Step 103: Determine target pre-read data based on the weights of multiple data blocks and the weights of multiple data pages in the access history record table.
[0024] Exemplarily, the first N high-weighted data blocks are selected from the data block access history table according to the weight sorting, and then for each selected data block, the first M high-weighted data pages are screened out from the corresponding data page access history table according to the weight. These selected data pages are identified as target pre-read data. By analyzing and sorting the access weights of data blocks and data pages, the data that is most likely to be accessed can be accurately selected as the target pre-read data, thereby improving system performance and response speed.
[0025] Step 104: If it is detected that the position of the target pre-read data is not in the pre-read position linked list, the target pre-read data is loaded into the cache of the solid state drive.
[0026] In some examples, the pre-read position linked list is used to store the location information of data that the system predicts may be accessed in the future, including identifiers such as data block IDs and data page IDs. Based on the pre-read position linked list, it is possible to effectively track which data has been pre-read, its pre-read order, and status, ensuring that the data can be quickly located when it is actually needed. Inserting the location of the target pre-read data into the pre-read position linked list can optimize cache usage and improve the pre-read hit rate.
[0027] Exemplarily, this embodiment maintains an access history table through an adaptive learning mechanism to track the access frequency of each data block, and defines a weight for each data block to reflect its access probability, thereby dynamically adjusting the selection of the pre-read position according to the actual access mode. In the pre-reading process, the data block with the highest weight is selected for pre-reading first, ensuring that the system can intelligently predict and load the data that is most likely to be accessed, thereby improving the pre-reading hit rate and data access efficiency.
[0028] In some embodiments, through the above-mentioned data processing flow, the selection of the pre-read position is dynamically adjusted according to the actual access mode, so as to maintain a high pre-read hit rate. Specifically, the algorithm identifies the data blocks and data pages that are most likely to be accessed by statistically analyzing the access history records of data blocks and data pages, and dynamically adjusting the weights according to the access frequency. These high-weight data are loaded into the cache in advance through an adaptive learning algorithm to speed up the response speed of subsequent access requests. The method of this embodiment not only optimizes data access efficiency, but also significantly improves the overall performance of the SSD, enabling the system to improve the speed and responsiveness of data processing while reducing waiting time. The method of this embodiment effectively enhances the performance and user experience of the storage system by intelligently predicting and pre-fetching data.
[0029] Compared with the related art, the present embodiment first extracts data access information from the solid state drive to determine the currently accessed data block; obtains the access history table corresponding to the currently accessed data block, the access history table includes a data block access history table and a data page access history table, the data block access history table is used to record the accessed data blocks and the weights of the accessed data blocks, the data page access history table is used to record the accessed data pages and the weights of the accessed data pages, and the weights are used to reflect the probability of data blocks and data pages in the solid state drive being accessed; based on the weights of multiple data blocks and multiple data pages in the access history table, the target pre-read data is determined; if it is detected that the position of the target pre-read data is not in the pre-read position linked list, the target pre-read data is loaded into the cache of the solid state drive. Compared with the current existing technology, the present embodiment can more accurately predict the next most likely accessed data block and data page by maintaining the data block access history table and the data page access history table, and then determine the target pre-read data. This dynamic adjustment mechanism based on the access mode can significantly improve the hit rate of pre-reading and reduce invalid pre-reading operations. By loading the target pre-read data into the cache of the SSD in advance, when the user actually accesses the data, it can be read directly from the cache, thereby significantly reducing the delay in data access and improving the system's response speed.
[0030] Further, as a refinement and extension of the above-mentioned embodiment, in order to specifically illustrate the data processing process, optionally, step 103 may also specifically include: according to the weights of multiple data blocks in the data block access history table, filtering out a first preset number of data blocks from high to low; according to the weights of multiple data pages in the data page access history table, for multiple data blocks in the first preset number of data blocks, filtering out a second preset number of data pages from high to low; and determining the data in the second preset number of data pages as target pre-read data.
[0031] Exemplarily, according to the weight of each data block in the data block access history table, a first preset number (for example, the first 30) of data blocks are screened from high to low; then, for the selected data blocks, according to the data page weights in the corresponding data page access history table, a second preset number (for example, the first 30 under each data block) of data pages are further screened from high to low. Finally, the data in these selected data pages are determined as target pre-read data to optimize data access efficiency and ensure that the pre-read operation focuses on the data that is most likely to be accessed, thereby improving the overall system performance and reducing unnecessary reading overhead.
[0032] In some embodiments, before the pre-read operation is implemented, it is also necessary to check the pre-read linked list to ensure that the pre-read operation is performed only on data blocks and data pages that have not been read, thereby avoiding repeated pre-reading of data that already exists in the cache, improving overall reading efficiency and reducing unnecessary resource consumption. In this way, data access patterns can be intelligently optimized and system performance can be improved.
[0033] Optionally, the method of this embodiment may also include: in response to a read request for a data block, updating the identifier and access timestamp of the first data block into an access history record table; updating the weight of the first data block based on the number of times the first data block is accessed, and updating the weight of the first data page based on the number of times the first data page corresponding to the first data block is accessed.
[0034] In some examples, when a read request is received, the system first records the currently accessed data block identifier (block_id) and its access timestamp (timestamp) into the initialized data block access history table (Blk_AccessHistory[block_id] = timestamp). Next, the weight of the data block is updated, and the initial weight is set to 1. Whenever this data block is accessed again, its weight increases by a certain fraction (for example, +1). Specifically, it is determined whether to increase the existing weight or set a new weight by checking whether the data block exists in the weight table. In addition, it is necessary to find the data page access table corresponding to the data block identifier, record the current data page, and update the weight of the data page in the same way to track the access frequency and importance of the data page. This process helps to optimize data access strategies and improve the efficiency of read operations.
[0035] Optionally, the method of this embodiment may further include: if it is detected that the position of the target pre-read data is in the pre-read position linked list, increasing the number of pre-read hits of the position of the target pre-read data.
[0036] For example, if it is detected that the location of the target pre-read data is in the pre-read location linked list, it indicates that the location has been pre-read before, and the pre-read hit count should be increased to record the frequency of access to the pre-read data. This ensures that frequently accessed data can be kept in the cache, thereby improving cache utilization and pre-read hit rate, and ultimately improving the response speed and overall performance of the system, so that the system can optimize cache management by updating the pre-read hit count.
[0037] Optionally, before determining the target pre-read data based on the weights of multiple data blocks and the weights of multiple data pages in the access history table, the method of this embodiment may further specifically include: obtaining the last access time of the currently accessed data block by querying the access history table; if the difference between the last access time and the current time is greater than a preset interval period, stopping obtaining the target pre-read data; accordingly, step 103 may further specifically include: if the difference between the last access time and the current time is less than or equal to the preset interval period, determining the target pre-read data based on the weights of multiple data blocks and the weights of multiple data pages in the access history table.
[0038] For example, a timer may be created and set to periodically trigger the pre-reading process every 5 seconds. Each time it is triggered, the data block access history record table is first checked to confirm whether the most recent access occurred within 5 seconds. If it exceeds 5 seconds, the pre-reading election process is skipped to avoid invalid pre-reading.
[0039] Optionally, step 104 may further specifically include: inserting the target pre-read data into a pre-read position linked list, and adding the target pre-read data to a pre-read buffer table.
[0040] Exemplarily, the specific locations of these target pre-read data (such as data block ID and data page ID) are inserted into the pre-read position linked list to record their pre-read order and status. At the same time, the actual data content or pointers to these data are added to the pre-read buffer to ensure that these data that may be accessed can be directly obtained from the cache quickly, reducing subsequent access delays, which not only optimizes cache usage efficiency, but also improves the pre-read hit rate and the overall performance of the system.
[0041] In some examples, the SSD pre-reading algorithm based on adaptive learning can dynamically adjust the pre-reading strategy under limited memory size conditions, improve the pre-reading hit efficiency, reduce invalid read operations, and significantly improve the overall disk performance and user interaction experience. This method effectively optimizes cache usage, enhances data processing speed and the overall responsiveness of the system.
[0042] As a refinement of this embodiment, before loading the target pre-read data into the cache of the solid state drive, the space of the pre-read position buffer may be allocated in the following manners, but not limited to: Figure 3 As shown, Figure 3 A flowchart of a data processing method provided by an embodiment of the present disclosure includes: Step 201: Determine whether there is enough space in the cache of the solid state drive to store the target pre-read data.
[0043] Exemplarily, in the cache management strategy, the pre-read buffer (PreReadBuffer) is first initialized, and the total cache capacity (TotalCapacity) is set to the maximum cache size (MAX_CACHE_SIZE) (for example, set to 16K*30*30, indicating that the size of each data page is 16KB, and the first 30 data pages are selected for each of the first 30 data blocks selected for pre-reading), and the currently used cache size (CurrentSize) is initialized to 0, as well as the pre-read location list (PreReadAddr), so as to optimize the use of cache space and improve the data pre-read hit rate and system performance.
[0044] Step 202: If there is not enough space in the cache, the nodes in the pre-read position linked list are sorted according to access frequency, and the nodes whose access frequency is lower than a preset threshold are deleted.
[0045] Optionally, if there is enough space in the cache, the target pre-read data is loaded into the cache of the solid state drive.
[0046] Exemplarily, when the adaptive learning algorithm determines the position to be pre-read, it first checks whether the position already exists in the pre-read position list. If it exists, the pre-read hit count (access frequency) of the position is increased (Pre_cnt++); if it does not exist, a pre-read request is initiated. After the pre-read data is returned, the system will first check whether there is enough space before putting it into the cache. If there is enough space, the new node will be inserted into the pre-read position list, and its pre-read hit count Pre_cnt=1 will be set, and the pre-read data will be added to the pre-read buffer. If there is insufficient space, the existing nodes are sorted according to the access frequency, and the nodes with the lowest access frequency are deleted to make room, and then the new pre-read data and its nodes are added to the pre-read buffer and the pre-read position list. In this way, by dynamically managing the data in the cache, it is ensured that the data with high access frequency is retained, thereby improving the overall performance and pre-reading efficiency of the system.
[0047] Exemplarily, this embodiment uses an intelligent cache management strategy to reasonably allocate space in the pre-read position buffer under the premise of limited memory size and regularly clears data blocks with low access frequency to release space for data blocks that are more likely to be accessed, thereby maintaining the freshness and relevance of the cache content. At the same time, an optimization algorithm is used to ensure the efficient operation of the cache management strategy, ensuring that data blocks with high access frequency are retained, thereby improving the overall cache utilization and system performance.
[0048] Optionally, the method of this embodiment may further specifically include: regularly clearing the access history record table and / or the pre-read position linked list based on a preset time interval.
[0049] For example, by periodic cleaning, low-frequency or outdated data records can be deleted, thereby freeing up valuable storage resources and allowing the cache to accommodate more active or useful data. Removing invalid or inefficient cache entries helps keep the cache content fresh and relevant. This ensures that the cache retains the data that is most likely to be accessed again, thereby improving the cache hit rate, reducing unnecessary disk operations, and speeding up data access.
[0050] Optionally, the access history table is cleaned up regularly based on a preset time interval, which may specifically include: obtaining the current time and the last access time of each data block in the access history table; in the access history table, deleting unaccessed data blocks whose difference between the last access time and the current time exceeds a preset time threshold.
[0051] In some examples, the current time and the last access time of each data block in the access history table are obtained. Then, a preset time threshold is set to determine whether the data block is a data block that has not been accessed for a long time. Next, the difference between the last access time and the current time of each data block is checked in the access history table. If this time difference exceeds the preset time threshold, the data block is considered to have not been accessed for a long time and is deleted from the access history table and the weight table. This ensures that only those data blocks that are still active or have been recently accessed are retained in the system, thereby optimizing storage efficiency and improving system performance. This not only reduces unnecessary memory usage, but also enables subsequent access and pre-read operations to focus more on valid data, improving overall data processing speed and response efficiency.
[0052] Exemplarily, in order to keep the size of the access history table and the weight table moderate, it is necessary to regularly clear data blocks that have not been accessed for a long time. First, get the current time current_time and set a time threshold (for example, 60 seconds). Then, traverse each data block ID in AccessHistory and its corresponding access timestamp timestamp. If the difference between the current time and the access timestamp of a data block exceeds the set threshold, the data block ID is added to the to-be-deleted list to_remove. And delete the corresponding entries from AccessHistory and Weights according to the to_remove list to ensure that only active data block information is retained, thereby optimizing storage efficiency and system performance. According to the to_remove list, remove the corresponding data blocks from AccessHistory and Weights, clean up expired data, and maintain the validity of the data and the health of the storage structure.
[0053] Optionally, the pre-read position linked list is cleaned up regularly based on a preset time interval, which may specifically include: based on a preset time interval, counting the access frequency of each data block in the pre-read position linked list; in the pre-read position linked list, deleting the second data block and the node corresponding to the second data block whose access frequency is lower than a preset frequency threshold.
[0054] For example, to optimize cache usage and ensure that data blocks with greater potential for access can obtain space, a timer can be set to periodically clean up the pre-read position list. Specifically, it can be checked every 10 seconds and pre-read nodes with access frequencies less than 5 times can be removed, thereby freeing up space for data blocks that are more likely to be accessed. This process not only maintains the freshness and relevance of the cache content, but also improves the overall performance and pre-reading efficiency of the system.
[0055] Optionally, the method of this embodiment may further include: in response to an erase operation request, querying an access history table; if the access history table contains an erased third data block, deleting the record of the third data block and the data page access table corresponding to the third data block.
[0056] In some examples, when an erase operation occurs, the access history of the relevant data blocks needs to be cleaned up to maintain data consistency and a tidy storage structure. The specific steps are: first query the data block access history table to check whether there is a record of the data block to be erased (i.e., block_id). If the record of the data block exists in the data block access history table, delete this record, and also delete the data page access history associated with the data block, that is, remove the corresponding entry from the data page access history table. This ensures that the access history records after the erase operation are updated and cleaned up in a timely manner, maintaining the consistency of system data and the tidiness of the storage structure.
[0057] Optionally, the method of this embodiment may further specifically include: in response to an erase operation request, querying in a pre-read position linked list; if a node corresponding to the erased fourth data block exists in the pre-read position linked list, deleting the record of the fourth data block and the pre-read buffer table corresponding to the fourth data block.
[0058] In some examples, when an erase operation occurs, the pre-read position linked list is queried, and if there is a node corresponding to block_id, the record of block_id and its data in the pre-read buffer table are deleted to clear useless data and release cache space. The cache management strategy effectively improves cache utilization and pre-read hit rate under the premise of limited memory size by comprehensively using access frequency analysis, cache space allocation and regular cleaning mechanism. Specifically, the strategy can dynamically adjust cache space allocation, give priority to retaining frequently accessed data blocks, and clean up infrequently accessed data blocks in a timely manner, thereby significantly improving the overall performance of the SSD.
[0059] In some embodiments, Figure 3 As shown in the figure, when a read request from the Flash Translation Layer (FTL) is received, a thread is first created to update the access history of the read request. Next, the data block access history table Blk_AccessHistory is queried based on the block_id. If the block_id does not exist, the current block_id node is inserted, and its timestamp and weight Blk_Weights are initialized; if it exists, the timestamp of the node is updated and its weight is increased. Subsequently, the data page access history table Pg_AccessHistory is queried based on the identifier page_id of the data page. If the page_id does not exist, the current page_id node is inserted, and its timestamp and weight Pg_Weights are initialized; if it exists, the timestamp of the node is updated and its weight is increased. It ensures that the access history of the relevant data blocks and data pages can be updated in time after each access, providing accurate data support for the subsequent pre-reading strategy.
[0060] In some embodiments, Figure 4 As shown in the figure, the timer is started every 5 seconds to obtain the current time. Each time the pre-reading process is triggered, the data block access history table is first checked to confirm whether the most recent access occurred within 5 seconds. If it exceeds 5 seconds, the pre-reading election process is skipped to avoid invalid pre-reading. Then the timestamps of the data blocks are sorted to check whether there are new access records in the last 60 seconds. If not, continue to the next cycle; if so, sort according to Blk_Weights and select the top 30 data blocks with the highest weight as the target pre-reading blocks. Then, for each selected data block, sort according to Pg_Weights and select the top 30 data pages with the highest weight as the target pre-reading pages. Subsequently, a pre-reading operation is initiated for the selected high-weight data blocks and data pages, and the returned data is saved. At the same time, the timestamps of all data blocks are traversed, and the data blocks and their corresponding data page access history tables that have not been accessed for more than 60 seconds are deleted. This ensures that the system can dynamically adjust the pre-reading strategy to improve the pre-reading hit rate and overall performance.
[0061] In some embodiments, Figure 5As shown in the figure, when the adaptive learning pre-reading instruction is issued, first check whether the target pre-read data is already in the pre-read position list PreReadAddr. If it exists, the pre-read hit count Pre_cnt of the data is increased and returned; if it does not exist, the back-end module (BE) processes and returns the pre-read data. Next, check whether the total capacity TotalCapacity of the pre-read buffer is full (TotalCapacity=0). If it is not full, insert the new data into the pre-read position list PreReadAddr, and store the pre-read data in the pre-read buffer PreReadBuffer. If the pre-read buffer is full, find the data node with the least pre-read hit count from the pre-read position list, remove the node, and release the corresponding pre-read buffer space. Subsequently, insert the new pre-read data into the pre-read position list and store it in the pre-read buffer, and save the data returned by the current pre-reading to the pre-read buffer to ensure that the cache space is effectively used.
[0062] In some embodiments, Figure 6 As shown in the figure, when the host sends a read operation request, the data access information (host op message) read request is first processed by FTL, and a thread is created to update the access history of the read request. Next, check whether the block_id of the target data block is in the data block access history table Blk_AccessHistory. If it exists, delete the node and its corresponding data page access history table Pg_AccessHistory. Then, check whether the block_id is in the pre-read position linked list PreReadAddr. If it exists, delete the node and release its corresponding pre-read buffer space. Finally, find the corresponding data buffer from the pre-read position linked list, obtain the data and return it to the host; if it does not exist, send a read request message to the back end (BE), process it according to the normal non-volatile memory NAND flash memory (Nand) read process, and return the data buff to the host host.
[0063] Compared with the current existing technology, this embodiment can more accurately predict the next most likely accessed data block and data page by maintaining a data block access history table and a data page access history table, and record the access frequency and weight of each data block and data page, and then determine the target pre-read data. This dynamic adjustment mechanism based on the access mode can significantly improve the pre-read hit rate and reduce invalid pre-read operations. By loading the target pre-read data into the cache of the solid-state drive in advance, when the user actually accesses the data, it can be read directly from the cache, thereby significantly reducing the delay of data access and improving the response speed of the system. By introducing an adaptive learning mechanism and an intelligent cache management strategy, the pre-read hit efficiency is significantly improved under the premise of limited memory size, thereby improving the overall SSD performance. The algorithm dynamically learns the actual access mode and selects the data blocks that are most likely to be accessed for pre-reading, which effectively improves the pre-read hit rate; at the same time, the intelligent cache management strategy is used to reasonably allocate the space of the pre-read position buffer, and invalid pre-reading is avoided by regularly cleaning up data blocks with low access frequency, further optimizing the cache utilization. These features work together to ensure that the system can maximize cache effectiveness and resource utilization efficiency while maintaining efficient data access.
[0064] The embodiment of the present application also provides a data processing device, as Figure 1 The specific implementation of the method shown is as follows Figure 7 As shown, the device includes: an extraction module 31, an acquisition module 32, a determination module 33, and a loading module 34.
[0065] The extraction module 31 is configured to extract data access information from the solid state drive and determine the data block currently being accessed; The acquisition module 32 is configured to acquire an access history table corresponding to the currently accessed data block, the access history table including a data block access history table and a data page access history table, the data block access history table is used to record the accessed data blocks and the weights of the accessed data blocks, the data page access history table is used to record the accessed data pages and the weights of the accessed data pages, and the weights are used to reflect the probability of the data blocks and data pages in the solid state drive being accessed; A determination module 33 is configured to determine target pre-read data based on weights of multiple data blocks and weights of multiple data pages in the access history record table; The loading module 34 is configured to load the target pre-read data into the cache of the solid state drive if it is detected that the location of the target pre-read data is not in the pre-read location linked list.
[0066] In some examples of the present embodiment, the determination module 33 is specifically configured to filter out a first preset number of data blocks from high to low according to the weights of multiple data blocks in the data block access history table; filter out a second preset number of data pages from high to low for multiple data blocks in the first preset number of data blocks according to the weights of multiple data pages in the data page access history table; and determine the data in the second preset number of data pages as the target pre-read data.
[0067] In some examples of this embodiment, the determination module 33 is further specifically configured to update the identifier and access timestamp of the first data block to the access history table in response to a read request for the data block; update the weight of the first data block based on the number of times the first data block is accessed, and update the weight of the first data page based on the number of times the first data page corresponding to the first data block is accessed.
[0068] In some examples of this embodiment, the loading module 34 is further configured to increase the number of pre-read hits of the target pre-read data position if it is detected that the target pre-read data position is in the pre-read position linked list.
[0069] In some examples of the present embodiment, the loading module 34 is further configured to determine whether there is sufficient space in the cache of the solid-state drive for storing the target pre-read data; if there is insufficient space in the cache, the nodes in the pre-read position linked list are sorted according to the access frequency, and the nodes whose access frequency is lower than a preset threshold are deleted; if there is sufficient space in the cache, the target pre-read data is loaded into the cache of the solid-state drive.
[0070] In some examples of this embodiment, the loading module 34 is further configured to insert the target pre-read data into the pre-read position linked list, and add the target pre-read data to the pre-read buffer table.
[0071] In some examples of this embodiment, the loading module 34 is further configured to periodically clean up the access history record table and / or the pre-read position linked list based on a preset time interval.
[0072] In some examples of this embodiment, the loading module 34 is specifically configured to obtain the current time and the last access time of each data block in the access history table; in the access history table, delete the unaccessed data blocks whose difference between the last access time and the current time exceeds a preset time threshold.
[0073] In some examples of this embodiment, the loading module 34 is further configured to count the access frequency of each data block in the pre-read position linked list based on a preset time interval; in the pre-read position linked list, delete the second data block and the node corresponding to the second data block whose access frequency is lower than the preset frequency threshold.
[0074] In some examples of this embodiment, the loading module 34 is specifically configured to query in the access history table in response to an erase operation request; if there is an erased third data block in the access history table, the record of the third data block and the data page access table corresponding to the third data block are deleted.
[0075] In some examples of this embodiment, the loading module 34 is specifically configured to query in the pre-read position linked list in response to a wipe operation request; if there is a node corresponding to the erased fourth data block in the pre-read position linked list, the record of the fourth data block and the pre-read buffer table corresponding to the fourth data block are deleted.
[0076] In some examples of this embodiment, the last access time of the currently accessed data block is obtained by querying the access history table; if the difference between the last access time and the current time is greater than the preset interval period, the acquisition of the target pre-read data is stopped; accordingly, the determination module 33 is further configured to determine the target pre-read data based on the weights of multiple data blocks and the weights of multiple data pages in the access history table if the difference between the last access time and the current time is less than or equal to the preset interval period.
[0077] It should be noted that for other corresponding descriptions of the functional units involved in the data processing device provided in this embodiment, reference can be made to Figure 1 The corresponding description in will not be repeated here.
[0078] Based on the above Figure 1 and Figure 2 The method shown in the embodiment also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the above-mentioned Figure 1 and Figure 2 The method shown.
[0079] Based on the above Figure 1 and Figure 2 The method shown in the embodiment also provides a computer program product, on which a computer program is stored, and when the computer program is executed by a processor, the above-mentioned Figure 1 and Figure 2 The method shown.
[0080] Based on this understanding, the technical solution of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, USB flash drive, mobile hard disk, etc.), including a number of instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute the methods of various implementation scenarios of the present application.
[0081] Based on the above Figure 1 and Figure 2 The method shown, and Figure 7 In order to achieve the above-mentioned purpose, the embodiment of the present application further provides an electronic device, such as a personal computer or a server, which includes a storage medium and a processor; the storage medium is used to store a computer program; the processor is used to execute the computer program to achieve the above-mentioned Figure 1 and Figure 2 The method shown.
[0082] In some embodiments, the above-mentioned physical device may also include a user interface, a network interface, a camera, a radio frequency (RF) circuit, a sensor, an audio circuit, a WI-FI module, etc. The user interface may include a display, an input unit such as a keyboard, etc., and the optional user interface may also include a USB interface, a card reader interface, etc. The network interface may include a standard wired interface, a wireless interface (such as a WI-FI interface), etc. in some embodiments.
[0083] Those skilled in the art will appreciate that the above-mentioned physical device structure provided in this embodiment does not constitute a limitation on the physical device, and may include more or fewer components, or a combination of certain components, or different arrangements of components.
[0084] The storage medium may also include an operating system and a network communication module. The operating system is a program that manages the hardware and software resources of the above-mentioned physical device, and supports the operation of the information processing program and other software and / or programs. The network communication module is used to realize the communication between the components inside the storage medium, and the communication with other hardware and software in the information processing physical device.
[0085] Through the description of the above implementation methods, those skilled in the art can clearly understand that the present application can be implemented by means of software plus necessary general hardware platforms, or by hardware. By applying the solution of this embodiment, compared with the current prior art, this embodiment improves the overall performance of the SSD by integrating an adaptive learning mechanism and an intelligent cache management strategy. The adaptive learning mechanism designs a set of algorithms that can dynamically adjust the selection of the pre-read position according to the actual access mode, maintain the access history table of the data block and its data page, and introduce a weight mechanism to reflect the access probability, give priority to the data blocks and data pages with higher weights for pre-reading, and clear the relevant access records and move out of the node when the data block is erased. The intelligent cache management strategy reasonably allocates the space of the pre-read buffer under the premise of limited memory size, regularly cleans up the data blocks with low access frequency to free up space for the data blocks that are more likely to be accessed, and improves the cache utilization. Finally, these algorithms are optimized and integrated into the firmware of the SSD to ensure its efficient operation and compatibility with other functions, which becomes the core function of improving the performance of the SSD. This systematic approach not only enhances the data access efficiency, but also significantly improves the overall performance and response speed of the storage system.
[0086] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0087] The above is only a specific implementation of the present application, so that those skilled in the art can understand or implement the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to these embodiments herein, but will conform to the widest scope consistent with the principles and novel features applied for herein.
Claims
1. A data processing method, characterized in that: include: Extract data access information from the solid state drive to determine the data block currently being accessed; Obtaining an access history table corresponding to the currently accessed data block, the access history table comprising a data block access history table and a data page access history table, the data block access history table being used to record accessed data blocks and weights of the accessed data blocks, the data page access history table being used to record accessed data pages and weights of the accessed data pages, the weights being used to reflect the probability of data blocks and data pages in the solid state drive being accessed; Determining target pre-read data based on weights of multiple data blocks and weights of multiple data pages in the access history record table; If it is detected that the position of the target pre-read data is not in the pre-read position linked list, the target pre-read data is loaded into the cache of the solid state drive.
2. The method according to claim 1, characterized in that The step of determining target pre-read data based on the weights of the plurality of data blocks and the plurality of data pages in the access history record table includes: According to the weights of the plurality of data blocks in the data block access history record table, a first preset number of data blocks are screened out from high to low; According to the weights of the plurality of data pages in the data page access history record table, for the plurality of data blocks in the first preset number of data blocks, filtering out a second preset number of data pages from high to low; The data in the second preset number of data pages are determined as the target pre-read data.
3. The method according to claim 2, characterized in that The method further comprises: In response to a read request for a first data block, updating an identifier and an access timestamp of the first data block into the access history record table; The weight of the first data block is updated based on the number of times the first data block is accessed, and the weight of the first data page corresponding to the first data block is updated based on the number of times the first data page is accessed.
4. The method according to claim 1, characterized in that: The method further comprises: If it is detected that the position of the target pre-read data is in the pre-read position linked list, the pre-read hit count of the position of the target pre-read data is increased.
5. The method according to claim 1, characterized in that Before loading the target pre-read data into the cache of the solid state drive, the method further includes: Determining whether there is enough space in the cache of the solid state drive to store the target pre-read data; If there is not enough space in the cache, the nodes in the pre-read position linked list are sorted according to access frequency, and nodes with access frequency lower than a preset threshold are deleted; If there is enough space in the cache, the target pre-read data is loaded into the cache of the solid state drive.
6. The method according to claim 5, characterized in that The loading of the target pre-read data into the cache of the solid state drive includes: The target pre-read data is inserted into the pre-read position linked list, and the target pre-read data is added to the pre-read buffer table.
7. The method according to claim 1, characterized in that The method further comprises: The access history record table and / or the pre-read position linked list are periodically cleared based on a preset time interval.
8. The method according to claim 7, characterized in that The access history record table is cleaned up regularly based on a preset time interval, including: Obtain the current time and the last access time of each data block in the access history record table; In the access history record table, unaccessed data blocks whose difference between the last access time and the current time exceeds a preset time threshold are deleted.
9. The method according to claim 7, characterized in that: The pre-read position linked list is periodically cleaned up based on a preset time interval, including: Based on a preset time interval, counting the access frequency of each data block in the pre-read position linked list; In the pre-read position linked list, a second data block whose access frequency is lower than a preset frequency threshold and a node corresponding to the second data block are deleted.
10. The method according to claim 1, characterized in that The method further comprises: In response to the erase operation request, querying the access history record table; If the erased third data block exists in the access history record table, the record of the third data block and the data page access table corresponding to the third data block are deleted.
11. The method according to claim 1, characterized in that: The method further comprises: In response to an erase operation request, querying the pre-read position linked list; If there is a node corresponding to the erased fourth data block in the pre-read position linked list, the record of the fourth data block and the pre-read buffer table corresponding to the fourth data block are deleted.
12. The method according to claim 1, characterized in that Before determining the target pre-read data based on the weights of the plurality of data blocks and the weights of the plurality of data pages in the access history record table, the method further includes: Obtaining the last access time of the currently accessed data block by querying the access history record table; If the difference between the last access time and the current time is greater than a preset interval period, then stop acquiring the target pre-read data; The step of determining target pre-read data based on the weights of the plurality of data blocks and the weights of the plurality of data pages in the access history record table comprises: If the difference between the last access time and the current time is less than or equal to the preset interval period, the target pre-read data is determined based on the weights of multiple data blocks and the weights of multiple data pages in the access history record table.
13. 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 12 is implemented.
14. An electronic device comprising a storage medium, a processor, and a computer program stored in the storage medium and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 12 is implemented.
15. A computer program product having a computer program stored thereon, characterized in that: When the computer program product is executed by a processor, the method according to any one of claims 1 to 12 is implemented.
Citation Information
Patent Citations
Real-time database history data organizational management method
CN102654863A
Data pre-reading method and device
CN117807040A
Data caching method, computer equipment, storage medium and program product
CN119322593A
Software configuration method and device
CN119415143A
Cited By
Response method and device of read-write request, electronic equipment and computer program product
CN120448137A
Simulator starting acceleration method and device, equipment and storage medium
CN120492053A
Solid state disk data pre-reading method based on access frequency
CN120508263A
Pre-reading method of solid state disk and solid state disk
CN120704608A
Data processing method, electronic equipment, system, storage medium and program product
CN121166043A