您的位置:山东大学 -> 科技期刊社 -> 《山东大学学报(工学版)》

山东大学学报 (工学版) ›› 2023, Vol. 53 ›› Issue (5): 156-164.doi: 10.6040/j.issn.1672-3961.0.2023.122

• 其他 • 上一篇    

基于RS485的多主机对等通信系统的设计与实现

任瑶瑶1,马金平2*   

  1. 1.南京财经大学红山学院, 江苏 南京 210003;2.山东大学机械工程学院, 山东 济南 250061
  • 发布日期:2023-10-19
  • 作者简介:任瑶瑶(1992— ),女,山东德州人,助教,硕士,主要研究方向为计算机、嵌入式系统、密码学等. E-mail: ryysdnu@163.com. *通信作者简介:马金平(1986— ),男,山东胶南人,实验师,硕士,主要研究方向为机械制造及自动化、高分子材料科学与工程、实践教学、创新创业教育等. E-mail: mjp@sdu.edu.cn
  • 基金资助:
    山东大学教育教学改革与研究资助项目(2022Y114);山东大学实验室建设与管理研究资助项目(sy20222304)

Design and implementation of multi-host peer-to-peer communication system based on RS485

REN Yaoyao1, MA Jinping2*   

  1. 1. Hongshan College, Nanjing University of Finance and Economics, Nanjing 210003, Jiangsu, China;
    2. College of Mechanical Engineering, Shandong University, Jinan 250061, Shandong, China
  • Published:2023-10-19

摘要: 针对主从模式带来的通信延迟、冗余通信等问题,设计一种基于RS485多主对等通信方式,实现RS485通信线路上多主机对等通信功能,不需要主机轮询通信。对通信线路进行设计,在原有RS485通信线路基础上增加一条控制线路,用于检测通信线路的工作情况。移植uC/OS-Ⅱ实时操作系统到STM32F103C8T6控制板上,利用uC/OS-Ⅱ的实时多任务特性,实现通信线路检测、数据接收、数据发送及其他任务的同时运行,提高通信系统的工作效率。采用数据缓冲、数据队列、循环冗余校核(cyclic redundancy check, CRC)校验等方式,提高数据接收与发送的稳定性和可靠性,解决数据量增加带来的数据混乱、传输不稳定等问题。通过搭建试验系统,实现预期的通信功能,验证多主对等通信的可行性,为联网设备通信提供一种新方法。

关键词: RS485, 多机通信, 通信转发, 通信协议, 嵌入式系统

中图分类号: 

  • TN919.6
[1] MIRAZ M H, ALI M, EXCELL P S, et al. Internet of nano-things, things and everything: future growth trends[J]. Future Internet, 2019, 10(8): 68.
[2] ALOZIE A, WESTPHAL B, KISCHE S. Surgical revision after percutaneous mitral valve repair by edge-to-edge device: when the strategy fails in the highest risk surgical population[J]. European Journal of Cardio Thoracic Surgery, 2019, 46(1): 55-60.
[3] ALVI S A, SHAH G A, MAHMOOD W. Energy efficient green routing protocol for Internet of Multimedia Things[C] //2015 IEEE Tenth International Conference on Intelligent Sensors, Sensor Networks and Information Processing(ISSNIP). Singapore: IEEE, 2015: 426.
[4] SHINICHI F, HIROSHI I, JIRO Y. Performance evaluation of packet reassembly at an edge device in ATM-LANS[J]. Electronics & Communications in Japan, 2001, 84(1): 40-48.
[5] 唐夕晴, 李建闽, 佘晓烁. RS485总线接口性能测试仪设计与开发[J].电测与仪表, 2019, 56(7): 142-147. TANG Xiqing, LI Jiamin, SHE Xiaoshuo. Design and development of RS485 bus interface performance tester[J]. Electrical Measurement & Instrumentation, 2019, 56(7): 142-147.
[6] 陈航, 严帅, 刘胜, 等. 基于RS485总线的分布式高精度数据采集系统[J]. 仪表技术与传感器, 2021, 457(2): 71-74. CHEN Hang, YAN Shuai, LIU Sheng, et al. Distributed high-precision data acquisition system based on RS485 bus[J]. Instrument Technique and Sensor, 2021, 457(2): 71-74.
[7] 高璐瑶, 杜淑蓓, 刘振翔, 等. 一种基于RS485和LoRa技术的混合网络环境监控系统设计[J].通信与信息技术, 2021, 250(2): 62-65. GAO Luyao, DU Shubei, LIU Zhenxiang, et al. Design of hybrid network environmental monitoring system based on RS485 and LoRa technology[J]. Communication & Information Technology, 2021, 250(2): 62-65.
[8] 邵严. RS485总线时分复用主动传输技术在安全监控系统的应用[J]. 自动化与仪器仪表, 2020, 250(8): 57-59. SHAO Yan. Application of RS485 transmission technology based on TDM in supervision system of coal mine safety[J]. Automation & Instrumentation, 2020, 250(8): 57-59.
[9] 于鑫, 马强, 朱亮. 一种实现多主机协商控制RS485从机设备的方法[J]. 电子质量, 2021, 406(1): 106-111. YU Xin, MA Qiang, ZHU Liang. Method for implementing multi-host negotiation control RS485 slave device[J]. Electronics Quality, 2021, 406(1): 106-111.
[10] 赵庆川. 基于RS485总线的顶板离层传感器设计[J]. 工业仪表与自动化装置, 2020, 274(4): 113-116. ZHAO Qingchuan. Design of top plate-free sensor based on RS485 bus[J]. Industrial Instrumentation & Automation, 2020, 274(4): 113-116.
[11] 邵严. 不定期受控RS485总线通信方式在煤矿安全监控系统中的应用[J]. 煤矿安全, 2020, 51(7): 117-120. SHAO Yan. Application of urban controlled RS485 bus communication in coal mine safety monitoring system[J]. Safety in Coal Mines, 2020, 51(7): 117-120.
[12] 黄孝良, 李敏刚. RS485通讯在饲料加工物联网系统中的应用[J]. 福建农机, 2020, 160(2): 23-25. HUANG Xiaoliang, LI Mingang. Application of RS485 communication in feed processing internet of things system[J]. Fujian Agricultural Machinery, 2020, 160(2): 23-25.
[13] 吴兴校, 王零超, 蔡华祥,等. 基于MODBUS-RS485多路集成系统的快速通信[J]. 现代机械, 2020, 217(3): 12-16. WU Xingxiao, WANG Lingchao, CAI Huaxiang, et al. Rapid communication based on MODBUS-RS485 multiple integrated system[J]. Modern Machinery, 2020, 217(3): 12-16.
[14] 王丹, 刘国栋, 张海涛, 等. 基于ARM的嵌入式系统开发[J]. 微处理机, 2021, 42(1): 62-64. WANG Dan, LIU Guodong, ZHANG Haitao, et al. Destructured system-based embedded system development[J]. Microprocessors, 2021, 42(1): 62-64.
[15] CHENG L W, TAO Y C, PIAO S H. The design of embedded operating system for vehicle internet of things[J]. Journal of Physics: Conference Series, 2021, 1732(1): 012054.
[16] 俞祥贤. 基于物联网的嵌入式操作系统设计[J].电子元器件与信息技术, 2020, 4(5): 89-90. YU Xiangxian. Design of embedded operating system based on IoT[J]. Electronic Component and Information Technology, 2020, 4(5): 89-90.
[17] 梁小骜, 宋庆国, 王勃. uCOS-Ⅲ在Cortex-M4平台上的移植和实现[J].电子技术与软件工程, 2017, 16: 199-201. LIANG Xiaoao, SONG Qingguo, WANG Bo. Migration and implementation of uCOS-Ⅲ on the Cortex-M4 platform[J]. Electronic Technology and Software Engineering, 2017, 16: 199-201.
[18] 张思超. 基于uC/OS-Ⅱ的多路信号采集及控制系统[D]. 济南: 山东师范大学, 2016. ZHANG Sichao. Multi-channel signal acquisition and control system based on uC/OS-Ⅱ[D]. Jinan: Shandong Normal University, 2016.
[19] LABROSSE J J. uC/OS-Ⅱ:源码公开的实时嵌入式操作系统[M]. 邵贝贝, 译. 北京: 中国电力出版社, 2001: 28-36.
[20] 何世添, 谢海昌. 基于STM32和uCOS-Ⅲ的智能家居控制系统设计[J]. 轻工科技, 2018, 34(8): 100-102. HE Shitian, XIE Haichang. Design of smart home control system based on STM32 and uCOS-Ⅲ[J]. Light Industry Science and Technology, 2018, 34(8): 100-102.
[21] 楚红雨, 李磊民, 黄玉清, 等. 实时操作系统uC/OS-Ⅱ在ARM9上移植的实现[J]. 计算机工程, 2005, 31(20): 226-228. CHU Hongyu, LI Leimin, HUANG Yuqing, et al. Implementation of porting RTOS uC/OS-Ⅱ to ARM9[J]. Computer Engineering, 2005, 31(20): 226-228.
[1] 马金平. 基于UART串口的多机通讯[J]. 山东大学学报 (工学版), 2020, 50(3): 24-30.
[2] 孙 科,刘 刚,房建成 . 基于ARM和DSP的嵌入式导航计算机方案设计[J]. 山东大学学报(工学版), 2007, 37(1): 23-26 .
Viewed
Full text


Abstract

Cited

  Shared   
  Discussed   
No Suggested Reading articles found!