1 Introduction

The rapid development of Internet-of-Things (IoT) techniques in 4G/5G deployments is witnessing the generation of massive amounts of data that are collected, stored, processed, and presented in an easily interpretable form. Analysis of IoT data helps provide smart services such as smart homes, smart energy, smart health, and smart environments through 4G and 5G technologies. At the same time, the threat of the cyberattacks and issues with mobile internet security are becoming increasingly severe, which introduces new challenges for the security of IoT systems and applications and the privacy of individuals. In [1,2,3,4,5], the authors study the covert channels to ensure the security and privacy of data in mobile communication. Xue et al. put forward a new data-hiding scheme (which can select the file format and size according to the optimization), so as to complete the data-hiding work conveniently and purposefully [6]. In [7, 8], the authors discuss data security and privacy in smart grid systems. As an important part of the IoT, wireless sensor networks (WSNs) mainly complete the data collection task of the IoT. Therefore, the data security and privacy of WSNs are very important to the data security and privacy of the IoT. WSNs are a self-organizing network that consists of a large amount of micro-sensor nodes deployed in the monitored area. The sensor nodes are distributed in the space and work cooperatively. The information collected in the monitored area is transmitted through the wireless link, then sent to the receiver, used locally, or transmitted to other networks [9]. The development of WSNs was initially driven by the development of military applications [10], for example battlefield surveillance to detect, locate, or track moving enemy targets. Most IoT sensor networks use wireless communication technology. Due to its broadcast nature, wireless transmission may be overheard by eavesdroppers in the network, which brings the risk of information leakage. Wireless communication channel security is discussed in [11,12,13]. Device-to-device (D2D) communication is a key enabler to facilitate the realization of the IoT. IoT that enables ubiquitous information acquisition and exchange among devices without external human intervention is a key enabler to facilitate the evolution of cellular networks from long-term evolution-advanced (LTE-A) systems to future 5G [14,15,16]. WSNs have some obvious negative characteristics, such as limited communication range, energy constraints, and vulnerability. A group key agreement in this environment requires lightweight cross-cluster, computation, and communication overhead, and a highly safe group key agreement protocol, which is discussed in [17, 18]. Node deployment tasks are a key issue, which determine the quality of the whole unlimited sensor network in the field of WSNs. The development of sensor sensors from a stationary to a mobile node provides a new research direction and solution for the deployment of WSNs.

Autonomous sensor nodes are prevalent recent research, including two-dimensional coverage in mobile WSNs (MWSNs). For example, many researchers used autonomous sensor nodes to reinforce coverage and discussed the node deployment technique in motion assist sensor. Ting-Yu Lin et al. and T.W. Sung et al. developed self-deployment algorithms using the Voronoi diagram in the two-dimensional space [19,20,21].

Many results suggested three-dimensional deployment of MWSNs. M. K. Watfa and A. Nauman debated how to minimize the number of sensor nodes in the target region while ensuring the coverage ratio [22,23,24]. A. Nauman proposed the scheduling solution for sensor node activities to minimize the number of sensor nodes [24]. Initially, the sensor nodes are stochastically deployed in the target region, then the sensor nodes are switched in the target position into an active state while other nodes switch to a dormancy state in order to reduce energy consumption. In [25], the authors using k-coverage in the three-dimensional surface proposed a self-deployment algorithm (APLLO) based on the partition principle of the Voronoi diagram. The algorithm first partitioned the three-dimensional surface, then calculated the Chebyshev centers in each Voronoi diagram, moving the nodes to the center of the diagram. The algorithm iterated until the position of the nodes did not change to complete the deployment. Brown et al. [26] used a greedy heuristic algorithm and enhanced depth-first algorithm to discuss the three-dimensional, full-space coverage problem with good experimental results. In [27,28,29], Temel, Akbarzadeh, and Topcuoglu used a heuristic algorithm to solve the maximum three-dimensional terrain surface-coverage problem. X. Li et al. and N. Boufares et al. used the virtual force strategy for self-deployment in three-dimensional WSNs. Each sensor nodes could move in the three-dimensional space based on the virtual force [30, 31]. N. Boufares et al. used the virtual force strategy for self-deployment in the three-dimensional plane, and deployed nodes in the three-dimensional plan through the autonomous movement of the nodes [32]. H. Yang [33] first proposed to use the discrete wavelet transform (DWT) to detect the coverage hole that exists in three-dimensional planes in WSNs, and improved the artificial bee colony algorithm to complete the node deployment on the three-dimensional plane.

In the aforementioned studies, most of the investigation was based on a stochastic or deterministic strategy for the three-dimensional WSN. Some researchers proposed to use the virtual force strategy to deploy three-dimensional WSNs. However, the virtual force can produce the local optimal solution, which causes the area coverage problem and coverage hole problem. The Voronoi diagram has characteristics like proximity, contiguity, maximal disk, and fast partitioning. It is widely used in the deployment of two-dimensional sensor networks and three-dimensional static WSNs. The aim of this study is to present a self-deployment of three-dimensional mobile sensor networks based on the Voronoi diagram, to let the sensor nodes autonomous move to the target position through the iterations.

2 Contributions

In this paper, our main contributions are as follows:

  1. 1.

    The communication between nodes adopts 4G/5G technology, which can effectively solve the problem of data security and privacy in the process of network data transmission.

  2. 2.

    The three-dimensional Voronoi diagram is used to control node deployment in WSNs. This method can quickly achieve high coverage of WSNs and reduce energy consumption.

  3. 3.

    Virtual force factors are considered on the basis of the three-dimensional Voronoi diagram method, which effectively solves the problems of long convergence time and low coverage of WSNs caused by the concentrated placement of initial state nodes.

The rest of this paper is organized as follows. In the next section, the environmental assumptions in this paper are presented. In Section 4, we describe the algorithms 3DV-ADA and 3DV-ADA-I in detail. Section 5 shows the simulation results and analyzes the performance of the algorithms. It also presents results of two algorithms for the coverage ratio, movement of the deployment process, and deployment time. Section 6 summarizes the research.

3 Environmental assumptions

The objective of this study is to discuss the node deployment problem in a three-dimensional bounded region, which can be abstracted as a deployment problem in a cube region. The “bound” does not mean physical boundaries. It defines target region and non-target region for the environment. In the target region, only node deployment is considered. In order to ensure the coverage ratio and network connectivity of the three-dimensional target monitored region, this study holds the hypothesis below.

Assumptions 1

The detection region of WSNs is ideal; any factors that may affect the node deployment are eliminated.

Assumptions 2

Every sensor node in the WSNs can obtain its location through the global positioning system (GPS).

Assumptions 3

The sensor model uses the binary perception model, which means if the detected target is within the sensing range of the sensor node, then the probability of detecting the target is 1. Otherwise, the probability is 0.

Assumptions 4

This paper adopts the Cartesian coordinate system; the nodes use the spherical framework. Using the position of the nodes as the center of a sphere, sense radius Rs and communication radius Rc are two radii of the sphere that form a communication sphere of the sense sphere. This paper supposes Rc > 2Rs according to [10, 11]. If the communication radius Rc is at least twice the sense radius Rs, then the full coverage of the convex region ensures the connectivity of the whole network. Using 4G/5G technology as communication technology between nodes ensures the connectivity of the network and the security of data transmission to a certain extent. Therefore, the study focuses on the coverage ratio.

Assumptions 5

All sensor nodes in the detection region are made by equipment with the same specifications; they have the same sense, range, and communication range. All sensor nodes are assumed to work fine; problems like deployment failure causing by hardware/software failures and deployment errors are not considered in the hypothesis.

Assumptions 6

The sense and communication models of the nodes are sphere, set node is the center of a sphere, and Rc is the radius of the sphere. Nodes can sense the surrounding environment. The set node is the center of a sphere, Rs is the radius of the sphere, and nodes can perform the intercommunication. Figure 1 is the node model.

Fig. 1
figure 1

Node model

4 Three-dimensional self-deployment algorithm

The article proposes a self-deployment algorithm based on the Voronoi diagram and also an effective improvement method based on the centralized placement of nodes, so that the algorithm can adapt to different node placements. These two algorithms are discussed in detail in the following sections.

4.1 Voronoi partitioning algorithm

The Voronoi diagram is a basic data structure for spatial partitioning, which uses Euclidean distance as a measurement to divide a two-dimensional plane region or three-dimensional space region. The Voronoi diagram of a set of three-dimensional nodes is a spatial partition for these nodes. Each partitioned node corresponds to a polyhedron of a Voronoi region, which is the nearest region to this node. There is no overlapping and seamless space in each region, where the set of nodes spread and define the three-dimensional space. As shown from Fig. 2, the red fine line is the Voronoi diagram. Delaunay triangulation is the most commonly used construction method for the Voronoi diagram, which is the blue bold line in Fig. 2.

Fig. 2
figure 2

Three-dimensional Voronoi diagram

4.2 Data security and privacy

In wireless sensor networks, data security and privacy are divided into two parts that is channel security and device security. As 4G/5G communication technology is applied, channel security was guaranteed by 4G/5G. In this paper, device data security and privacy were concerned. Device authorization and data encryption were considered in device data security and privacy.

Device authorization prevents unauthorized access to the device by setting access rights to the device. It improves the security and privacy of data in the device. The steps for device authorization are as follows:

  1. 1.

    After the device accessed the network, it will send a device activation request to the control center. Meanwhile, it will send device information to the control center, including the manufacturer code and chip code.

  2. 2.

    After the control center received the activation request, the control center generated a unique identification code of the device according to the received device information. Then it randomly generated a password.

  3. 3.

    The control center saved the unique identification code of the device to the authorization list, and then sent a unique identification code and password to the device.

  4. 4.

    The control center sent an updated list of device authorizations to all devices.

  5. 5.

    The device accepted and saved the device’s unique identification code, password, and an updated device authorization list.

  6. 6.

    After a period of time, the control center modified the passwords of all devices and updates the device authorization list.

On the one hand, when the device requested to connect with other devices or control centers, it needed to provide its own unique identification code and password. On the other hand, the control center needed to provide its own unique identification code and password when requested connection with the device. All passwords ware encrypted using asymmetric encryption to improve security.

Data encryption is an effective way to protect data security and privacy. Commonly, encryption methods were divided into symmetric encryption methods and asymmetric encryption methods. The symmetric encryption method was low in cost, but the security level was not high, the asymmetric encryption method had a high security level, but the cost was also very high. Wireless sensor network is a resource-constrained network. Asymmetric encryption method is not suitable for wireless sensor networks. In order to reduce the cost of data encryption and improve the security and privacy of data, a hybrid encryption method was applied. Hybrid encryption method adopted a strategy-combined symmetric encryption method and asymmetric encryption method. The encryption and decryption of data were done by a symmetric encryption method. The key of the symmetric encryption was encrypted and decrypted by asymmetric encryption. The process of hybrid encryption is shown in Fig. 3. The data was encrypted by the key A of the symmetric encryption. The key A of the symmetric encryption was encrypted by the key B of the asymmetric encryption. The sender sent the encrypted data and key A to the recipient. The receiver decrypted the ciphertext of the key A by using the key C, and then obtained the key A. The key A was used to decrypt the ciphertext of the data, and finally obtained the data sent by the sender.

Fig. 3
figure 3

Hybrid encryption method

4.3 Self-deployment algorithm based on three-dimensional Voronoi diagram: 3DV-ADA

3DV-ADA constructs the three-dimensional Voronoi diagram in the three-dimensional space, where each node corresponds to a polyhedron. The node in Fig. 2 corresponds to a polyhedron consisting of a set of nodes. The centroid of the polyhedron was taken as the target position of the node’s movement. The node was moved to target position that was the centroid of the polyhedron. The location of nodes was constantly updated, and eventually the node was placed in the best position in three-dimensional space. The node corresponded to the centroid of the polyhedron, the set of vertices of polyhedron. As it is complex to calculate the centroid of the polyhedron, (1) is used instead:

$$ \left({x}_{C{\hbox{'}}_i},{y}_{C{\hbox{'}}_i},{z}_{C{\hbox{'}}_i}\right)=\left(\frac{\sum \limits_{j=1}^n{x}_{v_j}}{n},\frac{\sum \limits_{j=1}^n{y}_{v_j}}{n},\frac{\sum \limits_{j=1}^n{z}_{v_j}}{n}\right) $$
(1)

where \( \left({x}_{C{\hbox{'}}_i},{y}_{C{\hbox{'}}_i},{z}_{C{\hbox{'}}_i}\right) \) is the set of coordinates of C'i, and \( \left({x}_{v_j},{y}_{v_j},{z}_{v_j}\right) \) is the set of coordinates of the vertex of the polygon. The displacement vector of the node \( {\overrightarrow{M}}_{V_i} \) is calculated using (2):

$$ {\overrightarrow{M}}_{v_i}={C_i}^{\hbox{'}}-{C}_i $$
(2)

The detailed descriptions of 3DV-ADA algorithm are as follows:

  1. 1.

    Initialization. Set the sensor nodes to the perceived radius, sizes and boundaries of the monitoring area, number of nodes, loop variant, and required probability.

  2. 2.

    Stochastically deploy all nodes in the targeted three-dimensional monitoring area, and check whether the coverage ratio satisfied the required condition. If the answer is yes, then complete step (6); otherwise, complete step (3).

  3. 3.

    Use the algorithm in the Voronoi diagram to construct a three-dimensional Voronoi diagram, and obtain the set of vertices of the polyhedron for each node.

  4. 4.

    Compute the centroid of the polygon for each node, moving the node to correspond to the centroid of the polyhedron according to the displacement vector.

  5. 5.

    Compute the coverage ratio, and check whether the coverage ratio satisfies the required condition. If the answer is yes, then complete step (6); otherwise, complete step (3).

  6. 6.

    Obtain the output and finish the deployment.

    figure a

4.4 Improved algorithm for solving the centralized placement of nodes: 3DV-ADA-I

3DV-ADA cannot fulfill the deployment task well when facing the centralized placement situation of the nodes. For the initial placement of nodes, the 3DV-ADA algorithm will have a long convergence time, low network coverage, and high energy consumption. In order to solve the problems, an improvement algorithm (3DV-ADA-I) was proposed based on 3DV-ADA. 3DV-ADA-I was developed by adding virtual repulsion between the nodes as well as between the nodes and boundaries. According to the distance between the center of the node and boundary of the monitoring area, the virtual repulsion generated by the boundary of the monitoring area to the node makes the node not too close to the boundary. All virtual repulsion between the nodes makes the nodes move away from each other. The distances between the nodes determine whether the virtual repulsion exists between the nodes. The boundary of the monitoring area generates virtual repulsion or not depending on the distance from the current node. The neighbor node of Ci was defined as Cn = {Cj| D(Ci, Cj) < Dth}. D(Ci, Cj) was the Euclidean distance between node Ci and node Cj. D(Ci, Cj) was calculated by formula (3). The Dth was the range of repulsion between nodes and it was set 2RS in this paper.

$$ D\left({C}_i,{C}_j\right)=\sqrt{{\left({x}_{C_j}-{x}_{C_i}\right)}^2+{\left({y}_{C_j}-{y}_{C_i}\right)}^2+{\left({z}_{C_j}-{z}_{C_i}\right)}^2} $$
(3)

The calculation formula of the virtual repulsion generated by the neighbor node of Ci to the node Ci is:

$$ {\overrightarrow{F}}_{r_{\left(i,j\right)}}=\Big\{{\displaystyle \begin{array}{c}\left(\frac{k_r}{{D_{\left({C}_i,{C}_j\right)}}^{\lambda_r}},-{\overrightarrow{\alpha}}_{\left(i,j\right)}\right),\kern0.5em 0<D\left({C}_i,{C}_j\right)<{D}_{th}\\ {}\kern1.00em \overrightarrow{\infty}\begin{array}{cc}& \begin{array}{ccc}& &, \end{array}\begin{array}{cc}& D\left({C}_n,{C}_m\right)=0\end{array}\end{array}\\ {}\begin{array}{ccc}& & \end{array}\overrightarrow{0}\begin{array}{cc}& \begin{array}{ccc}\begin{array}{cc}\begin{array}{cc}& \end{array}& \end{array}& &, \end{array}\begin{array}{cc}& other\end{array}\end{array}\end{array}} $$
(4)

where kr and λr are coefficients of repulsion, \( {\overrightarrow{\alpha}}_{\left(i,j\right)} \) is unit vector (which shows the direction of the node Ci to its neighbor node Cj ∈ Cn), and Dth is a critical point of the virtual repulsion. The resultant force of virtual repulsion of node Ci can be computed using the following:

$$ {\overrightarrow{F}}_{r_i}=\sum \limits_{C_j\in {C}_n}{\overrightarrow{F}}_{r_{\left(i,j\right)}} $$
(5)

where \( {\overrightarrow{F}}_{r_i} \) is the resultant force of the virtual repulsion of node Ci, node Cj is a neighbor node of Ci, \( {\overrightarrow{F}}_{r_{\left(i,j\right)}} \) is the resultant force of virtual repulsion of node Ci generated by Cj, and Cn is a collection of neighbor nodes for node Ci.

The node Ci is not only subjected to virtual repulsion by the neighbor nodes, but also virtual repulsion from the boundary of the monitoring area. The virtual repulsion of the boundary to the node guarantees that the node will not be deployed outside the monitoring area. The virtual repulsion of each boundary is calculated as (6)–(8).

$$ {F}_{i_X}=\Big\{{\displaystyle \begin{array}{c}\left(\frac{k_r}{{\left({x}_{C_i}-{L}_x\right)}^{\lambda_r}},-{\overrightarrow{\alpha}}_{\left(i,{L}_x\right)}\right),\kern1.00em 0\le {x}_{C_i}-{L}_x<{d}_{th}\\ {}\begin{array}{ccc}\left(\frac{k_r}{{\left({H}_x-{x}_{C_i}\right)}^{\lambda_r}},-{\overrightarrow{\alpha}}_{\left(i,{H}_x\right)}\right),& & 0\le {H}_x-{x}_{C_i}<{d}_{th}\end{array}\\ {}\begin{array}{ccc}& \overrightarrow{0},& \begin{array}{ccc}\begin{array}{ccc}\begin{array}{ccc}& & \end{array}& & \end{array}& & other\end{array}\end{array}\end{array}} $$
(6)
$$ {F}_{i_Y}=\Big\{{\displaystyle \begin{array}{c}\left(\frac{k_r}{{\left({y}_{C_i}-{L}_y\right)}^{\lambda_r}},-{\overrightarrow{\alpha}}_{\left(i,{L}_y\right)}\right),\kern1.00em 0\le {y}_{C_i}-{L}_y<{d}_{th}\\ {}\begin{array}{ccc}\left(\frac{k_r}{{\left({H}_y-{y}_{C_i}\right)}^{\lambda_r}},-{\overrightarrow{\alpha}}_{\left(i,{H}_y\right)}\right),& & 0\le {H}_y-{y}_{C_i}<{d}_{th}\end{array}\\ {}\begin{array}{ccc}& \overrightarrow{0},& \begin{array}{ccc}\begin{array}{ccc}\begin{array}{ccc}& & \end{array}& & \end{array}& & other\end{array}\end{array}\end{array}} $$
(7)
$$ {F}_{i_Z}=\Big\{{\displaystyle \begin{array}{c}\left(\frac{k_r}{{\left({z}_{C_i}-{L}_z\right)}^{\lambda_r}},-{\overrightarrow{\alpha}}_{\left(i,{L}_z\right)}\right),\kern1.00em 0\le {z}_{C_i}-{L}_z<{d}_{th}\\ {}\begin{array}{ccc}\left(\frac{k_r}{{\left({H}_z-{z}_{C_i}\right)}^{\lambda_r}},-{\overrightarrow{\alpha}}_{\left(i,{H}_z\right)}\right),& & 0\le {H}_z-{z}_{C_i}<{d}_{th}\end{array}\\ {}\begin{array}{ccc}& \overrightarrow{0},& \begin{array}{ccc}\begin{array}{ccc}\begin{array}{ccc}& & \end{array}& & \end{array}& & other\end{array}\end{array}\end{array}} $$
(8)

In (6)–(8), Lx and Hx are the boundary planes in the x-axis direction, Ly and Hy are the boundary planes in the y-axis direction, Lz and Hz are the boundary planes in the z-axis direction, and dth is the critical distance of the virtual repulsion generated by the boundary plane. The value of Dth was set to Rs. The \( \overrightarrow{\alpha} \) was the unit vector, which shows the direction of the node Ci to the boundary plane. Equation (9) was used to compute the resultant force of virtual repulsion \( {\overrightarrow{F}}_{i_{XYZ}} \) of the node Ci from all boundaries:

$$ {\overrightarrow{F}}_{i_{XYZ}}={\overrightarrow{F}}_{i_X}+{\overrightarrow{F}}_{i_Y}+{\overrightarrow{F}}_{i_Z} $$
(9)

The resultant force of all repulsions of the node Ci is computed by the total force of the resultant force of the neighbor nodes and the resultant force of the boundaries. The calculation formula is (10), and the calculation of the displacement vector driven by the virtual force is (11).

$$ {\overrightarrow{F}}_i={\overrightarrow{F}}_{r_i}+{\overrightarrow{F}}_{i_{XYZ}} $$
(10)
$$ {\overrightarrow{M}}_{F_i}=\lambda {\overrightarrow{F}}_i $$
(11)

λ Equation (11) is the coefficient of movement. According to \( {\overrightarrow{M}}_{v_i} \) in (2) and \( {\overrightarrow{M}}_{F_i} \) in the (11), the displacement vector of the node Ci was calculated, using (12):

$$ \overrightarrow{M_i}={\overrightarrow{M}}_{F_i}+{\overrightarrow{M}}_{V_i} $$
(12)

The detailed description of 3DV-ADA-I algorithm is shown below:

  1. 1.

    Initialization. Set the sensor nodes perceived radius, sizes, and boundaries of the monitoring area, number of nodes, loop variant, and the required probability.

  2. 2.

    Deploy all nodes in a sub-region of the three-dimensional monitoring area, and check whether the coverage ratio satisfied the required condition. If the answer is yes, then complete step (10); otherwise, complete step (3).

  3. 3.

    Use the construct algorithm in the Voronoi diagram to construct a three-dimensional Voronoi diagram, and obtain the set of vertices of polyhedron for each node.

  4. 4.

    Compute the centroid of the polyhedron for each node, and compute the displacement vector \( {\overrightarrow{M}}_{V_i} \) of each node driven by the Voronoi diagram.

  5. 5.

    Compute the resultant force of virtual repulsion from the neighbor nodes of each node.

  6. 6.

    Compute the resultant force of virtual repulsion from the boundary plane of each node.

  7. 7.

    Compute the resultant force of virtual repulsion of each node and compute the displacement vector \( {\overrightarrow{M}}_{F_i} \) of each node driven by the virtual force.

  8. 8.

    Compute the joint vector of each node’s displacement vector, moving the node to the target position according to the displacement vector.

  9. 9.

    Compute the coverage ratio, and check whether the coverage ratio satisfied the required condition. If the answer is yes, then complete step (10); otherwise, complete step (3).

  10. 10.

    Obtain the output and finish the deployment.

    figure b

5 Simulation results and analysis

5.1 Simulation

The simulation uses Python 2.7 as the simulation experiment platform. The monitoring area was set to a three-dimensional space of size 50 m × 50 m × 50 m. The sensor nodes perceive the radius, the number of nodes deployed in the monitoring area was set to 350. The initial nodes of the 3DV-ADA algorithm were randomly distributed throughout the monitoring area. The initial nodes of the 3DV-ADA-I algorithm were randomly distributed in an area if 10 m × 10 m × 10 m. This means that the value of x, y, and z is all in the range of 20–30. The initial deployments of the 3DV-ADA algorithm and 3DV-ADA-I algorithm are shown in Figs. 4 and 7. The simulation results after five iterations are shown in Fig. 5 (3DV-ADA) and Fig. 8 (3DV-ADA-I). Figure 6 is the simulation result of the final deployment of 3DV-ADA and Fig. 9 is the simulation result of the final deployment of 3DV-ADA-I.

Fig. 4
figure 4

The initial deployment of 3DV-ADA

Fig. 5
figure 5

The simulation results after five iterations for 3DV-ADA

Fig. 6
figure 6

The simulation result of final deployment for 3DV-ADA

Fig. 7
figure 7

The initial deployment of 3DV-ADA-I

Fig. 8
figure 8

The simulation results after five iterations for 3DV-ADA-I

Fig. 9
figure 9

The simulation result of final deployment for 3DV-ADA-I

Fig. 10
figure 10

The relationship between the number of sensor nodes and coverage ratio

Fig. 11
figure 11

The relationship between the number of sensor nodes and coverage ratio

Fig. 12
figure 12

The relationship between the number of iterations and mean moving distance

5.2 Result analysis

Li et al. [26] and Boufares et al. [27] noted the use of the virtual force algorithm to perform the self-deployment of the sensor nodes on the three-dimensional monitoring area. The sensor node moved autonomously to its best position through interaction force (gravity and repulsion) between the nodes to achieve a better coverage ratio. Compared to the 3D-DVFA algorithm of Li et al., [26] set the main indicators for the 3DV-ADA algorithm and 3DV-ADA-I algorithm as follows:

  1. 1.

    Coverage ratio: One of the important indicators to evaluate the performance of sensor networks, which reflected the comprehensive monitoring capability of the sensor network.

  2. 2.

    Convergence speed: The time required to achieve a relatively stable state during the whole deployment process. The smaller the time, the faster the convergence speed and the better the performance.

  3. 3.

    Mean moving distance: The mean moving distance can directly affect the life of the whole network. If the lower mean distance moved during the deployment process of a WSN, then the energy consumption would be reduced, thereby prolonging the network life cycle.

Table 1 compares the time cost and moving distance after 100 iterations between the 3D-DVFA algorithm and 3DV-ADA algorithm. Table 2 compares the same between 3DV-DVFA algorithm and 3DV-ADA-I algorithm. It is shown from Table 2 that both the time cost and moving distance of the 3DV-ADA algorithm are far below the 3D-DVFA algorithm. Table 2 shows that the time costs of the two algorithms are almost the same. However, the moving distance of the 3DV-ADA-I algorithm was far below that of the 3D-DVFA algorithm.

Table 1 Random deployment of sensor nodes
Table 2 Centralized deployment of the sensor nodes

The number of sensor nodes is an important factor affecting the coverage ratio in the monitoring area. This study discussed the maximum coverage ratio of three algorithms using different numbers of sensor nodes. If the same number of sensor nodes was used and one algorithm achieves the highest coverage ratio, then the performance of this algorithm is better than the others. The number of sensor nodes used in the simulation increased 10 nodes at a time, from 250 to 400. The relationship between the number of sensor nodes and coverage ratio is shown in Fig. 10. Figure 10(a) and (b) respectively shows the coverage ratio with same number of sensor nodes for the 3D-DVFA algorithm and 3DV-ADA algorithm, as well as the coverage ratio with same number of sensor nodes for the 3D-DVFA algorithm and 3DV-ADA-I algorithm. Figure 10 shows the increasing number of sensor nodes, where the coverage ratio is also increasing. However, the advantages of the 3DV-ADA algorithm and 3DV-ADA-I algorithm are relatively diminished over 3D-DVFA with the increasing number of sensor nodes. This is due to the gradual weakening of the network node deployment as the number of nodes gradually approaches saturation, making the advantages of the 3DV-ADA algorithm and 3DV-ADA-I algorithm no longer obvious.

The convergence speed of the algorithm determines the efficiency of node deployment: the smaller the time cost, the better the performance and less energy consumption of the sensor networks. To study the convergence rate of the algorithm, 350 nodes were deployed in the target monitoring. The relationship between the number of iterations and the coverage of the algorithm and the execution time cost of the algorithm were simulated. The results are shown in Fig. 11.

Figure 11 shows that, from the aspect of the coverage iteration numbers, the 3D-DVFA algorithm is better than the 3DV-ADA algorithm and 3DV-ADA-I algorithm. However, from the aspect of the coverage ratio, the 3DV-ADA algorithm and 3DV-ADA-I algorithm are better than the 3D-DVFA algorithm. After 20 iterations, the coverage ratios of the 3DV-ADA algorithm and 3DV-ADA-I algorithm are stable, with the value over than 95%. The coverage ratio of the 3D-DVFA algorithm is fluctuating: the coverage ratio in the random deployment is approximately 89% and the coverage ratio in the centralized deployment is approximately 84%. The test results show that the fluctuation range of the coverage ratio of the 3D-DVFA algorithm is approximately 2%.

Low energy consumption is vital for WSNs. The mean moves the distance and, to some extent, can reflect the energy-saving effect of the algorithm. Figure 12 shows the mean moving distance of each node at each iteration during 100 times of dropping from 350 nodes. Figure 12(a) shows the random deployment of sensor nodes, and Fig. 12(b) shows centralized deployment of sensor nodes.

Figure 12 shows that, whether it is a random or centralized deployment, the mean moving distance in each iteration is always approximately 5 m in the 3D-DVFA algorithm. It was because the threshold of the moving distance was set to 5 m in the 3D-DVFA algorithm. It meant that, after the coverage of the 3D-DVFA algorithm reaches a stable value, the entire network is still in an unstable state. However, the mean moving distance in each iteration is almost zero after the coverage ratio reaches a stable value in the 3DV-ADA algorithm and 3DV-ADA-I algorithm, which greatly saves the energy consumption of the whole network and prolongs the network life cycle.

The algorithm guaranteed the security and privacy of data in the network through device authorization and data encryption. Device authorization and data encryption will occupy a part of the resources of the node, such as computing resources, storage resources, and energy, but for the performance improvement of the WSN, these costs were worthwhile.

6 Conclusion

This paper guarantees the security and privacy of data from the data source of the IoT, that is, data security and privacy preservation of the network of the IoT sensor networks. We designed an IoT sensor–network security deployment algorithm based on the Voronoi diagram. In order to adapt to different deployment conditions, the algorithm was optimized and improved. The maximum coverage of the algorithm, the influence of the number of nodes on the coverage of sensor network, the energy consumption of the sensor network, and the problem of data security and privacy are discussed. The simulation experiments are completed, which show that the algorithm can greatly improve the coverage of the IoT sensor network and also have good performance in terms of energy saving. At the same time, it can protect the security and privacy of the data to a certain extent. The focus of the next research is to optimize the algorithm in this paper, so that the algorithm can adapt to heterogeneous IoT sensor networks. However, our method also has some shortcomings. For example, the algorithm is centralized and needs to know the global information. The algorithm also does not consider the impact of obstacles in the monitoring area of the algorithm. This will be the direction for future work.