Patent ID: 7783796

Claim:
A method for releasing data of a storage apparatus, comprising: providing an external memory device, configured to have a virtual output queue memory, a data storing memory, a bit map output port memory, wherein the external memory device communicates with a network processor, wherein the virtual output queue memory has a plurality of virtual output queues, the data storing memory has a plurality of data columns, and the bit map output port memory has a plurality of bit map columns, wherein the virtual output queues correspond to a plurality of output ports respectively, such that the data to be output from a to-be-processed output port in the output ports is stored in a to-be-processed data column in the data columns, and the to-be-processed data column corresponds to a to-be-processed bit map column in the bit map columns; arranging a plurality of bits for each of the bit map columns, wherein the bits in the to-be-processed bit map column are corresponding to the output ports respectively to indicate that the data to be output from the specific output ports is stored in the to-be-processed data storing column, wherein a first bit state of the bits indicates the data is not yet read at the corresponding to-be-processed output port and a second bit state of the bits indicates no data is to be read or the data has already been read at the to-be-processed corresponding output port; storing the addresses of the data required to be output from the to-be-processed output port in the to-be-processed data column into a virtual output queue block; writing the virtual output queue block into the virtual output queue corresponding to the to-be-processed output port; setting the corresponding bit to the to-be-processed output port as the first bit state; having the to-be-processed output port to obtain the data from the to-be-processed data column according to the virtual output queue block; changing the first bit state of the bit into the second bit state corresponding to the to-be-processed output port in the to-be-processed bit map column after the to-be-processed output port reads the data; and when the bits in the to-be-processed bit map column are all at the second bit state for indicating that the output ports have completely processed the data stored in the to-be-processed data column, releasing a space occupied by the to-be-processed data column herein all the bits in the to-be-processed bit map column remains at the second bit state until next time in use.