用于监视大量不同类型的系统变量的结构
我需要一些建议来解决我工作地点的数据存储问题。
问题如下:
我们有一个嵌入式应用程序,必须监视来自某些设备的数据。数据很简单,例如状态标志、指示设置/温度/其他的单个整数/浮点变量,但我们有数百个。
我们现在讨论的是在应用程序中存储这些变量的简单方法。系统的某些部分将读取设备,并将其状态写入这些变量。当这些变量发生变化时,系统的其他部分需要得到通知。
所以基本上是一个<消费者> <-----> <数据存储> <-----> <制作人>结构。
因为我以前从未使用过这样的专业软件(刚从大学毕业:)),所以我希望这些论坛上有一些聪明的人可以向我传授如何解决这个问题的智慧。
到目前为止我所研究的是:
SQLite:非常简单的数据库,并且易于使用。但当要存储的数据并不真正适合表格结构时,这也许有点矫枉过正了?
哈希图:简单地将每个数据块与某个键作为索引存储,然后订阅某些索引上的更改。
我希望我说得有道理,并对文字墙表示歉意:) 提前感谢您的帮助。
I am in need of some advice for a solution to a data storage problem we have at the place were I work.
The problem is as follows:
We have an embedded application which must monitor data from some equipment. The data is simple, such as status flags, single integer/floating variables indicating a setting/temperature/whatever, but we have hundreds of them.
What we are discussing now, is a simple way to store these variables in the application. Some parts of the system will read the equipment, and write their state to these variables. Other parts of the system will need to be notified when any of these variables change.
So basically a < Consumer > <-----> < Data Store > <-----> < Producer > structure.
As I have never worked on any professional software like this before (fresh out of university :) ) I was hoping there would be some brilliant people on these forums who could lend me their wisdom on how to aproach this problem.
What I have looked into so far, is:
SQLite: Very simple database, and easy to use. But perhaps it is overkill when the data to be stored doesnt really lend itself to a tabular structure?
Hashmaps: Simply store each data-lump with some key as index, then subscribe to changes on certain indices.
I hope I am making sense, and sorry for the wall of text :) Thanks in advance for the help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
由于数据有限,我建议尝试使用您提到的 观察者模式 来实现 HashMap。我认为这可能是一个很好的方法,因为有两件事:
With limited data, I'd say try the HashMap implementation using an Observer pattern like you mentioned. I think this may be a good approach because of two things:
您可能想了解一下 SNMP 协议。
You may want to have a look at the SNMP protocol.