sergejus zabinskis projects overview: 1985 - 2005

98
SERGEJUS ZABINSKIS Projects overview: 1985 - 2005

Upload: hasad-horton

Post on 01-Jan-2016

15 views

Category:

Documents


0 download

DESCRIPTION

SERGEJUS ZABINSKIS Projects overview: 1985 - 2005. INTRODUCTION. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: SERGEJUS ZABINSKIS Projects overview: 1985 - 2005

SERGEJUS ZABINSKISProjects overview: 1985 - 2005

Page 2: SERGEJUS ZABINSKIS Projects overview: 1985 - 2005

INTRODUCTION

I graduated Mathematics Faculty of Vilnius State University in 1985. As almost all students at that time I gained fundamental mathematics background from algebra and calculus to functional analysis and topology. Also I gained a good background in numerical computational methods that helped me much in my work.All my work experience is very close to computer programming. I hope that this slide show that contains some of the projects where I have been participating as a memberof team or alone will give you additional information about me.

Page 3: SERGEJUS ZABINSKIS Projects overview: 1985 - 2005

IMAGE PROCESSING

Years: 1990-1992

Page 4: SERGEJUS ZABINSKIS Projects overview: 1985 - 2005

Image processing algorithms and techniques

In the beginning of 1990s I was a member of an image processing initiative group, the objective of which was to acquire information on image processing methods and its applications. Here I got to know the main image processing techniques such as:

Fast linear box filtering Fast median filtering based on T.Huang algorithm Histogram equalization Local histogram equalization Image binarization methods Binary image skeletonization Contour extraction Contour tracing Component labeling Hough transformationThis experience helped me much in other projects.

Page 5: SERGEJUS ZABINSKIS Projects overview: 1985 - 2005

Example of image preprocessing techniques

Original halftone image

Extracted and thinned contours of original image.

Page 6: SERGEJUS ZABINSKIS Projects overview: 1985 - 2005

Example of image preprocessing techniques

Original halftone image Preprocessed image (histogram equalization procedure applied)

Page 7: SERGEJUS ZABINSKIS Projects overview: 1985 - 2005

DRIVING THEORY TEST PROGRAM

Company: ALS

Years: 1994

Page 8: SERGEJUS ZABINSKIS Projects overview: 1985 - 2005

Geometric modeling language

In 1994 I was hired by company “ALS” to develop driving theory test program. The main problem was to prepare program questionnaire that reached 500 questions, most of them contained graphics. To do that I invented a simple programming language to deal with 2D graphics objects such as lines, rectangles, polygons, circles, ellipses, etcLanguage also has the set of transformations - reflections, rotations, translations, scaling transformation. With the help of this language it is possible to encode complex enough graphic object such as road signs and symbolic situations on the road. I implemented language parser that converted source code to byte-code and engine to execute byte-code. Important to note that this approach let me do very compact questionnaire – it was very significant in the 1994.

Page 9: SERGEJUS ZABINSKIS Projects overview: 1985 - 2005

Geometric primitives

Since project was implemented with Turbo C compiler, all graphic object directly correspond to graphics objects that were supported by BGI graphics:

arccircleellipsefillellipsefillpolylineouttextouttextxypiesliceputpixelrectanglesectorsetcolorsetfillpatternsetfillstylesetlinestyle

Page 10: SERGEJUS ZABINSKIS Projects overview: 1985 - 2005

Geometric primitives

Geometric primitive Comment

PIXEL(X1,Y1) Point

SEGMENT(X1,Y1,X2,Y2) Segment

POLYLINE(X1,Y1,…,Xn,Yn) Sequence of connected segments

POLYGON(X1,Y1,…,Xn,Yn) Closed sequence of connected segments

RECTANGLE(X1,Y1,X2,Y2) Rectangle

FRECT(X1,Y1,X2,Y2) Filled rectangle

TRIANGLE(X1,Y1,X2,Y2,

X3,Y3)

Triangle

Page 11: SERGEJUS ZABINSKIS Projects overview: 1985 - 2005

Geometric primitives (continued)

Geometric primitive Comment

CIRCLE(Xc,Yc, R) Circle

FILLCIRCLE(Xc,Yc, R) Filled circle

ELLIPSE(Xc,Yc, Rx, Ry) Ellipse

FILLELLIPSE (Xc,Yc, Rx, Ry) Filled ellipse

ARC(Xc,Yc, Fi1, Fi2, R) Arc

PIESLICE(Xc,Yc, Fi1, Fi2, R) Pie slice

SECTOR(Xc,Yc,Fi1,Fi2,Rx,Ry) Sector

Page 12: SERGEJUS ZABINSKIS Projects overview: 1985 - 2005

Geometric primitive Comment

OUTTEXTXY(X,Y,Txt) Display text line

OUTTEXTFILE(X,Y,Filname) Display text from file

TEXTRECT(X1,Y1,X2,Y2,Txt) Display text in rectangle

TEXTCENTER(Y,Text) Display horizontally centered text line.

Geometric primitives (continued)

Page 13: SERGEJUS ZABINSKIS Projects overview: 1985 - 2005

Graphical settings

Setting Comment

COLOR(color) Set current pen color

FILLSTYLE(style,color) Set fill pattern and color

LINESTYLE(style,width) Set style of lines and width

FONT(fontname) Set current font

Page 14: SERGEJUS ZABINSKIS Projects overview: 1985 - 2005

Geometric transformations

Transformation Comment

TRANSLATE(DX,DY) Translation operation: (X,Y) (X+DX,Y+DY)

SCALE(COEFF) Scaling. Is performed in 4 steps:1. Computation of geometric object

centre of mass (Xc,Yc)2. Translation of object to (0,0). In other

words we do TRANSLATE(-Xc,-Yc). So after that object’s center of mass is moved to (0,0).

3. For each point of object (X,Y) perform multiplication:

(X,Y) (X*COEFF,Y*COEFF)4. Move object to the old place:

TRANSLATE(Xc,Yc)

STRETCHX(COEFF) Scaling that affects only X-coordinate

STRETCHY(COEFF) Scaling that affects only Y-coordinate

Page 15: SERGEJUS ZABINSKIS Projects overview: 1985 - 2005

Geometric transformations

Transformation Comment

REFLECTX() (X,Y) (X, -Y)

REFLECTY() (X,Y) (-X, Y)

ROTATE(ANGLE) Rotation:FI=(ANGLE/180)*PI(X,Y) (X*COS(FI)-Y*SIN(FI), X*SIN(FI)+Y*COS(FI))

TRANSPON() (X,Y) (Y, X)

Page 16: SERGEJUS ZABINSKIS Projects overview: 1985 - 2005

Examples of language constructions

COLOR(WHITE)TRANSLATE (45,30) { REFLECTY() { ROTATE (45) POLYGON (7,-15,70,-15,-70,-40,-70,0,-140,40,-70,15,-70,15,70) }}

This code snippet means that color of pen is set to white. After that we: rotate polygon to 45 degrees; apply reflection transformation for rotated polygon; finally translate it.

Page 17: SERGEJUS ZABINSKIS Projects overview: 1985 - 2005

Example of real graphic object implemented using geometric modeling language

Page 18: SERGEJUS ZABINSKIS Projects overview: 1985 - 2005

Source code (1)

#include "TRIS.PIC"COLOR (BLACK)FILLSTYLE (SOLID_FILL,BLACK)//// BUDKA//TRANSLATE (45,2) { FRECT (-20,-30,20,30) // WINDOW COLOR (WHITE) FILLSTYLE (SOLID_FILL,WHITE) TRANSLATE (0,-10) FRECT (-10,-10,10,10) COLOR (BLACK) FILLSTYLE (SOLID_FILL,BLACK) // KRYSHA TRANSLATE (2,-25) FRECT (-22,-5,22,5)}// KOTELTRANSLATE (-30,13) { POLYGON (7,-50,0,50,0,50,-20,-40,-20,-45,-15,-48,-10,-49,-5) REFLECTX () POLYGON (7,-50,0,50,0,50,-20,-40,-20,-45,-15,-48,-10,-49,-5)}

Page 19: SERGEJUS ZABINSKIS Projects overview: 1985 - 2005

// ChimneyTRANSLATE (-55,-17) FRECT (-7,-10,7,10)// FUNDAMENTTRANSLATE (-5,45) FRECT (-72,-10,72,10)// BUMPERTRANSLATE (-75,50) FRECT (-10,-10,10,10)// WheelsTRANSLATE (-50,55) { COLOR (BLACK) FILLSTYLE (SOLID_FILL,BLACK) FILLCIRCLE (0,0,15) COLOR(WHITE) FILLSTYLE (SOLID_FILL,WHITE) FILLCIRCLE (0,0,12)}TRANSLATE (-10,55) { COLOR (BLACK) FILLSTYLE (SOLID_FILL,BLACK) FILLCIRCLE (0,0,15) COLOR(WHITE) FILLSTYLE (SOLID_FILL,WHITE) FILLCIRCLE (0,0,12)}

Source code (2)

Page 20: SERGEJUS ZABINSKIS Projects overview: 1985 - 2005

Source code (3)TRANSLATE (30,55) { COLOR (BLACK) FILLSTYLE (SOLID_FILL,BLACK) FILLCIRCLE (0,0,15) COLOR(WHITE) FILLSTYLE (SOLID_FILL,WHITE) FILLCIRCLE (0,0,12)}

// DISKSTRANSLATE (-50,55) { COLOR (BLACK) FILLSTYLE (SOLID_FILL,BLACK) FILLCIRCLE (0,0,5) COLOR (WHITE) FILLSTYLE (SOLID_FILL,WHITE) FILLCIRCLE (0,0,2)}

TRANSLATE (-10,55) { COLOR (BLACK) FILLSTYLE (SOLID_FILL,BLACK) FILLCIRCLE (0,0,5) COLOR (WHITE) FILLSTYLE (SOLID_FILL,WHITE) FILLCIRCLE (0,0,2)}

Page 21: SERGEJUS ZABINSKIS Projects overview: 1985 - 2005

//// SMOKE//COLOR (BLACK)FILLSTYLE (SOLID_FILL,BLACK)TRANSLATE (0,-115) FILLCIRCLE (0,0,12)TRANSLATE (0,-90) FILLCIRCLE (0,0,20)TRANSLATE (-20,-70) FILLCIRCLE (0,0,16)TRANSLATE (-55,-30) PIESLICE (0,0,0,180,6)TRANSLATE (-50,-40) FILLCIRCLE (0,0,6)TRANSLATE (-40,-45 ) FILLCIRCLE (0,0,8)TRANSLATE (-30,-50 ) FILLCIRCLE (0,0,10)TRANSLATE (-25,-55) FILLCIRCLE (0,0,10)TRANSLATE (-30,-60 ) FILLCIRCLE (0,0,10)

Source code (4)

Page 22: SERGEJUS ZABINSKIS Projects overview: 1985 - 2005

Example of graphic object implemented using geometric modeling language

Page 23: SERGEJUS ZABINSKIS Projects overview: 1985 - 2005

SIGNAL MEASUREMENT SYSTEM BASED ON RK2-01

Company: INMATSIS

Years: 1997

Page 24: SERGEJUS ZABINSKIS Projects overview: 1985 - 2005

Acquired signal marker measurement

Acquired signal may be measured by markers, saved to database and printed.

Page 25: SERGEJUS ZABINSKIS Projects overview: 1985 - 2005

Main parameters summary for acquired signal

Also program can estimate main parameters: peak-to-peak amplitude, amplitude, period, rise/fall times, impulse duration.

Page 26: SERGEJUS ZABINSKIS Projects overview: 1985 - 2005

Signal database browser

Each signal may be retrieved from database to continue its investigation, exported to text file, printed and removed from database.

Page 27: SERGEJUS ZABINSKIS Projects overview: 1985 - 2005

COMPENSATION OF WIDE-ANGLE OBJECTIVE OPTICAL DISTORTIONS

Company: INMATSIS

Years: 1998

Page 28: SERGEJUS ZABINSKIS Projects overview: 1985 - 2005

Calibration transformation for wide-angle objective

This work was performed as part of signal registration research project. We used camera to get image directly from the screen of analogue measurement device. Here I used measurement grid images (graticule) to create calibration transformation to compensate wide-angle objective optical distortions.

Page 29: SERGEJUS ZABINSKIS Projects overview: 1985 - 2005

Original image

Illustration of calibration transformation

Transformed image with compensated fish-eye objective distortions

Page 30: SERGEJUS ZABINSKIS Projects overview: 1985 - 2005

Original imageTransformed image with compensated objective distortions.

Illustration of calibration transformation

Page 31: SERGEJUS ZABINSKIS Projects overview: 1985 - 2005

NUMERICAL ALGORITHMS APPLICATIONS

Company: INMATSIS

Years: 1996-2000

Page 32: SERGEJUS ZABINSKIS Projects overview: 1985 - 2005

Illustration of Savitzky-Golay smoothing filter

Page 33: SERGEJUS ZABINSKIS Projects overview: 1985 - 2005

Illustration of locally weighted regression filter

Page 34: SERGEJUS ZABINSKIS Projects overview: 1985 - 2005

HIGH SPEED NONREPETITIVE SIGNALS REGISTRATION SYSTEM K2-74

Company: INMATSIS

Years: 2001-2002

Page 35: SERGEJUS ZABINSKIS Projects overview: 1985 - 2005

K2-74 view

K2-74 is the measurement system for registration of nonrepetitive and periodic signals in nanosecond and picosecond range. The main parts of system:

Analogue measurement device;Camera;Framegrabber;PC (interfaces: IEEE-488 or RS-232).

Page 36: SERGEJUS ZABINSKIS Projects overview: 1985 - 2005

Screenshot of the device control page of K2-74

Page 37: SERGEJUS ZABINSKIS Projects overview: 1985 - 2005

Extracted signal parameters and marker measurement page.

Page 38: SERGEJUS ZABINSKIS Projects overview: 1985 - 2005

Signal extraction schemeHALFTONE IMAGEACQUIRED FROMOSCILLOSCOPE

SCREEN

IMAGE PREPROCESSING

SIGNAL EXTRACTION FROMPREPROCESSED IMAGE

CALIBRATIONTRANSFORMATION

RESULT:ELECTRICAL

SIGNAL

Page 39: SERGEJUS ZABINSKIS Projects overview: 1985 - 2005

Image preprocessing (why needed)

We get noisy images while catching high speed signals. You can see many speckles on the image.

Page 40: SERGEJUS ZABINSKIS Projects overview: 1985 - 2005

Image preprocessing (median filter)

To eliminate speckles we use median filter. In this program we implemented fast median filter. It processes images in real time.

Page 41: SERGEJUS ZABINSKIS Projects overview: 1985 - 2005

Image preprocessing (speckles suppression)

Sometimes speckles always present on the screen. It may be caused by tube defect. In this case we simply put “black” circle over the speckle.

Page 42: SERGEJUS ZABINSKIS Projects overview: 1985 - 2005

Image preprocessing (Region Of Interest)

Sometimes it is useful to process only part of the screen. We call it region of interest. It can fasten image processing and as we see here it can leave speckles outside.

Page 43: SERGEJUS ZABINSKIS Projects overview: 1985 - 2005

Image preprocessing (image averaging for repetitive signals)

Single image Averaging along the sequence of 10 images

Page 44: SERGEJUS ZABINSKIS Projects overview: 1985 - 2005

How we extract signal from image

Page 45: SERGEJUS ZABINSKIS Projects overview: 1985 - 2005

Accurate signal extraction

We used two ways to extract signal points from raster image:- mass center method- pixel distribution approximation using Gaussian function.

The first way is very fast but not accurate. And the second way is very accurate but needs more CPU time (nonlinear optimization problem is solved for each point of signal trace section).

Here is the illustration of pixel distribution peak estimation using the second way.

Page 46: SERGEJUS ZABINSKIS Projects overview: 1985 - 2005

Comparison of two ways of signal extraction

Blue signal is extracted using mass center methodGreen signal is extracted using Gaussian approximation method

Page 47: SERGEJUS ZABINSKIS Projects overview: 1985 - 2005

Calibration grid

Example of calibration grid that is used to build calibration transformation for time/div= 10 ns.

Page 48: SERGEJUS ZABINSKIS Projects overview: 1985 - 2005

Example of signal trace

Page 49: SERGEJUS ZABINSKIS Projects overview: 1985 - 2005

Extracted signal

Page 50: SERGEJUS ZABINSKIS Projects overview: 1985 - 2005

Example of signal trace

Page 51: SERGEJUS ZABINSKIS Projects overview: 1985 - 2005

Extracted signal

Page 52: SERGEJUS ZABINSKIS Projects overview: 1985 - 2005

Specialized programming language for waveform generation.

Company: INMATSIS

Years: 2000-2001

Page 53: SERGEJUS ZABINSKIS Projects overview: 1985 - 2005

In 2000 our company produced measurement device with arbitrary waveform generation function. Waveform generation was performed on computer and after that waveform samples were downloaded to device.In order to simplify waveform generation I designed simple waveform generation language, its parser and interpreter.

Waveform generation language history

Page 54: SERGEJUS ZABINSKIS Projects overview: 1985 - 2005

Waveform model structure

model model_name(comma-separated parameter list)[parametersParameters descriptions][exceptionsExceptions descriptions][varLocal variables declarations]programFunction body

Page 55: SERGEJUS ZABINSKIS Projects overview: 1985 - 2005

Simple harmonic signal model

model SIMPLE_HARMONIC(DC, AMPL, FREQ, PHASE)parametersDC caption “DC” unit “V” of real domain [-5,5] default 0;AMPL caption “Amplitude” unit “V” of real domain [0,5] default 1;FREQ caption “Frequency” unit “Hz” of real domain [1, 19999999] default 1;PHASE caption “Phase” of real domain [0,360] default 0;exceptionswhen abs(DC+AMPL) > 5 message “Signal value is out of range!”programreturn DC+AMPL*sin(2*pi*FREQ*t+(PHASE*pi)/180);

Page 56: SERGEJUS ZABINSKIS Projects overview: 1985 - 2005

model TELEVISION1(T0, AMPL, TAU, FREQ)parametersT0 caption “WIDTH” unit “V” of real domain [1,20] default 10;AMPL caption “Amplitude” unit “V” of real domain [0,10] default 2;FREQ caption “Frequency” unit “Hz” of real domain [1,10] default 0.8;TAU caption “Tau” of real domain [1,20] default 10var result, y of real;programif abs(t-T0) <= TAU/2 then y=AMPL*sqr(cos(pi*(t-T0)/TAU)) result=y*(1+sin(2*pi*FREQ*t))else result= 0endifreturn result

More complex waveform example

Page 57: SERGEJUS ZABINSKIS Projects overview: 1985 - 2005

High Frequency Oscilloscope K2-76 software

Company: INMATSIS

Years: 2001

Page 58: SERGEJUS ZABINSKIS Projects overview: 1985 - 2005

K2-76 view

Page 59: SERGEJUS ZABINSKIS Projects overview: 1985 - 2005

In 2001 I came back to INMATSIS company and became small software developers team leader (4 programmers including me). This year was very fruitful for our company and me. In summer 2001 we started development of stroboscopic oscilloscope K2-76 software. Here I would like to accent that K2-76 had no manual controls – only power button.Before K2-76 appeared, every device designed and manufactured in INMATSIS was fitted for manual measurements and additionally had interface with PC. In contrary – K2-76 was fully controlled from PC.

Some history

Page 60: SERGEJUS ZABINSKIS Projects overview: 1985 - 2005

Virtual measurement device features

K2-76 was system that we (in INMATSIS) call "virtual measurement device". “Virtual measurement device" means electronic measurement device and personal computer equipped with GUI application that lets user to control electronic measurement device, perform marker and automatic measurements of acquired signals, store signals in database, store device settings in database, etc.

Page 61: SERGEJUS ZABINSKIS Projects overview: 1985 - 2005

I would like to say little bit more about device setting saving in database. For example, engineer prepares device for complex measurement. To do that engineer sets many parameters on device what takes some time. Doing the same action many times becomes really boring. So, if these actions will be repeated many times engineer may simply record all parameter settings he does now in order to reproduce the whole sequence of settings later from device settings database. Saving the sequence to database engineer may assign some name to this sequence that will immediately say him what kind of action it contains.

Device settings database

Page 62: SERGEJUS ZABINSKIS Projects overview: 1985 - 2005

Screenshot

Multithreading allows user to do few jobs in one time: observe the samesignal in time and frequency domains.

Page 63: SERGEJUS ZABINSKIS Projects overview: 1985 - 2005

Screenshot

Here you can see live rectangular signal of positive polarity and idealrectangular signal that approximateit. Also here we have the window with parameters of live signal and window with histogram of live signal.

Page 64: SERGEJUS ZABINSKIS Projects overview: 1985 - 2005

RESTAURANT SERVICE SOFTWARE

Company: CONTRACT

Years: 1998-2000

Page 65: SERGEJUS ZABINSKIS Projects overview: 1985 - 2005

For almost two years I worked as an independent Consultant in the restaurant sector. I worked for “Pizza-Jazz” company that run several restaurants and bars in Kaunas. A computer system for the automation of the waiter service. The system integrates PCs, ECRs (electronic cash registers) and kitchen printers and comprises three modules: the Waiter Console, the ECR-Server (program that provides ECR sharing between several Waiter Consoles) and the Print-Server (program that provides kitchen printers sharing between Waiter Consoles).

System overview

Page 66: SERGEJUS ZABINSKIS Projects overview: 1985 - 2005

General scheme of restaurant system

Page 67: SERGEJUS ZABINSKIS Projects overview: 1985 - 2005

The Waiter Console program, developed in CA-Clipper, facilitated the uploading/downloading of menus file to/from ECRs (Electronic Cash Register), created new orders, maintained existing orders, appended/edited/deleted items to/from orders, sent information to corresponding kitchen printers and closed orders via automatic sale registration on ECRs. Closed orders with the history of their updates were stored in an archive database.

Waiter console

Page 68: SERGEJUS ZABINSKIS Projects overview: 1985 - 2005

The list of dishes uploaded to ECR

Page 69: SERGEJUS ZABINSKIS Projects overview: 1985 - 2005

System to store/retrieve and generate company customers payment and information documents

Company: OMNITEL

Years: 2002-2003

Page 70: SERGEJUS ZABINSKIS Projects overview: 1985 - 2005

Our company customers may receive about ten various payment or information document. The first project that I made in OMNITEL was design and implementation of information system to store/retrieve all documents that customers receive.

System contains three main parts:- document import program (used to import payment and other documents that are generated by our billing system to Oracle database). Documents (XML) are compressed and stored as blob fields;- program to design document templates that are used to generate documents in PDF format;- high performance stand-alone multithreaded web-service to retrieve documents and generate document representations (in PDF, XML or TXT formats);- various service programs;

The main part of system is stand-alone multithreaded web-service that run on IA64 Server under HP-UX (earlier on AlphaServer under HP Tru64Unix).

System overview

Page 71: SERGEJUS ZABINSKIS Projects overview: 1985 - 2005

Who are the users? 

Omnitel Portal – www.omni.lt

Customers get access to all payment documents for 24 hours each day.

Customer service offices

Customers may get their payment documents in customer service centers.

Automatic invoice delivery system

Customers may receive their payment documents via e-mail

Company staff Company staff has access to payment documents to solve customers problems.

Page 72: SERGEJUS ZABINSKIS Projects overview: 1985 - 2005

Workflow

subscriber

www.omni.lt

SERVER (HP-UX 11)

subscriber

subscriber

query

Customer service offices(Vilnius,Kaunas,….)

Company staff

Subscribers

Page 73: SERGEJUS ZABINSKIS Projects overview: 1985 - 2005

The main parts of system is stand-alone multithreaded web-service that run on machine equipped with 2 IA64 under HP-UX (earlier on AlphaServer under HP Tru64Unix). It was developed using C++ compiler (the first version for HP Tru64 – DEC C++ compiler and the second for HP-UX – using aCC), Other libraries and tools used are as follows:

Implementation details

  

pthreads POSIX threads library

gSOAP Free web-service development tool (developed by R.van Engelen)

Xerces-C Free XML processing library for C++

Zlib Free compression library for C

OTL(Oracle tempate library)

Free C++ wrapper around Oracle Call Interface (developed by S.Kuchin)

Page 74: SERGEJUS ZABINSKIS Projects overview: 1985 - 2005

Web-service methods

 

Client Method Server

Client sends an XML

NewQuery Returns ID

Polling loop GetInfo Returns current status of query

Client downloads the set of generated documents

GetResult Sends file or part of file.

Client closes query

CloseQuery Removes query context

 

Page 75: SERGEJUS ZABINSKIS Projects overview: 1985 - 2005

Typical scenario

NewQuery(“<billquery>…. </billquery>”)

Client

ID

Server

GetInfo(ID)

STATUS=Executing

………………………………….

GetInfo(ID)

STATUS=Completed

GetResult(ID)

PDF or TXT or XML

CloseQuery(ID)

STATUS=OK

PO

LLING

LOO

PD

OW

NLO

AD

ING

RE

SU

LT

Page 76: SERGEJUS ZABINSKIS Projects overview: 1985 - 2005

Internal structure of web-service

Document generation web-service is multithreaded application.There are several types of threads performing document generation job:Dispatcher – the most important thread of application. It coordinates the work of several pools of threads;Listener – single thread that listens on socket for incoming connections;SOAP serving thread – performs all work concerning SOAP message decoding, method execution and SOAP response sending to caller.Logging thread – provides query logging in Oracle table. Query parser – thread that parses query and creates query context;Data extractor – thread that retrieves documents from Oracle tablesand prepares XML files for document generation in PDF or TXT;PDF generator – thread that runs PDF generation executable;TXT generator – thread that runs TXT generation executable;XML generator – thread that performs generation of XML document;Only dispatcher and listener threads are single because of their nature, other threads are grouped to pools of threads doing the same job.

Page 77: SERGEJUS ZABINSKIS Projects overview: 1985 - 2005

<!-- DOCUMENT GENERATION SERVER CONFIGURATION FILE --><configuration> <common> <params> <param id="port" type="N">12173</param> <param id="backlog" type="N">200</param> <param id="output_directory" type="C">/usr/users/dgwebsvc1/output</param> <param id="temp_directory" type="C">/usr/users/dgwebsvc1/tmp</param> <param id="log_threads" type="N">3</param> <param id="qry_threads" type="N">2</param> <param id="db_threads" type="N">3</param> <param id="pdf_threads" type="N">4</param> <param id="txt_threads" type="N">2</param> <param id=“xml_threads" type="N">2</param> <param id="queue_capacity" type="N">1000</param> <param id="forminfo_refresh_interval" type="N">21600</param> <param id="formloader_refresh_interval" type="N">21600</param> <param id="txtman_refresh_interval" type="N">21600</param> <param id="watchdog_interval" type="N">100</param> <param id="query_expire_timeout" type="N">600</param> </params> </common> <generators> <generator filetype="pdf"> <params> <param id="pathname" type="C">/usr/local/bin/omnigen</param> <param id="form_directory" type="C">/usr/users/dgwebsvc1/forms</param> </params> </generator> <generator filetype="txt"> <params> <param id="pathname" type="C">/usr/txtgen/txtgen</param> </params> </generator> <generator filetype=“xml"> <params> <param id="pathname" type="C">/usrxmlgen/xmlgen</param> </params> </generator> </generators></configuration>

Configuration file

Page 78: SERGEJUS ZABINSKIS Projects overview: 1985 - 2005

Server internals (new query)

DISPATCHERAcceptor [1] Socket number fd

[2] Socket number fd

[3] char[] query

Client

NewQuery(“<billquery> …")

[4] char[] query

[5] Query context

[7] Query context

[8] Extracteddocument(s)

in XML

[10] PDF documentis generated

[9] XML document

Pool of SOAP servingthreads Query parsing threads

Pool of PDF generators

Pool of data extractors

Web-service

ID

IDn

...ID

3ID

2ID

1 List

of q

uerie

s be

ing

proc

esse

d

[6] put query to the list

[11] query is completed

Client sends new query to server and receivesit’s ID. At the same time query processing loopis initiated on server side.

Page 79: SERGEJUS ZABINSKIS Projects overview: 1985 - 2005

Server internals (get info)

DISPATCHERAcceptor [1] Socket number fd

[2] Socket number fd

[3] query ID

Client

GetInfo(ID)

Pool of SOAP servingthreads Query parsing threads

Pool of PDF generators

Pool of data extractors

Web-service

IDn

...ID

3ID

2ID

1 List

of q

uerie

s be

ing

proc

esse

d

[7] query is completed

[6] query is completed

[4] Is query completed?

[5] Yes

Page 80: SERGEJUS ZABINSKIS Projects overview: 1985 - 2005

Queries

Server accepts two types of queries:

INFORMATIONAL 

to know what documents were generated 

DOCUMENT GENERATION  

to retrieve documents’ content from database and generate PDF, TEXT or XML file 

Queries are presented to server as XML strings.

Page 81: SERGEJUS ZABINSKIS Projects overview: 1985 - 2005

<?xml version="1.0" encoding="ISO-8859-1"?><infoquery><customer date="20050216" id=“400920"> <params> <param name="format" value="XML"/> <param name="succeeded" value="ANY"/> <param name="docname" value="IQC4EB203A8C2256EC2003F026A"/> </params> <info selection="ALL"/></customer></infoquery>

Example of informational query

The result of this query will give the set of documents for customerNr. 400920 issued at 2005-February-16.

Page 82: SERGEJUS ZABINSKIS Projects overview: 1985 - 2005

Example of document generation query

This query will generate PDF with customer payment receipt, consolidated invoice and detailed call list for two subscribers.

<billquery requestor="Sergejus Zabinskis"><customer date="20060216" id="400920">

<params><param name="format" value="PDF"/><param name="docname" value=“my doc"/><param name="succeeded" value="ALL"/>

</params><forms>

<form type="RECEIPT"/><form type="CONSOLIDATED"/><form type="DETAILS">

<subscriber id="69804222"/> <subscriber id="69838609"/>

</form></forms>

</customer></billquery>

Page 83: SERGEJUS ZABINSKIS Projects overview: 1985 - 2005

Example of documents generated by web-service - receipt

Page 84: SERGEJUS ZABINSKIS Projects overview: 1985 - 2005

Example of documents generated by web-service – consolidated invoice

Page 85: SERGEJUS ZABINSKIS Projects overview: 1985 - 2005

Example of documents generated by web-service – detail call list

Page 86: SERGEJUS ZABINSKIS Projects overview: 1985 - 2005

Billing system gateway server

Company: OMNITEL

Years: 2004-2005

Page 87: SERGEJUS ZABINSKIS Projects overview: 1985 - 2005

Some History

OMNITEL uses it’s own made billing system. It was developed with GEMBASE 4GL and runs in OpenVMS environment. Billing system contains thousands of tables that store information used by many software systems and tens thousand lines of GEMBASE code. Many of applications that are used in company intensively use billing system information. So we need a reliable way of communication between system and their clients.Earlier clients communicated with billing system using archaic file-oriented interface using Lotus Notes as document flow carrier. Technically it was implemented very simple - each request for billing system was stored in separate file. Separate processes are created and GEMBASE image are loaded for each request file what causes great system resources waste. Also, since file processing is started from scheduler – response times are unacceptable.

Simplified scheme of such communication is illustrated by next slide figure.

Page 88: SERGEJUS ZABINSKIS Projects overview: 1985 - 2005

“Old style” billing system interface

Query1

Query2

Query3

Query4

Result1

Result2

Result3

Result4

GEMBASE process Nr.1

GEMBASE process Nr.2

GEMBASE process Nr.3

GEMBASE process Nr.4

GEMBASE process is created for each

query

Output directoryInput directory

Page 89: SERGEJUS ZABINSKIS Projects overview: 1985 - 2005

New way of billing system integration

Considerable step in the way of billing system integration into company information system was done introducing middleware server standing on the top on billing system.

BILLING SYSTEM

BILLING SYSTEM GATEWAY SERVER

CLIENT CLIENT CLIENT

Page 90: SERGEJUS ZABINSKIS Projects overview: 1985 - 2005

Server overviewBilling system gateway server has two major parts:

• Standalone multithreaded web-service as front-end;• Pool of GEMBASE processes directly working with billing system as back-end;

GEMBASE processes talk with server through shared memory using special communication library implemented in C. GEMBASE processes once created stay resident in memory and are awakened by server only when new query appears. Since there is no need to create new process for each query system resources are used in very efficient way.

GEMBASE PROCESS

SERVER PROCESS

COMMUNICATION ROUTINE

Page 91: SERGEJUS ZABINSKIS Projects overview: 1985 - 2005

Server and pool of GEMBASE processes

Query1

Query2

Query3

Query4

GEMBASE process Nr.1

GEMBASE process Nr.2

GEMBASE process Nr.3

GEMBASE process Nr.4

SERVER (DISPATCHER)

Page 92: SERGEJUS ZABINSKIS Projects overview: 1985 - 2005

Anatomy of server and billing system interaction

SERVER PROCESS

1

2

3

4

5

6

1

2

3

4

5

6

C Communication

function

Service A

Service C

Service Z

Service Y

Shared memory area

Service B

Query result(s)

3rd GEMBASE PROCESS

Que

ry d

ata

for 3

rd pro

cess Query data for 3 rd process

Service A

Service B

Service C

Service Z

C Communication function

Input queue for 3rd GEMBASE process. Process is waiting for

data in queue

Output queue for 3rd GEMBASE process. Server is notified about data delivery using event. (AST

handler is called)

Communication function gets data

from input work queue and delivers it to

GEMBASE process

Communication function places query

result (record or recordset) to output

queue

Do service stuff

……

..

Query result(s)

Service Y

Switch(Service)

Select oval andtype. Control handles change width & height

of oval.

Each GEMBASE process ha it’s own memory region for

input data

Each GEMBASE process ha it’s own

memory region to put results.

Service dispatcher reads query data from input queue, retrieves service name from query and calls appropriate

service

Service Dispatcher procedure

Page 93: SERGEJUS ZABINSKIS Projects overview: 1985 - 2005

Server states diagram

In order to make server more flexible in various situations it supports states.

STARTINGSHUTTING

DOWN

NOACCESS

READONLY FULL ACCESS

State that server keeps between application start and NOACCESS state

All databases are closed. All queries are rejected with

appropriate status code

State that server acquires immediately after receiving

“Shut Down” command

Databases are opened. Only queries that require read-only access are served. “Update”

queries are rejected with appropriate status code

No limitations - all queries are served

Page 94: SERGEJUS ZABINSKIS Projects overview: 1985 - 2005

ServicesThe main function of billing gateway server is to dispatch query to right GEMBASE procedure. It means that server must call right procedure, supply it with parameters embedded in query body, “wait” until procedure is doing its job and after that acquire result. GEMBASE procedure that performs query specific job is called service. But service is not only piece of GEMBASE code. Server needs more information about procedure it will communicate with. For that purpose service specification file is provided. Service specification must contain information about GEMBASE procedure to call (name of procedure) and information about input and output parameters (how to extract parameters from query and how to present result understandable to caller). Service specification file is XML file that has :

Root element that contains service name and it’s mode (Read-only or Update) Parameters specification. Contains input and output parameter declarations.

Parameters specification part is the most important part of service specification, because it must be able to describe complex data structure that may be used in input and output parameters.

Page 95: SERGEJUS ZABINSKIS Projects overview: 1985 - 2005

Service specification file

<service action="MultiTopUpAccount" mode="Update">  <input>    <param>      <array name="Subscribers">        <elem name="Subscriber" type="structure">          <elem name="ID" type="integer"/>          <elem name="Amount" type="integer"/>        </elem>      </array>    </param>  </input>  <output>    <param>      <array name="Results">        <elem name="Result" type="structure">          <elem name="ID" type="integer"/>          <elem name="errorCode" type="integer"/>          <elem name="errorMessage" type="string"/>        </elem>      </array>    </param>  </output></service>

In billing system gateway server each service is described by specification file – kind of XML that contains descriptions of service input and output parameters. Kind of description used is very flexible and lets model very sophisticated data structures: record, arrays of records, recursive arrays and so on.

Example of hypothetical service named “MultiTopUpAccount”, query and sample output.

<MultiTopUpAccount>  <Subscribers>    <Subscriber>      <ID>123456</ID>      <Amount>100</Amount>    </Subscriber>    <Subscriber>      <ID>234567</ID>      <Amount>200</Amount>    </Subscriber>    <Subscriber>      <ID>345678</ID>      <Amount>300</Amount>    </Subscriber>  </Subscribers></MultiTopUpAccount>

<MultiTopUpAccount>  <Results>    <Result>      <ID>123456</ID>      <errorCode>0</errorCode>      <errorMessage>OK</errorMessage>    </Result>    <Result>      <ID>234567</ID>      <errorCode>2</errorCode>      <errorMessage>Record not found</errorMessage>    </Result>    <Result>      <ID>345678</ID>      <errorCode>0</errorCode>      <errorMessage>OK</errorMessage>    </Result>  </Results></MultiTopUpAccount>

Page 96: SERGEJUS ZABINSKIS Projects overview: 1985 - 2005

Server integration into company information system

SOAP

SOAP

SOAP

OpenVMS Cluster

SOAP

Billing systemgateway server

GEMBASE GEMBASE GEMBASE

Pool of GEMBASE processes

OpenVMS node: OMNITE

.…..

Shared memory

http://omnite.omnitel.lan:12300

Round robin balancing Round robin balancing

OpenVMS node: OMNITM OpenVMS node: OMNITL

http://omnitm.omnitel.lan:12300 http://omnitl.omnitel.lan:12300

SOAP

SOAP

IVR LOTUSOMNITELDEALERS

PORTAL

SOAP

Load balancer

Load balancer

WebSphereAS

SOAP

COM+AS

DCOM

Page 97: SERGEJUS ZABINSKIS Projects overview: 1985 - 2005

Implementation details Server was developed using mainly DEC C++ compiler with few modules written in pure C (shared library for GEMBASE) and GEMBASE. Other libraries, OpenVMS facilities and tools used are as follows:

 

 

gSOAP Free web-service development tool (developed by R.van Engelen)

Xerces-C Free XML processing library for C++

PPL OpenVMS Parallel Programming Library

pthreads POSIX threads library

AST OpenVMS Asynchronous system traps

ICC OpenVMS intra-cluster communication

GEMBASE 4GL programming language 

Page 98: SERGEJUS ZABINSKIS Projects overview: 1985 - 2005

THANK YOU!THANK YOU!