观察者模式在地震预警系统中的应用
2021-03-13周跃勇李水龙于伟恒周施文
周跃勇 李水龙 于伟恒 周施文





摘 要:观察者模式定义对象间一对多的依赖关系,通过松耦合设计使对象间的依赖最小化。从地震预警系统研发的角度来看,波形数据的实时接收与高效处理是一个关键难点。通过应用观察者模式,实现了波形接收与数据处理的功能解耦,允许系统动态灵活地加入新的波形数据,提升了系统的可扩展性,使得系统具备较好的演化能力,能够较好地适应新的业务需求。
关键词:地震预警;观察者模式;发布-订阅模式;功能解耦
中图分类号:TP311;P315 文献标识码:A文章编号:2096-4706(2021)15-0128-03
Abstract: The observer pattern defines one-to-many dependencies among objects, and minimizes the dependencies among objects through loose coupling design. From the perspective of the research and development of earthquake early warning system, the real-time receiving and efficient processing of waveform data is a key difficulty. Through the application of observer pattern, the function decoupling of waveform receiving and data processing is realized, which allows the system to dynamically and flexibly add new waveform data, improves the scalability of the system, and makes the system have better evolution ability, and can better adapt to new business requirements.
Keywords: earthquake early warning; observer pattern; publish-subscribe mode; function decoupling
0 引 言
地震预警,是在地震发生后,基于地震发生地附近地震台站实时观测到的地震波初期信息,快速估计地震参数并预测地震对周围地区的影响程度,抢在破坏性地震波到达震中周围的预警目标区之前,发出主要震动的强度和到达时间的预警信息。预警目标区内民众和企业可以根据预警信息启动地震应急处置措施,以达到减少地震人员伤亡以及降低地震次生灾害损失的目的。
我国自2001年起开启地震预警技术研究,并在汶川地震后,开始加速地震预警系统的研究和建设,相继建成福建、首都圈和甘肃等地震预警示范系统。2010年,“国家地震烈度速报与预警工程”获得立项,2015年6月项目获得国家发展改革委批准,项目完成后我国五大重点预警区地震台网平均台间距达到12公里。对地震预警系统的研发来说,波形数据的实时接收与高效处理是一个难点问题,尤其是随着国家工程的落地实施,全国地震台网台站规模不断增加,对地震预警系统的处理能力提出了更高的要求。……
