摘要
针对采用蓝牙技术以虚拟串口方式组建工业数据采集系统时,因蓝牙发送数据包的频率和长度不确定,导致以规定长度的数据包协议进行串口编程可能出现的数据丢失问题,提出了一种基于环形缓冲区的数据处理算法,并详细说明了该算法的实现过程。实践证明该算法不仅稳定高效,而且原理简单,易于实现。同时该算法还适用于其他不规则数据的处理。
When an industrial data acquisition system which is based on Bluetooth and is in serial module, it may lead to data loss. The reason is due to the uncertainty of package length and sending rate of Bluetooth. To solve the problem this paper designs a data processing method based on circular buffer and gives a detailed description of the algorithm realization process. Practice has proved that the algorithm is not only stable and effective, but also easy to realize. In addition, this algorithm is also applicable to other irregular data processing.
出处
《实验室研究与探索》
CAS
北大核心
2013年第11期93-96,共4页
Research and Exploration In Laboratory
基金
江西省科技支撑项目(20111102040100)
关键词
数据包
蓝牙协议
串口通信
环形缓冲
数据处理
data packet
Bluetooth protocol
serial communication
circular buffer
data processing