Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

简单数据校验功能 #52

Open
zillionare opened this issue Jun 17, 2022 · 0 comments
Open

简单数据校验功能 #52

zillionare opened this issue Jun 17, 2022 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@zillionare
Copy link
Owner

目前,在保证数据完整性上,大富翁采取的措施是:

  1. 盘中数据被认为是容易发生错误的,它们只保存在缓存中,不会被写入持久化数据库。
  2. omicron在访问持久化数据库(influxdb)时,只使用只读token
  3. 每天在午夜同步前一天行情数据,先保存到minio,再写入influxdb。

尽管如此,仍然有可能出现数据不完整的情况,比如:

  1. 管理员使用可写账户登录influxdb,无意中对数据进行了更改(特别是删除)
  2. 在同步时就发生了错误。

为保证数据完整性,特提出以下简单校验功能:

证券日历的完整性校验

每天运行。将calendar中的日期与同期取得的上证指数的日期进行比较,如果不一致,则报警。

证券列表的完整性校验

每天运行。执行以下检查:

  1. 以下指数及股票代码出现在证券列表中,且名称、起始日期、结束日期都正确。
    • 000001.XSHG
    • 000001.XSHE
    • 600000.XSHG
  2. 每日证券列表中的股票代码数都比前一天保持相同或者增加。如果出现减少,则报警。

行情数据的完整性校验

  1. minio中,每个文件的大小都比对应文件前一日的大小非单调增加。
  2. minio中,每天证券列表中的品种,都在文件中有相应的行情数据。
  3. influxdb中,1, 5, 10, 15, 30, 60, 1d, 1w, 1M等数据的条目数都正确(即如果当天存在品种A,则该品种应该有240根1m线,8根30m线,以此类推。
  4. 针对沪指、深成指、创业板指、沪深300,重新从上游取一次数据,逐帧检验全部字段是否一致。
  5. 按抽样10%品种的概率,重新从上游取一次数据,逐帧检验全部字段是否一致。
    上述任务,每周非交易日运行。
@zillionare zillionare added the enhancement New feature or request label Jun 23, 2022
@henrycs henrycs self-assigned this Jun 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants