| Literature DB >> 25436650 |
Abstract
In recent years, the increased interest in energy conservation and environmental protection, combined with the development of modern communication and computer technology, has resulted in the replacement of distributed heating by central heating in urban areas. This paper proposes a Representational State Transfer (REST) Machine-to-Machine (M2M) gateway for wireless remote monitoring for a district central heating network. In particular, we focus on the resource-oriented RESTful M2M gateway architecture, and present an uniform devices abstraction approach based on Open Service Gateway Initiative (OSGi) technology, and implement the resource mapping mechanism between resource address mapping mechanism between RESTful resources and the physical sensor devices, and present the buffer queue combined with polling method to implement the data scheduling and Quality of Service (QoS) guarantee, and also give the RESTful M2M gateway open service Application Programming Interface (API) set. The performance has been measured and analyzed. Finally, the conclusions and future work are presented.Entities:
Year: 2014 PMID: 25436650 PMCID: PMC4299022 DOI: 10.3390/s141222447
Source DB: PubMed Journal: Sensors (Basel) ISSN: 1424-8220 Impact factor: 3.576
Figure 1.RESTful M2M architecture.
Data packet conversion format for ASCII mode.
| high address byte | Slave address |
| low address byte | |
|
| |
| high level function code | Function code |
| low level function code | |
|
| |
| data 1 high address | The first byte |
| data 1 low address | |
|
| |
| …… | …… |
|
| |
| Data | The |
| Data | |
|
| |
| LRC high address | LRC |
| LRC low address | |
|
| |
| End1 | CR(0DH) |
|
| |
| End2 | LF(0AH) |
Data request packet for analog data.
|
| |||
|---|---|---|---|
|
|
| ||
| Heading | 3A | Slave Address | 01 |
| Slave Address | 01 | Function | 03 |
| Function | 03 | Starting Address Hi | 06 |
| Starting Address Hi | 06 | Starting Address Lo | 14 |
| Starting Address Lo | 14 | Number of Points Hi | 00 |
| Number of Points Hi | 00 | Number of Points Lo | 08 |
| Number of Points Lo | 08 | CRC(low byte) | 04 |
| Error Check(LRC) | DA | CRC(high byte) | 80 |
| End1(CR) | 0D | ||
| End2(LF) | 0A | ||
Data reply packet for analog data.
|
| |||
|---|---|---|---|
|
|
| ||
| Heading | 3A | Slave Address | 01 |
| Slave Address | 01 | Function | 03 |
| Function | 03 | Bytes Count | 10 |
| Bytes Count | 10 | Data Hi (T20) | 00 |
| Data Hi (T20) | 00 | Data Lo (T20) | 01 |
| Data Lo (T20) | 01 | Data Hi (T21) | 00 |
| …… | … | …… | … |
| Data Lo (T27) | 08 | CRC (low byte) | 72 |
| Error Check (LRC) | C8 | CRC (high byte) | 98 |
| End1 (CR) | 0D | ||
| End2 (LF) | 0A | ||
Basic protocol packets of the H7000.
| 0 × 01 | terminal request for registration |
| 0 × 02 | terminal request for cancellation |
| 0 × 03 | query of IP address for certain DTU |
| 0 × 04 | packet of invalid command or protocol (usually used for question answering or setup instructions) |
| 0 × 05 | receiving a data packet from a user (from DSC) |
| 0 × 09 | data packet from a user (from DTU to DSC) |
| 0 × 0B | DTU parameters inquiry answer packet |
| 0 × 0D | set up a DTU parameters inquiry answer packet |
Definition of resources.
| 1 | collection of sub-stations |
| 2 | specific sub-station |
| 3 | collection of PLCs in applications |
| 4 | specific PLC |
| 5 | collection of sensors |
| 6 | specific sensor |
Definition of resource labels.
| collection of sub-stations; | /stations |
| specific sub-station | /stations/{stationed} |
| all PLCs under sub-station | /stations/{stationed}/plcs |
| PLC under sub-station | /stations/{stationed}/plcs/{plcid} |
| sensor under certain PLC | /stations/{stationed}/plcs/{plcid}/{sensorid} |
Simple description of the resource interface.
| /stations | GET | list of information about all substations |
|
| ||
| /stations/{stationed} | GET | display the information for stationed |
| PUT | update information about the stationid | |
|
| ||
| /stations/{stationed}/plcs | GET | list information about all PLCs for stationid |
| PUT | update information about all PLCs for stationid | |
|
| ||
| /stations/{stationed}/plcs/{plcid}/{sensorid} | GET | display information about sensorid in plcid for stationid |
| PUT | update information about sensorid in plcid for stationid | |
Resource information comparison.
| read data from certain sensor | GET /stations/{stationed}/plcs/{plcid}/{sensorid} | |
| write data to certain sensor | PUT /stations/{stationed}/plcs/{plcid}/{sensorid}/{value} |
Figure 2.Flowchart to handle the data request.
Simple description of a resource operation table.
| 1 | 1 | D2000 | 1 | ||
| 1 | 1 | D2002 | 2 | 58.5 | 98.5 |
| 1 | 2 | D1000 | 1 | ||
| 2 | 1 | D1500 | 2 | 24.7 | 36.4 |
Example I for the division of PLC storage area.
|
| ||||||||
|---|---|---|---|---|---|---|---|---|
| S | 000∼255 | bit | 0000∼00FF | 000001∼000256 | 0∼127 | 0∼1024 | 0∼1024 | |
| S | 256∼511 | bit | 0100∼01FF | 000257∼000512 | ||||
| S | 512∼767 | bit | 0200∼02FF | 000513∼000768 | ||||
| S | 768∼1023 | bit | 0300∼03FF | 000769∼001024 | ||||
|
| ||||||||
| X | 000∼377(Octal) | bit | 0400∼04FF | 101025∼101280 | 0∼177 | 0∼177 | 000∼377 | |
| Y | 000∼377(Octal) | bit | 0500∼05FF | 001281∼001536 | ||||
|
| ||||||||
| T | 000∼255 | bit | 0600∼06FF | 001537∼001792 | 0∼127 | 000∼255 | 000∼255 | |
| word | 0600∼06FF | 401537∼401792 | ||||||
|
| ||||||||
| M | 000∼255 | bit | 0800∼08FF | 002049∼002304 | 0∼1279 | 0∼4095 | 0000∼4095 | |
| M | 256∼511 | bit | 0900∼09FF | 002305∼002560 | ||||
| M | 512∼767 | bit | 0A00∼0AFF | 002561∼002816 | ||||
| M | 768∼1023 | bit | 0B00∼0BFF | 002817∼003072 | ||||
| M | 1024∼1279 | bit | 0C00∼0CFF | 003073∼003328 | ||||
| M | 1280∼1535 | bit | 0D00∼0DFF | 003329∼003584 | ||||
| M | 1536∼1791 | bit | B000∼B0FF | 045057∼045312 | ||||
| M | 1792∼2047 | bit | B100∼B1FF | 045313∼045568 | ||||
| M | 2048∼2303 | bit | B200∼B2FF | 045569∼045824 | ||||
| M | 2304∼2559 | bit | B300∼B3FF | 045825∼046080 | ||||
| M | 2560∼2815 | bit | B400∼B4FF | 046081∼046336 | ||||
| M | 2816∼3071 | bit | B500∼B5FF | 046337∼046592 | ||||
| M | 3072∼3327 | bit | B600∼B6FF | 046593∼046848 | ||||
| M | 3328∼3583 | bit | B700∼B7FF | 046849∼047104 | ||||
| M | 3584∼3839 | bit | B800∼B8FF | 047105∼047360 | ||||
| M | 3840∼4095 | bit | B900∼B9FF | 047361∼047616 | ||||
|
| ||||||||
| C | 0∼199 | 16-bit | bit | 0E00∼0EC7 | 003585∼003784 | 0∼127 | 0∼199 | 0∼199 |
| word | 0E00∼0EC7 | 403585∼403784 | 0∼127 | 0∼199 | 0∼199 | |||
|
| ||||||||
| 200∼255 | 32-bit | bit | 0EC8∼0EFF | 003785∼003840 | 232∼255 | 200∼255 | 200∼255 | |
| Dword | 0EC8∼0EFF | 403785∼403840 | 232∼255 | 200∼255 | 200∼255 | |||
Structure of the mapping rule table for a Delta PLC.
| S | 0 | 1023 | 10 | 0000 |
| X | 0 | 377 | 8 | 0400 |
| Y | 0 | 377 | 8 | 0500 |
| T | 0 | 255 | 10 | 0600 |
| N | 0 | 4095 | 10 | 0800 |
| D | 0 | 4095 | 10 | 1000 |
| D | 4096 | 9999 | 10 | 9000 |
Figure 3.Diagram of the process for resources address mapping.
Structure of the resource status description table.
| NUMBER | number | number for resource access, starting from 1 |
| COM_ID | Terminal ID | one resource corresponding to one number, and one number contains multiple resources |
| PLC_ID | ID for accessed PLC | one source belongs to one PLC hardware device |
| SENSOR_ID | Sensor ID | one sensor ID corresponding to one address in PLC |
| WORD_COUNT | word count for resource | 1 or 2 means resource in analogue data, 0 means resource in digital switch |
| NAME | measure item | e.g., temperature, power |
| DEVICE_NAME | Device name | e.g., SIEMENS, DVP |
| DEVICE_PROTOCOL | Protocol name | MODBUS_RTU(Modbus protocol RTU mode) and MODBUS_ASC(Modbus protocol ASC mode) |
| DATA_TYPE | Data type | analog means analog data, digital means digital switch; |
| CONTROL_TYPE | Control type | number 1 means read only, 2 means writable |
| MEASURE_UNIT | Measure unit | e.g., Mpa: temperature (°C), pressure (Mpa) |
| VALUE | Measure value | means specific value |
| STATUS | status | 0 means not usable, 1 means usable |
| FACTOR | factor | means original data need to determine factor |
| OFFSET | offset | means original data need to calculate offset |
Structure of the interface description table.
| COM_ID | communication ID | means ID for terminal communication module |
| PORT | port ID | means ID of the port access to the server |
| PROTOCOL | protocol | means GPRS protocol used by the terminal module |
| STATUS | status | 0 means not usable, 1 means usable |
| OPEN | ON/OFF status; | 0 means OFF, 1 means ON |
Figure 4.Procedures for data processing in resource management layer.
Figure 5.REST API for monitoring and controlling devices.
Figure 6.Topology diagram of the test environment.
Figure 7.Statistics of data packet loss.
Figure 8.Time delay statistics.
Figure 9.Response time for user requests.
Figure 10.Average response times for concurrent threads.