计算机毕业设计PySpark+Hadoop+Hive机票航班数据分析可视化大屏 机票预测 航班预测系统 机票爬虫 飞机票推荐系统 大数据毕业设计

培养大数据应用开发工程师,学生综合运用所学软件系统开发的基础理论和专业知识,掌握软件系统开发的设计与实现的流程、方法与技术,并具备解决软件系统开发过程中出现的一般问题的能力;同时培养学生务实、细致、严格、认真和吃苦耐劳的工作作风。

进一步提高学生所学的软件系统开发的理论知识水平,训练学生软件开发的动手能力,掌握软件系统开发过程中需求分析、概要设计、详细设计、功能测试等流程所需技能;贴近工作实际,让学生在对某个项目进行需求分析、功能确认后,完成整个系统架构的搭建以及功能实现,能独立完成开发工具的选择、功能模块的划分、数据库的设计以及软件功能的测试等任务,达到提高软件系统的设计与实现能力的目的。

通过毕业设计,使学生对软件系统的设计和实现的全过程有比较全面的了解,熟悉软件开发的有关流程、软件平台和开发工具的特点,为今后独立工作打下基础。

核心算法代码分享如下:

python 复制代码
#Flink连接HDFS上面的CSV文件 使用Flink_SQL分析完入表
## 启动hadoop
## cd /data/hadoop/sbin
## sh /data/hadoop/sbin/start-all.sh
## 启动hive
## cd /data/hive
## nohup hive --service metastore &
## nohup hive --service hiveserver2 &
import os
from pyflink.common import Row
from pyflink.table import (EnvironmentSettings, TableEnvironment, TableDescriptor, Schema,
                           DataTypes, FormatDescriptor)
from pyflink.table.expressions import lit, col
from pyflink.table.udf import udtf
import logging
import sys

logging.basicConfig(stream=sys.stdout, level=logging.INFO, format="%(message)s")

env_settings = EnvironmentSettings.in_streaming_mode()
table_env = TableEnvironment.create(env_settings)


jars = []
for file in os.listdir(os.path.abspath(os.path.dirname(__file__))):
    if file.endswith('.jar'):
        file_path = os.path.abspath(file)
        jars.append(file_path)

str_jars = ';'.join(['file:///' + jar for jar in jars])
table_env.get_config().get_configuration().set_string("pipeline.jars", str_jars)
# table_env.get_config().get_configuration().set_float('taskmanager.memory.network.fraction',0.8)
# table_env.get_config().get_configuration().set_string('taskmanager.memory.network.min','8gb')
# table_env.get_config().get_configuration().set_string('taskmanager.memory.network.max','16gb')
table_env.get_config().get_configuration().set_string('parallelism.default','1')
#先读取hadoop_hdfs上的CSV文件
table_env.execute_sql(
                """
                    CREATE  TABLE `ods_flight` (
                          `start_city` string COMMENT '出发城市',
                          `end_city` string  COMMENT '到达城市',
                          `stime` string  COMMENT '出发日期',
                          `airline_name` string  COMMENT '航班名称',
                          `flight_info` string  COMMENT '飞机详细信息',
                          `flight_type1` string  COMMENT '飞机型号',
                          `flight_type2` string  COMMENT '飞机系列',
                          `setup_time` string  COMMENT '出发时间',
                          `arr_time` string  COMMENT '到达时间',
                          `start_airport` string  COMMENT '起飞机场和航站楼',
                          `arr_airport` string  COMMENT '到达机场和航站楼',
                          `ontime_rate` bigint  COMMENT '准点率',
                          `flight_total_time` string  COMMENT '飞行时间字符串',
                          `price` bigint  COMMENT '价格',
                          `price_desc` string  COMMENT '优惠折扣力度',
                          `flight_company` string  COMMENT '航空公司',
                          `flight_type3` string  COMMENT '飞行性质',
                          `setup_time_math` double  COMMENT '出发时间_数字辅助',
                          `arr_time_math` double  COMMENT '到达时间_数字辅助',
                          `arr_time2` string  COMMENT '第几天到达',
                          `start_airport_simple` string  COMMENT '起飞机场',
                          `arr_airport_simple` string  COMMENT '到达机场',
                          `flight_total_time_math` bigint  COMMENT '飞行时长_数字辅助',
                          `price_desc_math` double  COMMENT '优惠折扣力度_数字辅助'
                        ) WITH(
                           'connector' = 'filesystem',
                            'path' ='hdfs://bigdata:9000/flink_fliggy_flight/flight/hdfs_flights.csv',
                            'format' = 'csv'
                )   
                """
                      )

#设置下沉到mysql的表
table_env.execute_sql(
                """
                create  table tables01(
                    `airline_name` string primary key ,
                    `price_desc_math` double  ,
                    `price_desc` string  ,
                    `stime` string
                ) WITH(
                    'connector' = 'jdbc',
                    'url' = 'jdbc:mysql://bigdata:3306/Flink_Fliggy_Flight',
                    'table-name' = 'tables01',
                    'username' = 'root',
                    'password' = '123456',
                    'driver' = 'com.mysql.jdbc.Driver'


                )   
                """
                      )


#数据分析并且导入
#result=table_env.sql_query("select * from ods_zymk limit 10 ")
table_env.execute_sql("""
                        insert into tables01
                        select distinct airline_name,price_desc_math,price_desc,stime
                        from ods_flight
                        order by stime desc,price_desc_math asc
                        limit 30


                  """).wait()
#print("表结构",result.get_schema())
#print("数据检查",result.to_pandas())
相关推荐
richdata4 小时前
商品数字化不是先做大数据,而是先把数据变成可用决策
大数据·运维·数据治理·商品数字化·智能补货·ai商品决策
傲笑风5 小时前
【openvino】tinybert基于openvino服务化部署(四)
人工智能·python·自然语言处理·nlp·bert·openvino
维基框架5 小时前
WIKI 知识库 v1.1.1 正式发布
人工智能·python
工业HMI实战笔记6 小时前
数据可视化实战:趋势图、仪表盘、热力图的正确用法
信息可视化·数据挖掘·数据分析
极新6 小时前
中国机器人已出海至141国,售后服务正成为新的机会
大数据·人工智能·机器人
AI_yangxi6 小时前
靠谱的短视频矩阵系统
大数据·人工智能·矩阵
czxxxc6 小时前
知识服务迎来 AI 变革,创客匠人 AI 智能体破解创作者运营难题
大数据·人工智能
戴西软件7 小时前
戴西iDWS.3DViz Suite数据轻量化可视化软件,从传统桌面软件向云端协同的重大突破
大数据·运维·网络·人工智能·机器学习·3d
衡石科技8 小时前
衡石科技携手超聚变联合发布HENGSHI BOX,引领私域ChatBI规模化落地
大数据·人工智能·科技
青春之我_XP8 小时前
MySQL 常用日期函数 实战指南
数据库·sql·mysql·数据分析·数据库开发·日期函数