# Development of User-Participatory Crowdsensing System for Improved Privacy Preservation
## 4 Implementation of Proposed System
### Service Provider Server  
The user database, request database, and data processing node pool database were constructed using PostgreSQL. The schema of the user, request, and data processing node pool databases is shown in Tables 3-5, respectively. Communication with the data processing nodes was implemented using the Kaa IoT platform. The Kaa SDK for communication with the \(SP\) is included in the data processing node registration process. The Kaa SDK contains connection information, encryption algorithms and encryption keys, data schemas, and so on for communication with the \(SP\). Reward payment data uses MongoDB, the default endpoint data history database on the Kaa IoT platform. The reward payment data sent by the data processing node are stored in MongoDB on the \(SP\), and the reward management module uses these data to update the user database and delete the applied reward data from MongoDB. Initially, a user uses an application to generate an RSA-2048 asymmetric cryptographic key pair and sends the public key to the \(SP\) for registration. Upon receiving the user registration request, the \(SP\) adds data having a reward field value of 0 to the user database using the public key provided by the user as \(user\_id\). The owner of a data processing node sets up a computing node as a data processing node, and then sends its ID and IP address to the \(SP\) to request data processing node registration. Upon receiving this request, the \(SP\) provides a data processing node application including the Kaa SDK. Figure 9 shows the interface for creating and issuing the Kaa SDK in the \(SP\). The owner of the data processing node installs the provided application on the computing node so that it can operate as a data processing node. The detailed structure and process flow of the data processing node application are described in Section 4.2. After verifying that the new data processing node is functioning properly, the \(SP\) adds a req_count value of 0, with the ID of the owner of the data processing node as \(owner\_id\) and the data processing node IP address as \(node\_addr\), to the data processing node database. The \(user\_no\) field value for the new data processing node is set to the smallest value that does not overlap with the \(user\_no\) value of other data processing nodes. The \(SP\) periodically communicates with the data \begin{table}
\begin{tabular}{c c c} \hline \hline
**Field Name** & **Data Type** & **Filed Content** \\ \hline \(user\_no\) & Unit & Unique user number \\ \(owner\_id\) & String & ID \(K_{pub}(u_{no})\) of the owner of the data processing node \\ \(node\_addr\) & Unit & Data processing node address \(addr(p_{i})\) \\ req\_count & Unit & Number of assigned requests \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Schema of data processing node database. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Field Name** & **Data Type** & **Filed Content** \\ \hline \(user\_id\) & String & User ID \(K_{pub}(u)\) \\ Reward & Decimal & Reward amount \(i(u)\). \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Schema of user database. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Field Name** & **Data Type** & **Filed Content** \\ \hline \(user\_no\) & Unit & Unique request number \\ \(owner\_id\) & String & Data requester ID \(K_{pub}(u)\) \\ Description & String & Description for sensing data transmitted by the data requester \\ Amount & Unit & Amount of requested data \\ Schema & String & Schema for sensing data \\ Reward & Decimal & Requested reward \\ \(node\_no\) & Unit (foreign key) & Assigned data processing node number \\ \hline \hline \end{tabular}
\end{table} 
Table 5: Schema of request database. processing node and deletes it from the corresponding database if it is determined that the node does not operate normally. The data requester sends the description of the requested sensing data, the requested quantity, the data schema, the reward payment amount, and its own ID to the _SP_, and requests the provision of the sensing data.