用于监视大量不同类型的系统变量的结构

发布于 2024-10-12 06:19:32 字数 546 浏览 2 评论 0原文

我需要一些建议来解决我工作地点的数据存储问题。

问题如下:

我们有一个嵌入式应用程序,必须监视来自某些设备的数据。数据很简单,例如状态标志、指示设置/温度/其他的单个整数/浮点变量,但我们有数百个。

我们现在讨论的是在应用程序中存储这些变量的简单方法。系统的某些部分将读取设备,并将其状态写入这些变量。当这些变量发生变化时,系统的其他部分需要得到通知。

所以基本上是一个<消费者> <-----> <数据存储> <-----> <制作人>结构。

因为我以前从未使用过这样的专业软件(刚从大学毕业:)),所以我希望这些论坛上有一些聪明的人可以向我传授如何解决这个问题的智慧。


到目前为止我所研究的是:

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

幻梦 2024-10-19 06:19:32

由于数据有限,我建议尝试使用您提到的 观察者模式 来实现 HashMap。我认为这可能是一个很好的方法,因为有两件事:

  1. 看起来你正在学习。因此,能够快速生产出一些东西来看看它是否有效是很重要的。
  2. 它似乎比使用 SQLLite 更简单(就依赖关系而言)。在一场有简单解决方案和复杂解决方案(并且两者都完成相同的事情)的战斗中,我赌简单的解决方案。

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:

  1. It seems that you're learning. Thus, it's important to be able to quickly churn something out just to see if it will work.
  2. It seems to be more simple (in terms of dependencies) than using SQLLite. In a fight in which theres a simple solution and a complex solution (and both accomplish the same thing), I'd bet on the simple solution.
是伱的 2024-10-19 06:19:32

您可能想了解一下 SNMP 协议。

You may want to have a look at the SNMP protocol.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文