Research on data storage and reading method of EAST poloidal field power supply
-
摘要: EAST (Experimental Advanced Super-conducting Tokamak)装置的等离子体放电持续时间设计值为1000 s,目前放电长度已超过100 s。极向场电源(PF)是EAST的核心系统,有接近200路信号需要进行数据存储,每一次放电的数据量非常大,普通的数据库不能够满足长脉冲数据存储的要求。本文使用HDF5(Hierarchical Data Format)存储长脉冲数据,HDF5是可以存储不同类型的图像和数码数据的文件格式。本文采用HDF5的C接口,设计复合数据类型的数据集,为了实现实时存储与实时读取,将一次放电时间进行分割,并对数据进行分块存储和读取。通过可视化工具Hdfview查看数据集,以及Qt读取HDF5文件并进行波形显示,证明复合数据类型和分块数据集的正确性,以及分块写入与分块读取的可行性,同时对读写时间进行简单的测试,证明分块写入与分块读取方式具有高效性。Abstract: The plasma discharge duration of EAST (Experimental Advanced Super-conducting Tokamak) is designed to be 1000 s, the time has exceeded 100 s at present. As the core subsystem, poloidal field power supply(PF) has nearly 200 signals to be stored. For every discharge, the amount of data is very large, ordinary database can't meet the requirement of long pulse data storage. This paper uses HDF5 (Hierarchical Data Format) to store the long pulse data. HDF5 is a file format that can store different types of images and data. Using C interface of HDF5 to design a dataset with compound datatype, to realize real-time writing and reading, the primary discharge time is segmented and the data is written and read as chunks. Visualization tool Hdfview is used to view the dataset, and Qt is used to read HDF5 file and display waveform. It proves the correctness of compound datatype and chunk dataset, and the feasibility of writing and reading as chunks. Simple time test proves that writing and reading as chunks are efficient.
-
Key words:
- EAST poloidal field power supply /
- long pulse /
- HDF5 /
- compound datatype /
- write and read as chunks
-
表 1 HDF5部分接口统计
Table 1. Part of HDF5 interfaces
interface description functions used in this paper H5D datasets interface, create and manipulate dataset objects, and set and retrieve their constant or persistent properties. H5Dcreate2, H5Dread, H5Dwrite, H5Dopen2, H5Dget_space, H5Dset_extent, H5Dclose, H5Dget_type, H5Dget_create_plist. H5A attribute interface, create and manipulate attributes and information about attributes. H5Acreate2, H5Aopen, H5Aget_space, H5Aread, H5Awrite, H5Aclose. H5S dataspace interface, create and manipulate the dataspace in which to store the elements of a dataset. H5Screate_simple, H5Screate, H5Sget_simple_extent_dims, H5Sget_simple_extent_ndims, H5Sselect_hyperslab, H5Sclose. H5F file interface, designed to provide file-level access to HDF5 files. H5Fcreate, H5Fopen, H5Fclose. H5T datatype interface, create and manipulate the datatype which describes elements of a dataset. H5Tarray_create1, H5Tcreate, H5Tinsert, H5Tget_class, H5Tclose. H5P property list interface, manipulate property list objects in various ways, including reset property values. H5Pcreate, H5Pset_chunk, H5Pset_fill_value, H5Pget_chunk. 表 2 HDF5本机数据类型和对应C类型
Table 2. HDF5 native type and corresponding C type
HDF5 native type C type HDF5 native type C type HDF5 native type C type H5T_NATIVE_CHAR char H5T_NATIVE_ULLONG unsigned long H5T_NATIVE_LONG long H5T_NATIVE_UCHAR unsigned char H5T_NATIVE_DOUBLE double H5T_NATIVE_LLONG long long H5T_NATIVE_USHORT unsigned short H5T_NATIVE_SCHAR signed char H5T_NATIVE_FLOAT float H5T_NATIVE_UINT unsigned H5T_NATIVE_SHORT short H5T_NATIVE_LDOUBLE long double H5T_NATIVE_ULONG unsigned long H5T_NATIVE_INT int -
[1] 王广红, 何诗英, 高格, 等. EAST极向场电源本地控制器软件设计与实现[J]. 计算机测量与控制, 2018, 26(1): 157-160. https://www.cnki.com.cn/Article/CJFDTOTAL-JZCK201801039.htmWang Guanghong, He Shiying, Gao Ge, et al. Design and implementation of local controller software for EAST poloidal field power supply. Computer Measurement & Control, 2018, 26(1): 157-160 https://www.cnki.com.cn/Article/CJFDTOTAL-JZCK201801039.htm [2] 杨飞, 肖炳甲, 朱应飞, 等. EAST长脉冲放电实验实时数据系统[J]. 计算机工程, 2011, 37(4): 12-14. https://www.cnki.com.cn/Article/CJFDTOTAL-JSJC201104006.htmYang Fei, Xiao Bingjia, Zhu Yingfei, et al. Real-time data system in long pulse discharge experiments of EAST. Computer Engineering, 2011, 37(4): 12-14 https://www.cnki.com.cn/Article/CJFDTOTAL-JSJC201104006.htm [3] 张永定, 秦品健, 郑锐. MDSplus在极向场电源数据管理系统中的应用[J]. 电源技术, 2011, 358(8): 966-968. doi: 10.3969/j.issn.1002-087X.2011.08.025Zhang Yongding, Qin Pinjian, Zheng Rui. Application of MDSplus in data management of EAST poloidal field power supply. Chinese Journal of Power Source, 2011, 358(8): 966-968 doi: 10.3969/j.issn.1002-087X.2011.08.025 [4] 刘强, 肖炳甲, 王华忠, 等. 基于MDSplus的EAST长脉冲数据采集系统设计与实现[J]. 微计算机信息, 2012, 28(9): 59-61. https://www.cnki.com.cn/Article/CJFDTOTAL-WJSJ201209026.htmLiu Qiang, Xiao Bingjia, Wang Huazhong, et al. Design and implementation of EAST long-pulse data acquisition system based on MDSplus. Microcomputer Information, 2012, 28(9): 59-61 https://www.cnki.com.cn/Article/CJFDTOTAL-WJSJ201209026.htm [5] Cook N. Survey of scientific data formats[R]. Cadarache: ITER Organization, 2015. [6] The HDF Group. HDF5 user's guide[EB/OL]. https://support.hdfgroup.org/HDF5/doc1.6/UG/. [7] 童大云, 秦忠国, 魏雨露, 等. HDF5在大型有限元软件数据管理中的应用[J]. 计算机应用与软件, 2014, 31(2): 58-61. https://www.cnki.com.cn/Article/CJFDTOTAL-JYRJ201402017.htmTong Dayun, Qin Zhongguo, Wei Yulu, et al. Applying HDF5 in large-scale finite element software data management. Computer Applications and Software, 2014, 31(2): 58-61 https://www.cnki.com.cn/Article/CJFDTOTAL-JYRJ201402017.htm [8] The HDF Group. HDF5 Datatypes[EB/OL]. https://support.hdfgroup.org/HDF5/doc1.6/UG/11_Datatypes.html. [9] 杨飞. EAST实验数据系统研究[D]. 合肥: 中国科学院等离子体物理研究所, 2011.Yang Fei. Systematic research on EAST experimental data. Hefei: Institute of Plasma Physics, Chinese Academy of Sciences, 2011 [10] The HDF Group. HDFVIEW[EB/OL]. https://support.hdfgroup.org/products/java/hdfview/.