Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

时间复杂度:O(1)

空间复杂度:O(1)



参考资料:

算法图解

算法论文.


基本概念

  • Error Compression Deviation (CD) 压缩偏差

    • 一个数据点与线性趋势的最大差异值 E

    • 运行程序前,预先设定的E 绝对压缩偏差值

    • 在偏差范围内,数据被压缩并扔掉

    • 在偏差范围外,数据不被压缩,保存下来

  • Compression minimum (comp min)
    • segment (存储的两个点为segment 的起点和终点) 之间的最小时间间隔距离
    • 若 compMin = 0,记录每一个超过CD的点
    • 可以设定compMin 防止noisy point 占用存储空间
  • Compression maximum (comp max)
    • segment 之间的最大时间间隔距离
    • 不论CD 的值,若两点之间的时间距离 >= compMax,pi server会记录当前数据点并结束当前segment
    • 为了更精准的压缩数据

  • upperDoor,当前保留数据点值+CD为支点的门

    • 起始默认为关闭状态  Integer.min

    • 和curUpperSlope 进行比较,取最大值,只能逆时针打开

  • lowerDoor,当前保留数据点值-CD为支点的门

    • 起始默认为关闭状态 Integer.max 

    • 和curLowerSlope进行比较,取最小值,只能顺时针打开

  • curUpperSlope 

    • 当前数据点到segment starttime 的上斜率

  • curLowerSlope 

    • 当前数据点到segment starttime 的下斜率

  • 存储上一个数据点

    • 两扇门超过平行的时候

    • upperDoor >= lowerDoor 

...