The Design and Implementation of a Distributed Data Acquisition\Monitoring & Pro

时间:2022-04-24 06:47:44

Abstract: This report presents the design and implementation of a Distributed Data Acquisition、Monitoring and Processing System (DDAMAP)。It is assumed that operations of a factory are organized into two-levels: client machines at plant-level collect real-time raw data from sensors and measurement instrumentations and transfer them to a central processor over the Ethernets, and the central processor handlestasks of real-time data processing and monitoring. This system utilizes the computation power of Intel T2300 dual-core processor and parallel computations supported by multi-threading techniques. Our experiments show that these techniques can significantly improve the system performance and are viable solutions to real-time high-speed data processing.

Keywords:Data acquisition, rawdata, multi-core processor, multi-thread programming, distributed system, parallel computation, embedded systems.

1. Introduction

Embedded system computing presents great challenges to engineering students and professionals due to the advance of semiconductor and microprocessor technologies.This report presents the design and implementation of a Distributed Data Acquisition、Monitoring and Process System (DDAMAP), using Intel T2300 dual-core processor on Yanxiang EC5-1719CLDNA board provided by the Organization Committee of Intel Cup Undergraduate Electronic Design Contest. The system supports real-time data acquisition over 5000 nodes, connected to an Ethernet Network, allows for monitoring and fast processing of data in parallel on a central computer, using multi-thread technology.

Our experiments show that significant improvements on system performance are obtained using multi-threading and optimization techniques. The number of instructions used in a computation have been reduced to under 5% from 80~90%, which, in turn, greatly reduces the usage of CPU resource, a drop from 25%~50% to below 15%.

This report is organized as follows. Section 1 and 2 provides a general description of the overall system, including the system architecture and organizations. Section 3 and 4 are dedicated to the functions and design of the two main components of the system, Client Machines and Central Processor, respectively. Section 5 discusses the efforts made to speed up the data computation, utilizing the computation power of the dual processor. Section 6 describes the design of a database used in the system, and Section 7 reports the experimental results.

2. The System Scheme

The system we intend to design and implement is a Distributed Data Acquisition、Monitoring and Process System (DDAMAP)。We assume that the operations of a factory are organized into two-levels: plant-level and factory level, where plant-level operations manage several thousands of physical devices, such as sensors、measurement instrumentations, and the factory-level management deals with the information from the client machines only. The system organization is shown in Fig.1 , where client machines collect real-time raw data from nodes and transfer them to the central processor over the Ethernets using UDP protocols, and the central processor handles the task of real-time data processing and monitoring.

The real-time data display is accomplished by application programs we development for the system on Visual Studio 2005. Net platform under WINDOWS XP operating system. The application program is capable of processing raw data, converting them into standard ranges of industrial data measurements, then, displaying them in several forms, such as data lists, bar charts and trendline charts, supported by an Access2000 database. This system utilizes the computation power of Intel T2300 dual-core processor and parallel computations supported by multi-thread techniques, and supports real-time data acquisition and processing of several thousands of data nodes.

For demonstration purpose, the system we present here is an analogue of DDAMAP, due to the inability of providing real industrial data access in front of the Organization Committee. The organization of the analogous system of DDAMAP is given in Fig. 2, where three Pentium 4 processors emulate the functions of the physical nodes and client machines in DDAMAP, and the role of the central processor, remains unchanged.In addition, we add a 1GB DDR2 SODIMM memory, a SATA160G high-speed hard drive, Liquid Crystal Displays (LCD), a standard keyboard and a mouse to the system.

The analogue of massive raw data from fields is achieved by the use of real-time stock information from Shanghai and Shenzhen Stock Exchanges. The data is normalized for the input range of the assumed physical devices. Then, the database is initialized by the assumed legal and alarming data ranges, needed by the real-time data acquisition and processing of the system.

3Client Machines

We assume that (1) DDAMAP is a two-level system, the factory-level of central system and plant-level sub-systems; (2) there are several thousands node devices monitored by plant-level computers, which send UDP data packages to the central system every second; (3) each package contains 1024 byte of data sending over the network.

DDAMAP employs UDP protocols which have highest data transfer rate. Moreover, DDAMAP uses an identification mark in the first byte of a package, greatly reduced the time required to distinguish illegal data. [4]

We took the real-time stock information from Shanghai and Shenzhen Stock Exchange, unitarized the data for the input range of the assumed DAQ devices. The data structure of the raw data is defined as follows:

typedef struct _rawdata_{

unsigned char id[5];

unsigned char clock[14];

short value;

}rawdata.

When a client computer sends a package, the system invokes “time” function to get the current time, if a second is passed, then send a package of data.

4Central Processor

The central processor is responsible of receiving real-time data from plant-level computers; it also handles data processing and real-time graphical display of processed data. DDAMAP employs server data processing technique, i.e. creating memory-pool to avoid the consumption of CPU resources caused by successive memory access.[9]

We dedicate a 512x1024byte memory space as buffers for the usage of UDP receiving thread. In a receiving thread, it quits if a legal data mark is not identified in first byte of a package, otherwise, writes the data into the PacketQueue, the memory pool, for later processing by data process procedures. [2]

Displays of real-time data of all nodes are given in three forms: list table, bar charts and trendline chart. All data are refreshed very second. Figures 3-4 below show examples of a list table.and a bar chart.

5Process of Real-time Data and Arithmetic

The processing of real-time data is carried out on the central processor. To achieve high-speed data processing and demonstrate the computation power of the dual-core processor, several threads, a raw data pool, a dealtdata pool, and several data classes are used.The figure below depicts the relationship of the main elements of data processing above. In particular, the receive thread reads the header information of a package (MAGIC) after receiving an UDP data, if the package is legal, push it into the receive queue; Two process threads, performing identical functions and running in parallel, constantly monitor the status of the receive queue. If it is not empty, the two push the data into the rawdata pool, and convert the raw data into the input range of measurement, and put processed data into the dealtdatapool. DB save thread takes care of the data popped out from rawdata pool and saves it into the database for later use; thread Main reads data from the dealtdata pool and refreshes the data for graphical display. [6]

In the system, we assumed that one types of the raw data is temperature measurement from 1500 nodes, collected by pt100 sensors. Newton iteration algorithm is used to adjust the data since the relationship between the resistance of pt100 and temperature is non-linear. The central processor computes approximately 1000 iterations for each of the 1500 temperature data every second, utilizing the computation power of the dual-core processor. Dedicated threads are used for the data conversion as well as for Newton iteration.

The resistances of platinum resistor, R(t), with respect temperature t are:

, for -200 ≤ t ≤ 0;

,for 0 ≤ t ≤ 850;

where a= 3.90802E-3, b=-5.802E-7, and c=-4.2735E-120.

Using Newton iteration algorithm, consider

.

Rearranging we get,

.

From equation R(t), we obtain

Simplifying the equation

[3]

Let the relationship between R and t be linear. We choose the first approximation

Assuming that the stopping criteria is 0.01℃,the program iterates until is less than 0.01。

6Database Design and Implementation

The core of data acquisition system is data collection and processing, where display of historical data and trendline chart all depend on data stored. Thus, design and implementation of a database system is of great importance.

The database platform used in DDAMAP is Access 2000 under Visual Studio 6.0. The database management program supports following main functions: link to database, obtain required data, and browse, delete, modify and insert of data records. Fig.7. shows a screen-dump of a DB management window, and Fig.6. depicts the relationship between DB management program, DB and DDAMAP.

7Experiments

Experiments are conducted to demonstrate the proposed system operations and they all work well as intended. A comparative study is conducted on the performances of the system using single- and dual-core microprocessors, respectively. The remainder of this section reports findings on this issue.

We choose a computation thread named ProcessReadData, the most CPU-intensive one in the system, to perform the tests. The testing tools used are Intel VTuneTM Performance Analyzer, Intel Thread Checker, and Intel Thread Profiler. The experiments are conducted under single- and dual-thread cases. For each case, three data parameters, Counter Values、InstructionsRetired、Clockticks, are collected for comparison. Table below summarizes the results.

It can be seen that significant improvements on several key parameters, such as Processor Queue Length、Context Switches/sec、Memory available bytes and Processor Time, are obtained using dual-thread and the optimization technique. Moreover, investigation is also made by analyzing several functions, GetTvalue()、fun()、dfun(), in Class Newton of thread ProcessReadData. It shows that the number of instructions used in the computation is reduced to 5% or below from 80%~-90%, using dual-thread and optimization. This, in turn, greatly reduces the usage of CPU resource, a drop from 25%~50% to below 15%.[1]

8Acknowledgement

We would like thank Mr. Y. Ming for his work in part of the software implementation. Our thanks also go to Liu M.L, Zou L.F. and Chen X.W, undergraduate students of the dept. for their involvement in this project, and to Prof. X. Sun for her help with the English version of this paper.

REFERENCES

[1]Training material, Embedded System Design Invitational Contest, Intel Cup Undergraduate Electronic Design Contest, 2008.

[2]Stephen Prata. C++ Primer Plus, 5TH Edition.

[3]Qi Huang et al.Design of Intelligent Instrumentation based on MSP430F149, Process Automation Instrumentation, Vol. 27, No. 8, Aug. 2006,pp 26--31

[4]Shameem Akhter. Multi-Core Programming increasing performance through software multi-threading,Electrical Industry Press,2007.3.

[5]J. R. Allen and K. Kennedy. Optimizing compilers for modern architectures: A dependence-based approach. Morgan Kaufmann Publishers Inc., 2002.

[6]M. J. Garzar'an, M. Prvulovic, J. M. Llaber'ia, V. Vi~nals,L. Rauchwerger, and J. Torrellas. Tradeoffs in buffering speculative memory state for thread-level speculation in multiprocessors. ACM Transactions on Architecture Code Optimization, 2(3):247-279, 2005.

[7]L. Hammond, B. A. Hubbert, M. Siu, M. K. Prabhu, M. Chen, and K. Olukotun. The Stanford Hydra CMP. IEEE Micro, 20(2):71-84, 2000.

[8]M. H. Lipasti and J. P. Shen. Exceeding the dataflow limit via value prediction. In 29th International Symposium on Microarchitecture, pages 226-237, 1996.

[9]J. G. Steffan, C. Colohan, A. Zhai, and T. C. Mowry. The STAMPede approach to thread-level speculation. ACM Transactions on Computer Systems, 23(3):253-300, 2005.

[10]N. Vachharajani, R. Rangan, E. Raman, M. J. Bridges, G. Ottoni, and D. I. August. Speculative decoupled software pipelining. In International Conference on Parallel Architectures and Compilation Techniques, 2007.

上一篇:何日破茧成蝶? 下一篇:自测:职场“拖延症”你患了么?