The invention discloses an Internet of Vehicles spectrum
allocation method, apparatus and device, and a medium, and belongs to the technical field of vehicle communication. The method comprises the following steps: acquiring the total bandwidth of a
frequency spectrum of a
base station, the number of terminal users connected with the
base station, the idle bandwidth of an idle
frequency spectrum, an alternative coefficient of the
frequency spectrum, and the service security weight, the unit frequency spectrum income and the transmission frequency spectrum efficiency of each
cognitive user; the service security weight is used for representing the security of the service; according to the total bandwidth, the number of the terminal users, the idle bandwidth, the replaceable coefficient, the security weight of each service, the income of each unit spectrum, the efficiency of each transmission spectrum, a preset authorized user profit function and a preset
cognitive user profit function, the bandwidth of each service is obtained; and determining the optimal shared bandwidth rented to each
cognitive user in the idle spectrum and the optimal unit spectrum
renting price given by each cognitive user. According to the method, the idle spectrum of the authorized user can be allocated to the cognitive user, and the
utilization rate of the spectrum is improved.