Showing posts with label design. Show all posts
Showing posts with label design. Show all posts

Thursday, May 30, 2013

Class diagram, Sequence, Use case, Activity, Component, and system diagram of warehouse based banking analytics

Outline
banking analytics is a warehouse based project. This is a project of analysis of transactional data in banks and tried to analyse the three objectives

  1. fraud detection
  2. churn analysis 
  3. customer relationship management
This project entitled “Warehouse based intelligent banking transaction analysis system” aims to develop a data warehouse with intelligent enough to analysis the day to day transaction occurring in the banks.  The key aims of the project  is to make the banking transaction more reliable and secure which has been a major problems in today’s age of increasing information technology. Furthermore this project aims to withstand a competitive market and bring itself in a strong position with the analysis of customer behavior and activities.


  •  1      System Architecture







The application system architecture consists of four blocks including the data sources, data warehouse servers, OLAP servers and reporting & data mining block. The functionality of each of the blocks is illustrated below:

                        Block –I: Operational & External Data Sources


For the implementation of a data warehouse & business intelligence system, the availability of reliable and actual data sources is essential and the most important without which the information reported, mined and forecasted may not be fruitful. For our system, the vendor for the operational & the external data sources is Nepal Investment Bank. The bank provided the bank’s customers’ profile and transaction databases in various format such as .txt and .sql. These data sources are flat files and need to be converted in multi-dimensional format for OLAP operations.

                         Block – II: Data Warehouse Servers

This block contains the staging area, warehouse database servers & metadata repository. There is physical data movement from source database to data warehouse database. Staging area is primarily designed to serve as intermediate resting place for data before it is processed and integrated into the target data warehouse. This staging are serves many purposes above and beyond the primary function:
                    The data is most consistent with the source. It is devoid of any transformation or has only minor      
                     format changes.

                     The staging area in a relation database can be read/ scanned/ queried using SQL without the  
                     need of logging into the source system or reading files (text/xml/binary).

                       It is a prime location for validating data quality from source or auditing and tracking down data  
                      issues.

                    Staging area acts as a repository for historical data if not truncated.

The next component is a warehouse database server that is almost always a relational database system. Back-end tools and utilities are used to feed data into the bottom tier from operational databases or other external sources (such as customer profile information provided by external consultants). These tools and utilities perform data extraction, cleaning, and transformation (e.g., to merge similar data from different sources into a unified format), as well as load and refresh functions to update the data warehouse.
This block also contains a metadata repository, which stores information about the data warehouse and its contents.

                     Block – III: OLAP Server

The middle block is an OLAP server that is typically implemented using either
(1) a relational OLAP (ROLAP) model, that is, an extended relational DBMS that maps operations on multidimensional data to standard relational operations; or
(2) a multidimensional OLAP (MOLAP) model, that is, a special-purpose server that directly implements multidimensional data and operations.

                Block – IV: Reporting & Data Mining Tools

The front-end client layer in data warehousing is the presentation phase which contains query and reporting tools, analysis tools and data mining tools for trend analysis, fraud detection and customer churn behavior analysis. The reporting tool that we’ve used for this purpose is Oracle Business Intelligence Enterprise Edition (OBIEE) 11g.

For providing the analytical result, we will be using some of the Online Analytical Processing (OLAP) operations such as slicing & dicing, roll up & roll down and pivoting. The analytical results will be provided in a multi-dimensional view using OLAP Cube Technology projected to assist decision makers such as visualization with comparison to different dimensions e.g. locations, time etc.

For trend & prediction analysis featuring churn analysis and CRM, we will be using some of the data mining algorithms such as CART, C5.0 & Rule based algorithms. Transactions made by fraudsters using counterfeit cards and making cardholder-not-present purchases will be detected through methods which seek changes in transaction patterns, as well as checking for particular patterns which are known to be indicative of counterfeiting. 


  • 2     USE CASE DIAGRAM

                          loading datawarehouse

use case diagram of loading datawarehouse


As shown in diagram above, the loadDataWarehouse subsystem contains two actors one primary actor- Database Administrator and the other supporting actor- Bash shell ETL module. Each of the actors show their one behaviour in context to the system. The relationships between the actors and the use case scenarios have been shown by the association lines and those between use cases have been shown by the dependency lines with appropriate stereotypes shown within guillemets. The specification of the actors with main success scenarios and other alternate scenarios have been shown as follows:

                                         Specification of Actors

element
Details
Description
Database Administrator is the primary actor who is responsible for the extraction, transformation and loading of the data to the staging area. This actor is also responsible for the handling of new transaction data.


element
Details
Description
Bash Shell ETL Module is the supporting actor who is responsible for actual extraction, transformation and loading of the data to the staging area. This actor is also responsible for the loading of the target area and handling updates, i.e, refreshment of the warehouse.






As shown in the figure above, the use case diagram modeling the report generation and data mining subsystem consists of two actors- the database administrator and the end users which are the executives belonging to the tactical level of the management in the bank. The relationships between the actors and the use case scenarios have been shown by the association lines and those between use cases have been shown by the dependency lines with appropriate stereotypes shown within guillemets. The specification of the actors with main success scenarios and other alternate scenarios have been shown as follows:

 Specification of Actors


element
Details
Description
Database Administrator is the supporting actor who is responsible for the handling of different multidimensional processing of data. This actor is also responsible for providing the supporting environment for the end users.


element
Details
Description
Bank Manager is the primary actor who is responsible for the generation of different analytical reports, dashboards and also perform the fraud detection and churn prediction including the CRM analysis provided by the subsystem.








  • SEQUENCE DIAGRAM
                    system sequence diagram




Data source are heterogeneous may have different storage file. Data is extracted from the distributed heterogeneous data sources and stored in DSA (Data Staging Area) and is used in the next level of ETL process, i.e., cleaning and transformation. The cleaned and transformed data is then loaded into the data warehouse

                          report generation sequence diagram








As in the figure there is three class OBI, OBIBackend, DataWarehouse and BankManger is user.  Synchronous message passing is done between classes which is shown by the solid and dotted line. OBI get the request from user and OBI send request to OBIBackend to generated report. OBIBackend gets necessary data from dataWarehouse class and generated report is send to OBI and report is displayed to the user.


ACTIVITY DIAGRAM


activity diagram of reporting system



The facts and dimension from the warehouse are arranged in snowflake schema. OLAP cube are formed through which operations like slicing, dicing, roll up & roll down are performed and then report are generated according to those fact tables.


CLASS DIAGRAM






COMPONENT DIAGRAM

The above component diagram displays the major components involved in this sub system and communication between them. The ATM Machine component denotes the ATM Machine where a transaction takes place, the users must authorize themselves before performing any transaction. The ATM transaction is passed to the Bank Database component via LAN interface. The data stored in Bank Database are accessed by ETL tools component with necessary credentials and authority to perform extraction, transformation and loading of the raw data from Bank Database.  Finally the transformed and refined data are loaded into the data warehouse.





Above component diagram displays the components involved in report generation using OBIEE tool. The data from Data Warehouse component are fed into the Oracle BI server. Oracle Bi server provides efficient processing of data and structure information intelligently. It uses metadata to direct processing. The Metadata Repository component stores the metadata used by Oracle BI server. The query client component contains two components, Analysis Editor Component and Dashboards component. Analysis Editor Component contains set of graphical tools that enable users to build, view, and modify analyses that provide analytical information. Dashboards display results the analyses and other items. The Administrator tool component exposes the Oracle BI repository as three separate panes of layers: Physical, Business Model and Mapping and Presentation






Friday, May 17, 2013

class diagram, use case diagram, activity , sequence,collaborative and state chart diagram of hostel management system



The best practice of starting any project proceeds with the modelling of the various aspect of the project. The project are visualized through the diagrams like class diagram, activity diagram,use case diagram and so on. such diagrams are very usefulin the sense that the actual flow and the order of the project is reflected through this diagrams. Each diagrams has its own
significance and are very important.

outline of the problem

we have a hostel named New Boys hostel. it has 3 blocks named Block-A, Block-B and Block-C with each block is 3 storied thus 
each blocks are identified with ground, mid and top like A-top,A-mid,A-ground, B-top,B-mid and so on............

Here now we want to make a website to manage the hostel. The website keeps the record of each students in a room. We have assumed that each room has 2 to 3 students. Admin has only previlage to add or delete the record. non admin can only view the data.
students registered in the hostel have access to the notice board facilities . students can post the notice if any materials is lost or have any information that is to be shared. Admin can delete the post if any violation of rules is identified.


1: Class Diagram





2:Use Case Diagrams
The use case diagram below shows that the actor User is inherited by three users and is allowed to access the particular part as depicted in the diagram. The User must login in in the system to get the right to use it. Here General User needs to register to the system first and if the User is already registered , they are identified as Admin or Registered User and are allowed the particular privilege.

In next diagram, it is shown that first the user are validated by matching their password and are allowed to view the students residing in the particular block only if they are either Admin or Registered User.



3:Activity Diagrams
Activity diagram below shows the flow from activity to Activity with the available of input in the project NB Hostel Management .It shows the overall activity diagram of the system which first checks the register user, Admin and the new user and give access to certain attributes according to their identity




The next  figure depicts the activity for message posting process. Admin and Registered_User can post the message and is displayed for both user .However In order to Delete the post, Admin can delete any post but User can delete their own post only.And to edit the post ,User who has posted the message can only edit it.



4:Sequence Diagrams

Following Diagram represents the user login process in our project. First, the user is checked whether he/she is logged in or not by authorizing with the DB server. The privileges provided in the site are different for different users such as an administrator can do updates, deletion and insertion of the students’ records in the database which the others can’t.



In the above diagram, we have used the ‘alt’ frame operator [UML 2.0] as alternative frame for mutually exclusive conditional messages.

Next diagram is the sequence diagram for the students’ records insertion process in the database by the administrator. The first message fillForm(record) also called found message represents that personal info, campus related info and permanent addresses of the student are filled and then sent to the admin for insertion.




5:Collaboration Diagrams
The following collaboration diagram models the message posting process by a student or by the admin.


Next, the following collaboration diagram is for the new user insertion and information update of the students



6: State chart Diagrams
The following state chart diagram represents the states while navigating through different pages in the project’s site indicating the overall features –insert, update, view messages/notices etc.


The next statechart diagram represents the states of a process while posting messages to the message board by a residential student or while  posting notices by the hostel administrator.




Conceptual Model for Database Design [ER Modelling]
The entity- relationship diagram below depicts the database design of the project:




Sunday, June 3, 2012

CODE OF PIC 16F877A FOR MAKING DVM USING MICRO C PROGRAMMING IDE


NOTE:  This is the programming code written for pic 16877 for making digital voltmeter.The IDE used for this program is micro c programming.we should also know that this code is written in C language whereas pic doesnot understand C,it only knows the Hex code so it must be first converted to hex code and then it is burned to the pic.

The design is performed in proteus

all the  things within /.........../ are the comments.




/*************display in LCD using 8-bit, 2 line mode*******/
#include <htc.h>

#define data PORTB
#define RS RD0
#define EN RD1
float result,val;
int val1,val2;
__CONFIG(HS & WDTDIS & PWRTEN & BORDIS & LVPDIS);

void delay_ms(int n )
{
           TMR1H=0xEC;        // EC77H=60535d
        TMR1L=0x77;
        T1CKPS1=0;
        T1CKPS0=0;
        TMR1CS=0;
        TMR1IF=0;
        TMR1ON=1;
           while(n>0)
           {
                while(!TMR1IF)  { }
                TMR1IF=0;
                TMR1H=0xEC;
                TMR1L=0x77;
                n--;
        }
}
void delay_100us(int n )      
{
           TMR1H=0xFE;      
        TMR1L=0x0C;
        T1CKPS1=0;
        T1CKPS0=0;
        TMR1CS=0;
        TMR1IF=0;
        TMR1ON=1;
           while(n>0)
           {
                while(!TMR1IF)  { }
                TMR1IF=0;
                TMR1H=0xFE;      
                TMR1L=0x0C;
                n--;
        }
}


void LCD_Write(unsigned char value,int rs)
{
        data = value;
        RS = rs;                                //if rs=0; command is sent to LCD otherwise data to be displayed is sent
        EN = 1;
        delay_ms(1);
        EN = 0;

}

void LCD_clear(void)
{
        LCD_Write(0x01,0);                //this clears LCD
}

void LCD_goto(unsigned char row,unsigned char column)
{
        if(row==1){
                LCD_Write(0x80+column,0);        //
        }
        else if(row==2){
                LCD_Write(0xC0+column,0);
        }


}
void LCD_num(int n)
{

    if(n<=9)
    {
            LCD_Write(48+n,1);
         }
         else if(n<=99)
         {
                 LCD_Write((n/10)+48,1);
                 LCD_Write((n%10)+48,1);
        }
        else if(n<=999)
        {
                LCD_Write((n/100)+48,1);
                LCD_Write(((n%10)/10)+48,1);
                LCD_Write((n%10)%10+48,1);
        }
}
void init_ADC()
{
        PCFG3=0;        PCFG2=0;  PCFG2=0;  PCFG0=0;                //Configures all the pins of PORTA and PORTB as ANALOG pins.

        /*For correct A/D conversions, the A/D conversion clock must be selected to ensure a minimum
        TAD time of 1.6 ms as shown in parameter 130 of the “Electrical Specifications” section.*/

        ADCS1=1;        ADCS0=0;        //this gives  32*Tosc=1.6 us
        ADFM=1;                                //Left justified format viz 6 LSBs of ADRESL regsiter are read as ‘0’.
        //Result will be held at ADRESH and ADRESL register
}
void initLCD(void)
{
        //PORT configuration
        TRISB = 0x00;
        TRISD=0x00;
        //////////////////

        LCD_Write(0x30,0);
//        data = 0x3;         // 8 bit mode
        EN=1; EN = 0;
        LCD_Write(0x38,0);
        delay_ms(1);
        LCD_Write(0x0C,0);    //dispaly on , no cursor blinking
        delay_ms(1);
        LCD_Write(0x01,0);    // clear dispaly screen


        delay_ms(1);
        LCD_Write(0x06,0);
        delay_ms(1);
        LCD_clear();
        LCD_goto(1,1);
        LCD_goto(1,1);        //1st row 1st column
    LCD_Write('D',1);delay_ms(100); LCD_Write('I',1);delay_ms(100); LCD_Write('G',1);delay_ms(100); LCD_Write('I',1);delay_ms(100);
        LCD_Write('T',1);delay_ms(100);LCD_Write('A',1);delay_ms(100);LCD_Write('L',1);delay_ms(100);LCD_Write(' ',1);delay_ms(100);
        LCD_Write('V',1);delay_ms(100);LCD_Write(' ',1);delay_ms(100);LCD_Write('M',1);delay_ms(100);LCD_Write('E',1);delay_ms(100);
    LCD_Write('T',1);delay_ms(100); LCD_Write('E',1);delay_ms(100); LCD_Write('R',1);
        LCD_goto(2,1);
    LCD_Write('D',1);  LCD_Write('C',1);  LCD_Write(' ',1);  LCD_Write('V',1);  LCD_Write('O',1);  LCD_Write('L',1);  LCD_Write('T',1);  LCD_Write('=',1);

}
/************Analog to digital conversion will occur here**********/
void ADC()
{
        ADON=1;                                         //A/D converter module is powered up
        /**********************channel one********************/
        CHS2=0; CHS1=0; CHS0=0;        // selecting pin A0 as input pin where analog signal will appear
        delay_ms(3);
    ADGO  = 1;                                         //ADGO WILL BE  RESET  BY  SYSTEM AUTOMATICALLY ONCE   ADC   IS   COMPLETE
        while(ADGO);
    result=(ADRESH<<8)+ADRESL;
    LCD_goto(2,9);
    if(result<511||result>512)
     {
         if(result>512.0)
           {//        LCD_goto(2,9);
            LCD_Write(' ',1);
             result=result-511.5;
   
        }
        else if(result<511.0)
         {//LCD_goto(2,9);
          LCD_Write('-',1);   //displaying negative sign
          result=result-511.5;
           result=-(result);
       }
       result=result*30/511.5;
       val1=(int)result;
       LCD_num(val1);
       LCD_Write('.',1);   //displaying dot sign
       val=result-val1;
       val=val*1000;
       val2=(int)(val);
       LCD_num(val2);
}
  else
    {result=0;
     LCD_Write(' ',1);
     LCD_Write(' ',1);
     result=result*30/511.5;
     val1=(int)result;
     LCD_num(val1);
     LCD_Write('.',1);   //displaying dot sign
     val=result-val1;
     val=val*1000;
     val2=(int)(val);
     LCD_num(val2);}



}

void main(void)
{        TRISB=0x00;                //Configuring all pins of B port as output.
        PORTB=0x00;                //output at all pins will be low
        TRISA=0xff;                        //Configuring all pins of A port as input
        TRISD0=TRISD1=0;
        RD0=RD1=0;
        initLCD();
        init_ADC();
while(1)
 {
        ADC();                //call ADC convert
}
}