簡易檢索 / 詳目顯示

研究生: 劉智中
Liou, Jhih-Jhong
論文名稱: 嵌入式系統程式自動評測系統─以樹莓派為例
Embedded System Program Automatic Evaluation System Taking Raspberry Pi as an Example
指導教授: 陳敬
Chen, Jing
戴顯權
Tai, Shen-Chuan
學位類別: 碩士
Master
系所名稱: 電機資訊學院 - 電機工程學系
Department of Electrical Engineering
論文出版年: 2024
畢業學年度: 112
語文別: 中文
論文頁數: 109
中文關鍵詞: 嵌入式系統自動評測模擬器
外文關鍵詞: embedded system, automatic evaluation, simulator
相關次數: 點閱:51下載:6
分享至:
查詢本校圖書館目錄 查詢臺灣博碩士論文知識加值系統 勘誤回報
  • 本論文研究設計一個關於嵌入式系統軟體功能正確性的自動評測系統,可用於嵌入式系統課程的程式作業評量。目前的技術已經可用軟體的方式模擬嵌入式系統的環境,並得出嵌入式系統程式會操控周邊裝置做出的行為(周邊裝置在每個時刻都會有對應的狀態,而特定時間區間內每個時刻的周邊裝置的狀態的集合稱為該時間區間內時周邊裝置的行為),但是由於嵌入式系統要達到特定效果時可用多種行為來實現(意即特定時刻特定裝置的狀態可能不固定),故只靠軟體模擬的方式檢驗特定時刻的裝置是否為指定狀態的作法,無法評測程式可能具有行為多樣性的題目類型。本研究基於此開發了一套自動評測系統,此系統中會應用軟體模擬嵌入式系統的方式,分析受測程式執行於嵌入式系統開發平台時會操控周邊裝置做出的行為,並且提供一套評測規則開發工具,讓題目的評測規則開發人員可以分析該行為是否符合題目所要求之效果;評測系統執行時會將周邊裝置每個時刻的狀態紀錄至一個檔案,然後評測系統會以該檔案的資料和開發人員所制定的評測規則為依據來判斷受測程式之正確性。

    This paper studies and designs an automatic evaluation system for the correctness of embedded system software functions, which can be used for evaluating program assignments in embedded system courses. At present, software can be used to simulate the environment of embedded systems and obtain the behavior that the embedded system program manipulates peripheral devices (peripheral devices have corresponding states at each moment, and the set of states of peripheral devices at each moment within a specific time interval is called the behavior of the peripheral output device within that time interval). However, Embedded systems can use a variety of behaviors to achieve specific effects (that is, the state of a specific device at a specific moment may not be fixed). Therefore, relying only on software simulation to check whether the device is in a specified state at a specific moment cannot evaluate the answers of questions with behavioral diversity. Based on this, this study developed an automatic evaluation system. This system uses software to simulate embedded systems, and analyzes the behavior of the peripheral devices that the tested program will control when executed on the embedded system development platform. It also provides a set of evaluation rule development tools so that the evaluation rule developers of the questions can analyze whether the behavior meets the requirements of the questions. When the evaluation system is executed, it will record the status of the peripheral device at each moment to a file, and then the evaluation system will judge the correctness of the program under test based on the data in the file and the evaluation rules established by the developers.

    第1章 緒論 1 1.1 研究背景 1 1.2 研究動機及目的 2 1.3 研究主題 2 1.3.1 評測規則開發 2 1.3.2 用軟體模擬嵌入式系統開發平台和其周邊裝置 4 1.4 章節規劃 4 第2章 文獻回顧 5 2.1 自動評測系統 5 2.1.1 評測系統類型 5 2.1.2 評測方式 6 2.1.3 防止惡意程式 6 2.1.4 UVA Online Judge 7 2.1.5 LeetCode 8 2.2 應用樹莓派開發嵌入式系統程式 8 2.2.1 嵌入式系統 8 2.2.2 樹莓派 9 2.3 嵌入式系統程式自動評測方式 10 2.3.1 函式執行日誌分析 11 2.3.2 軟體模擬 12 2.3.3 硬體模擬 13 2.3.4 討論 14 第3章 系統架構與設計 15 3.1 自動評測系統說明 15 3.2 系統軟硬體架構 17 3.2.1 硬體架構 17 3.2.2 軟體架構 17 3.3 系統運作模式 19 3.4 系統操作流程 21 3.5 使用介面 22 3.6 系統運行器之設計 23 3.7 修改後之嵌入式系統程式開發函式庫 25 3.7.1 嵌入式系統程式開發函式庫 25 3.7.2 模擬GPIO針腳 26 3.7.3 受測程式的邏輯一致性 26 3.8 裝置模擬程式之設計 26 3.8.1 輸入裝置模擬程式 27 3.8.1.1 輸入參數檔 27 3.8.1.2 寫入針腳通訊檔 27 3.8.1.3 結束受測程式之執行 28 3.8.2 輸出裝置模擬程式 28 3.8.2.1 輸出裝置模擬程式 28 3.8.2.2 讀取波形紀錄檔 29 3.8.2.3 輸出裝置的效果、行為、狀態 29 3.8.2.4 開發輸出裝置之功能 30 3.8.2.5 時間參數 30 3.8.2.6 執行流程 31 3.9 評測程式之設計 32 3.9.1 評測程式 32 3.9.2 評測規則設計 33 3.9.2.1 檢驗特定時間區間內特定裝置的狀態 33 3.9.2.2 檢驗不同裝置之間的關係 33 3.9.2.3 檢驗主狀態切換正確性 34 3.9.2.4 檢驗關鍵動作正確性 34 3.9.3 關鍵點 35 3.9.4 評測規則模型 35 第4章 開發工具之設計 36 4.1 輸出裝置功能開發工具 36 4.2 評測規則開發工具 37 4.2.1 評測規則設定檔 37 4.2.1.1 裝置狀態檢驗檔 37 4.2.1.2 裝置關係檢驗檔 38 4.2.1.3 關鍵點設定檔 39 4.2.2 評測規則標頭檔內容 40 4.2.3 應用關鍵點的函式 40 4.3 題庫開發 45 4.3.1 題目說明 45 4.3.2 輸入參數和裝置功能開發 46 4.3.3 評測規則設定檔 49 4.3.4 評測規則標頭檔 49 第5章 系統實作 51 5.1 系統運行器之實作 51 5.2 修改嵌入式系統的開發函式庫之實作 54 5.2.1 修改函式庫之方 54 5.2.2 修改函式庫之內容 55 5.3 裝置模擬程式之實作 59 5.3.1 輸入裝置模擬程式實作 59 5.3.1.1 讀取參數輸入檔 59 5.3.1.2 定時觸發事件 59 5.3.1.3 定時觸發事件之資料結構 60 5.3.1.4 註冊定時觸發事件 61 5.3.2 輸出裝置模擬程式實作 62 5.3.2.1 獲取任一時刻針腳狀態 62 5.3.2.2 紀錄裝置狀態 63 5.4 評測程式之實作 64 5.4.1 存取裝置行為紀錄檔 64 5.4.2 檢驗裝置狀態 65 5.4.3 檢驗裝置之間關係 65 5.4.4 設置關鍵點 65 5.4.5 獲取關鍵點的地址 66 5.4.6 應用關鍵點的相關函式之實作 67 5.4.7 記錄評測結果 70 5.5 使用介面 71 第6章 驗證與評估 73 6.1 測試環境 73 6.2 測試內容 74 6.2.1 LED開關 75 6.2.1.1 題目說明 75 6.2.1.2 輸入參數和裝置功能開發 76 6.2.1.3 評測規則設定檔 76 6.2.1.4 評測規則標頭檔 77 6.2.2 跑馬燈 77 6.2.2.1 題目說明 77 6.2.2.2 輸入參數和裝置功能開發 78 6.2.2.3 評測規則設定檔 79 6.2.2.4 評測規則標頭檔 80 6.2.3 英文字母紀錄器 81 6.3 測試結果 81 第7章 結論與未來展望 83 7.1 結論 83 7.2 未來展望 83 參考文獻 84

    [1] UVa Online Judge官方網站, [Online] Available: https://onlinejudge.org, accessed on 2024-07-16.
    [2] LeetCode官方網站, [Online] Available: https://leetcode.com, accessed on 2024-07-16.
    [3] 大學課程資訊網, [Online]Available: https://course-tvc.yuntech.edu.tw/webU/index.aspx, accessed on 2024-07-16.
    [4] Szymon Wasik, Maciej Antczak, Jan Badura, Artur Laskowski, Tomasz Sternal, “A Survey on Online Judge Systems and Their Applications,” ACM Computing Surveys, Volume 51, Issue 1, Page 34, 2019.
    [5] Forsythe ,Wirth, “Automatic grading programs,” Communications of the ACM, Volume 8, Issue 5, Pages 275-278, 1965.
    [6] ICPC官方網站, [Online] Available: https://icpc.global, accessed on 2024-07-16.
    [7] IOI官方網站, [Online] Available: https://tpmso.org/toi/index.php/about, accessed on 2024-07-16.
    [8] CPE官方網站, [Online] Available: https://cpe.cse.nsysu.edu.tw, accessed on 2024-07-16.
    [9] Kurnia, Lim, Cheang, “Online judge,” Computers & Education, volume 36, Issue 4, Pages 299-315, 2001.
    [10] 黑箱測試-維基百科, [Online] Available: https://zh.wikipedia.org/zh-tw/%E9%BB%91%E7%9B%92%E6%B5%8B%E8%AF%95, accessed on 2024-07-16.
    [11] Input Output Redirection in Linux, [Online] Available: https://www.geeksforgeeks.org/input-output-redirection-in-linux/, accessed on 2024-07-16.
    [12] 沙盒(電腦安全)-維基百科, [Online] Available: https://zh.wikipedia.org/wiki/%E6%B2%99%E7%9B%92_(%E9%9B%BB%E8%85%A6%E5%AE%89%E5%85%A8), accessed on 2024-07-16.
    [13] Jong-Yih Kuo, Zhi-Jia Wen, Han-Xuan Huang, I-Ting Guo, “A Study on the Security of Online Judge System Applied Sandbox Technology,” 2022 IEEE/ACIS 23rd International Conference on Software Engineering, Artificial Intelligence, Networking and Parallel/Distributed Computing, Pages 168-172, 2022.
    [14] MA Revilla, S Manzoor, R Liu, “Competitive Learning in InformatICs:The UVa Online Judge Experience,” Olympiads in Informatics, 2008.
    [15] Deschamps, “Synthesis Of Arithmetic Circuits: Fpga, Asic And Embedded Systems,” John Wiley & Sons Inc, 2006.
    [16] 單板機-維基百科, [Online] Available: https://zh.wikipedia.org/zh-tw/%E5%8D%95%E6%9D%BF%E6%9C%BA, accessed on 2024-07-16.
    [17] “Foundation Strategy 2016–2018,” Raspberry Pi Foundation, 2016.
    [18] 樹莓派實體圖, [Online] Available: https://tw.element14.com/raspberry-pi/rpi4-modbp-8gb/raspberry-pi-4-model-b-cortex/dp/3369503, accessed on 2024-07-16.
    [19] WiringPi官方網站, [Online] Available: http://Wiringpi.com, accessed on 2024-07-16.
    [20] Kangbok Seo, Junhyung Kim, Woojin Lee, “Arduino practice judgment system based on function execution log in virtual execution environment,” Computer Applications in Engineering Education, 2023.
    [21] Sang-Young Cho, “A virtual simulation package for Embedded System training and education,” 2009 International Conference on Engineering Education, 2010.
    [22] Heuiseok Lim, HeonChang Yu, Taeweon Suh, “Using virtual platform in embedded system education,” Computer Applications in Engineering Education, Volume 20, Issue 2, Page 346-355, 2012.
    [23] wokwi官方網站, [Online] Available: https://wokwi.com, accessed on 2024-07-16.
    [24] 郭春暉, “微控制器應用課程之網宇實體實驗室及自動評測系統,” 國立成功大學資訊工程研究所碩士論文, 2015
    [25] “MAX7219 Datasheet,” Maxim Integrated Products.

    下載圖示 校內:立即公開
    校外:立即公開
    QR CODE