A cognitive radio network (CRN) is integrated with the Internet of Connected Vehicles (IoCV) in order to address spectrum scarcity and communication reliability issues. However, it is limited, possessing less throughput, a low packet delivery ratio, high latency, and high mobility in the spectrum. In this research study, the existing issues are addressed by proposing a 6G cognitive radio network–Internet of connected vehicles (6GCRN–IoCV) approach. Initially, all the entities such as secondary users (SUs), primary users (PUs), and pedestrians are authenticated in blockchain to ensure security. The edge-assisted roadside units (ERSU) initiate clustering only for authenticated SUs using the improved DBSCAN algorithm in consideration of several metrics. The ERSU then generates an intersection-aware map using the spatial and temporal-based logistic regression algorithm (STLR) to reduce collisions in the intersection. The spectrum utilization is improved by performing spectrum sensing in which all the SUs involved in spectrum sensing use lightweight convolutional neural networks (Lite-CNN) in consideration of several metrics and provide the sensing report to the fusion center (FC) in an encrypted manner to reduce the spectrum scarcity and security issues. The communications between the SUs are necessary to avoid risks in the IoCV environment. Hence, optimal routing is performed using the Dingo Optimization Algorithm (DOA), which increases throughput and packet delivery ratio. Finally, communication reliability is enhanced by performing hybrid beamforming, and this exploits the multi-agent-based categorical Deep-Q Network (categorical DQN), which increases spectral efficiency based on its adaptive intelligent behavior. The proposed study is simulated using the SUMO and OMNeT++ simulation tools and the performances are validated with existing works using several performance metrics. The result of the simulation shows that the proposed work performs better than the existing approaches.