# User-Information-Aware D2D Multicast File Distribution Mechanism
## 4 User's Demands Awareness
### User-Demand-Aware Clustering Algorithm  
As mentioned above, the probability of the user requesting a video is calculated according to the historical viewing behavior information of the user and the video's popularity. Besides, the extra reception of the pushed video will consume the energy of the user's device, occupying the device's bandwidth and storage space. In order to ensure the experience quality of the potential service requesters, and avoid disturbing other unrelated users with the video push service., the probability of accepting the pushed video, named as user's willingness \(P_{pi,l}^{accept}\), is calculated according to the status information of the user's device, the popularity of the pushed video and user's degree of interest. In the construction of the D2D multicast cluster, with the consideration of user's willingness \(P_{pi,l}^{accept}\), any potential service requester \(u_{pi}\) who is selected as a push object to accept the video \(f_{l}\in F\) should meet the following conditions:  
\[P_{pi,l}^{accept}>P_{th}^{accept},\forall u_{pi}\in U_{P}^{S} \tag{12}\]  
where, \(U_{P}^{S}\) denotes the set of potential service requesters who are selected as push objects, and \(U_{P}^{S}\subseteq U_{P}\). \(P_{th}^{accept}\) is the minimum willingness threshold for potential service requesters to accept the pushed video, meaning that the user's QoE may be seriously degraded when the user's willingness \(P_{pi,l}^{accept}\) accepting the pushed video is less than the threshold \(P_{th}^{accept}\). Besides, the willingness value is considered to 1 when the video requested by the service requesters. Taken together, when the requesters initiate a request for the video \(f_{l}\in F\), the system constructs a D2D multicast cluster by added requesters and potential requesters fitting (12). Therefore, the users set \(U_{C}\) of the D2D multicast cluster can be expressed as:  
\[U_{C}=U_{R}\cup U_{P}^{S} \tag{13}\]  
According to the above analysis, this paper proposes a novel user-demand-aware D2D multicast clustering algorithm, which is based on the grid-based clustering algorithm, as shown in Algorithm 1. First, the willingness of the potential requester to accept the pushed video is calculated, and then the user set \(U_{C}\) of the D2D multicast cluster is composed of the requesters and the potential requesters who satisfy the condition of the willingness threshold. In the proposed algorithm, the throughput and resource utilization efficiency will be improved greatly by increasing the number of D2D multicastreceivers. The willingness value for the service requester is 1, so they are directly put into the user set \(U_{C}\) of D2D multicast cluster when the algorithm starts. ```
1. Input:
2. service requesters set \(U_{R}\), potential service requesters set \(U_{P}\), the popularity of video \(f_{i}\in F\), user \(u_{pi}\in U_{P}\) and their device's status information
3. Output:
4. cluster members set \(U_{C}\)
5. Procedure User Demand-aware Clustering Algorithm
6. for\(u_{i}\in U_{R}\)do
7. put \(u_{i}\) into set \(U_{C}\)
8. endfor
9. for\(u_{pi}\in U_{P}\)do
10. calculate the willingness \(p_{pi,l}^{accept}\) of user \(u_{pi}\) to accept video push service according to Equations (5)(6)(9)(11)
11. if\(p_{pi,l}^{accept}>p_{th}^{accept}\)then
12. put \(u_{pi}\) into set \(U_{C}\)
13. endif
14. endfor
15. End
```  
**Algorithm 1**User-Demand-Aware Clustering Algorithm  
Due to the mobility of D2D users, the limited transmission capability for wireless terminal devices and the instability of wireless channels, the optimal performance of D2D communication cannot be achieved in the actual D2D communication environment, and even D2D links may be frequently broken, so the stability of the D2D link is vital to whether the D2D communication system can achieve long-term stable performance gain. In addition to the aforementioned physical domain factors, recently, the numerous studies show that the performance of D2D communication is closely related to the social relationships between users.