1 Star 0 Fork 405

OKOKOK88 / SZT-bigdata

forked from 极客青年 / SZT-bigdata 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
GPL-3.0

SZT-bigdata 深圳地铁大数据客流分析系统 🚇🚇🚇



   ___     ____   _____           _         _      __ _      _             _
  / __|   |_  /  |_   _|   ___   | |__     (_)    / _` |  __| |   __ _    | |_    __ _
  \__ \    / /     | |    |___|  | '_ \    | |    \__, | / _` |  / _` |   |  _|  / _` |
  |___/   /___|   _|_|_   _____  |_.__/   _|_|_   |___/  \__,_|  \__,_|   _\__|  \__,_|
_|"""""|_|"""""|_|"""""|_|     |_|"""""|_|"""""|_|"""""|_|"""""|_|"""""|_|"""""|_|"""""|
"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'

项目说明🚩:

  • 🎈 该项目主要分析深圳通刷卡数据,通过大数据技术角度来研究深圳地铁客运能力,探索深圳地铁优化服务的方向;
  • ✨ 强调学以致用,本项目的原则是尽可能使用较多的常用技术框架,加深对各技术栈的理解和运用,在使用过程中体验各框架的差异和优劣,为以后的项目开发技术选型做基础;
  • 👑 解决同一个问题,可能有多种技术实现,实际的企业开发应当遵守最佳实践原则;
  • 🎉 学习过程优先选择较新的软件版本,因为新版踩坑一定比老版更多,坑踩的多了,技能也就提高了,遇到新问题可以见招拆招、对症下药;
  • 🚀 ...

第一期架构图

原图 .file/.doc/SZT-bigdata-2.png

数字标记不分先后顺序,对应代码:
1-cn.java666.sztcommon.util.SZTData
2-cn.java666.etlflink.app.Jsons2Redis
3-cn.java666.etlspringboot.controller.RedisController#get
4-cn.java666.etlflink.app.Redis2ES
5-cn.java666.etlflink.app.Redis2Csv
6-Hive sql 脚本(开发维护成本最低)
7-Saprk 程序(开发维护成本最高,但是功能更强)
8-HUE 方便查询和展示 Hive 数据
9-cn.java666.etlflink.app.Redis2HBase
10、14-cn.java666.szthbase.controller.KafkaListen#sink2Hbase
11-cn.java666.etlflink.app.Redis2HBase
12-CDH HDFS+HUE+Hbase+Hive 一站式查询
13-cn.java666.etlflink.app.Redis2Kafka
15-cn.java666.sztflink.realtime.Kafka2MyCH
16-cn.java666.sztflink.realtime.sink.MyClickhouseSinkFun

下一步,计划开发数据湖中台解决方案


核心技术栈 + 版本选择 + 点评 (持续更新)⚡:

  • Java-1.8/Scala-2.11,生态丰富,轮子够多;
  • Flink-1.10,流式业务、ETL 首选。发展势头如日中天,阿里巴巴背书,轻快灵活、健步如飞;就问你信不信马云???😚😚😚
  • Redis-3.2,天然去重,自动排序,除了快还是快。廉价版硬盘实现同类产品 SSDB。Win10|CentOS7|Docker Redis-3.2 三选一,CentOS REPL yum 安装默认使用3.2版本;
  • Kafka-2.1,消息队列业务解耦、流量消峰、订阅发布场景首选。最佳 CP:kafka-eagle-1.4.5,集生产、消费、Ksql、大屏、监控、报警于一身,同时监控 zk。其他我用过的 Kafka 监控组件最后都放弃了:
    • KafkaOffsetMonitor 问题太多,丑拒;
    • Kafka Manager,已更名为 CMAK,老外写的软件用起来就觉得很别扭,而且最高只兼容 Kafka 0.11,但是 Kafka 官方已经升级到 2.4 了啊喂;
    • 其他各种开源的 Kafka 监控基本都试过,一个能打的都没有。
  • Zookeeper-3.4.5,集群基础依赖,选举时 ID 越大越优势,通过会话机制维护各组件在线状态;
  • CDH-6.2,解决了程序员最难搞的软件兼容性问题,全家桶服务一键安装;
  • Docker-19,最快速度部署一款新软件,无侵入、无污染、快速扩容、服务打包。如果当前没有合适的运行环境,那么 docker 一定是首选;
  • SpringBoot-2.13,通用 JAVA 生态,敏捷开发必备;
  • knife4j-2.0,前身为 swagger-bootstrap-ui,REST API 项目调试简直不要太方便,秒杀原版丝袜哥十个数量级;
  • Elasticsearch-7,全文检索领域唯一靠谱的数据库,搜索引擎核心服务,亿级数据毫秒响应,真实时,坑也多🔊🔊🔊;
  • Kibana-7.4,ELK 全家桶成员,前端可视化,小白也不怕;
  • ClickHouse,家喻户晓的 nginx 服务器就是俄罗斯的代表作,接下来大红大紫的 clickhouse 同样身轻如燕,但是性能远超目前市面所有同类数据库,存储容量可达PB级别。目前资料还不多,正在学习中;
  • MongoDB-4.0,文档数据库,对 Json 数据比较友好,主要用于爬虫数据库;
  • Spark-2.3,目前国内大数据框架实时微批处理、离线批处理主流方案。这个组件太吃资源了,曾经在我开发时,把我的笔记本搞到蓝屏,于是我直接远程提交到 spark 集群了。接下来预计 Flink 开始表演了🦘,真的用了更快的框架就爱上了😍😍😍;
  • Hive-2.1,Hadoop 生态数仓必备,大数据离线处理 OLAP 结构化数据库,准确来说是个 HQL 解析器,查询语法接近 Mysql,就是窗口函数比较复杂😭😭😭;
  • Impala-3.2,像羚羊一样轻快矫健,同样的 hive sql 复杂查询,impala 毫秒级返回,hive 却需要80秒左右甚至更多;
  • HBase-2.1 + Phoenix,Hadoop 生态下的非结构化数据库,HBase 的灵魂设计就是 rowkey 和多版本控制,凤凰嫁接 hbase 可以实现更复杂的业务;
  • Kylin-2.5,麒麟多维预分析系统,依赖内存快速计算,但是局限性有点多啊,适用于业务特别稳定,纬度固定少变的场景,渣渣机器就别试了,内存太小带不起;
  • HUE-4.3,CDH 全家桶赠送的,强调用户体验,操作数仓很方便,权限控制、hive + impala 查询、hdfs 文件管理、oozie 任务调度脚本编写全靠他了;
  • 阿里巴巴 DataX,异构数据源同步工具,主持大部分主流数据库,甚至可以自己开发插件,马云家的东西,我选你!!!如果你觉得这还满足不了你的特殊业务需求,那么推荐你用 FlinkX,基于 Flink 的分布式数据同步工具。理论上你也可以自己开发插件;
  • Oozie-5.1,本身 UI 奇丑,但是配合 HUE 食用尚可接受,主要用来编写和运行任务调度脚本;
  • Sqoop-1.4,主要用来从 Mysql 导出业务数据到 HDFS 数仓,反过来也行;
  • Mysql-5.7,程序员都要用的吧,如果说全世界程序员都会用的语言,那一定是 SQL。Mysql 8.0 普及率不够高,MariaDB 暂不推荐,复杂的函数不兼容 Mysql,数据库这么基础的依赖组件出了问题你就哭吧;
  • Hadoop3.0(HDFS+Yarn),HDFS 是目前大数据领域最主流的分布式海量数据存储系统,这里的 Yarn 特指 hadoop 生态,主要用来分配集群资源,自带执行引擎 MR;
  • 阿里巴巴 DataV 可视化展示;
  • ...

我发现越来越多的国产开源软件用户体验值得肯定。。。


准备工作🍬:

以下是我的开发环境,仅作参考:

  • Win10 IDEA 2019.3 旗舰版,JAVA|Scala 开发必备,集万般功能于一身;
  • Win10 DBeaver 企业版 6.3,秒杀全宇宙所有数据库客户端,几乎一切常用数据库都可以连,选好驱动是关键;
  • Win10 Sublime Text3,地表最强轻量级编辑器,光速启动,无限量插件,主要用来编辑零散文件、markdown 实时预览、写前端特别友好(虽然我不擅长🖐🖐🖐),速度快到完全不用担心软件跟不上你的手速;
  • 其他一些实用工具参考我的博客:https://java666.cn/#/AboutMe
  • CentOS7 CDH-6.2 集群,包含如下组件,对应的主机角色和配置如图,集群至少需要40 GB 总内存,才可以满足基本使用,不差钱的前提下,RAM 当然是合理范围内越大越好啦,鲁迅都说“天下武功唯快不破”;我们的追求是越快越好;

如果你选用原版 Apache 组件搭建大数据集群,那么你会有踩不完的坑。我的头发不够掉了,所以我选 CDH!!!⚙🛠😏😏😏

物理机配置💎:

  • 以上软件分开部署在我的三台电脑上,Win10 笔记本 VMware + Win10 台式机 VMware + 古董笔记本 CentOS7。物理机全都配置 SSD + 千兆以太网卡,HDFS 需要最快的网卡。好马配好鞍,当然你得有个千兆交换机配合千兆网线,木桶原理警告!!!🎈🎈🎈

  • 有个机架当然再好不过了,哈哈哈。。。

  • 如果你想避免网线牵来牵去,可以采用电力猫实现分布式家庭组网方案;


数据源🌍:

理论上可以当作实时数据,但是这个接口响应太慢了,如果采用 kafka 队列方式,也可以模拟出实时效果。

本项目采用离线 + 实时思路 多种方案处理。


开发进度🥇:

准备好 java、scala、大数据开发常用的环境,比如 IDEA、VMware 虚拟机、CDH等,然后手机静音盖上,跟我一起左手画个龙,右手划一道彩虹,开始表演吧🤪


1- 获取数据源的 appKey:

https://opendata.sz.gov.cn/data/api/toApiDetails/29200_00403601

2- 代码开发:

2.1- 调用 cn.java666.etlspringboot.source.SZTData#saveData 获取原始数据存盘 /tmp/szt-data/szt-data-page.jsons,核对数据量 1337,注意这里每条数据包含1000条子数据;


2.2- 调用 cn.java666.etlflink.sink.RedisSinkPageJson#main 实现 etl 清洗,去除重复数据,redis 天然去重排序,保证数据干净有序,跑完后核对 redis 数据量 1337。


2.3- redis 查询,redis-cli 登录后执行 hget szt:pageJson 1

或者 dbeaver 可视化查询:


2.4- cn.java666.etlspringboot.EtlSApp#main 启动后,也可以用 knife4j 在线调试 REST API:


2.5- cn.java666.etlflink.source.MyRedisSourceFun#run 清洗数据发现 133.7 万数据中,有小部分源数据字段数为9,缺少两个字段:station、car_no;丢弃脏数据。

合格源数据示例:

{
	"deal_date": "2018-08-31 21:15:55",
	"close_date": "2018-09-01 00:00:00",
	"card_no": "CBHGDEEJB",
	"deal_value": "0",
	"deal_type": "地铁入站",
	"company_name": "地铁五号线",
	"car_no": "IGT-104",
	"station": "布吉",
	"conn_mark": "0",
	"deal_money": "0",
	"equ_no": "263032104"
}

不合格的源数据示例:

{
	"deal_date": "2018-09-01 05:24:22",
	"close_date": "2018-09-01 00:00:00",
	"card_no": "HHAAABGEH",
	"deal_value": "0",
	"deal_type": "地铁入站",
	"company_name": "地铁一号线",
	"conn_mark": "0",
	"deal_money": "0",
	"equ_no": "268005140"
}

2.6- cn.java666.etlflink.app.Redis2Kafka#main 根据需求推送满足业务要求的源数据到 kafka,topic-flink-szt-all 保留了所有源数据 1337000 条, topic-flink-szt 仅包含清洗合格的源数据 1266039 条。


2.7- kafka-eagle 监控查看 topic,基于原版去掉了背景图,漂亮多了:

ksql 命令查询: select * from "topic-flink-szt" where "partition" in (0) limit 1000


2.8- cn.java666.etlflink.app.Redis2Csv#main 实现了 flink sink csv 格式文件,并且支持按天分块保存。


2.9- cn.java666.etlflink.app.Redis2ES#main 实现了 ES 存储源数据。实现实时全文检索,实时跟踪深圳通刷卡数据。

这个模块涉及技术细节比较多,如果没有 ES 使用经验,可以先做下功课,不然的话会很懵。

我之前在处理 ES 各种问题踩了不少坑,熬了不少通宵,掉了很多头发。

遇到问题心态要稳,因为你今天处理了一个问题,明天接触新的版本新的框架大概率又会出现新的问题。。🥺🥺🥺

所以最佳实践很重要!!!

👇👇👇这部分内容有更新:修正了上一个版本时区问题。

🎬接下来,让我们时光倒流,回到 2018-09-01这一天,调整 kibana 面板时间范围 2018-09-01 00:00:00.000~2018-09-01 23:59:59.999,看看当天深圳通刷卡记录的统计图曲线走向是否科学,间接验证数据源的完整性。

修正时区后统计数量,字段完整的合格源数据 1266039 条,2018-09-01全天 1229180 条。

图中可以看出 2018-09-01 这一天刷卡记录集中在上午6点~12点之间,早高峰数据比较吻合,虽然这一天是周六,高峰期不是特别明显。我们继续缩放 kibana 时间轴看看更详细的曲线:

回顾一下本项目 ETL 处理流程:

1337000 条源数据清洗去除字段不全的脏数据,剩余的合格数据条数 1266039 已经进入 ES 索引 szt-data

在 1266039 条合格数据中,有 1227234 条数据集中在 2018-09-01 这一天的上午时段;

我们暂且相信上午时段的数据是真实的,那么是否说明官方提供的数据并不是全部的当天完整刷卡数据???

如果按照上午的刷卡量来估测全天的刷卡量,考虑到是周六,那么深圳通全天的刷卡记录数据应该在 122万 X 2 左右,当然这么武断的判断方式不是程序员的风格,接下来我们用科学的大数据分析方式来研究这些数据背后的意义。

注意,ES 大坑:

  • ES 存数据时,带有时间字段的数据如何实时展示到 kibana 的图表面板上?
    🤣需要在存入 index 之前设置字段映射。参考格式,不要照抄!!!
{
  "properties": {
	"deal_date": {
	  "format": "yyyy-MM-dd HH:mm:ss",
	  "type": "date"
	}
  }
}  

这里并没有指定时区信息,但是 ES 默认使用 0 时区,这个软件很坑,无法设置全局默认时区。但是很多软件产生的数据都是默认机器所在时区,国内就是东八区。因为我们的源始数据本身也没有包含时区信息,这里我不想改源数据,那就假装自己在 ES 的 0 时区。同时需要修改 kibana 默认时区为 UTC,才可以保证 kibana 索引图表时间轴正确对位。不过这并不是一个科学的解决方案。

如果是企业项目,必须要用数据质量监控软件!!!要不然得有多少背锅侠要杀去祭天😂😂😂,数据可以没有但是千万不能错。

  • ES 存数据时,需要使用 json 格式包装数据,不符合json 语法的纯字符无法保存;
  • ES 序列化复杂的 bean 对象时,如果 fastjson 报错,推荐使用 Gson,很强!

TIPS😙😙😙:

  • Gson 相比 fastjson:Gson 序列化能力更强,但是 反序列化时,fastjson 速度更快。

2.10- 查看 ES 数据库卡号,对比自己的深圳通地铁卡,逐渐发现了一些脱敏规律。

日志当中卡号脱敏字段密文反解猜想:
由脱敏的密文卡号反推真实卡号,因为所有卡号密文当中没有J开头的数据, 但是有A开头的数据,A != 0,而且出现了 BCDEFGHIJ 没有 K,所以猜想卡号映射关系如图!!!

类似摩斯电码解密。。。我现在还不确定这个解密方式是否正确🙄🙄🙄


2.11- cn.java666.sztcommon.util.ParseCardNo#parse 实现了支持自动识别卡号明文和密文、一键互转功能。 cn.java666.etlspringboot.controller.CardController#get 实现了卡号明文和密文互转 REST API。


3- 搭建数仓:深圳地铁数仓建模

3.1- 第一步,分析业务

确定业务流程 ---> 声明粒度 ---> 确定维度 ---> 确定事实

3.2- 第二步,规划数仓结构

参考行业通用的数仓分层模式:ODS、DWD、DWS、ADS,虽然原始数据很简单,但是我们依然使用规范的流程设计数据仓库。

  • 第一层:ODS 原始数据层
ods/ods_szt_data/day=2018-09-01/   
# szt_szt_page/day=2018-09-01/  
  • 第二层:DWD 清洗降维层
    区分维表 dim_ 和事实表 fact_,为了使粒度更加细化,我们把进站和出站记录分开,巴士数据暂不考虑。
dwd_fact_szt_in_detail      进站事实详情表
dwd_fact_szt_out_detail     出站事实详情表
dwd_fact_szt_in_out_detail  地铁进出站总表
  • 第三层:DWS 宽表层
dws_card_record_day_wide  每卡每日行程记录宽表【单卡单日所有出行记录】
  • 第四层:ADS 业务指标层【待补充】
【体现进站压力】 每站进站人次排行榜      
	ads_in_station_day_top
【体现出站压力】 每站出站人次排行榜      
	ads_out_station_day_top
【体现进出站压力】 每站进出站人次排行榜      
	ads_in_out_station_day_top
【体现通勤车费最多】 每卡日消费排行      
	ads_card_deal_day_top  
【体现线路运输贡献度】 每线路单日运输乘客总次数排行榜,进站算一次,出站并且联程算一次     
	ads_line_send_passengers_day_top  
【体现利用率最高的车站区间】 每日运输乘客最多的车站区间排行榜       
	ads_stations_send_passengers_day_top
【体现线路的平均通勤时间,运输效率】 每条线路单程直达乘客耗时平均值排行榜     
	ads_line_single_ride_average_time_day_top
【体现深圳地铁全市乘客平均通勤时间】 所有乘客从上车到下车间隔时间平均值    
	ads_all_passengers_single_ride_spend_time_average
【体现通勤时间最长的乘客】 单日从上车到下车间隔时间排行榜     
	ads_passenger_spend_time_day_top
【体现车站配置】 每个站点进出站闸机数量排行榜
	每个站点入站闸机数量  		ads_station_in_equ_num_top
	每个站点出站闸机数量    		ads_station_out_equ_num_top
【体现各线路综合服务水平】 各线路进出站闸机数排行榜
	各线路进站闸机数排行榜 		ads_line_in_equ_num_top.png
	各线路出站闸机数排行榜 		ads_line_out_equ_num_top
【体现收入最多的车站】 出站交易收入排行榜   
	ads_station_deal_day_top
【体现收入最多的线路】 出站交易所在线路收入排行榜   
	ads_line_deal_day_top
【体现换乘比例、乘车体验】 每天每线路换乘出站乘客百分比排行榜  
	ads_conn_ratio_day_top
【体现每条线的深圳通乘车卡普及程度 9.5 折优惠】 出站交易优惠人数百分比排行榜     
	ads_line_sale_ratio_top
【体现换乘的心酸】 换乘耗时最久的乘客排行榜	
	ads_conn_spend_time_top
【体现线路拥挤程度】 上车以后还没下车,每分钟、小时每条线在线人数   
	ads_on_line_min_top

3.3- 第三步:建库建表计算指标

hdfs 关闭权限检查。hive 设置保存目录 /warehouse;
hue 创建 hue 用户,赋予超级组。hue 切换到 hue 用户,执行 hive sql 建库 szt;
库下面建目录 ods dwd dws ads;

上传原始数据到 /warehouse/szt.db/ods/
szt-etl-data.csv szt-etl-data_2018-09-01.csv szt-page.jsons

查看: hdfs dfs -ls -h hdfs://cdh231:8020/warehouse/szt.db/ods/

接下来使用 HUE 按照 sql/hive.sql 依次执行 HQL 语句.....

也可以使用 IDEA Database 工具栏操作,附送idea cdh hive 完美驱动 https://github.com/timveil/hive-jdbc-uber-jar/releases

也可以使用 DBeaver (我只想说, 上古产品 Sqlyog、navicat、heidisql、workbench 全都是战五渣),因为有时候复杂的查询可以一边执行一边在另一个客户端工具查看结果,这对于复杂的嵌套查询 debug 非常有助于分析和跟踪问题。DBeaver 客户端自带图表,不过没有 HUE 好看:


已经完成的指标分析:


3.3.1 - 深圳地铁进站人次排行榜:

2018-09-01,当天依次为:五和、布吉、丹竹头,数据说明当天这几个站点进站人数最多。


3.3.2 - 深圳地铁出站人次排行榜:

2018-09-01,当天出站乘客主要去向分别为:深圳北高铁站、罗湖火车站、福田口岸。


3.3.3- 深圳地铁进出站总人次排行榜:

2018-09-01,当天车站吞吐量排行榜:
五和站???、布吉站(深圳东火车站)、罗湖站(深圳火车站)、深圳北(深圳北高铁站)。。。
五和站为什么这么秀??? 🚀


3.3.4- 深圳地铁乘客车费排行榜:

2018-09-01,当天车费最高的乘客花了 48 元人民币
🚄🚄🚄 说明:深圳通地铁卡不记名,未涉及个人隐私!!!


3.3.5- 深圳地铁各线路单日发送旅客排行榜:

2018-09-01,当天五号线客运量遥遥领先,龙岗线碾压一号线,心疼龙岗人民!😳


3.3.6- 深圳地铁每日运输乘客最多的区间排行榜:

2018-09-01当天前三名分别是:赤尾>华强北,福民>福田口岸,五和>深圳北


3.3.7- 深圳地铁每条线路单程直达乘客耗时平均值排行榜:

2018-09-01,当天五号线单程直达乘客平均耗时1500s,约合25分钟,平均值最长的是 11号线,平均耗时 40 分钟


3.3.8- 深圳地铁所有乘客通勤时间平均值:

2018-09-01,当天所有乘客通勤时间平均值 1791 s,约合 30 分钟


3.3.9- 深圳地铁所有乘客通勤时间排行榜:

2018-09-01,当天所有乘客通勤时间排行榜,站内滞留最久的乘客间隔 17123 秒,约合 4.75 小时,实际情况只需要 20 分钟车程,难道是进站搞事情???


3.3.10- 深圳地铁每个站点进出站闸机数量排行榜:

2018-09-01,当天福田站双项第一


3.3.11- 深圳地铁各线路进出站闸机数量排行榜:

2018-09-01,当天深圳地铁一号线长脸了@_@,两个指标都是第一,港铁四号线全部垫底,后妈养的???


3.3.12- 深圳地铁各站收入排行榜:

2018-09-01,当天上午深圳北站收入 4 万元人民币,排名第一


3.3.12- 深圳地铁各线路收入排行榜:

2018-09-01,数据显示一号线依然是深圳地铁最多收入的线路,1号线上午收入 30 万元人民币,其次是五号线紧随其后


3.3.13- 深圳地铁各线路换乘出站乘客百分比排行榜:

换乘后从五号线出来的乘客是占比最高的 15.6%,从九号线出站的乘客,换乘比例最低,仅 9.42%


3.3.14- 深圳地铁各线路直达乘客优惠人次百分比排行榜:

目前可以确定的是,持有深圳通地铁卡可以享受9.5折优惠乘坐地铁,从统计结果看,2018-09-01当天,七号线使用地铁卡优惠的乘客人次占比最高,达到 90.36%,排名最低的是五号线,占比 84.3%


3.3.15- 深圳地铁换乘时间最久的乘客排行榜:

统计过程发现难以理解的现象,有几个乘客进站以后,没有刷卡出站就换乘了公交车,于是出现了同一个地铁站进出站,但是标记为联程的记录


4- 新增模块:SZT-kafka-hbase

SZT-kafka-hbase project for Spring Boot2
看过开源的 spring-boot-starter-hbase、spring-data-hadoop-hbase,基础依赖过于老旧,长期不更新;引入过程繁琐,而且 API 粒度受限;数据库连接没有复用,导致数据库服务读写成本太高。

于是自己实现了 hbase-2.1 + springboot-2.1.13 + kafka-2.0 的集成,一个长会话完成 hbase 连续的增删改查👑👑👑,降低服务器资源的开销。

主要特色:

  • knife4j 在线调试,点击鼠标即可完成 hbase 写入和查询,再也不用记住繁琐的命令😏😏😏。

  • hbase 列族版本历史设置为 10,支持配置文件级别的修改。可以查询某卡号最近 10 次交易记录。

  • hbase rowkey 设计为卡号反转,使得字典排序过程消耗的服务器算力在分布式环境更加均衡。

  • 全自动的建库建表【本项目的 hbase 命名空间为 szt】,实现幂等操作,无需担心 hbase 数据库的污染。

效果展示:

  • 准备部署完成的 hbase,适当修改本项目配置文件,运行 SZT-kafka-hbase 项目,效果如下:

启动:

api-debug,随便写点东西进去,狂点发送。能写多快就考验你的手速了😏😏😏:

hue-hbase 查表:

hue-hbase 查看历史版本:

hbase-shell 命令:
全表扫描,返回十个版本格式化为字符串显示,压榨服务器性能的时候到啦!!!😝😝😝
scan 'szt:data', {FORMATTER => 'toString',VERSIONS=>10}


  • 接下来接入 kafka 🎯🎯🎯
    启动 cn.java666.etlflink.app.Redis2Kafka,生产消息,适当调慢生产速度,以免机器崩溃。
    不出意外的话,你会看到 SZT-kafka-hbase 项目的控制台打印了日志:

如果 hbase 崩溃了,看看内存够不够,我就直接怼上 2GB X 3 个节点🌟🌟🌟:

5- SZT-flink 模块新增 cn.java666.etlflink.app.Json2HBase

实现了从 redis 或者其他数据源取出 json 串,保存到 hbase 表。本项目中从 redis 获取 json(当然更推荐 kafka),通过 flink 清洗存到 hbase flink:flink2hbase 表中。用于实时保存深圳通刷卡记录,通过卡号查询可以获取卡号最近10次(如果有10次)交易记录。

简化了上一版 hbase 写入 bean 的方式,JSON 再一次赢得掌声😏😏😏。

val keys = jsonObj.keySet().toList
val size = keys.size()

for (i <- 0 until size) {
	val key = keys.get(i)
	val value = jsonObj.getStr(key)
	putCell(card_no_re, cf, key, value)
}

6- 新增实时处理模块 SZT-flink

完成 flink 读取 kafka,存到 clickhouse 功能。


...继续开发中🛠🛠🛠...


TODO🔔🔔🔔:

  • 解析 redis pageJson,转换数据格式为最小数据单元存到 csv,减少原始数据的冗余字符,方便存取和传输。丰富数据源的格式,兼容更多的实现方案;
  • 推送 kafka,使用队列传输数据;
  • 存入 elasticsearch,使用全文检索实现实时搜索,kibana 可视化展示;
  • 数仓建模:ODS、DWD、DWS、ADS
  • hive on spark 数仓建模、分析计算;
  • spark on hive,本地开发 spark 程序,操作远程 hive 数据库;
  • 刷卡记录实时写入 hbase,支持最近交易记录的查询;
  • [-] oozie 调度,数据太少啊 嘤嘤嘤😮😮😮;
  • 实时思路分析数据:flink 流式实时分析早晚高峰站点压力排行;
  • 离线思路分析数据:spark 微批处理;
  • DataV 可视化大屏展示;

更新日志🌥:

  • 2020-05-25:

    • flink 实时流处理功能部分上线。完成 flink 读取 kafka,存到 clickhouse 模块;
    • 补充第一期开发计划架构图;
    • 下一步,计划开发数据湖中台解决方案,规模比较大。目前这个项目已经初现雏形,短期内以维护和优化为主【原则就是先上线后迭代】;
  • 2020-05-22:

    • 补充第一期开发计划的架构图,帮助理解整个业务流程;
  • 2020-05-14:

    • RedisSinkPageJsonpackage cn.java666.etlflink.sink 移到 package cn.java666.etlflink.app 更名为 Jsons2Redis,方便归类,该模块用于解析原始数据多行json到redis;
  • 2020-05-01:

    • 实现了从 redis 或者其他数据源取出 json 串,保存到 hbase 表;
    • 实现了 hbase-2.1 + springboot-2.1.13 + kafka-2.0 的集成;
    • 实时消费 kafka 消息存到 hbase 数据库,支持实时查询某卡号最近 n 次交易记录;
  • 2020-04-30:

    • 实现了 hbase-2.1 + springboot-2.1.13 的集成,一个长会话完成 hbase 连续的增删改查👑👑👑,降低服务器资源的开销。
  • 2020-04-27:

    • 彻底的解决了静态资源无法热部署的问题;
<dependency>
	<groupId>org.springframework.boot</groupId>
	<artifactId>spring-boot-devtools</artifactId>
	<scope>runtime</scope>
	<optional>true</optional>
</dependency>

######################### 实时热部署 ###################################
#"关闭缓存, 即时刷新"
spring.freemarker.cache=false
spring.thymeleaf.cache=false

#热部署生效
spring.devtools.restart.enabled=true
#是否支持livereload
spring.devtools.livereload.enabled=true
#设置重启的目录,添加那个目录的文件需要restart
spring.devtools.restart.additional-paths=src/main/*
#设置不需要重启的目录
#spring.devtools.restart.exclude=static/**,public/**
  • 202-04-27:
    • 完成所有线路规划+换乘方案的抓取入库,合计 45932 条;
    • 解决了 hive 注释乱码问题;
alter table COLUMNS_V2 modify column COMMENT varchar(256) character set utf8;
alter table TABLE_PARAMS modify column PARAM_VALUE varchar(4000) character set utf8;
alter table PARTITION_PARAMS  modify column PARAM_VALUE varchar(4000) character set utf8;
alter table PARTITION_KEYS  modify column PKEY_COMMENT varchar(4000) character set utf8;
alter table  INDEX_PARAMS  modify column PARAM_VALUE  varchar(4000) character set utf8;
  • 2020-04-24:

    • 完成新的指标计算任务:深圳地铁各线路换乘出站乘客百分比排行榜;
    • 完成新的指标计算任务:深圳地铁各线路直达乘客优惠人次百分比排行榜;
  • 2020-04-23:

    • 完成新的指标计算任务:深圳地铁各线路单程直达乘客耗时平均值排行榜;
    • 完成新的指标计算任务:深圳地铁所有乘客通勤时间平均值;
    • 完成新的指标计算任务:深圳地铁所有乘客通勤时间排行榜(倒序);
    • 完成新的指标计算任务:深圳地铁各站点、线路,进站、出站闸机数排行榜;
    • 完成新的指标计算任务:深圳地铁各站点、线路,收入排行榜;
  • 2020-04-22:

    • 更新文档;
    • 完成新的指标计算任务:每日运输乘客最多的区间排行榜;
  • 2020-04-21:

    • 新增模块:SZT-spark-hive,本地开发 spark 程序,操作远程 Hive 数据库;
    • Debug:spark on hive 本地开发,远程提交 yarn 踩坑,主要是为了缓解开发主机的压力;
  • 2020-04-20:

    • 更新项目文档;
    • 自制项目 logo;
    • 继续写 SQL 计算新指标,本打算切到 hive 3.1 使用 TEZ 引擎,但是 hive on spark 速度已经很给力了,至少是 MR 引擎的 10 倍速度,先用着;
  • 2020-04-19:

    • vmware 虚拟机扩容时误删系统文件rm -rf /usr/ 🥵,好在 HDFS、Kafka、ES 自带副本机制,而且大部分业务数据都是挂载到外部磁盘,所以重要数据和组件日志基本没丢。cdh 集群添加了新的节点;
    • 恢复工作环境,从 hive on MR 切换到 hive on spark;
  • 2020-04-18:

    • 规划数仓,搭建数仓环境;
  • 2020-04-17

    • 修正错别字;
    • 发布v0.12;
  • 2020-04-16

    • 重构项目;
    • 补充文档
    • 发布v0.1
  • 2020-04-15

    • 增加 common 模块,拆分解耦;
    • 支持自动识别卡号明文和密文,一键互转,提供 REST API;
    • 修复 ES 时区导致的错误统计数量;
    • Redis2Csv 实现了按天转换 csv 存盘;
  • 2020-04-14

    • 重构;
    • 完成 csv 格式文件的抽取;
    • 添加 GPL-3 开源证书,鼓励开源分发;
    • 添加徽标;
    • 完成写入 ES 数据库,添加时间映射,kibana 实时查看刷卡数据统计曲线的变化;
  • 2020-04-13

    • 项目初始化;
    • 完成数据源清洗去重,存到 redis;
    • 完成 redis 查询 REST API 的开发;
    • 完成 flink 自定义 source redis 的开发,并且更细粒度清洗源数据;
    • 完成 推送源数据到 kafka;

联系😪:

欢迎交流技术,接头暗号github

百度和谷歌能找到的问题就不要再问了!很累的😕😕😕

补充💌💌💌:

  • 不开小密圈;
  • 不卖课、不卖教程;
  • 不求赞,不求粉;
  • 不发广告、不骚扰;
  • 不割韭菜

坚持原则和底线。

比心🤞🤞🤞

吐个槽🍦🍦🍦:

程序员这辈子一定会遇到的三个问题:

  • 乱码问题🌚;
  • 时区不一致问题🌗;
  • 软件版本不兼容问题❄;

教训:

  • 大数据程序员千万不能生产错误的数据,容忍程序运行失败、甚至没有输出数据,失败了可以跟踪原因,至少不会有脏数据。
  • 一旦数据错误,会影响后面的所有计算流程,甚至导致错误决策。

统计信息:

GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/> Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. <one line to give the program's name and a brief idea of what it does.> Copyright (C) <year> <name of author> This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>. Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: <program> Copyright (C) <year> <name of author> This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see <https://www.gnu.org/licenses/>. The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read <https://www.gnu.org/licenses/why-not-lgpl.html>.

简介

深圳地铁大数据客流分析系统🚇🚄🌟 展开 收起
Scala
GPL-3.0
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
Scala
1
https://gitee.com/chu888chu888/SZT-bigdata.git
git@gitee.com:chu888chu888/SZT-bigdata.git
chu888chu888
SZT-bigdata
SZT-bigdata
master

搜索帮助

14c37bed 8189591 565d56ea 8189591