Upgrade to Pro — share decks privately, control downloads, hide ads and more …

秒間30fps * n台のIOTデータを Express.js MongoDB Metaba...

Hjosuke
December 22, 2023
36

秒間30fps * n台のIOTデータを Express.js MongoDB Metabase + Nuxtでいい感じに可視化する(予定)

Hjosuke

December 22, 2023
Tweet

Transcript

  1. w ͘͠Έ੡࡞ॴͱ͍͏ϑϧϦϞʔτͷձࣾͰۈ຿͍ͯ͠·͢ɻ ొه্ͷձࣾͷ ॅॴ͸͙ۙ͘͢Ͱ͕͢ɺ୭΋ग़͍ࣾͯ͠·ͤΜɻ w ීஈ͸όοΫΤϯυΤϯδχΞ 3VCZPO3BJMTϝΠϯ ΍ɺ5FSSBGPSN$%, ౳Ͱ"84ͷΠϯϑϥߏஙͨ͠Γͯ͠·͢ɻ w

    $IBU(15བྷΈͷҊ݅ʹ৮Γɺ1ZUIPO΍0QFO"*Λຊ֨తσϏϡʔ w ࡀ̓ϲ݄ͷΘΜͺ͘ͳଉࢠ͕ਓ͍·͢ w झຯ͸ϩʔυόΠΫɺౙ৔͸࣮૸Ͱ͖ͳ͍ͷͰɺόʔνϟϧϥΠυ͍ͯ͠· ͢ɻ ϩʔυόΠΫ͸ۚ৯͍஬Ͱ͆͢  w ʰΰδϥʱ͸͍͍͓ͧ ίίϊεεΩϊͷυϧϏʔγωϚͰݟͯ΄͍͠ ࣗݾ঺հ DALL·E3Ͱ࡞ͬͨImageը૾
  2. w ೲظ͕γϏΞͳͷͰɺϛχϚϜͳ΋ͷΛ͓౉ͯ͠͠ɺࡉ͔͍ௐ੔౳ ͸͓ئ͍͢Δܗʹ΍Γͦ͏ɻ w %PDLFS$PNQPTFͰ্ཱ͕ͪΔ(JUIVCϦϙδτϦΛ༻ҙ͠ɺΦϯ ϓϨͷαʔόʔͰ্ཱͪ͛ͯ΋Β͏ɻ ,VCFSOFUFTͱ͔͸࣌ؒͳ͞ ͗ͯ͢͞ແཧͩͱࢥ͏ɻ  w

    .Z42-ͱ͔ͷ;ͭ͏ͷϦϨʔγϣφϧɾσʔλϕʔεͩͱτϥϯβ ΫγϣϯܥͰGQT٧Έͦ͏ͳؾ͕͢Δɻ w ݸਓతʹ΋ձࣾతʹ΋࣮੷͸গͳ͍͚Ͳ .POHP%#  &YQSFTT /PEF ͳΒ8FCTPDLFU΋΍Γ΍͍͢͠ɺGQT଱͑ͯ͘ ΕΔͷͰ͸ͳ͍͔ɻ w αʔόʔଆ͸ϑϧελοΫͳϑϨʔϜϫʔΫ͸͍Βͳͦ͞͏ͳͷͰ 3BJMT͸·͊ͳͯ͘΋͍͍͔ͳɻɻɻ ΦϯϓϨͷ৔߹ͷ୅Ҋ
  3. ଟ෼࿩࣌ؒ͢ͳ͍ͩΖ͏͚Ͳ͜Μͳ޻෉Λͨ͠ w .POHPEC༻ͷϥΠϒϥϦͱͯ͠ɺNPOHPPTFΛར༻ w 5ZQFTDSJQUFTMJOUQSFUUJFSͷઃఆ ࠓͲ͖౰ͨΓલ͔΋Ͱ͕͢  w ωετͨ͠+TPOͷ4DIFNBఆٛؤுͬͨ ܕ͸࣮෺Ͱ͸ͳͯ͘μϛʔͰ͢

     import mongoose from 'mongoose'; const Schema = mongoose.Schema; const humanSchema = new Schema({ position: { x: Schema.Types.Decimal128, y: Schema.Types.Decimal128, z: Schema.Types.Decimal128, }, }); export const AtrSchema = new Schema({ topic: String, body: { info: { time: { secs: Number, nano: Number, }, robot_id: String, seq: Number, }, humans: [{ type: humanSchema }], }, robot_id: String, timestamp_msec: Schema.Types.Date, humans: [{ type: humanSchema }], }); w 4DIFNF5ZQFT%BUFʹಥͬࠐΉ࣌ʹNTFDͷਫ਼౓·Ͱ͔͠ରԠ͍ͯ͠ͳ͍ͷͰ OBOPTFDΛ*OUʹͯ͠ಥͬࠐΜͩ const timestampMsec = parseInt( `${secs}${(nsecs / 1_000_000).toFixed().padStart(3, '0')}`, );
  4. w ͦ΋ͦ΋͜ͷߏ੒ͰͪΌΜͱGQTͷෳ਺෦԰Λ͞͹͍ͯ%#อ ଘͰ͖Δͷ͔ʁ ͜͏ͨ͠΄͏͕͑͑ΜͪΌ͏ʁతͳΞυόΠε͋ Ε͹ޙ΄Ͳͦͬͱڭ͍͑ͯͩ͘͞ɻ  w 8FCTPDLFUਖ਼௚͋Μ·ΓΘ͔ͬͯͳ͍ɻ1+಺ͷڧڧͳϑϩϯτ ΤϯδχΞ͔Βֶͼ͍ͨɻ w

    8FCTPDLFU͸4PDLFU*0ͱ͍͏ϥΠϒϥϦׂ͕ΓͱϝδϟʔͰ࢖ ͍উख͕Α͍ͷͰɺ8FCTPDLFUͷ࢓༷Λݟͳ͕ΒͲͷΑ͏ʹϥ οϓ͞Ε͍ͯΔͷ͔Λݟ͍͖͍ͯͨɻ w ϑϩϯτΤϯυͷ΄͏͕ɺը໘਺ଟ͔ͬͨΓظ଴஋͕ߴ͔ͬͨΓ Ͱɺଟ෼͍Ζ͍Ζ͠ΜͲ͍ͱࢥ͏ͷͰɺ+4ք۾ͭΑͭΑʹͳͬͯ ϔϧϓͰ͖ͨΒ͍͍ͳ͊ɻ ࠓޙͷ՝୊
  5. w ࢠҭͯͱϩʔυόΠΫͷτϨʔχϯάͰ͋·Γ͕࣌ؒऔΕͳ͍ͷͰ݄࣌ؒఔ౓ͷ୹͍ۀ຿ͱ͔ɺ εϙοτͰͷܖ໿ͩͱॿ͔Γ·͢ɻ w ଈઓྗͱͯ͠׆༂Ͱ͖ͦ͏ͳ͜ͱ w 3VCZPO3BJMTͷλεΫ ೥͘Β͍΍ͬͯ·͢  w

    (JU)VC"DUJPOT΍$JSDMF$*ʹΑΔ$* $%ߏங w "84౳ͷ5FSSBGPSNʹΑΔ؀ڥߏங w "84ͷίετ࡟ݮܥ ฐࣾͷΠϯϑϥඅ༻Λ΢ϯඦສ୯ҐͰු͔ͤ·ͨ͠ɻ  w ଟগͷܦݧ͋Γ w 7VFKT 5ZQFTDSJQU ʹΑΔ։ൃ w 0QFO"* 3"(Λ࢖ͬͨ$IBU#PU(15։ൃ w ڵຯ͸͋Δ͚Ͳগֶ͠शʹ͕͔͔࣌ؒΓͦ͏ͳ͜ͱ w /FYUKT౳KTք۾ͷϞμϯϑϨʔϜϫʔΫ։ൃ w "84αʔόʔϨεΞʔΩςΫνϟΛϝΠϯͱ͢Δ৔߹ͷΞϓϦέʔγϣϯߏங ෭ۀืूத ୹Ίͷ