計算機畢業設計Hadoop+Hive地震預測系統 地震數據分析可視化 地震爬蟲 大數據畢業設計 Spark 機器學習 深度學習 Flink 大數據

2024 ?屆本科畢業論文(設計)

?基于Hadoop的地震預測的

分析與可視化研究

姓 ???名:____田偉情_________

系 ???別:____信息技術學院___

專 ???業:數據科學與大數據技術

學 ???號:__2011103094________

指導教師:_____王雙喜________

年 ??月 ??日

目 錄

1 緒論

2 ?相關技術與工具

2.1 ?大數據技術概述

2.2 ?hadoop介紹

3 地震數據分析

3.1 數據收集與處理

4 地震數據可視化

4.1 可視化技術概述

4.2 可視化設計原則

4.3 可視化實現與評估

5 系統設計與實現

5.1 登錄頁面

5.2

5.3 地震數據分析頁面

5.4 地震數據維護頁面

6 結果討論

6.1 結果總結

6.2 結果分析

6.3 存在問題

6.4 結果展望

參考文獻

致 謝

基于Hadoop的地震預測的分析與可視化研究

田偉情 ???指導教師:王雙喜

(商丘師范學院信息技術學院,河南商丘 ?476000) ??

??

摘 ?要:08年四川5·12汶川地震、10年青海玉樹地震、13年四川雅安地震,到23年甘肅積石山地震,大大小小的地震無數次的上演,帶給我們的不僅是肉體上的疼痛,還有無法治愈的心靈創傷。在睡夢中因地震而驚醒,轟隆隆的地裂聲還有那些肉眼可見的消失的村莊恐怕是無數遭遇地震的人的噩夢,也是所有人共同的悲哀。即使沒有親身經歷過,但新聞報道中倒坍的房屋,埋頭救人的官兵,隔著屏幕也能感受到疼痛。?因此,準確地預測地震的發生時間、地點和震級對于人們的生命安全和財產安全具有重要意義。然而,地震預測是一個復雜而困難的問題,受到多種因素的影響,如地質構造、地下水位變化、地殼運動等。傳統的地震預測方法往往依賴于經驗和專家判斷,準確度和效率有限。隨著大數據技術的快速發展,越來越多的地震數據被收集和存儲起來。大數據分析和處理技術能夠對這些海量的地震數據進行高效的分析和建模,為地震預測提供更準確的預測模型。然而,大數據在地震預測中的應用也面臨著一些挑戰。首先,地震數據具有高維度和復雜的特征,需要選擇合適的特征參數進行分析和建模。其次,地震數據的規模龐大,傳統的數據處理方法無法滿足實時性要求。此外,地震數據的可視化也是一個重要問題,如何將海量的地震數據以直觀的方式展示給用戶,提高地震預測的可理解性和可操作性,也是一個需要解決的問題。 因此,本研究基于Hadoop的大數據技術,對地震數據進行分析和可視化,提高地震預測的準確性和效率。具體而言,本研究將使用Hadoop框架對地震數據進行分析和建模,利用線性回歸預測算法構建地震預測模型。同時,本研究利用echarts的可視化技術和工具,將地震數據以直觀的方式展示給用戶,提高地震預測的可理解性和可操作性。

關鍵詞:地震、地震預測、Hadoop、線性回歸預測算法

Analysis and visualization of earthquake prediction based on Hadoop??????????

TIAN Weiqing??????Supervisor: WANG Shuangxi

(College of Information Technology, Shangqiu Normal University, Shangqiu 476000, China)

Abstract :The 5.12 Wenchuan earthquake in Sichuan in 08, the Yushu earthquake in Qinghai in 10, the Ya'an earthquake in Sichuan in 13, and the Jishishan earthquake in Gansu in 23 years, earthquakes of all sizes have been staged countless times, bringing us not only physical pain, but also incurable psychological wounds. Waking up in your sleep by the earthquake, the rumbling sound of the ground cracking, and the visible disappearance of the villages are probably the nightmare of countless people who have been hit by the earthquake, and it is also the sorrow shared by everyone. Even if you haven't experienced it yourself, you can feel the pain through the screen of the collapsed houses in the news reports and the officers and soldiers who buried their heads in saving people. Therefore, it is of great significance to accurately predict the time, place and magnitude of earthquakes for the safety of people's lives and property. However, earthquake prediction is a complex and difficult problem that is affected by a variety of factors, such as geological structure, changes in groundwater level, crustal movements, etc. Traditional earthquake prediction methods often rely on experience and expert judgment, and their accuracy and efficiency are limited. With the rapid development of big data technology, more and more seismic data is collected and stored. Big data analysis and processing technology can efficiently analyze and model these massive seismic data, and provide more accurate prediction models for earthquake prediction. However, the application of big data in earthquake prediction also faces some challenges. First of all, seismic data has high-dimensional and complex features, and it is necessary to select appropriate feature parameters for analysis and modeling. Secondly, the scale of seismic data is huge, and traditional data processing methods cannot meet the real-time requirements. In addition, the visualization of seismic data is also an important problem, and how to display massive seismic data to users in an intuitive way and improve the comprehensibility and operability of earthquake prediction is also a problem that needs to be solved. Therefore, this study analyzes and visualizes earthquake data based on Hadoop's big data technology to improve the accuracy and efficiency of earthquake prediction. Specifically, this study will use the Hadoop framework to analyze and model seismic data, and use the linear regression prediction algorithm to construct an earthquake prediction model. At the same time, this study uses the visualization technology and tools of ECHARTS to present earthquake data to users in an intuitive way, so as to improve the comprehensibility and operability of earthquake prediction.

Key words:earthquake, earthquake prediction、Hadoop、Linear regression prediction algorithm

核心算法代碼分享如下:

import csv
import random
import re
import time
import datetime
import pymysql
import requests
#將數據保存到mysql方便制作表格查詢
provinces = ['北京', '天津', '河北', '山西', '內蒙古', '遼寧', '吉林', '黑龍江', '上海', '江蘇', '浙江', '安徽','福建', '江西', '山東', '河南', '湖北', '湖南','廣東', '廣西', '海南', '重慶', '四川', '貴州', '云南', '西藏', '陜西', '甘肅', '青海', '寧夏','新疆', '香港', '澳門', '臺灣'
]
long_provinces = ['北京市', '天津市', '河北省', '山西省', '內蒙古自治區', '遼寧省', '吉林省', '黑龍江省', '上海市', '江蘇省', '浙江省', '安徽省','福建省', '江西省', '山東省', '河南省', '湖北省', '湖南省','廣東省', '廣西壯族自治區', '海南', '重慶市', '四川省', '貴州省', '云南省', '西藏自治區', '陜西省', '甘肅省', '青海省', '寧夏回族自治區','新疆維吾爾自治區', '香港特別行政區', '澳門特別行政區', '臺灣省'
]
with open('./world.csv', 'r',encoding='utf-8') as world_file :world_reader = csv.reader(world_file)errors=0line=0for row in world_reader:#magnitude ,stime_long, latitude, longitude, depth, addr ,stime_short,provincemagnitude = row[0]stime_long = row[1]latitude = row[2]longitude = row[3]depth = row[4]addr = row[5]stime_short = row[6]stime_year = row[7]stime_month = row[8]stime_clock= row[9]data_type='外國'addr=addr.replace(',',',')for province in provinces:if province in addr:data_type=province# magnitude, stime_long, latitude, longitude, depth, addr, stime_short,data_typeprint(magnitude, stime_long, latitude, longitude, depth, addr, stime_short,data_type)#tb_earthquakeconn = pymysql.connect(host='bigdata', user='root', password='123456', port=3306, db='hive_earthquake')cursor = conn.cursor()data = (magnitude, stime_long, latitude, longitude, depth, addr, stime_short,data_type)sql = "replace into tb_earthquake (magnitude, stime_long, latitude, longitude, depth, addr, stime_short,data_type) " \"values (%s,%s,%s,%s,%s,%s,%s,%s)"cursor.execute(sql,data)conn.commit()cursor.close()if data_type != '外國':for long_province in long_provinces:if data_type in long_province:earthquake_file = open("earthquake_hdfs.csv", mode="a+", newline='', encoding="utf-8")earthquake_writer = csv.writer(earthquake_file)earthquake_writer.writerow([magnitude, stime_long, latitude, longitude, depth, addr, stime_short,data_type,long_province,stime_year,stime_month,stime_clock])earthquake_file.close()else:earthquake_file = open("earthquake_hdfs.csv", mode="a+", newline='', encoding="utf-8")earthquake_writer = csv.writer(earthquake_file)earthquake_writer.writerow([magnitude, stime_long, latitude, longitude, depth, addr, stime_short,data_type,'無(外國)',stime_year,stime_month,stime_clock])earthquake_file.close()

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/bicheng/15752.shtml
繁體地址,請注明出處:http://hk.pswp.cn/bicheng/15752.shtml
英文地址,請注明出處:http://en.pswp.cn/bicheng/15752.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

【大數據面試題】33 Flink SQL做過哪些優化?

一步一個腳印,一天一道面試題 簡單寫幾個 Flink SQL 的優化 1.優化狀態管理 Flink 的狀態管理對整個程序的性能有較大影響。所以優化效果比較好。 設置空閑狀態自動清理(TTL Time-to-Live)數據量大時選擇 RocksDBStateBackend // 設置狀…

《圖解支付系統設計與實現》電子書_V20240525

相較于上次公開發布的V20240503版本,變更內容如下: 根據掘金網友zz67373(李浩銘)的勘誤建議,優化了部分描述。增加:金額處理規范,低代碼報文網關實現完整代碼,分布式流控等內容。擴…

Java虛擬機原理(下)-Dalvik vs ART-探秘Android虛擬機內在機制

Android系統作為移動端主流平臺,其高效的虛擬機無疑是其核心競爭力之一。今天,就讓我們一起剝開Dalvik和ART虛擬機的外衣,深入解析它們的工作原理和優缺點,幫助你全面把握Android系統的運行機制。 正文導覽 Dalvik和ART虛擬機的發…

Openstack all-in-one_ironic 部署測試

1. 基礎環境 apt update apt install git python3-dev libffi-dev gcc libssl-dev apt install python3-venv 2. 設置虛擬環境變量 root@controller01:~# python3 -m venv /deploy/venv root@controller01:~# source /deploy/venv/bin/activate (venv) root@controller01:~#…

Nginx - 安全基線配置與操作指南

文章目錄 概述中間件安全基線配置手冊1. 概述1.1 目的1.2 適用范圍 2. Nginx基線配置2.1 版本說明2.2 安裝目錄2.3 用戶創建2.4 二進制文件權限2.5 關閉服務器標記2.6 設置 timeout2.7 設置 NGINX 緩沖區2.8 日志配置2.9 日志切割2.10 限制訪問 IP2.11 限制僅允許域名訪問2.12 …

debugger(一):打斷點的實現以及案例分析

〇、前言 最近在學習 debugger 的實現原理,并按照博客實現,是一個很不錯的小項目,這是地址。由于 macOS 的問題,系統調用并不完全相同,因此實現了兩個版本分支,一個是 main 版本分支(macOS M1 …

【一站式學會Kotlin】第八節:kotlin== 和 === 的差別和含義

作者介紹: 百度資深Android工程師T6,在百度任職7年半。 目前:成立趙小灰代碼工作室,歡迎大家找我交流Android、微信小程序、鴻蒙項目。 一:通俗易懂的人工智能教程:https://www.captainbed.cn/nefu/ 點一下…

Altium Designer 中鍵拖動,滾輪縮放,并修改縮放速度

我的版本是AD19,其他版本應該都一樣。 滾輪縮放 首先,要用滾輪縮放,先要調整一下AD 設置,打開Preferences,在Mouse Wheel Configuration 里,把Zoom Main Window 后面Ctrl 上的對勾取消掉,再把…

C++中的懸掛指針和野指針

懸掛指針(dangling pointer)和野指針(wild pointer)是兩種常見的指針錯誤,雖然它們都可能導致未定義行為,但它們產生的原因和表現有所不同。 1.懸掛指針(Dangling Pointer) 懸掛指…

2024 ISCC pwn wp

iscc 練武pwn 總結第一周chaosISCC_easyFlagshopping 第二周ISCC_easyISCC_Uheapheap 第三周miaoYour_programeazy_heap 總結 總體感覺iscc考察的題目都挺基礎的,在目前這種比賽的大環境下,仍然出這種,比較基礎的題目,實在是難得…

智馭未來:探究AIGC行業的戰略入局時機與前景展望

當前時點涉足人工智能生成內容(AIGC)行業,是一個策略性抉擇,基于對該行業現狀的深度剖析及對未來趨勢的前瞻性預判,其可行性與吸引力顯著。 行業發展階段分析: 技術迭代加速:近年來&#xff0c…

力扣刷題---2283. 判斷一個數的數字計數是否等于數位的值【簡單】

題目描述 給你一個下標從 0 開始長度為 n 的字符串 num &#xff0c;它只包含數字。 如果對于 每個 0 < i < n 的下標 i &#xff0c;都滿足數位 i 在 num 中出現了 num[i]次&#xff0c;那么請你返回 true &#xff0c;否則返回 false 。 示例 1&#xff1a; 輸入&a…

SpringCloud系列(31)--使用Hystrix進行服務降級

前言&#xff1a;在上一章節中我們創建了服務消費者模塊&#xff0c;而本節內容則是使用Hystrix對服務進行服務降級處理。 1、首先我們先對服務提供者的服務進行服務降級處理 (1)修改cloud-provider-hystrix-payment8001子模塊的PaymentServiceImpl類 注&#xff1a;HystrixP…

學習elixir(1)

突然發現elixir很有趣&#xff0c;所以想記錄以下學習內容 # .ex .exs file elixir simple.exs # mix new <app_name> # mix deps.get; mix deps.update; mix deps.compile # 怎么使用mix escript.build # eg. 在mix.exs添加escript: [main_module: IntentionCLI, name:…

Window在VScode運行C/C++程序

首先說明&#xff1a;不同運行環境&#xff08;Linux/Window&#xff09;下的頭文件會有差異&#xff0c;要注意變換&#xff01;生成可執行文件 Window默認生成a.exe&#xff0c;Linux默認生成a.out # C源代碼 g test.cpp # C語言源代碼 g test.c 或 gcc test.c直接輸入a.ex…

從零開始學逆向,js逆向啟蒙:有道翻譯

語言&#xff1a;js、python 工具&#xff1a;pycharm、chrome瀏覽器F12調試、chatgpt&#xff08;補充js第三方庫&#xff0c;轉python&#xff09;、node.js(js運行)&#xff08;必須&#xff09; 目標&#xff1a;學習掌握基本js逆向知識。 對象&#xff1a; 有道翻譯 &a…

怎么判斷同步時序邏輯電路和異步時序邏輯電路?

&#x1f3c6;本文收錄于「Bug調優」專欄&#xff0c;主要記錄項目實戰過程中的Bug之前因后果及提供真實有效的解決方案&#xff0c;希望能夠助你一臂之力&#xff0c;幫你早日登頂實現財富自由&#x1f680;&#xff1b;同時&#xff0c;歡迎大家關注&&收藏&&…

力扣刷題---2418. 按身高排序【簡單】

題目描述 給你一個字符串 數組 names &#xff0c;和一個由 互不相同 的正整數組成的數組 heights 。兩個數組的長度均為 n 。 對于每個下標 i&#xff0c;names[i] 和 heights[i] 表示第 i 個人的名字和身高。 請按身高 降序 順序返回對應的名字數組 names 。 示例 1&…

僵尸進程,孤兒進程,守護進程

【一】僵尸進程 1.僵尸進程是指完成自己的任務之后&#xff0c;沒有被父進程回收資源,占用系統資源,對計算機有害&#xff0c;應該避免 """ 所有的子進程在運行結束之后都會變成僵尸進程(死了沒死透)還保留著pid和一些運行過程的中的記錄便于主進程查看(短時間…

嵌入式作業5

在函數main.c中初始化三種顏色的燈&#xff1a; gpio_init(LIGHT_BLUE, GPIO_OUTPUT, LIGHT_OFF); //藍燈 gpio_init(LIGHT_GREEN, GPIO_OUTPUT, LIGHT_OFF); //綠燈 gpio_init(LIGHT_RED, GPIO_OUTPUT, LIGHT_OFF); //紅燈 同時為了響應以上修改&#xff0c;進入isr。c…