#573 Need guidance on history mechanism

Pun Mum Sat 13 Jan 2018

Hi All,

Query is about history mechanism. We are implementing haystack server which connects with BACnet end-points to collect data.

I am under impression that for a historized point, data is fetched from end-point at certain interval and fetched data is stored (say in a database) with timestamp.

When client sends hisRead op, data (available as per range parameters) will be returned.

E.g. for a point, data in database is available from 11-Jan-2018 10 am to 12-Jan-2018 10 am.

If hisRead requests data for this range, then response will have some data.

If hisRead requests data outside this range (say for 9-Jan-2018 to 10-Jan-2018), then response will be empty grid.

Queries:

1) Is this understanding correct ? If not, please provide information, if possible with example.

2) Further, explanation of hisInterpolate tag confuses me. Please provide details on how to use hisInterpolate tag.

3) Also Please provide details on usage of hisTotalized tag.

4) Why would client use hisWrite op? In above example, can client post data for past dates 1-Jan-2018 to 10-Jan-2018 using hisWrite? Can client post data for future dates 1-Feb-2018 to 10-Feb-2018 using hisWrite? Can client post data for already available dates 11-Jan-2018 to 12-Jan-2018 using hisWrite?

My assumption: hisWrite op will make server maintain a data about historized point in database in all above cases. No write operation to actual end-point will be issued.

Looking forward to comments and help.

I know these are too many queries in one post. Hence, please point me to any references if available. Hope that this query and answer will help newcomers like me to understand history mechanism in Haystack.

Thanks.

Brian Frank Sun 14 Jan 2018

  1. yes
  2. hisInterpolote is an indication to the person consuming the data to know how it was collected when doing analytics. If your implementation is collecting the data, then you should use that tag to indicate whether you sample the data or collect it on change-of-value
  3. in general that is only used for meter data when keeping a totalized aggregate of energy usage or substance consumed
  4. if someone wants to push the historical data to you, then that op is used

I would also highly recommend you take a look at the Java Toolkit which is all open source and has a complete test server you can run, as well as a client implementation to test with. Use it as a reference implementation to see how yours might work

Pun Mum Sun 14 Jan 2018

Thanks Brian for directions.

For hisWrite, I request your views on 3 cases how hisWrite will be used - to post past data, to post future data or to post data for already recorded dates.

Also please let me know your views on my assumption on hisWrite that no values are written in case hisWrite posts future data.

For hisInterpolate = linear, the standard says "to compute the approximation using a linear equation based on the previous and next values and the associated timestamps".

Is definition of "linear equation" defined anywhere ?

Meanwhile, i will go through Java Toolkit. Thank you.

On a different note, I have a few more queries. Can we have 1-to-1 email communication, please ?

Later, I will prepare a document based on our email communication which can be posted on this forum.

Thanks once again.

Brian Frank Mon 15 Jan 2018

For hisWrite, I request your views on 3 cases how hisWrite will be used - to post past data, to post future data or to post data for already recorded dates.

I would say that is an implementation detail. Our system allows future timestamps and we allow to post updated timestamps which already existing which is a merge/overwrite.

hisInterpolate = linear, the standard says "to compute the approximation using a linear equation based on the previous and next values and the associated timestamps"

The intention here is to tell the client how the data was historized. Its either sampled on an interval basis (this is what linear means) or its collected as cov (change of value).

We've changed our terminology and I'll probably propose the same for Haystack so that its more clear

Pun Mum Mon 15 Jan 2018

Thanks a ton Brian.

Your comment tells me that Haystack as a standard is not so strict yet about all implementation or behavior as long as we are meeting the syntax and not deviating from basic idea.

This stand helps a lot :)

As I said earlier, I am still studying Haystack and will post my queries in this forum. Thank you for your guidance and support.

Pun Mum Thu 22 Mar 2018

A query on hisRead operation:

If number of records to be returned is huge (say 10,000), then

  • is there any way to tell Haystack client that only partial data say (1000 records) are being returned and client will have to query again by changing date-range parameters to get next set of data ?

Pun Mum Thu 29 Mar 2018

Hi guys,

looking forward to thoughts on above.

Brian Frank Thu 29 Mar 2018

Hi Pun, there is nothing standardized for truncation/limiting.

In our system we allow the limit tag to be passed into the request and if omitted we default to 10K records. And if we hit a limit, then we add the more marker tag into the grid meta. We could potentially standardize that if everyone likes that design (or brainstorm on better design)

Pun Mum Fri 30 Mar 2018

Thanks Brian.

Our thoughts match on proposed solution. I wanted to ensure that I am not missing anything in terms of Haystack standard.

"limit" and "more" tags make sense. Default records to return in absence of "limit" tag, is implementation specific.

The onus falls on Haystack client to look for "more" marker tag and accordingly send another hisread op by adjusting date range. And as history data is being collected continuously, there is no need to inform record count to Haystack client.

My vote in favor of "limit" and "more" tags standardization for hisread op !

Login or Signup to reply.