数据库中专用于代理的时间戳

发布于 2024-10-29 05:55:22 字数 393 浏览 6 评论 0原文

我需要为软件代理设计一个数据库。应该有一些表(例如 DOOR、CORRIDOR、WINOW)指示具有特定功能列的对象。功能可能已设置、未设置或不可用。它们还应该根据它们发生的时间以某种方式进行本地化。

主要任务之一是检查对象在特定时刻具有哪些特征。应该有一种简单的方法来获取与给定参数(也是时间戳类型)最接近的时间戳特征。

处理它的程序将是 Java 语言。这将是一个小型应用程序。我正在考虑 JavaDB - 它不一定要高效,但我愿意接受其他建议。 时间戳在这里是一个抽象的概念。它可以只是连续整数。当代理从数据库收集信息并将两个或多个对象的时间戳关联起来时,就会出现此问题。它们可能会有所不同,但在某些范围内应被视为同一时刻

我应该在每个表中放置时间戳列还是应该采用其他方式?您认为最好的方法是什么?

I need to design a database for a software agent. There should be some tables (eg. DOOR, CORRIDOR, WINOW) indicating objects with columns for specific features. Features may be set, unset or unavailable. They should be also somehow localised according to time when they occured.

One of main tasks will be checking what features the object had in particular moment of the time. There should be easy way of getting features for the timestamp which is closest for given parameter (also of timestamp type).

The program handling it would be in Java. It's going to be small application. I'm thinking about JavaDB - it doesn't have to be efficient but I'm open for other suggestions.
Timestamp is an abstract concept here. It can be just in continuous integers. The problem will occur when the agent gathers information from the DB and associate timestamp for two or more objects. They can vary but should be treated as the same moment in some scope.

Should I place timestamp columns in each table or should I rather do it another way? What do you think is the best approach for this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

梦在深巷 2024-11-05 05:55:22

我必须承认,仅仅通过阅读您的描述,我并没有真正理解您的意思。

但我认为你必须在每个表中存储一个时间戳列。我正在想象入侵监控系统的“门键盘”和“开门传感器”等功能。您可能想要区分“正常”门事件(“门键盘”事件,然后是“解锁门”事件,然后是“门打开”事件,全部在 5 秒内)与入侵事件(2 分钟到绕过锁)。所以我不认为整数在这里对你有帮助。

I have to admit I don't fell like I really understand what you're getting at just by reading your description.

But I think you're going to have to store a timestamp column in each table. I'm imagining features like "door keypad" and "door open sensor" for an intrusion monitoring system. You might want to distinguish a "normal" door event--a "door keypad" event followed by a "unlock door" event followed by a "door open" event, all within 5 seconds--from an intrusion event (2 minutes to bypass the lock). So I don't think integers will help you here.

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