Abstract
1. Introduction
In wireless sensor networks (WSNs), big data is the intensification of information architecture, while distributed computing is the intensification of infrastructure and resource [1]. Distributed computing models can bring benefits to big data. And there are two categories of distributed computing: client/server model and mobile code model. Mobile agent model consists of remote computation, code on demand, and mobile agent model [2].
In client/server model, client asks for services, while server provides resources, services, and methods for executing services. There are many distributed systems adopting this model [3, 4]. Mainwaring proposed a habitat monitoring system, which is accomplished by transmitting data to gateway [3]. Ivy is the distributing system in WSN studied by the University of California, Berkeley, CA, USA [4]. Although the client/server model has been widely used, its drawbacks are very obvious, especially in WSN [5]. Firstly, it needs a series of supernodes as a processing center. Secondly, in multiclient systems, overdependence on bandwidth reduces the transmitting performance. Thirdly, the nodes which are closer to the server need to transmit more data; thus, they consume more energy.
Mobile agent model supports distributed computing, too. The processing center/centralized information system (CIS) is in charge of sending and recovering mobile agents, while agents migrate between sensor nodes and are responsible for data exchange. A typical exemplar is the data fusion algorithm based on mobile agent to track objects in WSN [6]. In general, mobile agent is a special program which can be executed autonomously. And it is also defined as an entity with the following four attributes: agent identifier, data space, method, and migration table. Agent identifier describes the uniqueness of each agent; data space carries part of the integrated results; method is used to deal with missions or execute codes; and migration table stores the routing information of an agent and it can be preset or modified dynamically.
Compared with traditional computing models which need amount of data interaction between nodes and CIS (or base station), mobile agent model has many merits. As illustrated above, in WSN, mobile agents dynamically migrate to the CIS with service request. With CIS accomplishing the computing operations locally and returning the results to the nodes, agents can be devoid of the transmission of big data and the reliance on the network bandwidth, which improves the efficiency. The specific advantages of mobile agent model, especially, in terms of energy consumption, reliability, and large-scale distribution, are declared in [7]. However, the consequent challenges are not negligible, like the high failure rate, unreliable communication link, high dependence on bandwidth, and so on.
2. Related Work
Although mobile-agent-based distributed model has exceptional advantages in WSN [8], dynamic migration is necessary in practical deployment. Dynamic migration, presented by migration table, has two behaviors: nodes selection and migration sequences. Therefore, migration table's efficiency, in some sense, decides accuracy of data integrations, time of migrations, energy consumption, and performance of the whole network.
In response to the challenges embodied in the specialty of WSN, the design of mobile agent's migration table needs to adequately consider the following three aspects. Firstly, agent entity must be as small as possible to reduce migrating energy consumption. Secondly, migration table has to guarantee rational precision of data integrations to obtain sufficient sensor nodes. Thirdly, in the precondition of the second aspect, migration table needs to be short enough. In conclusion, a suitable migration table should balance the cost and precision.
Thus, in this paper, we mainly concentrate on the design of the migration table which can reduce agent's migration energy consumption while guaranteeing reliable migration methods.
Briefly, mobile agent migration has two categories: static migration list algorithm (SMLA) and dynamic migration list algorithm (DMLA). In SMLA, CIS analyzes the whole network's resources and designs migration paths that are inserted in agent entities initially. However, static SMLA cannot respond to the changes of the network timely; the changes happen when one or more links between nodes break, while, in DMLA, migration table is updated at each migration interval according to the sensibility of the network.
Without loss of generality, mobile agent migration algorithms can be illustrated by target tracking. Considering movements of the target entity, Zhao et al. proposed the information-driven-based tracking method [9]. Liu et al. proposed the collaborative in-network method to track target [10], which effectively reduced overheads and energy consumption. Kim et al. transferred the distributed tracking issue to the continuous Bayesian estimation problem and adopted the information-driven-based sensor querying scheme to select the next hop [11]. Wang et al. proposed a heuristic target localization method based on entropy [12], which is more efficient than the information-based computing method. In this paper, we will propose the dynamic migration list algorithm based on the predicting information drive (pid-DMLA) to solve the motion problems of migrations of the target entity.
Considering the condition of using multiple agents to track an application in practice, we will also propose the dynamic migration list algorithm based on the predicting information drive of multiple agents (Mpid-DMLA).
In this paper, we would propose the migration algorithms in different scenarios: single mobile agent and multiple mobile agents, which is valuable and applicable in WSNs. The rest of this paper is organized as follows. Section 3 describes the preliminary of migration. Section 4 presents single-agent-based migration algorithms, including SMLA, DMLA, and pid-DMLA. Section 5 illustrates Mpid-DMLA. Simulation results and analyses are presented in Section 6, and conclusions are drawn in Section 7.
3. Preliminary
3.1. Assumptions
The following assumptions are considered.
The location of each sensor node is known. Each node has at least two neighbor nodes. The valid perception radius of sensor node is more than half the distance between two neighboring nodes. All nodes are synchronized. All sensors are deployed in a two-dimensional region. There is only one target entity in the region, and it moves uniformly and linearly.
3.2. Evaluation Indicators of the Agent Migration Algorithm
In order to evaluate the existing agent migration algorithms, we adopt the three indicators proposed by Xu et al. [7] energy consumption, network lifetime, and migration hops.
Each migration step of mobile agent is called a hop. And the energy consumption of each hop consists of three aspects: transmission consumption
A migration is primarily composed of four parts: sending an agent, receiving an agent, data processing, and deciding the next hop. And each consumption time of the four processes is fixed. Thus, evaluating the migration time of an agent is equivalent to calculating the migration hops.
3.3. Node's Sensor Model
We adopt the following wireless transmission model [13] proposed by Rappaport:
3.4. Node's Information Collection Model
In order to quantify the data provided by sensors, we need to define the amount of information. According to (1), at any time,
3.5. Beacon Frames
We use beacons to termly exchange information of the neighboring nodes. A beacon frame consists of the following five fields:
3.6. Target Localization Algorithm
As illustrated in (2), the location of target entity is calculated by the target localization algorithm. At present, target localization algorithms mostly adopt the method of centroid weighting. And the basic idea is to make node's beacons take control of the centroid's coordinate and to reflect the general relations of the locations by using weighting factors which influence the positions of the nodes' centroids. And according to the RSSIs of the three sensors' beacons, it is easy to obtain the other node's location by the trilateration.
As shown in Figure 1, the locations of

The target localization algorithm.
Apparently, the distance of
4. Migration Algorithms Based on Single Mobile Agent
This section would propose SMLA and DMLA algorithms from static and dynamic aspects, respectively. And it would then propose pid-DMLA based on disadvantages of SMLA and DMLA.
4.1. SMLA
In SMLA algorithm, we use static information. Before distributing mobile agents, the CIS collects by communicating with other nodes, and it then generates a migration plan. In this migration plan, information collection values of all nodes in the network decrease. The specific steps of SMLA are as follows.
Algorithm 1 (SMLA).
At time it generates a mobile agent. At time Calculate the amount of information collection, Select the next hop, according to the predetermined migration sequence. At time Calculate the amount of information collection of node If Return to cluster head to process data.
Though, sometimes, SMLA can gain the ideal migration sequence, there are many drawbacks in practical applications. Firstly, since SMLA uses static information, sensor's transmission distance must be large enough to ensure that CIS is within one-hop range. So we need to adopt the nodes with greater power in communication capabilities. And using these nodes will inevitably result in relatively higher energy consumption. Secondly, since SMLA is a static algorithm, the static information, which is acquired before migration, lack timeliness and cannot reflect the changes of the network in the process of migrating. For example, that some nodes suddenly lose efficacy can result in the failure of the deployment of SMLA [9]. Moreover, most of WSNs are highly dynamic, so SMLA has some limitations in WSNs.
4.2. DMLA
SMLA is a centralized algorithm, and it has already decided the migration sequence before distributing mobile agents. Because WSN is a dynamic and distributed network, static routing information exposes a lot of problems in practical applications. Thus, DMLA is proposed. DMLA dynamically selects the next hop in the process of migration based on characteristics of the network.
4.2.1. The Migration Model of Mobile Agent in DMLA
In DMLA, mobile agents decide the nodes that they need to migrate to. In the surviving neighbor nodes, not all of the nodes can provide information affecting the final result. Therefore, the purpose of mobile agent migration algorithm is to produce a set of optimal subsets to determine the optimum migration sequence.
In the target entity tracking, we construct rules to choose the next hop as follows: mobile agent, which is located in node
Define the transmission energy consumption of the agent migrating from node
From (2), (5), and (6), we can gain
Equation (7) can be rewritten as follows:
In summary, the total cost in the migration process is
4.2.2. The Specific Migration Procedure of DMLA
The mobile agent migrates to the alive node which has not been reached and with the minimal migration overheads according to (7). In this way, we can gain a table close to the optimal migration. If all nodes have been reached, mobile agent will return the node that distributes it. And when the mobile agent has acquired enough information, it will return to the CIS.
Since each node periodically receives beacon frames from neighbor nodes, DMLA can always use the updated local variables to determine the next hop. As only using local variables, sensor nodes can avoid the node which has a greater transmission distance, so part of the transmission energy can be saved. In addition, when some nodes suddenly lose efficacy, the whole migration process will not make mistakes. So DMLA algorithm is a fault-tolerant algorithm. The specific migration steps of DMLA are as follows.
Algorithm 2 (DMLA).
At time it generates a mobile agent. At time Calculate the amount of information collection, Select the next hop, according to (8). At time Calculate the amount of information collection of node If Return to cluster head to process data.
4.3. pid-DMLA
4.3.1. The Proposition of pid-DMLA
In the cooperation processing applications, the movement of target entity is one of the important factors that affect the final result [14–19]. DMLA algorithm does not take the direction of the movement of target entity into account. So in some cases, it cannot select the optimum next hop. For example, in Figure 2, at time

The movement of the target entity.
4.3.2. Agent Migration Model in pid-DMLA
Suppose that the moving direction and speed of the target entity do not change. Then, the change of the target entity's displacement is a constant, at each identical time interval, as follows:
Equivalently,
As illustrated in (11), the position information
Update the overhead function in (7), and get
And the next hop is
At time
4.3.3. The Specific Migration Procedure of pid-DMLA
The process of mobile agent migration of pid-DMLA is shown in Figure 3. In a period of time, the target entity moves along the dotted line, and mobile agent migrates from node

The migration of pid-DMLA.
The specific migration procedure of pid-DMLA is as follows.
Algorithm 3 (pid-DMLA).
At time it generates a mobile agent. At time Calculate the amount of information collection, Select the next hop, according to (14). At time Calculate the amount of information collection of node If Return to cluster head to process data.
5. Migration Algorithm Based on Multiple Mobile Agents
5.1. The Architecture of Mpid-DMLA
Many researchers have proposed and realized feasible ways to organize the migration of a single mobile agent, such as Agilla program [18] and SensorWare program [19]. Consider the functional requirements of these programs. Firstly, they have not formed an architecture to manage the agent migration mechanisms in WSN. Secondly, they lack migration algorithms when a tracking application needs the collaboration of multiple agents. So when dealing with multiple agents' migration, we need a specific agent to manage the applications.
Therefore, we will propose Mpid-DMLA to solve this problem.
Suppose that multiple target entity applications are deployed in an area of sensors; each application is responsible for monitoring a part of the area and composed of one or more mobile agents. Therefore we have the following definitions.
Definition 4 (code segment application).
A centralized program which consists of multiple mobile agents deployed in the WSN to accomplish a specific task is called centralized code segment application of multiple agents, which is called code segment application for short.
Code segment applications are associated with sensing data that need to be evaluated, and they need to cooperate and interact based on the need of programs. On the other hand, according to the Deluge & Mate model [20], code segment applications need to redeploy themselves so that they can be distributed by the CIS.
To track targets, code segment applications require the following four functions [21].
Constructing the architecture of multiple mobile agents also requires the following definitions.
Definition 5 (main component agent).
The main component agent is responsible for managing migration information and activity cycle of all component agents, processing sensing data of other agents, and collecting and exchanging the information of subcomponent agents. Each code segment application has one and only main component agent.
Definition 6 (subcomponent agent).
The subcomponent agent is used to obtain the data of nodes and report them to the main component agent. Each code segment application has one or more subcomponent agents.
Definition 7 (communication component agent).
The communication component agent is used to collect and exchange the entity information of WSN by migrating. Each code segment application has one or more communication component agents.
Definition 8 (middleware software).
The middleware software, located between the physical and the operating system layers, is the software entity running in mobile agents.
5.2. The Migration Model of Mobile Agent in Mpid-DMLA
When a code segment application changes monitoring positions, all of the mobile agents in this application need to migrate together to reconstruct a new code segment application. In Agilla, the main component agent controls the entire process by sending the migration sequence, while other mobile agents can communicate by accessing the independent tuple space [22]. And the engine virtual machine works as the kernel to provide services and controls all of the concurrent execution of all of the agents in a node. However, with the increase of the mobile agents, the possibilities of the loss of packet and the failure of migration will increase, too. Suppose that a code segment application is composed of
Communication overheads, based on pid-DMLA, are given as follows:
And the next hop is
5.3. The Specific Migration Procedure of Mpid-DMLA
In the construction of the target entity tracking, we assume that subcomponent agent is a small program of lightweight code which is suitable for migration. And it can independently access the target entity's location. As shown in Figure 4, hollow circles represent sensor nodes which are distributed in the sensing region; code segment is composed of one main component agent (solid circle), four subcomponent agents (solid squares) and one communication component agent (solid triangle). Each agent runs on one node, executing code segment applications. The migration of code segment application means the migration of the six mobile agents, which is the migration of multiple mobile agents [19]. The following algorithm can be used to describe the above-mentioned procedure.

Migration based on predicting information drive of multiple mobile agents.
Algorithm 9 (Mpid-DMLA).
A main component agent, a communication component agent, and several subcomponent agents are deployed in different sensor nodes. Sensor nodes are monitoring around the target entity. The node that has first detected information of target entity is denoted as cluster head; the main component agent then migrates to it. At time Calculate the amount of information collection, Define the threshold of the amount of information as The main component agent generates new communication component agent and transfers Then, the communication component agent sets to migrate. At time Calculate the amount of information collection of node If Communication component agent stores the information of the migration path: ( And it interacts with the main component agent. The main component agent generates the migration sequence Send it to each subcomponent agent (this step is optional for different applications). The main component agent sends complete instructions to the lower-layered middleware software. Method functions which are predefined in the middleware software recycle the communication component agent and the subcomponent agents. The main component agent goes to the destination node based on the migration sequence. If the migration fails, send failure information to CIS to terminate this migration; otherwise, generate new communication component agent and subcomponent agents, and this migration ends.
6. Simulation and Analyses
6.1. The Effect of Single Mobile Agent in Target Tracking
Before the simulation experiments, we firstly use target tracking as a sample to demonstrate the migration effect of a single mobile agent of different migration algorithms. As shown in Figures 5, 6, and 7, suppose that a car is running from left to right through the area covered by WSN. The small circle represents the sensor node; solid small circle represents the cluster head, which distributes agents; large dotted circle represents the communication range of sensor node, and each node selects the next hop only within its communication range. The above-mentioned figures illustrate the specific locations of the car and agent from time

The migration process of SMLA.

The migration process of DMLA.

The migration process of pid-DMLA.
The migration process of SMLA is shown in Figure 5. At time
DMLA can, in some sense, optimize the performance of SMLA. As shown in Figure 6, mobile agent tracks the movement of the target entity. However, the movement of the target entity is unpredictable, so it is not accurate to decide migration path only by the amount of information, which is, however, related to the distance to the target entity.
The pid-DMLA can predict movement information of target entity dynamically, which is a better solution to such problems. As shown in Figure 7, at time
6.2. Performance Analysis on the Single Mobile Agent Migration Algorithms
We use simulation software, NS2, to evaluate the three single mobile agent migration algorithms' performances. The default simulation parameters are shown in Table 1.
Basic simulation parameters of single mobile agent migration algorithms.
Suppose that once the agent migrates one hop, all sensor nodes in the network consume 0.2 J. For SMLA, the transmission distance is set to 30 m, while, for DMLA and pid-DMLA, the transmission distance is set to be 10 m. Therefore, the consumption of transmission, for SMLA, is three times more than that of sending. The reason for this setting is that SMLA needs bigger transmission range to collect information. The direction and size of movement of the target entity are constant, denoted as
Scenario 1.
Set the number of nodes as 200, the target entity speed as 0~50 m/s, and the simulation time as 100 s, which can guarantee a complete migration. The simulation results are shown in Figures 8 and 9. It is obvious that DMLA and pid-DMLA consume less energy than SMLA in the whole network. This is because the communication cost of SMLA is higher than that of DMLA. But with the increasing speed of the target entity, the effect of SMLA algorithm in tracking the target entity becomes less and less obvious; therefore, migration may terminate, and the energy consumption, on the contrary, becomes slower. On the other hand, when the speed of target entity is very low, there are no significant differences among the three migration schemes.

Energy consumption of the single agent migration algorithms in Scenario 1.

Lifetime of the single agent migration algorithms in Scenario 1.
Scenario 2.
Set the speed of target entity as 5 m/s and the number of nodes as 800. Generally, the coverage and the number of nodes are positively correlated. The simulation results are shown in Figures 10 and 11. It is clear that pid-DMLA has the lowest energy consumption when the number of nodes is more than 100. This is because with the increase of the nodes the choices of predicting the next hop become more; as a result, the overheads become less [23]. When the number of nodes is less than 50, the performance of SMLA is better than those of the other two. This is because with less nodes static and dynamic migration algorithms share the more similar migration path; however, the migration table has been predetermined in SMLA; thus, it, on the contrary, has the least overheads. On the other hand, when the density of nodes is high, there would be more neighbors and more migration choices. Thus, DMLA and pid-DMLA outperform SMLA.

Energy consumption of the single agent migration algorithms in Scenario 2.

Lifetime of the single agent migration algorithms in Scenario 2.
6.3. Multiple Mobile Agents Migration Algorithm Performance Analysis
Before the assessment of Mpid-DMLA, we need to consider two problems [24, 25]. The first is the effect of code segment applications on the amount of communication in the migration process. To ensure the comprehensiveness of the evaluation, set the number of communication component agents as 1 and the number of subcomponent agents as 5, 10, or 20, and evaluate Mpid-DMLA based on code segments with different scales. The second is the effect of different environment and running platform in practical operation on the amount of information and the success rate of migration. Therefore, we only consider the relation of the number of communication and energy instead of the influence of the agent's size.
The performance of the migration of mobile agent in Agilla system has been evaluated in [19]. First, Agilla system is not designed to support multiple mobile agents specifically, which means that it is not aware of the number of the agents in the code segment application. And the system's overheads are related to the size of mobile agent. So, in Agilla, all kinds of agents are considered to be identical, and there is no discrimination between the main and communication component agents. However, this does not affect the simulation results because all agents are uniformly assumed in the simulation in this paper.
The purpose of multiple mobile agents migration is to complete the entire application migration with limited energy. The default simulation parameters are shown in Table 2.
Basic simulation algorithm parameters of a single mobile agent migration.
And when main component agent recycles and sends mobile agents, suppose that the energy consumption of the node where main component agent stays is neglected, while that of other nodes is 0.05 J.
Figures 12, 13, and 14 illustrate the relation between the number of application code segments and the success rate of one hop migration, when the numbers of subcomponent agents are 5, 10, and 15, respectively. The success rate of Mpid-DMLA is higher, when the number of subcomponent agents is 5, than those when the numbers of subcomponent agents are 10 and 20. It is obvious that the successful rate of Mpid-DMLA is generally not less than 50%, which is much larger than that of Agilla.

The relation between the number of code segment applications and the success rate of migration (I).

The relation between the number of code segment applications and the success rate of migration (II).

The relation between the number of code segment applications and the success rate of migration (III).
Moreover, Figure 15 demonstrates the relationship between the migration hops and the amount of communication, when the subcomponent agents are 5. As shown in Figure 15, with the same migration hops, the amount of communication of Mpid-DMLA is much less than that of Agilla. As the number of data packet reflects the amount of energy consumption, Mpid-DMLA consumes less energy than Agilla.

The relation between the migration hops and the amount of communication.
Although the simulation results show that Mpid-DMLA is a suitable migration scheme for multiple mobile agents, it bases on some specific assumptions. In general, this scheme still encounters the following three issues.
When the main component agent loses efficacy in the process of migration, code segment applications cannot be rebuilt. When subcomponent agents lose efficacy after deployment, code segment applications will keep waiting because the applications cannot be recycled. If the main and the subcomponent agents, which lose efficacy in issue 1 or 2, are left in the nodes without being recycled, then other mobile agents cannot reach these nodes.
Therefore, in designing middleware software, it is necessary to add the feedback mechanism of main component agent, and it needs to periodically return ACK information to the higher layer of the middleware software. When the middleware finds that the main component agent loses efficacy, it needs to distribute a new one or a specialized independent agent to recycle the useless agents in the whole network.
In Agilla, the method of recycling the useless agents is by adding the unified interface into all of the agents. Removing all of the mobile agents will affect the function of code segment applications. Therefore, developing the more appropriate middleware software is the future work, which is also related to the development of the better migration strategies [26].
7. Conclusion
As big data is the intensification of information architecture while distributed computing is the intensification of infrastructure and resource, distributed computing is an appropriate method to deal with big data. In this paper, we have firstly illustrated the mobile agent model in the distributed computing. And it led to the two considerable factors of migration: the selection of nodes and of the sequence of them. Then, we have proposed the assumptions of the migration algorithms. Moreover, we have designed the node's sensor model and information collection model. Furthermore, we have formulated the beacon frames of mobile agent for communication. Generally, mobile agent migration algorithms can be transferred as the target tracking issue. Thus, we have described a simple target localization algorithm applicable for migration. On this basis, we have generalized the whole migration process of the mobile agent.
Considering the single mobile agent, we have proposed the static SMLA and the dynamic DMLA algorithms. After analyzing the drawbacks of SMLA and DMLA, we then proposed the pid-DMLA algorithm. Section 4 has demonstrated the modeling procedure of the abovementioned three algorithms; Section 6 has emulated and evaluated their performances and studied their advantages and disadvantages in different scenarios.
Considering the multiple mobile agents applied in practical target tracking, we have also put forward the Mpid-DMLA algorithm. In the process of mobile agent component constructing code segment applications, we defined three mobile agents with different functions to cooperate with each other to accomplish the migration. Section 5 illustrated the architecture, modeling procedure, and basic process of Mpid-DMLA; Section 6 compared it with Agilla and evaluated its advantages and disadvantages.
