Patent ID: 11960762
Assignee: PHISON ELECTRONICS CORP.
Field: Computer technology (Electrical engineering)
Classification: CPC G | IPC G

Claim 0:
1. A method for managing a memory buffer, applicable to a memory storage apparatus, wherein the memory storage apparatus comprises a rewriteable non-volatile memory module and a buffer memory, and the rewrite able non-volatile memory module stores a plurality of logical-to-physical address mapping tables, the method comprising:
receiving a plurality of consecutive first commands from a host system;
calculating a command ratio of read command corresponding to a random read operation mode among the plurality of first commands;
deciding to configure the memory storage apparatus in a first mode or a second mode according to the command ratio and a ratio threshold;
configuring a first buffer in the buffer memory to temporarily store the logical-to-physical address mapping table in response to the memory storage apparatus being configured in the first mode, wherein the first buffer has a first capacity; and
configuring a second buffer in the buffer memory to temporarily store the logical-to-physical address mapping table in response to the memory storage apparatus being configured in the second mode, wherein the second buffer has a second capacity,
wherein the second capacity is greater than the first capacity,
adjusting the ratio threshold according to an effective ratio,
wherein in response to the memory storage apparatus being configured in the second mode, the method further comprises:
configuring a third buffer in the buffer memory to temporarily store data associated with a write command of the host system, wherein the third buffer is different from the second buffer and the third buffer has a third capacity,
recording a total number of times of the memory storage apparatus switching from being configured in the second mode to being configured in the first mode and a number of times of the cache unit comprised in the third buffer being full during switching,
obtaining the effective ratio according to the number of times and the total number of times.