博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
sync logic
阅读量:4180 次
发布时间:2019-05-26

本文共 1118 字,大约阅读时间需要 3 分钟。

Push data flow:

Step
client App
server
1

New Data can be captured in the following flows:

  • new Scan ticket
  • Answer Questions
  • Submit Additional Notes

Each flow will mark the entry in client side as "dirty". When each flow succeeds in the API call (which means server has been updated for individual entry, the "dirty" flag will be removed.

New Data = all entries with "dirty" flag.

Push new data to server. Include the device key (or device id).

 
2

 

Receive the new data.

3   Generate a timestamp (e.g. date time now) and stamp it to the data.
4   Save data to the DB together with the device key.

Pull data flow:

Step
client App
server
1

Pull new data from server.

Include the following parameters:

  • latest timestamp in local storage
  • device key (or device id)

 

 
2   Receive the client timestamp and client device key
3  

Query data from DB with this filter:

  • db timestamp > client timestamp
  • db device key != client device key

Send the resulting data back to client

4 Receive resulting data from server  
5

if record match (e.g. ticket id, customer id) with local storage

update the record locally.

Otherwise, add the new record locally.

转载地址:http://fphai.baihongyu.com/

你可能感兴趣的文章
SpringBoot | 第二章:配置多环境以及上传文件
查看>>
Spring Data JPA |自定义非实体类的映射
查看>>
SpringBoot | 常用注解记录
查看>>
JavaBean对象转换EntityUtils工具类
查看>>
Maven常用命令
查看>>
SpringBoot | 运行报错,无法加载oracle连接驱动
查看>>
为什么阿里巴巴禁止在 foreach 循环里进行元素的 remove/add 操作
查看>>
AWS EC2如何从普通用户切换为root用户
查看>>
click方法不生效的
查看>>
mysql排行榜并列与不并列
查看>>
SpringBoot | Mybatis申明为Mapper文件
查看>>
JPA主键生成策略
查看>>
byte数组和InputStream的相互转换
查看>>
InputStream,InputStreamReader和Reader之间的区别与关系
查看>>
Java中System.arraycopy方法的使用
查看>>
tk.mybatis的使用记录
查看>>
遍历获取目录下的所有文件
查看>>
从指定服务器路径下载文件
查看>>
EasyExcel读取和写入java model数据
查看>>
《C编译原理》共享库的动态加载和静态加载
查看>>