19
DATABASE SCHEME FOR UNIFIED OPERATION OF SACLA/SPRING-8 K.Okada, M.Ishii, N.Hosoda, T.Sugimoto, M.Yamaga, T.Fukui, T.Maruyama, T.Fujiwara, K.Watanabe, H.Sumitomo 10/10/2017 ICALPCS 2017 2017/10/10 1 K.Okada, JASRI

Database Scheme for Unified Operation of SACLA / SPring-8...GRP2 GRP3 (id B, key, value) data store space work space K.Okada, JASRI Redesign example : SR magnet 2017/10/10 14 power

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Database Scheme for Unified Operation of SACLA / SPring-8...GRP2 GRP3 (id B, key, value) data store space work space K.Okada, JASRI Redesign example : SR magnet 2017/10/10 14 power

DATABASE SCHEME FOR UNIFIED OPERATION OF

SACLA/SPRING-8

K.Okada, M.Ishii, N.Hosoda, T.Sugimoto, M.Yamaga, T.Fukui, T.Maruyama, T.Fujiwara, K.Watanabe, H.Sumitomo

10/10/2017

ICALPCS 2017

2017/10/10 1K.Okada, JASRI

Page 2: Database Scheme for Unified Operation of SACLA / SPring-8...GRP2 GRP3 (id B, key, value) data store space work space K.Okada, JASRI Redesign example : SR magnet 2017/10/10 14 power

Outline• Background

• A new database scheme

• Transition plan and status

• Summary

2017/10/10 K.Okada, JASRI 2

Page 3: Database Scheme for Unified Operation of SACLA / SPring-8...GRP2 GRP3 (id B, key, value) data store space work space K.Okada, JASRI Redesign example : SR magnet 2017/10/10 14 power

Background

• SPring-8, SACLA, A4SXFEL

• 20 years of operation

• An upgrade project

(SPring-8-II, early 2020s)

Use SACLA as an injector to the new SP8 SR.

• We, the control group, decided to overhaul the system.

2017/10/10 3

DBK.Okada, JASRI

© RIKEN

This talk is about DB.

SPring-8 Strage Ring

Page 4: Database Scheme for Unified Operation of SACLA / SPring-8...GRP2 GRP3 (id B, key, value) data store space work space K.Okada, JASRI Redesign example : SR magnet 2017/10/10 14 power

time-series data

3 roles of database at SPring-8

Log data• time series data

env, mon, status, etc.

Parameter set• communication

between applications • operation points, etc.

Management

2017/10/10 4

application_1

application_2

K.Okada, JASRI

signal attributes,DAQ settings

Page 5: Database Scheme for Unified Operation of SACLA / SPring-8...GRP2 GRP3 (id B, key, value) data store space work space K.Okada, JASRI Redesign example : SR magnet 2017/10/10 14 power

Log database

2017/10/10 5K.Okada, JASRI

Page 6: Database Scheme for Unified Operation of SACLA / SPring-8...GRP2 GRP3 (id B, key, value) data store space work space K.Okada, JASRI Redesign example : SR magnet 2017/10/10 14 power

Current situation: local evolutions• SPring-8, SACLA, A4SXFEL

• Type 1,2,3 are in operation.

• Requirements• Logging SACLA’s 60Hz shot by shot synchronized data

• Unified system for the control from SACLA through the new SR

for the maintenance cost

2017/10/10 6

streamer

writerType 1

online

Archive

Sybase

Sybase

Online

Archive

Type 2

Type 3event sync’d

K.Okada, JASRI

Page 7: Database Scheme for Unified Operation of SACLA / SPring-8...GRP2 GRP3 (id B, key, value) data store space work space K.Okada, JASRI Redesign example : SR magnet 2017/10/10 14 power

New logging scheme

2017/10/10 7

Simple (no intermediate stage)Treats all kind of data Easy to add data points

ArchiveOnlineFirst stage (3 months to 1year)

A relatively tight connection between frontends and DB

We adopt a policy to limit types of frontend platforms

Frontend(VME, Micro TCA.4)

K.Okada, JASRI

Cassandra DB MariaDB

write incentive read incentive

Page 8: Database Scheme for Unified Operation of SACLA / SPring-8...GRP2 GRP3 (id B, key, value) data store space work space K.Okada, JASRI Redesign example : SR magnet 2017/10/10 14 power

New logging scheme

2017/10/10 8

Cassandra (NoSQL)# First stage storage

key (date+signal_id) & value@time1key (date+signal_id) & value@time2key (date+signal_id) & value@time3

…….. ……..# Online/index

key (date+signal_id) & latest value

MariaDB (RDB)# 1table/signal

up to 60 data points packed for data volume and access speed.

t0_1, [[t,v], [t’,v’], [t”,v”],...]t0_2, [[t,v], [t’,v’], [t”,v”],...]t0_3, [[t,v], [t’,v’], [t”,v”],...]....

K.Okada, JASRI

ArchiveOnlineFirst stage

Cassandra DB MariaDB

Page 9: Database Scheme for Unified Operation of SACLA / SPring-8...GRP2 GRP3 (id B, key, value) data store space work space K.Okada, JASRI Redesign example : SR magnet 2017/10/10 14 power

Parameter set

2017/10/10 9K.Okada, JASRI

Page 10: Database Scheme for Unified Operation of SACLA / SPring-8...GRP2 GRP3 (id B, key, value) data store space work space K.Okada, JASRI Redesign example : SR magnet 2017/10/10 14 power

Current situation (What is wrong)

RDB

dedicated functionsfor each table

operator console

2017/10/10 10

various types of tables

Example of itemsoperation points :magnetic field setting

file

also private files

There had been no effort to formalize the usage.

K.Okada, JASRI

Page 11: Database Scheme for Unified Operation of SACLA / SPring-8...GRP2 GRP3 (id B, key, value) data store space work space K.Okada, JASRI Redesign example : SR magnet 2017/10/10 14 power

Current situation

RDB

file

dedicated functionsfor each table

operator console

2017/10/10 11

various type of tables

also private files

Example of itemsmagnet field settingconversion factoralignment

There had been no effort to formalize the usage.

db_update_run_curr_ns_bump.cdb_update_run_curr_ns_fill.cdb_update_run_curr_ns_lnbt.cdb_update_run_curr_ns_lnbt_energy.cdb_update_run_curr_ns_qmag.cdb_update_run_curr_ns_rf.cdb_update_run_curr_ns_rf_eqip.cdb_update_run_curr_ns_sept.cdb_update_run_curr_ns_seq.cdb_update_run_curr_ns_seq_all.cdb_update_run_curr_ns_skew.cdb_update_run_curr_ns_st.cdb_update_run_curr_ns_sx.cdb_update_run_curr_qmag.cdb_update_run_curr_quad.cdb_update_run_curr_rf.cdb_update_run_curr_rf_eqip.cdb_update_run_curr_sept.cdb_update_run_curr_set_hs.cdb_update_run_curr_set_li.cdb_update_run_curr_skew.cdb_update_run_curr_skew_oct.cdb_update_run_curr_skew_sx.cdb_update_run_curr_sp8.cdb_update_run_curr_sr.cdb_update_run_curr_ssbt_q.cdb_update_run_curr_ssbt_st.cdb_update_run_curr_st.cdb_update_run_curr_sx.cdb_update_run_curr_sy.cdb_update_run_curr_sy_mag.cdb_update_run_curr_sy_mon.cdb_update_run_curr_sy_rf.cdb_update_run_curr_sy_tmg.cdb_update_run_mode_run_time.cdb_update_run_proc_mng.cdb_update_run_proc_mng_now.cdb_update_run_proc_mng_ut.cdb_update_spa_run_curr_set.cdb_update_spbpm_imbalance.cdb_update_sr_injection_time.c

BMAG_RUN_SETQMAG_RUN_SETSKEW_OCT_RUN_SETSKEW_RUN_SETSKEW_SX_RUN_SETST_RUN_SETSX_RUN_SETNS_BUMP_RUN_SETNS_LNBT_RUN_SETNS_SEPT_RUN_SETLI_BS_RUN_SETLI_MAG_RUN_SETLI_RF_RUN_SETLI_RUN_SETNS_RUN_SETSP8_RUN_SETSPA_RUN_SETSR_RUN_SETSY_MAG_RUN_SETSY_MON_RUN_SETSY_RF_RUN_SETSY_RUN_SETSY_TMG_RUN_SETLI_BS_SHUTTER_RUN_SETLI_DELAY_RUN_SETLI_TMG_RUN_SETFILL_RUN_SETNS_FILL_RUN_SETLI_BM_H1_RUN_SETLI_BM_L1BT_RUN_SETLI_BM_L3BT_RUN_SETLI_BM_LSBT_RUN_SETLI_BM_M20_RUN_SETLI_BS_IRIS_RUN_SETLI_BS_SLIT_RUN_SETLI_GUN_RUN_SET

BL_MNGBL_SIG_HISTORYBL_SIG_SCHEDULEBL_STATUSBL_WS_IPBPMBPM_ALIGNMENTBPM_CALIBBPM_LOCAT_MNGCODBPM_IMBALANCECODBPM_MBUNCH_GAINCODBPM_NON_LINCODBPM_SBUNCH_GAINNS_BPM_ALIGNMENTNS_BPM_CALIBNS_CODBPM_IMBALANCENS_CODBPM_MBUNCH_GAINNS_CODBPM_NON_LINNS_CODBPM_SBUNCH_GAINFILLING_PATTERNINTLK_BIT_INFINTLK_CODEKLYLI_BPM_EQIPLI_BPM_INFLI_MOD_FIRST_INTLKLI_MOD_H0H1_FIRST_INTLKLI_MOD_M18_FIRST_INTLKLIL3_PM_EQIPLNBT_ENERGYMAG_COEFFMAG_LOCAT_MNGMAG_PS_MNGMAG_ID_ATTRNS_INJECTION_TIMENS_MAG_LOCAT_MNG

db_get_run_mode_comment.cdb_get_run_mode_maxid.cdb_get_run_mode_name.cdb_get_run_proc_host.cdb_get_run_proc_mng.cdb_get_run_set_bmag.cdb_get_run_set_bump.cdb_get_run_set_bump_tilt.cdb_get_run_set_by_id.cdb_get_run_set_fill.cdb_get_run_set_li.cdb_get_run_set_ns.cdb_get_run_set_ns_fill.cdb_get_run_set_ns_seq.cdb_get_run_set_qmag.cdb_get_run_set_quad.cdb_get_run_set_rf.cdb_get_run_set_rf_eqip.cdb_get_run_set_sept.cdb_get_run_set_skew.cdb_get_run_set_skew_oct.cdb_get_run_set_skew_sx.cdb_get_run_set_sp8.cdb_get_run_set_sr.cdb_get_run_set_ssbt_q.cdb_get_run_set_ssbt_st.cdb_get_run_set_st.cdb_get_run_set_sx.cdb_get_run_set_sy.cdb_get_run_set_table_type.cdb_get_spa_run_curr_set.cdb_get_spa_run_set.cdb_get_spbpm_delay_comm.cdb_get_spbpm_delay_machine.cdb_get_spbpm_gain.cdb_get_spbpm_imbalance.cdb_get_spbpm_non_lin.cdb_get_sr_injection_time.cdb_get_station.cdb_get_sub_grp_id_by_name.cdb_get_sub_grp_inf.c

K.Okada, JASRI

Page 12: Database Scheme for Unified Operation of SACLA / SPring-8...GRP2 GRP3 (id B, key, value) data store space work space K.Okada, JASRI Redesign example : SR magnet 2017/10/10 14 power

Requirements are simple

• group (= a set of values in a same category)

• store a set of values with the version#

• parent and child groups (e.g. magnet, vacuum)

• access to ID# and relation between ID’s

2017/10/10 12K.Okada, JASRI

Page 13: Database Scheme for Unified Operation of SACLA / SPring-8...GRP2 GRP3 (id B, key, value) data store space work space K.Okada, JASRI Redesign example : SR magnet 2017/10/10 14 power

Design of RDB tables and access functions

2017/10/10 13

GRP ID ID-ID

attributes

p-cversion

group relation

(idA, key, value)

GRP1GRP2

GRP3

(idB, key, value)

data

store space

work space

K.Okada, JASRI

Page 14: Database Scheme for Unified Operation of SACLA / SPring-8...GRP2 GRP3 (id B, key, value) data store space work space K.Okada, JASRI Redesign example : SR magnet 2017/10/10 14 power

Redesign example : SR magnet

2017/10/10 14

power supply name

eqip_name(eqip_id)

power supplycurrent limits

ID: eqip

mag_ps_param_run_set

energy acc. freq.acc. voltage, etc.

comp_run_set

beam_param_run_set

mag_run_set

element_name(element_id)

ring_param_run_set

cell numberlocation

effective length

twiss parameter

element name

ID: element

strength

Bmag run set

Quad run set

Sx run set

St run set

Skew Q run set

Bump run set,,,

mag_param_run_set

mag strength current conversion factor

ID: magtype

Existing application

wrapperfunction

commonfunction

new DB scheme

RD

B t

able

Ap

plic

atio

n

K.Okada, JASRI

ID-ID : element_magtype

ID-ID: element_eqip

Page 15: Database Scheme for Unified Operation of SACLA / SPring-8...GRP2 GRP3 (id B, key, value) data store space work space K.Okada, JASRI Redesign example : SR magnet 2017/10/10 14 power

A new feature : inheritance

2017/10/10 15

1234…

1234…

1234…

id key value

++

p

c1 c2

keys(common)

keys(unique)

keys(unique)

SACLA delivers electrons to XFEL-BLs and SR.Shot by shot switching operation

RF-common

RF-BL2RF-BL3

RF-SR

K.Okada, JASRI

Changes applied to “c1” are properly inherited to “c2”.

RF operation parameters

Page 16: Database Scheme for Unified Operation of SACLA / SPring-8...GRP2 GRP3 (id B, key, value) data store space work space K.Okada, JASRI Redesign example : SR magnet 2017/10/10 14 power

Transition plan

2017/10/10 16K.Okada, JASRI

Page 17: Database Scheme for Unified Operation of SACLA / SPring-8...GRP2 GRP3 (id B, key, value) data store space work space K.Okada, JASRI Redesign example : SR magnet 2017/10/10 14 power

Transition plan

• Since it is a running facility, the blackout period should be minimized.

• We started the transition this summer with A4SXFEL. It is independent and a relatively small system.

construction1y in 2020scontrol system

ready

2017/10/10 17K.Okada, JASRI

Page 18: Database Scheme for Unified Operation of SACLA / SPring-8...GRP2 GRP3 (id B, key, value) data store space work space K.Okada, JASRI Redesign example : SR magnet 2017/10/10 14 power

Sep

. 27

Sep

. 13

10GB

Sep

. 13

Sep

. 27

Status of A4SXFEL system

2017/10/10 18K.Okada, JASRI

log data accumulation monitor

1st stage/online

Archive

It operates well under the new data logging scheme and applications.

Cassandra 18 nodes

Page 19: Database Scheme for Unified Operation of SACLA / SPring-8...GRP2 GRP3 (id B, key, value) data store space work space K.Okada, JASRI Redesign example : SR magnet 2017/10/10 14 power

Summary• SPring-8-II upgrade in the early 2020s.

Planning SACLA/SPring-8 unified operation.

• overhaul the control system

• new database scheme is shownlog databaseparameter set• management

• 2017 summer, transition of A4SXFEL went smoothly

• working for SPring-8 SR, SACLA

• See also Dr. Fukui’s presentation on Friday (FRAPL03) for the overview of the new control system.

2017/10/10 19K.Okada, JASRI