鴻蒙HarmonyOS 5小游戲實踐:數字記憶挑戰(附:源代碼)

數字記憶挑戰游戲:打造提升大腦記憶力的鴻蒙應用

在當今數字時代,人們的記憶力面臨著前所未有的挑戰。從日常的待辦事項到復雜的工作任務,強大的記憶力都是提高效率和表現的關鍵。本文將介紹一款基于鴻蒙系統開發的數字記憶挑戰游戲,它不僅能為用戶提供有趣的娛樂體驗,還能有效地鍛煉和提升記憶力。我們將深入探討游戲的設計理念、核心功能、技術實現以及如何通過這款應用幫助用戶增強記憶能力。

游戲設計理念與功能特點

數字記憶挑戰游戲的設計靈感來源于經典的記憶訓練方法,通過讓用戶在有限時間內記憶數字的位置并按順序點擊來鍛煉短期記憶能力。游戲遵循"循序漸進"的原則,設計了三種不同難度模式,滿足不同年齡段和記憶水平用戶的需求:

  • 簡單模式(4×3網格,數字1-6):適合初學者和兒童,提供較短的記憶時間和較少的數字,幫助用戶建立記憶信心和基礎方法
  • 中等模式(5×4網格,數字1-10):適合有一定記憶基礎的用戶,增加了數字數量和記憶難度,挑戰用戶的記憶容量
  • 困難模式(6×5網格,數字1-15):為記憶高手設計,最多的數字數量和較長的記憶時間,全面考驗用戶的記憶能力和反應速度

游戲的核心功能圍繞記憶訓練的科學原理展開,通過以下機制提升訓練效果:

  • 限時記憶機制:在顯示數字階段,根據難度不同設置2.5-4秒的記憶時間,模擬真實記憶場景中的時間壓力
  • 錯誤容錯機制:設置3次錯誤機會,讓用戶在壓力下鍛煉記憶準確性,同時避免因一次錯誤就結束游戲
  • 得分系統:根據難度設置不同的得分標準,鼓勵用戶挑戰更高難度,獲得更高分數
  • 漸進式挑戰:完成當前關卡后自動進入下一輪,數字數量和難度逐步增加,持續刺激大腦記憶能力的提升

技術實現與核心代碼解析

游戲狀態管理與流程控制

游戲采用狀態機模式管理不同階段的邏輯,定義了四種主要狀態:

enum GameState {READY,        // 準備狀態SHOWING_NUMBERS, // 顯示數字狀態PLAYING,      // 游戲進行狀態GAME_OVER     // 游戲結束狀態
}

狀態之間的轉換構成了游戲的核心流程:從準備狀態開始,用戶選擇難度后進入數字顯示狀態,記憶時間結束后進入游戲進行狀態,用戶按順序點擊數字,當錯誤次數用盡或時間結束時進入游戲結束狀態。

startGame() {const config = this.getGridConfig(this.gameMode)this.currentNumber = 1this.score = 0this.mistakesLeft = 3const result = this.generateNumbers()const numbers = result.numbersconst blanks = result.blanksthis.numbers = numbersthis.blankPositions = blanksthis.showNumbers = truethis.gameState = GameState.SHOWING_NUMBERS// 顯示數字3秒后隱藏let showTime = 3000if (this.gameMode === GameMode.HARD) showTime = 4000if (this.gameMode === GameMode.EASY) showTime = 2500this.showTimer = setTimeout(() => {this.showNumbers = falsethis.gameState = GameState.PLAYINGthis.startTimer()}, showTime)
}

數字生成與網格布局算法

游戲使用Fisher-Yates洗牌算法生成隨機數字排列,確保每次游戲的數字位置都是隨機的,增加了游戲的挑戰性和趣味性:

// Fisher-Yates洗牌算法
for (let i = nums.length - 1; i > 0; i--) {const j = Math.floor(Math.random() * (i + 1));let temp = nums[i]; nums[i] = nums[j]; nums[j] = temp;
}

網格布局根據不同難度模式動態生成,使用鴻蒙系統的Grid組件實現靈活的網格布局:

Grid() {ForEach(this.numbers, (num: number, index?: number) => {GridItem() {Column() {// 數字卡片內容}.width('100%').height('100%').justifyContent(FlexAlign.Center).alignItems(HorizontalAlign.Center).backgroundColor(this.blankPositions.includes(index!) ? '#EEEEEE' :num < this.currentNumber ? '#4CAF50' : '#4A90E2').borderRadius(8).onClick(() => {if (!this.blankPositions.includes(index!)) {this.handleCardClick(num, index!)}})}})
}
.columnsTemplate(new Array(this.getGridConfig(this.gameMode).cols).fill('1fr').join(' '))
.rowsTemplate(new Array(this.getGridConfig(this.gameMode).rows).fill('1fr').join(' '))
.columnsGap(10)
.rowsGap(10)
.width('90%')
.height(this.getGridConfig(this.gameMode).rows * 70)
.margin({ bottom: 20 })

交互邏輯與反饋機制

游戲實現了完善的交互反饋機制,包括:

  • 視覺反饋:已點擊的數字卡片變為綠色,未點擊的數字顯示為"?",空白格為灰色
  • 錯誤提示:點擊錯誤數字時顯示提示信息,并減少錯誤次數
  • 進度提示:頂部信息欄實時顯示當前需要點擊的數字、分數、剩余時間和錯誤次數
  • 完成提示:完成當前關卡或游戲結束時顯示相應的提示信息
handleCardClick(num: number, index: number) {if (this.gameState !== GameState.PLAYING) returnif (this.blankPositions.includes(index)) return // 空白格不可點擊if (num !== this.currentNumber) {this.mistakesLeft--promptAction.showToast({message: `錯誤! 剩余機會: ${this.mistakesLeft}`,duration: 1000})if (this.mistakesLeft <= 0) {this.gameOver()}return}// 正確點擊邏輯this.currentNumber++// 根據難度設置不同的得分let points = 10if (this.gameMode === GameMode.HARD) points = 15if (this.gameMode === GameMode.EASY) points = 5this.score += points// 檢查是否完成const config = this.getGridConfig(this.gameMode)if (this.currentNumber > config.maxNum) {this.levelComplete()}
}

記憶訓練的科學原理與應用

短期記憶的訓練方法

數字記憶挑戰游戲的設計基于認知心理學中的短期記憶理論。短期記憶(工作記憶)是指信息在大腦中保持的時間約為15-30秒,容量有限,通常為7±2個組塊。游戲通過以下方式鍛煉短期記憶:

  • 組塊化訓練:用戶需要將數字及其位置信息組合成組塊進行記憶,提高記憶效率
  • 復述訓練:在記憶時間內,用戶需要主動復述數字及其位置,強化記憶痕跡
  • 視覺空間記憶訓練:將數字與空間位置結合記憶,鍛煉大腦的視覺空間記憶能力

記憶提升的漸進式訓練

游戲的三種難度模式遵循漸進式訓練原則,符合記憶能力提升的規律:

  1. 簡單模式:小網格、少數字,幫助用戶建立記憶信心,掌握基本的記憶方法
  2. 中等模式:中等網格、中等數量數字,挑戰用戶的記憶容量,訓練記憶策略
  3. 困難模式:大網格、多數字,全面考驗用戶的記憶能力和反應速度,提升記憶極限

應用場景與用戶群體

這款數字記憶挑戰游戲適用于多種場景和用戶群體:

  • 兒童教育:幫助兒童從小鍛煉記憶力,提高學習能力
  • 學生群體:緩解學習壓力,提升記憶效率,為考試做準備
  • 上班族:在工作間隙進行短暫的記憶訓練,緩解大腦疲勞,提高工作效率
  • 中老年人:預防記憶力衰退,降低認知障礙風險,保持大腦活力

游戲優化

當前優化點

游戲在開發過程中進行了多方面的優化,提升用戶體驗:

  • 響應式布局:適配不同尺寸的鴻蒙設備屏幕,確保在手機、平板等設備上都有良好的顯示效果
  • 性能優化:使用鴻蒙系統的高效渲染機制,保證游戲在各種設備上都能流暢運行
  • 用戶界面優化:簡潔明了的界面設計,清晰的視覺反饋,讓用戶專注于記憶訓練

附:源代碼

import { promptAction } from "@kit.ArkUI";enum GameState {READY,SHOWING_NUMBERS,PLAYING,GAME_OVER
}enum GameMode {EASY,     // 4x3網格,數字1-6MEDIUM,   // 5x4網格,數字1-10HARD      // 6x5網格,數字1-15
}interface GridConfig {cols: number;rows: number;maxNum: number;
}interface nerateNumbers {numbers: number[];blanks: number[];
}@Component
struct NumberMemoryGame {@State gameState: GameState = GameState.READY@State numbers: number[] = []@State currentNumber: number = 1@State score: number = 0@State timer: number = 0@State showNumbers: boolean = false@State gameMode: GameMode = GameMode.MEDIUM@State blankPositions: number[] = []@State mistakesLeft: number = 3 // 剩余錯誤次數private gameTimer: number = 0private showTimer: number = 0// 根據模式獲取網格配置private getGridConfig(mode: GameMode): GridConfig {switch (mode) {case GameMode.EASY:return {cols: 4, rows: 3, maxNum: 6}case GameMode.MEDIUM:return {cols: 5, rows: 4, maxNum: 10}case GameMode.HARD:return {cols: 6, rows: 5, maxNum: 15}default:return {cols: 5, rows: 4, maxNum: 10}}}// 生成數字和空白格generateNumbers(): nerateNumbers {const config = this.getGridConfig(this.gameMode)const totalCells = config.cols * config.rowsconst numbers: number[] = []const blanks: number[] = []// 隨機選擇空白格位置const blankCount = totalCells - config.maxNum // 確保每個數字只出現一次while (blanks.length < blankCount) {const pos = Math.floor(Math.random() * totalCells)if (!blanks.includes(pos)) {blanks.push(pos)}}// 生成數字1-maxNum的隨機排列const nums: number[] = []for (let i = 1; i <= config.maxNum; i++) {nums.push(i)}// Fisher-Yates洗牌算法for (let i = nums.length - 1; i > 0; i--) {const j = Math.floor(Math.random() * (i + 1));let temp = nums[i]; nums[i] = nums[j]; nums[j] = temp;}// 填充數字到網格let numIndex = 0for (let i = 0; i < totalCells; i++) {if (blanks.includes(i)) {numbers.push(0) // 0表示空白格} else {numbers.push(nums[numIndex++])}}return {numbers, blanks}}// 開始新游戲startGame() {const config = this.getGridConfig(this.gameMode)this.currentNumber = 1this.score = 0this.mistakesLeft = 3const result = this.generateNumbers()const numbers = result.numbersconst blanks = result.blanksthis.numbers = numbersthis.blankPositions = blanksthis.showNumbers = truethis.gameState = GameState.SHOWING_NUMBERS// 顯示數字3秒后隱藏if (this.showTimer) {clearTimeout(this.showTimer)}// 根據難度設置不同的記憶時間let showTime = 3000if (this.gameMode === GameMode.HARD) showTime = 4000if (this.gameMode === GameMode.EASY) showTime = 2500this.showTimer = setTimeout(() => {this.showNumbers = falsethis.gameState = GameState.PLAYINGthis.startTimer()}, showTime)}// 開始計時startTimer() {// 根據難度設置不同的時間限制let timeLimit = 30if (this.gameMode === GameMode.HARD) timeLimit = 45if (this.gameMode === GameMode.EASY) timeLimit = 20this.timer = timeLimitif (this.gameTimer) {clearInterval(this.gameTimer)}this.gameTimer = setInterval(() => {this.timer--if (this.timer <= 0) {this.gameOver()}}, 1000)}// 處理卡片點擊handleCardClick(num: number, index: number) {if (this.gameState !== GameState.PLAYING) returnif (this.blankPositions.includes(index)) return // 空白格不可點擊if (num !== this.currentNumber) {this.mistakesLeft--promptAction.showToast({message: `錯誤! 剩余機會: ${this.mistakesLeft}`,duration: 1000})if (this.mistakesLeft <= 0) {this.gameOver()}return}// 正確點擊this.currentNumber++// 根據難度設置不同的得分let points = 10if (this.gameMode === GameMode.HARD) points = 15if (this.gameMode === GameMode.EASY) points = 5this.score += points// 檢查是否完成const config = this.getGridConfig(this.gameMode)if (this.currentNumber > config.maxNum) {this.levelComplete()}}// 關卡完成levelComplete() {clearInterval(this.gameTimer)promptAction.showToast({message: `恭喜完成! 得分: ${this.score}`,duration: 2000})// 準備下一輪setTimeout(() => {this.startGame()}, 2000)}// 游戲結束gameOver() {clearInterval(this.gameTimer)this.gameState = GameState.GAME_OVERpromptAction.showToast({message: `游戲結束! 最終得分: ${this.score}`,duration: 2000})}build() {Column() {// 游戲狀態判斷if (this.gameState === GameState.READY) {this.buildStartScreen()} else if (this.gameState === GameState.GAME_OVER) {this.buildGameOverScreen()} else {this.buildGameScreen()}}.width('100%').height('100%').backgroundColor('#F5F7FA')}// 開始界面@Builder buildStartScreen() {Column() {Text("數字記憶挑戰").fontSize(28).fontWeight(FontWeight.Bold).fontColor('#333333').margin({ bottom: 30 })Text("記住數字的位置\n按1開始的順序點擊數字\n每個數字只出現一次\n錯誤不能超過3次").fontSize(16).textAlign(TextAlign.Center).fontColor('#666666').margin({ bottom: 40 })Text("選擇難度模式:").fontSize(18).fontColor('#333333').margin({ bottom: 15 })// 模式選擇按鈕Button("簡單模式", { type: ButtonType.Capsule }).onClick(() => {this.gameMode = GameMode.EASY}).width(240).height(50).fontSize(18).backgroundColor(this.gameMode === GameMode.EASY ? '#4CAF50' : '#E0E0E0').fontColor(this.gameMode === GameMode.EASY ? Color.White : '#333333').margin({ bottom: 15 })Button("中等模式", { type: ButtonType.Capsule }).onClick(() => {this.gameMode = GameMode.MEDIUM}).width(240).height(50).fontSize(18).backgroundColor(this.gameMode === GameMode.MEDIUM ? '#2196F3' : '#E0E0E0').fontColor(this.gameMode === GameMode.MEDIUM ? Color.White : '#333333').margin({ bottom: 15 })Button("困難模式", { type: ButtonType.Capsule }).onClick(() => {this.gameMode = GameMode.HARD}).width(240).height(50).fontSize(18).backgroundColor(this.gameMode === GameMode.HARD ? '#F44336' : '#E0E0E0').fontColor(this.gameMode === GameMode.HARD ? Color.White : '#333333').margin({ bottom: 30 })Button("開始挑戰", { type: ButtonType.Capsule }).onClick(() => this.startGame()).width(240).height(50).fontSize(18).backgroundColor('#4A90E2').fontColor(Color.White)}.width('100%').height('100%').justifyContent(FlexAlign.Center).alignItems(HorizontalAlign.Center)}// 游戲結束界面@Builder buildGameOverScreen() {Column() {Text(this.mistakesLeft <= 0 ? "機會用盡!" : "時間到!").fontSize(24).fontWeight(FontWeight.Bold).fontColor('#F44336').margin({ bottom: 15 })Text(`最終得分: ${this.score}`).fontSize(20).fontWeight(FontWeight.Bold).fontColor('#333333').margin({ bottom: 10 })Text(`模式: ${this.gameMode === GameMode.EASY ? "簡單" :this.gameMode === GameMode.MEDIUM ? "中等" : "困難"}`).fontSize(18).fontColor('#666666').margin({ bottom: 30 })Button("再試一次", { type: ButtonType.Capsule }).onClick(() => this.startGame()).width(200).height(45).fontSize(17).backgroundColor('#4A90E2').fontColor(Color.White).margin({ bottom: 15 })Button("選擇模式", { type: ButtonType.Capsule }).onClick(() => {this.gameState = GameState.READY}).width(200).height(45).fontSize(17).backgroundColor('#9E9E9E').fontColor(Color.White)}.width('100%').height('100%').justifyContent(FlexAlign.Center).alignItems(HorizontalAlign.Center)}// 游戲界面@Builder buildGameScreen() {Column() {// 頂部信息欄Row() {Column() {Text("當前數字").fontSize(14).fontColor('#666666')Text(`${this.currentNumber > this.getGridConfig(this.gameMode).maxNum ? '完成!' : this.currentNumber}`).fontSize(20).fontWeight(FontWeight.Bold).fontColor(this.currentNumber > this.getGridConfig(this.gameMode).maxNum ? '#4CAF50' : '#333333')}.margin({ right: 25 })Column() {Text("分數").fontSize(14).fontColor('#666666')Text(`${this.score}`).fontSize(20).fontWeight(FontWeight.Bold).fontColor('#FF9800')}.margin({ right: 25 })Column() {Text("時間").fontSize(14).fontColor('#666666')Text(`${this.timer}s`).fontSize(20).fontWeight(FontWeight.Bold).fontColor(this.timer <= 5 ? '#F44336' : '#333333')}Column() {Text("機會").fontSize(14).fontColor('#666666')Text(`${this.mistakesLeft}`).fontSize(20).fontWeight(FontWeight.Bold).fontColor(this.mistakesLeft <= 1 ? '#F44336' : '#333333')}}.width('100%').justifyContent(FlexAlign.Start).padding({ left: 20, top: 15, bottom: 15 })// 游戲提示Text(this.showNumbers ? "記住這些數字的位置..." : `請點擊數字 ${this.currentNumber}`).fontSize(16).fontColor('#666666').margin({ bottom: 15 })// 數字網格Grid() {ForEach(this.numbers, (num: number, index?: number) => {GridItem() {Column() {if (this.blankPositions.includes(index!)) {// 空白格Text("").width('100%').height('100%').backgroundColor('#EEEEEE')} else if (this.showNumbers || num < this.currentNumber) {// 已顯示或已點擊的數字Text(num.toString()).fontSize(22).fontWeight(FontWeight.Bold).fontColor('#FFFFFF')} else {// 未點擊的數字Text("?").fontSize(22).fontWeight(FontWeight.Bold).fontColor('#FFFFFF')}}.width('100%').height('100%').justifyContent(FlexAlign.Center).alignItems(HorizontalAlign.Center).backgroundColor(this.blankPositions.includes(index!) ? '#EEEEEE' :num < this.currentNumber ? '#4CAF50' : '#4A90E2').borderRadius(8).onClick(() => {if (!this.blankPositions.includes(index!)) {this.handleCardClick(num, index!)}})}})}.columnsTemplate(new Array(this.getGridConfig(this.gameMode).cols).fill('1fr').join(' ')).rowsTemplate(new Array(this.getGridConfig(this.gameMode).rows).fill('1fr').join(' ')).columnsGap(10).rowsGap(10).width('90%').height(this.getGridConfig(this.gameMode).rows * 70).margin({ bottom: 20 })}.width('100%').height('100%').alignItems(HorizontalAlign.Center)}
}@Entry
@Component
struct NumberMemoryGamePage {build() {Stack() {NumberMemoryGame()}.width('100%').height('100%')}
}

結語

數字記憶挑戰游戲作為一款基于鴻蒙系統開發的記憶訓練應用,不僅展現了鴻蒙系統在應用開發中的強大能力,更為用戶提供了一種科學、有趣的記憶訓練方式。通過循序漸進的難度設計和科學的記憶訓練原理,這款游戲能夠幫助不同年齡段的用戶提升記憶力,鍛煉大腦思維能力。

隨著鴻蒙生態的不斷發展和完善,類似的腦力訓練應用將在教育、健康等領域發揮更大的作用。數字記憶挑戰游戲只是一個開始,未來我們可以期待更多基于鴻蒙系統的創新應用,為用戶的生活和學習帶來更多的便利和價值。如果你對記憶訓練感興趣,不妨下載這款游戲,開始你的記憶提升之旅吧!

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

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

相關文章

記錄一個C#/.NET的HTTP工具類

記錄一個C#/.NET的HTTP工具類 using Serilog; using System.Net; using System.Text; using System.Text.Json;namespace UProbe.Common.Comm.Http {public class HttpClientHelper{/// <summary>/// 發送HttpGet請求/// </summary>/// <typeparam name"T…

深度學習:PyTorch卷積神經網絡之圖像入門

本文目錄&#xff1a; 一、二值圖像二、**灰度圖像*三、**索引圖像**四、**真彩色RGB圖像****星空圖** 前言&#xff1a;這篇文章開始講解CNN&#xff0c;此前講解的人工神經網絡&#xff08;ANN&#xff09;如果有小伙伴還不清楚&#xff0c;一定要多看&#xff0c;多練習&…

PyTorch RNN實戰:快速上手教程

PyTorch實現RNN的實例 以下是一個使用PyTorch實現RNN的實例代碼,包含數據準備、模型定義、訓練和評估步驟。 RNN流程圖 RNN流程圖,在使用t來表示當前時間點(序列中的第t項),RNN接收所有先前內容得單一個表示h和關于序列最新項的信息,RNN將這些信息合并到迄今為止所有看…

C++項目快速配置SQLite

前言&#xff1a;完全沒接觸過數據庫&#xff0c;但老師課程設計要求數據存儲在數據庫怎么辦&#xff1f;&#xff1f;&#xff1f;主包看了些網絡上的資源&#xff0c;覺得講得都不是很能快速上手&#xff0c;所以決定自己寫一篇博客 SQLiteCpp是一個基于 C 封裝的 SQLite 操…

ArcGIS中對輸入面圖層A的相交問題批量處理的實現方法

一、背景及意義 在各種數據建庫中&#xff0c;拓撲錯誤是必須處理的&#xff0c;其中最常見的是重疊問題&#xff0c;我們常用拓撲工具來檢查重疊&#xff0c;但是由于拓撲工具只能作為檢查且不能批量修改&#xff0c;此時我們可以使用“相交”工具來檢查出重疊部分&#xff0…

【學習筆記】3.3 Decoder-Only PLM

參考資料&#xff1a;https://github.com/datawhalechina/happy-llm Decoder-Only是當前大型語言模型&#xff08;LLM&#xff09;的基礎架構&#xff0c;如 GPT 系列。GPT 是 Decoder-Only 架構的代表&#xff0c;而開源 LLM 如 LLaMA 也是在 GPT 架構基礎上發展而來的。 3…

主流的Attention Backend介紹

Attention Backend 技術背景 注意力&#xff08;Attention&#xff09;機制在深度學習中扮演著關鍵角色&#xff0c;它幫助模型在處理序列數據時&#xff0c;有選擇地關注輸入中的重要信息。然而&#xff0c;傳統的注意力計算往往受到內存訪問和算力分配的雙重制約&#xff0c…

Linux內存取證

我們先把linux取證文件放到kali中&#xff0c;然后這里的Ubuntu18.04-5.4.0-84-generic.zip需要不解壓直接放到vol工具中 然后把Ubuntu18.04-5.4.0-84-generic放到vol工具中&#xff0c;然后開始去這個&#xff0c;使用vol工具查看linux的版本信息 這個LinuxUbuntu18_04-5_4_0-…

使用docx4j 實現word轉pdf(linux亂碼處理)

由于系統之前使用了是itext進行轉換的&#xff0c;現在已經不是開源的工具了&#xff0c;需要收費&#xff0c;然后進行改造&#xff0c;具體處理如下。 <dependency><groupId>org.docx4j</groupId><artifactId>docx4j</artifactId><version…

C++ - vector 的相關練習

目錄 前言 1、題1 只出現一次的數字 &#xff1a; 解法一&#xff1a;遍歷 參考代碼&#xff1a; 解法二&#xff1a;按位異或 參考代碼&#xff1a; 解法三&#xff1a;哈希表 參考代碼&#xff1a; 2、題2 楊輝三角&#xff1a; 參考代碼&#xff1a; 總結 前言 …

JDK 1.8 Stream API:集合流處理深度解析

JDK 1.8 Stream API&#xff1a;集合流處理深度解析 摘要&#xff1a;Stream API 是 JDK 1.8 的革命性特性&#xff0c;它將集合操作從傳統迭代升級為聲明式函數式處理。Stream API三個階段&#xff08;創建→中間操作→終端操作&#xff09;詳解流處理機制&#xff0c;輔以代…

2025學年湖北省職業院校技能大賽 “信息安全管理與評估”賽項 樣題卷(二)

2025學年湖北省職業院校技能大賽 “信息安全管理與評估”賽項 樣題卷&#xff08;二&#xff09; 第一部分&#xff1a;第二部分&#xff1a;網絡安全事件響應、數字取證調查、應用程序安全任務書任務 1&#xff1a;應急響應&#xff08;可以培訓有答案&#xff09;任務 2&…

AiPy實戰(5):效率革命!5分鐘構建行業分析報告

在當今數字化時代&#xff0c;數據呈指數級增長&#xff0c;行業分析報告對于企業的決策制定愈發關鍵。傳統上&#xff0c;撰寫一份行業分析報告&#xff0c;需要分析師耗費大量時間從各類數據庫、新聞資訊平臺、行業報告中手動收集數據&#xff0c;再進行整理、分析和撰寫&…

docker小白自存-windows系統通過docker安裝n8n-nodes-puppeteer

n8n上直接在社區下載puppeteer節點&#xff0c;使用時會報錯說沒有chromium依賴。 找到了n8n-nodes-puppeteer的github試圖解決 根據他的docker安裝指南執行&#xff0c;運行容器時會報exec /docker-custom-entrypoint.sh: no such file or directory &#xff08;明明文件都有…

腳本shebang的作用與使用方法

#!&#xff08;稱為 shebang 或 hashbang&#xff09;是腳本文件開頭的前兩個字符&#xff0c;用于告訴操作系統應該使用哪個解釋器來執行該腳本。 核心作用&#xff1a; 指定解釋器&#xff1a; 明確告訴系統運行這個腳本時應該調用哪個程序&#xff08;解釋器&#xff09;來…

【大模型學習 | BERT 量化學習 (1)】

BERT 情感分析 一、 數據集加載與模型訓練 from transformers import BertTokenizer, BertForSequenceClassification, Trainer, TrainingArguments from datasets import load_dataset import torch import numpy as np from sklearn.metrics import accuracy_score mode_na…

用低通濾波優化串口或485 通信指示燈電路

常見的通信指示燈電路就是簡單的把LED 連到TXD 和RXD 上&#xff0c;一有動靜就閃一下。問題是&#xff0c;如果波特率很高&#xff0c;一次通信時間很短&#xff0c;相當于占空比很低&#xff0c;LED 閃爍的亮度就很弱&#xff0c;不容易觀察。比如MODBUS 通信&#xff0c;波特…

【純干貨】調整word目錄中的行距以及右對齊頁碼

1.問題展現 目錄生成會遇到一些奇葩現象 所以到了展現技術力的時候了【doge】 2.解決word目錄中的行距問題 選中目錄中的文字-》段落 此時你可能勾選了圖片中的一個以上&#xff0c;把他們都取消了&#xff0c; 由于一個目錄的標題對應一個樣式&#xff0c;第一個也可以取消 …

pandas 優雅處理值類型為list的列的csv讀寫問題

文章目錄 直接存儲join list 變成字符串存儲json.dumps序列化存儲以及json.loads反序列化讀取總結 之所以分析這個問題,是因為讀者在跟第三方數據供應商對接數據的時候,老是會遇到數據加載都會出錯的問題,其中一個原因就是list類型數據沒有正確儲存,于是筆者在這篇文章里面詳細…

一種解決 OpenWrt 安裝 docker 之后局域網的設備之間無法互相訪問通信的方法

文章目錄 一、問題背景二、解決方案&#xff08;方法一&#xff09;修改全局設置的 轉發&#xff08; forward&#xff09; 為 接受&#xff08;ACCEPT&#xff09;&#xff08;方法二&#xff09;設置 net.bridge.bridge-nf-call-iptables0 并將 docker 的容器網絡設置為host …