# Rough Estimator Based Asynchronous Distributed Super Points Detection on High Speed Network Edge
## 4 RE Based Distributed Super Points Detection Algorithm READ
### Generate Candidate Super Points  
The master data structure at the observation node consists of two parts: REC and LEA. REC is used to recover global candidate super points, which has the advantage of less memory consumption; LEA is used to estimate cardinality, which has the advantage of high estimation accuracy. Each observation node can only observe part of the opposite hosts. In order to detect the super points accurately, it is necessary to collect the opposite hosts information recorded by each observation node on the global server. In this paper, the super points detected from IP address pairs of all observation nodes are called as global super points, and the generated global candidate super points are called global candidate super points. When generating global candidate super points, only RECs are collected from each observation node, as shown in Figure 6.  
After each observation node has scanned all IP address pairs in a time window, only the REC needs to be sent to the global server. The global server merges all the collected REC. The merging method is to merge the RE of different observation nodes in a \"bit or\" manner. In this paper, the way of combining according to \"bit or\" is called external merging, and the way of combining according to \"bit and\" is called internal merging. External merger of RE is defined as follows:  
**Definition 3** (RE Out merging). : _All bits of two RE generate a new RE according to the operation of \"bit or\"._  
In this paper, when the operand of the operator \"\(\bigoplus\)\" is two RE or two LE, it means to out merge the two RE or LE; when the operand of the operator \"\(\bigcirc\)\" is two RE or two LE, it means to inner merge the two RE or LE. The REC of all observation nodes are merged on the global server by outer merging, which ensures that any bit in the REC is still 1 in the merged global REC as long as it is set to 1 at any one observation node. Since RE uses bits to record the occurrence of opposite host, the global REC generated by outer merging contains the opposite information recorded by all observation nodes. In this paper, the REC used to restore the global candidate super points on the global server is called as the global REC. The global REC has the same structure as the REC at all observation nodes. The global REC and the REC of all observation nodes are merged according to outer merging. There are two methods to get the global REC:  
1. Before merging the REC, the global server initializes a REC with the same structure as the REC at the observation nodes, and sets all bits in the initialized REC to 0. Then,  
Figure 6: Collect REC from observation nodes. the REC on the global server is merged with the REC on all observation nodes one by one, and the results are saved to the global REC. 2. The global server takes the REC from the first observation node as the global REC, then merges the global REC with the REC from the remaining observation nodes, and saves the results to the global REC. Among the two methods for merging global REC, method 2 is less computational than method 1, because method 2 does not need to re-initialize REC. In this paper, method 2 is used to merge the REC of observation nodes into the global REC. Let \(\mathbb{R}\) denote the global REC, and \(\mathbb{R}_{i,j,k}\) denote the \(j\)-th RE of the \(i\)-th REV in the \(k\)-th REA of \(\mathbb{R}\). Assuming that the REC on \(\mathcal{O}_{\theta}\) is first received as one on the global server, Algorithm 2 describes the REC merging process on the global server. ```
0:\(\mathsf{n},\{\mathbb{R}^{0},\mathbb{R}^{1},\cdots,\mathbb{R}^{n-1}\}\), \(r\), \(u\), \(\{v_{0},v_{1},\cdots,v_{u-1}\}\)
0:\(\mathbb{R}\)
1:\(\mathbb{R}\gets\mathbb{R}^{0}\)
2:for\(l\in[1,\mathsf{n}-1]\)do
3:for\(k\in[0,2^{r}-1]\)do
4:for\(i\in[0,2^{u}-1]\)do
5:for\(j\in[0,2^{v_{i}}-1]\)do
6:\(\mathbb{R}_{i,j,k}\leftarrow(\mathbb{R}_{i,j,k}\bigoplus\mathbb{R}_{i,j,k}^{l})\)
7:endfor
8:endfor
9:endfor
10:endfor
11:Return \(\mathbb{R}\)
```  
**Algorithm 2** Out Merging REC.