当前位置:网站首页>Day26 IP query items
Day26 IP query items
2022-07-07 12:56:00 【Xiaobai shelter】
IP Online inquiry platform of ownership
One 、 Project introduction
1. background
according to IP Get the position , Tag
Do big data analysis , For example, Taobao Recommendation provides high-quality data
www.ip.cn etc. Inquire about IP
2. demand
IP analysis Attribution information , Lookup completed in milliseconds
IP Address base , The public network is open
IANA : international organization , Responsible for public network IP Maintenance Distribution
3. Technology stack
Eclipse ,JavaSE Object oriented in 、IO flow 、 Dichotomy algorithm 、Base64 code 、 Tool class encapsulation
4. The goal is
By developing IP Address attribution query platform , We need to be right about JavaSE The comprehensive technology has been improved , Enhance actual combat capability . After studying this project, we should have the following abilities :
1 Object oriented programming
2 Tool class encapsulation and usage writing
3 file IO flow
4 string manipulation
5 Binary search
6 IP Different forms of address use
Two 、 Main idea
1 Read the content in the program
2 analysis IP character string , Structured processing
3 Wrapper utility class
4 Interface API
Enter the reference : IP
The ginseng : Place of ownership
3、 ... and 、 Main idea
Application development projects
C/S structure , Need to have a specific client , such as QQ, WeChat ,eclipse
Web Development projects
B/S Structure first . An online system accessed through a web page , For example, various official websites , Various management systems, etc
Standard R & D process of small and medium-sized projects
1 Requirements overview - Requirements describe : Explain why you did this project
according to IP Get the place of belonging
2 Demand analysis :
According to the demand Overview , Consider it from a technical point of view , Is it feasible
Three aspects : 1 Input , 2 Output , 3 Necessary materials ( Address base )
Input : Given an arbitrary legal IP Address
Output : return IP Address library corresponding to address
3 Development steps
1 Read IP Address base
2 Resolve the information of the address Library , Structured processing
3 Save the object to list in
4 Do a binary search , Increase of efficiency
5 An interface that provides external access
6 test
4 Detail development and risk control
5 BUG Repair , tuning , Standardization
6 The official launch
7 Project summary - Project resumption
Four 、 Code development
1 Mindless reading files
public class TestFileIO_01 {
public static void main(String args[]){
try{
//1 File path
String ipLibrayPath="ip_location_relation.txt";
String encoding="UTF-8";
//2 Node stream docking file
FileInputStream fis=new FileInputStream(ipLibrayPath);
//3 Convert to character stream and specify character encoding
Reader reader=new InputStreamReader(fis,encoding);
//4 Buffering streams improves efficiency
BufferedReader br=new BufferedReader(reader);
//5 Read
String line=null;
while((line=br.readLine())!=null){
System.out.println(line);
}
//6 close
br.close();
}catch(Exception e){
e.printStackTrace();
}
}
}
2… Text file reading tool class
Abstract tool class
1 By coding , Realize input and output
2 Abstract input and output , Form method input and output parameters
3 Implement and test the tool class code
2.1 Tool class code
public class FileOperatorUtil {
public static List<String> getLineList(String filePath, String encoding) {
// TODO Auto-generated method stub
return null;
}
}
2.2 Tool class test
public class TestFileIO_02 {
public static void main(String args[]){
//1. File path
String ipLibrayPath="ip_location_relation.txt";
String encoding="UTF-8";
try{
List<String> lineList=FileOperatorUtile.getLineList(ipLibrayPath,encoding);
for(String string:lineList){
System.out.println(string);
}
}catch(IOException e){
e.printStackTrace();
}
}
}
- structured
structured : When we know the format of the first data , Then the data format of the second has been determined , There are rules to follow , Convenient operation
Based on unstructured data , Find the corresponding rule , And create corresponding entity classes for encapsulation , Convert to structured data - Abstract entity classes and save data
4.1 Entity class
边栏推荐
- Enterprise custom form engine solution (XII) -- experience code directory structure
- 2022聚合工艺考试题模拟考试题库及在线模拟考试
- .Net下极限生产力之efcore分表分库全自动化迁移CodeFirst
- 货物摆放问题
- MySQL importing SQL files and common commands
- leetcode刷题:二叉树22(二叉搜索树的最小绝对差)
- Go语言学习笔记-结构体(Struct)
- Leetcode brush questions: binary tree 19 (merge binary tree)
- @What is the difference between resource and @autowired?
- 红杉中国完成新一期90亿美元基金募集
猜你喜欢
leetcode刷题:二叉树19(合并二叉树)
Aike AI frontier promotion (7.7)
Star Enterprise Purdue technology layoffs: Tencent Sequoia was a shareholder who raised more than 1billion
通过Keil如何查看MCU的RAM与ROM使用情况
[statistical learning method] learning notes - support vector machine (Part 2)
认养一头牛冲刺A股:拟募资18.5亿 徐晓波持股近40%
Leetcode skimming: binary tree 25 (the nearest common ancestor of binary search tree)
Talk about four cluster schemes of redis cache, and their advantages and disadvantages
云检测2020:用于高分辨率遥感图像中云检测的自注意力生成对抗网络Self-Attentive Generative Adversarial Network for Cloud Detection
2022 polymerization process test question simulation test question bank and online simulation test
随机推荐
Sorting, dichotomy
ISPRS2021/遥感影像云检测:一种地理信息驱动的方法和一种新的大规模遥感云/雪检测数据集
明星企业普渡科技大裁员:曾募资超10亿 腾讯红杉是股东
环境配置篇
HZOJ #235. 递归实现指数型枚举
Day-16 set
Aosikang biological sprint scientific innovation board of Hillhouse Investment: annual revenue of 450million yuan, lost cooperation with kangxinuo
2022A特种设备相关管理(锅炉压力容器压力管道)模拟考试题库模拟考试平台操作
Leetcode skimming: binary tree 27 (delete nodes in the binary search tree)
Leetcode question brushing: binary tree 26 (insertion operation in binary search tree)
博文推荐|Apache Pulsar 跨地域复制方案选型实践
Star Enterprise Purdue technology layoffs: Tencent Sequoia was a shareholder who raised more than 1billion
【无标题】
Sample chapter of "uncover the secrets of asp.net core 6 framework" [200 pages /5 chapters]
Several ways to clear floating
[statistical learning method] learning notes - logistic regression and maximum entropy model
Enterprise custom form engine solution (XII) -- experience code directory structure
xshell评估期已过怎么办
HZOJ #240. 图形打印四
What if does not match your user account appears when submitting the code?