Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

WALL-E/vin-decoder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

278 Commits

Repository files navigation

vin-decoder

车架号(车辆识别码)查询服务/校验服务

vin layout

The 17 character VIN:

VIN
Position ISO Section 49 CFR 565 Assigned by
1 - 2 WMI Country Code SAE
2 - 3 Manufacturer, Type of MV
4 - 8 VDS Vehicle Attributes Manufacturer
9 VIS Check Digit Calculated
10 Model Year 30 Year Code
11 Manufacturing Plant Manufacturer
12 - 17 Serial Number
Or < 500 models per year
9 VIS Check Digit Calculated
10 Model Year 30 Year Code
11 Manufacturing Plant Manufacturer
12 - 14 WMI Suffix SAE
15 - 17 Serial Number Manufacturer

兼容性测试

目前,只在centos7.x上做了兼容性测试。

使用方法

提供web查询服务

请求

curl http://127.0.0.1/vin/v1/LVSHCAMB1CE054249

响应

{
 "status": "20000000",
 "message": "ok",
 "result": [{
 "vincode": "LVSHCAMB",
 "驱动形式": "前置前驱",
 "排量(升)": "1.6 L",
 "进气形式": "自然吸气",
 "变速器描述": "手动变速器(MT)",
 "燃油类型": "汽油",
 "品牌": "福特",
 "最大马力(ps)": "125",
 "厂家": "长安福特马自达",
 "VIN年份": "2012",
 "档位数": "5",
 "车型": "福克斯-两厢",
 "排放标准": "国4"
 }]
}

技术栈

  • Python
  • Tornado
  • Mongodb

正确性校验服务

从组成规则验证vin是否合法

  • 只包含阿拉伯数字和罗马字母(字母I,O,Q不能使用)
  • 校验码验证

Mongodb文档

  • WMI
  • WMI+VDS
    • 美版(中国),包含校验码,需要忽略
    • 欧版,没有校验码
  • YEAR
    • 年份代码表(30年循环一次)

数据来源

一次获取,多次使用(Mongodb缓存数据)

  • 付费查询
    • 网页解析
  • 网络爬虫
    • 定时更新

系统架构

系统主要依赖两个组件

  • mongodb
  • rabbitmq

mongodb实现了无模式,非常适合存储网络爬取到的数据,rabbitmq降低了多个模块的耦合性。

image

RabbitMQ

系统包含了多个队列,这里做一个统一说明

  • vin
    • 需要查询的vin code
  • pre-proxy
    • 爬虫获取到的代理服务器
  • proxy
    • 经过简单验证的代理服务器

Spider

包含了两种爬虫

简单的H5查询页面

这里涉及到一个跨域问题,在Tornado里做了忽略处理。

image

About

Vehicle Identification Number

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

Contributors

AltStyle によって変換されたページ (->オリジナル) /