Swarm intelligence is widely used in the application of communication networks. In this paper we adopt a biologically inspired strategy to investigate the data dissemination problem in the opportunistic cognitive networks (OCNs). We model the system as a centralized and distributed hybrid system including a location prediction server and a pervasive environment deploying the large-scale human-centric devices. To exploit such environment, data gathering and dissemination are fundamentally based on the contact opportunities. To tackle the lack of contemporaneous end-to-end connectivity in opportunistic networks, we apply ant colony optimization as a cognitive heuristic technology to formulate a self-adaptive dissemination-based routing scheme in opportunistic cognitive networks. This routing strategy has attempted to find the most appropriate nodes conveying messages to the destination node based on the location prediction information and intimacy between nodes, which uses the online unsupervised learning on geographical locations and the biologically inspired algorithm on the relationship of nodes to estimate the delivery probability. Extensive simulation is carried out on the real-world traces to evaluate the accuracy of the location prediction and the proposed scheme in terms of transmission cost, delivery ratio, average hops, and delivery latency, which achieves better routing performances compared to the typical routing schemes in OCNs.