{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# IDS 오감지/ 민감 감지에 관한 고찰\n", "- IDS 미니프로그램이 잘 작동한다.\n", "- 0x300번대 메시지들은 침입이 아닌데도 주기 기반 침입 감지가 발생한다.\n", "- 혹시 0x300번대에 메시지들이 다른 번호대 메시지들 보다 많나? 그래서 전송 지연이 연쇄 작용을 일으키나? 하는 의문이 생겼다. " ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "import pandas as pd\n", "from pathlib import Path\n", "import pickle\n", "import plotly.express as px\n", "import plotly.graph_objects as go" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
countmeanstdmin25%50%75%max
042.asc3840.9993320.0001040.9990620.9992820.9993320.9993870.999562
043.asc3840.9993320.0001040.9990620.9992820.9993320.9993870.999561
044.asc3870.9915650.0836120.0401360.9992770.9993320.9993860.999561
\n", "
" ], "text/plain": [ " count mean std min 25% 50% 75% \\\n", "042.asc 384 0.999332 0.000104 0.999062 0.999282 0.999332 0.999387 \n", "043.asc 384 0.999332 0.000104 0.999062 0.999282 0.999332 0.999387 \n", "044.asc 387 0.991565 0.083612 0.040136 0.999277 0.999332 0.999386 \n", "\n", " max \n", "042.asc 0.999562 \n", "043.asc 0.999561 \n", "044.asc 0.999561 " ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# 메시지별 d_ts 통계값을 저장한 xlsx 파일을 읽는다.\n", "xlsx_d_ts_distribution = Path.cwd() / 'd_ts_distribution.xlsx'\n", "df = pd.read_excel(xlsx_d_ts_distribution, sheet_name='Sheet1', header=0, index_col=0)\n", "df.head(3)" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
m_idcountmeanstdmin25%50%75%maxfreq
00x423840.9993320.0001040.9990620.9992820.9993320.9993870.9995621.000669
10x433840.9993320.0001040.9990620.9992820.9993320.9993870.9995611.000669
20x443870.9915650.0836120.0401360.9992770.9993320.9993860.9995611.008507
\n", "
" ], "text/plain": [ " m_id count mean std min 25% 50% 75% \\\n", "0 0x42 384 0.999332 0.000104 0.999062 0.999282 0.999332 0.999387 \n", "1 0x43 384 0.999332 0.000104 0.999062 0.999282 0.999332 0.999387 \n", "2 0x44 387 0.991565 0.083612 0.040136 0.999277 0.999332 0.999386 \n", "\n", " max freq \n", "0 0.999562 1.000669 \n", "1 0.999561 1.000669 \n", "2 0.999561 1.008507 " ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# index 컬럼을 m_id로 이름을 변경한다.\n", "df = (\n", " df.reset_index()\n", " .rename(columns={'index': 'm_id'})\n", ")\n", "\n", "# m_id(message id)를 hex로 변환한다.\n", "df['m_id'] = (\n", " df['m_id']\n", " .apply(lambda x: x.replace('.asc', ''))\n", " .apply(lambda x: int(x, base=16))\n", " .apply(lambda x: hex(x))\n", ")\n", "\n", "# 메시지를 자주 전송할 수록 큰 값을 가지도록 하고 싶다. 따라서 freq를 추가한다.\n", "df['freq'] = 1 / df['mean']\n", "\n", "\n", "df.head(3)" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
m_iddlc
00x428
10x438
20x448
\n", "
" ], "text/plain": [ " m_id dlc\n", "0 0x42 8\n", "1 0x43 8\n", "2 0x44 8" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# 앞에서 저장해두었던 m_id별 dlc 변수를 로드한다.\n", "id_dlc = pickle.load(open('id_dlc.pkl', 'rb'))\n", "\n", "# id_dlc를 df로 만든다.\n", "df_dlc = pd.DataFrame(data=id_dlc.items(), columns=['m_id', 'dlc'])\n", "\n", "# m_id를 hex로 변환한다.\n", "df_dlc['m_id'] = df_dlc['m_id'].apply(lambda x: hex(x))\n", "\n", "df_dlc.head(3)" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
m_idcountmeanstdmin25%50%75%maxfreqdlc
580x5fa3841.0008350.0011510.9963491.0000831.0007361.0008541.0069010.9991668
170x2b0383940.0100000.0001360.0076850.0099830.0100010.0100150.01231899.9988236
390x50038400.0999830.0006460.0942570.0999790.0999840.1000270.10570810.0017251
420x50c38390.1000010.0005180.0962970.0999830.1000020.1000230.1037069.9999228
280x38d191880.0200100.0004950.0146860.0199870.0200050.0200220.02532749.9742358
\n", "
" ], "text/plain": [ " m_id count mean std min 25% 50% 75% \\\n", "58 0x5fa 384 1.000835 0.001151 0.996349 1.000083 1.000736 1.000854 \n", "17 0x2b0 38394 0.010000 0.000136 0.007685 0.009983 0.010001 0.010015 \n", "39 0x500 3840 0.099983 0.000646 0.094257 0.099979 0.099984 0.100027 \n", "42 0x50c 3839 0.100001 0.000518 0.096297 0.099983 0.100002 0.100023 \n", "28 0x38d 19188 0.020010 0.000495 0.014686 0.019987 0.020005 0.020022 \n", "\n", " max freq dlc \n", "58 1.006901 0.999166 8 \n", "17 0.012318 99.998823 6 \n", "39 0.105708 10.001725 1 \n", "42 0.103706 9.999922 8 \n", "28 0.025327 49.974235 8 " ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# df와 df_dlc를 merge한다.\n", "df = pd.merge(df, df_dlc, on='m_id', how='left')\n", "df.sample(5)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 통신 부하를 시각화한다." ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [], "source": [ "# 전송을 자주(freq)하면 할 수록 통신 부하에 차지하는 비중이 크다.\n", "# 길이(dlc)가 길 수록 통신 부하에 차지하는 비중이 크다. \n", "# 통신 부하를 나타내는 load_com을 정의한다.\n", "\n", "df['load_com'] = df['freq'] * df['dlc']" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "data": { "application/vnd.plotly.v1+json": { "config": { "plotlyServerURL": "https://plot.ly" }, "data": [ { "alignmentgroup": "True", "customdata": [ [ "0x42" ], [ "0x43" ], [ "0x44" ], [ "0x80" ], [ "0x81" ], [ "0x111" ], [ "0x112" ], [ "0x113" ], [ "0x124" ], [ "0x153" ], [ "0x164" ], [ "0x18f" ], [ "0x200" ], [ "0x220" ], [ "0x251" ], [ "0x260" ], [ "0x280" ], [ "0x2b0" ], [ "0x316" ], [ "0x329" ], [ "0x340" ], [ "0x346" ], [ "0x34c" ], [ "0x374" ], [ "0x381" ], [ "0x383" ], [ "0x386" ], [ "0x387" ], [ "0x38d" ], [ "0x394" ], [ "0x417" ], [ "0x436" ], [ "0x483" ], [ "0x492" ], [ "0x4a7" ], [ "0x4e5" ], [ "0x4e6" ], [ "0x4e7" ], [ "0x4f1" ], [ "0x500" ], [ "0x502" ], [ "0x507" ], [ "0x50c" ], [ "0x50e" ], [ "0x52a" ], [ "0x53e" ], [ "0x541" ], [ "0x545" ], [ "0x547" ], [ "0x549" ], [ "0x553" ], [ "0x556" ], [ "0x557" ], [ "0x593" ], [ "0x5a0" ], [ "0x5b0" ], [ "0x5ce" ], [ "0x5cf" ], [ "0x5fa" ] ], "hovertemplate": "m_id_int=%{x}
load_com=%{y}
m_id=%{customdata[0]}", "legendgroup": "", "marker": { "color": "#636efa", "pattern": { "shape": "" } }, "name": "", "offsetgroup": "", "orientation": "v", "showlegend": false, "textposition": "auto", "type": "bar", "x": [ 66, 67, 68, 128, 129, 273, 274, 275, 292, 339, 356, 399, 512, 544, 593, 608, 640, 688, 790, 809, 832, 838, 844, 884, 897, 899, 902, 903, 909, 916, 1047, 1078, 1155, 1170, 1191, 1253, 1254, 1255, 1265, 1280, 1282, 1287, 1292, 1294, 1322, 1342, 1345, 1349, 1351, 1353, 1363, 1366, 1367, 1427, 1440, 1456, 1486, 1487, 1530 ], "xaxis": "x", "y": [ 8.005349663745006, 8.005349663745006, 8.068054752494968, 799.976819362604, 799.9768214461963, 799.9791253623728, 799.9791170277382, 799.979131613349, 799.9768214461963, 799.9639962026196, 399.9818782955016, 799.9763234679147, 599.9823187123515, 799.9631701465648, 799.9899566285753, 799.9754560562176, 799.9754623071365, 599.9929394209877, 799.9750372448786, 799.9735599486814, 799.5877582726642, 799.9796525283737, 799.9796483610504, 799.9796608630194, 399.995936694746, 400.26485222504897, 399.984584079432, 399.9818845462375, 399.7938780950339, 399.9825575432944, 39.998559905863246, 79.99942436261537, 39.979359977971754, 159.99444177183526, 3.9979377313223314, 79.99726271413645, 79.9972629225098, 79.99726250576312, 199.99775059833533, 10.001724887209189, 39.99895954777275, 39.99785587314556, 79.99937968172502, 40.04551736188266, 66.78410581129437, 59.96910629831984, 85.67637383698843, 79.99694411256729, 79.99709059812727, 79.99679408523836, 40.06635139968878, 79.99704183900512, 79.99704079714411, 30.000053152777866, 8.001401686800978, 3.9999645538389146, 79.99744295748232, 79.99744254073377, 7.993324572207846 ], "yaxis": "y" } ], "layout": { "barmode": "relative", "height": 600, "legend": { "tracegroupgap": 0 }, "template": { "data": { "bar": [ { "error_x": { "color": "#2a3f5f" }, "error_y": { "color": "#2a3f5f" }, "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "bar" } ], "barpolar": [ { "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "barpolar" } ], "carpet": [ { "aaxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "baxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "type": "carpet" } ], "choropleth": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "choropleth" } ], "contour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "contour" } ], "contourcarpet": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "contourcarpet" } ], "heatmap": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmap" } ], "heatmapgl": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmapgl" } ], "histogram": [ { "marker": { "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "histogram" } ], "histogram2d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2d" } ], "histogram2dcontour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2dcontour" } ], "mesh3d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "mesh3d" } ], "parcoords": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "parcoords" } ], "pie": [ { "automargin": true, "type": "pie" } ], "scatter": [ { "fillpattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 }, "type": "scatter" } ], "scatter3d": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatter3d" } ], "scattercarpet": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattercarpet" } ], "scattergeo": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergeo" } ], "scattergl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergl" } ], "scattermapbox": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattermapbox" } ], "scatterpolar": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolar" } ], "scatterpolargl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolargl" } ], "scatterternary": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterternary" } ], "surface": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "surface" } ], "table": [ { "cells": { "fill": { "color": "#EBF0F8" }, "line": { "color": "white" } }, "header": { "fill": { "color": "#C8D4E3" }, "line": { "color": "white" } }, "type": "table" } ] }, "layout": { "annotationdefaults": { "arrowcolor": "#2a3f5f", "arrowhead": 0, "arrowwidth": 1 }, "autotypenumbers": "strict", "coloraxis": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "colorscale": { "diverging": [ [ 0, "#8e0152" ], [ 0.1, "#c51b7d" ], [ 0.2, "#de77ae" ], [ 0.3, "#f1b6da" ], [ 0.4, "#fde0ef" ], [ 0.5, "#f7f7f7" ], [ 0.6, "#e6f5d0" ], [ 0.7, "#b8e186" ], [ 0.8, "#7fbc41" ], [ 0.9, "#4d9221" ], [ 1, "#276419" ] ], "sequential": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "sequentialminus": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ] }, "colorway": [ "#636efa", "#EF553B", "#00cc96", "#ab63fa", "#FFA15A", "#19d3f3", "#FF6692", "#B6E880", "#FF97FF", "#FECB52" ], "font": { "color": "#2a3f5f" }, "geo": { "bgcolor": "white", "lakecolor": "white", "landcolor": "#E5ECF6", "showlakes": true, "showland": true, "subunitcolor": "white" }, "hoverlabel": { "align": "left" }, "hovermode": "closest", "mapbox": { "style": "light" }, "paper_bgcolor": "white", "plot_bgcolor": "#E5ECF6", "polar": { "angularaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "radialaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "scene": { "xaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "yaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "zaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" } }, "shapedefaults": { "line": { "color": "#2a3f5f" } }, "ternary": { "aaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "baxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "caxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "title": { "x": 0.05 }, "xaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 }, "yaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 } } }, "title": { "text": "통신 하중" }, "xaxis": { "anchor": "y", "domain": [ 0, 1 ], "tickmode": "array", "ticktext": [ "0x42", "0x43", "0x44", "0x80", "0x81", "0x111", "0x112", "0x113", "0x124", "0x153", "0x164", "0x18f", "0x200", "0x220", "0x251", "0x260", "0x280", "0x2b0", "0x316", "0x329", "0x340", "0x346", "0x34c", "0x374", "0x381", "0x383", "0x386", "0x387", "0x38d", "0x394", "0x417", "0x436", "0x483", "0x492", "0x4a7", "0x4e5", "0x4e6", "0x4e7", "0x4f1", "0x500", "0x502", "0x507", "0x50c", "0x50e", "0x52a", "0x53e", "0x541", "0x545", "0x547", "0x549", "0x553", "0x556", "0x557", "0x593", "0x5a0", "0x5b0", "0x5ce", "0x5cf", "0x5fa" ], "tickvals": [ 66, 67, 68, 128, 129, 273, 274, 275, 292, 339, 356, 399, 512, 544, 593, 608, 640, 688, 790, 809, 832, 838, 844, 884, 897, 899, 902, 903, 909, 916, 1047, 1078, 1155, 1170, 1191, 1253, 1254, 1255, 1265, 1280, 1282, 1287, 1292, 1294, 1322, 1342, 1345, 1349, 1351, 1353, 1363, 1366, 1367, 1427, 1440, 1456, 1486, 1487, 1530 ], "title": { "text": "m_id_int" } }, "yaxis": { "anchor": "x", "domain": [ 0, 1 ], "title": { "text": "load_com" } } } } }, "metadata": {}, "output_type": "display_data" } ], "source": [ "# m_id가 hex로 되어있어 그래프에 m_id간 간격이 제대로 반영되지 않는다.\n", "# m_id를 int로 변환한다. \n", "df['m_id_int'] = df['m_id'].apply(lambda x: int(x, base=16))\n", "\n", "fig = px.bar(\n", " df, \n", " x='m_id_int', \n", " y='load_com', \n", " hover_data=['m_id'],\n", " title='통신 하중'\n", ")\n", "fig.update_layout(\n", " xaxis = dict(\n", " tickmode = 'array',\n", " tickvals = df['m_id_int'],\n", " ticktext = df['m_id']\n", " ),\n", " height=600,\n", ")\n", "fig.show()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "- 0x100번대, 0x200번대, 0x300번대 메시지들이 freq도 높고, dlc도 커서 통신 부하에 미치는 영향이 크다.\n", "- 0x300번대 메시지들이 0x100번대 0x200번대 메시지들에 비해 많고 빽빽하게 인접하여 있다. \n", "- 이런 시각화는 유용할 수 있을 것 같다. " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# 가설\n", "- 0x300번대 메시지들은 통신 부하에 미치는 영향도 크고 촘촘히 분포되어 있다. \n", "- 0x300번대 메시지들은 0x100번대, 0x200번대 메시지들 보다 우선 순위가 낮다.\n", "- 0x300번대 메시지들은 CAN 버스를 점유하기 위한 조정이 치열하고, 전송 지연이 발생할 가능성이 상대적으로 크다. \n", "- 그래서 전송 주기가 상대적으로 들쭉날쭉하기 쉬운 것이 아닌가? 그래서 침입으로 오감지 되는 경우가 0x100번대와 0x200번대 메시지들에 비해서 잦은 것은 아닌가?\n", "- 나는 이 가설을 증명하기 위해서 노력할 생각은 없다." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# 추가 고찰" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 인접 m_id 사이의 거리 \n", "- 인접 m_id 사이의 거리가 가까우면 CAN 버스 점유 조정에 시간이 지연이 늘어난다." ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [ { "data": { "application/vnd.plotly.v1+json": { "config": { "plotlyServerURL": "https://plot.ly" }, "data": [ { "hovertemplate": "variable=m_id_distance_up
m_id=%{x}
value=%{y}", "legendgroup": "m_id_distance_up", "marker": { "color": "#636efa", "symbol": "circle" }, "mode": "markers", "name": "m_id_distance_up", "orientation": "v", "showlegend": true, "type": "scatter", "x": [ "0x42", "0x43", "0x44", "0x80", "0x81", "0x111", "0x112", "0x113", "0x124", "0x153", "0x164", "0x18f", "0x200", "0x220", "0x251", "0x260", "0x280", "0x2b0", "0x316", "0x329", "0x340", "0x346", "0x34c", "0x374", "0x381", "0x383", "0x386", "0x387", "0x38d", "0x394", "0x417", "0x436", "0x483", "0x492", "0x4a7", "0x4e5", "0x4e6", "0x4e7", "0x4f1", "0x500", "0x502", "0x507", "0x50c", "0x50e", "0x52a", "0x53e", "0x541", "0x545", "0x547", "0x549", "0x553", "0x556", "0x557", "0x593", "0x5a0", "0x5b0", "0x5ce", "0x5cf", "0x5fa" ], "xaxis": "x", "y": [ 0, 1, 1, 60, 1, 144, 1, 1, 17, 47, 17, 43, 113, 32, 49, 15, 32, 48, 102, 19, 23, 6, 6, 40, 13, 2, 3, 1, 6, 7, 131, 31, 77, 15, 21, 62, 1, 1, 10, 15, 2, 5, 5, 2, 28, 20, 3, 4, 2, 2, 10, 3, 1, 60, 13, 16, 30, 1, 43 ], "yaxis": "y" }, { "hovertemplate": "variable=m_id_distance_down
m_id=%{x}
value=%{y}", "legendgroup": "m_id_distance_down", "marker": { "color": "#EF553B", "symbol": "circle" }, "mode": "markers", "name": "m_id_distance_down", "orientation": "v", "showlegend": true, "type": "scatter", "x": [ "0x42", "0x43", "0x44", "0x80", "0x81", "0x111", "0x112", "0x113", "0x124", "0x153", "0x164", "0x18f", "0x200", "0x220", "0x251", "0x260", "0x280", "0x2b0", "0x316", "0x329", "0x340", "0x346", "0x34c", "0x374", "0x381", "0x383", "0x386", "0x387", "0x38d", "0x394", "0x417", "0x436", "0x483", "0x492", "0x4a7", "0x4e5", "0x4e6", "0x4e7", "0x4f1", "0x500", "0x502", "0x507", "0x50c", "0x50e", "0x52a", "0x53e", "0x541", "0x545", "0x547", "0x549", "0x553", "0x556", "0x557", "0x593", "0x5a0", "0x5b0", "0x5ce", "0x5cf", "0x5fa" ], "xaxis": "x", "y": [ -1, -1, -60, -1, -144, -1, -1, -17, -47, -17, -43, -113, -32, -49, -15, -32, -48, -102, -19, -23, -6, -6, -40, -13, -2, -3, -1, -6, -7, -131, -31, -77, -15, -21, -62, -1, -1, -10, -15, -2, -5, -5, -2, -28, -20, -3, -4, -2, -2, -10, -3, -1, -60, -13, -16, -30, -1, -43, 0 ], "yaxis": "y" } ], "layout": { "legend": { "title": { "text": "variable" }, "tracegroupgap": 0 }, "template": { "data": { "bar": [ { "error_x": { "color": "#2a3f5f" }, "error_y": { "color": "#2a3f5f" }, "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "bar" } ], "barpolar": [ { "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "barpolar" } ], "carpet": [ { "aaxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "baxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "type": "carpet" } ], "choropleth": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "choropleth" } ], "contour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "contour" } ], "contourcarpet": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "contourcarpet" } ], "heatmap": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmap" } ], "heatmapgl": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmapgl" } ], "histogram": [ { "marker": { "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "histogram" } ], "histogram2d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2d" } ], "histogram2dcontour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2dcontour" } ], "mesh3d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "mesh3d" } ], "parcoords": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "parcoords" } ], "pie": [ { "automargin": true, "type": "pie" } ], "scatter": [ { "fillpattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 }, "type": "scatter" } ], "scatter3d": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatter3d" } ], "scattercarpet": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattercarpet" } ], "scattergeo": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergeo" } ], "scattergl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergl" } ], "scattermapbox": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattermapbox" } ], "scatterpolar": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolar" } ], "scatterpolargl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolargl" } ], "scatterternary": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterternary" } ], "surface": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "surface" } ], "table": [ { "cells": { "fill": { "color": "#EBF0F8" }, "line": { "color": "white" } }, "header": { "fill": { "color": "#C8D4E3" }, "line": { "color": "white" } }, "type": "table" } ] }, "layout": { "annotationdefaults": { "arrowcolor": "#2a3f5f", "arrowhead": 0, "arrowwidth": 1 }, "autotypenumbers": "strict", "coloraxis": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "colorscale": { "diverging": [ [ 0, "#8e0152" ], [ 0.1, "#c51b7d" ], [ 0.2, "#de77ae" ], [ 0.3, "#f1b6da" ], [ 0.4, "#fde0ef" ], [ 0.5, "#f7f7f7" ], [ 0.6, "#e6f5d0" ], [ 0.7, "#b8e186" ], [ 0.8, "#7fbc41" ], [ 0.9, "#4d9221" ], [ 1, "#276419" ] ], "sequential": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "sequentialminus": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ] }, "colorway": [ "#636efa", "#EF553B", "#00cc96", "#ab63fa", "#FFA15A", "#19d3f3", "#FF6692", "#B6E880", "#FF97FF", "#FECB52" ], "font": { "color": "#2a3f5f" }, "geo": { "bgcolor": "white", "lakecolor": "white", "landcolor": "#E5ECF6", "showlakes": true, "showland": true, "subunitcolor": "white" }, "hoverlabel": { "align": "left" }, "hovermode": "closest", "mapbox": { "style": "light" }, "paper_bgcolor": "white", "plot_bgcolor": "#E5ECF6", "polar": { "angularaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "radialaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "scene": { "xaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "yaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "zaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" } }, "shapedefaults": { "line": { "color": "#2a3f5f" } }, "ternary": { "aaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "baxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "caxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "title": { "x": 0.05 }, "xaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 }, "yaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 } } }, "title": { "text": "인접 m_id간 거리" }, "xaxis": { "anchor": "y", "domain": [ 0, 1 ], "title": { "text": "m_id" } }, "yaxis": { "anchor": "x", "domain": [ 0, 1 ], "title": { "text": "value" } } } } }, "metadata": {}, "output_type": "display_data" } ], "source": [ "df['m_id_distance_up'] = df['m_id_int'].diff().fillna(0)\n", "df['m_id_distance_down'] = df['m_id_int'].diff(-1).fillna(0)\n", "px.scatter(\n", " df,\n", " x='m_id',\n", " y=['m_id_distance_up', 'm_id_distance_down'],\n", " title='인접 m_id간 거리'\n", ")\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "- m_id 간격을 고려한 통신 부하 바 차트에서 시각화한 것을 다른 측면에서 본 것이다 \n", "- m_id 간격과 지연 시간을 함께 표시하면 뭔가 의미있는 관계를 볼 수 있을 수도 있겠다. " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 주기 대비 변동폭 비율" ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [ { "data": { "application/vnd.plotly.v1+json": { "config": { "plotlyServerURL": "https://plot.ly" }, "data": [ { "alignmentgroup": "True", "hovertemplate": "m_id=%{x}
r_var_width=%{y}", "legendgroup": "", "marker": { "color": "#636efa", "pattern": { "shape": "" } }, "name": "", "offsetgroup": "", "orientation": "v", "showlegend": false, "textposition": "auto", "type": "bar", "x": [ "0x42", "0x43", "0x44", "0x80", "0x81", "0x111", "0x112", "0x113", "0x124", "0x153", "0x164", "0x18f", "0x200", "0x220", "0x251", "0x260", "0x280", "0x2b0", "0x316", "0x329", "0x340", "0x346", "0x34c", "0x374", "0x381", "0x383", "0x386", "0x387", "0x38d", "0x394", "0x417", "0x436", "0x483", "0x492", "0x4a7", "0x4e5", "0x4e6", "0x4e7", "0x4f1", "0x500", "0x502", "0x507", "0x50c", "0x50e", "0x52a", "0x53e", "0x541", "0x545", "0x547", "0x549", "0x553", "0x556", "0x557", "0x593", "0x5a0", "0x5b0", "0x5ce", "0x5cf", "0x5fa" ], "xaxis": "x", "y": [ 0.0005003343540006723, 0.0004993336852952306, 0.9675866788640994, 0.3367902409511268, 0.3364902505210342, 0.17979530842030506, 0.1797953065527803, 0.1838952028757477, 0.3367902418283196, 0.22588983342012273, 0.3391846327908388, 0.3567894402668247, 0.3399899806035843, 0.4280802914295405, 0.3379957566805412, 0.3397895749603017, 0.3395895837503076, 0.4632945480574937, 0.4821849537040465, 0.4591848234107803, 0.8120813170020377, 0.31039210518034244, 0.3005923528744242, 0.3007923524867499, 0.2756971993663991, 0.5685261894800095, 0.27553938035764286, 0.30403622999044283, 0.5317758320993653, 0.34258506053558013, 0.03564371669592988, 0.1532788970785957, 0.05749531706831876, 0.1632743278285987, 0.017930750724933896, 0.07325749333039024, 0.07461744699100928, 0.07595740074900427, 0.37164582004894714, 0.11452975168337111, 0.047518763942717174, 0.11024409025053529, 0.07408942550783512, 0.8145708743477194, 1.3963888684084473, 0.100328314837176, 0.7120991811459417, 0.09861623285475023, 0.09913639452353541, 0.10301587158407674, 0.8199879311583076, 0.08044702519944844, 0.0753972109513668, 0.03320505883127577, 0.010622860914397389, 0.007498933547334074, 0.0579581474227324, 0.062827991435391, 0.010543195110760902 ], "yaxis": "y" } ], "layout": { "barmode": "relative", "legend": { "tracegroupgap": 0 }, "template": { "data": { "bar": [ { "error_x": { "color": "#2a3f5f" }, "error_y": { "color": "#2a3f5f" }, "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "bar" } ], "barpolar": [ { "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "barpolar" } ], "carpet": [ { "aaxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "baxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "type": "carpet" } ], "choropleth": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "choropleth" } ], "contour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "contour" } ], "contourcarpet": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "contourcarpet" } ], "heatmap": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmap" } ], "heatmapgl": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmapgl" } ], "histogram": [ { "marker": { "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "histogram" } ], "histogram2d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2d" } ], "histogram2dcontour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2dcontour" } ], "mesh3d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "mesh3d" } ], "parcoords": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "parcoords" } ], "pie": [ { "automargin": true, "type": "pie" } ], "scatter": [ { "fillpattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 }, "type": "scatter" } ], "scatter3d": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatter3d" } ], "scattercarpet": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattercarpet" } ], "scattergeo": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergeo" } ], "scattergl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergl" } ], "scattermapbox": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattermapbox" } ], "scatterpolar": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolar" } ], "scatterpolargl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolargl" } ], "scatterternary": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterternary" } ], "surface": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "surface" } ], "table": [ { "cells": { "fill": { "color": "#EBF0F8" }, "line": { "color": "white" } }, "header": { "fill": { "color": "#C8D4E3" }, "line": { "color": "white" } }, "type": "table" } ] }, "layout": { "annotationdefaults": { "arrowcolor": "#2a3f5f", "arrowhead": 0, "arrowwidth": 1 }, "autotypenumbers": "strict", "coloraxis": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "colorscale": { "diverging": [ [ 0, "#8e0152" ], [ 0.1, "#c51b7d" ], [ 0.2, "#de77ae" ], [ 0.3, "#f1b6da" ], [ 0.4, "#fde0ef" ], [ 0.5, "#f7f7f7" ], [ 0.6, "#e6f5d0" ], [ 0.7, "#b8e186" ], [ 0.8, "#7fbc41" ], [ 0.9, "#4d9221" ], [ 1, "#276419" ] ], "sequential": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "sequentialminus": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ] }, "colorway": [ "#636efa", "#EF553B", "#00cc96", "#ab63fa", "#FFA15A", "#19d3f3", "#FF6692", "#B6E880", "#FF97FF", "#FECB52" ], "font": { "color": "#2a3f5f" }, "geo": { "bgcolor": "white", "lakecolor": "white", "landcolor": "#E5ECF6", "showlakes": true, "showland": true, "subunitcolor": "white" }, "hoverlabel": { "align": "left" }, "hovermode": "closest", "mapbox": { "style": "light" }, "paper_bgcolor": "white", "plot_bgcolor": "#E5ECF6", "polar": { "angularaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "radialaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "scene": { "xaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "yaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "zaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" } }, "shapedefaults": { "line": { "color": "#2a3f5f" } }, "ternary": { "aaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "baxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "caxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "title": { "x": 0.05 }, "xaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 }, "yaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 } } }, "title": { "text": "주기 대비 주기 변동폭 비율" }, "xaxis": { "anchor": "y", "domain": [ 0, 1 ], "title": { "text": "m_id" } }, "yaxis": { "anchor": "x", "domain": [ 0, 1 ], "title": { "text": "r_var_width" } } } } }, "metadata": {}, "output_type": "display_data" } ], "source": [ "df['r_var_width'] = (df['max'] - df['min']) / df['mean']\n", "px.bar(\n", " df,\n", " x='m_id',\n", " y='r_var_width',\n", " title='주기 대비 주기 변동폭 비율'\n", ")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "- 예상했던 것보다 주기 대비 변동폭이 비율이 높다. 통신 하중이 높은 0x100 - 0x300번대 메시지들의 비율이 평균 30%는 되는 것 같다.\n", "- CAN이 이래서 deterministic 하지 않고, 그점이 기능 안전 관점에서 우려의 대상이 되는구나." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## m_id 간격 vs 주기 대비 변동폭 비율" ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [ { "data": { "application/vnd.plotly.v1+json": { "config": { "plotlyServerURL": "https://plot.ly" }, "data": [ { "customdata": [ [ "0x42" ], [ "0x43" ], [ "0x44" ], [ "0x80" ] ], "hovertemplate": "band=0
m_id_distance_up=%{x}
r_var_width=%{y}
load_com=%{marker.size}
m_id=%{customdata[0]}", "legendgroup": "0", "marker": { "color": "#636efa", "size": [ 8.005349663745006, 8.005349663745006, 8.068054752494968, 799.976819362604 ], "sizemode": "area", "sizeref": 1.9999748915714384, "symbol": "circle" }, "mode": "markers", "name": "0", "orientation": "v", "showlegend": true, "type": "scatter", "x": [ 0, 1, 1, 60 ], "xaxis": "x", "y": [ 0.0005003343540006723, 0.0004993336852952306, 0.9675866788640994, 0.3367902409511268 ], "yaxis": "y" }, { "customdata": [ [ "0x81" ], [ "0x111" ], [ "0x112" ], [ "0x113" ], [ "0x124" ], [ "0x153" ], [ "0x164" ] ], "hovertemplate": "band=1
m_id_distance_up=%{x}
r_var_width=%{y}
load_com=%{marker.size}
m_id=%{customdata[0]}", "legendgroup": "1", "marker": { "color": "#EF553B", "size": [ 799.9768214461963, 799.9791253623728, 799.9791170277382, 799.979131613349, 799.9768214461963, 799.9639962026196, 399.9818782955016 ], "sizemode": "area", "sizeref": 1.9999748915714384, "symbol": "circle" }, "mode": "markers", "name": "1", "orientation": "v", "showlegend": true, "type": "scatter", "x": [ 1, 144, 1, 1, 17, 47, 17 ], "xaxis": "x", "y": [ 0.3364902505210342, 0.17979530842030506, 0.1797953065527803, 0.1838952028757477, 0.3367902418283196, 0.22588983342012273, 0.3391846327908388 ], "yaxis": "y" }, { "customdata": [ [ "0x18f" ], [ "0x200" ], [ "0x220" ], [ "0x251" ], [ "0x260" ], [ "0x280" ] ], "hovertemplate": "band=2
m_id_distance_up=%{x}
r_var_width=%{y}
load_com=%{marker.size}
m_id=%{customdata[0]}", "legendgroup": "2", "marker": { "color": "#00cc96", "size": [ 799.9763234679147, 599.9823187123515, 799.9631701465648, 799.9899566285753, 799.9754560562176, 799.9754623071365 ], "sizemode": "area", "sizeref": 1.9999748915714384, "symbol": "circle" }, "mode": "markers", "name": "2", "orientation": "v", "showlegend": true, "type": "scatter", "x": [ 43, 113, 32, 49, 15, 32 ], "xaxis": "x", "y": [ 0.3567894402668247, 0.3399899806035843, 0.4280802914295405, 0.3379957566805412, 0.3397895749603017, 0.3395895837503076 ], "yaxis": "y" }, { "customdata": [ [ "0x2b0" ], [ "0x316" ], [ "0x329" ], [ "0x340" ], [ "0x346" ], [ "0x34c" ], [ "0x374" ] ], "hovertemplate": "band=3
m_id_distance_up=%{x}
r_var_width=%{y}
load_com=%{marker.size}
m_id=%{customdata[0]}", "legendgroup": "3", "marker": { "color": "#ab63fa", "size": [ 599.9929394209877, 799.9750372448786, 799.9735599486814, 799.5877582726642, 799.9796525283737, 799.9796483610504, 799.9796608630194 ], "sizemode": "area", "sizeref": 1.9999748915714384, "symbol": "circle" }, "mode": "markers", "name": "3", "orientation": "v", "showlegend": true, "type": "scatter", "x": [ 48, 102, 19, 23, 6, 6, 40 ], "xaxis": "x", "y": [ 0.4632945480574937, 0.4821849537040465, 0.4591848234107803, 0.8120813170020377, 0.31039210518034244, 0.3005923528744242, 0.3007923524867499 ], "yaxis": "y" }, { "customdata": [ [ "0x381" ], [ "0x383" ], [ "0x386" ], [ "0x387" ], [ "0x38d" ], [ "0x394" ], [ "0x417" ], [ "0x436" ] ], "hovertemplate": "band=4
m_id_distance_up=%{x}
r_var_width=%{y}
load_com=%{marker.size}
m_id=%{customdata[0]}", "legendgroup": "4", "marker": { "color": "#FFA15A", "size": [ 399.995936694746, 400.26485222504897, 399.984584079432, 399.9818845462375, 399.7938780950339, 399.9825575432944, 39.998559905863246, 79.99942436261537 ], "sizemode": "area", "sizeref": 1.9999748915714384, "symbol": "circle" }, "mode": "markers", "name": "4", "orientation": "v", "showlegend": true, "type": "scatter", "x": [ 13, 2, 3, 1, 6, 7, 131, 31 ], "xaxis": "x", "y": [ 0.2756971993663991, 0.5685261894800095, 0.27553938035764286, 0.30403622999044283, 0.5317758320993653, 0.34258506053558013, 0.03564371669592988, 0.1532788970785957 ], "yaxis": "y" }, { "customdata": [ [ "0x483" ], [ "0x492" ], [ "0x4a7" ], [ "0x4e5" ], [ "0x4e6" ], [ "0x4e7" ], [ "0x4f1" ], [ "0x500" ], [ "0x502" ], [ "0x507" ], [ "0x50c" ], [ "0x50e" ], [ "0x52a" ], [ "0x53e" ], [ "0x541" ], [ "0x545" ], [ "0x547" ], [ "0x549" ], [ "0x553" ], [ "0x556" ], [ "0x557" ] ], "hovertemplate": "band=5
m_id_distance_up=%{x}
r_var_width=%{y}
load_com=%{marker.size}
m_id=%{customdata[0]}", "legendgroup": "5", "marker": { "color": "#19d3f3", "size": [ 39.979359977971754, 159.99444177183526, 3.9979377313223314, 79.99726271413645, 79.9972629225098, 79.99726250576312, 199.99775059833533, 10.001724887209189, 39.99895954777275, 39.99785587314556, 79.99937968172502, 40.04551736188266, 66.78410581129437, 59.96910629831984, 85.67637383698843, 79.99694411256729, 79.99709059812727, 79.99679408523836, 40.06635139968878, 79.99704183900512, 79.99704079714411 ], "sizemode": "area", "sizeref": 1.9999748915714384, "symbol": "circle" }, "mode": "markers", "name": "5", "orientation": "v", "showlegend": true, "type": "scatter", "x": [ 77, 15, 21, 62, 1, 1, 10, 15, 2, 5, 5, 2, 28, 20, 3, 4, 2, 2, 10, 3, 1 ], "xaxis": "x", "y": [ 0.05749531706831876, 0.1632743278285987, 0.017930750724933896, 0.07325749333039024, 0.07461744699100928, 0.07595740074900427, 0.37164582004894714, 0.11452975168337111, 0.047518763942717174, 0.11024409025053529, 0.07408942550783512, 0.8145708743477194, 1.3963888684084473, 0.100328314837176, 0.7120991811459417, 0.09861623285475023, 0.09913639452353541, 0.10301587158407674, 0.8199879311583076, 0.08044702519944844, 0.0753972109513668 ], "yaxis": "y" }, { "customdata": [ [ "0x593" ], [ "0x5a0" ], [ "0x5b0" ], [ "0x5ce" ], [ "0x5cf" ], [ "0x5fa" ] ], "hovertemplate": "band=6
m_id_distance_up=%{x}
r_var_width=%{y}
load_com=%{marker.size}
m_id=%{customdata[0]}", "legendgroup": "6", "marker": { "color": "#FF6692", "size": [ 30.000053152777866, 8.001401686800978, 3.9999645538389146, 79.99744295748232, 79.99744254073377, 7.993324572207846 ], "sizemode": "area", "sizeref": 1.9999748915714384, "symbol": "circle" }, "mode": "markers", "name": "6", "orientation": "v", "showlegend": true, "type": "scatter", "x": [ 60, 13, 16, 30, 1, 43 ], "xaxis": "x", "y": [ 0.03320505883127577, 0.010622860914397389, 0.007498933547334074, 0.0579581474227324, 0.062827991435391, 0.010543195110760902 ], "yaxis": "y" } ], "layout": { "height": 800, "legend": { "itemsizing": "constant", "title": { "text": "band" }, "tracegroupgap": 0 }, "template": { "data": { "bar": [ { "error_x": { "color": "#2a3f5f" }, "error_y": { "color": "#2a3f5f" }, "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "bar" } ], "barpolar": [ { "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "barpolar" } ], "carpet": [ { "aaxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "baxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "type": "carpet" } ], "choropleth": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "choropleth" } ], "contour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "contour" } ], "contourcarpet": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "contourcarpet" } ], "heatmap": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmap" } ], "heatmapgl": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmapgl" } ], "histogram": [ { "marker": { "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "histogram" } ], "histogram2d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2d" } ], "histogram2dcontour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2dcontour" } ], "mesh3d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "mesh3d" } ], "parcoords": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "parcoords" } ], "pie": [ { "automargin": true, "type": "pie" } ], "scatter": [ { "fillpattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 }, "type": "scatter" } ], "scatter3d": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatter3d" } ], "scattercarpet": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattercarpet" } ], "scattergeo": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergeo" } ], "scattergl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergl" } ], "scattermapbox": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattermapbox" } ], "scatterpolar": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolar" } ], "scatterpolargl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolargl" } ], "scatterternary": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterternary" } ], "surface": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "surface" } ], "table": [ { "cells": { "fill": { "color": "#EBF0F8" }, "line": { "color": "white" } }, "header": { "fill": { "color": "#C8D4E3" }, "line": { "color": "white" } }, "type": "table" } ] }, "layout": { "annotationdefaults": { "arrowcolor": "#2a3f5f", "arrowhead": 0, "arrowwidth": 1 }, "autotypenumbers": "strict", "coloraxis": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "colorscale": { "diverging": [ [ 0, "#8e0152" ], [ 0.1, "#c51b7d" ], [ 0.2, "#de77ae" ], [ 0.3, "#f1b6da" ], [ 0.4, "#fde0ef" ], [ 0.5, "#f7f7f7" ], [ 0.6, "#e6f5d0" ], [ 0.7, "#b8e186" ], [ 0.8, "#7fbc41" ], [ 0.9, "#4d9221" ], [ 1, "#276419" ] ], "sequential": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "sequentialminus": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ] }, "colorway": [ "#636efa", "#EF553B", "#00cc96", "#ab63fa", "#FFA15A", "#19d3f3", "#FF6692", "#B6E880", "#FF97FF", "#FECB52" ], "font": { "color": "#2a3f5f" }, "geo": { "bgcolor": "white", "lakecolor": "white", "landcolor": "#E5ECF6", "showlakes": true, "showland": true, "subunitcolor": "white" }, "hoverlabel": { "align": "left" }, "hovermode": "closest", "mapbox": { "style": "light" }, "paper_bgcolor": "white", "plot_bgcolor": "#E5ECF6", "polar": { "angularaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "radialaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "scene": { "xaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "yaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "zaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" } }, "shapedefaults": { "line": { "color": "#2a3f5f" } }, "ternary": { "aaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "baxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "caxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "title": { "x": 0.05 }, "xaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 }, "yaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 } } }, "title": { "text": "인접 m_id간 간격 vs 주기 대비 주기 변동폭 비율" }, "xaxis": { "anchor": "y", "domain": [ 0, 1 ], "title": { "text": "m_id_distance_up" } }, "yaxis": { "anchor": "x", "domain": [ 0, 1 ], "title": { "text": "r_var_width" } } } } }, "metadata": {}, "output_type": "display_data" } ], "source": [ "df['band'] = df['m_id_int'].div(256).round().astype(int).astype('category')\n", "px.scatter(\n", " df,\n", " x='m_id_distance_up',\n", " y='r_var_width',\n", " hover_data=['m_id'],\n", " color='band',\n", " size='load_com',\n", " title='인접 m_id간 간격 vs 주기 대비 주기 변동폭 비율',\n", " height=800,\n", ")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "- 0x300번대 메시지들이 인접 메시지 아이디간 간격(m_id_distanc)은 작고, 전송 주기 변동 폭(r_var_width)은 크고 마커의 크기 (load_com)는 클 것이라고 기대했다. \n", "- 셋 사이의 명확한 상관 관계를 찾지 못하겠다. \n" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.12.5" } }, "nbformat": 4, "nbformat_minor": 2 }