The application provides a method for optimizing virtual NVMe read-write performance through an LRU
algorithm and a virtual NVMe
system, and the method comprises the following steps: constructing a
cache management architecture in cooperation with a
hash table and a double-
linked list, quickly positioning a cache node corresponding to an internal address of an SSD through the
hash table, and managing the access order of the SSD address through the double-
linked list; when the NVMe performs an SSD read-write operation, the LRU
algorithm is first called, and if there is no address in the
hash table to execute the read-write file; a
linked list order adjustment thread is created when the LRU
algorithm is initialized, the node data of the longest non-accessed node exceeding the length of the linked
list is flushed to the SSD mirror file, and then the node is deleted; when the read-write data is greater than the size of the linked
list node data, the hash mapping is refreshed. The application combines the LRU algorithm, maps the commonly used internal address of the SSD and the corresponding data block, directly operates the memory to read and write the commonly used data, optimizes the read-write mode of the existing virtual
simulation NVMe, and further improves the performance of the virtual
simulation NVMe in the
virtual hardware system.