The invention discloses a
mobile device memory
compression method based on dictionary encoding and run-length encoding. The
mobile device memory
compression method based on the dictionary encoding and the run-length encoding mainly solves the problem that an existing dictionary encoding
compression method and an existing run-length encoding compression method are low in
compression ratio of memory data. The
mobile device memory compression method based on the dictionary encoding and the run-length encoding mainly comprises the following steps of (1) reading in the memory data and the lengths of the storage data, (2) judging whether the memory data are compressible data, directly recording the lengths of the data and the data when the data are not compressible data, and using a run-length encoding compressed format to compress continuous identical character strings when the data are compressible data, (3) using a dictionary compressed format to compress other ordinary memory data, (4) judging whether compression is carried out on the
tail of the memory data, stopping compressing when the compression is carried out on the
tail of the memory data, and continuing reading in the memory data when the compression is not carried out on the
tail of the memory data. Compared with existing other storage compression methods, the mobile device memory compression method based on the dictionary encoding and the run-length encoding is higher in
compression ratio, thus more
residual space can be released for an internal storage of a mobile device, operating efficiency of the mobile device can be improved, and the mobile device memory compression method based on the dictionary encoding and the run-length encoding can be used in mobile devices which need memory compression.