版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
DistributedSystemsWebSearchingTechnologiesSomehelpfulwebsites•Ahistoryofsearchengines:–/legacy/compbooks/sonnenreich/webdev/history.html•OpensourcesearchengineswritteninJava:–/open-source/search-engines•Robots:–/wc/robots.html2SearchEnginesArchitectureWebSpiderIndexerDatabaseUserQuerySearchInterfaceEngine3Spiders(WebCrawler)•AutomaticallyRetrievewebpages–StartwithanURL,retrievingthewebpage–FindallURLsonthewebpageandrecursivelyretrievenot-yetsearchedURLs•AlgorithmicIssues–EfficiencyandQuality:howtoquicklygatherasmanyusefulwebpagesaspossible?–HowtochoosethenextURL?–Howtoavoidoverloadedsub-networks?4Indexer•Selectterms(keywords)toindexadocument–needco-operationfromauthorsofwebpagethroughMetatags(nexttoTitletaginhtmlfiles)toindicatespecifictermstoindex<METAname="keywords"content=“retrieval,,cloudcomp”>•Algorithmicissues:–Howtochooseterms/phrasestoindexdocuments,suchthatuserqueriescanbereturnedaccuratelyandefficiently–Howtoindexdocumentsencodedindifferenttypes(multimediadataretrieval)5Database•Structureddata(seeBigtableforGoogle)–Bigtable:ADistributedStorageSystemforStructuredData,CACM,Jun2008••ParallelsearchanddistributedstorageAlgorithmicissues:–Datapartitioninganddistributedstorage:storepetabytesofdataacrossthousandsofservers–Real-timedataretrievalandupdate(shortlatency)–Fault-tolerance(dataredundancy)6SearchEngine••ReturnthemostrelevantdocumentsforqueriesAlgorithmicIssues:–Parallelsearch(e.g.,map-reducetechniques)–Relevanceanalysis7MajorProductsofSearchEngines••••••AltavistaGoogleGotoLycosYahoo…8SearchEngineSizes(Dec11,2001)Estimatedtotalwebpages~2billionAVFASTGGINKNLAltavistaFASTGoogleInktomiNorthernLightShadedareaforGGandINKTOMIarepagesindexedbutnotvisitedSOURCE:SEARCHENGINEWATCH.COM9DifficultiesforInternetInformationRetrieval•DiversifiedUsers(puternerds).–Canwedevelopanevolvingsystemthatadaptstouser?•Ambiguityoflanguageexpression–ThisisanimportantissueduetovarietiesofdataontheInternet–Hfilingtechniquestoresolveit?•FalseInformation–Phising,Spam,MisleadingAdvertisement10SpiderArchitectureSharedURLpoolAddanewURLHttpRequesturl_spiderurl_spiderurl_spiderurl_spiderWebSpaceurl_spiderspidersGetanHttpResponseURLDatabaseInterfaceDatabase11SpiderProgramming:startwithHTTP…•SpidersuseHTTPprotocoltoretrievedata…publicclassHttpClientGet{publicstaticvoidmain(String[]args)throwsException{StringserverUrl=".hk";Sockets=newSocket(serverUrl,80);BufferedReaderin=newBufferedReader(newInputStreamReader(s.getInputStream()));PrintStreamout=newPrintStream(s.getOutputStream());out.println("GET/~jia/index.htmlHTTP/1.0");out.println();//“GET”mustbefollowedbyablankline.Stringline;while((line=in.readLine())!=null){System.out.println(">"+line);}s.close();}}12ASimpleHTTPServerpublicclassHttpServer{publicstaticvoidmain(Stringargv[])throwsException{ServerSocketserverSock=newServerSocket(8632);//openserversocketatportwhile(true){Socketnew_s=serverSock.accept();serveRequest(new_s);client.close();}}publicstaticvoidserveRequest(Sockets)throwsException{PrintStreamout=newPrintStream(s.getOutputStream());BufferedReaderin=newBufferedReader(newInputStreamReader(s.getInputStream()));StringhttpCmd=in.readLine();//TheHTTPRequestishttpCmd;String[]httpArgs=httpCmd.split("");if(httpArgs.length<2||!httpArgs[0].equalsIgnoreCase("GET")){out.println("400BadRequest.");return;}StringfContent=readFileContent(httpArgs[1]);if(fContent==null)out.println("404FileNotFound");elseout.println(fContent);}13SpiderinAction!••InitializethequeuewithURLsofknownpagesRepeatdoing:a)b)TakeanURLfromqueueFetchthewebpageandstore/rmationinthepageExtractURLsfromthepageandaddthemtothequeuec)•Assumption:Thewebiswelllinked.14ASimpleSpiderpublicclassSimpleSpider{privateQueuelinkQueue=newLinkedList();privateLinkExtractorextractor=newLinkExtractor();protectedbooleanprocessLink(Stringlink)throwsIOException{System.out.println(link);extractor.parse((newURL(link)).openStream());//parsethepagecontent…..Iteratorit=extractor.getExtLinkIterator();//extractallURLlinksinthispagewhile(it.hasNext())linkQueue.add(it.next());//addnextlinktothequeue}publicvoidwork(StringiLink){linkQueue.add(iLink);//addthislinktothequeuefor(inti=0;i<20;++i){//limitmax#ofwebpagestovisitStringlink=(String)linkQueue.poll();//getalinkfromthequeueif(link==null)break;//nomorelinksprocessLink(link);}}publicstaticvoidmain(String[]args){SimpleSpiderspider=newSimpleSpider();spider.work(".hk");//startfromthislink}15ASimpleSpider(cont’d)publicclassLinkExtractor{privateHtmlHrefParserrefParser=newHtmlHrefParser();//HtmlHrefParserissystemdefinedpublicvoidparse(InputStreamstream)throwsIOException{if(stream==null)thrownewIllegalArgumentException("IllegalArgument");refParser.reset();ParserDelegatorpd=newParserDelegator();pd.parse(newInputStreamReader(stream),refParser,true);}publicIteratorgetExtLinkIterator(){returnrefParser.extLinks.iterator();//returnlistofextURLlinks}publicIteratorgetLocalLinkIterator(){returnrefParser.localLinks.iterator();}}16Cautionsaboutusingspiders••••ItmayaddunexpectedamountoftrafficifpoorlydesignedBeresponsibleforyouractionsTestitlocallybeforerunningitovertheInternetFollowthestandardguidelines–/wc/guidelines.html17WebDataMining:Digraph••••Nodes:webpages(itsaddressisURL)DirectedEdges:hyperlinksfromonewebpagetoanotherContentofanode:thecontentofthecorrespondingwebpageDynamicnatureofthedigraph:–Forsomenodes,thereareoutgoingedgeswedon’tknowyet.••Ncessed(don’tknowitscontent)Newedges(hyperlinks)mayhaveaddedtosomenodes–Forallthenodes,therearesomeincomingedgeswedon’tyetknow.18ConstructWebDigraph•Toconstructthewebdigraph,oneneeds–aspidertoautomaticallycollectURLs–rmationfornodes(URLs)andedges(hyperlinks)•Thewholedigraph(URLs,HyperLinks)ishuge:–162,128,493hosts(2002Juldata)–1,173,109,925users–/stats.htm–Onemayneedgraphalgorithmswithsecondarymemories–Googleusesthousandsofworkstations.19AnExampleDigraphV0V1V2V3V4V5V6AnordinarydigraphHwith7verticesand12edges20PartialMapofWebDigraph•Partialmapmaybesufficientforsomepurposes–e.g.,erestedinasmallportionofthewholeInternet•ApartialmapmaybeconstructedwithinthememoryspaceforanordinaryPC,whichallowsfastperformance.Withpartialmap,wemaynotbeabletohaveallnecessaryinformationforourpurpose•–e.g.,backlinkstoaURL21AnExampleofaPartialDigraphV0V124110V2V3322V458461V5V6ApartialdigraphH:nodev5isnotyetexplored.Wedon’tknowthatithasoutgoingedgesfromv5thoughweknowitsexistence(byitsURL).22UnknownandDynamicFactorsofWebStructure•ThereisnocentralcontrolofthehyperlinksandeachsearchenginecanonlymapafractionofthewholewebspaceHyperlinksaredynamicallyaddedanddeletedbyindividualwebpageauthorsNowebpageknowsitsincominghyperlinksSomewebpagesarenotdocumentedbyanysearchengine•••23SomeUsefulFunctionsonDigraph•Back_Link(the_url):–findoutalltheurlsthatpointtothe_url•Shortest_Path(url1,url2):–returntheshortestpathfromurl1tourl2•Maximal_Clique(url):–returnamaximalcliquethatcontainsurl•In-Degree(url)––returnthenumberoflinksthatpointtotheurl.represents,tosomeextent,itspopularity.Themoreawebpageispointedtobywebpages,erestedin•Relateddatastructures,algorithmsandwebsites––––/javadocs/pt/tumba/links/WebGraph.html/introcs/45graph/Digraph.java.html/products/qed/docs/source/_di_graph_8java-source.html/~kris/Research/agl/doc/agl2/Digraph.html24BackLinksofDigraph•Hyperlinksonthewebareforward-pointing.Webpagesdonotknowthehyperlinkspointingbacktothem–authorsofwebpagescanfreelylinktootherdocumentsinthecyberspacewithoutconsentfromtheirauthors•Brmationisimportant–inscientificliterature,SCI(ScientificCitationIndex)isanimportantindexforjudgmentofacademicvalueofoneacademicarticle•Itisnoteasytofindallthebacklinks25CollectBackLinkInformationViaHTTPSection10.HeaderfielddefinitionofHttp1.0subsection10.13Referer:–Refererfield(inrequest-header)allowstheclient(browser)tospecifythesourceaddress(URI)fromwhichtheRequest-URIwasobtained.–Thisallowsaservertogeneratelistsofback-linkstoresourcesforinterest,logging,optimizedcaching,etc.–TheRefererfieldisemptyiftherequestisNOTfromawebpage,e.g.,fromtheURIfieldinbrowser(i.e.,thesourcedoesnothaveanURI).–Fordetails,see•/rfc/rfc1945.txt26AnApplicationofBackLink:FAN••Fansofawebpagehasalinkpointingtothewebpage.Auserwouldaddalinktoawebpageafterheaccessedandviewedthecontentofthepage.fansFansofawebpage27FAN:AnIndicatorofPopularity••Themorefansawebpagehas,themorepopularitis.SCI(ScientificCitationIndex),forexample,isawellknownmethodtoratetheimportanceofaresearchpaper.However,someverypopularwebpagesaresowellknownthatpeopledon’tneedtoputthemintheirwebpages,such,,etc.Anothercontroversialargumentaboutbacklinkpopularity:••–apagepointedbysomeimportantwebpages,comparedwithanotherpointedbymanyun-importantpages?28WebPageRanking•Twofactorsforrankingawebpage:–Therankofwebpagespointingtoit•Thehighthebetter–Thenumberofoutgoinglinksinthewebpagespointingtoit•Thelessthebetter•PageRankofpageA,PR(A),iscalculatedasfollows:–SupposepageAhaspagesT1...Tnthatpointtoit(i.e.,backlinks).–disafactorbetween0and1(usuallysetto0.85).–C(T)isthenumberofoutgoinglinksofpageT.29PageRankCalculation•ThedefinitionofPR(A)iscyclic,i.e.,therankofapagedependsontheranksofotherpages.However,pageranksputedbyasimpleiterativealgorithm.Pagerankscanbeefficientlycalculatedbyusingwebdigraph.Pputedinafewhoursonamediumsizeworkstation.Pagerankshelpsearchenginetorankthesearchresultsaccordingtotheirpopularityorimportance(noconsiderationofrelevanceofsearchresultshere).••30InvertedFile:indexingforsearchWordExtractionWordIDsOriginalDocumentsW1:d1,d2,d3W2:d2,d4,d7,d9DocumentIDsWn:di,…dnInvertedFiles31Term-Documentindexing1.Ms(documents)tofileIDsConsiderthefollowingOriginalDocumentsd1TheDepartmentofComputerSciencewasestablishedin1984.d2TheDepartmentlauncheditsfirstBSc(Hons)inComputerStudiesin1987.followedbytheMScinComputerSciencewhichwasstartedin1991.TheDduceditsfirstPhDgraduatein1994.d3d4d5Ofessionallytotheadvancementsinthesefields.32RemoveStopWords2.Removestopwords(“in”,“the”,“in”,….)thatarenotmeaningfulforsearchd1TheDepartmentofComputerSciencewasestablishedin1984.d2TheD
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 山东德州市2027届高三第一次模拟考试数学试卷含解析
- 沉井隐蔽验收记录
- 江西省抚州市临川实验学校重点班2027届高考考前提分数学仿真卷含解析
- 2026年行车值班员助理(高级技师)职业技能等级认定考前冲刺试题
- 2026年地铁运营安全检查考核安全检查规程试题
- 初中九年级物理欧姆定律的理解与计算一轮复习教学设计
- 初中八年级地理教学设计:青藏地区地形气候与自然景观整合复习
- 高三化学二轮复习 实验综合大题核心素养导向教学设计
- 高三政治选择性必修三《创新思维要多路探索》教学设计
- 小学一年级劳动课衣物自己叠教学设计
- 凯里七小学校管理制度
- JG/T 3050-1998建筑用绝缘电工套管及配件
- 2022危险化学品安全技术说明书第2卷易制爆化学品易制毒化学品
- 23G409先张法预应力混凝土管桩
- 4人合伙股份合同协议书范本范本
- CQI-8分层过程审核
- 铁工电〔2023〕54号国铁集团关于印发《普速铁路工务安全规则》的通知
- 药品质量管理体系培训
- 操盘出击主图公式指南针
- 求职信-教学讲解课件
- 初入职场必备技能学习通超星课后章节答案期末考试题库2023年
评论
0/150
提交评论