Optimization of the Resource for Cognitive Radio RF Harvesting IoT Networks