正在加载图片...
·186· 智能系统学报 第3卷 framework,more complex DDM algorithms can be The code of a DDM_agent defines the home a- easily coded. gent resided at the stationary server.When the home agent starts execution,it creates two mobile :-home agent(a DDM agent) agents called workerl and worker2 alone with ini- a_DDM_agent(_): tial arguments and then waits for results.When a create(“workerI”,worker1,location(“perseus.imago worker is loaded,it migrates to the IMA GO data- _lab.cis.uoguelph.ca","mysql://localhost/ base server specified in its argument.Having ar- ImagoDB1”), create(“worker2”,worker2,location(“orion.imago_ rived to the database server,the worker continues lab.cis.uoguelph.ca","mysql://localhost/Ima- execution by connecting to the given local database goDB2"”), and making a SQL query for data access.Two wait accept(worker1,Tablel), worker agents take different way to retrieve data, wait accept(worker2,Table2), where workerl uses set retrieval and worker2 a- result compare(Tablel,Table2), dopts tuple retrieval.Having collected all required terminate. data,both workers separately dispatch a s oneway result compare (TI,T2):-write ("Two tables are i- messenger to deliver results back to the home a- dentical."),nl. result_compare(,)-write("Two tables are not i- gent for further data mining analysis. dentical."),nl 4 Conclusion :-end home agent(a DDM agent) In this paper,we discussed the scheme of de- :-mobile agent (worker1). ploying mobile agents in DDM applications.The workerl(location(Database Server,DB URL)):- move(Database Server), advantage of adopting mobile agents for DDM is to db connect(C,DB URL). scale up to large,dynamic and remote data db_query(C,“SEL ECT·FROM LOG', sources,such as various databases distributed over db_store_result(C,Table,name(true),type the Internet.We presented the design of data serv- (true),length(true)]), ice discovery module and database management db_disconnect (C), module.The programming interface of these mod- dispatch($oneway_messenger,home,Table)., ules is a set system built-in predicates capable to dispose. couple a logic programming language with func- :-end mobile agent (worker1) tionalities of locating data services and accessing -mobile_agent (worker2). remote databases.Equipped with those system worker2(location(Database Server,DB URL)):- tools,mobile agents may search for suitable data move(Database Server), sites,roam the Internet to collect useful informa- db connect(C,DB URL) tion,and communicate with each other to generate db query(C,"SELECT FROM LOG), db use result(C,R), a global view of data through the aggregation of get_rows(R,Table), distributed computations.In order to verify the db disconnect(C,), feasibility and efficiency of the mobile agent based dispatch($oneway_messenger,home,Table), DDM proposal,experimental service discovery dispose module and database management module have get_rows(R,[RowT])- been implemented and integrated with the IMA GO db_next_row(R,Row,[name(true),type(true), system.The service discovery module is based on length(true)]), the search engine technology and concentrates on get_rows(R,T) get_rows(R,[]): locating database services.It uses web pages as a db_free_result(R). medium to advertise services,and runs an inde- :-end_mobile_agent (worker2) pendent search engine to gather and index service provider's information,such as service types,da- 1994-2009 China Academic Journal Electronic Publishing House.All rights reserved.http://www.cnki.netframework , more complex DDM algorit hms can be easily coded. :2home_agent (a_DDM_agent) . a_DDM_agent (_) :2 create “( worker1”, worker1 , location“( perseus. imago _ lab. cis. uoguelph. ca”, “mysql :/ / localhost/ ImagoDB1”) ) , create “( worker2”, worker2 , location “( orion. imago _ lab. cis. uoguelph. ca”“, mysql :/ / localhost/ Ima2 goDB2”) ) , wait_accept (worker1 , Table1) , wait_accept (worker2 , Table2) , result_compare ( Table1 , Table2) , terminate. result_compare ( T1 , T2) :2 write “( Two tables are i2 dentical. ”) , nl. result_compare (_ , _) :2 write “( Two tables are not i2 dentical. ”) , nl. :2end_home_agent (a_DDM_agent) . :2mobile_agent (worker1) . worker1 (location (Database_Server , DB_URL) ) :2 move (Database_Server) , db_connect (C , DB_URL) , db_query (C ,“SEL ECT 3 FROM LO G”) , db _ store _ result ( C , Table , [ name (true) , type (true) , length (true) ]) , db_disconnect (C) , dispatch ( oneway_messenger , home , Table) . , dispose. :2end_mobile_agent (worker1) . :2mobile_agent (worker2) . worker2 (location (Database_Server , DB_URL) ) :2 move (Database_Server) , db_connect (C , DB_URL) , db_query (C ,“SEL ECT 3 FROM LO G”) , db_use_result (C , R) , get_rows(R , Table) , db_disconnect (C , ) , dispatch ( oneway_messenger , home , Table) , dispose. get_rows(R , [ Row| T]) :2 db_next_row (R , Row , [ name (true) , type (true) , length (true) ]) , get_rows(R , T) . get_rows(R , [ ]) :2 db_free_result (R) . :2end_mobile_agent (worker2) . The code of a_DDM_agent defines t he home a2 gent resided at t he stationary server. When t he home agent starts execution , it creates two mobile agents called worker1 and worker2 alone wit h ini2 tial arguments and t hen waits for results. When a worker is loaded , it migrates to t he IMA GO data2 base server specified in its argument. Having ar2 rived to t he database server , t he worker continues execution by connecting to t he given local database and making a SQL query for data access. Two worker agents take different way to retrieve data , where worker1 uses set retrieval and worker2 a2 dopts tuple retrieval. Having collected all required data , bot h workers separately dispatch a oneway _messenger to deliver results back to the home a2 gent for f urt her data mining analysis. 4 Conclusion In this paper , we discussed t he scheme of de2 ploying mobile agents in DDM applications. The advantage of adopting mobile agents for DDM is to scale up to large , dynamic and remote data sources , such as various databases distributed over t he Internet. We presented the design of data serv2 ice discovery module and database management module. The programming interface of t hese mod2 ules is a set system built2in predicates capable to couple a logic p rogramming language wit h f unc2 tionalities of locating data services and accessing remote databases. Equipped with those system tools , mobile agents may search for suitable data sites , roam t he Internet to collect usef ul informa2 tion , and communicate wit h each other to generate a global view of data t hrough the aggregation of distributed comp utations. In order to verify t he feasibility and efficiency of the mobile agent based DDM proposal , experimental service discovery module and database management module have been implemented and integrated wit h t he IMA GO system. The service discovery module is based on t he search engine technology and concentrates on locating database services. It uses web pages as a medium to advertise services , and runs an inde2 pendent search engine to gat her and index service provider’s information , such as service types , da2 ·186 · 智 能 系 统 学 报 第 3 卷
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有