Telecom Acquisition Sub-item 1 (gross structure)

Source: Internet
Author: User

Broadly divided into two areas:

1. The client is responsible for collecting the data information generated by each region into 5 modules.

1.1 Configuration Module

1.2 Log Module

1.3 Acquisition Module

1.4 Backup Module

1.5 Network Module

2. The server receives data

1.1 Configuration Module

1.2 Log Module

1.3 Storage Module

1.4 Backup Module

1.5 Network Module

The Bidr class is used to split the collected data.

Interface

Gather Interface Client Acquisition module

Responsible for collecting data from the specified file (AAA server-generated files)
Methods that need to be implemented:
Collection<bidr> gather ();

Sample Collection File:
#briup1660 |037:wkgb1660a|7|1239110900|44.211.221.247
#briup4418 |037:wkgb4418a|7|1239138480|251.196.223.191
#|037:wkgb1660a|8| 1239203860|44.211.221.247
...
..

Problem:
1. How to obtain the file path
2. Understand the meaning of each row of data
2.1 The data used is | to split
2.2 Data are divided into two types
Follow the rules on 7 on 8
Contains 7 of the data indicates that the user is online
Contains 8 of data indicating user downline
Contains 7 of the data
Data is divided into five parts
Part I: User name of Login (minus # #)
Part II: Name of the NAS server
Part III: Must be 7
Part IV: The time of the line (in seconds)
Part V: IP at logon
2.4 Contains 8 of the data
Data is divided into five parts
The first part: must be a match #
Part II: Name of the NAS server
Part III: Must be 8
Part IV: The Time of the downline (in seconds)
Part V: IP at logon

3. How to read and write data
4. How to encapsulate data
5. The collected data are divided into two cases
First case data:
Users on-line and also offline
Second case data:
The user is online, but there's no downline.
6. How to deal with two kinds of data
The first type of data described above:
Ready to be passed to the server after encapsulating the object.
The second type of data described above:
To make a backup of the data, in the next acquisition, the backup data needs to be read back to use, because the user may be in the next collection of the offline
7. How to read the second reading of the data from the next line after reading the data for the first time
You can record how many bytes are read in total this time, and the next time you can skip over so many bytes, then read on.
8. In the process of reading or processing, if an exception occurs, the data needs to be backed up
9. Note Logging of important information


Client Interface Clients Network module
Responsible for sending the collected data to the server.
Methods that need to be implemented:
void Send (collection<bidr> c)
Problem:
1. How to get information about connecting to a server
2. How to get the collected data
3. How to send data to the server
4. What to do if sending data fails
5. Note Logging of important information


Server Interface servers-side network module
Responsible for receiving data sent by the client.
Methods that need to be implemented:
Collection<bidr> Revicer ();
void shutdown ();
Problem:
1. How to obtain information about the server startup time
2. How to turn off the server
3. How to receive the information sent by the client
4. How to handle client concurrency issues
5. What to do after receiving the data
6. Data reception or process backup issues
7. Note Logging of important information

Dbstore interface server-side inbound module
Responsible for inserting incoming data into the database
Methods that need to be implemented:
void Savetodb (collection<bidr> c)
Problem:
1. How to get information about a connected database
2. How to insert data into the database
3. Efficiency issues when inserting data
4. What kind of data corresponds to which table

Logger Interface Common Log module
Responsible for recording some important information of the system operation process
Methods that need to be implemented:
void Debug (String msg);
void info (String msg);
void Warn (String msg);
void error (String msg);
void Fatal (String msg);
Problem:
1. How to Implement Journal records
2. Understanding Log Levels
3. How to set the level of the log
4. How to get a log object
5. How to control the format of the log
6. How to control the log output to the console and the specified file

Backup interface, public back-up module
Responsible for backing up some data that has not been processed
Methods that need to be implemented:
void Store (String filePath, Object obj,
Boolean append)
Object Load (String FilePath, Boolean del)
Problem:
1. How to obtain directory information for backup files
2. How to back up data to a file
3. How to read backup data from a file
4. How to implement the backup data when the append or overwrite
5. How to control whether the file needs to be deleted after reading the backup data

Configuration Interface Common Config module
The module is equivalent to a factory
Responsible for
1. Generating individual Module objects
2. Read the information required by each module and inject the information into each module
Note: The interface is required for each module at this time Wossmodule
3. If you need to use the configuration module in a module A, then you need to inject yourself (because you are the configuration module) into this module a
Note: module A is required to implement interface Configurationaware

Methods that need to be implemented:
Logger GetLogger ();
BackUP Getbackup ();
Gather Getgather ();
Client getclient ();
Server Getserver ();
Dbstore Getdbstore ();

Problem:
1. How to get information about each module
2. How to create an object for each module
3. How to inject the data needed for each module into the module
4. When you can inject yourself (the configuration module itself) into the required modules

    Wossmodule Interface

For example: module A needs to use some parameters (such as the path to read XML, the address of the connection data, etc.), module A needs to implement the Wossmodule interface, then this module A has a method:
Init (Properties p)

In the future we can call this Init method and inject the data into module a

Configurationaware Interface

Configuration is a module interface
For example: module A needs to use the configuration module, module a needs to implement the Configurationaware interface, then this module A has a method:
Setconfiguration (Configuration c)

In the future, we can call this method to inject the configuration Module object into module a


Database:
1. There are 31 sheets
T_detail_1
..
T_detail_31

Columns in the table:
(
AAA_LOGIN_NAMEVARCHAR2 (30),
LOGIN_IPVARCHAR2 (32),
Login_datedate,
Logout_datedate,
NAS_IPVARCHAR2 (32),
Time_durationnumber (10)
)
2. Each table corresponds to a single day
3. Different data needs to be inserted into different tables
For example: Number 1th (not concerned about the year and month) the data generated, you need to insert the data into the 1th table, number 15th generated data, you need to insert into the 15th table
4. Build a Table statement
Using PL/SQL to build tables
BEGIN
For I in 1..31 LOOP
EXECUTE IMMEDIATE
' CREATE TABLE t_detail_ ' | | To_char (i) | |
‘(
AAA_LOGIN_NAMEVARCHAR2 (30),
LOGIN_IPVARCHAR2 (32),
Login_datedate,
Logout_datedate,
NAS_IPVARCHAR2 (32),
Time_durationnumber (10)
)‘;
END LOOP;
END;
/

To delete a table using PL/SQL
BEGIN
For I in 1..31 LOOP
EXECUTE IMMEDIATE
' DROP TABLE t_detail_ ' | | To_char (i);
END LOOP;
END;
/

Telecom Acquisition Sub-item 1 (gross structure)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.