The invention discloses an adaptive cache
replacement method based on a dual-state counter, which belongs to the technical field of data caching, and comprises the following steps: performing improvement based on an adaptive cache replacement
algorithm ARC, and designing an
improved algorithm structure which comprises a dynamic adjustment mechanism, an LRU replacement
algorithm structure, an LFU replacement
algorithm structure and a cache item table, the cache item table comprises a data pointer, a
timestamp for LRU sorting, a 2-bit saturation counter and cache data, designing a timing attenuation mechanism for preventing cache items which are not accessed for a long time from continuously occupying a high
active state, adding a global bias counter, dynamically adjusting a state transition threshold, and adaptively balancing LRU and LFU strategies, so that the implementation structure can be simplified, and the implementation efficiency is improved. The
cache hit rate and the
system performance are improved, the
cache pollution and the bandwidth overhead are effectively reduced, the
adaptive capacity of the cache to different access
modes is enhanced, and the overall performance and the energy efficiency of a computer
system are improved.