报警系统设计
我被要求设计一个警报系统,允许一些用户创建警报,而其他用户则可以收听这些警报并执行他们需要执行的任何操作。 启动警报的用户希望有一个快捷方式(他们的系统运行的是Windows XP),因此正在监听可能警报的人会自动获得相应的信号。
也就是说,如果用户按下组合键,就会自动向安全人员发出请愿书。
我想过通过创建一个数据库来开发它,该数据库包含系统中所有用户的位置信息,并且还包含警报历史记录。我正在考虑为用户启动的每个警报创建一个新行,然后让安全人员寻找生成的新警报。基本上是这样的:
- 在快捷方式启动脚本上,在警报表中创建一个新行。
- Cron 或安排安全人员不断检查新警报的任务。
我对设计此类系统还很陌生,我在想这是否是一个好方法。另外,如果有人知道如何将脚本的启动分配给 Windows 下的系统快捷方式,我将不胜感激。
感谢任何帮助,如果需要更多信息,请告诉我。
I've been asked to design an alarm system that would allow some users to create alarms, and others to listen to those alarms and do whatever they need to do.
The users that launch the alarms want to have a shortcut (their systems are running Windows XP), so automatically the guys who are listening to possible alarms get the correspondent signal.
That is to say, if a user presses the key combination the petition is made automatically to the security people.
I've thought of developing this by creating a database that would contain location information of all the users in the system, and would also have alarms history. I was thinking on creating a new row for each alarm a user launches, and then having the security guys looking for new alarms generated. So basically something like:
- On shortcut launch script that creates a new row in ALARMS table.
- Cron or scheduled task on security guys checking for new alarms constantly.
I am pretty new on designing this kind of systems, and I was thinking if this is a good way to go. Also, I would appreciate if somebody knows how to assign the launch of a script to a system shortcut under Windows.
Appreciate any help, and let me know if more information is needed.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我强烈建议为此使用消息队列。您可以使用简单的控制台应用程序(使用桌面上的快捷方式或其他东西)向队列提交新消息。
“监听”系统将立即收到通知,您届时将执行相应的操作。
Microsoft 的内置队列效果很好:
http://msdn.microsoft。 com/en-us/library/system.messaging.messagequeue.aspx
或者您可以使用 RabbitMQ,它更强大,但很难开箱即用。
这将省去不断访问数据库进行更新的所有麻烦。
编辑:
当然,您还希望将所有呼叫记录在数据库中,以保存记录。
I would highly suggest using a message queue for this. You can submit a new message to the queue with a simple console app (with a shortcut on the desktop or something).
The "listening" systems would be notified immediately and you perform the corresponding action at that time.
Microsoft's built in queues work great:
http://msdn.microsoft.com/en-us/library/system.messaging.messagequeue.aspx
Or you can use RabbitMQ, which is more robust, but harder to get working out of the box.
This will save all the hassle of constantly hitting a database for updates.
Edit:
And, of course, you would also want to record all the calls in a database, for record-keeping.