<acronym id="s8ci2"><small id="s8ci2"></small></acronym>
<rt id="s8ci2"></rt><rt id="s8ci2"><optgroup id="s8ci2"></optgroup></rt>
<acronym id="s8ci2"></acronym>
<acronym id="s8ci2"><center id="s8ci2"></center></acronym>

電子發燒友App

硬聲App

0
  • 聊天消息
  • 系統消息
  • 評論與回復
登錄后你可以
  • 下載海量資料
  • 學習在線課程
  • 觀看技術視頻
  • 寫文章/發帖/加入社區
創作中心

完善資料讓更多小伙伴認識你,還能領取20積分哦,立即完善>

3天內不再提示
電子發燒友網>電子資料下載>電子資料>Walabot睡眠質量追蹤器開源

Walabot睡眠質量追蹤器開源

2022-10-21 | zip | 0.14 MB | 次下載 | 免費

資料介紹

描述

Walabot 睡眠質量追蹤器

亞歷克斯技能

該技能發布在 alexa 技能版塊,請隨意按照指南并監控自己的睡眠

?
pYYBAGNR4yKAb5W-AAIUt-LtXxU944.png
Walabot 睡眠追蹤器 Alexa Skill Store
?

您可以按照系統指南中的用戶鏈接 alexa 來使用您的指南設置多個用戶。

問題

CDC最近將睡眠不足??列為公共衛生問題。嗜睡是增加事故和其他職業錯誤風險的根本原因。它還可能引起健康問題,如糖尿病、抑郁癥和高血壓。

根據美國國家睡眠基金會和消費電子協會最近的一項調查,超過 60% 的睡眠追蹤技術擁有者在睡眠追蹤后更加了解自己的睡眠模式。51% 的睡眠追蹤技術擁有者表示,他們知道這項技術正在幫助他們睡得更好,而 49% 的人表示,自從開始使用這項技術后,他們感覺更健康了。

盡管大多數睡眠跟蹤技術是手表和手環等非侵入性設備,但它們仍然需要大量日常維護以保持衛生和持續充電。使用可穿戴設備的頻繁充電和衛生維護的紀律已經讓很多人不再使用它們。

我們的解決方案

使用 Walabot,我們可以構建一個始終開啟的非侵入式睡眠跟蹤系統。通過這種方式,用戶不必擔心為可穿戴設備充電、清洗衛生,并且仍然能夠跟蹤良好的睡眠。

解決方案分為三個部分:

  • Walabot部分
  • Walabot 服務器部分
  • Alexa部分

Walabot 可以在任何 LinuxIoT 機器上使用;在這種情況下,我們將使用筆記本電腦作為基礎。我們還將在本地實施人工智能,以向用戶識別模式。

Walabot服務器將用于存儲信息;這可用于顯示移動設備、物聯網顯示設備以及 Alexa 的額外信息。

Alexa 是我們可以使用的眾多輸出選項之一;在這種情況下,它是最容易實現的,并且可以快速了解您的夜間睡眠情況。

第 1 步:使用 Ubuntu 設置 Walabot

我們首先必須設置 Walabot。在這種情況下,我們正在檢測睡眠時使用的能量。我們以呼吸的例子為基礎,因為看起來 Walabot 不僅在檢測運動方面非常有效,而且在檢測運動中使用了多少能量方面非常有效,因此非常適合跟蹤睡眠。

我們可以使用任何運行 Ubuntu 和 Python 的物聯網設備(例如 Raspberry Pi)來構建它,但對于這個原型的案例,我們將使用便宜的筆記本電腦,因為我們有一個可以監控正在發生的事情的屏幕。

#!/usr/bin/env python3 
from __future__ import print_function # WalabotAPI works on both Python 2 an 3. 
from sys import platform 
from os import system 
from imp import load_source 
from os.path import join 
import time, random 
import math 
from collections import deque 
import urllib.request 
modulePath = join('/usr', 'share', 'walabot', 'python', 'WalabotAPI.py')      
wlbt = load_source('WalabotAPI', modulePath) 
wlbt.Init() 
start = time.time() 
class RealtimePlot: 
   def __init__(self, axes, max_entries =100): 
       self.axis_x = deque(maxlen=max_entries) 
       self.axis_y = deque(maxlen=max_entries) 
       self.axes = axes 
       self.max_entries = max_entries 
       self.lineplot, = axes.plot([], [], "ro-") 
       self.axes.set_autoscaley_on(True) 
   def add(self, x, y): 
       self.axis_x.append(x) 
       self.axis_y.append(y) 
       self.lineplot.set_data(self.axis_x, self.axis_y) 
       self.axes.set_xlim(self.axis_x[0], self.axis_x[-1] + 1e-15) 
       self.axes.set_ylim(0, 0.2) 
       self.axes.relim(); self.axes.autoscale_view() # rescale the y-axis 
   def animate(self, figure, callback, interval = 50): 
       import matplotlib.animation as animation 
       def wrapper(frame_index): 
           self.add(*callback(frame_index)) 
           self.axes.relim(); self.axes.autoscale_view() # rescale the y-axis 
           return self.lineplot 
       animation.FuncAnimation(figure, wrapper, interval=interval) 
def main(): 
   from matplotlib import pyplot as plt 
   # Walabot_SetArenaR - input parameters 
   minInCm, maxInCm, resInCm = 30, 150, 1 
   # Walabot_SetArenaTheta - input parameters 
   minIndegrees, maxIndegrees, resIndegrees = -4, 4, 2 
   # Walabot_SetArenaPhi - input parameters 
   minPhiInDegrees, maxPhiInDegrees, resPhiInDegrees = -4, 4, 2 
   # Configure Walabot database install location (for windows) 
   wlbt.SetSettingsFolder() 
   # 1) Connect : Establish communication with walabot. 
   wlbt.ConnectAny() 
   # 2) Configure: Set scan profile and arena 
   # Set Profile - to Sensor-Narrow. 
   wlbt.SetProfile(wlbt.PROF_SENSOR_NARROW) 
   # Setup arena - specify it by Cartesian coordinates. 
   wlbt.SetArenaR(minInCm, maxInCm, resInCm) 
   # Sets polar range and resolution of arena (parameters in degrees). 
   wlbt.SetArenaTheta(minIndegrees, maxIndegrees, resIndegrees) 
   # Sets azimuth range and resolution of arena.(parameters in degrees). 
   wlbt.SetArenaPhi(minPhiInDegrees, maxPhiInDegrees, resPhiInDegrees) 
   # Dynamic-imaging filter for the specific frequencies typical of breathing 
   wlbt.SetDynamicImageFilter(wlbt.FILTER_TYPE_DERIVATIVE) 
   # 3) Start: Start the system in preparation for scanning. 
   wlbt.Start() 
   fig, axes = plt.subplots() 
   display = RealtimePlot(axes) 
   display.animate(fig, lambda frame_index: (time.time() - start, random.random() * 100)) 
   #plt.show() 
   #fig, axes = plt.subplots() 
   #display = RealtimePlot(axes) 
   while True: 
       appStatus, calibrationProcess = wlbt.GetStatus() 
       # 5) Trigger: Scan(sense) according to profile and record signals 
       # to be available for processing and retrieval. 
       wlbt.Trigger() 
       # 6) Get action: retrieve the last completed triggered recording 
       energy = wlbt.GetImageEnergy() 
       display.add(time.time() - start, energy * 100) 
       #This is just for prototype purposes, we will gather the data in bulk and send them to the server in the future 
       if energy * 100 > 0.05 and  energy * 100 <= 0.15: 
       	urllib.request.urlopen("http://{your_server_link}/input?medium=1&high=0").read() 
       elif energy * 100 > 0.15: 
       	urllib.request.urlopen("http://{your_server_link}/medium=0&high=1").read() 
       plt.pause(0.001) 
if __name__ == "__main__": main()  

第二步:Walabot Server 數據存儲

為了隨著時間的推移跟蹤睡眠,我們將數據存儲在云中是一個好主意。在這個例子中,我們在一個文件中設置了一個簡單的文件存儲,但將來我們可以將它存儲到 mongodb 中。

對于這個例子,我們將使用node.js并通過heroku托管。

設置服務器后,使用附加的以下代碼作為您的基礎。您可以選擇托管在其他地方,例如 Amazon、Azure 或 IBM Bluemix;這只是啟動服務器的一個簡單示例。

var fs = require('fs'); 
var app = express() 
// respond with "hello world" when a GET request is made to the homepage 
app.get('/', function (req, res) { 
	fs.readFile('data.txt', 'utf8', function readFileCallback(err, data){ 
	    if (err){ 
	        console.log(err); 
	    } else { 
	    obj = JSON.parse(data); //now it an object 
	    res.send(JSON.stringify(obj)); 
	}}); 
}) 
app.get('/input', function (req, res)  
{	var fs = require('fs'); 
	var high = req.query.high; 
	var medium = req.query.medium; 
	fs.readFile('data.txt', 'utf8', function readFileCallback(err, data){ 
	    if (err){ 
	        console.log(err); 
	    } else { 
	    obj = JSON.parse(data); //now it an object 
	    obj.high += parseInt(high); 
	    obj.medium += parseInt(medium); //add some data 
	    json = JSON.stringify(obj); //convert it back to json 
	    fs.writeFile('data.txt', json, 'utf8', null); // write it back 
	    res.send('success')  
	}}); 
}) 

一旦達到閾值,讓 Walabot 更新服務器。

if energy * 100 > 0.05 and  energy * 100 <= 0.15: 
    urllib.request.urlopen("http://{your_server_link}/input?medium=1&high=0").read() 
elif energy * 100 > 0.15: 
    urllib.request.urlopen("http://{your_server_link}/medium=0&high=1").read() 

第 3 步:亞歷克斯

用戶現在可以使用 Alexa 來了解您的睡眠質量。我們將按照本指南使用 Alexa 快速技能套件

該指南將教您:

  • 在 AWS 上創建 Lambda 函數
  • 在 Alexa 技能上創建 Alexa 技能

Lambda 托管 Alexa 可以與之交互的無服務器函數。使用 node.js 而不是按照指南創建一個空的。我們可以從下面復制/粘貼 Alexa node.js 代碼。

?
poYBAGNR4yyADPYvAAIk8-sgVug248.png
拉姆達函數
?

創建函數后,我們將獲得 ARN 編號。把它寫下來,這樣我們就可以在 Alexa Skill 工具包的配置中使用它。我們還必須將 Alexa Skill 工具包添加到睡眠跟蹤器中 - 復制并粘貼整個 node.js 代碼。

目前的情報托管在 Alexa 中,它會檢查是否四處走動和是否經常移動,例如起床。這樣我們就可以減輕服務器的負擔。

?
poYBAGNR4y-AXDcjAAD4PEHiM8g279.png
ARN 和 alexa 技能包
?

現在我們正在轉向 Alexa 技能套件:

?
pYYBAGNR4zKAAWy4AAEBFwjaLmM234.png
創建 Alexa 技能
?

在交互模型中,將以下睡眠跟蹤意圖模式放在那里:

Intent Schema: 
{ 
 "intents": [ 
   { 
     "intent": "SleepTrackIntent" 
   }, 
   { 
     "intent": "AMAZON.HelpIntent" 
   } 
 ] 
} 
Sample Utterances: 
SleepTrackIntent How was my sleep 
SleepTrackIntent How was my sleep tracking 

之后,在配置中,我們可以把我們之前使用的 ARN:

?
poYBAGNR4zWANWcZAAGSlhKK3p4321.png
將 ARN 放入 ARN 部分
?
pYYBAGNR4ziAf3bkAAHwCNGwZzY407.png
Walabot 睡眠追蹤器技能

第 4 步:一切準備就緒,開始測試

現在您可以通過詢問“Alexa,問 Sleep Tracker 我的睡眠如何?”來測試您的 Alexa 技能。

下一步是什么?

我們可以對睡眠質量進行機器學習,而不是編寫自己的算法。將來會這樣做。

?
?
?
?

?


下載該資料的人也在下載 下載該資料的人還在閱讀
更多 >

評論

查看更多

下載排行

本周

  1. 1山景DSP芯片AP8248A2數據手冊
  2. 1.06 MB  |  532次下載  |  免費
  3. 2RK3399完整板原理圖(支持平板,盒子VR)
  4. 3.28 MB  |  339次下載  |  免費
  5. 3TC358743XBG評估板參考手冊
  6. 1.36 MB  |  330次下載  |  免費
  7. 4DFM軟件使用教程
  8. 0.84 MB  |  295次下載  |  免費
  9. 5元宇宙深度解析—未來的未來-風口還是泡沫
  10. 6.40 MB  |  227次下載  |  免費
  11. 6迪文DGUS開發指南
  12. 31.67 MB  |  194次下載  |  免費
  13. 7元宇宙底層硬件系列報告
  14. 13.42 MB  |  182次下載  |  免費
  15. 8FP5207XR-G1中文應用手冊
  16. 1.09 MB  |  178次下載  |  免費

本月

  1. 1OrCAD10.5下載OrCAD10.5中文版軟件
  2. 0.00 MB  |  234315次下載  |  免費
  3. 2555集成電路應用800例(新編版)
  4. 0.00 MB  |  33566次下載  |  免費
  5. 3接口電路圖大全
  6. 未知  |  30323次下載  |  免費
  7. 4開關電源設計實例指南
  8. 未知  |  21549次下載  |  免費
  9. 5電氣工程師手冊免費下載(新編第二版pdf電子書)
  10. 0.00 MB  |  15349次下載  |  免費
  11. 6數字電路基礎pdf(下載)
  12. 未知  |  13750次下載  |  免費
  13. 7電子制作實例集錦 下載
  14. 未知  |  8113次下載  |  免費
  15. 8《LED驅動電路設計》 溫德爾著
  16. 0.00 MB  |  6656次下載  |  免費

總榜

  1. 1matlab軟件下載入口
  2. 未知  |  935054次下載  |  免費
  3. 2protel99se軟件下載(可英文版轉中文版)
  4. 78.1 MB  |  537798次下載  |  免費
  5. 3MATLAB 7.1 下載 (含軟件介紹)
  6. 未知  |  420027次下載  |  免費
  7. 4OrCAD10.5下載OrCAD10.5中文版軟件
  8. 0.00 MB  |  234315次下載  |  免費
  9. 5Altium DXP2002下載入口
  10. 未知  |  233046次下載  |  免費
  11. 6電路仿真軟件multisim 10.0免費下載
  12. 340992  |  191187次下載  |  免費
  13. 7十天學會AVR單片機與C語言視頻教程 下載
  14. 158M  |  183279次下載  |  免費
  15. 8proe5.0野火版下載(中文版免費下載)
  16. 未知  |  138040次下載  |  免費
亚洲欧美日韩精品久久_久久精品AⅤ无码中文_日本中文字幕有码在线播放_亚洲视频高清不卡在线观看
<acronym id="s8ci2"><small id="s8ci2"></small></acronym>
<rt id="s8ci2"></rt><rt id="s8ci2"><optgroup id="s8ci2"></optgroup></rt>
<acronym id="s8ci2"></acronym>
<acronym id="s8ci2"><center id="s8ci2"></center></acronym>