简易局用程控交换机数据预处理系统
2016-08-18张帆李佳琦
张帆 李佳琦
摘要:局用程控交换机是计算机按预先编制的程序控制接续的自动交换机,全称存储程序控制交换机。该系统实现功能如下:主要对局用程控交换机的二进制磁带卸载数据,按照规定格式要求,转化成标准ASCII码格式校验并以文本形式输出,经过内存排序,提供给后续计费模块处理。结果验证了系统控制方案的可行性和正确性,并对系统算法进行分析与改进。系统具有很强的推广价值及实际工程应用前景。
关键词: 程控交换机;码制转换;数据排序 ;数据校验 ;快速排序 ;日志处理
中图分类号:U442 文献标识码:A 文章编号:1009-3044(2016)19-0249-01
Simple Conversion SPC Exchange Data Pretreatment System
ZHANG Fan, LI Jia-qi
(College of Information Engineering, ChangAn University, Xi'an 710021, China)
Abstract:Bureau of PBX is the preprogrammed computer program control in automatic exchange, the full name of stored program control switches. This system realizes the function is as follows: mainly to the public line SPC exchange of binary tape uninstall data, format requirements, in accordance with the relevant provisions into standard ASCII format validation and output in the form of text, sort through memory, for subsequent billing module processing. Results verify the correctness and feasibility of the system control scheme, and algorithm of the system were analyzed and improvement. System has a strong promotion value and the actual engineering application prospects.
Key words: bridge; SPC exchange; code system conversion; data sorting; data validation; quick sort
1 引言
程控交换机在人们日常生活中起着重要的作用。本系统主要针对二进制磁带上卸载下来的数据进行一系列预处理,从而方便后续计费模块进行分析。预处理包括将分离BCD码转换成ASCII码(码制转换),转换后的数据按照给定三种关键字进行排序(数据排序),排序后的数据针对不合理情况进行排错处理(数据校验),对之前进行的每一步工作实现日志记录(日志处理)。
2 系统实现原理
2.1 码制转换
结合实际情况,BCD码具有存储空间小,且能满足系统基本要求。所以在程控交换机系统中,数据在磁带上以BCD码格式进行存储。而实际之后由计算机进行数据处理时,ASCII码格式更为通用简便直接。则存在一个将BCD码转换成ASCII码的过程,实现方法是通过移位运算和与运算实现。
具体转换过程如下:首先得到初始存储BCD码的文件,然后根据BCD码格式的存储特点,首先通过移位运算和与运算将各个位分离出来,得到之后在和0x30做或运算,可得到相对应ASCIi码。……
