123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111 |
- <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
- <html><head><title>Python: module DBManager</title>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- </head><body bgcolor="#f0f0f8">
- <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
- <tr bgcolor="#7799ee">
- <td valign=bottom> <br>
- <font color="#ffffff" face="helvetica, arial"> <br><big><big><strong>DBManager</strong></big></big></font></td
- ><td align=right valign=bottom
- ><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:f%3A%5Cwork%5Cqx%5Cdata_analyze_platform%5Clib%5Cbackend%5Cdbmanager.py">f:\work\qx\data_analyze_platform\lib\backend\dbmanager.py</a></font></td></tr></table>
- <p><tt>暂时采用http方式获取历史数据。<br>
- <br>
- 预留:后期若改用通过访问数据库的形式进行数据的获取,则本文件负责数据库的连接,sql指令的执行,数据获取等功能。</tt></p>
- <p>
- <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
- <tr bgcolor="#aa55cc">
- <td colspan=3 valign=bottom> <br>
- <font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
-
- <tr><td bgcolor="#aa55cc"><tt> </tt></td><td> </td>
- <td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="datetime.html">datetime</a><br>
- <a href="json.html">json</a><br>
- <a href="numpy.html">numpy</a><br>
- </td><td width="25%" valign=top><a href="os.html">os</a><br>
- <a href="pandas.html">pandas</a><br>
- <a href="pdb.html">pdb</a><br>
- </td><td width="25%" valign=top><a href="requests.html">requests</a><br>
- <a href="time.html">time</a><br>
- <a href="urllib.html">urllib</a><br>
- </td><td width="25%" valign=top></td></tr></table></td></tr></table><p>
- <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
- <tr bgcolor="#ee77aa">
- <td colspan=3 valign=bottom> <br>
- <font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
-
- <tr><td bgcolor="#ee77aa"><tt> </tt></td><td> </td>
- <td width="100%"><dl>
- <dt><font face="helvetica, arial"><a href="builtins.html#object">builtins.object</a>
- </font></dt><dd>
- <dl>
- <dt><font face="helvetica, arial"><a href="DBManager.html#DBManager">DBManager</a>
- </font></dt></dl>
- </dd>
- </dl>
- <p>
- <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
- <tr bgcolor="#ffc8d8">
- <td colspan=3 valign=bottom> <br>
- <font color="#000000" face="helvetica, arial"><a name="DBManager">class <strong>DBManager</strong></a>(<a href="builtins.html#object">builtins.object</a>)</font></td></tr>
-
- <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
- <td colspan=2><tt><a href="#DBManager">DBManager</a>(host='', port='', auth='', db='', username='', password='')<br>
- <br>
- # import http.client<br>
- # http.client.HTTPConnection._http_vsn = 10<br>
- # http.client.HTTPConnection._http_vsn_str = 'HTTP/1.1'<br> </tt></td></tr>
- <tr><td> </td>
- <td width="100%">Methods defined here:<br>
- <dl><dt><a name="DBManager-__enter__"><strong>__enter__</strong></a>(self)</dt></dl>
- <dl><dt><a name="DBManager-__exit__"><strong>__exit__</strong></a>(self)</dt></dl>
- <dl><dt><a name="DBManager-__init__"><strong>__init__</strong></a>(self, host='', port='', auth='', db='', username='', password='')</dt><dd><tt>Initialize self. See help(type(self)) for accurate signature.</tt></dd></dl>
- <dl><dt><a name="DBManager-close"><strong>close</strong></a>(self)</dt></dl>
- <dl><dt><a name="DBManager-connect"><strong>connect</strong></a>(self)</dt></dl>
- <dl><dt><a name="DBManager-get_data"><strong>get_data</strong></a>(self, url='http://172.16.126.13/store/load?dataType={}&limit=0&sn={}', sn='', start_time='', end_time='', data_groups=['bms', 'gps'])</dt><dd><tt>获取指定 sn 和起止日期的bms和gps数据.<br>
- 添加了重试机制。<br>
- <br>
- --------------输入参数------------<br>
- url:数据获取url, 可采用默认值<br>
- sn: str, 电池sn号<br>
- start_time: str, 开始时间<br>
- end_time: str, 结束时间<br>
- data_groups: 选择需要获取的数据组,可填入多个字符串(默认只获取bms和gps数据)<br>
- bms: bms数据<br>
- gps:gps数据<br>
- system:system数据<br>
- accum:accum数据<br>
- <br>
- <br>
- --------------输出参数------------<br>
- df_data: {'bms':dataframe, 'gps':dataframe, 'system':dataframe, ;accum':dataframe}</tt></dd></dl>
- <hr>
- Data descriptors defined here:<br>
- <dl><dt><strong>__dict__</strong></dt>
- <dd><tt>dictionary for instance variables (if defined)</tt></dd>
- </dl>
- <dl><dt><strong>__weakref__</strong></dt>
- <dd><tt>list of weak references to the object (if defined)</tt></dd>
- </dl>
- </td></tr></table></td></tr></table><p>
- <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
- <tr bgcolor="#55aa55">
- <td colspan=3 valign=bottom> <br>
- <font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr>
-
- <tr><td bgcolor="#55aa55"><tt> </tt></td><td> </td>
- <td width="100%"><strong>S</strong> = <RegexFlag.DOTALL: 16></td></tr></table><p>
- <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
- <tr bgcolor="#7799ee">
- <td colspan=3 valign=bottom> <br>
- <font color="#ffffff" face="helvetica, arial"><big><strong>Author</strong></big></font></td></tr>
-
- <tr><td bgcolor="#7799ee"><tt> </tt></td><td> </td>
- <td width="100%">lmstack</td></tr></table>
- </body></html>
|