首页> 中文期刊> 《计算机技术与发展》 >基于串口自定义协议传输文件的设计

基于串口自定义协议传输文件的设计

         

摘要

In order to use the serial port to transmit the document correctly,it selected the seal data frame method to realize this goal. First the circulation process is divided into 3 parts: the transmission filename, the transmission document size and the transmission document content. Jn view of each process to design different data frame structure, use the order character of the structure to differentiate the different period of the transmission. In the sending process,there possibly presents the data missing or line fault to influence data transmissions, this question is avoided to establish the reproduction mechanism. Before sealing the data,carry on the contrast to the data part byte one by one, transmit the key words of frame head and frame tail to carry on the replace, guarantee the key words is only in the transmission data. The result indicated that this method can complete the document transmission highly effective and accurate using the definition data frame structure to seal data to the transmit data.%为了利用串口准确高效地传输文件,文中采用了自定义协议封装数据帧的方式来实现这一目的.首先将文件发送分成3个过程,发送文件名和发送文件大小、发送文件内容以及发送文件结束确认.针对每一过程设计不同的数据帧结构,通过帧结构中的命令字来区分发送过程的不同阶段.线路受干扰可能出现传输数据丢失,线路故障将影响数据正常发送,采用定时器实时检测传输状态的模式提高数据发送过程的容错性,及时纠正发送过程中的错误,保证数据准且高效地传输.封装数据前对数据部分逐一字节进行对比,发现帧头帧尾关键字进行替换,保证了发送数据中关键字的唯一.结果表明,利用自定义数据帧结构封装数据通过串口进行发送,定时器模式及时纠正数据传输过程中的错误,高效准确地完成了文件的传输.

著录项

相似文献

  • 中文文献
  • 外文文献
  • 专利
获取原文

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号