Research Article

Falcon: A Blockchain-Based Edge Service Migration Framework in MEC

Algorithm 2

Service migration decision algorithm.
 Input: , Current system iTH migration request, m represents the number of mobile agents that make up the current service.
 Output: , Migration decision for each agent to migrate to a platform , where n represents the number of platforms available.
(1) = ReadBlockchainData(), Read the block chain data to obtain the connection relation matrix A between nodes;
(2) Request.experience, Boolean checkStata = false;
(3)for j = 1; j ≤ n; j++ do
(4)  Updating task weight ;
(5)   = getNetworkCondation()
 Get the network condition of node j;
(6)  ;
(7)  ifthen
(8)   ;
(9)  else
(10)   ;
(11)  end if
(12)   = getNetworkCondation();
(13)   = getCpuLoadRatio();
(14)   = getMemoryLoadRatio();
(15)  ;
(16)  ;
(17)end for
(18)While j = 1; j ≤ ; j++ do
(19)  for j = 1; j ≤ ; j++ do
(20)   ifthen
(21)    ifthen
(22)     ;
(23)    else
(24)     Path = Dijkstra();
(25)     .add(, Path);
(26)    end if
(27)   end if
(28)  end for
(29)  heckStata = CheckAcl(si);
(30)  if checkStata is true then
(31)   Retun 1;
(32)  else
(33)   return 0;
(34)  end if
(35)end While