Research Article

A Privacy-Preserving Caching Scheme for Device-to-Device Communications

Algorithm 1

D2D caching strategy based on node importance.
Input:;
Output:, // is the cache identifier, is the code identifier, 0 indicates the original block, and 1 is the coding block;
(1) Initialization: , ;
(2) The SDN switch collects the request records and interactive information of the devices and periodically sends it to the SDN controller;
(3) The SDN controller computes the node importance of the device according to the history information collected by SDN switches, namely, :
(4) While BS receives the request from device for content do
(5) if the node importance of device is higher then
(6)  Make ;
(7) else
(8)  Make ;
(9) end if
(10) if content blocks are cached in the D2D caching network then
(11) BS locates a group of cached content holder with the top node importance to respond to the user request;
(12)  for each cached content holder do
(13)   if the cached content is the original block then
(14)    make ;
(15)   else
(16)    make ;
(17)   end if
(18)   BS sends data packets to the content holder;// is the number of content blocks to be sent by content holder to the requester
(19)   After content holder receives the data packets from BS, it will establish the D2D communication link with device and transfer the data packet ;// is the coding block or content block;
(20)  end for
(21) else
(22)  if then
(23)   BS sends original blocks to the content requester device , namely, ;
(24)  else
(25)   BS sends coding blocks to the content requester device , namely, ;
(26)  end if
(27) end if
(28) end while