摘要
高速串口具有较大数据吞吐量,在耗时可观的任务环境中,极易产生因读取串口缓存不及时而导致数据丢失的现象;针对该缺陷,提出了一种适用于高速串口的上位机软件设计模式,采用Windows API和重叠I/O方法搭建串口数据的读写操作;该模式运用多线程技术,对其数据一致性问题进行了论证;对于使用串口传输JEPG图像压缩码流的特殊应用场合,进行了优化设计;对使用波特率为2.5M的高速串口传输尺寸为640*480、帧频为12Hz、压缩比为12.5的图像测试表明,提出的设计模式满足工程应用需求。
The high-speed serial communication works with a mass of data streams. The buffer overflows in result of reading delayed in situation of time-limited tasks. The paper proposed a software design model to solve the problem. The design model used Windows API and overlapped functions to implement reading and writing operation. Multithread technique was used and synchronization was discussed. For the application of transfer image streams compressed by JPEG with serial communication, the design model was optimized. The test of transferring image data with size 640 * 480, frame frequency 12Hz, compression ratio 12.5 proves that the proposed design model meets the needs of engineering application.
出处
《计算机测量与控制》
北大核心
2014年第7期2318-2320,共3页
Computer Measurement &Control
关键词
高速串口
设计模式
high-speed serial communication
design model