## 4 Function Design of the Back-End Service Layer
### Uniform Interface of the Back-End Service Layer  
The uniform interface of the back-end service layer is designed using the REST. The design process includes resource identification, resource representation, URI design, and HTTP methods. The design process is shown in Figure 10.  
Resource identification refers to categorizing and identifying interactive resources to obtain monitoring terminal resources and user resources. Specifically, the monitoring terminal resources are obtained through the monitoring terminal interface (/device), abstracting the corresponding data of the monitoring terminal to support the business logic processing of the back-end service layer's data module and fault alarm page. User resources  
\begin{table}
\begin{tabular}{c c c} \hline \hline
**Number** & **Table Name** & **Note** \\ \hline
1 & DTPPF\_runpara & Running state parameter table \\
2 & power\_i & Power supply current data table \\
3 & Filter\_i & Filter branch current data table \\
4 & power-u & Power supply voltage data table \\
5 & capa-ui & Data table for rated current and voltage of filter capacitor \\
6 & DTPPF\_faultpara & Fault characteristic parameter table \\
7 & DTPPF\_faulttype & Fault type parameter table \\
8 & user & User information data table \\
9 & log & Log record data table \\
10 & role\_permissions & Role-based permission data table \\
11 & monitor\_terminal & Monitoring terminal data table \\ \hline \hline \end{tabular}
\end{table}
Table 5: Information of the main tables included in the database.  
Figure 9: Software architecture of the cloud server.  
are obtained via the user interface (/user), and mainly provide business logic processing functions for registration, login, permission management, and recording fault alarms and logs in the back-end service layer.  
On the basis of resource identification, the JSON format is used as the form of resource representation to design the resource representation, including entity header design and representation format design. The entity header is the specific format that the browser uses to submit requests to the back-end service layer via Accept, while the representation format is the form in which the back-end service layer informs the browser about the representation of resources based on the content type.  
The Uniform Resource Identifier (URI) identifies and specifies the location of resources, namely, the server address and port number. In this paper, Uniform Resource Locator (URL) is used to identify resources. URL is an application of URI that has the ability to identify resources such as URI and provides a special structure for locating resources.  
The design of the URL structure is shown in Figure 11.  
As shown in Figure 11, the URL mainly consists of the protocol name, server IP address or domain name, port number, one or multiple segments of paths, and query strings. The URL uses the forward slash separator to divide the hierarchy.  
HTTP methods such as GET, POST, PUT, and DELETE are adopted to design interfaces to handle different resources, that is, to perform CRUD (create, read, update, delete) operations on the server's resource data to ensure the consistency of the back-end interfaces.  
Table 6 provides the most commonly used data retrieval interfaces in the monitoring system.  
Figure 11: Design of the URL structure.  
Figure 10: Flowchart of the interface design.