在Java中对给定数据实现多个规则

在Java中对给定数据实现多个规则,java,spring,rules,rule-engine,Java,Spring,Rules,Rule Engine,我需要对每天收到的数据实施大量规则 数据将包含有关用户操作的信息,如某人点击广告。我们想忽略一些基于规则的点击,比如 - anyone clicking the same ad more than 4 times in a minute --> ignore all clicks 4th onwards - anyone clicking the same ad more than 4 times in an hour --> ignore all clicks 4th onward

我需要对每天收到的数据实施大量规则

数据将包含有关用户操作的信息,如某人点击广告。我们想忽略一些基于规则的点击,比如

- anyone clicking the same ad more than 4 times in a minute --> ignore all clicks 4th onwards
- anyone clicking the same ad more than 4 times in an hour --> ignore all clicks 4th onwards
- anyone clicking different ads more than 10 times in a minute --> ignore all clicks for that user
每次点击都会有数据。例如:

User_ID AD_ID  CLICK_TIME
User1   ad1    2018-09-11 11:10:00
User1   ad1    2018-09-11 11:10:01
User1   ad1    2018-09-11 11:10:02
User1   ad1    2018-09-11 11:10:03
User1   ad1    2018-09-11 11:10:04
User1   ad1    2018-09-11 11:10:05
因为数据将是巨大的,每个规则都需要数据聚合,然后检查计数。数据将以文件形式提供

我可以知道在Java中实现这些规则的最佳方法是什么吗?是否有我们可以使用的ope源代码


感谢

这取决于数据流入的速度和中所述的其他因素

因为你最多只需要在内存中存储最后几个小时的数据,我建议你看看。如果数据大得多,并且计算不需要实时,您也可以查看Hadoop。 Spark和Hadoop都能很好地处理文件

您还可以将数据流化并使用来执行所有这些操作

阅读更多关于大数据的内容,你会觉得你的数据不是那么“大”,你也可以使用数据库,我建议你保持简单,从数据库中读取最后的“x”小时数据,然后进行计算

至于用于单击验证的Java设计模式,您可以查看该模式


PS:-我不是建筑师,你可能想看看其他答案。这个答案只是为您提供一些关于哪些技术可用的指导。

谢谢,Kartik。我们将进一步检查提供的建议。