




已閱讀5頁,還剩3頁未讀, 繼續(xù)免費閱讀
版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)
文檔簡介
北京工業(yè)大學(xué)畢業(yè)設(shè)計(譯文)-7-TheDIL/NetPCsDNP/1110UsingtheEmbeddedLinuxWebServerforEmbeddedSystemsAfterthe“everybody-in-the-Internet-wave”nowobviouslyfollowsthe“everything-in-the-Internet-wave”.Themostcoffee,vendingandwashingmachinesarestillnotavailableabouttheworldwidenet.HowevertheembeddedInternetintegrationforremotemaintenanceanddiagnosticaswellastheso-calledM2Mcommunicationisgrowingwithaconsiderablespeedrate.JusttheremotemaintenanceanddiagnosticofcomponentsandsystemsbyWebbrowsersviatheInternet,oralocalIntranethasaveryhighweightformanydevelopmentprojects.InnumerousdevelopmentdepartmentspeopleworkoncompletelyWebbasedconfigurationsandservicesforembeddedsystems.TheremainingdaysoftheclassicuserinterfacemadebyasmallLC-displaywithfrontpanelandafewfunctionkeysareover.ThroughfutureevolutionsinthefieldofthemobileInternet,Bluetooth-basedPANs(PersonalAreaNetworks)andtherapidlygrowingM2Mcommunication(M2M=Machine-to-Machine)afurtherinnovatingadvanceistobeexpected.ThecentralfunctionunittogetaccessonanembeddedsystemviaWebbrowseristheWebserver.SuchWebserversbringthedesiredHTMLpages(HTML=HyperTextMarkupLanguage)andpicturesovertheworldwideInternetoralocalnetworktotheWebbrowser.ThishappensHTTP-based(HyperTextTransferProtocol).ATCP/IPprotocolstackthatmeansitisbasedonsophisticatedandestablishedstandardsmanagestheentirecommunication.Webserver(HTTPserver)andbrowser(HTTPclient)buildTCP/IP-applications.HTTPachievedaphenomenaldistributioninthelastyears.MeanwhilemillionsofuseraroundtheworldsurfHTTP-basedintheWorldWideWeb.Todayalmosteverypersonalcomputeroffersthenecessaryassistanceforthisprotocol.Thisstatusisvalidmoreandmoreforembeddedsystemsalso.TheHTTPspreadsupwithafastratetoo.北京工業(yè)大學(xué)畢業(yè)設(shè)計(譯文)8TheDIL/NetPCsDNP/1110UsingtheEmbeddedLinux1.TCP/IP-basedHTTPasCommunicationPlatformHTTPisasimpleprotocolthatisbasedonaTCP/IPprotocolstack(picture1.A).HTTPusesTCP(TransmissionControlProtocol).TCPisarelativecomplexandhigh-qualityprotocoltotransferdatabythesubordinateIPprotocol.TCPitselfalwaysguaranteesasafeguardedconnectionbetweentwocommunicationpartnersbasedonanextensivethree-way-handshakeprocedure.AsaresultthedatatransferviaHTTPisalwaysprotected.DuetotheextensiveTCPprotocolmechanismsHTTPoffersonlyalow-gradeperformance.Figure1:TCP/IPstackandHTTPprogrammingmodelHTTPisbasedonasimpleclient/server-concept.HTTPserverandclientcommunicateviaaTCPconnection.AsdefaultTCPportvaluetheportnumber80willbeused.Theserverworkscompletelypassive.Hewaitsforarequest(order)ofaclient.ThisrequestnormallyreferstothetransmitionofspecificHTMLdocuments.ThisHTMLdocumentspossiblyhavetobegenerateddynamicallybyCGI.Asresultoftherequests,theserverwillanswerwitharesponsethatusuallycontainsthedesiredHTMLdocumentsamongothers(picture1.B).GET/test.htmHTTP/1.1Accept:image/gif,image/jpeg,*/*Usersellingagent:Mozilla/4.0Host:Listing1.A:HTTPGET-requestHTTP/1.1200OKDate:Mon,06Dec199920:55:12GMTServer:Apache/1.3.6(Linux)Content-length:82Content-type:text/htmlTest-SeiteTest-Seite北京工業(yè)大學(xué)畢業(yè)設(shè)計(譯文)9TheDIL/NetPCsDNP/1110UsingtheEmbeddedLinuxListing1.B:HTTPresponseasresultoftheGET-requestfromlisting1.AHTTPrequestsnormallyconsistofseveraltextlines,whicharetransmittedtotheserverbyTCP.Thelisting1.Ashowsanexample.Thefirstlinecharacterizestherequesttype(GET),therequestedobject(/test1.htm)andtheusedHTTPversion(HTTP/1.1).Inthesecondrequestlinetheclienttellstheserver,whichkindoffilesitisabletoevaluate.Thethirdlineincludesinformationabouttheclient-software.Thefourthandlastlineoftherequestfromlisting1.AisusedtoinformtheserverabouttheIPaddressoftheclient.Inaccordingtothetypeofrequestandtheusedclientsoftwaretherecouldfollowsomefurtherlines.Asanendoftherequestablanklineisexpected.TheHTTPresponsesasrequestanswermostlyconsistoftwoparts.Atfirstthereisaheaderofindividuallinesoftext.Thenfollowsacontentobject(optional).ThiscontentobjectmaybeconsistsofsometextlinesincaseofaHTMLfileorabinaryfilewhenaGIForJPEGimageshouldbetransferred.Thefirstlineoftheheaderisespeciallyimportant.Itworksasstatusorerrormessage.Ifanerroroccurs,onlytheheaderorapartofitwillbetransmittedasanswer.2.FunctionalprincipleofaWebServerSimplifiedaWebservercanbeimaginedlikeaspecialkindofafileserver.Picture2.Ashowsanoverview.TheWebserverreceivesaHTTPGET-requestfromtheWebbrowser.Bythisrequest,aspecificfileisrequiredasanswer(seestep1intopicture2.A).Afterthat,theWebservertriestogetaccessonthefilesystemoftherequestedcomputer.Thenitattemptstofindthedesiredfile(step2).AfterthesuccessfulsearchtheWebserverreadtheentirefile(step3)andtransmititasananswer(HTTPresponsecomprisingofheaderandcontentobject)totheWebbrowser(step4).IftheWebservercannotfindtheappropriatefileinthefilesystem,anerrormessage(HTTPresponsewhichonlycontainstheheader)issimplybesendasresponsetotheclient.Figure2:FunctionalprinciplefromWebserverandbrowser北京工業(yè)大學(xué)畢業(yè)設(shè)計(譯文)10TheDIL/NetPCsDNP/1110UsingtheEmbeddedLinuxThewebcontentisbuildbyindividualfiles.ThebaseisbuildbystaticfileswithHTMLpages.WithinsuchHTMLfilestherearereferencestofurtherfilesembeddedthesefilesaretypicallypicturesinGIForJPEGformat.However,alsoreferencestootherobjects,forexampleJava-Applets,arepossible.AfteraWebbrowserhasreceivedaHTMLfileofaWebserver,thisfilewillbeevaluatedandthensearchedforexternalreferences.Nowthesteps1to4frompicture2.AwillrunagainforeveryexternalreferenceinordertorequesttherespectivefilefromthecorrespondingWebserver.Pleasenote,thatsuchareferenceconsistsofthenameorIPaddressofaWebserver(),aswellasthenameofthedesiredfile(e.g.picture1.gif).SovirtuallyeveryreferencecanrefertoanotherWebserver.Inotherwords,aHTMLfilecouldbelocatedontheserverssv-embedded.debuttherequiredpicture-whichisexternalreferencedbythisHTMLfile-islocatedontheW.Finallythis(worldwide)networkingofseparateobjectsisthecauseforthenameWorldWideWeb(WWW).Allfiles,whicharerequiredbyaWebserver,arerequestedfromabrowserliketheprocedureshownonpicture2.A.Normallythesefilesarestoredinthefilesystemoftheserver.TheWebmasterhastoupdatethesefilesfromtimetotime.AfurtherelementaryfunctionalityofaWebserveristheCommonGatewayInterface(CGI)-wehavementionedbefore.Originallythistechnologyismadeonlyforsimpleforms,whichareembeddedintoHTMLpages.Thedata,resultingfromthepaddingofaform,willbetransmittedtoaWebserverviaHTTP-GETorPOST-request(seestep1intopicture2.B).InsuchaGET-orPOST-requestthenameoftheCGIprogram,whichisneededfortheevaluationofaform,isfundamentallyincluded.ThisprogramhastobeontheWebserver.Normallythedirectory/cgi-binisusedasstoragelocation.AsresultoftheGET-orPOST-requesttheWebserverstartstheCGIprogramlocatedinthesubdirectory/cgi-binanddeliversthereceiveddatainformofparameters(step2).TheoutputsofaCGIprogramareguidedtotheWebserver(step3).ThentheWebserversendsthemallasresponsestotheWebbrowser(step4).3.DynamicgeneratedHTMLPagesIncontradictiontoacompanyWebsite
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 日照職業(yè)技術(shù)學(xué)院《醫(yī)用電子學(xué)》2023-2024學(xué)年第二學(xué)期期末試卷
- 貴州經(jīng)貿(mào)職業(yè)技術(shù)學(xué)院《顯微構(gòu)造地質(zhì)學(xué)》2023-2024學(xué)年第二學(xué)期期末試卷
- 萍鄉(xiāng)學(xué)院《ORACE數(shù)據(jù)庫》2023-2024學(xué)年第二學(xué)期期末試卷
- 集寧師范學(xué)院《nternet協(xié)議分析A(實驗)》2023-2024學(xué)年第二學(xué)期期末試卷
- 沈陽城市建設(shè)學(xué)院《劇本創(chuàng)作》2023-2024學(xué)年第二學(xué)期期末試卷
- 江蘇安全技術(shù)職業(yè)學(xué)院《中外文學(xué)作品導(dǎo)讀》2023-2024學(xué)年第二學(xué)期期末試卷
- 2024年無功功率自動補償裝置項目資金申請報告代可行性研究報告
- 2024年電子廚房秤項目資金籌措計劃書代可行性研究報告
- 2024年濕電子化學(xué)品項目資金申請報告代可行性研究報告
- 一葉知秋幼兒教育
- 【MOOC】用Python玩轉(zhuǎn)數(shù)據(jù)-南京大學(xué) 中國大學(xué)慕課MOOC答案
- 門診合作協(xié)議合同范本(2篇)
- 上市公司執(zhí)行企業(yè)會計準則案例解析
- 路燈安裝施工組織設(shè)計方案
- 蓋房四鄰簽字協(xié)議書范文
- 超聲考試題+參考答案
- 《飛向太空的航程》名師課件
- 《飛越瘋?cè)嗽骸冯娪百p析
- 《建筑結(jié)構(gòu)抗震設(shè)計》全套課件
- 農(nóng)業(yè)綜合執(zhí)法大比武測試題
- 2024年高考歷史復(fù)習(xí)試題匯編:材料分析題匯編(中國史+世界史)(教師卷)
評論
0/150
提交評論