{"id":2158,"date":"2019-02-28T09:14:17","date_gmt":"2019-02-28T09:14:17","guid":{"rendered":""},"modified":"2019-02-28T17:14:42","modified_gmt":"2019-02-28T09:14:42","slug":"%e5%9f%ba%e4%ba%8e%e5%b5%8c%e5%85%a5%e5%bc%8f%e6%95%b0%e6%8d%ae%e5%ba%93%e7%9a%84%e7%9f%bf%e5%9c%ba%e5%ae%89%e5%85%a8%e7%b3%bb%e7%bb%9f%e8%ae%be%e8%ae%a1%e6%96%b9%e6%a1%88%e8%af%a6%e8%a7%a3","status":"publish","type":"post","link":"http:\/\/www.szryc.com\/?p=2158","title":{"rendered":"\u57fa\u4e8e\u5d4c\u5165\u5f0f\u6570\u636e\u5e93\u7684\u77ff\u573a\u5b89\u5168\u7cfb\u7edf\u8bbe\u8ba1\u65b9\u6848\u8be6\u89e3"},"content":{"rendered":"

\n\t\u5f15\u8a00<\/p>\n

\n\t\u5d4c\u5165\u5f0f\u6570\u636e\u5e93<\/u>\u4e0d\u4ec5\u5728\u529f\u80fd\u6982\u5ff5\u53ca\u7cfb\u7edf\u7279\u70b9\u4e0a\u4e0e\u4f20\u7edf\u7684\u6570\u636e\u5e93\u6709\u7740\u5f88\u5927\u7684\u5dee\u522b\uff0c\u800c\u4e14\u5728\u5b83\u7684\u5e94\u7528\u65b9\u5f0f\u4e0a\u4e5f\u662f\u4e0d\u540c\u7684\u3002\u5d4c\u5165\u5f0f\u6570\u636e\u5e93\u5e76\u4e0d\u662f\u76f4\u63a5\u9500\u552e\u7ed9\u7528\u6237\uff0c\u800c\u662f\u63d0\u4f9b\u7ed9\u8bbe\u5907\u7684\u751f\u4ea7\u5546\u6216\u5e94\u7528\u7684\u5f00\u53d1\u5546\uff0c\u4ee5\u4fbf\u76f4\u63a5\u751f\u6210\u5728\u5d4c\u5165\u5f0f\u7cfb\u7edf\u548c\u5e94\u7528\u4e4b\u4e2d\uff0c\u5d4c\u5165\u5f0f\u6570\u636e\u5e93\u5728\u8bb8\u591a\u9886\u57df\u62e5\u6709\u5e7f\u6cdb\u7684\u5e94\u7528\u524d\u666f\uff0c\u5982\u624b\u6301\u5f0f\u8ba1\u7b97\u548c\u79fb\u52a8\u8ba1\u7b97\uff0c\u667a\u80fd\u8bbe\u5907\uff0c\u5728\u672c\u6587\u4e2d\u4fbf\u63d0\u4f9b\u4e86\u8f83\u597d\u7684\u5e94\u7528\u3002<\/p>\n

\n\t <\/div>\n

\n\t1 \u7cfb\u7edf\u9700\u6c42\u5206\u6790<\/p>\n

\n\t\u524d\u7aef\u6570\u636e\u91c7\u96c6\u3001\u76d1\u63a7\u3001\u53d1\u9001\u7b49\u5d4c\u5165\u5f0f\u7cfb\u7edf\u8f6f\u4ef6\u5f00\u53d1\u5de5\u4f5c\u3002\u4e3a\u4e86\u6ee1\u8db3\u524d\u7aef\u5d4c\u5165\u5f0f\u76d1\u63a7\u7cfb\u7edf\u5bf9\u4e95\u4e0b\u5b9e\u65f6\u6570\u636e\u7684\u5b58\u50a8\u3001\u67e5\u8be2\u3001\u663e\u793a\u7b49\u5927\u91cf\u5904\u7406\u8981\u6c42\uff0c\u5fc5\u987b\u5b89\u88c5\u6570\u636e\u5e93\u7ba1\u7406\u7cfb\u7edf\uff0c\u800c\u4f20\u7edf\u7684\u6570\u636e\u5e93\u7ba1\u7406\u7cfb\u7edf\u663e\u7136\u56e0\u5176\u8d44\u6e90\u5360\u7528\u5927\u3001\u6570\u636e\u7ba1\u7406\u6548\u7387\u4f4e\u7b49\u7279\u70b9\u4e0d\u80fd\u9002\u7528\u4e0e\u5d4c\u5165\u5f0f\u77ff\u573a\u76d1\u63a7\u7cfb\u7edf\uff0c\u56e0\u6b64\uff0c\u63a2\u7d22\u4e00\u79cd\u9002\u7528\u4e8e\u77ff\u573a\u6076\u52a3\u73af\u5883\u4e0b\u7684\u5d4c\u5165\u5f0f\u76d1\u63a7\u7ec8\u7aef\u7684\u6570\u636e\u5e93\u7cfb\u7edf\u6210\u4e3a\u672c\u6587\u8fdb\u5c55\u7684\u5173\u952e\u3002<\/p>\n

\n\t\u5d4c\u5165\u5f0f\u6570\u636e\u5e93\u7ba1\u7406\u7cfb\u7edf\u662f\u968f\u7740\u5d4c\u5165\u5f0f\u5e94\u7528\u7684\u53d1\u5c55\u800c\u5174\u8d77\u7684\u4e00\u7c7b\u5d4c\u5165\u5f0f\u5e94\u7528\u8f6f\u4ef6\uff0c\u5df2\u7ecf\u6210\u4e3a\u6570\u636e\u5e93\u6280\u672f\u7814\u7a76\u7684\u4e00\u4e2a\u91cd\u8981\u5206\u652f\uff0c\u5728\u79fb\u52a8\u8ba1\u7b97\u5e73\u53f0\uff08\u5982HPC\uff0cPDA\uff09\u3001\u5bb6\u5ead\u4fe1\u606f\u73af\u5883\uff08\u5982\u673a\u9876\u76d2\u548c\u6570\u5b57\u7535\u89c6\uff09\u3001\u901a\u8baf\u8ba1\u7b97\u5e73\u53f0\u3001\u6c7d\u8f66\u7535\u5b50\u5e73\u53f0\u3001\u7535\u5b50\u5546\u52a1\u5e73\u53f0\uff08\u5982\u667a\u80fd\u5361\u5e94\u7528\uff09\u7b49\u9886\u57df\u5f97\u5230\u5e7f\u6cdb\u7684\u5e94\u7528\u3002<\/p>\n

\n\t\u4e3a\u89e3\u51b3\u8fd9\u4e9b\u95ee\u9898\uff0c\u63d0\u51fa\u4e86\u5d4c\u5165\u5f0f\u7cfb\u7edf\u5728\u7164\u77ff\u4e95\u4e0a\u76d1\u63a7\u7cfb\u7edf\u4e2d\u7684\u5e94\u7528\uff0c\u5d4c\u5165\u5f0f\u7cfb\u7edf\u6280\u672f\u7684\u5c0f\u4f53\u79ef\u3001\u9ad8\u53ef\u9760\u6027\u3001\u4f4e\u529f\u8017\u548c\u4f4e\u6210\u672c\u7b49\u7279\u70b9\u6ee1\u8db3\u4e95\u4e0a\u76d1\u63a7\u7cfb\u7edf\u8bbe\u5907\u7684\u4e25\u683c\u8981\u6c42\u53ca\u73b0\u573a\u6076\u52a3\u751f\u4ea7\u73af\u5883\u7684\u9002\u5e94\u6027\uff0c\u5e76\u4e14\u76d1\u63a7\u7ec8\u7aef\u79fb\u690d\u5d4c\u5165\u5f0f\u6570\u636e\u5e93\u7ba1\u7406\u7cfb\u7edf\uff0c\u6ee1\u8db3\u4f20\u7edf\u7164\u77ff\u5b89\u5168\u76d1\u63a7\u7cfb\u7edf\u7684\u4e3b\u8981\u529f\u80fd\u9700\u6c42\uff1a<\/p>\n

\n\t1.\u6570\u636e\u901a\u4fe1<\/u>\u529f\u80fd\u9700\u6c42\u3002<\/p>\n

\n\t2.\u5b9e\u65f6\u67e5\u8be2\u53ca\u663e\u793a\u9700\u6c42\u3002<\/p>\n

\n\t3.\u7528\u6237\u767b\u5f55\u7ba1\u7406\u9700\u6c42\u3002<\/p>\n

\n\t2 \u7cfb\u7edf\u603b\u4f53\u8bbe\u8ba1<\/p>\n

\n\t\u5d4c\u5165\u5f0f\u77ff\u573a\u5b89\u5168\u7cfb\u7edf\u7684\u6838\u5fc3\u662f\u6570\u636e\u5904\u7406\u3002\u76d1\u63a7\u7ec8\u7aef\u5b9e\u65f6\u91c7\u96c6\u77ff\u573a\u5404\u7c7b\u4f20\u611f\u5668<\/u>\u7684\u6a21\u62df\u4fe1\u53f7\uff08\u5982\u74e6\u65af\u6d53\u5ea6\u3001\u4e00\u6c27\u5316\u78b3\u6d53\u5ea6\u3001\u98ce\u901f\u3001\u6e29\u5ea6\u3001\u6e7f\u5ea6\u3001\u7c89\u5c18\u3001\u538b\u529b\u7b49\uff09\u548c\u73b0\u573a\u8bbe\u5907\u63a7\u5236\u8bbe\u5907\u7684\u5f00\u5173\u91cf\u4fe1\u53f7\uff08\u5982\u98ce\u673a\u542f\u3001\u505c\u72b6\u6001\u7b49\uff09\uff0c\u5b9e\u73b0\u6570\u636e\u5b9e\u65f6\u663e\u793a\u3001\u5b9e\u65f6\/\u5386\u53f2\u66f2\u7ebf\u663e\u793a\u3001\u67e5\u8be2\u548c\u62a5\u8868\u6253\u5370\u3001\u58f0\u5149\u62a5\u8b66\u3001\u624b\u52a8\/\u81ea\u52a8\u63a7\u5236\uff0c\u4ee5\u53ca\u7f51\u7edc\u901a\u4fe1\u7b49\u529f\u80fd\u3002\u800c\u6240\u6709\u8fd9\u4e9b\u529f\u80fd\u7684\u5b9e\u73b0\u90fd\u662f\u4ee5\u6570\u636e\u7ba1\u7406\u4e3a\u57fa\u7840\u7684\uff0c\u5d4c\u5165\u5f0f\u6570\u636e\u5e93\u7cfb\u7edf\u53ef\u4ee5\u6709\u6548\u5730\u7ec4\u7ec7\u548c\u7ba1\u7406\u7164\u77ff\u573a\u4e0b\u5404\u7c7b\u6570\u636e\uff0c\u4ece\u800c\u8fbe\u5230\u77ff\u573a\u76d1\u63a7\u7cfb\u7edf\u5b9e\u65f6\u67e5\u8be2\u3001\u63a7\u5236\u7b49\u529f\u80fd\u7684\u8bbe\u8ba1\u8981\u6c42\u3002\u56fe1 \u662f\u4e00\u4e2a\u5178\u578b\u7684\u91c7\u7528\u4e86\u5d4c\u5165\u5f0f\u6570\u636e\u5e93\u7684\u77ff\u573a\u5b89\u5168\u7cfb\u7edf\u7684\u7ed3\u6784\u56fe\uff1a<\/p>\n

\n\t\"\u57fa\u4e8e\u5d4c\u5165\u5f0f\u6570\u636e\u5e93\u7684\u77ff\u573a\u5b89\u5168\u7cfb\u7edf\u8bbe\u8ba1\u65b9\u6848\u8be6\u89e3\"<\/p>\n

\n\t\u7cfb\u7edf\u91c7\u7528 Windows CE \u5d4c\u5165\u5f0f\u64cd\u4f5c\u7cfb\u7edf\u548cBerkeley DB \u5d4c\u5165\u5f0f\u6570\u636e\u5e93\u4f5c\u4e3a\u77ff\u573a\u4e95\u4e0a\u76d1\u63a7\u7cfb\u7edf\u7ec8\u7aef\u5e94\u7528\u7a0b\u5e8f\u7684\u5f00\u53d1\u5e73\u53f0;\u4ee5\u73b0\u6709\u7684\u77ff\u573a\u5b89\u5168\u76d1\u6d4b\u76d1\u63a7\u7cfb\u7edf\u4e3a\u6570\u636e\u6e90\uff0c\u4ee5\u6587\u4ef6\u5171\u4eab\u7684\u65b9\u5f0f\u5b9e\u65f6\u91c7\u96c6\u73b0\u573a\u5b89\u5168\u751f\u4ea7\u6570\u636e\uff0c\u8fdb\u884c\u6570\u636e\u7684\u5904\u7406\u548c\u53d1\u9001\u3002<\/p>\n

\n\t3.\u7cfb\u7edf\u4e3b\u8981\u529f\u80fd\u6a21\u5757\u5b9e\u73b0<\/p>\n

\n\t3.1 \u6570\u636e\u91c7\u96c6\u6a21\u5757<\/p>\n

\n\t\u6570\u636e\u91c7\u96c6\u6a21\u5757\u5b9e\u73b0\u7164\u77ff\u6570\u636e\u6e90\u4f20\u611f\u5668\u5b9e\u65f6\u6570\u636e\u7684\u8bfb\u53d6\uff0c\u5e76\u8bbe\u8ba1\u6210\u4e00\u5b9a\u683c\u5f0f\u7684\u6570\u636e\u7ed3\u6784\uff0c\u4ee5\u4fbf\u6570\u636e\u5e93\u548c\u5e94\u7528\u7a0b\u5e8f\u64cd\u4f5c\u3002\u672c\u7cfb\u7edf\u4ee5\u73b0\u6709\u7684\u77ff\u573a\u5b89\u5168\u7cfb\u7edf\uff08MSUS \uff09\u4e3a\u6570\u636e\u6e90\uff0c\u5b89\u5168\u7cfb\u7edf\u6309\u7167\u534f\u8bae\u89c4\u5b9a\u7684\u6587\u4ef6\u683c\u5f0f\u7ec4\u7ec7\u4f20\u611f\u5668\u6570\u636e\uff0c\u5b58\u50a8\u5728\u6307\u5b9a\u672c\u5730\u78c1\u76d8\u8def\u5f84\u4e2d\u3002<\/p>\n

\n\t1.\u8bbe\u5907\u5b89\u88c5\u4fe1\u606f\u6587\u4ef6\uff08dev.xml \uff09<\/p>\n

\n\t\u4f20\u611f\u5668\u8bbe\u5907\u6587\u4ef6\u5206\u4e3a\u6570\u636e\u5934\u548c\u6570\u636e\u4f53\uff0c\u6570\u636e\u5934\u683c\u5f0f\u89c4\u5b9a\u5982\u4e0b\uff1a<\/p>\n

\n\t\u300a\u77ff\u573a\u7f16\u53f7\u300b\u300a\u77ff\u4e95\u540d\u79f0\u300b\u300a\u65e5\u671f\u300b\u300a\u4f20\u611f\u5668\u4e2a\u6570\u300b\u300a\u5176\u4ed6\u300b\u300a\u4fdd\u7559\u300b<\/p>\n

\n\t2.\u5b9e\u65f6\u6570\u636e\u6587\u4ef6\uff08rtdata. xml \uff09<\/p>\n

\n\t\u5b9e\u65f6\u6570\u636e\u6587\u4ef6\u5206\u4e3a\u6570\u636e\u5934\u548c\u6570\u636e\u4f53\uff0c\u6570\u636e\u5934\u683c\u5f0f\u89c4\u5b9a\u5982\u4e0b\uff1a<\/p>\n

\n\t\u300a\u77ff\u573a\u7f16\u53f7\u300b\u300a\u6570\u636e\u4e0a\u4f20\u65f6\u95f4\u300b\u300a\u4f20\u611f\u5668\u6570\u76ee\u300b<\/p>\n

\n\t\u6570\u636e\u4f53\u683c\u5f0f\u89c4\u5b9a\u5982\u4e0b\uff1a<\/p>\n

\n\t\u300a\u4f20\u611f\u5668\u7f16\u53f7\u300b\u300a\u6570\u636e\u503c\u300b\u300a\u6570\u636e\u72b6\u6001\u300b<\/p>\n

\n\t\u5176\u4e2d\uff0c\u6570\u636e\u72b6\u6001\u6309\u4f4d\u6765\u8868\u793a\u6570\u636e\u7684\u72b6\u6001\uff08\u7528\u4e8c\u8fdb\u5236\u5b9a\u4e49\uff0c\u4f7f\u7528\u65f6\u8f6c\u6362\u4e3a\u6574\u6570\uff09\uff0c\u5176\u6587\u672c\u5bf9\u5e94\u5173\u7cfb\u5982\u4e0b\uff1a<\/p>\n

\n\t\"\u57fa\u4e8e\u5d4c\u5165\u5f0f\u6570\u636e\u5e93\u7684\u77ff\u573a\u5b89\u5168\u7cfb\u7edf\u8bbe\u8ba1\u65b9\u6848\u8be6\u89e3\"<\/p>\n

\n\t\uff08\u4e8c\uff09\u6570\u636e\u91c7\u96c6\u7a0b\u5e8f\u8bbe\u8ba1<\/p>\n

\n\t\u6570\u636e\u91c7\u96c6\u6a21\u5757\u7a0b\u5e8f\u4f7f\u7528\u4e86 ReadFile.h \u548cReadFile.cpp \u6587\u4ef6\uff0c\u56e0\u6b64\u672c\u6587\u8bbe\u8ba1\u4e86CReadFile \u7c7b\uff0c\u8be5\u7c7b\u5c01\u88c5\u4e86\u5bf9dev.xml \u548crtdata.xml \u4ea4\u6362\u6587\u4ef6\u6240\u6709\u7684\u6570\u636e\u91c7\u96c6\u64cd\u4f5c\u3002\u6839\u636e dev.xml \u548crtdata.xml \u4ea4\u6362\u6587\u4ef6\u7684\u6784\u6210\uff0c\u4ee5\u53ca\u6570\u636e\u5e93\u5b58\u50a8\u64cd\u4f5c\u4e0a\u7684\u8003\u8651\uff0c\u7a0b\u5e8f\u4e3a\u6bcf\u4e2a\u4f20\u611f\u5668\u8bbe\u8ba1\u4e86DEVDATA \u548cREALDATA \u7ed3\u6784\u4f53\uff0c\u5206\u522b\u7528\u6765\u4fdd\u5b58dev.xml \u548crtdata.xml \u6587\u4ef6\u7684\u6570\u636e\u4fe1\u606f\u3002DEVDATA \u7ed3\u6784\u4f53\u5982\u4e0b\u6240\u793a\uff1a<\/p>\n

\n\ttypedef struct devdata<\/p>\n

\n\t{ TCHAR m_str_devSubstati<\/u>on\uff3bMAXLENGTH\uff3d;\/\/\u5206\u7ad9<\/p>\n

\n\tTCHAR m_str_devID\uff3bMAXID\uff3d;\/\/\u4f20\u611f\u5668\u7f16\u53f7<\/p>\n

\n\tTCHAR m_str_devPlace\uff3bMAXLENGTH\uff3d;\/\/\u5b89\u88c5\u5730\u70b9<\/p>\n

\n\tTCHAR m str_devName\uff3bMAX\uff3d;\/\/\u68c0\u6d4b\u7c7b\u522b<\/p>\n

\n\tTCHAR m str_devType\uff3bMAX\uff3d;\/\/\u4f20\u611f\u5668\u7c7b\u578b<\/p>\n

\n\tTCHAR m str_devUnit\uff3bMAX\uff3d;\/\/\u5355\u4f4d<\/p>\n

\n\tfloat m_data_up;\/\/\u91cf\u7a0b\u4e0a\u9650<\/p>\n

\n\tfloat mes_data_down;\/\/\u91cf\u7a0b\u4e0b\u9650<\/p>\n

\n\tfloat m_alarrn_up;\/\/\u62a5\u8b66\u4e0a\u9650<\/p>\n

\n\tfloat m_alarm<\/u>_down;\/\/\u62a5\u8b66\u4e0b\u9650<\/p>\n

\n\tfloat m_power_off;\/\/\u65ad\u7535\u503c<\/p>\n

\n\tfloat m_power_on;\/\/\u590d\u7535\u503c<\/p>\n

\n\t}DEVDATA;<\/p>\n

\n\tREALDATA \u7ed3\u6784\u4f53\u5982\u4e0b\u6240\u793a\uff1a<\/p>\n

\n\ttypedef struct realdata<\/p>\n

\n\t{TCHAR m_str_devID\uff3bMAXID\uff3d;\/\/\u4f20\u611f\u5668\u7f16\u53f7<\/p>\n

\n\tfloat m_data;\/\/\u4f20\u611f\u5668\u6570\u503c<\/p>\n

\n\tTCHAR m_str_dataStatus\uff3bMAXSTATUS\uff3d;\/\/\u6570\u636e\u72b6\u6001<\/p>\n

\n\t}REALDATA;<\/p>\n

\n\tCReadFile \u7c7b\u4f7f\u7528\u4e86CPtrList \u94fe\u8868\u6570\u636e\u7ed3\u6784\uff0c\u7528\u4ee5\u7ba1\u7406\u4ea4\u6362\u6587\u4ef6\u7684\u6240\u6709\u4f20\u611f\u5668\u4fe1\u606f\uff0c\u6570\u636e\u8282\u70b9\u4e3aDEVDATA \u548cREALDATA \u7ed3\u6784\u4f53\u3002<\/p>\n

\n\t3.2 \u6570\u636e\u5b58\u50a8\u6a21\u5757<\/p>\n

\n\t\u5c06\u4f20\u611f\u5668\u8bbe\u5907\u4e0a\u4f20\u65f6\u95f4\u4f5c\u4e3a key\uff0c\u5c01\u88c5\u5728DEVDATA \u7ed3\u6784\u4f53\u4e2d\u7684\u8bbe\u5907\u5b89\u88c5\u4fe1\u606f\u548c\u5c01\u88c5\u5728REALDATA \u7ed3\u6784\u4f53\u4e2d\u7684\u5b9e\u65f6\u6570\u636e\u4fe1\u606f\u5206\u522b\u6784\u6210\u6570\u636e\u5e93\u7684data\uff0c\u4ece\u800c\u6784\u6210\u4e24\u7ec4Key \u5230Data\u5bf9\u3002\u56e0\u6b64\uff0c\u8be5\u65b9\u6848\u5c06\u5f62\u6210\u4e24\u5f20\u8868\uff0c\u5206\u522b\u5b58\u50a8\u5728\u4e24\u4e2a\u6570\u636e\u5e93\u6587\u4ef6\u4e2d\u3002\u5c06\u4f20\u611f\u5668\u8bbe\u5907\u5b89\u88c5\u4fe1\u606f\u548c\u5b9e\u65f6\u6570\u636e\u4fe1\u606f\u5f62\u6210\u4e24\u4e2a\u6570\u636e\u5e93\u6587\u4ef6\u5206\u522b\u5b58\u50a8\uff0c\u53ea\u5728\u8bbe\u5907\u5b89\u88c5\u4fe1\u606f\u6539\u53d8\u7684\u65f6\u5019\u624d\u4f1a\u8fdb\u884c\u8bbe\u5907\u6587\u4ef6\u7684\u5b58\u50a8\u64cd\u4f5c\uff0c\u8fd9\u6837\u5927\u5927\u51cf\u5c11\u4e86\u6570\u636e\u5e93\u6587\u4ef6\u7684\u78c1\u76d8\u5360\u7528\u7a7a\u95f4\u3002<\/p>\n

\n\tBerkeley DB \u7528Key\/Data\uff08\u5173\u952e\u8bcd\/\u6570\u636e\uff09\u6765\u533a\u5206\u6570\u636e\u5e93\u4e2d\u7684\u6570\u636e\uff0cKey\/Data \u5bf9\u662fBerkeleyDB \u7528\u6765\u8fdb\u884c\u6570\u636e\u5e93\u7ba1\u7406\u7684\u57fa\u7840\uff0c\u7531\u8fd9\u4e24\u8005\u6784\u6210\u7684Key\/Data \u5bf9\u7ec4\u6210\u4e86\u6570\u636e\u5e93\u4e2d\u7684\u4e00\u4e2a\u57fa\u672c\u7ed3\u6784\u5355\u5143\uff0c\u800c\u6574\u4e2a\u6570\u636e\u5e93\u5b9e\u9645\u4e0a\u5c31\u662f\u7531\u8bb8\u591a\u8fd9\u6837\u7684\u7ed3\u6784\u5355\u5143\u6240\u6784\u6210\u7684\u3002\u4e5f\u5c31\u662f\u8bf4\uff0c\u8c03\u7528\u6570\u636e\u5e93\u63a5\u53e3\u5b9e\u9645\u4e0a\u5c31\u662f\u63d0\u4f9b\u4e86\u76f8\u5e94\u7684\u5173\u952e\u8bcd\uff0c\u901a\u8fc7\u8be5\u5173\u952e\u8bcd\u6765\u67e5\u627e\u8981\u64cd\u4f5c\u7684\u6570\u636e\u3002<\/p>\n

\n\t\u5982\u679c\u628a\u4e00\u7ec4\u76f8\u5173\u7684 Key\/Data \u5bf9\u4e5f\u770b\u4f5c\u4e00\u4e2a\u8868\u7684\u8bdd\uff0c\u90a3\u4e48\u6bcf\u4e00\u4e2a\u6570\u636e\u5e93\u53ea\u5141\u8bb8\u5b58\u653e\u4e00\u4e2atable\uff0c\u56e0\u6b64\uff0c\u4e00\u822c\u4e00\u79cd\u7c7b\u578b\u7684Key\/Data \u5bf9\u6784\u6210\u4e00\u4e2a\u6570\u636e\u5e93\u6587\u4ef6\u3002\u6570\u636e\u5e93\u5b58\u50a8\u4ee3\u7801\u8bbe\u8ba1\u4e3b\u8981\u5206\u4e3a\u8bbe\u5907\u5b89\u88c5\u4fe1\u606f\uff08key\/data \u5bf9\u4e3a\u8bbe\u5907\u4e0a\u4f20\u65f6\u95f4\/DEVDATA \u7ed3\u6784\u4f53\uff09\u5b58\u50a8\u4ee3\u7801\u8bbe\u8ba1\u548c\u5b9e\u65f6\u6570\u636e\u4fe1\u606f\uff08key\/data \u5bf9\u4e3a\u8bbe\u5907\u4e00\u4e0a\u4f20\u65f6\u95f4\/REALDATA \u7ed3\u6784\u4f53\uff09\u5b58\u50a8\u4ee3\u7801\u8bbe\u8ba1\u3002Berkeley DB \u662f\u4ee5\u6587\u4ef6\u4e3a\u5355\u4f4d\u8fdb\u884c\u6570\u636e\u5e93\u7ba1\u7406\u7684\uff0c\u7531\u4e8e\u8bbe\u5907\u5b89\u88c5\u4fe1\u606f\u53ea\u5728\u6570\u636e\u6539\u53d8\u7684\u65f6\u5019\u624d\u8fdb\u884c\u6570\u636e\u5e93\u5b58\u50a8\u64cd\u4f5c\uff0c\u5e76\u4e14\u5176\u95f4\u9694\u5468\u671f\u8f83\u957f\uff0c\u56e0\u6b64\u4f5c\u8005\u8bbe\u8ba1\u4e86dev.db \u6587\u4ef6\u5b9e\u73b0\u5b89\u88c5\u4fe1\u606f\u7684\u5b58\u50a8\u7ba1\u7406;\u7531\u4e8e\u5b9e\u65f6\u6570\u636e\u4fe1\u606f\u7684\u66f4\u65b0\u5468\u671f\u8f83\u77ed\uff0c\u6570\u636e\u5e93\u5b58\u50a8\u64cd\u4f5c\u9891\u7e41\uff0c\u5e76\u4e14\u6bcf\u5929\u90fd\u4f1a\u6709\u6570\u636e\u7684\u91c7\u96c6\u548c\u66f4\u65b0\uff0c\u56e0\u6b64\u4f5c\u8005\u4ee5\u6bcf\u5929\u7684\u65e5\u671f\u4e3a\u5355\u4f4d\u8bbe\u8ba1\u4e86\u5b9e\u65f6\u6570\u636e\u5e93\u6587\u4ef6\uff0c\u7cfb\u7edf\u5c06\u4f1a\u83b7\u53d6\u5f53\u5929\u7684\u65e5\u671f\uff0c\u5e76\u4ee5\u4e4b\u4e3a\u6587\u4ef6\u540d\u5f62\u6210\u6570\u636e\u5e93\u6587\u4ef6\u8fdb\u884c\u6570\u636e\u5e93\u64cd\u4f5c\uff0c\u4f8b\u5982\u5f53\u5929\u7684\u65e5\u671f\u4e3a2007 \u5e742 \u67088 \u65e5\uff0c\u90a3\u4e48\u6570\u636e\u5e93\u6587\u4ef6\u540d\u4e3a 2007-02-08.db \u3002<\/p>\n

\n\t\u8bbe\u5907\u5b89\u88c5\u4fe1\u606f\u548c\u5b9e\u65f6\u6570\u636e\u4fe1\u606f\u7684\u5b58\u50a8\u4ee3\u7801\u5177\u6709\u4e00\u5b9a\u7684\u76f8\u4f3c\u6027\uff0c\u4f5c\u8005\u4ee5\u5b9e\u65f6\u6570\u636e\u4fe1\u606f\u7684\u5b58\u50a8\u4ee3\u7801\u4e3a\u4f8b\u8bf4\u660e\u5176\u8bbe\u8ba1\u8fc7\u7a0b\uff0c\u7a0b\u5e8f\u6d41\u7a0b\u5982\u4e0b\u6240\u793a\uff1a<\/p>\n

\n\t\"\u57fa\u4e8e\u5d4c\u5165\u5f0f\u6570\u636e\u5e93\u7684\u77ff\u573a\u5b89\u5168\u7cfb\u7edf\u8bbe\u8ba1\u65b9\u6848\u8be6\u89e3\"<\/p>\n

\n\t\u56fe 2 \u8bbe\u5907\u5b89\u88c5\u4fe1\u606f\u6570\u636e\u5e93\u5b58\u50a8\u7a0b\u5e8f\u6d41\u7a0b<\/p>\n

\n\t3.3 \u6570\u636e\u67e5\u8be2\u6a21\u5757<\/p>\n

\n\t\u5b9e\u65f6\/\u5386\u53f2\u6570\u636e\u67e5\u8be2\u6a21\u5757\u8bbe\u8ba1\u4e3b\u8981\u5c31\u662fGetDevKey\u3001DataQueryByRealTIme \u548cDataQuery\u51fd\u6570\u8bbe\u8ba1\u3002<\/p>\n

\n\t1. DataQueryByRealTIme \u51fd\u6570\u8bbe\u8ba1<\/p>\n

\n\t\u82e5\u7528\u6237\u8f93\u5165\u7684\u67e5\u8be2\u65f6\u95f4\u6bb5\u5185\u8bbe\u5907\u5b89\u88c5\u4fe1\u606f\u6ca1\u6709\u6539\u53d8\uff0cGetDevKey \u51fd\u6570\u4f1a\u76f4\u63a5\u8fd4\u56deFALSE\uff0c\u7a0b\u5e8f\u63a5\u7740\u4f1a\u8c03\u7528DataQueryByRealTIme \u51fd\u6570\u67e5\u8be2\u5b9e\u65f6\u6570\u636e\u5e93\u6587\u4ef6\uff0c\u8bbe\u5907\u5b89\u88c5\u4fe1\u606f\u76f4\u63a5\u4ecem-devList \u7ed3\u6784\u4f53\u94fe\u8868\u4e2d\u83b7\u5f97\uff0c\u51fd\u6570\u8bbe\u8ba1\u5305\u62ec\u5982\u4e0b\uff1a<\/p>\n

\n\t\u2460\u6839\u636e\u7528\u6237\u8f93\u5165\u7684\u67e5\u8be2\u65e5\u671f\uff0c\u5f62\u6210\u5b9e\u65f6\u6570\u636e\u5e93\u6587\u4ef6\u59822007-02-09.db\uff0c\u6253\u5f00\u5b9e\u65f6\u6570\u636e\u5e93\u3002<\/p>\n

\n\t\u2461\u6784\u5efa\u6e38\u6807curs<\/u>or\uff0c\u4f7f\u7528get \u65b9\u6cd5\uff0c\u4ee5\u67e5\u8be2\u65f6\u95f4\u4e3akey\uff0cflag \u6807\u7b7e\u4e3aDB_ SET_ RANGE \u6e38\u6807\u5b9a\u4f4d\u5230\u6570\u636e\u5e93\u6587\u4ef6\u591a\u91cd\u8bb0\u5f55\u7684\u9996\u4e00\u8bb0\u5f55\u3002<\/p>\n

\n\t\u2462\u904d\u5386\u6570\u636e\u5e93\u6587\u4ef6\u62e5\u6709\u76f8\u540c kev \u7684\u591a\u91cd\u8bb0\u5f55\uff0c\u5c06data \u4e2d\u4f20\u611f\u5668ID \u53f7\u4e0e\u7528\u6237\u8f93\u5165ID \u53f7\u76f8\u7b49\u7684REALDATA \u7ed3\u6784\u4f53\u4e0e\u76f8\u5e94\u7684m devList \u94fe\u8868\u8282\u70b9DEVDATA \u7ed3\u6784\u4f53\u5728\u5217\u8868\u6846\u63a7\u4ef6\uff08CC1istCtrl\uff09\u4e2d\u663e\u793a\u51fa\u6765\u3002<\/p>\n

\n\t2. DataQuery \u51fd\u6570\u8bbe\u8ba1<\/p>\n

\n\t\u82e5\u8bbe\u5907\u67e5\u8be2\u65f6\u95f4\u5bf9\u5e94\u7684\u5b89\u88c5\u4fe1\u606f\u76f8\u5bf9\u4e8e\u5f53\u524d\u65f6\u95f4\u6bb5\u5df1\u7ecf\u6539\u53d8\uff0cGetDevKey \u51fd\u6570\u4f1a\u8fd4\u56de\u6b63\u786e\u7684\u8bbe\u5907\u5b89\u88c5\u4fe1\u606f\u67e5\u8be2\u65f6\u95f4devKey\uff0c\u8fd9\u4e2a\u67e5\u8be2\u65f6\u95f4\u53ef\u80fd\u8ddf\u7528\u6237\u8f93\u5165\u7684\u4f20\u611f\u5668\u67e5\u8be2\u65f6\u95f4\u4e0d\u540c;\u7a0b\u5e8f\u63a5\u7740\u4f1a\u8c03\u7528DataQuery \u51fd\u6570\uff0c\u5e76\u5c06\u8fd9\u4e2a\u6b63\u786e\u7684\u8bbe\u5907\u67e5\u8be2\u65f6\u95f4devKey\u3001\u7528\u6237\u8f93\u5165\u7684\u4f20\u611f\u5668\u5b9e\u65f6\u6570\u636e\u67e5\u8be2\u65f6\u95f4realKey\u3001\u4f20\u611f\u5668ID \u53f7strDevID \u4ee5\u53ca\u5b9e\u65f6\u6570\u636e\u5e93\u6587\u4ef6\u540dstrRealDbName\u4ee5\u5f62\u53c2\u65b9\u5f0f\u4f20\u7ed9DataQuery \u51fd\u6570\uff0c\u5176\u51fd\u6570\u8bbe\u8ba1\u5305\u62ec\u5982\u4e0b\uff1a<\/p>\n

\n\t\u2460\u6253\u5f00\u8bbe\u5907\u6570\u636e\u5e93 dev.db \u6587\u4ef6\uff0c\u6839\u636e\u5f62\u53c2strRealDbName \u6253\u5f00\u5b9e\u65f6\u6570\u636e\u5e93\u6587\u4ef6\u3002<\/p>\n

\n\t\u2461\u6784\u5efa\u6e38\u6807 cursor\uff0c\u4f7f\u7528get \u65b9\u6cd5\uff0c\u5206\u522b\u4ee5devKey \u548crealKey \u4e3a\u6570\u636e\u5e93\u7684key\uff0c flag\u6807\u7b7e\u4e3aDB_ SET_ RANGE\uff0c\u6e38\u6807\u5b9a\u4f4d\u5230\u8bbe\u5907\u6570\u636e\u5e93\u6587\u4ef6\u548c\u5b9e\u65f6\u6570\u636e\u5e93\u6587\u4ef6\u7684\u9996\u8bb0\u5f55\u3002<\/p>\n

\n\t\u2462\u904d\u5386\u6570\u636e\u5e93\u6587\u4ef6\u62e5\u6709\u76f8\u540ckey \u7684\u591a\u91cd\u8bb0\u5f55\uff0c\u82e5\u8bbe\u5907\u6570\u636e\u5e93\u6587\u4ef6\u8bb0\u5f55\u7684data \u4e2d\uff08DEVDATA \u7ed3\u6784\u4f53\uff09\u4f20\u611f\u5668ID \u53f7\u4e0e\u5b9e\u65f6\u6570\u636e\u5e93\u6587\u4ef6\u8bb0\u5f55\u7684data \u4e2d\uff08REALDATA \u7ed3\u6784\u4f53\uff09\u4f20\u611f\u5668ID \u53f7\u76f8\u7b49\uff0c\u5219\u5c06\u8fd9\u4e24\u4e2adata \u4fe1\u606f\u5728\u5217\u8868\u6846\u63a7\u4ef6\uff08CC1istCtrl\uff09\u4e2d\u663e\u793a\u51fa\u6765\u3002<\/p>\n

\n\t4\uff0e\u603b\u7ed3<\/p>\n

\n\t\u672c\u6587\u7684\u521b\u65b0\u70b9\uff1a\u5206\u6790\u5d4c\u5165\u5f0f\u7164\u77ff\u4e95\u4e0a\u76d1\u63a7\u7cfb\u7edf\u7684\u529f\u80fd\u9700\u6c42\uff0c\u5f00\u53d1\u8bbe\u8ba1\u4e86\u57fa\u4e8eBerkeley DB\u6570\u636e\u5e93\u548cWindows CE \u7684\u77ff\u573a\u5b89\u5168\u7cfb\u7edf\uff0c\u5b9e\u73b0\u4e86\u7a97\u53e3\u767b\u5f55\u3001\u6570\u636e\u91c7\u96c6\u3001\u7cfb\u7edf\u754c\u9762\u3001\u6570\u636e\u5e93\u5b58\u50a8\u3001\u5b9e\u65f6\/\u5386\u53f2\u6570\u636e\u67e5\u8be2\u3001\u5b9e\u65f6\u66f2\u7ebf\u663e\u793a\u7b49\u529f\u80fd\u6a21\u5757\uff0c\u6df1\u5165\u8ba8\u8bba\u7814\u7a76\u4e86\u7cfb\u7edf\u7684\u6570\u636e\u91c7\u96c6\u65b9\u6cd5\u3001\u6570\u636e\u5e93KEY\/DATA \u5bf9\u5b58\u50a8\u65b9\u6848\u53ca\u5b9e\u65f6\/\u5386\u53f2\u4f20\u611f\u5668\u6570\u636e\u7684\u6570\u636e\u5e93\u67e5\u8be2\u7b56\u7565\u3002\u5728\u5b9e\u9645\u751f\u4ea7\u4e2d\u5de5\u4f5c\u7a33\u5b9a\uff0c\u67e5\u8be2\u901f\u5ea6\u5feb\uff0c\u8fbe\u5230\u4e86\u9884\u671f\u7684\u8bbe\u8ba1\u76ee\u6807\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

\u5f15\u8a00 \u5d4c\u5165\u5f0f \u6570\u636e\u5e93 \u4e0d\u4ec5\u5728\u529f\u80fd\u6982\u5ff5\u53ca\u7cfb\u7edf\u7279\u70b9\u4e0a\u4e0e\u4f20\u7edf\u7684\u6570\u636e\u5e93\u6709\u7740\u5f88\u5927\u7684\u5dee\u522b\uff0c\u800c\u4e14\u5728\u5b83\u7684\u5e94\u7528\u65b9\u5f0f\u4e0a\u4e5f\u662f\u4e0d\u540c\u7684\u3002\u5d4c\u5165\u5f0f\u6570\u636e\u5e93\u5e76\u4e0d\u662f\u76f4\u63a5\u9500\u552e\u7ed9\u7528\u6237\uff0c\u800c\u662f\u63d0\u4f9b\u7ed9\u8bbe\u5907\u7684\u751f\u4ea7\u5546<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[14],"tags":[],"_links":{"self":[{"href":"http:\/\/www.szryc.com\/index.php?rest_route=\/wp\/v2\/posts\/2158"}],"collection":[{"href":"http:\/\/www.szryc.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.szryc.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.szryc.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.szryc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2158"}],"version-history":[{"count":0,"href":"http:\/\/www.szryc.com\/index.php?rest_route=\/wp\/v2\/posts\/2158\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.szryc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2158"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.szryc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2158"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.szryc.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2158"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}