# Bloom Filter Approach for Autonomous Data Acquisition in the Edge-Based MCS Scenario +
## 3 Materials and Methods
### Decentralized BF Algorithm  
The algorithm's fundamental idea is to utilize a BF membership test on a mobile node to determine whether or not a new data reading should be reported to the ME host in the period under consideration. As already stated in Section 3.1 in the proposed hierarchical edge-based MCS ecosystem, each ME host is responsible for one square-shaped MGRS area with a side length of 10 km. As this is a pretty large deployment area, it is unlikely that a single user (i.e., worker) can cover it in a short period. Therefore, a worker's geolocation is mapped to an MGRS area of 1 square kilometer (referred to as a \(km\) MGRS area from now on) where a user is currently located, depicted as the dark blue cell in Figure 2. In cases when redundant workers are available in cells of interest, we need only a subset of workers to collect and transmit data, while others may be deactivated to achieve battery savings and reduce unnecessary data reporting. Each worker maintains a BF structure for the \(km\) MGRS area where it is currently located, while an ME host takes care of all BFs in its corresponding MGRS area with a side length of 10 km. When a user enters in a new _km_ area and _announces_ his/her capabilities to the corresponding ME host, in the _assign_ message, he/she will receive the active tasks and current state of the BF for this area. Note that each _km_ MGRS area is associated with the one BF structure, which is created and maintained by the ME host and represents the union of BFs of all workers in that _km_ MGRS area. The proposed architecture uses a BF structure both on mobile nodes and edge servers to minimize redundant worker activity while at the same time keeping uniform data density within the area. In more detail, each worker queries its local filter structure to choose whether or not to produce more results in the area where it is now positioned. If the filter already contains data readings of the same type (note that it does not have to be the same value, but the same measured property) in the same MGRS area with a side length of 100 m in the observed period (shown as the light blue cell in Figure 2), data production will be suspended. Note that from now on, we call this 100 \(\times\) 100 m\({}^{2}\) cell the _small_ MGRS area. (We opted for a _small_ MGRS area in the process of encoding produced data readings because we want to collect data with greater density and equally distributed within a _km_ MGRS area.) The data reading should be discarded if a BF membership test results positively. Otherwise, it is valuable, and a worker should transmit this reading to the ME host. In addition, a worker inserts the combination of reading data type and the ID of the _small_ MGRS area where data was produced in its BF. Since such procedure would immediately stop a data acquisition on a worker node for this _small_ area after submitting the first valuable result for a required data type, a worker can be instructed to produce multiple results of the same type in this area before updating its BF structure. That can be achieved by using a special variable \(k_{s}\), indicating the required number of results per _small_ area. Analogously, when the corresponding ME host receives a new data reading, it will use its BF to determine whether the reading is redundant (shown as \"new data reading\" which falls in the green cell in Figure 2). If the filter membership test is negative, the ME host will add the combination of reading data type and ID of the _small_ MGRS area where the reading was created to its filter, ensuring a uniform density of data readings inside a _km_ MGRS area. This procedure enables the synchronization between the two filters (i.e., the ME host's and worker's BFs). If the filter membership test reports positive, then the worker's BF structure is inconsistent, and the ME host will send the current state of its BF to the worker that produced this data reading in a _BFupdate_ message.