I have a small expert system made with Drools
, and I have a doubt, I will try to explain it. The system reacts to various sensors. It receives the values from the sensors and acts. I know what I have to do to trigger the entire set of rules, but my question arises when I scale the application to respond to, say, hundreds of sensors.
The idea is that the expert system is always listening to all the producers and that it acts accordingly with each new value, which can be a key value.
Should I launch the rules for each of the sensor values? Should I put the values of the sensors in a queue, using RabbitMQ
for example, and launch all the rules for each new value that is removed from the queue? If I fire the rules for each sensor value without using a queue manager like RabbitMQ
, how do I know I won't lose any values?
Your problem is very similar with the handling of industrial PLCs. There is software that handles industrial sensors such as PLCs, temperature readers, etc. and the strategy of these is to put an intermediate layer between the sensors and the consumer.
The middle layer asks the sensors for values all the time. If these values are different from the previous values, then it saves them.
I clarify that the values have a
timestamp
and aquality-read
that are the date and time of the last value and the reading quality of that value since the sensors can throw fruit (inconsistent values).This is all part of the OPC standard .
As for the part that it exposes to be consumed, it can be a simple WS like an RPC, Pipe or whatever you want. You can even expose events to call your application and get new captured data.
This intermediate layer, which I mention to you, is very similar to an OPC Server .
Regarding
Drools
, I can't tell you much, since I don't know him. If a business rules engine, then you shouldn't have any problems. You can declare a rule to consume a particular value from the middle layer and work with that data.From my part, I tried to give you an approximation to the data consumption of electronic devices. I hope it helped you.