For the task offloading in end-edge-cloud collaborative computing systems,a task offload-ing model that combines data compression and security protection is established,and an offloading algorithm based on improved whale algorithm is proposed to obtain the best task offloading strate-gy.This model utilizes data compression technology to compress the task data that needs to be transmitted,so as to reduce the transmission delay of the task.At the same time,privacy entropy is introduced to quantify the privacy risk of task offloading,thereby achieving a balance between data availability and security.The proposed offloading algorithm introduces an adaptive probability threshold and uses the inertia weight in particle swarm optimization to balance the ability of global search and local development.The simulation results show that the task offloading model can effec-tively reduce the task processing latency and protect the task data security.Meanwhile,compared with the existing offloading algorithms,the proposed algorithm has a faster convergence speed and can obtain better target values.