Research on IoT that merely aims at connecting and communicating is about to past. Thereafter, general objects should have the capability to learn, think, and understand both physical and social areas by themselves. Cognitive Internet of Things (CIoT) attempts to empower the current IoT with a ''brain'' for high-level intelligence, requiring networks to have the ability to bridge the physical and social worlds. This attempt means matching equipment and resources with people and their behavior. Therefore, accurate location information is crucial for equipment connecting to CIoT. This endeavor sets a higher requirement for the localization technology of wireless sensor networks in terms of accuracy, energy, and efficiency compared with that in the past. In this paper, we propose an efficient and accurate mobile anchor node assisted localization algorithm for WSNs based on diameter-varying spiral line (LDVSL), which broadcasts coordinates of the anchor node to assist localizing unknown sensor nodes. The proposed algorithm has two main innovations. First, we obtain the mobile anchor node position through a time and angle mechanism instead of GPS, given the unique characteristics of the diameter-varying spiral line. Second, the linear fitting method is adapted to select the key virtual node, which has the real maximum received signal strength indicator. Simulations indicate that the proposed LDVSL algorithm outperforms other similar algorithms in terms of average localization error and positionable node ratio. The simulations also show that the LDVSL is not affected by obstacles seriously and has good robustness. The LDVSL has a wide prospect of application in CIoT. INDEX TERMS CIoT, localization, mobile anchor node, diameter-varying spiral line, linear fitting. I. INTRODUCTION With the rapid development of wireless communication techniques in the past few years, IoT has been widely used as a cyber physical systems in the fields of modern intelligent services such as ecological protection, smart homes, food safety, environmental, logistics, transportation, and national information coverage [1], [2]. According to the latest surveys, approximately 600 billion devices will be connected to the IoT by 2020. With the increasing interconnectivity among general things or objects, many new services or The associate editor coordinating the review of this manuscript and approving it for publication was Min Jia. applications are emerging, generating massive data in an explosive manner [3]. However, many of the existing Internet of Things applications are still not intelligent enough to perceive data and perform decision making, and they are highly dependent on human beings for cognition processing [4]. Therefore, cognitive computing has gained the interest of IoT researchers [5]-[7]. Related researchers attempt to infuse intelligence into objects to learn from the physical world [8], [9]. The IoT with cognitive ability is called cognitive Internet of Things (CIoT), which enables objects and groups to learn data from connected dev...