To address interoperability and scalability issues for cloud computing, in our previous paper, we presented a novel cloud market model called CACM that enables a dynamic collaboration (DC) platform among different Cloud providers. As the initiator of dynamic collaboration, primary Cloud provider (pCP) needs an efficient local task selection and allocation algorithm to partition the whole tasks and allocate those tasks to be executed locally. Existing task allocation algorithms cannot be directly applicable in a DC environment since they may cause low resource utilization of local resources. So in this paper we propose a general task selection and allocation framework to improve resource utilization for pCP. The framework utilizes an adaptive filter to select tasks and a modified heuristic algorithm to allocate tasks. Moreover, a trade-off metric is developed as the optimization goal of heuristic algorithm, so that it is able to manage and optimize the trade-off between QoS of tasks and utilization of resources.