The document proposes a hierarchical security framework for defending against sophisticated attacks on wireless sensor networks (WSNs) in smart cities, incorporating chance discovery and usage control (UCON) technologies. It addresses ongoing and unknown attacks through multi-level detection strategies and adaptive mitigation methods, leveraging software-defined networking (SDN) and network function virtualization (NFV). Experimental results demonstrate the effectiveness and feasibility of the proposed system.