In the past few years, cloud services have become more and more widely adopted. Recent studies show that the adoption of Software as a Service (SaaS) cloud services is surpassing Infrastructure as a Service (IaaS) cloud and becoming the spotlight in the cloud computing realm. As more cloud service providers (CSPs) have begun to offer cloud services, the cloud users face the tough problem of choosing the appropriate cloud services such that their demands can be satisfied. Besides, with the rapid development of Internet of Things (IoT), more and more IoT applications, such as face recognition and autonomous driving, need to be processed. These applications typically need a lot of computing resources and have high requirements for delay. However, IoT devices generally have limited computing resources and battery lives. Therefore, how to allocate resources to provide privacy and security for IoT applications while meeting the performance requirements is a challenging research problem. In this talk, I will firstly present how the cloud users make service choices in the heterogeneous cloud system where two IaaS CSPs have different cloud capacities. Then, I will analyze how the mobile users make service choices between the edge cloud and public cloud. At last, I will show some research problems of resource allocation in the mobile edge computing (MEC). In particular, I will introduce how to apply the deep reinforcement learning to solve resource allocation problems in the MEC, and apply federated learning to provide privacy and security for IoT applications.