該(gai)設(she)計(ji)屬(shu)于計(ji)算機軟件-系統應用軟件領域(yu),涉及一種機載端航電總線狀態(tai)交(jiao)換協議(yi)處理方法(fa)。
背景技術:
隨著民用(yong)(yong)(yong)航(hang)(hang)(hang)空(kong)電(dian)子(zi)系統的(de)(de)(de)(de)(de)(de)(de)發(fa)(fa)展,飛(fei)機(ji)內(nei)部(bu)(bu)的(de)(de)(de)(de)(de)(de)(de)航(hang)(hang)(hang)電(dian)總(zong)線(xian)種類越來(lai)越多,機(ji)載(zai)航(hang)(hang)(hang)電(dian)數據信(xin)息(xi)管(guan)(guan)理系統負責對航(hang)(hang)(hang)電(dian)總(zong)線(xian)上數據進行實時地采(cai)集,并且(qie)將(jiang)采(cai)集的(de)(de)(de)(de)(de)(de)(de)數據通(tong)過某種方式發(fa)(fa)送給外部(bu)(bu)應用(yong)(yong)(yong)。當外部(bu)(bu)應用(yong)(yong)(yong)接收不(bu)到(dao)航(hang)(hang)(hang)電(dian)數據信(xin)息(xi)管(guan)(guan)理系統發(fa)(fa)送的(de)(de)(de)(de)(de)(de)(de)數據時,需要某種遠(yuan)程(cheng)方式能夠獲得總(zong)線(xian)上的(de)(de)(de)(de)(de)(de)(de)歷史信(xin)息(xi),根據歷史信(xin)息(xi)來(lai)分析總(zong)線(xian)的(de)(de)(de)(de)(de)(de)(de)歷史狀(zhuang)態和當前所處的(de)(de)(de)(de)(de)(de)(de)狀(zhuang)態。如(ru)何遠(yuan)程(cheng)獲取機(ji)載(zai)航(hang)(hang)(hang)電(dian)總(zong)線(xian)的(de)(de)(de)(de)(de)(de)(de)歷史信(xin)息(xi),這就(jiu)需要用(yong)(yong)(yong)戶自定義一套輕量(liang)級(ji)的(de)(de)(de)(de)(de)(de)(de)遠(yuan)程(cheng)獲取機(ji)載(zai)航(hang)(hang)(hang)電(dian)總(zong)線(xian)管(guan)(guan)理信(xin)息(xi)的(de)(de)(de)(de)(de)(de)(de)協議(yi),輕量(liang)級(ji)的(de)(de)(de)(de)(de)(de)(de)機(ji)載(zai)航(hang)(hang)(hang)電(dian)總(zong)線(xian)管(guan)(guan)理信(xin)息(xi)協議(yi)占用(yong)(yong)(yong)的(de)(de)(de)(de)(de)(de)(de)機(ji)載(zai)設備資(zi)源少,并且(qie)交互(hu)方式簡單易行,利于在機(ji)載(zai)設備上實現,并且(qie)能夠達到(dao)很好(hao)的(de)(de)(de)(de)(de)(de)(de)使(shi)用(yong)(yong)(yong)效果。
技術實現要素:
本發明的目的:
本發明提供一種機(ji)載(zai)端(duan)航(hang)(hang)電總線(xian)(xian)(xian)狀態交換協議處(chu)理(li)方法,能夠(gou)在機(ji)載(zai)設備上開發機(ji)載(zai)航(hang)(hang)電總線(xian)(xian)(xian)管(guan)理(li)的服務,進(jin)而對航(hang)(hang)電總線(xian)(xian)(xian)狀態信(xin)息進(jin)行實(shi)時(shi)監控和管(guan)理(li),從而給遠程(cheng)的外部(bu)應(ying)用獲取(qu)機(ji)載(zai)端(duan)航(hang)(hang)電總線(xian)(xian)(xian)狀態信(xin)息提供了(le)便利(li),便于(yu)外部(bu)管(guan)理(li)人員實(shi)時(shi)了(le)解(jie)機(ji)載(zai)設備的航(hang)(hang)電總線(xian)(xian)(xian)的狀態,便于(yu)發現航(hang)(hang)電總線(xian)(xian)(xian)的故障信(xin)息,從而利(li)于(yu)對航(hang)(hang)電設備的維護和維修。
本發明的技術方案:
一(yi)種機載端航電總線狀態交換協議處理方(fang)法(fa),包括(kuo):
步(bu)驟(zou)1、等待接收外(wai)部應用(yong)請(qing)(qing)求消息(xi);如果接收到外(wai)部應用(yong)請(qing)(qing)求消息(xi),解析所(suo)述請(qing)(qing)求消息(xi);
步驟(zou)2、如果解析得到(dao)所述請求(qiu)消息(xi)為(wei)訪(fang)問命(ming)令A消息(xi),根據訪(fang)問命(ming)令A消息(xi)中(zhong)(zhong)總(zong)線類(lei)型和總(zong)線ID請求(qiu)的總(zong)線狀態信(xin)息(xi),獲取機(ji)載端航(hang)電總(zong)線管理(li)信(xin)息(xi)庫(ku)中(zhong)(zhong)對應(ying)的總(zong)線類(lei)型和總(zong)線ID上的總(zong)線狀態信(xin)息(xi);
步(bu)驟3、組裝訪問命(ming)令A的響(xiang)應(ying)消息并發送給外部應(ying)用,返回(hui)步(bu)驟1;
步驟(zou)4、如果解析得(de)到所(suo)述請求消息為訪問(wen)命令(ling)R消息,根據(ju)訪問(wen)命令(ling)R消息中總(zong)線(xian)(xian)類型(xing)(xing)和(he)總(zong)線(xian)(xian)ID請求的(de)總(zong)線(xian)(xian)狀態(tai)信(xin)息,獲(huo)取(qu)機(ji)載(zai)端航電(dian)總(zong)線(xian)(xian)管理信(xin)息庫中對(dui)應的(de)總(zong)線(xian)(xian)類型(xing)(xing)和(he)總(zong)線(xian)(xian)ID上的(de)總(zong)線(xian)(xian)狀態(tai)信(xin)息;
步驟(zou)(zou)5、組裝訪問命令(ling)R的響應(ying)消息并發送給外部應(ying)用,返回步驟(zou)(zou)1;
步(bu)驟6、如果解析得到所(suo)述(shu)請求消(xiao)息(xi)為訪問命令(ling)S消(xiao)息(xi),根據訪問命令(ling)S消(xiao)息(xi)中總(zong)線(xian)(xian)(xian)(xian)類型和(he)總(zong)線(xian)(xian)(xian)(xian)ID請求的(de)總(zong)線(xian)(xian)(xian)(xian)狀態(tai)信(xin)息(xi),獲取機載端航電總(zong)線(xian)(xian)(xian)(xian)管理信(xin)息(xi)庫中對應的(de)總(zong)線(xian)(xian)(xian)(xian)類型和(he)總(zong)線(xian)(xian)(xian)(xian)ID上的(de)總(zong)線(xian)(xian)(xian)(xian)狀態(tai)信(xin)息(xi);
步驟(zou)7、組裝訪問命令(ling)S的響應消(xiao)息并發送給外部應用,返(fan)回步驟(zou)1;
航(hang)電總(zong)線(xian)管理(li)信息庫(ku)中機載(zai)端航(hang)電總(zong)線(xian)管理(li)信息模型(xing)為:
(1)機(ji)載端航(hang)電總線管理信(xin)息模型(xing)采(cai)用樹形結構,模型(xing)采(cai)用四層(ceng)樹,根節點是(shi)(shi)(shi)管理信(xin)息庫,一層(ceng)是(shi)(shi)(shi)總線類型(xing)節點,二層(ceng)是(shi)(shi)(shi)總線號節點,三層(ceng)是(shi)(shi)(shi)記錄的航(hang)電總線狀態信(xin)息;
(2)航電總線管理(li)信息模型的(de)狀態信息中包含如下關系:
當正常接收情況:
a.接(jie)(jie)收(shou)總(zong)(zong)線數(shu)(shu)(shu)據(ju)總(zong)(zong)字節(jie)數(shu)(shu)(shu)次數(shu)(shu)(shu)*4294967296+接(jie)(jie)收(shou)總(zong)(zong)線數(shu)(shu)(shu)據(ju)總(zong)(zong)字節(jie)數(shu)(shu)(shu)=(接(jie)(jie)收(shou)數(shu)(shu)(shu)據(ju)成功總(zong)(zong)字節(jie)數(shu)(shu)(shu)次數(shu)(shu)(shu)*4294967296+接(jie)(jie)收(shou)總(zong)(zong)線數(shu)(shu)(shu)據(ju)成功總(zong)(zong)字節(jie)數(shu)(shu)(shu))+(接(jie)(jie)收(shou)數(shu)(shu)(shu)據(ju)失(shi)敗(bai)總(zong)(zong)字節(jie)數(shu)(shu)(shu)次數(shu)(shu)(shu)*4294967296+接(jie)(jie)收(shou)總(zong)(zong)線數(shu)(shu)(shu)據(ju)失(shi)敗(bai)總(zong)(zong)字節(jie)數(shu)(shu)(shu));
b.當接收(shou)總線數據總字節(jie)數等于4294967296時,接收(shou)總線數據總字節(jie)數次數加1;
c.當接收總線數(shu)(shu)(shu)據成功(gong)總字節數(shu)(shu)(shu)等于4294967296,接收數(shu)(shu)(shu)據成功(gong)總字節數(shu)(shu)(shu)次數(shu)(shu)(shu)加1;
d.每(mei)當接(jie)收(shou)(shou)(shou)(shou)(shou)一(yi)次(ci)(ci)數(shu)(shu)(shu)(shu)(shu)據(ju)(ju)(ju),數(shu)(shu)(shu)(shu)(shu)據(ju)(ju)(ju)通過完整性校驗,則接(jie)收(shou)(shou)(shou)(shou)(shou)總(zong)線(xian)(xian)數(shu)(shu)(shu)(shu)(shu)據(ju)(ju)(ju)成功(gong)(gong)總(zong)字節數(shu)(shu)(shu)(shu)(shu)更新(xin)為(wei)原來的(de)值(zhi)加(jia)上本次(ci)(ci)接(jie)收(shou)(shou)(shou)(shou)(shou)的(de)數(shu)(shu)(shu)(shu)(shu)據(ju)(ju)(ju)的(de)字節數(shu)(shu)(shu)(shu)(shu),接(jie)收(shou)(shou)(shou)(shou)(shou)總(zong)線(xian)(xian)數(shu)(shu)(shu)(shu)(shu)據(ju)(ju)(ju)總(zong)字節數(shu)(shu)(shu)(shu)(shu)更新(xin)為(wei)原來的(de)值(zhi)加(jia)上本次(ci)(ci)接(jie)收(shou)(shou)(shou)(shou)(shou)的(de)數(shu)(shu)(shu)(shu)(shu)據(ju)(ju)(ju)的(de)字節數(shu)(shu)(shu)(shu)(shu),接(jie)收(shou)(shou)(shou)(shou)(shou)成功(gong)(gong)次(ci)(ci)數(shu)(shu)(shu)(shu)(shu)加(jia)1,最近一(yi)次(ci)(ci)接(jie)收(shou)(shou)(shou)(shou)(shou)總(zong)線(xian)(xian)數(shu)(shu)(shu)(shu)(shu)據(ju)(ju)(ju)成功(gong)(gong)時間更新(xin)為(wei)接(jie)收(shou)(shou)(shou)(shou)(shou)數(shu)(shu)(shu)(shu)(shu)據(ju)(ju)(ju)時時間;當接(jie)收(shou)(shou)(shou)(shou)(shou)數(shu)(shu)(shu)(shu)(shu)據(ju)(ju)(ju)是第(di)一(yi)個數(shu)(shu)(shu)(shu)(shu)據(ju)(ju)(ju)包時,記(ji)錄第(di)一(yi)次(ci)(ci)接(jie)收(shou)(shou)(shou)(shou)(shou)數(shu)(shu)(shu)(shu)(shu)據(ju)(ju)(ju)時間;
e.當接收總線數(shu)據失(shi)敗(bai)總字節數(shu)等于(yu)4294967296,接收數(shu)據失(shi)敗(bai)總字節數(shu)次數(shu)加1;
f.每當(dang)接(jie)(jie)收(shou)(shou)(shou)一(yi)次(ci)數據(ju)(ju)(ju),數據(ju)(ju)(ju)未能(neng)通(tong)過(guo)完整性(xing)校驗(yan),則接(jie)(jie)收(shou)(shou)(shou)總(zong)線(xian)數據(ju)(ju)(ju)失敗總(zong)字(zi)節數更新(xin)為原來的(de)值(zhi)加上本次(ci)接(jie)(jie)收(shou)(shou)(shou)的(de)數據(ju)(ju)(ju)的(de)字(zi)節數,接(jie)(jie)收(shou)(shou)(shou)總(zong)線(xian)數據(ju)(ju)(ju)總(zong)字(zi)節數更新(xin)為原來的(de)值(zhi)加上本次(ci)接(jie)(jie)收(shou)(shou)(shou)的(de)數據(ju)(ju)(ju)的(de)字(zi)節數,接(jie)(jie)收(shou)(shou)(shou)失敗次(ci)數加1,最(zui)近一(yi)次(ci)接(jie)(jie)收(shou)(shou)(shou)總(zong)線(xian)數據(ju)(ju)(ju)失敗時間更新(xin)為接(jie)(jie)收(shou)(shou)(shou)數據(ju)(ju)(ju)時時間;當(dang)接(jie)(jie)收(shou)(shou)(shou)數據(ju)(ju)(ju)是第一(yi)個數據(ju)(ju)(ju)包時,記錄(lu)第一(yi)次(ci)接(jie)(jie)收(shou)(shou)(shou)數據(ju)(ju)(ju)時間;
g.當接收(shou)(shou)(shou)失(shi)敗次數達到(dao)設定的閾(yu)值后,接收(shou)(shou)(shou)總(zong)線(xian)狀態(tai)設置為失(shi)效狀態(tai),否則接收(shou)(shou)(shou)總(zong)線(xian)狀態(tai)設置為正常工作狀態(tai);
當正常發送情況:
a.發(fa)送(song)總(zong)(zong)(zong)(zong)線(xian)數(shu)(shu)(shu)(shu)據(ju)總(zong)(zong)(zong)(zong)字(zi)(zi)(zi)節(jie)數(shu)(shu)(shu)(shu)次(ci)數(shu)(shu)(shu)(shu)*4294967296+發(fa)送(song)總(zong)(zong)(zong)(zong)線(xian)數(shu)(shu)(shu)(shu)據(ju)總(zong)(zong)(zong)(zong)字(zi)(zi)(zi)節(jie)數(shu)(shu)(shu)(shu)=(發(fa)送(song)數(shu)(shu)(shu)(shu)據(ju)成功總(zong)(zong)(zong)(zong)字(zi)(zi)(zi)節(jie)數(shu)(shu)(shu)(shu)次(ci)數(shu)(shu)(shu)(shu)*4294967296+發(fa)送(song)總(zong)(zong)(zong)(zong)線(xian)數(shu)(shu)(shu)(shu)據(ju)成功總(zong)(zong)(zong)(zong)字(zi)(zi)(zi)節(jie)數(shu)(shu)(shu)(shu))+(發(fa)送(song)數(shu)(shu)(shu)(shu)據(ju)失敗總(zong)(zong)(zong)(zong)字(zi)(zi)(zi)節(jie)數(shu)(shu)(shu)(shu)次(ci)數(shu)(shu)(shu)(shu)*4294967296+發(fa)送(song)總(zong)(zong)(zong)(zong)線(xian)數(shu)(shu)(shu)(shu)據(ju)失敗總(zong)(zong)(zong)(zong)字(zi)(zi)(zi)節(jie)數(shu)(shu)(shu)(shu)次(ci)數(shu)(shu)(shu)(shu));
b.當發(fa)送總線(xian)數(shu)據總字節(jie)數(shu)等(deng)于(yu)4294967296時,發(fa)送總線(xian)數(shu)據總字節(jie)數(shu)次數(shu)加1;
c.當發送總線數(shu)據(ju)成(cheng)(cheng)功(gong)總字節(jie)數(shu)等于4294967296時(shi),發送數(shu)據(ju)成(cheng)(cheng)功(gong)總字節(jie)數(shu)次數(shu)加1;
d.每當發(fa)(fa)送(song)(song)一(yi)次數(shu)(shu)(shu)(shu)(shu)據(ju)(ju)(ju),數(shu)(shu)(shu)(shu)(shu)據(ju)(ju)(ju)發(fa)(fa)送(song)(song)成功,則發(fa)(fa)送(song)(song)總(zong)線(xian)(xian)數(shu)(shu)(shu)(shu)(shu)據(ju)(ju)(ju)成功總(zong)字(zi)(zi)節(jie)(jie)數(shu)(shu)(shu)(shu)(shu)更(geng)新為(wei)原來的(de)(de)值加上(shang)本次發(fa)(fa)送(song)(song)的(de)(de)數(shu)(shu)(shu)(shu)(shu)據(ju)(ju)(ju)的(de)(de)字(zi)(zi)節(jie)(jie)數(shu)(shu)(shu)(shu)(shu),發(fa)(fa)送(song)(song)總(zong)線(xian)(xian)數(shu)(shu)(shu)(shu)(shu)據(ju)(ju)(ju)總(zong)字(zi)(zi)節(jie)(jie)數(shu)(shu)(shu)(shu)(shu)更(geng)新為(wei)原來的(de)(de)值加上(shang)本次發(fa)(fa)送(song)(song)的(de)(de)數(shu)(shu)(shu)(shu)(shu)據(ju)(ju)(ju)的(de)(de)字(zi)(zi)節(jie)(jie)數(shu)(shu)(shu)(shu)(shu),發(fa)(fa)送(song)(song)成功次數(shu)(shu)(shu)(shu)(shu)加1,最近一(yi)次發(fa)(fa)送(song)(song)總(zong)線(xian)(xian)數(shu)(shu)(shu)(shu)(shu)據(ju)(ju)(ju)成功時(shi)間(jian)更(geng)新為(wei)發(fa)(fa)送(song)(song)數(shu)(shu)(shu)(shu)(shu)據(ju)(ju)(ju)時(shi)時(shi)間(jian);當發(fa)(fa)送(song)(song)數(shu)(shu)(shu)(shu)(shu)據(ju)(ju)(ju)是第一(yi)個數(shu)(shu)(shu)(shu)(shu)據(ju)(ju)(ju)包時(shi),記錄第一(yi)次發(fa)(fa)送(song)(song)數(shu)(shu)(shu)(shu)(shu)據(ju)(ju)(ju)時(shi)間(jian);
e.當發(fa)(fa)送(song)總(zong)(zong)線數(shu)據(ju)失敗總(zong)(zong)字節數(shu)等(deng)于4294967296,發(fa)(fa)送(song)數(shu)據(ju)失敗總(zong)(zong)字節數(shu)次數(shu)加1;
f.每當(dang)發送(song)(song)一次(ci)(ci)(ci)數(shu)(shu)(shu)(shu)(shu)據(ju),數(shu)(shu)(shu)(shu)(shu)據(ju)發送(song)(song)失敗,則發送(song)(song)總(zong)(zong)(zong)線(xian)數(shu)(shu)(shu)(shu)(shu)據(ju)失敗總(zong)(zong)(zong)字(zi)(zi)節(jie)數(shu)(shu)(shu)(shu)(shu)更新為(wei)原來(lai)(lai)的(de)值加上(shang)本次(ci)(ci)(ci)發送(song)(song)的(de)數(shu)(shu)(shu)(shu)(shu)據(ju)的(de)字(zi)(zi)節(jie)數(shu)(shu)(shu)(shu)(shu),發送(song)(song)總(zong)(zong)(zong)線(xian)數(shu)(shu)(shu)(shu)(shu)據(ju)總(zong)(zong)(zong)字(zi)(zi)節(jie)數(shu)(shu)(shu)(shu)(shu)更新為(wei)原來(lai)(lai)的(de)值加上(shang)本次(ci)(ci)(ci)發送(song)(song)的(de)數(shu)(shu)(shu)(shu)(shu)據(ju)的(de)字(zi)(zi)節(jie)數(shu)(shu)(shu)(shu)(shu),發送(song)(song)失敗次(ci)(ci)(ci)數(shu)(shu)(shu)(shu)(shu)加1,最近一次(ci)(ci)(ci)發送(song)(song)總(zong)(zong)(zong)線(xian)數(shu)(shu)(shu)(shu)(shu)據(ju)失敗時(shi)間(jian)更新為(wei)發送(song)(song)數(shu)(shu)(shu)(shu)(shu)據(ju)時(shi)時(shi)間(jian);當(dang)發送(song)(song)數(shu)(shu)(shu)(shu)(shu)據(ju)是第一個(ge)數(shu)(shu)(shu)(shu)(shu)據(ju)包時(shi),記(ji)錄第一次(ci)(ci)(ci)發送(song)(song)數(shu)(shu)(shu)(shu)(shu)據(ju)時(shi)間(jian);
g.當發送(song)失敗次數達(da)到設(she)置(zhi)的閾(yu)值后,發送(song)總(zong)線狀態(tai)(tai)設(she)置(zhi)為失效狀態(tai)(tai),否則閾(yu)值內,發送(song)總(zong)線狀態(tai)(tai)設(she)置(zhi)為正(zheng)常(chang)工作狀態(tai)(tai)。
訪問命令A、R、S消息中總(zong)(zong)(zong)線(xian)類型和總(zong)(zong)(zong)線(xian)ID請求的總(zong)(zong)(zong)線(xian)狀態信息時,機載航電總(zong)(zong)(zong)線(xian)信息管理協(xie)議交(jiao)互(hu)流程包括:
一、訪問(wen)命(ming)令A交互(hu)過程:應(ying)用向機(ji)載(zai)端發送(song)訪問(wen)命(ming)令A的請求消(xiao)(xiao)息,機(ji)載(zai)端收(shou)到請求消(xiao)(xiao)息后進行(xing)處理(li),當請求消(xiao)(xiao)息內容(rong)(rong)完全(quan)正確,回復包(bao)含數(shu)據字段(duan)的響(xiang)應(ying);當請求消(xiao)(xiao)息內容(rong)(rong)檢查出(chu)現錯誤(wu),則回復不包(bao)含數(shu)據字段(duan)的響(xiang)應(ying);
二、訪問命令R交互過程:應用向機載(zai)端發送訪問命令R的(de)(de)請求(qiu)消息,機載(zai)端收到請求(qiu)消息后進行處理,當請求(qiu)消息內(nei)容完全(quan)正確,回復包(bao)含數據字段的(de)(de)響(xiang)應;當請求(qiu)消息內(nei)容檢(jian)查出現錯誤,則回復不(bu)包(bao)含數據字段的(de)(de)響(xiang)應;
三、訪(fang)問命令(ling)S交互過程(cheng):應用(yong)向機載(zai)端(duan)發送訪(fang)問命令(ling)S的請(qing)求消息,機載(zai)端(duan)收到請(qing)求消息后進行處理(li),當(dang)請(qing)求消息內容完全(quan)正確,回復(fu)包含數據(ju)字(zi)段的響應;當(dang)請(qing)求消息內容檢(jian)查出現錯誤,則回復(fu)不包含數據(ju)字(zi)段的響應。
訪問命(ming)令(ling)A、R、S消息(xi)中(zhong)總線(xian)類型和總線(xian)ID請求的總線(xian)狀態信(xin)息(xi)時,機(ji)載(zai)航(hang)電(dian)總線(xian)信(xin)息(xi)管理(li)協議交(jiao)互(hu)流程的交(jiao)互(hu)協議數據模型具(ju)體(ti)為(wei):
分為請(qing)求(qiu)消(xiao)息(xi)(xi)和響應(ying)消(xiao)息(xi)(xi)兩(liang)部分,兩(liang)個消(xiao)息(xi)(xi)的字(zi)段(duan)定義如下:
(1)總線類(lei)型:表示請(qing)求總線類(lei)型;
(2)總(zong)線ID:表示請求的具體的某(mou)條總(zong)線。
(3)訪(fang)問(wen)命令(ling):表示請(qing)求的(de)總(zong)線狀態(tai)信息,訪(fang)問(wen)命令(ling)分為:
A:表示獲取此總線(xian)下面所有狀態信息;
R:表示獲取(qu)此總(zong)線(xian)下面與接收有關的狀態信息;
S:表示獲取此總(zong)線下面與發送有關的(de)狀態信息。
(4)請求消息狀(zhuang)(zhuang)態(tai)碼:表(biao)示請求的消息正(zheng)確與(yu)否,狀(zhuang)(zhuang)態(tai)碼分為:
0:表示請求消息中所(suo)有字段都正(zheng)確;
1:表示請求消息的CRC校(xiao)驗錯誤;
2:表示請求(qiu)消(xiao)息中無此總(zong)線類型;
3:表示請求消(xiao)息中(zhong)無(wu)此總線ID;
4:表示請(qing)求消息中無此訪(fang)問命令。
(5)響應(ying)命令:表示(shi)對請求消(xiao)息中訪問命令的回復,響應(ying)命令分為:
AR:表(biao)示(shi)對訪問命令A的響應;
RR:表示對訪問命令R的(de)響應;
SR:表示對訪問命令(ling)S的響(xiang)應。
(6)數據(ju):當請求消(xiao)息(xi)(xi)內容(rong)檢查正確和通過,則(ze)響(xiang)(xiang)應(ying)消(xiao)息(xi)(xi)包含此(ci)字段(duan),如果請求消(xiao)息(xi)(xi)檢查出現錯誤,則(ze)響(xiang)(xiang)應(ying)消(xiao)息(xi)(xi)不包含此(ci)字段(duan)。
(7)CRC:表示消(xiao)息的CRC校(xiao)驗碼。
本發(fa)明具有的(de)優點效果:
本設(she)計在使用過程(cheng)中(zhong)可(ke)以獲(huo)取以下有益效果:
(1)提供對(dui)機載(zai)航電總(zong)(zong)線(xian)(xian)的(de)狀態(tai)(tai)監控和(he)管(guan)理,通過對(dui)每一類航電總(zong)(zong)線(xian)(xian)的(de)每一條航電總(zong)(zong)線(xian)(xian)的(de)狀態(tai)(tai)信息(xi)的(de)統計,便于機載(zai)維(wei)護人員和(he)管(guan)理人員及時地通過遠程方式獲悉航電總(zong)(zong)線(xian)(xian)的(de)歷史(shi)狀態(tai)(tai)信息(xi),分析機載(zai)航電總(zong)(zong)線(xian)(xian)是否發生(sheng)故(gu)障(zhang),故(gu)障(zhang)發生(sheng)的(de)時間點和(he)發生(sheng)的(de)頻率,提高了設備的(de)可維(wei)護性(xing)和(he)維(wei)修性(xing)。
(2)方法(fa)的通用性:本方法(fa)是一(yi)種輕量級(ji)的協(xie)(xie)議,機載端實(shi)現協(xie)(xie)議時(shi)占用的硬件資源少,便(bian)于實(shi)現和(he)可操(cao)作性,不論是采(cai)用TCP還是UDP都可實(shi)現此協(xie)(xie)議。
附圖說明
圖(tu)1為機載端航(hang)電總線(xian)管(guan)理信息模型示意圖(tu)。
圖2為(wei)機(ji)載航電總線信息管理交互協議數據模(mo)型(xing)示(shi)意圖。
圖3為機(ji)載航電總線信息管理協議(yi)交互流程示意圖。
圖(tu)4為機載端(duan)航電總線(xian)交換(huan)協議數(shu)據處理流程示意(yi)圖(tu)。
具體實施方式
一種機載端航電總(zong)線狀態交(jiao)換(huan)協議(yi)處理方法,包括:
步驟1、等待接收外部(bu)應(ying)用請(qing)求(qiu)(qiu)消(xiao)息(xi);如(ru)果接收到外部(bu)應(ying)用請(qing)求(qiu)(qiu)消(xiao)息(xi),解(jie)析(xi)所述請(qing)求(qiu)(qiu)消(xiao)息(xi);
步驟2、如果解析(xi)得到所述請(qing)求消息為訪問命(ming)令A消息,根據(ju)訪問命(ming)令A消息中總(zong)線類型和總(zong)線ID請(qing)求的總(zong)線狀(zhuang)態(tai)信息,獲取機載端(duan)航電總(zong)線管理信息庫中對應的總(zong)線類型和總(zong)線ID上(shang)的總(zong)線狀(zhuang)態(tai)信息;
步(bu)驟3、組裝訪問命(ming)令A的(de)響應(ying)消息并(bing)發送給外部應(ying)用(yong),返回步(bu)驟1;
步驟(zou)4、如果解析(xi)得到(dao)所述請(qing)求(qiu)消(xiao)息(xi)為(wei)訪問命令(ling)R消(xiao)息(xi),根(gen)據(ju)訪問命令(ling)R消(xiao)息(xi)中(zhong)總(zong)(zong)(zong)(zong)線(xian)類(lei)型和總(zong)(zong)(zong)(zong)線(xian)ID請(qing)求(qiu)的總(zong)(zong)(zong)(zong)線(xian)狀(zhuang)態(tai)信(xin)(xin)息(xi),獲取機載端航(hang)電(dian)總(zong)(zong)(zong)(zong)線(xian)管理信(xin)(xin)息(xi)庫中(zhong)對應的總(zong)(zong)(zong)(zong)線(xian)類(lei)型和總(zong)(zong)(zong)(zong)線(xian)ID上的總(zong)(zong)(zong)(zong)線(xian)狀(zhuang)態(tai)信(xin)(xin)息(xi);
步驟5、組裝訪問命令R的響應消(xiao)息(xi)并發送給外部應用(yong),返回步驟1;
步驟6、如果解析得到所述請(qing)(qing)求(qiu)消(xiao)(xiao)息為訪問命(ming)令S消(xiao)(xiao)息,根據訪問命(ming)令S消(xiao)(xiao)息中(zhong)總(zong)線類型和(he)(he)總(zong)線ID請(qing)(qing)求(qiu)的總(zong)線狀態信(xin)息,獲取機載端航(hang)電總(zong)線管理信(xin)息庫(ku)中(zhong)對應的總(zong)線類型和(he)(he)總(zong)線ID上的總(zong)線狀態信(xin)息;
步(bu)驟(zou)7、組裝訪問命令S的響應(ying)消(xiao)息并發送給外(wai)部應(ying)用,返回(hui)步(bu)驟(zou)1。
航電總線管(guan)理(li)信息(xi)庫中(zhong)機(ji)載端(duan)航電總線管(guan)理(li)信息(xi)模型為:
(1)機(ji)載端航電總(zong)線(xian)管(guan)理信(xin)息(xi)(xi)模型(xing)采用樹形結構,模型(xing)采用四層樹,根節(jie)點(dian)(dian)是管(guan)理信(xin)息(xi)(xi)庫,一層是總(zong)線(xian)類型(xing)節(jie)點(dian)(dian),二層是總(zong)線(xian)號節(jie)點(dian)(dian),三層是記錄(lu)的航電總(zong)線(xian)狀態信(xin)息(xi)(xi);
(2)航電總線(xian)管理(li)信(xin)(xin)息模型(xing)的狀態信(xin)(xin)息中包含(han)如下關(guan)系:
當正常接收情況:
a.接收總(zong)(zong)線(xian)數(shu)(shu)(shu)(shu)據(ju)(ju)總(zong)(zong)字(zi)(zi)節數(shu)(shu)(shu)(shu)次數(shu)(shu)(shu)(shu)*4294967296+接收總(zong)(zong)線(xian)數(shu)(shu)(shu)(shu)據(ju)(ju)總(zong)(zong)字(zi)(zi)節數(shu)(shu)(shu)(shu)=(接收數(shu)(shu)(shu)(shu)據(ju)(ju)成功總(zong)(zong)字(zi)(zi)節數(shu)(shu)(shu)(shu)次數(shu)(shu)(shu)(shu)*4294967296+接收總(zong)(zong)線(xian)數(shu)(shu)(shu)(shu)據(ju)(ju)成功總(zong)(zong)字(zi)(zi)節數(shu)(shu)(shu)(shu))+(接收數(shu)(shu)(shu)(shu)據(ju)(ju)失敗總(zong)(zong)字(zi)(zi)節數(shu)(shu)(shu)(shu)次數(shu)(shu)(shu)(shu)*4294967296+接收總(zong)(zong)線(xian)數(shu)(shu)(shu)(shu)據(ju)(ju)失敗總(zong)(zong)字(zi)(zi)節數(shu)(shu)(shu)(shu));
b.當接收總線數(shu)據(ju)(ju)總字節數(shu)等于4294967296時,接收總線數(shu)據(ju)(ju)總字節數(shu)次數(shu)加1;
c.當接收(shou)總(zong)線數據成(cheng)功(gong)總(zong)字節數等于(yu)4294967296,接收(shou)數據成(cheng)功(gong)總(zong)字節數次數加1;
d.每當接(jie)(jie)(jie)(jie)(jie)收(shou)一次數(shu)據(ju)(ju)(ju),數(shu)據(ju)(ju)(ju)通(tong)過完(wan)整性校驗,則接(jie)(jie)(jie)(jie)(jie)收(shou)總(zong)線(xian)數(shu)據(ju)(ju)(ju)成功(gong)總(zong)字(zi)節數(shu)更(geng)新為原來的(de)值(zhi)(zhi)加(jia)上本次接(jie)(jie)(jie)(jie)(jie)收(shou)的(de)數(shu)據(ju)(ju)(ju)的(de)字(zi)節數(shu),接(jie)(jie)(jie)(jie)(jie)收(shou)總(zong)線(xian)數(shu)據(ju)(ju)(ju)總(zong)字(zi)節數(shu)更(geng)新為原來的(de)值(zhi)(zhi)加(jia)上本次接(jie)(jie)(jie)(jie)(jie)收(shou)的(de)數(shu)據(ju)(ju)(ju)的(de)字(zi)節數(shu),接(jie)(jie)(jie)(jie)(jie)收(shou)成功(gong)次數(shu)加(jia)1,最近一次接(jie)(jie)(jie)(jie)(jie)收(shou)總(zong)線(xian)數(shu)據(ju)(ju)(ju)成功(gong)時(shi)(shi)(shi)間(jian)更(geng)新為接(jie)(jie)(jie)(jie)(jie)收(shou)數(shu)據(ju)(ju)(ju)時(shi)(shi)(shi)時(shi)(shi)(shi)間(jian);當接(jie)(jie)(jie)(jie)(jie)收(shou)數(shu)據(ju)(ju)(ju)是第一個(ge)數(shu)據(ju)(ju)(ju)包時(shi)(shi)(shi),記(ji)錄(lu)第一次接(jie)(jie)(jie)(jie)(jie)收(shou)數(shu)據(ju)(ju)(ju)時(shi)(shi)(shi)間(jian);
e.當(dang)接收(shou)總線數據失(shi)敗(bai)總字節(jie)數等(deng)于4294967296,接收(shou)數據失(shi)敗(bai)總字節(jie)數次數加1;
f.每當接(jie)(jie)(jie)(jie)(jie)(jie)收(shou)一(yi)次(ci)(ci)數(shu)據(ju)(ju)(ju),數(shu)據(ju)(ju)(ju)未能(neng)通(tong)過完(wan)整性校驗,則(ze)接(jie)(jie)(jie)(jie)(jie)(jie)收(shou)總(zong)線數(shu)據(ju)(ju)(ju)失(shi)敗(bai)總(zong)字節數(shu)更新(xin)(xin)為原來的(de)值加(jia)上本次(ci)(ci)接(jie)(jie)(jie)(jie)(jie)(jie)收(shou)的(de)數(shu)據(ju)(ju)(ju)的(de)字節數(shu),接(jie)(jie)(jie)(jie)(jie)(jie)收(shou)總(zong)線數(shu)據(ju)(ju)(ju)總(zong)字節數(shu)更新(xin)(xin)為原來的(de)值加(jia)上本次(ci)(ci)接(jie)(jie)(jie)(jie)(jie)(jie)收(shou)的(de)數(shu)據(ju)(ju)(ju)的(de)字節數(shu),接(jie)(jie)(jie)(jie)(jie)(jie)收(shou)失(shi)敗(bai)次(ci)(ci)數(shu)加(jia)1,最近一(yi)次(ci)(ci)接(jie)(jie)(jie)(jie)(jie)(jie)收(shou)總(zong)線數(shu)據(ju)(ju)(ju)失(shi)敗(bai)時(shi)(shi)間(jian)(jian)更新(xin)(xin)為接(jie)(jie)(jie)(jie)(jie)(jie)收(shou)數(shu)據(ju)(ju)(ju)時(shi)(shi)時(shi)(shi)間(jian)(jian);當接(jie)(jie)(jie)(jie)(jie)(jie)收(shou)數(shu)據(ju)(ju)(ju)是第一(yi)個數(shu)據(ju)(ju)(ju)包時(shi)(shi),記(ji)錄第一(yi)次(ci)(ci)接(jie)(jie)(jie)(jie)(jie)(jie)收(shou)數(shu)據(ju)(ju)(ju)時(shi)(shi)間(jian)(jian);
g.當接收(shou)失敗次數達到設定(ding)的閾值后,接收(shou)總線(xian)(xian)狀態設置為失效(xiao)狀態,否則接收(shou)總線(xian)(xian)狀態設置為正常工作狀態;
當正常發送情況:
a.發(fa)送(song)總(zong)(zong)(zong)線(xian)數(shu)(shu)(shu)據(ju)(ju)總(zong)(zong)(zong)字(zi)(zi)(zi)節數(shu)(shu)(shu)次(ci)數(shu)(shu)(shu)*4294967296+發(fa)送(song)總(zong)(zong)(zong)線(xian)數(shu)(shu)(shu)據(ju)(ju)總(zong)(zong)(zong)字(zi)(zi)(zi)節數(shu)(shu)(shu)=(發(fa)送(song)數(shu)(shu)(shu)據(ju)(ju)成功(gong)總(zong)(zong)(zong)字(zi)(zi)(zi)節數(shu)(shu)(shu)次(ci)數(shu)(shu)(shu)*4294967296+發(fa)送(song)總(zong)(zong)(zong)線(xian)數(shu)(shu)(shu)據(ju)(ju)成功(gong)總(zong)(zong)(zong)字(zi)(zi)(zi)節數(shu)(shu)(shu))+(發(fa)送(song)數(shu)(shu)(shu)據(ju)(ju)失敗(bai)總(zong)(zong)(zong)字(zi)(zi)(zi)節數(shu)(shu)(shu)次(ci)數(shu)(shu)(shu)*4294967296+發(fa)送(song)總(zong)(zong)(zong)線(xian)數(shu)(shu)(shu)據(ju)(ju)失敗(bai)總(zong)(zong)(zong)字(zi)(zi)(zi)節數(shu)(shu)(shu)次(ci)數(shu)(shu)(shu));
b.當發送(song)總線數(shu)(shu)據總字節數(shu)(shu)等于(yu)4294967296時,發送(song)總線數(shu)(shu)據總字節數(shu)(shu)次數(shu)(shu)加1;
c.當發(fa)送(song)(song)總(zong)線(xian)數據(ju)成(cheng)功(gong)總(zong)字(zi)節數等于4294967296時,發(fa)送(song)(song)數據(ju)成(cheng)功(gong)總(zong)字(zi)節數次數加1;
d.每當發(fa)(fa)(fa)送(song)(song)(song)一次(ci)(ci)數(shu)據(ju)(ju),數(shu)據(ju)(ju)發(fa)(fa)(fa)送(song)(song)(song)成(cheng)功,則發(fa)(fa)(fa)送(song)(song)(song)總(zong)線(xian)數(shu)據(ju)(ju)成(cheng)功總(zong)字節(jie)數(shu)更(geng)新(xin)為原(yuan)來(lai)的值加上本次(ci)(ci)發(fa)(fa)(fa)送(song)(song)(song)的數(shu)據(ju)(ju)的字節(jie)數(shu),發(fa)(fa)(fa)送(song)(song)(song)總(zong)線(xian)數(shu)據(ju)(ju)總(zong)字節(jie)數(shu)更(geng)新(xin)為原(yuan)來(lai)的值加上本次(ci)(ci)發(fa)(fa)(fa)送(song)(song)(song)的數(shu)據(ju)(ju)的字節(jie)數(shu),發(fa)(fa)(fa)送(song)(song)(song)成(cheng)功次(ci)(ci)數(shu)加1,最近一次(ci)(ci)發(fa)(fa)(fa)送(song)(song)(song)總(zong)線(xian)數(shu)據(ju)(ju)成(cheng)功時(shi)間更(geng)新(xin)為發(fa)(fa)(fa)送(song)(song)(song)數(shu)據(ju)(ju)時(shi)時(shi)間;當發(fa)(fa)(fa)送(song)(song)(song)數(shu)據(ju)(ju)是第一個數(shu)據(ju)(ju)包(bao)時(shi),記(ji)錄(lu)第一次(ci)(ci)發(fa)(fa)(fa)送(song)(song)(song)數(shu)據(ju)(ju)時(shi)間;
e.當發(fa)送總(zong)(zong)線數(shu)據(ju)失(shi)敗(bai)總(zong)(zong)字節數(shu)等于4294967296,發(fa)送數(shu)據(ju)失(shi)敗(bai)總(zong)(zong)字節數(shu)次數(shu)加1;
f.每當發(fa)送(song)一次數(shu)(shu)(shu)據(ju)(ju),數(shu)(shu)(shu)據(ju)(ju)發(fa)送(song)失敗,則發(fa)送(song)總(zong)線(xian)數(shu)(shu)(shu)據(ju)(ju)失敗總(zong)字節(jie)數(shu)(shu)(shu)更新(xin)為原來的(de)(de)值加(jia)上本(ben)次發(fa)送(song)的(de)(de)數(shu)(shu)(shu)據(ju)(ju)的(de)(de)字節(jie)數(shu)(shu)(shu),發(fa)送(song)總(zong)線(xian)數(shu)(shu)(shu)據(ju)(ju)總(zong)字節(jie)數(shu)(shu)(shu)更新(xin)為原來的(de)(de)值加(jia)上本(ben)次發(fa)送(song)的(de)(de)數(shu)(shu)(shu)據(ju)(ju)的(de)(de)字節(jie)數(shu)(shu)(shu),發(fa)送(song)失敗次數(shu)(shu)(shu)加(jia)1,最近一次發(fa)送(song)總(zong)線(xian)數(shu)(shu)(shu)據(ju)(ju)失敗時間更新(xin)為發(fa)送(song)數(shu)(shu)(shu)據(ju)(ju)時時間;當發(fa)送(song)數(shu)(shu)(shu)據(ju)(ju)是第(di)一個數(shu)(shu)(shu)據(ju)(ju)包時,記錄第(di)一次發(fa)送(song)數(shu)(shu)(shu)據(ju)(ju)時間;
g.當發送失敗次數達到設(she)置(zhi)(zhi)的閾值后,發送總(zong)線(xian)(xian)狀(zhuang)態設(she)置(zhi)(zhi)為失效狀(zhuang)態,否則閾值內(nei),發送總(zong)線(xian)(xian)狀(zhuang)態設(she)置(zhi)(zhi)為正(zheng)常工作狀(zhuang)態。
訪(fang)問命(ming)令A、R、S消息中總(zong)線(xian)(xian)類型和(he)總(zong)線(xian)(xian)ID請求的總(zong)線(xian)(xian)狀(zhuang)態信息時,機載航電總(zong)線(xian)(xian)信息管理協議交(jiao)互流程(cheng)包括(kuo):
一(yi)、訪(fang)問(wen)命(ming)令A交(jiao)互過程:應(ying)用向機載端發送訪(fang)問(wen)命(ming)令A的(de)請(qing)求消(xiao)(xiao)(xiao)息(xi)(xi)(xi),機載端收到請(qing)求消(xiao)(xiao)(xiao)息(xi)(xi)(xi)后進行處(chu)理,當(dang)請(qing)求消(xiao)(xiao)(xiao)息(xi)(xi)(xi)內(nei)容(rong)完(wan)全正(zheng)確(que),回(hui)復(fu)包含數(shu)據(ju)(ju)字段(duan)的(de)響應(ying);當(dang)請(qing)求消(xiao)(xiao)(xiao)息(xi)(xi)(xi)內(nei)容(rong)檢查出(chu)現錯誤,則回(hui)復(fu)不包含數(shu)據(ju)(ju)字段(duan)的(de)響應(ying);
二(er)、訪問(wen)(wen)命令R交互過程:應(ying)用向機(ji)載端發送訪問(wen)(wen)命令R的(de)請(qing)求(qiu)消息,機(ji)載端收(shou)到請(qing)求(qiu)消息后進(jin)行處理,當(dang)請(qing)求(qiu)消息內容(rong)完(wan)全正確,回(hui)(hui)復包含數(shu)據(ju)字段的(de)響應(ying);當(dang)請(qing)求(qiu)消息內容(rong)檢查出現(xian)錯誤(wu),則回(hui)(hui)復不包含數(shu)據(ju)字段的(de)響應(ying);
三、訪問(wen)命令S交互過程:應用(yong)向機(ji)載端發(fa)送(song)訪問(wen)命令S的請求(qiu)(qiu)消(xiao)(xiao)息(xi),機(ji)載端收(shou)到請求(qiu)(qiu)消(xiao)(xiao)息(xi)后進行處理,當請求(qiu)(qiu)消(xiao)(xiao)息(xi)內容完全正確,回(hui)復包含數據字段的響應;當請求(qiu)(qiu)消(xiao)(xiao)息(xi)內容檢查出現錯誤,則回(hui)復不包含數據字段的響應。
訪問命(ming)令A、R、S消(xiao)息(xi)中(zhong)總(zong)(zong)線類(lei)型和總(zong)(zong)線ID請求的(de)總(zong)(zong)線狀態信息(xi)時,機載航電總(zong)(zong)線信息(xi)管理協(xie)議交互流程的(de)交互協(xie)議數據模型具體(ti)為:
分為請求消息和響(xiang)應消息兩(liang)部分,兩(liang)個消息的字段定義(yi)如下:
(1)總線(xian)類型:表示請求(qiu)總線(xian)類型;
(2)總線(xian)ID:表示請求的具(ju)體的某條(tiao)總線(xian)。
(3)訪(fang)問命(ming)令:表示請求的總線狀態(tai)信(xin)息(xi),訪(fang)問命(ming)令分為(wei):
A:表示獲取此總線下(xia)面所有狀態信息(xi);
R:表示獲取(qu)此總線(xian)下面與接收有關的狀態信息;
S:表示獲取此總(zong)線下(xia)面(mian)與發送有關的(de)狀態信息。
(4)請(qing)(qing)求消(xiao)息(xi)狀態(tai)碼(ma):表示請(qing)(qing)求的消(xiao)息(xi)正確與否,狀態(tai)碼(ma)分為:
0:表示請求消息中所有字段都正確;
1:表示請求消息的(de)CRC校驗錯誤(wu);
2:表示請求消息中無此總線(xian)類(lei)型;
3:表示請(qing)求消息(xi)中無此總線ID;
4:表示請(qing)求消息(xi)中(zhong)無(wu)此(ci)訪問命令。
(5)響(xiang)應命(ming)令:表示對(dui)請求消息中訪問命(ming)令的回(hui)復,響(xiang)應命(ming)令分為(wei):
AR:表示(shi)對訪問命令A的響應;
RR:表示對訪問命令R的響應;
SR:表(biao)示對訪問命令S的響應(ying)。
(6)數據:當請求消(xiao)息(xi)內容檢(jian)查正確和通(tong)過(guo),則(ze)響(xiang)應消(xiao)息(xi)包含此字段,如果請求消(xiao)息(xi)檢(jian)查出現錯誤(wu),則(ze)響(xiang)應消(xiao)息(xi)不包含此字段。
(7)CRC:表示消息的(de)CRC校驗碼。
實施例
機(ji)載端航(hang)電總(zong)(zong)線交(jiao)互協議數(shu)據處理(li)流程(cheng)描述了(le)機(ji)載端航(hang)電總(zong)(zong)線交(jiao)互協議服務處理(li)的(de)過程(cheng)和流程(cheng),如圖4所示。
(1)機載端服務等待(dai)接收外部應(ying)用請求消息(xi),無消息(xi)則一直等待(dai),有消息(xi)時轉到(2);
(2)解(jie)析(xi)外部應用發送的(de)請(qing)求消(xiao)息,根據請(qing)求消(xiao)息格(ge)式(圖2請(qing)求消(xiao)息)來解(jie)析(xi)消(xiao)息;若(ruo)請(qing)求消(xiao)息正確,且訪(fang)問(wen)命(ming)(ming)令(ling)是(shi)A,則執行圖3中的(de)訪(fang)問(wen)命(ming)(ming)令(ling)A過程(cheng),轉(zhuan)到(dao)(dao)(3);若(ruo)訪(fang)問(wen)命(ming)(ming)令(ling)是(shi)R,則執行圖3中的(de)訪(fang)問(wen)命(ming)(ming)令(ling)R過程(cheng),轉(zhuan)到(dao)(dao)(6);若(ruo)訪(fang)問(wen)命(ming)(ming)令(ling)是(shi)S,則執行圖3中的(de)訪(fang)問(wen)命(ming)(ming)令(ling)S過程(cheng),轉(zhuan)到(dao)(dao)(9);若(ruo)解(jie)析(xi)請(qing)求消(xiao)息錯誤,則轉(zhuan)到(dao)(dao)(1);
(3)根據請求消息中的訪問命令A、總(zong)(zong)線(xian)類型(xing)和總(zong)(zong)線(xian)ID,獲取圖1中機載端(duan)航(hang)電總(zong)(zong)線(xian)管(guan)理信息庫中對(dui)應的總(zong)(zong)線(xian)類型(xing)和總(zong)(zong)線(xian)ID上的總(zong)(zong)線(xian)狀態信息,獲取成功后,轉到(dao)(4);
(4)按圖2中(zhong)響應消(xiao)息格式組(zu)裝訪(fang)問命令A的(de)響應消(xiao)息,組(zu)裝成功(gong)后(hou),轉到(5);
(5)向(xiang)外部應(ying)用發送請求(qiu)訪問(wen)命令A對應(ying)的響(xiang)應(ying)消息(xi)。發送完成(cheng)后,轉(zhuan)到(1);
(6)根(gen)據請(qing)求(qiu)消(xiao)息中(zhong)(zhong)的訪問命令R、總(zong)線類型(xing)和總(zong)線ID,獲取圖1中(zhong)(zhong)機載端航電(dian)總(zong)線管理信(xin)息庫中(zhong)(zhong)對應的總(zong)線類型(xing)和總(zong)線ID上的總(zong)線狀態信(xin)息,獲取成功后,轉到(7);
(7)按圖2中響(xiang)應(ying)消(xiao)息格式組裝訪問命(ming)令R的(de)響(xiang)應(ying)消(xiao)息,組裝成功后(hou),轉到(8);
(8)向外部應用發(fa)送請求(qiu)訪(fang)問命令R對應的(de)響應消息。發(fa)送完成后,轉到(1);
(9)根據(ju)請求消息(xi)(xi)中的訪問(wen)命令S、總(zong)線類型和總(zong)線ID,獲(huo)取圖1中機載端航電(dian)總(zong)線管理信(xin)息(xi)(xi)庫中對(dui)應的總(zong)線類型和總(zong)線ID上的總(zong)線狀(zhuang)態(tai)信(xin)息(xi)(xi),獲(huo)取成功后,轉到(10);
(10)按圖2中響應(ying)消(xiao)息格式組裝訪問命(ming)令S的響應(ying)消(xiao)息,組裝成功后,轉到(11);
(11)向外部應(ying)用(yong)發送訪問命令S對應(ying)的響應(ying)消息。發送完成后(hou),轉(zhuan)到(1);
1.機載端航電(dian)總線管理信息(xi)模型
機載端航電總(zong)線管理(li)信息模型如(ru)圖1所(suo)示。
(1)機載端航電總線(xian)管(guan)理(li)信息(xi)模(mo)(mo)型采用樹(shu)(shu)形(xing)結(jie)構,模(mo)(mo)型采用四層樹(shu)(shu),根節點(dian)是(shi)管(guan)理(li)信息(xi)庫,一層是(shi)總線(xian)類型節點(dian),二(er)層是(shi)總線(xian)號節點(dian),三層是(shi)記錄的航電總線(xian)狀態信息(xi)。
(2)航電總線管理信(xin)息模型(xing)的狀(zhuang)態信(xin)息中包含如(ru)下(xia)關系:
當正常接收情況:
h.接收(shou)總(zong)線數(shu)(shu)(shu)(shu)(shu)(shu)據(ju)(ju)(ju)總(zong)字(zi)節(jie)數(shu)(shu)(shu)(shu)(shu)(shu)次數(shu)(shu)(shu)(shu)(shu)(shu)*4294967296+接收(shou)總(zong)線數(shu)(shu)(shu)(shu)(shu)(shu)據(ju)(ju)(ju)總(zong)字(zi)節(jie)數(shu)(shu)(shu)(shu)(shu)(shu)=(接收(shou)數(shu)(shu)(shu)(shu)(shu)(shu)據(ju)(ju)(ju)成功總(zong)字(zi)節(jie)數(shu)(shu)(shu)(shu)(shu)(shu)次數(shu)(shu)(shu)(shu)(shu)(shu)*4294967296+接收(shou)總(zong)線數(shu)(shu)(shu)(shu)(shu)(shu)據(ju)(ju)(ju)成功總(zong)字(zi)節(jie)數(shu)(shu)(shu)(shu)(shu)(shu))+(接收(shou)數(shu)(shu)(shu)(shu)(shu)(shu)據(ju)(ju)(ju)失敗總(zong)字(zi)節(jie)數(shu)(shu)(shu)(shu)(shu)(shu)次數(shu)(shu)(shu)(shu)(shu)(shu)*4294967296+接收(shou)總(zong)線數(shu)(shu)(shu)(shu)(shu)(shu)據(ju)(ju)(ju)失敗總(zong)字(zi)節(jie)數(shu)(shu)(shu)(shu)(shu)(shu));
i.當接收(shou)總(zong)線數(shu)據總(zong)字節(jie)數(shu)等于4294967296時,接收(shou)總(zong)線數(shu)據總(zong)字節(jie)數(shu)次(ci)數(shu)加1;
j.當接(jie)(jie)收總線數據成功總字(zi)節數等(deng)于4294967296,接(jie)(jie)收數據成功總字(zi)節數次數加1;
k.每當接(jie)(jie)(jie)(jie)收一(yi)(yi)次(ci)(ci)數(shu)(shu)據,數(shu)(shu)據通過完整性校驗,則(ze)接(jie)(jie)(jie)(jie)收總線(xian)數(shu)(shu)據成(cheng)功總字(zi)(zi)節(jie)數(shu)(shu)更(geng)新(xin)為原來(lai)的(de)值(zhi)加上本次(ci)(ci)接(jie)(jie)(jie)(jie)收的(de)數(shu)(shu)據的(de)字(zi)(zi)節(jie)數(shu)(shu),接(jie)(jie)(jie)(jie)收總線(xian)數(shu)(shu)據總字(zi)(zi)節(jie)數(shu)(shu)更(geng)新(xin)為原來(lai)的(de)值(zhi)加上本次(ci)(ci)接(jie)(jie)(jie)(jie)收的(de)數(shu)(shu)據的(de)字(zi)(zi)節(jie)數(shu)(shu),接(jie)(jie)(jie)(jie)收成(cheng)功次(ci)(ci)數(shu)(shu)加1,最近(jin)一(yi)(yi)次(ci)(ci)接(jie)(jie)(jie)(jie)收總線(xian)數(shu)(shu)據成(cheng)功時間(jian)(jian)更(geng)新(xin)為接(jie)(jie)(jie)(jie)收數(shu)(shu)據時時間(jian)(jian);當接(jie)(jie)(jie)(jie)收數(shu)(shu)據是第一(yi)(yi)個數(shu)(shu)據包時,記錄第一(yi)(yi)次(ci)(ci)接(jie)(jie)(jie)(jie)收數(shu)(shu)據時間(jian)(jian)。
l.當(dang)接收總線數(shu)(shu)據失敗總字節(jie)數(shu)(shu)等(deng)于4294967296,接收數(shu)(shu)據失敗總字節(jie)數(shu)(shu)次數(shu)(shu)加1;
m.每當接(jie)(jie)收(shou)(shou)(shou)(shou)一(yi)次(ci)數(shu)(shu)(shu)(shu)據(ju)(ju)(ju),數(shu)(shu)(shu)(shu)據(ju)(ju)(ju)未(wei)能通過完整性校驗,則接(jie)(jie)收(shou)(shou)(shou)(shou)總線(xian)數(shu)(shu)(shu)(shu)據(ju)(ju)(ju)失(shi)敗(bai)總字節(jie)數(shu)(shu)(shu)(shu)更新為(wei)原(yuan)來的值(zhi)加上本次(ci)接(jie)(jie)收(shou)(shou)(shou)(shou)的數(shu)(shu)(shu)(shu)據(ju)(ju)(ju)的字節(jie)數(shu)(shu)(shu)(shu),接(jie)(jie)收(shou)(shou)(shou)(shou)總線(xian)數(shu)(shu)(shu)(shu)據(ju)(ju)(ju)總字節(jie)數(shu)(shu)(shu)(shu)更新為(wei)原(yuan)來的值(zhi)加上本次(ci)接(jie)(jie)收(shou)(shou)(shou)(shou)的數(shu)(shu)(shu)(shu)據(ju)(ju)(ju)的字節(jie)數(shu)(shu)(shu)(shu),接(jie)(jie)收(shou)(shou)(shou)(shou)失(shi)敗(bai)次(ci)數(shu)(shu)(shu)(shu)加1,最近一(yi)次(ci)接(jie)(jie)收(shou)(shou)(shou)(shou)總線(xian)數(shu)(shu)(shu)(shu)據(ju)(ju)(ju)失(shi)敗(bai)時間更新為(wei)接(jie)(jie)收(shou)(shou)(shou)(shou)數(shu)(shu)(shu)(shu)據(ju)(ju)(ju)時時間;當接(jie)(jie)收(shou)(shou)(shou)(shou)數(shu)(shu)(shu)(shu)據(ju)(ju)(ju)是(shi)第一(yi)個數(shu)(shu)(shu)(shu)據(ju)(ju)(ju)包時,記錄(lu)第一(yi)次(ci)接(jie)(jie)收(shou)(shou)(shou)(shou)數(shu)(shu)(shu)(shu)據(ju)(ju)(ju)時間。
n.當接收(shou)失敗次數達到設定(ding)的閾值后,接收(shou)總線狀態(tai)設置為失效狀態(tai),否(fou)則接收(shou)總線狀態(tai)設置為正常工作(zuo)狀態(tai)。
當正常發送情況:
h.發(fa)送總線(xian)(xian)數(shu)(shu)據(ju)總字(zi)節(jie)數(shu)(shu)次(ci)(ci)數(shu)(shu)*4294967296+發(fa)送總線(xian)(xian)數(shu)(shu)據(ju)總字(zi)節(jie)數(shu)(shu)=(發(fa)送數(shu)(shu)據(ju)成功(gong)總字(zi)節(jie)數(shu)(shu)次(ci)(ci)數(shu)(shu)*4294967296+發(fa)送總線(xian)(xian)數(shu)(shu)據(ju)成功(gong)總字(zi)節(jie)數(shu)(shu))+(發(fa)送數(shu)(shu)據(ju)失敗(bai)總字(zi)節(jie)數(shu)(shu)次(ci)(ci)數(shu)(shu)*4294967296+發(fa)送總線(xian)(xian)數(shu)(shu)據(ju)失敗(bai)總字(zi)節(jie)數(shu)(shu)次(ci)(ci)數(shu)(shu))
i.當發送總(zong)線數(shu)據(ju)總(zong)字(zi)節數(shu)等于4294967296時,發送總(zong)線數(shu)據(ju)總(zong)字(zi)節數(shu)次數(shu)加1;
j.當(dang)發送(song)總(zong)線數(shu)據(ju)成功(gong)總(zong)字節(jie)數(shu)等(deng)于(yu)4294967296時(shi),發送(song)數(shu)據(ju)成功(gong)總(zong)字節(jie)數(shu)次數(shu)加(jia)1;
k.每當發(fa)(fa)(fa)送(song)(song)(song)(song)一次(ci)數(shu)(shu)(shu)據,數(shu)(shu)(shu)據發(fa)(fa)(fa)送(song)(song)(song)(song)成(cheng)功(gong),則發(fa)(fa)(fa)送(song)(song)(song)(song)總線(xian)數(shu)(shu)(shu)據成(cheng)功(gong)總字(zi)(zi)節(jie)數(shu)(shu)(shu)更(geng)新為原來的值加(jia)上本次(ci)發(fa)(fa)(fa)送(song)(song)(song)(song)的數(shu)(shu)(shu)據的字(zi)(zi)節(jie)數(shu)(shu)(shu),發(fa)(fa)(fa)送(song)(song)(song)(song)總線(xian)數(shu)(shu)(shu)據總字(zi)(zi)節(jie)數(shu)(shu)(shu)更(geng)新為原來的值加(jia)上本次(ci)發(fa)(fa)(fa)送(song)(song)(song)(song)的數(shu)(shu)(shu)據的字(zi)(zi)節(jie)數(shu)(shu)(shu),發(fa)(fa)(fa)送(song)(song)(song)(song)成(cheng)功(gong)次(ci)數(shu)(shu)(shu)加(jia)1,最近一次(ci)發(fa)(fa)(fa)送(song)(song)(song)(song)總線(xian)數(shu)(shu)(shu)據成(cheng)功(gong)時(shi)間更(geng)新為發(fa)(fa)(fa)送(song)(song)(song)(song)數(shu)(shu)(shu)據時(shi)時(shi)間;當發(fa)(fa)(fa)送(song)(song)(song)(song)數(shu)(shu)(shu)據是(shi)第一個數(shu)(shu)(shu)據包時(shi),記錄第一次(ci)發(fa)(fa)(fa)送(song)(song)(song)(song)數(shu)(shu)(shu)據時(shi)間。
l.當發送總(zong)線數(shu)(shu)(shu)據失敗總(zong)字(zi)節數(shu)(shu)(shu)等于4294967296,發送數(shu)(shu)(shu)據失敗總(zong)字(zi)節數(shu)(shu)(shu)次(ci)數(shu)(shu)(shu)加1;
m.每當發(fa)(fa)送(song)(song)一(yi)次(ci)數(shu)(shu)據(ju)(ju)(ju)(ju),數(shu)(shu)據(ju)(ju)(ju)(ju)發(fa)(fa)送(song)(song)失敗(bai),則發(fa)(fa)送(song)(song)總線(xian)數(shu)(shu)據(ju)(ju)(ju)(ju)失敗(bai)總字(zi)(zi)節(jie)數(shu)(shu)更(geng)新(xin)為原來(lai)的(de)(de)值加上(shang)本次(ci)發(fa)(fa)送(song)(song)的(de)(de)數(shu)(shu)據(ju)(ju)(ju)(ju)的(de)(de)字(zi)(zi)節(jie)數(shu)(shu),發(fa)(fa)送(song)(song)總線(xian)數(shu)(shu)據(ju)(ju)(ju)(ju)總字(zi)(zi)節(jie)數(shu)(shu)更(geng)新(xin)為原來(lai)的(de)(de)值加上(shang)本次(ci)發(fa)(fa)送(song)(song)的(de)(de)數(shu)(shu)據(ju)(ju)(ju)(ju)的(de)(de)字(zi)(zi)節(jie)數(shu)(shu),發(fa)(fa)送(song)(song)失敗(bai)次(ci)數(shu)(shu)加1,最近一(yi)次(ci)發(fa)(fa)送(song)(song)總線(xian)數(shu)(shu)據(ju)(ju)(ju)(ju)失敗(bai)時間(jian)(jian)更(geng)新(xin)為發(fa)(fa)送(song)(song)數(shu)(shu)據(ju)(ju)(ju)(ju)時時間(jian)(jian);當發(fa)(fa)送(song)(song)數(shu)(shu)據(ju)(ju)(ju)(ju)是第一(yi)個數(shu)(shu)據(ju)(ju)(ju)(ju)包時,記錄第一(yi)次(ci)發(fa)(fa)送(song)(song)數(shu)(shu)據(ju)(ju)(ju)(ju)時間(jian)(jian)。
n.當發送失敗次數達到設(she)置(zhi)(zhi)的閾(yu)值后,發送總(zong)線狀態(tai)(tai)(tai)設(she)置(zhi)(zhi)為失效狀態(tai)(tai)(tai),否則閾(yu)值內,發送總(zong)線狀態(tai)(tai)(tai)設(she)置(zhi)(zhi)為正常(chang)工作狀態(tai)(tai)(tai)。
2.機載航電總線信息(xi)管理交互協議數據(ju)模型
機載(zai)航電總線信息管理交互協議數據模型如圖2所(suo)示,
交互協議數據模型的(de)分為請求消息(xi)和(he)響(xiang)應消息(xi)兩部分,兩個消息(xi)的(de)字(zi)段定(ding)義如下:
(1)總線(xian)類型:表示(shi)請求總線(xian)類型;
(2)總線ID:表示請求的具體的某條(tiao)總線。
(3)訪問命令:表(biao)示(shi)請求的總線狀態信(xin)息,訪問命令分為:
A:表(biao)示(shi)獲取此(ci)總(zong)線(xian)下(xia)面(mian)所有狀(zhuang)態(tai)信息;
R:表示(shi)獲取此總線下面與接收有關的狀態信息;
S:表(biao)示獲取此總線下(xia)面與(yu)發送有關的狀態(tai)信息。
(4)請(qing)求(qiu)消息(xi)(xi)狀(zhuang)態(tai)碼(ma)(ma):表(biao)示請(qing)求(qiu)的(de)消息(xi)(xi)正確與否,狀(zhuang)態(tai)碼(ma)(ma)分為:
0:表示請(qing)求(qiu)消息(xi)中所有字(zi)段都正確(que);
1:表示請求消(xiao)息的(de)CRC校驗錯誤;
2:表示請求(qiu)消息中無(wu)此總線(xian)類型;
3:表示請求(qiu)消息中(zhong)無此總線ID;
4:表示(shi)請求消(xiao)息中無此訪(fang)問命令。
(5)響應命令:表示(shi)對請求消息中訪問命令的回(hui)復,響應命令分為(wei):
AR:表示對訪問命(ming)令A的響應;
RR:表(biao)示對訪問(wen)命令R的(de)響應;
SR:表示對訪問命令S的響應。
(6)數據(ju):當請求消(xiao)(xiao)息內容檢查正確和通過,則響應(ying)消(xiao)(xiao)息包含(han)此字(zi)段(duan),如(ru)果(guo)請求消(xiao)(xiao)息檢查出現錯誤,則響應(ying)消(xiao)(xiao)息不包含(han)此字(zi)段(duan)。
(7)CRC:表示消息(xi)的CRC校(xiao)驗碼。
3.機載航電總(zong)線信息管理協議交互流(liu)程
機載航電(dian)總線信(xin)(xin)息管(guan)理協議(yi)交互(hu)流程如圖3所示,用于(yu)描述應用與機載端航電(dian)總線信(xin)(xin)息管(guan)理協議(yi)服務的(de)交互(hu)過程。
(1)訪(fang)問(wen)(wen)命令(ling)A交互過程:應(ying)用(yong)向機(ji)載(zai)端發送訪(fang)問(wen)(wen)命令(ling)A的請求(qiu)(qiu)消息,機(ji)載(zai)端收到請求(qiu)(qiu)消息后進行處理(li),當請求(qiu)(qiu)消息內容完全正確,回(hui)復包(bao)含(han)數據字段的響應(ying);當請求(qiu)(qiu)消息內容檢查出現錯(cuo)誤(wu),則回(hui)復不(bu)包(bao)含(han)數據字段的響應(ying)。
(2)訪問(wen)命令(ling)R交互過(guo)程(cheng):應(ying)用向(xiang)機(ji)載(zai)(zai)端發送訪問(wen)命令(ling)R的請(qing)求(qiu)消息,機(ji)載(zai)(zai)端收到請(qing)求(qiu)消息后進行處理(li),當請(qing)求(qiu)消息內(nei)容(rong)完全(quan)正確(que),回復(fu)(fu)包含數據字段(duan)的響應(ying);當請(qing)求(qiu)消息內(nei)容(rong)檢查出現錯誤,則回復(fu)(fu)不包含數據字段(duan)的響應(ying)。
(3)訪問命(ming)令S交(jiao)互(hu)過程:應用向機載端(duan)發送訪問命(ming)令S的(de)請求(qiu)消息(xi)(xi),機載端(duan)收(shou)到(dao)請求(qiu)消息(xi)(xi)后進行(xing)處(chu)理(li),當請求(qiu)消息(xi)(xi)內容(rong)完全正(zheng)確(que),回復包含(han)數據字(zi)段的(de)響(xiang)應;當請求(qiu)消息(xi)(xi)內容(rong)檢查出(chu)現錯誤(wu),則回復不包含(han)數據字(zi)段的(de)響(xiang)應。
4.機載端(duan)航電總線交(jiao)互協議數據處理(li)流程
機(ji)載端航電總線交互協議(yi)數據(ju)處理流(liu)程(cheng)(cheng)描述了機(ji)載端航電總線交互協議(yi)服(fu)務處理的過程(cheng)(cheng)和流(liu)程(cheng)(cheng),如圖4所示。
機載(zai)端航(hang)電(dian)總(zong)(zong)線(xian)交互(hu)協議處理流程(cheng)通過(guo)(guo)圖4所示的過(guo)(guo)程(cheng),對(dui)來自應(ying)(ying)用的請求消息進行解析,并且根據航(hang)電(dian)總(zong)(zong)線(xian)類(lei)型(xing)、總(zong)(zong)線(xian)ID和訪(fang)問命令獲取(qu)相應(ying)(ying)的數(shu)據,最后將響應(ying)(ying)發(fa)送(song)給應(ying)(ying)用。
在MA700機載(zai)(zai)信息(xi)管理(li)系(xi)統機載(zai)(zai)航(hang)電總(zong)線數(shu)據采集功能中(zhong),采用本方法來(lai)管理(li)機載(zai)(zai)航(hang)電總(zong)線的(de)狀態(tai)信息(xi)和遠程(cheng)獲取機載(zai)(zai)航(hang)電總(zong)線的(de)狀態(tai)信息(xi)。