# Bloom Filter Approach for Autonomous Data Acquisition in the Edge-Based MCS Scenario +
## 3 Materials and Methods
### Main Algorithm Procedures  
Hereafter, we briefly explain five main procedures in our algorithm. First, in Algorithm 1, we show a procedure when a worker \(u_{w}\) arrives in a \(km\) MGRS area operated by the \(ME_{i}\) host. \(ME_{i}\) identifies an area in which \(u_{w}\) is currently located (line 2) and checks if he/she can potentially answer to any task in that area (lines 3-7). If any potential tasks are available, \(ME_{i}\) sends a BF for this area and assigns all potential tasks to the worker \(u_{w}\) (lines 8-13). Next, we present a procedure when a worker \(u_{w}\) submits a new result \(r\) to the \(ME_{i}\) host in Algorithm 2. Before sending the data, a worker \(u_{w}\) has to check if a similar result has already been produced in a _small_ area of 100 m\({}^{2}\) by querying the Bloom filter associated with the \(km\) MGRS area where he/she is currently located received from the corresponding ME host. Note that from now on, we call this worker's BF. If a filter membership test reports positive, the result \(r\) contains redundant data and should be skipped (lines 4-6). Otherwise, the produced result should be sent to the \(ME_{i}\) host. Worker \(u_{w}\) submits data until a sufficient number of results are produced for this _small_ MGRS area and adds this result in his/her BF (lines 7-13). Figure 3: An algorithm for autonomous decision-making of a moving worker regarding its participation in the data acquisition process. ```
1:procedureWorkerAnnounce(\(u_{w},a\))
2:\(area\gets findArea(\ell_{a})\)
3:\(workersInArea(area).add(u_{w})\)
4:foreach\(\tau\) in \(activeTasks(area)\)do
5:if\(\mu_{\tau}(a)==\top\)then
6:\(potentialTasks(u_{w}).add(\tau)\)
7:endif
8:endfor
9:if\(potentialTasks(u_{w})==\varnothing\)then
10:break
11:else
12:\(sendBF(bloomFilter(area),m)\)
13:\(assign(u_{w},potentialTasks(u_{w}))\)
14:endif
15:endprocedure
```  
**Algorithm 1** Arrival of a new worker in the area covered by the ME host  
```
1:procedureSubmitResult(\(u_{w},r\))
2:\(small\,Area\gets findArea(\ell_{r})\)
3:\(property\gets getProperty(r)\)
4:if\(workerBloomFilter.membershipTest(small\,Area+property)\)then
5:break
6:else
7:if\(resultsCounter(small\,Area+property)<k_{s}\)then
8:\(resultsCounter(small\,Area+property)++\)
9:\(submitResult(r)\)
10:else
11:\(submitResult(r)\)
12:\(workerBloomFilter.add(small\,Area+property)\)
13:endif
14:endif
15:endprocedure
```  
**Algorithm 2** Submission of a new result to the ME host by a worker \(w\)  
Algorithm 3 shows a procedure when the \(ME_{i}\) host receives a new result \(r\) submitted by the worker \(u_{w}\). First, \(ME_{i}\) identifies an area in which \(u_{w}\) is currently located (line 2) and analyzes features of a produced result (lines 3-4). Then, it checks whether its BF for the corresponding \(km\) MGRS area contains an element with the same combination of data type and \(small\) MGRS area as \(r\). If yes, the result \(r\) contains redundant data, and the \(ME_{i}\) host has to update the BF of the worker \(u_{w}\) (lines 5-7). Otherwise, the submitted result is new and should be stored by the \(ME_{i}\) host and delivered to the interested users. When the \(ME_{i}\) host collects sufficient number of results \(k\) per \(small\) MGRS area, it adds this result in its BF (lines 8-13). In Algorithm 2, a worker maintains the \(resultsCounter\), while in Algorithm 3, the \(resultsCounter\) is maintained by an ME host. An ME host will first reach the counter threshold (\(k\)) as it collects all measurements in the \(small\) MGRS area (from multiple workers), and then it will send the filled BF structure to all workers who reported redundant data reading, because the worker's counter still did not reach the threshold value (\(k_{s}\)). Note that when an ME host accepts multiple data readings, a detection or filtering mechanism can be built on top of an ME host because it receives numerous readings per \(small\) MGRS area, and it can perform preprocessing of received data readings (e.g., to detect faulty values).