SSD IO conflict processing method and device, computer equipment and storage medium
By introducing hashing algorithms and hash arrays in SSD to manage IO conflicts, the performance bottlenecks and log space consumption problems caused by frequent queries and updates of FTL tables are solved, and more efficient IO processing and more stable system performance are achieved.
Patent Information
- Application Number
- CN202510242785.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-03
- Publication Date
- 2025-06-20
AI Technical Summary
When existing enterprise-level SSDs handle IO conflicts, frequent queries and updates of FTL tables lead to performance bottlenecks, and excessive log space consumption, affecting system performance and reliability.
By introducing a hash algorithm to classify IO write commands, avoid frequent search and modification operations directly in the FTL table, use a hash array to record the hash_id of the IO command being processed, and reduce the burden and log count of the FTL table.
It significantly reduces table search and modification consumption on the main IO path, improves the overall IO processing efficiency of SSD, reduces log space consumption, and improves the stability and durability of the system.
Smart Images

Figure CN120179165A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to solid state drive technology, and more particularly to a method, device, computer device and storage medium for SSD IO conflict handling. Background Art
[0002] In enterprise storage systems, solid state drives (SSDs) have become key components for enhancing data storage and processing performance due to their high speed, low latency, and high reliability characteristics. To improve the efficiency of SSDs in processing input / output (IO) commands, especially in concurrent IO operation scenarios to avoid data conflicts, modern enterprise SSDs widely adopt flash translation layer (FTL) technology to manage the mapping relationship between underlying physical flash cells and upper layer logical addresses.
[0003] The FTL table, as a core component of FTL technology, is responsible for recording the mapping information from logical addresses to physical addresses and plays a key role in conflict detection and scheduling during the execution of IO commands. When an SSD receives an IO command, it first accesses the FTL table to check whether there are any outstanding write commands in the target read / write area, that is, to determine whether there are data conflicts. If a conflict is detected, the newly received IO command will be temporarily stored in the cache and executed after the current conflict is resolved; if no conflict is detected, the FTL table will be updated and the corresponding area will be marked as a conflict state to indicate the ongoing data operation, thus preventing subsequent commands from causing data overwrite or damage.
[0004] However, the current IO conflict handling mechanism based on the FTL table has several significant drawbacks, which limit the further improvement of SSD performance:
[0005] Performance bottleneck: Whether an IO command causes a conflict or not, the SSD needs to perform FTL table query and update operations. These operations involve complex address mapping calculations and data structure modifications, which become key factors affecting the overall read / write performance of the SSD. Frequent table lookups and table modifications not only increase additional processing latency but also consume precious processor resources, thus becoming an obvious performance bottleneck in high-load environments.
[0006] Log space consumption: Each modification of the FTL table generates corresponding modification records, which are crucial for maintaining data consistency and supporting data recovery. However, as the amount of IO operations increases, the accumulation of modification records will cause the log storage space to expand rapidly. Especially in high-concurrency write scenarios, the log volume almost doubles, which not only increases the complexity of storage management but also may trigger additional garbage collection or data migration operations due to insufficient log space, further affecting the performance and lifespan of the SSD.
[0007] In summary, although the existing enterprise-level SSD's method of using the FTL table to handle IO conflicts ensures data consistency and security to a certain extent, its inherent performance overhead and log space consumption problems need to be solved urgently. Therefore, developing a new technology that can efficiently manage IO conflicts, reduce the operation frequency of the FTL table, and optimize the utilization rate of log storage is of great significance for improving the overall performance and reliability of SSDs. Summary of the Invention
[0008] The purpose of the present invention is to overcome the deficiencies of the prior art and provide a method, device, equipment, and medium for handling SSD IO conflicts.
[0009] To solve the above technical problems, the present invention adopts the following technical solutions:
[0010] In the first aspect, a method for handling SSD IO conflicts is provided, including:
[0011] Obtain an IO write command sent by the host;
[0012] Calculate hash_id based on the address LPA carried in the IO write command;
[0013] Determine whether the hash array contains the chained information corresponding to hash_id;
[0014] If the hash array does not contain the chained information corresponding to hash_id, then add the chained information corresponding to hash_id to the hash array;
[0015] Execute the write operation in the hash array until the data writing is completed.
[0016] In the second aspect, a device for handling SSD IO conflicts is provided, including:
[0017] An acquisition unit for obtaining an IO write command sent by the host;
[0018] A first calculation unit for calculating hash_id based on the address LPA carried in the IO write command;
[0019] A first judgment unit for determining whether the hash array contains the chained information corresponding to hash_id;
[0020] A first addition unit for adding the chained information corresponding to hash_id to the hash array if the hash array does not contain the chained information corresponding to hash_id;
[0021] A first execution unit for executing the write operation in the hash array until the data writing is completed.
[0022] In a third aspect, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the above SSD IO conflict handling method are implemented.
[0023] In a fourth aspect, a computer-readable storage medium is provided. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the above SSD IO conflict handling method are implemented.
[0024] For the above SSD IO conflict handling method, by introducing a hash algorithm to classify and manage the IO write commands received from the host, it effectively avoids frequent lookup and modification operations directly in the FTL table, significantly reducing the table lookup, modification, and consumption on the main IO path, enabling the SSD to respond and execute IO requests more quickly, thereby greatly improving the overall IO processing efficiency. Additionally, traditional IO conflict handling often requires frequent access and update of the FTL table, which not only increases system overhead but may also cause additional latency. However, in the present invention, by maintaining an independent hash array to record the hash_id of the IO commands being processed, the need to directly operate on the FTL table is avoided, effectively reducing the burden on the FTL table and the number of logs generated due to FTL table operations, further enhancing the stability and durability of the SSD.
[0025] The present invention will be further described below in conjunction with the accompanying drawings and specific embodiments. Description of the Drawings
[0026] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings in the following description are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0027] Figure 1 It is a schematic flowchart of the SSD IO conflict handling method provided by the embodiment of the present invention;
[0028] Figure 2 It is a schematic application scenario diagram of the processing of newly arrived IO commands in a scenario without IO conflicts provided by the embodiment of the present invention;
[0029] Figure 3 It is a schematic application scenario diagram of the processing of newly arrived IO commands in a scenario with IO conflicts provided by the embodiment of the present invention;
[0030] Figure 4 It is a schematic application scenario diagram of special processing in a scenario with IO conflicts provided by the embodiment of the present invention;
[0031] Figure 5 Schematic block diagram of the SSD IO conflict handling device provided by the embodiment of the present invention;
[0032] Figure 6 It is a schematic structural diagram of a computer device in an embodiment of the present invention. Specific embodiments
[0033] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
[0034] It should be understood that when used in this specification and the appended claims, the terms "comprising" and "including" indicate the presence of the described features, wholes, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components, and / or their combinations.
[0035] It should also be understood that the terms used in this specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in this specification of the present invention and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an", and "the" are intended to include the plural forms.
[0036] It should be further understood that the term " / and" used in this specification of the present invention and the appended claims refers to any combination and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0037] Please refer to Figures 1 to 4 In the specific embodiment shown, the present invention discloses a method for handling SSD IO conflicts, including the following steps:
[0038] Among them, referring to Figure 1 and Figure 2 shown, S110, obtain the IO write command issued by the host;
[0039] Specifically, the SSD is connected to the host system through its internal interfaces (such as PCIe, SATA, etc.). The SSD firmware contains a program module specifically responsible for listening to these interfaces. When the host system needs to write data to the SSD, it sends an IO write command through the interface. The interface listening module of the SSD captures these commands in real time and passes them to the subsequent IO processing flow. The received IO write commands usually contain multiple key information, such as logical page address (LPA), data length, data checksum, etc. The command parsing module in the SSD firmware is responsible for parsing these commands and extracting the necessary information for subsequent processing.
[0040] By implementing the above technical feature of obtaining the IO write command issued by the host, the following technical effects are brought:
[0041] Ensure the integrity and accuracy of the command: Through interface listening and command parsing, the SSD can accurately capture the IO write command issued by the host and extract all necessary information, which ensures the accuracy and reliability of the subsequent IO processing flow.
[0042] Improve the response speed of IO processing: Temporarily storing the received IO write commands in the command cache allows the SSD to preload and prepare the next command while processing the current command, which reduces the waiting time for command processing and improves the response speed of IO processing.
[0043] Enhance the robustness of the system: The interface listening module can continuously monitor the connection status with the host, ensuring that in case of connection interruption or abnormality, it can be detected in time and corresponding recovery measures can be taken, which enhances the robustness and stability of the SSD system.
[0044] Lay the foundation for conflict detection and handling: Accurately obtaining and parsing the IO write command is a prerequisite for subsequent conflict detection and handling. Only by mastering the detailed information of the command can the SSD effectively judge whether the new command conflicts with the existing commands and take corresponding handling measures.
[0045] S120, calculate the hash_id according to the address LPA carried in the IO write command;
[0046] Specifically, the address LPA is carried during IO read and write, and a hash_id is obtained by performing a hash calculation on the LPA. The range of the hash_id is 0 to hash_id_max. When calculating the hash_id, the current IO conflict range to be processed needs to be passed in, and the default is 0 to max_lpa, that is, all LPAs globally.
[0047] That is to say, when the SSD receives an IO write command sent by the host, it first parses the command to extract the LPA information therein. This LPA is a key identifier used within the SSD to locate the data storage position. Before performing the hash calculation, some key parameters need to be configured, including the type of hash function (such as MD5, SHA-1, CRC, etc.), the length of the hash table (i.e., hash_id_max + 1, because the range of hash_id is from 0 to hash_id_max), and the current IO conflict range being processed (by default, the global range 0 to max_lpa, where max_lpa is the maximum LPA value that the SSD can recognize). Using the configured hash function and parameters, a hash calculation is performed on the extracted LPA. This calculation process maps the LPA to a fixed hash value range, i.e., 0 to hash_id_max. The calculated hash value is the hash_id corresponding to the IO write command. The obtained hash_id will be used in the subsequent IO conflict detection and handling processes. Usually, this hash_id will be stored together with other key information of the IO command in a certain data structure (such as a hash array) inside the SSD for quick retrieval and comparison.
[0048] By implementing the above technical feature of calculating the hash_id based on the address LPA carried in the IO write command, the following technical effects are brought:
[0049] Efficient conflict detection: By mapping the LPA to the hash_id, the SSD can detect IO conflicts in an efficient manner. Due to the characteristics of the hash function, the same or similar LPA values will be mapped to the same hash_id, which makes the conflict detection fast and simple.
[0050] Reduced memory consumption: Using the hash_id instead of the original LPA for conflict detection and handling can significantly reduce the memory consumption. Because the hash_id is usually a numerical value with a fixed length, while the LPA may be a relatively long address value. In addition, by restricting the length of the hash table (i.e., hash_id_max + 1), the SSD can further control the memory usage.
[0051] Improved IO processing speed: Since the conflict detection becomes efficient and the memory consumption is reduced, the SSD can process IO requests faster, which improves the overall IO processing speed and enables the SSD to better meet the high-performance storage requirements.
[0052] Enhance system scalability: Use a hash function to map LPA to hash_id, enabling the SSD to easily adapt to different storage space sizes and different modes of IO loads. As the SSD capacity increases and the IO load changes, simply adjusting the parameters of the hash function and the length of the hash table can maintain the system's performance and stability.
[0053] S130, determine whether there is chained information corresponding to hash_id in the hash array;
[0054] Specifically, at the corresponding index position in the hash array, what is stored may be a pointer or reference that points to a chained data structure (such as a linked list, tree, etc.). This chained data structure is used to store IO requests or data items with the same hash_id but different LPAs (Logical Page Addresses). Therefore, after accessing the corresponding index of the hash array, it is necessary to check whether the chained information at this position exists and whether it contains the entry corresponding to the target hash_id. If the entry corresponding to the target hash_id is found in the chained information, it indicates a conflict, which may be because multiple IO requests are mapped to the same hash_id. At this time, conflict resolution strategies such as linear probing, quadratic probing, rehashing, or chaining method need to be adopted.
[0055] By implementing the above technical feature of determining whether there is chained information corresponding to hash_id in the hash array, the following technical effects are brought:
[0056] Improve conflict detection efficiency: By combining the use of the hash array and the chained data structure, it is possible to quickly determine whether a certain hash_id has a conflict, which improves the efficiency of conflict detection and enables the SSD to respond and process IO requests faster.
[0057] Optimize memory usage: Using the hash array and the chained data structure can effectively reduce memory waste. Because the size of the hash array is limited and its length can be adjusted to adapt to different storage requirements and IO loads. At the same time, the chained data structure only stores entries with the same hash_id, avoiding unnecessary memory occupation.
[0058] Enhance system scalability: This implementation enables the SSD to easily adapt to the increase in storage capacity and the change in IO load. When the storage capacity of the SSD increases, the performance of the system can be maintained by expanding the size of the hash array and the capacity of the chained data structure. At the same time, when the IO load changes, the response speed and processing ability of the system can be optimized by adjusting the parameters of the hash function and the conflict resolution strategy.
[0059] Improve data access speed: Due to the improved conflict detection efficiency and optimized memory usage, SSDs can access and process data faster, which improves data access speed and enables SSDs to better meet high-performance storage requirements.
[0060] S140, if the hash array does not contain the chained information corresponding to hash_id, then add the chained information corresponding to hash_id to the hash array;
[0061] Specifically, access the corresponding index position of the hash array and check whether chained information has been stored at this position. If it is empty (i.e., no chained information is stored), then prepare to add new chained information. If the index position is empty, create a new chained data structure (such as a linked list node) to store the entry corresponding to this hash_id. This entry usually contains hash_id, relevant LPA (Logical Page Address) information, and possibly other metadata. Add the newly created chained information (linked list node) to the corresponding index position of the hash array, which is usually achieved by storing the pointer or reference of the linked list node in the corresponding element of the hash array. In some cases, if the corresponding index position of the hash array already stores a chained data structure (such as a linked list), but the linked list does not contain an entry for the target hash_id, then the new entry needs to be added to the end or an appropriate position of the linked list.
[0062] By implementing the above technical feature of adding the chained information corresponding to hash_id to the hash array, the following technical effects are brought:
[0063] Support dynamic expansion: This implementation enables the hash array to dynamically expand its storage capacity. When a new IO request is mapped to a new hash_id, if the hash array does not yet contain the chained information corresponding to this hash_id, it can be easily added, which supports the SSD's adaptability to the growing IO load.
[0064] Improve conflict resolution flexibility: By adding chained information to the hash array, the SSD can flexibly handle IO conflicts. When multiple IO requests are mapped to the same hash_id, these requests can be stored in the chained data structure and processed through appropriate conflict resolution strategies (such as linked list traversal, rehashing, etc.).
[0065] Optimize memory usage: This implementation avoids unnecessary memory waste. Only when the hash array actually lacks the chained information corresponding to a certain hash_id will a new chained data structure be added, which ensures the effective utilization of memory.
[0066] Simplify the IO processing flow: By directly storing the chained information in the hash array, the SSD can access and process IO requests faster, which simplifies the IO processing flow and improves the overall storage performance.
[0067] S150. Perform the write operation in the hash array until the data writing is completed.
[0068] Specifically, after the chained information is prepared, the SSD starts to perform the write operation. This step usually involves transferring data from the memory buffer to the storage medium of the SSD and updating the relevant metadata inside the SSD (such as the mapping table from LPA to PPA, etc.). The write operation needs to ensure the integrity and consistency of the data to avoid data corruption or loss. During the execution of the write operation, the SSD needs to monitor the progress of the write operation in real time, which can be achieved by checking the write pointer, counter, or other status information. When the write operation is completed, the SSD updates its internal state and notifies the host or upper-layer software that the write operation has been completed. If an exception occurs during the execution of the write operation (such as power failure, storage medium damage, etc.), the SSD needs to adopt appropriate error handling strategies to ensure the reliability and integrity of the data, which may include using a backup power supply, performing data recovery operations, or notifying the upper-layer software to perform error handling.
[0069] By implementing the above-mentioned performing the write operation in the hash array until the data writing is completed, this technical feature brings the following technical effects:
[0070] Improve data writing efficiency: By combining the use of the hash array and the chained data structure, the SSD can quickly locate the storage location of the data to be written and perform the write operation, which improves the data writing efficiency and reduces the latency of the write operation.
[0071] Optimize memory usage: The use of the chained data structure avoids unnecessary memory waste. Only when new data needs to be written, the chained information will be created or updated in the hash array, which ensures the effective utilization of memory.
[0072] Enhance data reliability: By monitoring the progress of the write operation in real time and handling write operation exceptions, the SSD can ensure the reliability and integrity of the data. Even in case of an exception, it can adopt appropriate error handling strategies to recover the data or notify the upper-layer software to perform error handling.
[0073] Support concurrent write operations: The design of the hash array and the chained data structure enables the SSD to support concurrent write operations. Multiple write requests can be simultaneously mapped to different hash_ids and stored and processed through the chained data structure, which improves the concurrent processing ability of the SSD and enables it to better meet the high-performance storage requirements.
[0074] Please refer to Figure 1 and Figure 3 As shown, in one embodiment, after the step S130, the following steps are further included:
[0075] S160, if the hash array contains the chained list information corresponding to hash_id, then traverse the LPA fields in the chained list information corresponding to hash_id;
[0076] Specifically, if the corresponding index position in the hash array actually stores the chained list information, then it is necessary to start traversing this chained list information. The traversal process usually starts from the head of the chained list and accesses each linked list node or tree node one by one until the entire chained list is traversed. During the traversal of the chained list information, it is necessary to access the LPA fields in each node. The LPA field stores the logical page address of the data associated with the current hash_id and is the key information for subsequent data access or processing. According to the LPA field information accessed, corresponding data access, modification, deletion, etc. operations can be performed, and the specific content of these operations depends on the IO processing flow and data management strategy of the SSD.
[0077] By implementing the above technical feature of performing write operations in the hash array until the data writing is completed, the following technical effects are brought:
[0078] Improve data access efficiency: By traversing the LPA fields in the chained list information corresponding to hash_id, the SSD can quickly locate the logical page address of the data associated with a specific hash_id, thereby improving the data access efficiency.
[0079] Support data concurrent processing: Due to the design of the hash array and the chained list data structure, the SSD can process multiple data entries with the same hash_id but different LPAs simultaneously, which supports data concurrent processing and improves the overall performance of the SSD.
[0080] Enhance data consistency: Traversing the LPA fields in the chained list information can ensure that all data associated with a specific hash_id is correctly processed, which helps to maintain data consistency and prevent data loss or corruption.
[0081] Optimize memory usage: The use of the chained list data structure avoids unnecessary memory waste. Only when it is necessary to process the data associated with a specific hash_id, the chained list information will be traversed, which optimizes the memory usage efficiency.
[0082] Support flexible data management strategies: The implementation of this technical feature enables the SSD to support flexible data management strategies. For example, operations such as sorting, grouping, or filtering data can be performed according to the information in the LPA field to meet different application requirements.
[0083] S170, determine whether there is chained information corresponding to the hash_id with the same LPA field in the current IO write command; if there is no chained information corresponding to the hash_id with the same LPA field in the current IO write command, then jump to execute the operation of adding the chained information corresponding to the hash_id to the hash array;
[0084] Specifically, during the process of traversing the chained information, if a node with the same LPA field as that in the current IO write command is found, it indicates that there is indeed chained information corresponding to the hash_id with the same LPA field in the current IO write command. At this time, the system can decide whether to overwrite the original data, update the metadata, or perform other operations according to the specific application scenarios and requirements. If no node with the same LPA field as that in the current IO write command is found after traversing the entire chained information, it indicates that there is no chained information corresponding to the hash_id with the same LPA field in the current IO write command. At this time, the system needs to jump to execute the logic of adding the chained information corresponding to the hash_id to the hash array.
[0085] By implementing the technical feature of determining whether there is chained information corresponding to the hash_id with the same LPA field in the current IO write command, the following technical effects are brought:
[0086] Avoid duplicate data writing: By determining whether there is chained information corresponding to the hash_id with the same LPA field in the current IO write command, the system can avoid duplicate data writing, which helps to save storage space and improve writing efficiency.
[0087] Improve data consistency: Ensuring that each hash_id corresponds to only one unique LPA field value helps to maintain data consistency, which can prevent data corruption or loss caused by data conflicts or incorrect writing.
[0088] Optimize the IO processing flow: The implementation of this technical feature makes the IO processing flow more efficient and flexible. The system can decide whether to update the existing data or add new data according to the actual situation, thereby improving the overall storage performance.
[0089] Support concurrent writing: Due to the design of the hash array and the chained data structure, the system can process multiple IO write commands simultaneously. Even if multiple commands have the same hash_id, the system can distinguish them by comparing the LPA fields, thus supporting concurrent writing.
[0090] S180. If there is chained information corresponding to a hash_id with the same LPA field in the current IO write command, then increase the chained information corresponding to the hash_id with the same LPA field to the conflict chain.
[0091] Specifically, once a conflict is detected, the system does not immediately overwrite or delete the original chained information. Instead, it increases the chained information (or the key information therein) corresponding to the hash_id with the same LPA field to a dedicated conflict chain. The conflict chain is a special data structure used to store and manage all chained information that has conflicts. When increasing the chained information to the conflict chain, the system records necessary metadata, such as the time when the conflict occurred, the hash_id involved, and the LPA field value, etc., for subsequent analysis and processing. The information in the conflict chain can be queried and analyzed by system administrators or automated programs to determine the cause of the conflict and the solution. According to the requirements of the application scenario, the system can adopt different strategies to process the information in the conflict chain, such as merging conflict data, discarding old data, or performing other custom operations.
[0092] By implementing the technical feature of increasing the chained information corresponding to the hash_id with the same LPA field to the conflict chain, the following technical effects are brought:
[0093] Avoid data loss: By increasing the conflicting chained information to the conflict chain, the system can retain the original data and avoid accidentally losing data during the conflict handling process.
[0094] Improve data consistency: The existence of the conflict chain enables the system to track and manage all conflicting chained information, thus ensuring that data consistency is not damaged when handling conflicts.
[0095] Enhance system flexibility: System administrators or automated programs can flexibly select strategies for handling conflicts based on the information in the conflict chain to adapt to different application scenarios and requirements.
[0096] Optimize the IO processing flow: By separately managing the conflicting chained information, the system can process IO write commands more efficiently and reduce the additional latency caused by conflict handling.
[0097] S190. Execute the write operation in the conflict chain until the data writing is completed.
[0098] Specifically, when the system detects a conflict in the LPA field between the chained information corresponding to the hash_id in the IO write command and the existing chained information, these write operations are added to the conflict chain for waiting to be processed. The system will periodically check the write operations in the conflict chain to determine whether these operations can be executed. When the conflict condition is resolved (for example, the relevant data block has been released or rewritten, or data consistency has been ensured through other mechanisms), the system will take out the corresponding write operations from the conflict chain and execute them. During the execution process, the system will ensure data integrity and consistency, and at the same time update the relevant metadata and data structures. Once the write operation is completed, the system will verify whether the data has been successfully written to the target location. If the write operation is successful, the system will remove the write operation from the conflict chain and update the relevant status information. If the write operation fails, the system will handle it according to the preset retry policy, such as retrying the write operation or logging the error.
[0099] By implementing the technical feature of adding the chained information corresponding to the hash_id with the same LPA field to the conflict chain, the following technical effects are brought:
[0100] Improve data consistency: By adding conflicting write operations to the conflict chain and waiting for the conditions to be resolved before execution, the system can ensure data integrity and consistency, and avoid data conflict problems caused by concurrent writes.
[0101] Enhance system stability: The design of the conflict chain enables the system to manage conflicting write operations in an orderly manner, avoiding system instability or crashes caused by disorderly execution.
[0102] Optimize IO performance: Although the introduction of the conflict chain will increase certain system overhead, in the long run, it helps to reduce the IO waiting time and retry times caused by data conflicts, thus optimizing the overall IO performance.
[0103] Support concurrent writes: The existence of the conflict chain enables the system to handle multiple concurrent write requests simultaneously. Even if there are conflicts between these requests, the system can manage and resolve these conflicts through the conflict chain, thus improving the system's concurrent write ability.
[0104] Easy to troubleshoot and recover: When the system fails or there are data inconsistency problems, the records in the conflict chain can be used as important bases for troubleshooting and recovery. By analyzing the write operations and execution status in the conflict chain, system administrators can quickly locate the cause of the problem and take corresponding recovery measures.
[0105] Please refer to Figure 1 and Figure 3 As shown, in one embodiment, after the step of performing the write operation in the execution hash array until the data is written completely, it further includes:
[0106] Write the hash_id corresponding to the command index according to the IO write command;
[0107] Specifically, when the storage system receives an IO write command, it first parses the command to extract the key information, including the data to be written, the target address (such as LPA), and the possible checksum. During the parsing process, the system pays special attention to whether the command contains a hash_id field. The hash_id is usually a unique identifier obtained by hashing a key part of the written data (such as LPA and data content) through a hash function. Once the hash_id is extracted, the system uses this identifier as an index to access an internal data structure (such as a hash table or hash array), which is used to store the chained information or metadata associated with the hash_id. The chained information may include the physical location of the data on the storage medium, the data status (such as whether it has been written), and other information related to data management and consistency maintenance.
[0108] Unchain the chained information corresponding to the hash_id in the hash array, that is, delete the node;
[0109] Specifically, at the located position in the hash table or hash array, the system usually finds a chained list (linked list) that contains all the nodes with the same hash_id (or similar hash_ids caused by hash collisions). The system needs to traverse this chained list to find the specific node to be deleted, which usually involves comparing the hash_id or other unique identifiers in the nodes. Once the node to be deleted is found, the system performs the deletion operation, which may involve adjusting the pointers of the linked list to disconnect the node to be deleted from the previous and next nodes. If the deleted node is the only node in the linked list, it is also necessary to ensure that the corresponding position in the hash table or hash array is marked as empty or reset to the initial state. After deleting the node, the system may need to update the metadata associated with the hash_id to reflect the latest state of the chained information, which may include updating the linked list length, marking the position as empty, or adjusting other information related to data management and consistency maintenance.
[0110] By implementing the above technical feature of unchaining the chained information corresponding to the hash_id in the hash array, that is, deleting the node, the following technical effects are brought:
[0111] Resource release: By deleting the nodes of the chained information that are no longer needed, the system can release the occupied memory or storage resources, which is crucial for improving resource utilization and avoiding resource leakage.
[0112] Data Consistency Maintenance: When deleting a node, the system ensures that it does not disrupt data consistency. This typically means that before deleting a node, the system checks and processes any potential dependencies or conflicts.
[0113] Performance Optimization: Over time, a large number of chained information nodes that are no longer needed may accumulate in a hash table or hash array. By periodically deleting these nodes, the system can maintain the compactness of the hash table or hash array, thereby improving the lookup and access efficiency.
[0114] Support for Concurrent Operations: In a concurrent environment, the system may need to handle multiple access requests to the hash table or hash array simultaneously. By implementing an efficient node deletion operation, the system can better support concurrent operations and reduce performance degradation caused by resource contention.
[0115] Determine whether there are conflicting nodes for the currently executed completed node;
[0116] Specifically, the system accesses internal data structures (such as hash tables, linked lists, trees, etc.) or queries the database to obtain information about conflicting nodes related to the current node. This information may include the identifiers, status, and association relationships of the nodes with other nodes. The system applies conflict judgment logic to check whether there are conflicting nodes for the current node. This typically involves comparing the data, status, timestamps, or other unique identifiers of the nodes to determine whether there are potential conflicts. Conflicts may manifest as data inconsistency, resource contention, or violations of the isolation, atomicity, consistency, or durability (ACID) properties of transactions. If the system detects conflicting nodes, it will take appropriate measures to handle the conflicts, which may include rolling back the operations of the current node, waiting for the conflicting nodes to release resources, or attempting to merge the conflicting data.
[0117] By implementing the above-mentioned determination of whether there are conflicting nodes for the currently executed completed node, the following technical effects are brought about by this technical feature:
[0118] Data Consistency Maintenance: By detecting and handling conflicting nodes, the system can ensure data consistency and integrity, which helps to avoid data corruption, loss, or inconsistency, thereby improving the reliability and stability of the system.
[0119] Performance Optimization: The conflict detection and handling mechanism can help the system avoid unnecessary resource contention and data conflicts, thereby improving the overall performance of the system. By reducing conflicts and waiting times, the system can respond and process user requests more quickly.
[0120] Support concurrent operations: In a concurrent environment, multiple nodes or operations may access and modify the same data simultaneously. By implementing a conflict detection and handling mechanism, the system can better support concurrent operations, ensure data consistency and integrity, and reduce performance degradation caused by conflicts.
[0121] Improve user experience: By detecting and handling conflict nodes in a timely manner, the system can reduce user waiting time and improve the user experience. In addition, by providing clear conflict information and handling options, the system can also help users better understand and manage data conflicts.
[0122] If there are conflict nodes among the currently executed completed nodes, replace the conflict nodes at the positions of the deleted nodes;
[0123] Specifically, once it is confirmed that there are conflict nodes and the positions of the deleted nodes have been reserved, the system will perform the replacement operation of the conflict nodes. This replacement operation may involve copying the data, status, and other relevant information of the conflict nodes to the reserved positions of the deleted nodes, and updating the pointers or references in the internal data structure to ensure that the new data or nodes can be correctly accessed and processed. During the replacement process, the system will also ensure the consistency and integrity of the new data, avoiding data loss or corruption. After completing the replacement of the conflict nodes, the system will execute the newly arrived IO write command, which may involve writing data to the new position, updating the internal data structure, or performing other relevant operations. When executing the write command, the system will ensure the consistency and integrity of the data and handle any possible exceptions or errors.
[0124] By implementing the above technical feature of replacing conflict nodes at the positions of deleted nodes, the following technical effects are brought:
[0125] Maintain data consistency: By replacing conflict nodes to execute new IO write commands, the system can ensure data consistency and integrity, which helps to avoid data conflicts, loss, or corruption, thereby improving the reliability and stability of the system.
[0126] Optimize system performance: By reserving positions in the internal data structure and quickly replacing conflict nodes, the system can reduce the waiting time and performance degradation caused by data conflicts, which helps to improve the system's response speed and throughput and enhance the user experience.
[0127] Enhance concurrent processing ability: This technical feature enables the system to better handle concurrent write operations. By quickly detecting and replacing conflict nodes, the system can reduce data inconsistency and performance bottleneck problems caused by concurrent operations.
[0128] Improved resource utilization: By efficiently utilizing internal data structures and storage space, the system can reduce unnecessary resource waste, which helps to lower the system's operating costs and improve resource utilization.
[0129] If there are no conflicting nodes for the currently executed completion node, the execution is completed and the operation ends.
[0130] Specifically, once it is confirmed that there are no conflicting nodes for the currently executed completion node, the system will perform an end operation, which may involve updating the state of internal data structures, releasing relevant resources, notifying users or administrators that the operation has been completed, etc. The end operation may also include recording the operation result in a log for subsequent auditing or troubleshooting.
[0131] By implementing the above execution completion and end operation, this technical feature brings the following technical effects:
[0132] Guaranteed data consistency: By detecting conflicting nodes after node execution is completed and ending the operation when there are no conflicts, the system can ensure data consistency and integrity, which helps to avoid data conflicts, loss, or corruption, thereby improving the system's reliability.
[0133] Improved operation efficiency: Ending the operation directly after confirming that there are no conflicting nodes can reduce unnecessary waiting time and processing steps, thereby improving the system's operation efficiency, which helps the system to respond to user requests faster and enhance the user experience.
[0134] Optimized resource utilization: By quickly ending the operation and releasing relevant resources, the system can utilize computing resources and storage space more effectively, which helps to lower the system's operating costs and improve resource utilization.
[0135] Please refer to Figure 1 and Figure 4 As shown, in one embodiment, after the step of calculating hash_id based on the address LPA carried in the IO write command, the following steps are further included:
[0136] Determine whether the current number of hash_ids exceeds a threshold; if the current number of hash_ids does not exceed the threshold, perform a write operation.
[0137] Specifically, the system needs to preset a threshold for determining whether the number of hash_ids is excessive. This threshold may be determined based on the system's performance requirements, storage capacity, load capacity, or other business logics. The threshold can be static (i.e., fixed and unchanging) or dynamic (e.g., automatically adjusted according to system load or time). The system compares the current number of hash_ids with the preset threshold. If the current number exceeds the threshold, it is considered that the number of hash_ids is excessive and further processing measures may be required; if the current number does not exceed the threshold, normal operations continue.
[0138] By implementing the above technical feature of determining whether the current number of hash_ids exceeds the threshold, the following technical effects are brought:
[0139] Performance optimization: By controlling the number of hash_ids, the system can avoid overloading of a single storage node or database table, thereby improving the overall system performance and response speed.
[0140] Load balancing: Distributing hash_ids evenly across multiple storage nodes helps achieve load balancing, reduces the burden on certain nodes, and improves the stability and reliability of the system.
[0141] Efficient resource utilization: Through reasonable management of the number of hash_ids, the system can utilize storage and computing resources more effectively and avoid resource waste.
[0142] Data consistency guarantee: In a distributed system, an excessive number of hash_ids may increase the complexity of data synchronization and consistency maintenance. By controlling the number of hash_ids, the system can more easily ensure data consistency.
[0143] Fault prevention: An excessive number of hash_ids may lead to problems such as system performance degradation and increased failure rate. By regularly checking and limiting the number of hash_ids, the system can prevent these potential faults in advance.
[0144] If the current number of hash_ids exceeds the threshold, update the hash calculation function to obtain configuration parameters;
[0145] Specifically, when the conflict linked list exceeds the threshold, it is necessary to update the conflict range and hash_size. That is, when the number of hash_ids reaches or exceeds the preset threshold, the system triggers the process of updating the hash calculation function. Once the update process is triggered, the system updates the hash calculation function according to the new configuration parameters or business requirements. The new hash calculation function may adopt different hash algorithms, increase randomness, adjust the size of the hash table (hash_size), or change the distribution range of hash values, etc. When updating the hash calculation function, the system also checks the length of the conflict linked list. If the length of the conflict linked list exceeds the preset threshold, the system will further adjust the conflict range (such as increasing the number of partitions of the hash table) and hash_size to reduce conflicts and improve the performance of the hash table. After updating the hash calculation function and adjusting the conflict linked list threshold, the system may need to recalculate and redistribute the hash_ids of the existing data, which usually involves traversing all elements in the hash table, recalculating their hash values using the new hash calculation function, and inserting them into the new hash table positions. Finally, the system updates the relevant configuration parameters, such as the new hash_size, conflict linked list threshold, etc., to ensure that subsequent data insertion and query operations can be based on the latest configuration.
[0146] By implementing the above-mentioned update of the hash calculation function to obtain the configuration parameters, the following technical effects are brought:
[0147] Performance optimization: By updating the hash calculation function and adjusting the conflict linked list threshold, the system can reduce hash conflicts and improve the search and insertion efficiency of the hash table. Redistributing the hash_ids can ensure that data is more evenly distributed in the hash table, further improving performance.
[0148] Load balancing: Adjusting the hash_size and conflict range helps to achieve load balancing of the hash table and avoid overloading of certain partitions or linked lists.
[0149] Efficient resource utilization: By optimizing the structure and performance of the hash table, the system can more effectively utilize storage and computing resources.
[0150] Enhanced scalability: This technical feature enables the system to more easily adapt to the growth and changes in data volume, and the hash table can be extended and optimized by adjusting the configuration parameters.
[0151] Improved stability: Reducing hash conflicts and optimizing the performance of the hash table helps to improve the stability of the system and reduce the failure rate caused by data conflicts or performance bottlenecks.
[0152] Recalculate the address LPA carried in the IO write command according to the configuration parameters to obtain a new hash_id;
[0153] Specifically, when recalculating, the relative offset within the current conflict range is calculated using the LPA, and the new hash_id is obtained by taking the remainder of the relative offset with respect to hash_size. That is, when the system receives an IO write command, it parses the command to obtain the data to be written and the logical address of the data. Based on the LPA and the current conflict range, the system calculates the relative offset of the LPA within the conflict range, which typically involves converting the LPA to an offset relative to the starting address of the conflict range. Using the calculated relative offset, the system calculates the new hash_id through a modulo operation (i.e., taking the remainder of the relative offset with respect to hash_size). The new hash_id is used to determine the actual location of the data on the physical storage medium. The system updates the location information of the data using the new hash_id, which may involve updating internal data structures, metadata tables, or indexes, etc., to ensure that subsequent data access can correctly locate the data based on the new hash_id.
[0154] By implementing the above-mentioned updated hash calculation function to obtain configuration parameters, the following technical effects are brought about by this technical feature:
[0155] Uniform data distribution: By calculating the relative offset based on the LPA and the current conflict range, and obtaining the new hash_id by taking the remainder of the relative offset with respect to hash_size, the system can ensure that the data is more evenly distributed on the storage medium. This helps to reduce data access conflicts and waiting times, and improve the overall performance of the storage system.
[0156] Improved access efficiency: Uniform data distribution means that data access requests can be more evenly dispersed to various parts of the storage system, which helps to reduce hot spots and performance bottlenecks, and improve the efficiency of data access.
[0157] Enhanced scalability: This technical feature enables the system to more easily adapt to the growth of storage capacity and changes in data volume. By adjusting configuration parameters such as hash_size and conflict range, the system can flexibly expand and optimize its storage performance.
[0158] Simplified data management: Using the hash_id as the index for data access can simplify data management operations. For example, operations such as data migration, backup, and recovery can be carried out more efficiently because the location of the data can be located simply based on the hash_id.
[0159] Chain the IO write command according to the new hash_id and perform the write operation.
[0160] Specifically, the system maintains an internal data structure (such as a hash table, linked list, etc.) to associate the hash_id with the corresponding IO write command. When a new hash_id is calculated, the system will chain (or associate) the current IO write command to this hash_id. The chaining operation may involve inserting a new entry in the internal data structure, which contains the new hash_id and a pointer or reference to the IO write command. In this way, when a write operation needs to be performed, the system can quickly find the corresponding IO write command according to the hash_id. Once the IO write command is chained to the new hash_id, the system can start the write operation, which usually involves writing data from the memory buffer to the corresponding location on the physical storage medium (such as a hard disk, SSD, etc.). When performing the write operation, the system calculates the physical address of the data according to the hash_id and writes the data to this address. At the same time, the system also updates the relevant metadata or index to ensure that subsequent data access can correctly locate the data. If a conflict occurs during the chaining or write operation (such as multiple IO write commands having the same hash_id), the system needs to adopt an appropriate conflict resolution strategy, which may involve using data structures such as linked lists and red - black trees to handle the conflicting items, or recalculating the hash_id and trying to chain again.
[0161] By implementing the above technical feature of chaining the IO write command according to the new hash_id and performing the write operation, the following technical effects are brought:
[0162] Improve data writing efficiency: By chaining the IO write command according to the new hash_id and performing the write operation, the system can quickly locate the physical storage location of the data and reduce the waiting time and conflicts during the data writing process, which helps to improve the overall performance and throughput of the storage system.
[0163] Maintain data consistency and integrity: Using the hash_id as the unique identifier of the data can ensure the consistency and integrity of the data in the storage system. Even in case of unexpected situations such as system crashes or data loss, the system can quickly recover the data according to the hash_id.
[0164] Simplify data management: By chaining the IO write command to the hash_id, the system can manage data more efficiently. For example, operations such as data migration, backup, and recovery can be carried out more easily because the location of the data can be located only according to the hash_id.
[0165] Support concurrent writing: This technical feature also supports concurrent writing operations. Multiple IO write commands can be chained to different hash_ids simultaneously and perform the write operation in parallel, which helps to improve the concurrent processing ability and response speed of the storage system.
[0166] The present invention classifies and manages the IO write commands received from the host by introducing a hash algorithm, effectively avoiding frequent lookup and modification operations directly in the FTL table, significantly reducing the table lookup, modification, and consumption on the main IO path, enabling the SSD to respond and execute IO requests more quickly, thereby greatly improving the overall IO processing efficiency. Additionally, traditional IO conflict handling often requires frequent access and update of the FTL table, which not only increases system overhead but also may cause additional latency. However, the present invention maintains an independent hash array to record the hash_id of the IO commands being processed, avoiding the need to directly operate on the FTL table, effectively reducing the burden on the FTL table, reducing the number of logs generated due to FTL table operations, and further enhancing the stability and durability of the SSD. Moreover, the present invention uses the hash array to quickly determine whether a new IO command conflicts with existing commands. Only when the same hash_id is detected is it necessary to further compare the LPA (Logical Page Address) to confirm whether there is a real conflict. This hierarchical conflict detection strategy greatly improves the efficiency of conflict detection, avoids unnecessary full scans, and enables the SSD to maintain high-efficiency IO processing capabilities in high-concurrency scenarios. In addition, since the present invention does not depend on a specific FTL table structure or algorithm, its hash classification and conflict detection mechanisms have high flexibility and scalability. As the storage capacity of the SSD increases and the IO load pattern changes, this method can easily adapt to ensure the continuous optimization of SSD performance. Furthermore, by simplifying the IO conflict handling process and reducing the direct dependence on the FTL table, the present invention reduces the complexity of SSD firmware design, making system maintenance and upgrade easier; at the same time, it reduces the potential risks caused by FTL table operation errors or exceptions, improving the reliability and stability of the system.
[0167] Figure 5 FIG. is a schematic block diagram of a device 300 for handling SSD IO conflicts provided by an embodiment of the present invention. As Figure 5 shown, corresponding to the above method for handling SSD IO conflicts, the present invention also provides a device 300 for handling SSD IO conflicts. The device 300 for handling SSD IO conflicts includes units for executing the above method for handling SSD IO conflicts, and this device can be configured in a server. Specifically, please refer to Figure 5 FIG., the device 300 for handling SSD IO conflicts includes an acquisition unit 301, a first calculation unit 302, a first judgment unit 303, a first increment unit 304, and a first execution unit 305;
[0168] The acquisition unit 301 is used to acquire the IO write command issued by the host;
[0169] The first calculation unit 302 is configured to calculate hash_id according to the address LPA carried in the IO write command;
[0170] The first judgment unit 303 is configured to judge whether the hash array contains the chained information corresponding to hash_id;
[0171] The first increment unit 304 is configured to, if the hash array does not contain the chained information corresponding to hash_id, increment the chained information corresponding to hash_id to the hash array;
[0172] The first execution unit 305 is configured to execute the write operation in the hash array until the data writing is completed.
[0173] In one embodiment, the device further includes:
[0174] The traversal unit 306 is configured to, if the hash array contains the chained information corresponding to hash_id, traverse the LPA field in the chained information corresponding to hash_id;
[0175] The second judgment unit 307 is configured to judge whether there is chained information corresponding to hash_id with the same LPA field in the current IO write command; if there is no chained information corresponding to hash_id with the same LPA field in the current IO write command, jump to execute the step of incrementing the chained information corresponding to hash_id to the hash array;
[0176] The second increment unit 308 is configured to, if there is chained information corresponding to hash_id with the same LPA field in the current IO write command, increment the chained information corresponding to hash_id with the same LPA field to the conflict chain;
[0177] The second execution unit 309 is configured to execute the write operation in the conflict chain until the data writing is completed.
[0178] In one embodiment, the device further includes:
[0179] The indexing unit is configured to index the corresponding hash_id according to the IO write command;
[0180] The de-chaining unit is configured to de-chain the chained information corresponding to hash_id in the hash array, that is, delete the node;
[0181] The third judgment unit is configured to judge whether there is a conflict node in the currently executed completed node;
[0182] The replacement unit is configured to, if there is a conflict node in the currently executed completed node, replace the position of the deleted node with the conflict node;
[0183] An end unit, configured to execute completion and end the operation if there is no conflict node for the currently executed completion node.
[0184] In one embodiment, the apparatus further includes:
[0185] A fourth determination unit, configured to determine whether the current number of hash_ids exceeds a threshold;
[0186] An update unit, configured to update the hash calculation function to obtain configuration parameters if the current number of hash_ids exceeds the threshold;
[0187] A second calculation unit, configured to recalculate the address LPA carried in the IO write command according to the configuration parameters to obtain a new hash_id;
[0188] A chained execution unit, configured to chain the IO write command according to the new hash_id and execute the write operation.
[0189] It should be noted that those skilled in the art can clearly understand the specific implementation processes of the above SSD IO conflict handling apparatus 300 and each unit, which can refer to the corresponding descriptions in the foregoing method embodiments. For the sake of convenience and brevity of description, they will not be elaborated here.
[0190] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as Figure 6 shown. The computer device includes a processor, a memory, a network interface, and a database connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile and / or volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external client through a network connection. When the computer program is executed by the processor, it implements the functions or steps on the server side of a method for handling SSD IO conflicts.
[0191] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, the following steps are implemented:
[0192] Obtain the IO write command sent by the host; calculate hash_id based on the address LPA carried in the IO write command; determine whether the hash array contains the chained information corresponding to hash_id; if the hash array does not contain the chained information corresponding to hash_id, then add the chained information corresponding to hash_id to the hash array; execute the write operation in the hash array until the data writing is completed.
[0193] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented:
[0194] Obtain the IO write command sent by the host; calculate hash_id based on the address LPA carried in the IO write command; determine whether the hash array contains the chained information corresponding to hash_id; if the hash array does not contain the chained information corresponding to hash_id, then add the chained information corresponding to hash_id to the hash array; execute the write operation in the hash array until the data writing is completed.
[0195] It should be noted that for the functions or steps that the above computer-readable storage medium or computer device can achieve, reference can be made to the relevant descriptions on the server side and the client side in the foregoing method embodiments. To avoid repetition, they will not be described in detail here.
[0196] Those of ordinary skill in the art can understand that all or part of the processes of implementing the methods in the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, storage, database, or other medium used in the embodiments provided in the present application can include non-volatile and / or volatile memories. Non-volatile memories can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memories can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0197] Those skilled in the art can clearly understand that, for the convenience and conciseness of description, only the above division of each functional unit and module is used as an example. In actual applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.
[0198] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements for some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included in the protection scope of the present invention.
Claims
1. A method for handling SSD IO conflicts, characterized in that: include: Get the IO write command sent by the host; The hash_id is calculated based on the address LPA carried by the IO write command; Determine whether the hash array contains the pendant information corresponding to hash_id; If the hash array does not contain the pendant information corresponding to hash_id, then add the pendant information corresponding to hash_id to the hash array; Execute write operations in the hash array until the data is written.
2. The method for handling SSD IO conflicts according to claim 1, characterized in that: After the step of determining whether the hash array contains the fob information corresponding to the hash_id, the method further includes: If the hash array contains the fob information corresponding to hash_id, then traverse the LPA field in the fob information corresponding to hash_id; Determine whether there is chaining information corresponding to hash_id with the same LPA field in the current IO write command; If the chaining information corresponding to the hash_id with the same LPA field does not exist in the current IO write command, then jump to execute the adding of the chaining information corresponding to the hash_id to the hash array; If the current IO write command contains chaining information corresponding to the hash_id with the same LPA field, the chaining information corresponding to the hash_id with the same LPA field is added to the conflict chain; Execute the write operations in the conflict chain until the data is written.
3. The method for handling SSD IO conflicts according to claim 1, characterized in that: The step of executing the write operation in the hash array until the data writing is completed further includes: According to the hash_id corresponding to the IO write command index; Remove the chain information corresponding to hash_id in the hash array, that is, delete the node; Determine whether there is a conflicting node in the currently executed node; If there is a conflicting node in the currently executed node, the conflicting node will be replaced with the deleted node; If there is no conflicting node in the currently executed node, the execution is completed and the operation ends.
4. The method for handling SSD IO conflicts according to claim 1, characterized in that: After the step of calculating hash_id according to the address LPA carried by the IO write command, the method further includes: Determine whether the current number of hash_ids exceeds the threshold; If the current number of hash_ids exceeds the threshold, the hash calculation function is updated to obtain the configuration parameters; Recalculate the address LPA carried by the IO write command according to the configuration parameters to obtain a new hash_id; The IO write command is chained according to the new hash_id and the write operation is performed.
5. A device for handling SSD IO conflicts, characterized in that: include: An acquisition unit, used to acquire an IO write command issued by the host; A first calculation unit, configured to calculate hash_id according to the address LPA carried by the IO write command; The first judgment unit is used to judge whether the hash array contains the fob information corresponding to the hash_id; The first adding unit is used to add the fob information corresponding to hash_id to the hash array if the hash array does not contain the fob information corresponding to hash_id; The first execution unit is used to execute the write operation in the hash array until the data writing is completed.
6. The device for SSD IO conflict processing according to claim 5, characterized in that: The device also includes: A traversal unit, used for traversing the LPA field in the fob information corresponding to hash_id if the hash array contains the fob information corresponding to hash_id; The second judgment unit is used to judge whether there is a chaining information corresponding to the hash_id with the same LPA field in the current IO write command; if there is no chaining information corresponding to the hash_id with the same LPA field in the current IO write command, jump to execute the adding of the chaining information corresponding to the hash_id to the hash array; The second adding unit is used to add the chaining information corresponding to the hash_id with the same LPA field to the conflict chain if there is chaining information corresponding to the hash_id with the same LPA field in the current IO write command; The second execution unit is used to execute the write operation in the conflict chain until the data writing is completed.
7. The device for SSD IO conflict processing according to claim 5, characterized in that: The device also includes: Index unit, used to index the corresponding hash_id according to the IO write command; The off-chain unit is used to off-chain the hanging chain information corresponding to hash_id in the hash array, that is, to delete the node; The third judgment unit is used to judge whether there is a conflicting node in the currently executed node; A replacement unit, used to replace the position of the deleted node with the conflicting node if there is a conflicting node in the currently executed node; The end unit is used to complete the execution and end the operation if there is no conflicting node in the current execution completion node.
8. The device for SSD IO conflict processing according to claim 5, characterized in that: The device also includes: The fourth judgment unit is used to judge whether the current number of hash_ids exceeds a threshold; An updating unit, used to update the hash calculation function to obtain configuration parameters if the current number of hash_ids exceeds a threshold; The second calculation unit is used to recalculate the address LPA carried by the IO write command according to the configuration parameters to obtain a new hash_id; The chain execution unit is used to chain the IO write command according to the new hash_id and execute the write operation.
9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method for handling SSD IO conflicts as described in any one of claims 1 to 4 are implemented.
10. A storage medium, wherein the computer-readable storage medium stores a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method for handling SSD IO conflicts as claimed in any one of claims 1 to 4 are implemented.