├── 1.png ├── 111.png ├── 2.png ├── 3.png ├── 4.png ├── JedisUtil.java ├── README.md ├── ReduceByKeySortRddDemo.scala └── crawler.py /1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bysj2022NB/hive_spark_hadoop_music2024/6dc4ca24016320153d2bfa65ebe014cb43ca3ac5/1.png -------------------------------------------------------------------------------- /111.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bysj2022NB/hive_spark_hadoop_music2024/6dc4ca24016320153d2bfa65ebe014cb43ca3ac5/111.png -------------------------------------------------------------------------------- /2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bysj2022NB/hive_spark_hadoop_music2024/6dc4ca24016320153d2bfa65ebe014cb43ca3ac5/2.png -------------------------------------------------------------------------------- /3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bysj2022NB/hive_spark_hadoop_music2024/6dc4ca24016320153d2bfa65ebe014cb43ca3ac5/3.png -------------------------------------------------------------------------------- /4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bysj2022NB/hive_spark_hadoop_music2024/6dc4ca24016320153d2bfa65ebe014cb43ca3ac5/4.png -------------------------------------------------------------------------------- /JedisUtil.java: -------------------------------------------------------------------------------- 1 | package com.bigdata.storm.kafka.util; 2 | 3 | import redis.clients.jedis.Jedis; 4 | import redis.clients.jedis.JedisPool; 5 | import redis.clients.jedis.JedisPoolConfig; 6 | 7 | /** 8 | * @program: storm-kafka-api-demo 9 | * @description: redis工具类 10 | * @author: 小毕 11 | * @company: 清华大学深圳研究生院 12 | * @create: 2019-08-22 17:23 13 | */ 14 | public class JedisUtil { 15 | 16 | /*redis连接池*/ 17 | private static JedisPool pool; 18 | 19 | /** 20 | *@Description: 返回redis连接池 21 | *@Param: 22 | *@return: 23 | *@Author: 小毕 24 | *@date: 2019/8/22 0022 25 | */ 26 | public static JedisPool getPool(){ 27 | if(pool==null){ 28 | //创建jedis连接池配置 29 | JedisPoolConfig jedisPoolConfig = new JedisPoolConfig(); 30 | //最大连接数 31 | jedisPoolConfig.setMaxTotal(20); 32 | //最大空闲连接 33 | jedisPoolConfig.setMaxIdle(5); 34 | pool=new JedisPool(jedisPoolConfig,"node03.hadoop.com",6379,3000); 35 | } 36 | return pool; 37 | } 38 | 39 | public static Jedis getConnection(){ 40 | return getPool().getResource(); 41 | } 42 | 43 | /* public static void main(String[] args) { 44 | //System.out.println(getPool()); 45 | //System.out.println(getConnection().set("hello","world")); 46 | }*/ 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 计算机毕业设计吊炸遥遥领先Python+Hadoop+Spark+Hive音乐可视化 音乐数据分析 音乐大数据 音乐推荐系统 音乐数据仓库 大数据毕业设计 大数据毕设 2 | 3 | ## 要求 4 | ### 源码有偿一套(论文 PPT 源码+sql脚本+虚拟机) 5 | ### 6 | ### 加好友前帮忙start一下,并备注github有偿获取源码 7 | ### 我的QQ号是2877135669 8 | 9 | ### 或者 微信 bysj2023nb 10 | 11 | ### 加qq好友说明(被部分 网友整得心力交瘁): 12 | 1.加好友务必按照格式备注git虚拟机旅游 13 | 2.避免浪费各自的时间 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | ## 开发技术 29 | python 3.6.6 30 | 31 | java 1.8 32 | 33 | scala 2.11 34 | 35 | kafka_2.11-2.4.1 36 | 37 | zookeeper_3.4.6 38 | 39 | flink 1.14.0 40 | 41 | hadoop 2.7.6 42 | 43 | sqoop 1.4.6 44 | 45 | hive 1.2.1 46 | 47 | azkaban 2.5.0 48 | 49 | mysql 5.7 50 | 51 | FineReport 11 52 | 53 | ## 创新点 54 | 55 | 实时计算、离线计算、大屏、爬虫、虚拟机 56 | 57 | 58 | 59 | ## 补充说明 60 | 适合大数据毕业设计、数据分析、爬虫类计算机毕业设计 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | # 运行截图 71 | 72 | ![](111.png) 73 | 74 | 75 | ![](1.png) 76 | 77 | ![2](2.png) 78 | 79 | ![3](3.png) 80 | 81 | ![4](4.png) 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | # 演示视频 94 | 95 | https://www.bilibili.com/video/BV128411j7SG/?spm_id_from=333.999.0.0 96 | 97 | 或者去我B站搜关键词 98 | 99 | https://space.bilibili.com/474562629 -------------------------------------------------------------------------------- /ReduceByKeySortRddDemo.scala: -------------------------------------------------------------------------------- 1 | package com.bigdata.spark.reducebykey_sort 2 | 3 | import org.apache.spark.{SparkConf, SparkContext} 4 | 5 | /** 6 | * @program: spark-api-demo 7 | * @description: 类作用描述 8 | * @author: 小毕 9 | * @company: 清华大学深圳研究生院 10 | * @create: 2019-09-02 18:00 11 | */ 12 | object ReduceByKeySortRddDemo { 13 | 14 | def main(args: Array[String]): Unit = { 15 | val conf=new SparkConf() 16 | .setAppName("MapFilterApp") 17 | .setMaster("local") 18 | val sc=new SparkContext(conf) 19 | val rdd1=sc.parallelize(List(("tom", 1), ("jerry", 3), ("kitty", 2), ("shuke", 1))) 20 | val rdd2=sc.parallelize(List(("jerry", 2), ("tom", 3), ("shuke", 2), ("kitty", 5))) 21 | val rdd3=rdd1.union(rdd2) 22 | //按key进行聚合 23 | val rdd4=rdd3.reduceByKey(_+_) 24 | rdd4.collect.foreach(println(_)) 25 | //按value的降序排序 26 | val rdd5=rdd4.map(t=>(t._2,t._1)).sortByKey(false).map(t=>(t._2,t._1)) 27 | rdd5.collect.foreach(println) 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /crawler.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | from bs4 import BeautifulSoup 3 | import requests 4 | import sys 5 | import random 6 | import pymysql 7 | links = [] 8 | datas = [] 9 | hea = { 10 | 'User-Agent': 'Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.118 Safari/537.36' 11 | } 12 | urls =[ 13 | "https://www.chinanews.com/china.shtml", #国内 14 | "https://www.chinanews.com/society.shtml", #社会 15 | "https://www.chinanews.com/compatriot.shtml",#港澳 16 | "https://www.chinanews.com/wenhua.shtml",#文化 17 | "https://www.chinanews.com/world.shtml",#国际 18 | "https://www.chinanews.com/cj/gd.shtml",#财经 19 | "https://www.chinanews.com/sports.shtml",#体育 20 | "https://www.chinanews.com/huaren.shtml" #华人 21 | ] 22 | # 打开数据库连接 23 | db = pymysql.connect(host='127.0.0.1', user='root', password='123456', port=3396, db='news_recommendation_system') 24 | # 使用cursor()方法获取操作游标 25 | cursor = db.cursor() 26 | 27 | def main(): 28 | #reload(sys) 29 | #sys.setdefaultencoding("utf-8") 30 | #baseurl = 'https://www.chinanews.com/taiwan.shtml' # 要爬取的网页链接 31 | baseurl = 'https://www.chinanews.com/taiwan.shtml' # 要爬取的网页链接 32 | # deleteDate() 33 | # 1.爬取主网页获取各个链接 34 | getLink(baseurl) 35 | # 2.根据链接爬取内部信息并且保存数据到数据库 36 | getInformationAndSave() 37 | # 3.关闭数据库 38 | db.close() 39 | 40 | def getInformationAndSave(): 41 | for link in links: 42 | data = [] 43 | url = "https://www.chinanews.com" + link[1] 44 | cur_html = requests.get(url, headers=hea) 45 | cur_html.encoding = "utf8" 46 | soup = BeautifulSoup(cur_html.text, 'html.parser') 47 | # 获取时间 48 | title = soup.find('h1') 49 | title = title.text.strip() 50 | # 获取时间和来源 51 | tr = soup.find('div', class_='left-t').text.split() 52 | time = tr[0] + tr[1] 53 | recourse = tr[2] 54 | # 获取内容 55 | cont = soup.find('div', class_="left_zw") 56 | content = cont.text.strip() 57 | print(link[0] + "---" + title + "---" + time + "---" + recourse + "---" + url) 58 | saveDate(title,content,time,recourse,url) 59 | 60 | def deleteDate(): 61 | sql = "DELETE FROM news " 62 | try: 63 | # 执行SQL语句 64 | cursor.execute(sql) 65 | # 提交修改 66 | db.commit() 67 | except: 68 | # 发生错误时回滚 69 | db.rollback() 70 | 71 | def saveDate(title,content,time,recourse,url): 72 | try: 73 | cursor.execute("INSERT INTO news(news_title, news_content, type_id, news_creatTime, news_recourse,news_link) VALUES ('%s', '%s', '%s', '%s', '%s' ,'%s')" % \ 74 | (title, content, random.randint(1,8), time, recourse,url)) 75 | db.commit() 76 | print("执行成功") 77 | except: 78 | db.rollback() 79 | print("执行失败") 80 | 81 | def getLink(baseurl): 82 | html = requests.get(baseurl, headers=hea) 83 | html.encoding = 'utf8' 84 | soup = BeautifulSoup(html.text, 'html.parser') 85 | for item in soup.select('div.content_list > ul > li'): 86 | # 对不符合的数据进行清洗 87 | if (item.a == None): 88 | continue 89 | data = [] 90 | type = item.div.text[1:3] # 类型 91 | link = item.div.next_sibling.next_sibling.a['href'] 92 | data.append(type) 93 | data.append(link) 94 | links.append(data) 95 | 96 | if __name__ == '__main__': 97 | main() 98 | 99 | 100 | --------------------------------------------------------------------------------