A method and system for maintaining data access consistency

By implementing data status control and address translation mechanisms in the cache space of SSD hard drives, the performance degradation and durability problems of traditional SSD hard drives under frequent writes are solved, efficient data access and consistency management are achieved, and the system is improved. performance and reliability.

CN118331508BActive Publication Date: 2024-09-20PENG TI STORAGE TECH (NANJING) CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202410764187.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-14
Publication Date
2024-09-20
Estimated Expiration
2044-06-14

AI Technical Summary

Technical Problem

Traditional SSD hard disks suffer from performance degradation and durability issues under frequent writes, and cannot meet the CPU's high access frequency and real-time requirements, resulting in low data access efficiency and difficulty in optimizing data consistency management.

Method used

By implementing data status control and address translation mechanisms in the cache space of the SSD, monitoring the host interface to capture read and write commands, arbitrating and parsing commands, generating new read and write commands, ensuring data consistency between cache and NAND media, utilizing The cache controller and NAND controller work together to reduce direct writes to NAND media and optimize data status management.

Benefits of technology

It improves data access speed and system performance, ensures data consistency, extends the service life of NAND media, improves system stability and reliability, adapts to concurrent processing capabilities in high-load environments, and reduces system latency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118331508B
    Figure CN118331508B
Patent Text Reader

Abstract

The present invention discloses a method and system for maintaining data access consistency, and relates to the field of data storage technology. The method includes: a host command controller monitors the host interface in real time, captures read and write commands, and arbitrates, parses and manages the read and write commands; an address conversion controller converts the target address in the read and write commands, and converts the logical address into a physical address; a data state controller records, converts and manages the data state of the target address, and generates new read and write commands, and sends them to a cache controller and a NAND controller; the cache controller and the NAND controller respectively perform read and write operations on the cache medium or the NAND medium according to the new read and write commands. The method of the present invention quickly responds to the host's read and write commands through the coordinated work of the cache controller and the NAND controller, utilizes the cache space of the SSD, maintains the consistency of data access without adding additional hardware overhead, and significantly reduces system latency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data storage, and in particular to a method and system for maintaining data access consistency. Background Art

[0002] In recent years, with the evolution of chip design and technology, the computing performance of the host CPU has been significantly improved. However, as an important memory in computer systems, the performance improvement of DRAM (Dynamic Random Access Memory) has not kept up with the growth rate of the CPU, forming an obvious performance bottleneck. In order to solve this problem, the computer system introduced the design of cache. By adding one or more layers of cache between the CPU and DRAM, the CPU can access the required data faster, thereby improving the performance of the overall system. The design of the cache is mainly aimed at the CPU's high-speed access to data. Existing data consistency solutions mainly focus on how to ensure that the CPU can maintain data consistency when accessing data in the cache.

[0003] With the rapid development of solid-state drive (SSD) technology, the introduction of concepts such as storage and computing integration, and the continuous updating of the Compute Express Link (CXL) protocol, SSD hard drives are no longer just used as traditional storage media, but have begun to play the role of CPU memory expansion. This transformation has led to tremendous changes in the usage scenarios and requirements of SSD hard drives.

[0004] In new application scenarios, the CPU has higher and higher access frequency and real-time requirements for SSD hard disks. Traditional SSD hard disks can no longer meet these new performance requirements due to the read and write characteristics of solid-state storage. For example, the write speed of SSD is usually lower than the read speed, and frequent writes may cause performance degradation and durability issues. These performance limitations are particularly prominent for new application scenarios that require frequent read and write data.

[0005] Therefore, how to solve the performance gap between CPU and DRAM, and fully utilize the storage advantages of SSD to improve the overall system performance and data access efficiency, and optimize data consistency management, has become an urgent problem to be solved. Summary of the invention

[0006] In view of the above problems, the present invention proposes a method and system for maintaining data access consistency, which utilizes the cache space of the SSD to maintain the consistency of data access without adding additional hardware overhead, thereby effectively improving the performance of the host CPU accessing NAND data.

[0007] In order to achieve the above object, the present invention is implemented by the following technical solutions:

[0008] A method for maintaining data access consistency, the method comprising:

[0009] The host command controller monitors the host interface in real time, captures read and write commands, and arbitrates, parses and manages the read and write commands, wherein the read and write commands carry a target address and a data operation type;

[0010] The address conversion controller converts the target address in the read and write commands, converting the logical address into a physical address, wherein the physical address includes a NAND address and a cache address;

[0011] The data status controller records, converts and manages the data status of the target address, and generates new read and write commands and sends them to the cache controller and NAND controller;

[0012] The cache controller performs read and write operations on the cache medium according to the new read and write commands, and the NAND controller performs read and write operations on the NAND medium according to the new read and write commands.

[0013] As a preferred solution of the present invention, the host command controller monitors the interface signal from the host in real time and captures all read and write commands from the host, wherein the read and write commands include read commands and write commands;

[0014] According to the predetermined priority rules, the captured read and write commands are arbitrated to determine the execution order of each read and write command to ensure that high-priority commands are processed first;

[0015] Parse the read and write commands after arbitration, and parse the target address and data operation type in the read and write commands;

[0016] Manage the parsed read and write commands to ensure that they can be correctly executed according to the parsed results;

[0017] Generate a control signal based on the analysis result, and send the generated control signal and the analyzed read and write command to the corresponding controller;

[0018] Monitor the processing status of the corresponding controller for read and write commands in real time, collect feedback information, and adjust and optimize the command execution process based on the feedback information.

[0019] As a preferred solution of the present invention, the address conversion controller receives the read and write commands parsed by the host command controller, parses the target address in the read and write commands, and identifies the logical address of the target address;

[0020] Search the corresponding physical address in the address mapping table according to the logical address. If the logical address has a corresponding physical address in the address mapping table, directly read the physical address; if the logical address has no corresponding physical address, generate a new physical address and update the address mapping table;

[0021] The converted physical address is passed to the data status controller together with the data operation type in the read and write commands.

[0022] As a preferred solution of the present invention, the data state controller receives the physical address from the address conversion controller and the data operation type in the read and write commands, and records the data state corresponding to each target address;

[0023] Convert the data state according to the current data state and the data operation type of the read and write commands;

[0024] Generate new read and write commands according to the converted data state and data operation type;

[0025] If the data corresponding to the target address in the new read / write command is stored in the NAND medium, the new read / write command is sent to the NAND controller;

[0026] If the data corresponding to the target address in the new read / write command is stored in the cache medium, the new read / write command is sent to the cache controller;

[0027] Monitor changes in data status in real time, collect feedback information from the NAND controller and cache controller, adjust and optimize the data status according to the feedback information, and update the data status table.

[0028] As a preferred solution of the present invention, the method of converting the data state according to the current data state and the data operation type of the read and write commands specifically includes:

[0029] For the data at the target address that has never been accessed, the data status is initialized to "invalid";

[0030] When the data at the target address is accessed for the first time, it needs to be loaded from the NAND medium to the cache medium, and the data status is marked as "loading";

[0031] Once the data is successfully written to the cache medium, the load is complete and the data status is updated to "available";

[0032] If the data is read in the "available" state, it will remain in the "available" state; if the data is replaced in the "available" state, the data state will be updated to "invalid"; if the data is fully or partially overwritten, the data state will be updated to "dirty data";

[0033] If the data is read in the "dirty data" state, it will remain in the "dirty data" state; if the data is replaced in the "dirty data" state, the data state will be updated to "unloaded" and written back to the NAND medium from the cache medium;

[0034] If the data is accessed again in the "unloading" state, the data status is updated to "dirty data"; if the data is successfully written back to the NAND medium in the "unloading" state, the unloading is completed and the data status is updated to "invalid".

[0035] A system for maintaining data access consistency, the system comprising:

[0036] A host command controller, used to monitor the host interface in real time, capture read and write commands, and arbitrate, parse and manage the read and write commands, wherein the read and write commands carry a target address and a data operation type;

[0037] An address conversion controller, used for converting the target address in the read and write commands, and converting the logical address into a physical address, wherein the physical address includes a NAND address and a cache address;

[0038] A data status controller is used to record, convert and manage the data status of the target address, and generate new read and write commands and send them to the cache controller and NAND controller;

[0039] A cache controller, used to perform read and write operations on the cache medium according to new read and write commands;

[0040] The NAND controller is used to perform read and write operations on the NAND medium according to new read and write commands.

[0041] As a preferred solution of the present invention, the host command controller includes:

[0042] An interface monitoring module, used for real-time monitoring of interface signals from the host, and capturing all read and write commands from the host, wherein the read and write commands include read commands and write commands;

[0043] The command arbitration module is used to arbitrate the captured read and write commands according to the predetermined priority rules, determine the execution order of each read and write command, and ensure that the high priority command is processed first;

[0044] A command parsing module is used to parse the read and write commands after arbitration, and parse the target address and data operation type in the read and write commands;

[0045] The command management module is used to manage the parsed read and write commands to ensure that the read and write commands can be correctly executed according to the parsed results;

[0046] A command sending module, used to generate a control signal based on the analysis result, and send the generated control signal and the analyzed read and write command to the corresponding controller;

[0047] The monitoring management module is used to monitor the processing status of the corresponding controller for read and write commands in real time, collect feedback information, and adjust and optimize the command execution process based on the feedback information.

[0048] As a preferred solution of the present invention, the address conversion controller includes:

[0049] An address parsing module is used to parse the target address in the read and write commands and identify the logical address in the target address;

[0050] The address conversion module is used to search the corresponding physical address in the address mapping table according to the logical address. If the logical address has a corresponding physical address in the address mapping table, the physical address is directly read; if the logical address has no corresponding physical address, a new physical address is generated and the address mapping table is updated;

[0051] The output module transmits the converted physical address together with the data operation type in the read and write commands to the data state controller;

[0052] The mapping table management module is used to maintain an address mapping table to record the mapping relationship between logical addresses and physical addresses.

[0053] As a preferred solution of the present invention, the data state controller includes:

[0054] A status recording module is used to record the data status corresponding to the target address;

[0055] The state conversion module is used to convert the data state according to the current data state and the data operation type of the read and write commands, including:

[0056] For the data at the target address that has never been accessed, the data status is initialized to "invalid";

[0057] When the data at the target address is accessed for the first time, it needs to be loaded from the NAND medium to the cache medium, and the data status is marked as "loading";

[0058] Once the data is successfully written to the cache medium, the load is complete and the data status is updated to "available";

[0059] If the data is read in the "available" state, it will remain in the "available" state; if the data is replaced in the "available" state, the data state will be updated to "invalid"; if the data is fully or partially overwritten, the data state will be updated to "dirty data";

[0060] If the data is read in the "dirty data" state, it will remain in the "dirty data" state; if the data is replaced in the "dirty data" state, the data state will be updated to "unloaded" and written back to the NAND medium from the cache medium;

[0061] If the data is accessed again in the "unloading" state, the data status is updated to "dirty data"; if the data is successfully written back to the NAND medium in the "unloading" state, the unloading is completed and the data status is updated to "invalid";

[0062] The state management module is used to monitor the changes of data state in real time, collect feedback information from the NAND controller and cache controller, adjust and optimize the data state according to the feedback information, and update the data state table;

[0063] A command generation module, used to generate new read and write commands according to the converted data state and data operation type, and send them to the NAND controller and the cache controller;

[0064] If the data corresponding to the target address in the new read / write command is stored in the NAND medium, the new read / write command is sent to the NAND controller;

[0065] If the data corresponding to the target address in the new read / write command is stored in the cache medium, the new read / write command is sent to the cache controller.

[0066] As a preferred solution of the present invention, the NAND controller and the cache controller each include a command parsing unit and an execution unit;

[0067] The command parsing unit is used to parse the target address and data operation type in the new read and write commands;

[0068] The execution unit is used to perform corresponding read and write operations on the NAND medium or the cache medium according to the parsing result of the command parsing unit.

[0069] The beneficial effects of the present invention are as follows: through the coordinated work of the cache controller and the NAND controller, the host's read and write commands can be quickly responded to, and the cache controller can directly read or write data from the cache medium, which greatly reduces the delay in accessing the NAND medium and improves the data access speed of the overall system; the data state controller ensures the consistency of data between different storage media by maintaining the data state of each target address. When the data is modified in the cache (becomes dirty data), the system will write the data back to the NAND medium at an appropriate time to ensure data consistency. Through effective data state management, data inconsistency problems are avoided and data reliability is improved; the data state conversion mechanism is used to effectively manage cache and NAND storage resources. The conversion of data between different states (such as "loading", "dirty data", "unloading", etc.) realizes efficient use of cache space. When data in the cache is replaced, the dirty data will be written back to the NAND, thereby freeing up cache space for storing new data and optimizing storage resources. utilization rate; when performing write operations, frequent direct writing to the NAND medium is avoided. The cache controller first performs write operations in the cache. When the data status is dirty data, it is written back to the NAND medium in a timely manner. This method reduces the write amplification effect and extends the service life of the NAND medium; the monitoring and management mechanism of the data status controller enables the system to process read and write requests of data in different states, ensure the correctness and consistency of data operations, and enhance the stability and reliability of the system through effective error handling mechanisms (such as handling read and write failures, invalid data, etc.); using parallel processing, the cache controller and NAND controller can process multiple read and write commands at the same time, improving the concurrent processing capability. This parallel processing mechanism increases the throughput of the system and adapts to the data access requirements under high load environments; during data access, the system gives priority to using data in the cache. When reading cache hit data, it can return the result immediately. While ensuring data consistency, it significantly reduces system latency and improves user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0070] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for describing the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative labor. Among them:

[0071] Figure 1 is a flow chart of the method of the present invention;

[0072] Figure 2 A schematic diagram of data state conversion in an embodiment of the present invention;

[0073] Figure 3It is a system modular structure diagram of the present invention. DETAILED DESCRIPTION

[0074] In order to make the purpose, technical solution and advantages of the embodiment of the present invention clearer, the technical solution of the embodiment of the present invention will be clearly and completely described below in conjunction with the drawings of the embodiment of the present invention. Obviously, the described embodiment is a part of the embodiment of the present invention, not all of the embodiments. Based on the described embodiment of the present invention, all other embodiments obtained by ordinary technicians in this field belong to the scope of protection of the present invention.

[0075] like Figure 1 FIG. 1 is an embodiment of the present invention, which provides a method for maintaining data access consistency, comprising the following steps:

[0076] S1: The host command controller monitors the host interface in real time, captures read and write commands, and arbitrates, parses, and manages the read and write commands. The read and write commands carry the target address and data operation type (read or write);

[0077] In one embodiment, step S1 specifically includes:

[0078] S11: The host command controller monitors the interface signals from the host in real time and captures all read and write commands from the host, including read commands and write commands, to ensure that no command is missed;

[0079] S12: arbitrating the captured read and write commands according to a predetermined priority rule, determining the execution order of each read and write command, ensuring that high-priority commands are processed first, and avoiding command conflicts;

[0080] S13: parsing the read and write commands after arbitration, parsing the target address, data operation type and related parameters in the read and write commands;

[0081] S14: managing the parsed read and write commands to ensure that the read and write commands can be correctly executed according to the parsing results, such as classifying the parsed read and write commands and sending them to corresponding controllers (such as an address translation controller, a NAND controller, and a cache controller);

[0082] S15: Generate a control signal based on the parsing result, and send the generated control signal and the parsed read and write command to the corresponding controller to ensure that each command can be delivered to the corresponding processing unit in a timely and accurate manner. The control signal is used to instruct the corresponding controller (such as the address translation controller, the NAND controller, and the cache controller) how to process these commands;

[0083] S16: Monitor the processing status of the corresponding controller for the read and write commands in real time, collect feedback information, and adjust and optimize the command execution process according to the feedback information to ensure the efficiency and consistency of the overall operation of the system.

[0084] The host command controller monitors and arbitrates the read and write commands of the host interface, which can ensure the system's real-time response to host commands, avoid command conflicts, and improve system efficiency. Through the arbitration mechanism, it ensures that high-priority commands can be executed in a timely manner, improving the overall performance of the system.

[0085] S2: The address conversion controller converts the target address in the read / write command and converts the logical address into a physical address, which includes a NAND address and a cache address.

[0086] In one embodiment, step S2 specifically includes:

[0087] S21: the address conversion controller receives the read / write command parsed by the host command controller, parses the target address in the read / write command, identifies the logical address of the target address, and determines the structure and format of the logical address, so as to perform subsequent address conversion operations;

[0088] S22: the address translation controller maintains an address mapping table to record the mapping relationship between the logical address and the physical address, searches the address mapping table for the corresponding physical address according to the logical address, and directly reads the physical address if the logical address has a corresponding physical address in the address mapping table; if the logical address has no corresponding physical address, generates a new physical address and updates the address mapping table;

[0089] S23: The converted physical address together with the data operation type in the read / write command is transmitted to the data state controller to ensure that the data state controller can perform correct operations according to the physical address.

[0090] The address conversion controller converts the target address in the read and write commands into NAND addresses and cache addresses, realizing address mapping between the host and the storage medium, improving the address conversion efficiency, and ensuring that the command can quickly and accurately locate the location of the storage medium.

[0091] S3: The data state controller records, converts and manages the data state of the target address, generates new read and write commands, and sends them to the cache controller and NAND controller;

[0092] The data status is closely related to each target address in the storage medium. Each target address has a corresponding data status record that describes the data status at the address.

[0093] In one embodiment, step S3 specifically includes:

[0094] S31: The data status controller receives the physical address and the data operation type in the read / write command from the address translation controller, and records the data status corresponding to each target address, including whether the data is valid, whether it needs to be updated, whether the data has been modified, etc.;

[0095] S32: converting the data state according to the current data state and the data operation type of the read / write command;

[0096] S33: Generate new read and write commands according to the converted data state and data operation type;

[0097] S34: If the data corresponding to the target address in the new read / write command is stored in the NAND medium, the new read / write command is sent to the NAND controller;

[0098] If the data corresponding to the target address in the new read / write command is stored in the cache medium, the new read / write command is sent to the cache controller;

[0099] S35: monitor the changes in data status in real time, collect feedback information from the NAND controller and cache controller, adjust and optimize the data status according to the feedback information, ensure the consistency and synchronization of system data, and update the data status table to ensure that the information in the data status table is always up to date and reflects the actual status of the current system.

[0100] The data state controller records and converts the data state, which can maintain the consistency of the data state and ensure the synchronization of data between different storage media; by generating new read and write commands, it can achieve efficient management of NAND and cache to avoid data inconsistency. Send new commands to the NAND controller and cache controller respectively. Each controller receives and processes its own commands independently, performs corresponding read and write operations, realizes parallel operations on different storage media, improves data processing efficiency, ensures that commands can be accurately sent to the corresponding controller, and realizes correct storage and reading of data. For example, when the host requests to modify certain data, the data state controller will generate a corresponding write command and update the data state to ensure the consistency of data in the cache and NAND media.

[0101] like Figure 2 As shown, in one specific embodiment, according to the current data state and the data operation type of the read and write commands, the data state is converted, and the method specifically includes:

[0102] For the data at the target address that has never been accessed, the data status is initialized to "invalid";

[0103] When the data at the target address is accessed for the first time, it needs to be loaded from the NAND medium to the cache medium, and the data status is marked as "loading";

[0104] Once the data is successfully written to the cache medium, the load is complete and the data status is updated to "available";

[0105] If the data is read in the "available" state, it will remain in the "available" state; if the data is replaced in the "available" state, the data state will be updated to "invalid"; if the data is fully or partially overwritten, the data state will be updated to "dirty data";

[0106] If the data is read in the "dirty data" state, it will remain in the "dirty data" state; if the data is replaced in the "dirty data" state, the data state will be updated to "unloaded" and written back to the NAND medium from the cache medium;

[0107] If the data is accessed again in the "unloading" state, the data status is updated to "dirty data"; if the data is successfully written back to the NAND medium in the "unloading" state, the unloading is completed and the data status is updated to "invalid".

[0108] S4: The cache controller performs read and write operations on the cache medium according to the new read and write commands, and the NAND controller performs read and write operations on the NAND medium according to the new read and write commands;

[0109] In one embodiment, the cache controller performs the following steps:

[0110] The cache controller receives a new read or write command generated by the data state controller, which contains the target address (physical address) and the operation type (read or write);

[0111] Parse new read and write commands, identify the target address and data operation type, and determine whether to perform a read or write operation;

[0112] The data status in the cache is searched based on the target address. If the data status is "available" or "dirty data", the read and write operations can continue. If the data status is "invalid" or "unloading", it may be necessary to wait or trigger other operations (such as loading from NAND).

[0113] If the operation type is read, the data at the target address is read from the cache medium, the read data is returned to the requester, and the data status is updated to "available" (if the original status is "loading");

[0114] If the operation type is write, the data is written to the target address of the cache medium, and the data status of the target address is updated to "dirty data";

[0115] Process cache hits and misses. If there is a cache hit, the read and write operations are performed directly in the cache. If there is a cache miss, the target data is not in the cache and the data may need to be loaded from the NAND media.

[0116] According to the read and write operation results, the data status of the target address in the data status table is updated. If the data status is "dirty data", the status is recorded for subsequent writing back to the NAND medium;

[0117] Feedback the operation results and current data status to the data status controller for subsequent management and operation.

[0118] The specific steps of the NAND controller are as follows:

[0119] The NAND controller receives a new read or write command generated by the data state controller, which contains the target address (physical address) and the operation type (read or write);

[0120] Parse read and write commands, identify the target address and operation type, and determine whether to perform a read or write operation;

[0121] Find the data status in the NAND medium according to the target address to confirm whether the data is valid or needs to be erased;

[0122] If the operation type is read, the data at the target address is read from the NAND medium, the read data is returned to the cache controller or the requester, and the data status is updated to "loading";

[0123] If the operation type is write, the data is written to the target address of the NAND medium. If the data status of the target address is "dirty data", it is necessary to perform an erase operation first and then perform a write operation;

[0124] If a write operation requires it, first perform an erase operation to clear the storage unit corresponding to the target address to ensure that the data can be written correctly;

[0125] According to the read and write operation results, the data status in the NAND medium is updated. If the data has been successfully written back, the update status is "invalid" or "available";

[0126] Feedback the operation results and current data status to the data status controller for subsequent management and operation.

[0127] The NAND controller implements data reading and writing to the NAND storage medium, provides large-capacity storage support, and improves the access speed and efficiency of the storage medium by optimizing read and write operations. For example, when the host requests to modify a certain data, the data state controller will generate a corresponding write command and update the data state to ensure the consistency of the data in the cache and NAND medium.

[0128] The cache controller provides high-speed cache support, which can accelerate data access and improve the overall system performance. Through the cooperation of cache and NAND media, the data storage and reading efficiency is optimized. For example, when the host requests to read a frequently accessed data, the cache controller will first check whether the data is in the cache. If so, it will read it directly from the cache, thereby reducing the time to access the NAND media and improving the reading speed.

[0129] like Figure 3 As shown, another embodiment of the present invention provides a system for maintaining data access consistency, including:

[0130] The host command controller is used to monitor the host interface in real time, capture read and write commands, and arbitrate, parse and manage the read and write commands. The read and write commands carry the target address and data operation type.

[0131] An address conversion controller is used to convert the target address in the read and write commands, and convert the logical address into a physical address, the physical address includes a NAND address and a cache address;

[0132] A data status controller is used to record, convert and manage the data status of the target address, and generate new read and write commands and send them to the cache controller and NAND controller;

[0133] A cache controller, used to perform read and write operations on the cache medium according to new read and write commands;

[0134] The NAND controller is used to perform read and write operations on the NAND medium according to new read and write commands.

[0135] In one specific embodiment, the host command controller includes:

[0136] The interface monitoring module is used to monitor the interface signals from the host in real time and capture all read and write commands from the host, including read commands and write commands;

[0137] The command arbitration module is used to arbitrate the captured read and write commands according to the predetermined priority rules, determine the execution order of each read and write command, and ensure that the high priority command is processed first;

[0138] A command parsing module is used to parse the read and write commands after arbitration, and parse the target address and data operation type in the read and write commands;

[0139] The command management module is used to manage the parsed read and write commands to ensure that the read and write commands can be correctly executed according to the parsed results;

[0140] A command sending module, used to generate a control signal based on the analysis result, and send the generated control signal and the analyzed read and write command to the corresponding controller;

[0141] The monitoring management module is used to monitor the processing status of the corresponding controller for read and write commands in real time, collect feedback information, and adjust and optimize the command execution process based on the feedback information.

[0142] In one specific embodiment, the address translation controller includes:

[0143] An address parsing module is used to parse the target address in the read and write commands and identify the logical address in the target address;

[0144] The address conversion module is used to search the corresponding physical address in the address mapping table according to the logical address. If the logical address has a corresponding physical address in the address mapping table, the physical address is directly read; if the logical address has no corresponding physical address, a new physical address is generated and the address mapping table is updated;

[0145] The output module transmits the converted physical address together with the data operation type in the read and write commands to the data state controller;

[0146] The mapping table management module is used to maintain an address mapping table to record the mapping relationship between logical addresses and physical addresses.

[0147] In one specific embodiment, the data state controller includes:

[0148] A status recording module is used to record the data status corresponding to the target address;

[0149] The state conversion module is used to convert the data state according to the current data state and the data operation type of the read and write commands, including:

[0150] For the data at the target address that has never been accessed, the data status is initialized to "invalid";

[0151] When the data at the target address is accessed for the first time, it needs to be loaded from the NAND medium to the cache medium, and the data status is marked as "loading";

[0152] Once the data is successfully written to the cache medium, the load is complete and the data status is updated to "available";

[0153] If the data is read in the "available" state, it will remain in the "available" state; if the data is replaced in the "available" state, the data state will be updated to "invalid"; if the data is fully or partially overwritten, the data state will be updated to "dirty data";

[0154] If the data is read in the "dirty data" state, it will remain in the "dirty data" state; if the data is replaced in the "dirty data" state, the data state will be updated to "unloaded" and written back to the NAND medium from the cache medium;

[0155] If the data is accessed again in the "unloading" state, the data status is updated to "dirty data"; if the data is successfully written back to the NAND medium in the "unloading" state, the unloading is completed and the data status is updated to "invalid";

[0156] The state management module is used to monitor the changes of data state in real time, collect feedback information from the NAND controller and cache controller, adjust and optimize the data state according to the feedback information, and update the data state table;

[0157] A command generation module, used to generate new read and write commands according to the converted data state and data operation type, and send them to the NAND controller and the cache controller;

[0158] If the data corresponding to the target address in the new read / write command is stored in the NAND medium, the new read / write command is sent to the NAND controller;

[0159] If the data corresponding to the target address in the new read / write command is stored in the cache medium, the new read / write command is sent to the cache controller.

[0160] In one specific embodiment, the NAND controller and the cache controller each include a command parsing unit and an execution unit;

[0161] The command parsing unit is used to parse the target address and data operation type in the new read and write commands;

[0162] The execution unit is used to perform corresponding read and write operations on the NAND medium or the cache medium according to the parsing result of the command parsing unit.

[0163] In summary, the present invention can quickly respond to the host's read and write commands through the coordinated work of the cache controller and the NAND controller. The cache controller can directly read or write data from the cache medium, which greatly reduces the delay in accessing the NAND medium and improves the data access speed of the overall system; the data state controller ensures the consistency of data between different storage media by maintaining the data state of each target address. When the data is modified in the cache (becomes dirty data), the system will write the data back to the NAND medium at an appropriate time to ensure data consistency. Through effective data state management, data inconsistency problems are avoided and data reliability is improved. The data state conversion mechanism is used to effectively manage cache and NAND storage resources. The conversion of data between different states (such as "loading", "dirty data", "unloading", etc.) realizes efficient use of cache space. When data in the cache is replaced, the dirty data will be written back to NAND, thereby freeing up cache space for storing new data, thereby optimizing storage resources. Utilization rate; when performing write operations, frequent direct writing to the NAND medium is avoided. The cache controller first performs write operations in the cache. When the data status is dirty data, it is written back to the NAND medium in a timely manner. This method reduces the write amplification effect and extends the service life of the NAND medium. The monitoring and management mechanism of the data status controller enables the system to process read and write requests of data in different states, ensure the correctness and consistency of data operations, and enhance the stability and reliability of the system through effective error handling mechanisms (such as handling read and write failures, invalid data, etc.); using parallel processing, the cache controller and NAND controller can process multiple read and write commands at the same time, improving the concurrent processing capability. This parallel processing mechanism increases the throughput of the system and adapts to the data access requirements in high-load environments; during data access, the system gives priority to using data in the cache. When reading cache hit data, it can return the result immediately. While ensuring data consistency, it significantly reduces system latency and improves user experience.

[0164] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of various changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A method for maintaining data access consistency, characterized in that: The method comprises: The host command controller monitors the host interface in real time, captures read and write commands, and arbitrates, parses and manages the read and write commands, wherein the read and write commands carry a target address and a data operation type; The host command controller monitors the interface signal from the host in real time and captures all read and write commands from the host, wherein the read and write commands include read commands and write commands; According to the predetermined priority rules, the captured read and write commands are arbitrated to determine the execution order of each read and write command to ensure that high-priority commands are processed first; Parse the read and write commands after arbitration, and parse the target address and data operation type in the read and write commands; Manage the parsed read and write commands to ensure that they can be correctly executed according to the parsed results; Generate a control signal based on the analysis result, and send the generated control signal and the analyzed read and write command to the corresponding controller; Monitor the processing status of read and write commands by the corresponding controller in real time, collect feedback information, and adjust and optimize the command execution process based on the feedback information; The address conversion controller converts the target address in the read and write commands, converting the logical address into a physical address, wherein the physical address includes a NAND address and a cache address; The data status controller records, converts and manages the data status of the target address, and generates new read and write commands and sends them to the cache controller and NAND controller; The data state controller receives the physical address from the address conversion controller and the data operation type in the read and write commands, and records the data state corresponding to each target address; Convert the data state according to the current data state and the data operation type of the read and write commands; Generate new read and write commands according to the converted data state and data operation type; If the data corresponding to the target address in the new read / write command is stored in the NAND medium, the new read / write command is sent to the NAND controller; If the data corresponding to the target address in the new read / write command is stored in the cache medium, the new read / write command is sent to the cache controller; Monitor changes in data status in real time, collect feedback information from the NAND controller and cache controller, adjust and optimize the data status based on the feedback information, and update the data status table; The cache controller performs read and write operations on the cache medium according to the new read and write commands, and the NAND controller performs read and write operations on the NAND medium according to the new read and write commands.

2. A method for maintaining data access consistency according to claim 1, characterized in that: The address conversion controller receives the read and write commands parsed by the host command controller, parses the target address in the read and write commands, and identifies the logical address of the target address; Search the corresponding physical address in the address mapping table according to the logical address. If the logical address has a corresponding physical address in the address mapping table, directly read the physical address; if the logical address has no corresponding physical address, generate a new physical address and update the address mapping table; The converted physical address is passed to the data status controller together with the data operation type in the read and write commands.

3. A method for maintaining data access consistency according to claim 1, characterized in that: The method of converting the data state according to the current data state and the data operation type of the read and write commands specifically includes: For the data at the target address that has never been accessed, the data status is initialized to "invalid"; When the data at the target address is accessed for the first time, it needs to be loaded from the NAND medium to the cache medium, and the data status is marked as "loading"; Once the data is successfully written to the cache medium, the load is complete and the data status is updated to "available"; If the data is read in the "available" state, it will remain in the "available" state; if the data is replaced in the "available" state, the data state will be updated to "invalid"; if the data is fully or partially overwritten, the data state will be updated to "dirty data"; If the data is read in the "dirty data" state, it will remain in the "dirty data" state; if the data is replaced in the "dirty data" state, the data state will be updated to "unloaded" and written back to the NAND medium from the cache medium; If the data is accessed again in the "unloading" state, the data status is updated to "dirty data"; if the data is successfully written back to the NAND medium in the "unloading" state, the unloading is completed and the data status is updated to "invalid".

4. A system for maintaining data access consistency, characterized in that: The system comprises: A host command controller, used to monitor the host interface in real time, capture read and write commands, and arbitrate, parse and manage the read and write commands, wherein the read and write commands carry a target address and a data operation type; An address conversion controller, used for converting the target address in the read and write commands, and converting the logical address into a physical address, wherein the physical address includes a NAND address and a cache address; A data status controller is used to record, convert and manage the data status of the target address, and generate new read and write commands and send them to the cache controller and NAND controller; A cache controller, used to perform read and write operations on the cache medium according to new read and write commands; A NAND controller, used to perform read and write operations on the NAND medium according to new read and write commands; The host command controller comprises: An interface monitoring module, used for real-time monitoring of interface signals from the host, and capturing all read and write commands from the host, wherein the read and write commands include read commands and write commands; The command arbitration module is used to arbitrate the captured read and write commands according to the predetermined priority rules, determine the execution order of each read and write command, and ensure that the high priority command is processed first; A command parsing module is used to parse the read and write commands after arbitration, and parse the target address and data operation type in the read and write commands; The command management module is used to manage the parsed read and write commands to ensure that the read and write commands can be correctly executed according to the parsed results; A command sending module, used to generate a control signal based on the analysis result, and send the generated control signal and the analyzed read and write command to the corresponding controller; The monitoring management module is used to monitor the processing status of the corresponding controller for read and write commands in real time, collect feedback information, and adjust and optimize the command execution process according to the feedback information; The address conversion controller comprises: An address parsing module is used to parse the target address in the read and write commands and identify the logical address in the target address; The address conversion module is used to search the corresponding physical address in the address mapping table according to the logical address. If the logical address has a corresponding physical address in the address mapping table, the physical address is directly read; if the logical address has no corresponding physical address, a new physical address is generated and the address mapping table is updated; The output module transmits the converted physical address together with the data operation type in the read and write commands to the data state controller; A mapping table management module is used to maintain an address mapping table to record the mapping relationship between logical addresses and physical addresses; The data state controller comprises: A status recording module is used to record the data status corresponding to the target address; The state conversion module is used to convert the data state according to the current data state and the data operation type of the read and write commands, including: For the data at the target address that has never been accessed, the data status is initialized to "invalid"; When the data at the target address is accessed for the first time, it needs to be loaded from the NAND medium to the cache medium, and the data status is marked as "loading"; Once the data is successfully written to the cache medium, the load is complete and the data status is updated to "available"; If the data is read in the "available" state, it will remain in the "available" state; if the data is replaced in the "available" state, the data state will be updated to "invalid"; if the data is fully or partially overwritten, the data state will be updated to "dirty data"; If the data is read in the "dirty data" state, it will remain in the "dirty data" state; if the data is replaced in the "dirty data" state, the data state will be updated to "unloaded" and written back to the NAND medium from the cache medium; If the data is accessed again in the "unloading" state, the data status is updated to "dirty data"; if the data is successfully written back to the NAND medium in the "unloading" state, the unloading is completed and the data status is updated to "invalid"; The state management module is used to monitor the changes of data state in real time, collect feedback information from the NAND controller and cache controller, adjust and optimize the data state according to the feedback information, and update the data state table; A command generation module, used to generate new read and write commands according to the converted data state and data operation type, and send them to the NAND controller and the cache controller; If the data corresponding to the target address in the new read / write command is stored in the NAND medium, the new read / write command is sent to the NAND controller; If the data corresponding to the target address in the new read / write command is stored in the cache medium, the new read / write command is sent to the cache controller.

5. A system for maintaining data access consistency according to claim 4, characterized in that: The NAND controller and cache controller each include a command parsing unit and an execution unit; The command parsing unit is used to parse the target address and data operation type in the new read and write commands; The execution unit is used to perform corresponding read and write operations on the NAND medium or the cache medium according to the parsing result of the command parsing unit.

Citation Information

Cited By

  • Multi-level cache implementation method and system suitable for nonvolatile storage data

    CN121560779A

  • A multi-level cache implementation method and system suitable for non-volatile storage data

    CN121560779B