Abstract
Keywords
Introduction
Wireless sensor networks (WSNs) play important roles in healthcare, geological detection, military defense, and other fields.1–3 Yet, the practical use of WSNs can present serious concerns regarding privacy disclosure. Attackers may obtain sensitive information by hacking, forging, or otherwise attacking unauthorized sensor nodes. In the medical field, patients’ private information can be swiftly disclosed if their medical data are hacked. 1 In military applications, grave consequences can follow from adversarial access to important data such as event locations. Therefore, the question of how to guarantee the privacy and integrity of data in WSNs has become a major research focus.
Traditional WSNs consist of many sensor nodes deployed in a specific area. Given budgetary constraints related to calculation, storage, and energy recourse, sensor nodes can only communicate with neighboring nodes via a rather simple multihop communication structure. Sensor nodes cooperate with each other to complete a query request based on the query protocol. In a traditional two-tiered WSN, storage nodes (SNs) comprise the middle tier of the Internet. SNs are obligated to collect and save data gathered by perception nodes; the upper network, made of sensor nodes, collaborates on query instructions from the sink. These two schemes differ substantially. In a traditional WSN, sensor nodes are responsible for data collection and storage within a given time period. The nodes also correspond to and perform query instructions from the sink in a two-tiered WSN. However, the sensor nodes are only obligated to collect data to be sent to the SN to store. The SN is in charge of query requests rather than the sensor nodes. Therefore, the network lifespan of the two-tiered WSN is longer than that of a traditional WSN, and the two-tiered WSN is steadier under identical conditions.
In a two-tiered WSN, the lower network tier consists of sensor nodes with limited computational ability, and the upper tier consists of few SNs with sufficient resources. The advantages of bringing the SN into the sensor network are as follows: (1) prolonged Internet lifespan (sensor nodes can transmit data to the nearest SN by one or multiple hops instead of sending data to a distant sink, thereby decreasing the hops needed to transmit data packets while also reducing Internet communication consumption); (2) increased query efficiency, such that the SN can better perform complicated query operations and effectively reduce the response delay; and (3) improved flexibility (the SN can simplify the management operation of Internet topology when nodes increase or decrease). Although SN makes the data storage and query process more convenient in WSNs, it also increases the risk of privacy disclosure. The two-tiered WSN adopts wireless communication that allows attackers to more easily attack communication links and capture nodes, as deployed sensor nodes are not monitored. Because the SN stores a large amount of perception data from sensor nodes, which is crucial for managing data queries, the SN is a key target of attack. An attacked SN poses a severe threat to Internet data security.
The two-tiered WSN is a distributed sensor network with many query modes including range query, top-k query, maximum or minimum value query, and space-time query.4–7 The current research focuses on the range query, which can serve as a guide for other queries. This article specifically examines a multidimensional data range query based on WSNs and proposes a query method (WQuery) to verify privacy protection and the multidimensional data range query method. The main contributions of this article are as follows:
It proposes a new scheme for secure data storage and query processing of range query data using bucket label retrieval.
It proposes a highly efficient tree-to-destination (T2D) data structure to verify the integrity of results.
Compared with current schemes, the proposed method does not require data to be saved, thus enhancing data privacy.
The proposed scheme offers advantages related to energy consumption and storage overhead.
Theoretical analysis and simulation experiments analyze and verify the security and effectiveness of the scheme.
The remainder of this article is organized as follows. Section “Relevant background” outlines relevant research. Research models and secure targets are presented in section “Model.” Section “Data privacy protocol” explains the encryption process for multidimensional data. Section “System analysis” presents privacy and integrity analysis. Section “Experimental analysis” carries out the simulation analysis. Finally, conclusions are offered in section “Conclusion.”
Relevant background
In WSN research, the privacy and integrity protection of multidimensional range queries is a common focus,8–10 especially pertaining to data privacy and integrity in the two-tiered WSN model. The current secure query scheme mainly solves security problems introduced by SN capture. These problems can be classified into two types: privacy attack and integrity attack. In privacy attacks, attackers obtain clear data through captured nodes while still following the network protocol. In integrity attacks, attackers pretend to be legal nodes and release false data by inserting, modifying, or deleting data to destroy the query integrity, leading to incomplete or false query results.
Sheng and Li 11 and others have applied a bucket-partitioning scheme for data privacy protection in a security range query for WSNs and proposed an encoding number scheme to verify the integrity of results. Shi et al. 12 further optimized a bucket-partitioning scheme to solve the problem of communication waste resulting from edge mistakes and then proposed a spatiotemporal crosscheck verification method, but it is not suitable for multidimensional data. Zhang et al. 13 further developed the approach introduced in Shi et al. 12 and proposed a secure scheme that leveraged a bitmap scheme to realize spatiotemporal crosscheck verification. The scheme was then applied to multidimensional data range queries to reduce the cost of data communication in networks and save energy. The above works mainly focus on the privacy protection scope query, but ignores the destruction of the collusion attack, the probabilistic attack, and the differential attack. Zeng et al. 14 proposed the energy-saving and multidimensional range query protocol PERQ. Considering these kinds of attacks, the generalized distance and modular operation range query mechanism is used to improve the security, but also increases the energy consumption. 15 Reference bucket-partitioning and symmetric encryption technology, using hash-based message authentication coding (HMAC) method, to construct code information for checking the integrity verification of query results, and fusion processing of range query according to bucket label, reducing data communication costs. In this article, the bucket-partitioning 15 scheme is used to perform WQuery queries to ensure the privacy of data.
However, the attacker may estimate the perceived data and query results by capturing the SN to destroy the integrity of the data. To address this problem, a prefix code validation scheme was proposed in Chen and Liu16,17 to provide SafeQ (Secure and Efficient Query processing). This scheme demonstrated acceptable security and performed quite well in storage overhead but carried a high communication cost. To rectify these issues, the scheme used the bloom filter mechanism to optimize query processing. As SafeQ adopts the prefix code scheme, sensor nodes are required to transfer substantial code data, allowing for further optimization of energy consumption. Tsou et al. 18 proposed the use of the XOR linked list (X2L) data structure, allowing the queryer to verify the integrity of the retrieved data by means of so-called verification information, that is, to store the neighborhood differences in an efficient way, to ensure safe range query, but in the linked list. The amount of data is increased during the construction process.
The literature10,19 adopts the concept of value chain and the encryption constraint chain model to verify the integrity of the query results and effectively reduce the amount of data added during the prefix encoding process, but it will generate a lot of energy consumption when querying multidimensional sensory data. To this end, Bu et al. 20 gives a VQuery protocol for privacy protection single-dimensional and multidimensional range query. VQuery encodes the data range and query conditions based on polynomial technology to hide the real sensitive information, complete the result integrity authentication based on the watermark chain, and propose multidimensional interval tree structure to represent multidimensional data, effectively reducing communication overhead. The above research effectively solves the accurate query and verification of small- and medium-sized WSNs network data. R Li et al. 21 implement data privacy protection based on pseudo-random hash function and Bloom filter and uses data partitioning algorithm to achieve complete query results. Sexual detection proposed a solution for large network sizes.
This article realizes the goals of privacy protection and integrity verification for a multidimensional range query by using the order encryption mechanism (OEM). OEM technology allows SNs to complete a range query by matching stored encrypted data blocks and the query command of an encrypted state and to some extent prevents the data leakage of the captured SN. To verify the integrity of the query results, a new T2D data structure based on a bucket-partitioning scheme is proposed to transform sensed data and data in the upper and lower bounds of the query range into corresponding bucket labels. The perceived data reduce the communication overhead by reducing the data search time. The solution proposed in this article has good performance in ensuring data security and integrity. This article verifies the performance of our method in section “Experimental analysis.”
Model
Network model
In traditional WSNs, users collect all perception data gathered by the sensor nodes and complete local queries, an approach suitable for small-scale networks but one that consumes excessive energy (i.e. adjacent nodes requiring more energy consume energy quickly). 21 Meanwhile, maintaining a real-time communication path between sensor nodes and sink nodes in a distant or unfavorable environment is difficult. Given these conditions, an in-network storage sensor node model is proposed in this article. The two-tiered WSN is intended to help realize in-network storage. In this model, sensor nodes store continuous data in the interior part of an SN, which users can visit. 22
The two-tiered sensor network
23
has a simple topological structure, high query efficiency, and stable link quality as displayed in Figure 1. The network is divided into several cells, and each unit consists of sensor nodes, an SN, and a sink, denoted as

Two-tiered wireless sensor node network model.
The sensor nodes, SN, and sink are assumed to be loosely in sync, meaning their time does not overlap. Every sensor node collects
Attack model and secure objectives
WSN is the physical sensor part of data collection and processing in the Internet of Things (IoT) system, 24 mainly in the sensing layer of the IoT system, used to perform different measurements (i.e. temperature, acceleration, humidity) and functions. Due to limited node resources and distributed organizational structure, the main security threats from the WSNs are as follows.
For the above two types of attacks, we will analyze in detail in the privacy protection section of section “System analysis.”
In the two-tiered WSN attack model, attacks on the privacy and integrity of perception data can be categorized as either exterior or interior. An exterior attack is one in which attackers outside the WSN infer corresponding perception data without obtaining keys by capturing the encrypted text between the wirelessly transmitted sensor nodes and SN. An interior attack is one in which the attackers infer clear data while collecting an encrypted text index, querying, and comparing by attacking single or multisensor nodes. For collusion attacks, attackers obtain sensitive data information by colluding with the SN and sensor nodes. Collusion attacks among sensor nodes only disclose information about captured data, exerting a minor impact on the entire Internet. However, collusion attacks among the SN and sensor nodes could potentially disclose all data information on the SN, causing serious damage.
Sensor nodes and sinks are assumed to be reliable. The number of sensor nodes subject to attack is limited because when the number of attacked nodes reaches a certain threshold, the network ceases to function normally. Sensor nodes are indeed vulnerable to attack, but for the whole sensor node network, the data collected by a single sensor among all sensors are negligible. Thus, attacks on sensor nodes are not considered in this article. In contrast to sensors, the SN stores extensive sensor node data and facilitates query processing. When an SN is captured, attackers can access vast perception data to either forge false query results or provide users with incomplete query results. Attackers can infer clear data by collecting the encrypted text index, querying, and comparing, which infringes on data privacy and may compromise query range privacy as well. Meanwhile, a captured SN can destroy data integrity by distorting or deleting query results. In distortion, the captured SN falsifies data that do not satisfy the query range and returns them to users. In deletion, the captured SN returns partial data as query results, ignoring the sensor nodes satisfying the query range intentionally; this attack reduces the integrity of the results. Once an SN is attacked, consequences are much more serious than when a sensor node is captured. As such, this article focuses on the scenario in which an SN is under attack.
The primary security objectives of two-tiered sensor networks are as follows:
Data privacy protocol
Bucket-partitioning scheme
Based on a bucket-partitioning scheme, 25 this article effectively realizes data privacy and query privacy and verifies the integrity of query results. A bucket-partitioning scheme divides a value range into many continuous ranges. Each range is called a bucket, and each bucket is assigned a unique label. Bucket-partitioning schemes are shared between sensor nodes and the sink. Before sensor nodes send perception data to a SN, sensor nodes label each datum based on the sub-bucket to which it belongs. Data with the same label are encrypted into a data block. Meanwhile, the sink transforms query commands into a series of label values based on the same bucket-partitioning scheme and sends these labels as query commands to SNs. The SNs query labels in the query range and their corresponding encrypted values in the collected data blocks before sending these values to the sink. The sink shares secret keys with sensor nodes and encodes encrypted data to obtain query results.
The bucketing scheme needs to be adapted to the data range query, and the selection of the step size optimal value is beneficial to better ensure the privacy of the data. Assuming that the data generated by each sensor follows the same distribution, the optimal parameters can be obtained from the theoretical model 15 or empirical data, but the query characteristics, that is, the range specification and the query frequency, need to be considered. Assume that the query in the full scope query set is represented as
where
Assume that the data collected by sensors are discrete and limited, such that
Then, one-dimensional data can be expanded into multidimensional data where users define different dimensions of
OEM encryption scheme
To protect data privacy, sensor nodes are required to encrypt gathered data to prevent sensitive data disclosure. This article uses a secure OEM 26 to realize one-dimensional data privacy protection. The OEM is then expanded to privacy protection of multidimensional data.
Assume that
OEM consists of order mapping and data encryption. During order mapping,
For the sake of precise monitoring, sensors in a natural environment generally monitor various data, such as temperature, humidity, and light intensity. Sensor-collected data are multidimensional in this case. This article expands OEM to privacy protection for multidimensional data. Assume that the
Figure 2 illustrates an encryption process for multidimensional data. First, a finite state machine is used to generate perception data collected by sensors into an

Encrypted sensor data.
A symmetric function will be the barrel label, with all sensory data of the
and
Then, the multidimensional data collected by
The process of multidimensional data privacy protection can be explained through the following example as shown in Figure 3(a). Sensor

Data query model: (a) mapping of sensor node, (b) processing of storage node, and (c) mapping of sink.
Sink to SN
If users query the perception data of sensor node
Therefore, during a multidimensional query, the sink should send the query to the SN using equation (9)
In Figure 3(c), when the sink deals with query request
SN to sink
When the SN receives query requests from the sink, it will divide the requests into various bucket labels using
in which
In Figure 3(b), when the SN receives query requests
and
Finally, the SN returns the query result to the sink.
System analysis
Given the premise of reliable sensor nodes, for perception data collected by any sensor node, perception data are considered to have secure privacy only when the query methods can guarantee that the SNs will not obtain actual values of any perception data. To prevent perception data and query requests from being obtained by attackers, this article uses an OEM KS to encrypt data. In addition, this article proposes a T2D data structure based on the bucket mechanism to verify the integrity of query results.
Privacy analysis
In sum, WQuery can effectively realize a range query and protect the privacy of perception data and the query range. Based on the Internet model, attack model, and secure objectives discussed in section “Model,” the security analysis of WQuery is as follows.
Proof
For any polynomial
Set
Then
2.
3. Resistance to external and captured SNs.
The proposed WQuery protocol transforms users’ actual query range [
Integrity analysis
The integrity protection results of a multidimensional data query are required to verify whether the result has been forged and whether satisfactory data have been deleted. To verify the integrity result of a multidimensional data query, this article proposes a T2D data structure to protect the integrity of multidimensional data. Based on the encrypted scheme in this article, the sink decodes the corresponding KS when receiving
For example, at time
Generally, when sensor nodes send encrypted data that satisfy a query range, if attackers falsify a data item, the sink can detect it without knowing the keys. Thus, this article conducts integrity analysis on decoded data under the following three conditions.
Experimental analysis
Based on the current secure range query protocol and models presented in sections “Relevant background” and “Model,” this article compares the WQuery protocol with current protocols from the aspects of privacy protection and integrity verification. First, the privacy protection scheme, respectively, evaluates EQ, SafeQ,
This study used original data to conduct a simulation experiment with WQuery on the MATLAB platform and compared it with the SafeQ in literature,
16
the EQ protocol in literature,18 and the
The experimental environment for this study consisted of Intel i5-2467M, CPU (quad core, 1.6 GHz), and 8GB memory. The software environment included a Windows 10 operating system and MATLAB. Assume the following: the sensor node network coverage area is 100–1000 m, 100 sensor nodes are randomly distributed in the sensor network, four SNs are evenly distributed in the network, the network includes sink nodes, and in one time unit the sensor nodes collect 10 pieces of perception data with a key length of 128 bits, encrypted by OEM.
The effective transmission distance between sensor nodes is 75 m. Sensor nodes take 1.8 jumps on average to transmit data to SNs, and every node has 25 neighboring nodes on average. The routing path was established using the Tiny AGgregation Service (TAG) for ad hoc sensor networks. 30 Sensor nodes were not considered in the simulation; the experiment focused primarily on energy consumption for the sensors to present data along with SN energy consumption. The simulation experiment only considered the independent data distribution, ignoring relevant and irrelevant data distribution.
In two-tiered WSNs, the SN has sufficient energy conservation, and the energy consumption of sensor nodes is therefore analyzed in detail. In the WQuery protocol, a sensor node mainly includes two forms of energy consumption: (1) energy consumption generated by sending and receiving information and (2) calculation energy consumption generated by OEM encrypted calculation. Based on the energy consumption of the wireless communication circuit when sending and receiving,
31
assume that every sensor node sends
where
Assume that every sensor collects 10–128 digits of perception data periodically and regularly sends the data to neighboring SNs; thus,
Experimental results reveal that the WQuery protocol in this article is superior to the SafeQ and EQ and
Under different time intervals and data lengths, ordinary sensor nodes and the SN consume energy after submitting data. In this case, query time interval

Energy consumption for sensor nodes to present data.
As noted earlier, query time interval

Query consumption of multidimensional data.
As before, query time interval

Storage space consumption.
To verify data integrity, the scheme in this article processed data collected by sensor nodes based on a bucket-partitioning scheme, matched corresponding bucket labels rather than comparing perception data with the upper and lower limits of the query range, and transformed multidimensional data processing into a problem of union sets without consuming extra space. The T2D data structure effectively reduced the amount of verified information, and the experimental results demonstrate the effectiveness of this scheme.
Conclusion
To investigate the query range problem in two-tiered WSNs, this article proposes a novel multidimensional data range query protocol based on WSNs, called WQuery, to address the drawbacks of some current schemes. This protocol guarantees the privacy of perception data and integrity verification of query results while SNs can manage range queries accurately. To better protect data privacy, this article adopts the OEM method and uses a bucket-partitioning scheme to process multidimensional data collected by sensor nodes. A new T2D scheme is also proposed that transforms the actual user query range into a matched bucket label set and verifies data integrity by comparing the difference between an
