Patent ID: 11928359
Assignee: HUAWEI TECHNOLOGIES CO., LTD.
Field: Computer technology (Electrical engineering)
Classification: CPC G | IPC G

Claim 7:
8. A computer device, wherein the computer device comprises a processor and a memory, the memory is configured to store instructions, and the processor is configured to invoke the instructions to:
select n to-be-swapped-out pages, wherein n is an integer greater than 0;
compress the n to-be-swapped-out pages into n compressed blocks, grouping the n compressed blocks into at least one group based on a group identifier, and buffering the at least one group in a compressed data buffer area, wherein compressed blocks comprised in each group have a same group identifier;
organize at least one compressed block in one group into m to-be-written units, wherein m is an integer less than or equal to n and greater than 0, and a size of each of the m to-be-written units is an integer quantity of pages; and
write the m to-be-written units into a swap area of a non-volatile storage device in a maximum of m batches, wherein at least one of the m to-be-written units in the m to-be-written units is stored in a segment of continuous space in the swap area,
wherein the processor is further configured to:
select a part of the at least one group based on a second indication is sent by an operating system or an application at an application layer, and
wherein the second indication further comprises a quantity of compressed blocks or a to-be-swapped-out data volume, and the quantity of compressed blocks or the to-be-swapped-out data volume indicates a quantity of to-be-swapped-out compressed blocks in a group indicated by the group identifier or a volume of to-be-swapped-out data in the group indicated by the group identifier.