地震前兆观测设备模拟通信软件关键技术研究*

(防灾科技学院,河北 三河 065201)

前兆观测设备; 模拟通信软件; 套接字; 多线程; 观察者设计模式

Research on Key Technologies of Simulative Communication System of Earthquake Precursory Observation Devices
SHAN Wei-feng,LI Jun

(Institute of Disaster Prevention,Sanhe 065201,Hebei,China)

precursory observation devices,simulative communication software,socket,multithreading,observer design patten

备注

遵循“中国数字地震观测网络技术规程”相关标准,设计了一套基于Java语言的前兆观测设备模拟通信软件。介绍了通信指令原语、数据包格式定义以及模拟通信软件的总体设计,详述了模拟通信软件中的几个关键技术,包括如何同时模拟多个前兆设备,应用观察者设计模式实时更新设备状态信息,使用套接字技术和多线程技术启动或停止模拟设备,通过“心跳”线确认远端Socket是否关闭等。该软件可以模拟大多数“十五”前兆观测设备的通信原语,一方面为台站技术人员以及地震专业学生了解前兆设备的功能、通信指令、以及数据包的数据格式提供了一个模拟环境,有效地提高了教学效果和培训质量,另一方面也为开发前兆设备相关软件提供了模拟支撑环境。

According to“Stipulation on Net Communication for Devices in China Geophysical and Geochemical Observatory Network”,a simulative communication system of precursory observation devices based on java programming language is designed.Firstly,the paper introduces the communication primitives,data package format and high-level architecture.Secondly,several key technologies of simulative communication system are argued in detail,such as how to simultaneously simulate multiple precursor equipment,updating devices' status using observer pattern,using socket and multithreading technologies to start/stop simulative device,using“heart”message to judge whether the remote socket is closed or not.The simulative communication system realizes most communication primitives and provides a simulative environment for students to understand the functions,communication primitives and data package format of precursory observation devices,which enhances the teaching effects and training quality,on the other hand it provides a support environment for development of simulation software.