Next Article in Journal
Effects of Abscisic Acid on Rice Seed Dormancy: Antioxidant Response and Accumulations of Melatonin, Phenolics and Momilactones
Previous Article in Journal
Inhibition of Botrytis cinerea and Escherichia coli by Lactic Acid Bacteria on Leafy Vegetables
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Research and Design of a Hybrid DV-Hop Algorithm Based on the Chaotic Crested Porcupine Optimizer for Wireless Sensor Localization in Smart Farms

1
College of Mechanical and Electrical Engineering, Shihezi University, Shihezi 832003, China
2
Bingtuan Energy Development Institute, Shihezi University, Shihezi 832003, China
*
Author to whom correspondence should be addressed.
Agriculture 2024, 14(8), 1226; https://doi.org/10.3390/agriculture14081226
Submission received: 9 July 2024 / Revised: 23 July 2024 / Accepted: 23 July 2024 / Published: 25 July 2024
(This article belongs to the Section Digital Agriculture)

Abstract

:
The efficient operation of smart farms relies on the precise monitoring of farm environmental information, necessitating the deployment of a large number of wireless sensors. These sensors must be integrated with their specific locations within the fields to ensure data accuracy. Therefore, efficiently and rapidly determining the positions of sensor nodes presents a significant challenge. To address this issue, this paper proposes a hybrid optimization DV-Hop localization algorithm based on the chaotic crested porcupine optimizer. The algorithm leverages the received signal strength indicator, combined with node hierarchical values, to achieve graded processing of the minimum number of hops. Polynomial fitting methods are employed to reduce the estimation distance error from the beacon nodes to unknown nodes. Finally, the chaotic optimization crested porcupine optimizer is designed for intelligent optimization. Simulation experiments verify the proposed algorithm’s localization performance across different monitoring areas, varying beacon node ratios, and assorted communication radii. The simulation results demonstrate that the proposed algorithm effectively enhances node localization accuracy and significantly reduces localization errors compared to the results for other algorithms. In future work, we plan to consider the impact of algorithm complexity on the lifespan of wireless sensor networks and to further evaluate the algorithm in a pH monitoring system for farmland.

1. Introduction

Currently, the cultivation methods of a vast number of farmlands still predominantly rely on farmers’ traditional experience, resulting in resource overutilization and inefficient management. Against this backdrop, smart farms, at the forefront of modern agricultural development, exhibit immense promise and potential [1,2]. By leveraging advanced technologies such as wireless sensor networks (WSNs), the Internet of things (IoT), and artificial intelligence (AI), smart farms achieve the comprehensive collection and processing of farmland information. This enables precise irrigation and fertilization, making farm management more intelligent and efficient [3,4]. For instance, deep learning algorithms are employed for the detection and classification of crop diseases [5], and intelligent control algorithms are used to achieve precise ratios of nitrogen, phosphorus, and potassium in fertilizer solutions [6]. Smart farms are typically applied to large-scale farming operations, where intelligent management decisions depend on the accurate monitoring of farm environmental information. Consequently, WSNs are crucial to the realization of smart farms.
Wireless sensor networks (WSNs) are distributed networks composed of numerous wireless sensor nodes deployed within the monitoring areas, characterized by features such as self-organization, self-configuration, and adaptability [7,8]. As a composite system for information collection and processing, WSNs have been widely utilized in smart farms. Their advantage lies in their ability to promptly acquire soil environmental information for each plot of land, thereby facilitating the rational improvement and adjustment of the growth environment for crops within different plots [9,10,11]. To accurately reflect the actual conditions of various plots, the environmental information monitored by sensor nodes in WSNs—such as light intensity, soil temperature, and pH value—must be analyzed in conjunction with the specific location of the nodes to ensure data accuracy and validity. However, due to the diversity of plot characteristics, the deployment locations of sensors are random, posing a significant challenge for efficiently and rapidly determining the positions of sensor nodes.
Currently, farms primarily employ two methods to determine the positions of sensors [12,13]. The first method involves manually deploying sensors to predetermined locations. However, given the vast expanse of farmland, this approach often results in excessive labor for workers and high costs and inefficiencies in terms of time. The second method involves installing GPS devices on each sensor node. Full GPS coverage of a large number of sensor nodes in WSNs is difficult due to the high cost of GPS devices [14]. Considering constraints such as network cost, node power consumption, and operating environment, we only install GPS modules on a limited number of sensor nodes (beacon nodes) for precise positioning during sensor node deployment. The positions of the remaining nodes (unknown nodes) are estimated using the known locations of beacon nodes and localization algorithms. This strategy effectively reduces the cost and energy consumption of WSNs while ensuring a reasonable degree of localization accuracy [15,16].
Regarding WSN localization algorithms, they can be categorized into range-based and range-free localization algorithms, depending on whether or not they require the measurement of distances between nodes [17]. Range-based localization algorithms offer high positioning accuracy but necessitate embedding specific measurement modules within the sensor nodes. For instance, the angle of arrival (AoA) algorithm requires the installation of antenna array modules to obtain the azimuth angle between nodes, thereby providing high-precision localization [18]. In contrast, range-free localization algorithms are characterized by lower cost and energy consumption. For example, the centroid localization algorithm estimates the coordinates of a node by calculating the centroid of a polygon formed by the beacon nodes within the communication radius of the unknown node [19].
Among the numerous range-free localization algorithms, the DV-Hop algorithm is widely utilized due to its simplicity and low cost [20]. However, the complexity of farmland and the randomness of the distribution of sensor nodes result in low localization accuracy for the DV-Hop algorithm. To address this issue in smart farm wireless sensor networks, this paper proposes a novel DV-Hop localization algorithm based on polynomial fitting average optimization and an improved crested porcupine optimizer. The main contributions of this study are as follows:
  • The RSSI algorithm is used to optimize the minimum hop count by comparing the received signal strength and hierarchical values of the nodes, thereby achieving fractional grading of the minimum hop count.
  • The polynomial fitting method is employed to model the nonlinear relationship between the minimum hop count and distance in the DV-Hop algorithm, effectively reducing the distance estimation error.
  • The chaotic crested porcupine optimizer (CACPO) is designed to replace the least squares method for intelligent optimization of the unknown node coordinates, which not only enhances localization accuracy, but also improves the computational efficiency of the nodes.
In the first section, this paper introduces the localization technology for wireless sensor networks in smart farms. Section 2 reviews related work. Section 3 introduces the structural model of the farm wireless sensor network system, establishing a path loss model in Section 3.1. In Section 3.2, the principles of the DV-Hop algorithm are described, along with hop count optimization based on the RSSI algorithm, distance optimization using polynomial fitting, and solution optimization using the chaotic crested porcupine optimizer. Section 4 utilizes Matlab2022b for simulation experiments and analyzes the simulation results. Finally, Section 5 summarizes the conclusions drawn from the study.

2. Related Work

Due to the irregularity and complexity of real-world application environments, the localization results for range-free algorithms often exhibit significant discrepancies from the actual positions [21,22]. To reduce the localization error of these algorithms, various improvement schemes have been proposed by researchers.
Xingcheng Liu et al. [23] employed geometric constraint solutions and a hop-progress-based method to categorize anchor pairs into optimal pairs, suboptimal pairs, and unusable pairs. Different distance estimation methods were proposed for each category to balance the trade-off between distance estimation accuracy and anchor utilization. Shengqiang Han et al. [24] proposed an auxiliary hole localization algorithm based on multidimensional scaling to enhance the localization accuracy of sensor nodes situated at the boundaries of holes. Simulation results indicate that this algorithm is suitable for node localization in wireless sensor networks with various types of holes. Amanpreet Kaur et al. [25] introduced a weighting factor that considers different anchors, communication radii, and the influence of anchors near a given node, thereby reducing the power consumption of WSNs. Jari Luomala and Hakala Ismo [26] utilized the geometric shapes of reference triangles and ranging errors to identify the optimal combination of reference nodes for an unknown node within a given time and space. This approach enables resource-constrained WSN nodes to achieve high localization accuracy.
Intelligent optimization algorithms, known for their global optimization capabilities and strong versatility, can find the optimal solution or near-optimal solution within a limited time [27]. Consequently, many researchers have introduced intelligent optimization algorithms into WSN localization algorithms.
Wenxian Jia et al. [28] introduced an adaptive step change chaotic fruit fly optimization algorithm. Simulation results demonstrated that in an H-shaped topology, the normalized average localization error remained stable within the range of 0.2 to 0.3. Penghong Wang et al. [29] proposed a multi-objective algorithm based on the non-dominated sorting genetic algorithm II (NSGA-II). By employing a multi-objective constraint method, they effectively reduced the convergence range of unknown nodes. Veerraghava Reddy Sabbella et al. [30] introduced a lobster swarm optimization algorithm with enhanced heuristic crossover and mutation. Compared to the improved amorphous localization algorithm, this approach offered higher localization accuracy and smaller error margins. Songyut Phoemphon et al. [31] employed a particle swarm optimization (PSO) algorithm, integrating it with an improved fitness function to estimate the positions of unknown nodes. Simulation results indicated that this method achieved higher accuracy than other PSO-based localization algorithms.
As one of the widely used range-free localization algorithms, the DV-Hop algorithm has been a major focus of current research improvements [32]. The enhancements of the DV-Hop method primarily concentrate on the following three aspects. Firstly, the optimization of the minimum hop count is performed: for example, Laizhong Cui et al. [33] transformed the single hop between neighboring nodes into continuous values through mathematical derivation, thereby eliminating the limitations of discrete integer sequences. Secondly, the optimization of average hop distance is achieved; for instance, Omar Cheikhrouhou et al. [34] used the estimated distance between beacon nodes and neighboring sensor nodes obtained via RSSI as the average distance, thereby improving the accuracy of distance estimation. Thirdly, the introduction of intelligent algorithms is emplooyed; for example, Aijia Ouyang et al. [35] introduced an improved adaptive genetic algorithm to overcome the low accuracy problem associated with the use of the least squares method.
To address the low localization accuracy of the DV-Hop algorithm, we propose a hybrid optimization localization algorithm that combines polynomial average optimization, RSSI optimization, and an improved crested porcupine optimizer algorithm. This algorithm integrates the advantages of various optimization methods, ensuring more stable and accurate performance in complex environments. Additionally, we introduce the WSN localization problem into the smart farm domain. Previous research on wireless sensor networks in agriculture has primarily focused on coverage deployment and routing technologies, with relatively little attention given to node localization techniques. Our study boasts broad application prospects, being suitable not only for smart farms, but also being extendable to other areas such as intelligent irrigation, demonstrating strong versatility and practical value.

3. Materials and Methods

3.1. Farm Wireless Sensor Network Model

The farm wireless sensor network system consists of numerous agricultural wireless sensor nodes, which may exhibit the same or different functions and work collaboratively to achieve precise monitoring in smart farms. In general, the terrain of farms in the Xinjiang region is relatively flat, so the monitoring area of the farm wireless sensor network system can be considered as a two-dimensional area, as shown in Figure 1. The system mainly includes agricultural sensor nodes, sink nodes, a cloud platform, and user terminals. Agricultural sensor nodes are randomly distributed within the monitoring area and possess self-organizing capabilities. These nodes can automatically form a multi-hop network system based on built-in protocols and algorithms, ensuring comprehensive data collection and transmission. Sink nodes are responsible for gathering data from agricultural sensor nodes within the monitoring area and effectively forwarding this data to the cloud platform using IoT technology. The cloud platform is tasked with processing and storing data, ensuring secure storage and complex data processing to support smart farm decision making. User terminals refer to the computing devices operated by users, allowing real-time access and monitoring of farm environmental information, enabling users to instantly stay informed about farm conditions.
In practical scenarios, signal transmission is influenced by various factors such as interference, refraction, and obstruction by obstacles. To address these challenges, the farm wireless sensor network adopts a log-normal shadowing model to calculate path loss. This model effectively describes the attenuation of the signal during transmission. The specific calculation formula for path loss is shown in Equation (1).
P ( d ) = P ( d 0 ) 10 n l g ( d d 0 ) + ε
where  P ( d )  is the path loss at distance  d P ( d 0 )  is the path loss at the reference distance  d 0 n  is the path loss exponent, and  ε  is the Gaussian error term.

3.2. Hybrid Optimization DV-Hop Algorithm Based on the Improved Crested Porcupine Optimizer

We focus on optimizing the traditional DV-Hop algorithm by addressing hop count errors, distance estimation errors, and coordinate estimation errors. Firstly, the minimum hop count is optimized using the RSSI algorithm, enabling the fractional processing of hop counts. Secondly, a polynomial fitting method is employed to capture the nonlinear relationship between the minimum hop count and the estimated distance. Finally, the CACPO algorithm is utilized for intelligent optimization of the coordinates of unknown nodes, thereby enhancing computational efficiency. The workflow of the proposed hybrid optimization DV-Hop algorithm (HO-DV-Hop), based on the improved crested porcupine optimizer, is illustrated in Figure 2.

3.2.1. DV-Hop Algorithm Design

The DV-Hop localization algorithm is one of the various widely used range-free localization algorithms. Its core intention is to approximate the actual distance from unknown nodes to beacon nodes by using the product of the average hop distance and the minimum hop count [32]. The specific implementation steps of the DV-Hop algorithm are as follows:
The first step is to obtain the minimum hop count between nodes. Each beacon node broadcasts a data packet containing its own ID, position, and hop count information (initially set to 0) to the surrounding nodes. For unknown nodes, if they have not previously received a data packet from that beacon node, they store the packet directly; otherwise, they save the packet with the smallest hop count value. Then, the stored packet’s hop count value is incremented by one and forwarded. This process is repeated until the broadcasting is complete, thereby obtaining the minimum hop count between all nodes and each beacon node in the smart farm wireless sensor network.
The second step is to estimate the distance from unknown nodes to beacon nodes. For a beacon node  i , its average hop distance  h o p e s i z e i  is calculated as shown in Equation (2):
h o p e s i z e i = j = 1 , j i M ( x i x j ) 2 + ( y i y j ) 2 j = 1 , j i M h i j
where  ( x i ,   y i )  and  ( x j ,   y j )  are the coordinates of beacon nodes  i  and  j , respectively;  h i j  is the minimum hop count from beacon node  i  to  j M  is the total number of beacon nodes in the WSNs. The average hop distance of the beacon node closest to a given unknown node is used as the average hop distance for that unknown node. The estimated distance  d u i  from unknown node  u  to beacon node  i  is given by Equation (3):
d u i = h o p e s i z e u × h u i
where  h o p e s i z e u  is the average hop distance of unknown node  u , and  h u i  is the minimum hop count from unknown node  u  to beacon node  i .
The third step is to form the distance relationship matrix. The distance relationship equations to calculate the distance between unknown node  u  and all beacon nodes are given by Equation (4):
( x u x 1 ) 2 + ( y u y 1 ) 2 = d u 1 2 ( x u x 2 ) 2 + ( y u y 2 ) 2 = d u 2 2 ( x u x M ) 2 + ( y u y M ) 2 = d u M 2
Subtracting the  M -th equation from the first  M 1  equations in Equation (4) and then simplifying yields Equation (5):
2 ( x M x 1 ) · x u + 2 ( y M y 1 ) · y u = ( d u 1 2 d u M 2 ) ( x 1 2 + y 1 2 ) + ( x M 2 + y M 2 ) 2 ( x M x 2 ) · x u + 2 ( y M y 2 ) · y u = ( d u 2 2 d u M 2 ) ( x 2 2 + y 2 2 ) + ( x M 2 + y M 2 ) 2 ( x M x M 1 ) · x u + 2 ( y M y M 1 ) · y u = ( d u ( M 1 ) 2 d u M 2 ) ( x M 1 2 + y M 1 2 ) + ( x M 2 + y M 2 )
Equation (5) can be simplified into a matrix form  A x = b , where the definitions of  A x , and  b  are obtained by Equations (6), (7), and (8), respectively.
A = 2 x M x 1 x M x 2 x M x M 1 y M y 1 y M y 2 y M y M 1
x = x u y u
b = ( d u 1 2 d u M 2 ) ( x 1 2 + y 1 2 ) + ( x M 2 + y M 2 ) ( d u 2 2 d u M 2 ) ( x 2 2 + y 2 2 ) + ( x M 2 + y M 2 ) ( d u ( M 1 ) 2 d u M 2 ) ( x M 1 2 + y M 1 2 ) + ( x M 2 + y M 2 )
The fourth step is to solve using the least squares method. Assuming  A T · A  is non-singular, the least squares solution to the linear equation  A x = b  can be expressed as shown in Equation (9):
x = a r g m i n A x b 2
Equation (9) represents the approximate solution  x  when  A x b 2  reaches its minimum value. This problem can be transformed into:
m i n f ( x ) = A x b 2
By expanding function  f ( x )  using the properties of matrix operations, we obtain:
f ( x ) = ( A x b ) T ( A x b ) = x T A T A x 2 b T A x + b T b
Taking the partial derivative with respect to  x , we get:
f ( x ) = 2 A T A x 2 A T b
Letting  f ( x ) = 0 , the least squares solution is given by Equation (13):
x = ( A T · A ) 1 · A T · b

3.2.2. Hop Count Optimization Based on the RSSI Algorithm

The DV-Hop algorithm counts the hop count of all nodes within the communication range of a beacon node as one hop, which introduces significant errors [36]. To reduce this error, this paper refines one hop within the communication range of the beacon node into five levels, as shown in Equation (14). The hop count grading diagram is illustrated in Figure 3.
h u i = a 5 a 1 5 R < d a 5 R
where  h u i  is the hop count of unknown node  u  relative to beacon node  i d  is the actual distance from unknown node  u  to beacon node  i R  is the communication radius of beacon node  i ; and  a  is any positive integer in the range [1,5]. As shown in Figure 1, the hop count of unknown node  u  relative to beacon node  i  is  4 5 .
Since the actual distance from the unknown node to the beacon node is unknown, the RSSI algorithm is introduced to establish the hop count grading standard. For the application scenario of farm wireless sensors, the relationship between the RSSI value and distance is obtained by Equation (15):
R S S I = A 10 n l g ( d ) + ε
where  A  is the difference between the transmission power of the beacon node and the received power at the unknown node.
In the application scenario of farm wireless sensors, the power of Gaussian noise is much lower than the power value of one hop within the communication range of the beacon node, so the impact of Gaussian noise can be ignored. The grading formula is given by Equation (16):
h u i = a 5 A 10 n l g ( a 5 R ) R S S I ( d ) < A 10 n l g ( a 1 5 R )
After obtaining the graded hop count for each pair of adjacent nodes, the shortest path algorithm is used to determine the minimum graded hop count between all connected nodes.

3.2.3. Distance Optimization Based on Polynomial Averaging

In the actual network environment of farm wireless sensors, the minimum hop count paths between nodes usually form a zigzag pattern. As shown in Figure 4, the minimum paths from beacon node  i  to  j  and from beacon node  i  to  k  both form zigzag patterns [37].
This paper uses a polynomial approximation method to estimate the distance from unknown nodes to beacon nodes. The relationship between the estimated distance  d u i  and the minimum hop count between nodes is given by Equation (17):
d u i = k 1 · h u i 4 + k 2 · h u i 3 + k 3 · h u i 2 + k 4 · h u i + k 5
where  k 1 k 2 k 3 k 4 , and  k 5  are the polynomial coefficients. Equation (17) can be simplified into matrix form as  H K = D , where the definitions of  H K , and  D  are given by Equations (18), (19), and (20), respectively:
H = h u 1 4 h u 2 4 h u M 4 h u 1 3 h u 2 3 h u M 3 h u 1 2 h u 2 2 h u M 2 h u 1 h u 2 h u M 1 1 1
K = k 1 , k 2 , k 3 , k 4 , k 5 T
D = d u 1 , d u 2 , d u 3 , , d u M T
Combining Equations (9)–(13), the polynomial coefficient matrix for unknown node  u  is obtained, as shown in Equation (21):
K = ( H T · H ) 1 · H T · D

3.3. Optimization Based on the Chaotic Crested Porcupine Optimizer

This section approaches the localization problem of unknown nodes in the DV-Hop algorithm from the perspective of intelligent algorithms, transforming it into an optimization problem to find the optimal solution [38]. The chaotic crested porcupine optimizer (CACPO) is introduced for intelligent optimization of the unknown node coordinates.
1. Chaotic initialization of the population: The initial iteration count  t m a x , initial population size  N m a x , minimum population size  N m i n , loop variable  T , and the trade-off ratio  T f  for the third and fourth defense mechanisms are employed. The initial population can be expressed as Equation (22), and the method for initializing their positions is obtained by Equation (23):
P = P 1 1 P 2 1 P i 1 P N m a x 1 = p 1,1 1 p 2,1 1 p i , 1 1 p N m a x , 1 1 p 1,2 1 p 2,2 1 p i , 2 1 p N m a x , 2 1
P i 1 = L + w × ( U L )     i = 1 , 2 , , N m a x
where  L  is the lower bound of the solution space;  U  is the upper bound of the solution space;  w  is the random sequence generated by iterating the circle map 1000 times, as shown in Equation (24). Equation (24) represents the relationship between the  t + 1 -th generation sequence and the  t -th generation sequence when iterating the circle map.
w t + 1 = m o d ( w t + 0.2 ( 0.5 2 π ) s i n ( 2 π x t ) , 1 )
For a given unknown node  u , the fitness function  f i t n e s s  of the CACPO algorithm is obtained by Equation (25), where  p i , 1 t  and  p i , 2 t  are the  x -axis and  y -axis coordinates of the  i -th generation population individual, respectively:
f i t n e s s = i = 1 M ( p i , 1 t x i ) 2 + ( p i , 2 t y i ) 2 d u i
2. Cyclic population reduction technique: During population iterations, only individuals under threat will trigger defense mechanisms. Over a cycle, the population size gradually decreases to accelerate convergence. At the end of the cycle, the population size is restored to the initial population size to increase diversity, as shown in Equation (26):
N = N m i n + ( N m a x N m i n ) × ( 1 t % · t m a x T t m a x T )
where  N  is the current population size, and  t  is the current generation number.
3. The first defense strategy: When an individual senses a predator, it raises and flutters its quills. In this situation, the predator has two choices: approach the individual or move away from it. If the predator approaches, the distance between the predator and the individual decreases, accelerating convergence. If the predator moves away, the distance increases, allowing exploration of unvisited areas. This process is represented by Equation (27):
P i t + 1 = P i t + τ 1 × 2 × τ 2 × P c p t h i t
where  P i t + 1  is the position of the  i -th individual in the  t + 1 -th generation;  P i t  is the position of the  i -th individual in the  t -th generation;  τ 1  is a random number following a normal distribution;  τ 2  is a random number in the interval [0, 1];  P c p t  is the position of the best individual in the  t -th generation; and  h i t  is the position of the predator after  t  iterations, as shown in Equation (28):
h i t = P i t + P r t 2
where  r  is a randomly chosen integer in the interval [0,  N ].
4. The second defense strategy: In this strategy, individuals use sound to create noise to threaten predators. The intensity of the sound is classified as high, medium, or low; meanwhile, the behavior of the predator can be to approach, move away, or remain stationary. This phenomenon can be described by Equation (29):
P i t + 1 = ( 1 U 1 ) × P i t + U 1 × ( h i t + τ 3 × ( P r 1 t P r 2 t )
where  U 1  is a binary vector composed of 0s and 1s;  τ 3  is a random number in the interval [0, 1];  r 1  and  r 2  are randomly chosen integers in the interval [0,  N ].
5. The third defense strategy: In this strategy, individuals secrete a foul odor to prevent predators from approaching them. This behavior is described by Equation (30):
P i t + 1 = ( 1 U 1 ) × P i t + U 1 × ( P r 1 t + s i t × ( P r 2 t P r 3 t ) τ 3 × δ × γ t × s i t )
where  s i t  is the odor diffusion factor, as specified in Equation (31);  δ  is the search direction parameter, as specified in Equation (32); and  γ t  is the defense factor, as specified in Equation (33):
s i t = e x p ( f i t n e s s ( P i t ) k = 1 N f i t n e s s ( P k t ) + σ )
δ = + 1 1     r a n d 0.5 e l s e  
γ t = 2 × τ 7 × ( 1 t t m a x ) t t m a x
where  r a n d  is a random vector with values in the interval [0, 1];  τ 7  is a random value in the interval [0, 1]; and  σ  is a small value to avoid division by zero.
6. The fourth defense strategy: In this strategy, individuals use their quills to attack predators. This physical attack process can be described as an inelastic collision in one dimension, represented by Equation (34):
P i t + 1 = P c p t + ( α ( 1 τ 4 ) + τ 4 ) × ( δ × P c p t P i t ) τ 5 × δ × γ t × F i t )
where  α  is the convergence speed factor;  τ 4  and  τ 5  are random values in the interval [0, 1]; and  F i t  is the average force of the  i -th predator, as specified in Equation (35):
F i t = τ 6 × s i t × ( P r t P i t )
where  τ 6  is a random vector with values in the interval [0, 1].

4. Simulation Results and Analysis

4.1. Modeling Set-Up and Assessment of Indicators

In this section, the performance of the proposed HO-DV-Hop algorithm is extensively evaluated through simulations under various scenarios and conditions. The HO-DV-Hop algorithm is compared with four other algorithms: DV-Hop, DQPSO-DV-Hop [39], CAFOA-DV-Hop [28], and SSI-DV-Hop [40]. To ensure fairness, simulations are conducted under identical network settings, and the results are averaged over 10 trials. The simulation platform runs on a Windows 11 operating system with an Intel Core i5-12400F processor (3.40 GHz) and 32 GB RAM, with all coding performed in the Matlab 2022b environment. In all simulations, sensor nodes are deployed within a 1000 × 1000 square meter area, with a maximum communication radius of 300 m. To assess the impact of different monitoring areas on algorithm localization accuracy, four distinct monitoring areas are considered: C-shaped, H-shaped, O-shaped, and W-shaped, as shown in Figure 5. In the figure, red asterisks indicate the coordinates of beacon nodes, while blue circles represent the coordinates of unknown nodes.
To validate the localization accuracy of the five algorithms, this paper uses the normalized average localization error as the evaluation metric, as specified in Equation (36).
e r r o r = u = 1 V ( x u x u ) 2 + ( y u y u ) 2 R × V
where  V  is the total number of unknown nodes, and  ( x u , y u )  are the actual coordinates of unknown node  u . The simulation parameters are set as shown in Table 1.

4.2. Impact of Beacon Node Ratio

A total of 240 sensor nodes are randomly distributed within the observation area, with the communication radius of each sensor node fixed at 200 m. In the simulation experiments, the proportion of beacon nodes is set to increase from 10% to 30%, with an interval of 5%. The simulation results for the four different monitoring areas are shown in Figure 6.
From Figure 6, it can be observed that in the four different monitoring areas, as the proportion of beacon nodes increases from 10% to 30%, the average localization error (ALE) of the DV-Hop algorithm, DQPSO-DV-Hop algorithm, CAFOA-DV-Hop algorithm, SSI-DV-Hop algorithm, and the proposed HO-DV-Hop algorithm gradually decreases. This is because the increased proportion of beacon nodes provides more references for calculating the distances between unknown nodes and beacon nodes, thereby reducing the error range. In the O-shaped monitoring area, when the proportion of beacon nodes in the DV-Hop algorithm increases from 15% to 20%, the ALE value rises from 0.522 to 0.531. This increase is due to the inherent randomness in the simulation results obtained in each experiment. Although we mitigated the impact of random errors by averaging the results of 10 experiments, significant random errors in a single experiment can still cause fluctuations in the average localization error. Across the four different monitoring areas and five different proportions of beacon nodes, the localization error of the proposed HO-DV-Hop algorithm is consistently lower than that of the DV-Hop algorithm, DQPSO-DV-Hop algorithm, CAFOA-DV-Hop algorithm, and SSI-DV-Hop algorithm. Notably, when the beacon node proportion is 10% in the C-shaped monitoring area, the HO-DV-Hop algorithm reduces the ALE by 1.233, 0.864, 0.188, and 0.144 compared to the other four algorithms, respectively. This indicates that the HO-DV-Hop algorithm possesses higher localization accuracy than the DQPSO-DV-Hop algorithm, CAFOA-DV-Hop algorithm, and SSI-DV-Hop algorithm, all of which utilize intelligent algorithms. The improved accuracy of the HO-DV-Hop algorithm is attributed to its use of RSSI technology to refine the single-hop communication range of the beacon nodes, reducing errors introduced during the hop count acquisition phase. In contrast, the DQPSO-DV-Hop, CAFOA-DV-Hop, and SSI-DV-Hop algorithms still employ traditional methods to obtain the minimum hop count, resulting in errors in the minimum hop count values used during computation, which accumulate throughout the localization process.

4.3. Impact of Communication Radius

In the simulation experiments, the communication radius of the sensor nodes varies between 100 m and 300 m, with an interval length of 50 m. The number of unknown nodes is set to 240, with beacon nodes accounting for 20% of this number. The simulation results for the four different monitoring areas are shown in Figure 7.
From Figure 7, it can be observed that in the four different monitoring areas, as the communication radius increases from 100 m to 300 m, the average localization error (ALE) of the five aforementioned localization algorithms gradually decreases. This is because, within a certain range, increasing the node communication radius extends the communication distance, enhancing network connectivity and reducing the presence of isolated nodes, thereby improving localization accuracy. In the C-shaped, H-shaped, O-shaped, and W-shaped monitoring areas, the HO-DV-Hop algorithm consistently demonstrates superior localization accuracy, maintaining the lowest ALE as the communication radius varies from 100 m to 300 m. Specifically, when the communication radius is 100 m in the C-shaped monitoring area, the ALE of the HO-DV-Hop algorithm is reduced by 2.652, 0.392, and 0.320 compared to that of the DQPSO-DV-Hop, CAFOA-DV-Hop, and SSI-DV-Hop algorithms, respectively. This improvement is attributed to the intelligent optimization algorithm proposed in this paper, which combines chaotic theory and cyclic population reduction techniques. This combination ensures that the search process maintains randomness and diversity while achieving faster convergence, thereby approaching the optimal solution more rapidly. Compared to the DV-Hop algorithm, the HO-DV-Hop algorithm reduces the ALE by 2.895. This is because the DV-Hop algorithm approximates the shortest path between nodes as a straight line when estimating distances, but the presence of holes in the four different monitoring areas causes node distributions to be more convoluted, resulting in significant estimation errors. The HO-DV-Hop algorithm designed in this paper uses polynomial fitting to approximate the relationship between the hop count and the distance between nodes, better aligning with the actual node distribution.

5. Conclusions

As a composite system for information collection and processing, wireless sensor networks (WSNs) have been widely applied across various fields. This paper conducts an in-depth study of the localization problem of wireless sensors in smart farms, establishing the structural model of a farm wireless sensor network system and calculating path loss using a log-normal distribution model. To address the insufficient localization accuracy of the DV-Hop algorithm, we propose a multi-layered improvement scheme. Firstly, we introduce the RSSI algorithm to achieve graded processing of the minimum hop count. Subsequently, we optimize the distance estimation from beacon nodes to unknown nodes in the DV-Hop algorithm using polynomial fitting methods. Finally, we integrate the CACPO algorithm for intelligent optimization. Simulation experiments validate the proposed algorithm’s localization performance in C-shaped, O-shaped, H-shaped, and W-shaped monitoring areas. By varying the proportion of beacon nodes and the communication radius in WSNs, we compare the localization accuracy of the proposed HO-DV-Hop algorithm with that of the DV-Hop, DQPSO-DV-Hop, CAFOA-DV-Hop, and SSI-DV-Hop algorithms. The results confirm that the proposed algorithm effectively improves node localization accuracy and significantly reduces localization errors. However, this study only validates the algorithm’s performance in a simulated environment. Considering various interferences in practical applications, further evaluation in a farmland pH monitoring system is necessary. In future research, we plan to consider the impact of algorithm complexity on the lifespan of WSNs and to further investigate how to achieve high localization accuracy while reducing algorithm complexity.

Author Contributions

Conceptualization, H.W.; software, H.W. and B.L.; validation, H.W.; data curation, H.W.; writing—original draft preparation, H.W.; writing—review and editing, L.Z. All authors have read and agreed to the published version of the manuscript.

Funding

This study was funded by the National Key R&D Program of China (2022ZD0115804), Major Science and Technology Projects in Xinjiang Uygur Autonomous Region (2022A02012-4).

Institutional Review Board Statement

Not applicable.

Data Availability Statement

Data are contained within the article.

Conflicts of Interest

The authors declare no conflicts of interest.

Abbreviations

P ( d ) the path loss at distance  d
P ( d 0 ) the path loss at the reference distance  d 0
n the path loss exponent
ε the Gaussian error term
h o p e s i z e i the average hop distance of beacon node  i
( x i ,   y i ) the coordinates of beacon node  i
( x j ,   y j ) the coordinates of beacon node  j
h i j the minimum hop count from beacon node  i  to  j
M the total number of beacon nodes in the WSNs
d u i the estimated distance from unknown node  u  to beacon node  i
h u i the minimum hop count from unknown node  u  to beacon node  i
x the approximate solution  x  when  A x b 2  reaches its minimum value
R the communication radius of beacon node  i
a any positive integer in the range [1, 5]
R S S I beacon node  u  receives the RSSI value from an unknown node  i
k 1 k 2 k 3 k 4 , and  k 5 the polynomial coefficients
L the lower bound of the solution space
U the upper bound of the solution space
w the random sequence generated by iterating the circle map 1000 times
f i t n e s s the fitness function of the CACPO algorithm
p i , 1 t the  x -axis coordinates of the  i -th generation population individual
p i , 2 t the  y -axis coordinates of the  i -th generation population individual
N the current population size
t the current generation number
P i t + 1 the position of the  i -th individual in the  t + 1 -th generation
P i t the position of the  i -th individual in the  t -th generation
τ 1 a random number following a normal distribution
τ 2 a random number in the interval [0, 1]
P c p t the position of the best individual in the  t -th generation
h i t the position of the predator after  t  iterations
r a randomly chosen integer in the interval [0, N]
U 1 a binary vector composed of 0 s and 1 s
τ 3 a random number in the interval [0, 1]
r 1 r 2 randomly chosen integers in the interval [0, N]
s i t the odor diffusion factor
δ the search direction parameter
γ t the defense factor
r a n d a random vector with values in the interval [0, 1]
τ 7 a random value in the interval [0, 1]
σ a small value to avoid division by zero
α the convergence speed factor
τ 4 τ 5 random values in the interval [0, 1]
F i t the average force of the  i -th predator
τ 6 a random vector with values in the interval [0, 1]
A L E the normalized average localization error of the positioning algorithm
V the total number of unknown nodes
( x u , y u ) the actual coordinates of unknown node  u

References

  1. Qian, M.; Qian, C.; Xu, G.; Tian, P.; Yu, W. Smart Irrigation Systems from Cyber–Physical Perspective: State of Art and Future Directions. Future Internet 2024, 16, 234. [Google Scholar] [CrossRef]
  2. Soussi, A.; Zero, E.; Sacile, R.; Trinchero, D.; Fossa, M. Smart Sensors and Smart Data for Precision Agriculture: A Review. Sensors 2024, 24, 2647. [Google Scholar] [CrossRef] [PubMed]
  3. Polymeni, S.; Skoutas, D.N.; Sarigiannidis, P.; Kormentzas, G.; Skianis, C. Smart Agriculture and Greenhouse Gas Emission Mitigation: A 6G-IoT Perspective. Electronics 2024, 13, 1480. [Google Scholar] [CrossRef]
  4. Balyan, S.; Jangir, H.; Tripathi, S.N.; Tripathi, A.; Jhang, T.; Pandey, P. Seeding a Sustainable Future: Navigating the Digital Horizon of Smart Agriculture. Sustainability 2024, 16, 475. [Google Scholar] [CrossRef]
  5. Yao, C.; Yang, Z.; Li, P.; Liang, Y.; Fan, Y.; Luo, J.; Jiang, C.; Mu, J. Two-Stage Detection Algorithm for Plum Leaf Disease and Severity Assessment Based on Deep Learning. Agronomy 2024, 14, 1589. [Google Scholar] [CrossRef]
  6. Wang, H.; Zhao, J.; Zhang, L.; Yu, S. Application of Disturbance Observer-Based Fast Terminal Sliding Mode Control for Asynchronous Motors in Remote Electrical Conductivity Control of Fertigation Systems. Agriculture 2024, 14, 168. [Google Scholar] [CrossRef]
  7. Wu, L.; Dawod, A.Y.; Miao, F. Data Transmission in Wireless Sensor Networks Based on Ant Colony Optimization Technique. Appl. Sci. 2024, 14, 5273. [Google Scholar] [CrossRef]
  8. Kandris, D.; Anastasiadis, E. Advanced Wireless Sensor Networks: Applications, Challenges and Research Trends. Electronics 2024, 13, 2268. [Google Scholar] [CrossRef]
  9. Luo, K.; Chen, Y.; Lin, R.; Liang, C.; Zhang, Q. A Portable Agriculture Environmental Sensor with a Photovoltaic Power Supply and Dynamic Active Sleep Scheme. Electronics 2024, 13, 2606. [Google Scholar] [CrossRef]
  10. Hassan, E.S. Energy-Efficient Resource Allocation Algorithm for CR-WSN-Based Smart Irrigation System under Realistic Scenarios. Agriculture 2023, 13, 1149. [Google Scholar] [CrossRef]
  11. Rahaman, M.; Lin, C.-Y.; Pappachan, P.; Gupta, B.B.; Hsu, C.-H. Privacy-Centric AI and IoT Solutions for Smart Rural Farm Monitoring and Control. Sensors 2024, 24, 4157. [Google Scholar] [CrossRef] [PubMed]
  12. Hassan, E.S.; Alharbi, A.A.; Oshaba, A.S.; El-Emary, A. Enhancing Smart Irrigation Efficiency: A New WSN-Based Localization Method for Water Conservation. Water 2024, 16, 672. [Google Scholar] [CrossRef]
  13. Hadir, A.; Kaabouch, N.; El Houssaini, M.-A.; El Kafi, J. Range-Free Localization Approaches Based on Intelligent Swarm Optimization for Internet of Things. Information 2023, 14, 592. [Google Scholar] [CrossRef]
  14. Esheh, J.; Affes, S. Effectiveness of Data Augmentation for Localization in WSNs Using Deep Learning for the Internet of Things. Sensors 2024, 24, 430. [Google Scholar] [CrossRef] [PubMed]
  15. Shen, X.; Xu, B.; Shen, H. Indoor Localization System Based on RSSI-APIT Algorithm. Sensors 2023, 23, 9620. [Google Scholar] [CrossRef] [PubMed]
  16. Zhao, Y.; Li, Z.; Hao, B.; Shi, J. Sensor Selection for TDOA-Based Localization in Wireless Sensor Networks with Non-Line-of-Sight Condition. IEEE Trans. Veh. Technol. 2019, 68, 9935–9950. [Google Scholar] [CrossRef]
  17. Lv, Y.; Liu, S.; Gao, Y.; Dai, J.; Ren, Z.; Liu, Y. An Ultra-Wideband Indoor Localization Algorithm with Improved Cubature Kalman Filtering Based on Sigmoid Function. Appl. Sci. 2024, 14, 2239. [Google Scholar] [CrossRef]
  18. Obeidat, H.; Shuaieb, W.; Obeidat, O.; Abd-Alhameed, R. A Review of Indoor Localization Techniques and Wireless Technologies. Wirel. Pers. Commun. 2021, 119, 289–327. [Google Scholar] [CrossRef]
  19. Sankaranarayanan, S.; Vijayakumar, R.; Swaminathan, S.; Almarri, B.; Lorenz, P.; Rodrigues, J.J.P.C. Node Localization Method in Wireless Sensor Networks Using Combined Crow Search and the Weighted Centroid Method. Sensors 2024, 24, 4791. [Google Scholar] [CrossRef]
  20. Yang, X.; Zhang, W.; Tan, C.; Liao, T. A Novel Localization Technology Based on DV-Hop for Future Internet of Things. Electronics 2023, 12, 3220. [Google Scholar] [CrossRef]
  21. Han, G.; Jiang, J.; Zhang, C.; Duong, T.Q.; Guizani, M.; Karagiannidis, G.K. A Survey on Mobile Anchor Node Assisted Localization in Wireless Sensor Networks. IEEE Commun. Surv. Tutor. 2016, 18, 2220–2243. [Google Scholar] [CrossRef]
  22. Jouhari, M.; Ibrahimi, K.; Tembine, H.; Ben-Othman, J. Underwater Wireless Sensor Networks: A Survey on Enabling Technologies, Localization Protocols, and Internet of Underwater Things. IEEE Access 2019, 7, 96879–96899. [Google Scholar] [CrossRef]
  23. Liu, X.; Han, F.; Ji, W.; Liu, Y.; Xie, Y. A Novel Range-Free Localization Scheme Based on Anchor Pairs Condition Decision in Wireless Sensor Networks. IEEE Trans. Commun. 2020, 68, 7882–7895. [Google Scholar] [CrossRef]
  24. Han, S.; Zhang, B.; Chai, S. A novel auxiliary hole localization algorithm based on multidimensional scaling for wireless sensor networks in complex terrain with holes. Ad Hoc Netw. 2021, 122, 102644. [Google Scholar] [CrossRef]
  25. Kaur, A.; Kumar, P.; Gupta, G.P. A weighted centroid localization algorithm for randomly deployed wireless sensor networks. J. King Saud Univ.-Comput. Inf. Sci. 2019, 31, 82–91. [Google Scholar] [CrossRef]
  26. Luomala, J.; Hakala, I. Adaptive range-based localization algorithm based on trilateration and reference node selection for outdoor wireless sensor networks. Comput. Netw. 2022, 210, 108865. [Google Scholar] [CrossRef]
  27. Abu Alsheikh, M.; Lin, S.; Niyato, D.; Tan, H.-P. Machine Learning in Wireless Sensor Networks: Algorithms, Strategies, and Applications. IEEE Commun. Surv. Tutor. 2014, 16, 1996–2018. [Google Scholar] [CrossRef]
  28. Jia, W.; Qi, G.; Liu, M.; Zhou, J. A high accuracy localization algorithm with DV-Hop and fruit fly optimization in anisotropic wireless networks. J. King Saud Univ.-Comput. Inf. Sci. 2022, 34, 8102–8111. [Google Scholar] [CrossRef]
  29. Wang, P.; Xue, F.; Li, H.; Cui, Z.; Xie, L.; Chen, J. A Multi-Objective DV-Hop Localization Algorithm Based on NSGA-II in Internet of Things. Mathematics 2019, 7, 184. [Google Scholar] [CrossRef]
  30. Sabbella, V.R.; Edla, D.R.; Lipare, A.; Parne, S.R. An Efficient Localization Approach in Wireless Sensor Networks Using Krill Herd Optimization Algorithm. IEEE Syst. J. 2021, 15, 2432–2442. [Google Scholar] [CrossRef]
  31. Phoemphon, S.; So-In, C.; Leelathakul, N. Improved distance estimation with node selection localization and particle swarm optimization for obstacle-aware wireless sensor networks. Expert Syst. Appl. 2021, 175, 114773. [Google Scholar] [CrossRef]
  32. Cui, Z.; Sun, B.; Wang, G.; Xue, Y.; Chen, J. A novel oriented cuckoo search algorithm to improve DV-Hop performance for cyber-physical systems. J. Parallel Distrib. Comput. 2017, 103, 42–52. [Google Scholar] [CrossRef]
  33. Cui, L.; Xu, C.; Li, G.; Ming, Z.; Feng, Y.; Lu, N. A high accurate localization algorithm with DV-Hop and differential evolution for wireless sensor network. Appl. Soft Comput. 2018, 68, 39–52. [Google Scholar] [CrossRef]
  34. Cheikhrouhou, O.; Bhatti, G.M.; Alroobaea, R. A Hybrid DV-Hop Algorithm Using RSSI for Localization in Large-Scale Wireless Sensor Networks. Sensors 2018, 18, 1469. [Google Scholar] [CrossRef]
  35. Ouyang, A.; Lu, Y.; Liu, Y.; Wu, M.; Peng, X. An improved adaptive genetic algorithm based on DV-Hop for locating nodes in wireless sensor networks. Neurocomputing 2021, 458, 500–510. [Google Scholar] [CrossRef]
  36. Zhang, W.; Yang, X. DV-Hop Location Algorithm Based on RSSI Correction. Electronics 2023, 12, 1141. [Google Scholar] [CrossRef]
  37. Sun, Z.; Wu, H.; Liu, Y.; Zhou, S.; Guan, X. A Hybrid Localization Algorithm for an Adaptive Strategy-Based Distance Vector-Hop and Improved Sparrow Search for Wireless Sensor Networks. Sensors 2023, 23, 8426. [Google Scholar] [CrossRef] [PubMed]
  38. Cai, X.; Wang, P.; Du, L.; Cui, Z.; Zhang, W.; Chen, J. Multi-Objective Three-Dimensional DV-Hop Localization Algorithm with NSGA-II. IEEE Sens. J. 2019, 19, 10003–10015. [Google Scholar] [CrossRef]
  39. Han, D.; Wang, J.; Tang, C.; Weng, T.-H.; Li, K.-C.; Dobre, C. A multi-objective distance vector-hop localization algorithm based on differential evolution quantum particle swarm optimization. Int. J. Commun. Syst. 2021, 34, e4924. [Google Scholar] [CrossRef]
  40. Abd El Ghafour, M.G.; Kamel, S.H.; Abouelseoud, Y. Improved DV-Hop based on Squirrel search algorithm for localization in wireless sensor networks. Wirel. Netw. 2021, 27, 2743–2759. [Google Scholar] [CrossRef]
Figure 1. The structure of the farm wireless sensor network system.
Figure 1. The structure of the farm wireless sensor network system.
Agriculture 14 01226 g001
Figure 2. HO-DV-Hop algorithm workflow.
Figure 2. HO-DV-Hop algorithm workflow.
Agriculture 14 01226 g002
Figure 3. Hop count grading illustration.
Figure 3. Hop count grading illustration.
Agriculture 14 01226 g003
Figure 4. Estimated distance error illustration.
Figure 4. Estimated distance error illustration.
Agriculture 14 01226 g004
Figure 5. Node distribution in different monitoring areas: (a) C-shaped; (b) H-shaped; (c) O-shaped; (d) W-shaped.
Figure 5. Node distribution in different monitoring areas: (a) C-shaped; (b) H-shaped; (c) O-shaped; (d) W-shaped.
Agriculture 14 01226 g005
Figure 6. Effect of different beacon node proportions: (a) C-shaped; (b) H-shaped; (c) O-shaped; (d) W-shaped.
Figure 6. Effect of different beacon node proportions: (a) C-shaped; (b) H-shaped; (c) O-shaped; (d) W-shaped.
Agriculture 14 01226 g006aAgriculture 14 01226 g006b
Figure 7. Effect of different communication radii: (a) C-shaped; (b) H-shaped; (c) O-shaped; (d) W-shaped.
Figure 7. Effect of different communication radii: (a) C-shaped; (b) H-shaped; (c) O-shaped; (d) W-shaped.
Agriculture 14 01226 g007
Table 1. Simulation parameter setting.
Table 1. Simulation parameter setting.
Simulation ParametersNumerical Value
interval size1000 m × 1000 m
total number of nodes240
ratio of beacon nodes20%
communication radius200 m
initial population size100
minimum population size80
number of iterations100
cyclic variable4
convergence rate0.2
trade-off ratio between third and fourth defense strategy0.8
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Wang, H.; Zhang, L.; Liu, B. Research and Design of a Hybrid DV-Hop Algorithm Based on the Chaotic Crested Porcupine Optimizer for Wireless Sensor Localization in Smart Farms. Agriculture 2024, 14, 1226. https://doi.org/10.3390/agriculture14081226

AMA Style

Wang H, Zhang L, Liu B. Research and Design of a Hybrid DV-Hop Algorithm Based on the Chaotic Crested Porcupine Optimizer for Wireless Sensor Localization in Smart Farms. Agriculture. 2024; 14(8):1226. https://doi.org/10.3390/agriculture14081226

Chicago/Turabian Style

Wang, Hao, Lixin Zhang, and Bao Liu. 2024. "Research and Design of a Hybrid DV-Hop Algorithm Based on the Chaotic Crested Porcupine Optimizer for Wireless Sensor Localization in Smart Farms" Agriculture 14, no. 8: 1226. https://doi.org/10.3390/agriculture14081226

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop