## 1 Introduction  
With the development of communication technologies and the growth of smart devices (such as smart phones, wearable devices and smart unmanned aerial vehicle, etc. ), mobile traffic data has increased dramatically in the last decade [1]. However, the spectrum resources in traditional cellular networks (CNs) cannot satisfy these demands. Device-to-Device (D2D) communications have been considered to be a promising technology to improve spectral efficiency and network capacity by allowing two proximal devices sharing the licensed spectrum with cellular users (CUs) to communicate directly bypassing the base station (BS) [2; 3; 4; 5]. However, the spectrum resource in the licensed spectrum is limited and easily congested due to the spectrum reusing by many users, especially in hot spots with plenty of data links. To tackle this challenge, the deployment of 5 GHz unlicensed spectrum in CNs may be an excellent solution. Recently, many researchers have operated the CUs in the unlicensed spectrum to further improve network capacity and spectral efficiency, which is referred as Long-Term Evolution-unlicensed (LTE-U) [6]. As LTE-U technology achieves better network performance, D2D communications in unlicensed spectrum (D2D-U) technology [7] has attracted more and more attention for its great potential capacity in enhancing network capacity. However, the unlicensed spectrum is primarily occupied by the Wi-Fi users and the users access to the spectrum in a distributed coordination function (DCF) based on Carrier Sense Multiple Access with Collision Avoidance(CSMA/CA) in which the nodes listen to the subchannel before the data transmission [8]. As opposed to the Wi-Fi users, LTEand D2D communications are both controlled by the BS, with no need for sensing before transmission [9]. The LTE users and D2D users sharing the same unlicensed band with the Wi-Fi users will bring about the huge performance degeneration of this system. Therefore, it is challenging to maintain a fair and harmonious coexistence [10; 11]. A great number of access mechanism of unlicensed spectrum has been proposed in light of this situation, namely Listen-Before-Talk (LBT) which allows LTE users and D2D users operate similar to the cognitive radio (CR) technique [12], and duty-cycle method, also known as Carrier Sense Adaptive Transmission (CSAT) in which each user occupies different time slot for data transmission [13]. There have been numerous works studying the resource allocation in LTE-U network or D2D communications underlaying CN in unlicensed spectrum [14; 15; 16; 17]. In these works, spectrum resources are not fully used, thereby resulting in the waste of communication resources. However, few works have investigated D2D communications underlaying CN over licensed and unlicensed spectrum due to the complicated interference. In contrast to the previous works, we propose a hybrid network where D2D users reuse the licensed channels with the existing CUs, and both CUs and D2D users can transmit in the unlicensed spectrum. There are two difficult problem to tackle. First, the joint user access and resource allocation over licensed and unlicensed spectrum is difficult to be studied. Secondly, the interference management should be investigated since the interference among all the users is complicated. The main contributions of this paper are summarized as follows:  
* We consider a cellular network with cellular users, D2D users and Wi-Fi users, where the CUs and D2D users can access to the licensed and unlicensed spectrum. * We formulate an optimization problem to maximize system rate by jointly optimizing user access and resource allocation. To tackle the formulated problem, we propose a matching-iteration-based joint user access and resource allocation algorithm to obtain the optimal solution. * The properties of the proposed algorithm including convergence, stability, optimality, complexity are analyzed.