iotonem2m

Can there be duplicate telemetry data in a oneM2M system


I am using OM2M (Eclipse) implementation of OneM2M standard. Here, they are generating a Content Instance for each telemetry data, and they use a random number to generate it's ID. Now , let's say for some reason, the device sends same telemetry data twice, then in that case, we will have duplicate entries for this telemetry data since we create a random ID of content instance.

There are two possibilities -

  1. I can use the telemetry timestamp to generate the ID for content instance. So that there won't be any duplicate entries.
  2. I do nothing and store the duplicate entries, so that we can later analyze the data and capture this anomaly. And change the device configurations accordingly.

Which of the two options is possible using oneM2M?

And how does oneM2M support time-series data streams?

Thanks in advance.


Solution

  • The scenarios you are describing in your question acre actually two different use cases:

    You need to decide which case you want to implement for your scenario, but it seems from your question that the second use case is what you want to implement.

    What you propose in option 1) is not possible because the <contentInstance> resource type does not allow updates of an existing resource. Your only possibility with this resource is to create a new <contentInstance> every time you want to store data.

    Also, you cannot provide, set or update the resourceIdentifier because it is always assigned by the CSE.

    However, there are a couple of options to achieve what you want to do when you only need to store one data record per sensor. You should have a look at the <container> definition because here you can set the maximumNumberOfInstance (mni) attribute to 1. This means that the <container> always makes sure to store one instance of the data automatically (ie. it removes all the older instances). To access your data you would then not directly address the <contentInstance>, but use the <latest> virtual child resource of the <container>. When sending a RETRIEVE request to that resource you would automatically get the latest <contentInstance>, independently from its name or resource identifier.

    Another possibility would be using <flexContainer>. Here, you can define you own data points and store data records without any versioning. But I am not sure whether the version of om2m you are using is fully supporting the <flexContainer> resource type.