正在加载图片...
·184· 智能系统学报 第3卷 hand,a mobile agent can move to a service discov- ded facts might be useless.In IMA GO system,we ery server,utilize the system interface to access intend to provide two data representation schemes, the search engine's database and obtain an itinerar-i.e.,fact-driven and data-driven,which would y that includes a list of ranked host addresses of broaden the range of choices accessible by applica- the data service providers.Based on the given itin- tion programmer.Data-driven approach converts erary,the mobile agent may travel from host to content of a table to a list of rows where each row host to carry out a DDM application.Figure 1 is a sub-list of fields.In other words,the results gives an example of service discovery and data min- obtained from a database query will be automatical- ing process. ly transformed to the IMA GO Prolog internal data The application programming interface of data structures. service discovery for mobile agents is a built-in Having received a list of database addresses predicate,namely,web_search(Query,Number, through the service discovery module,an agent Result),where Query is a compound term specif- may move from host to host to access these data- ying characteristics of the search,Number is an in-bases or clone multiple agents with assigned data- teger indicating what is the maximum number of base addresses to start a DDM application.In or- results expected,and Result is a variable to hold der to bridge logic based mobile agents with data- return values.For example,suppose a food com-base systems,the IMA GO system provides a set of pany wants to analyze the customer transaction re-database predicates,which enables agents to estab- cords for quickly developing successful business lish connection with data sources and make re- strategies,its DDM agent may move to a known I quests for desired information. MA GO service discovery server and then issue a To be able to access a database,an agent has query predicate requesting up to 10 possible food to find which database drivers are supported by the industry database locations: underlying system.For this purpose,built-in web_search(locate(“food”,“customer trans predicate db_drivers(?list)can be invoked to col- action”,“imago data server',l0,R) lect a list of all supported database drivers.A driv- The agent is blocked and control is transferred er identifier must be unique and is commonly to the service discovery module of the hosting I- named based on the database implementation,such MA GO server.The discovery module will commu- as mysql,oracle,and so on. nicate with the searcher,wait for search results, A database connection is established by issu- and resume the execution of the blocked agent. ing a predicate of the form db_connect(-conn,+db Search results will be delivered to the requesting a- URL).A valid db_URL looks like: gent in the form of list,where entries of the list driver:/username password @host- are ranked in priorities from high to low. name[port ][/database] where driver indicates the specific database imple- 2 Data mining facilities mentation,username and password are used for Obviously,representing content of a database authentication,hostname gives the network loca- in logic terms may be achieved by using different tion of the database server,port is used to establish methods.As a Prolog program itself is somehow a TCP connection if required,and database speci- thought of as a database,one natural approach is fies the actual database name which the agent fact-driven,namely,to append the content of a ta- wants to access.Upon success,variable conn is in- ble as a set of fact clauses to the end of the pro- stantiated with the database connection handler gram.The advantages of such approach are sim- which will be used in the subsequent database ac- plicity and ease of use,but the disadvantages are cesses.To disconnect a database,the agent may dynamical modification of the original program and issue a predicate db_disconnection(+conn),where creation of garbage code because part of the appen- conn represents a previously established connec- 1994-2009 China Academic Journal Electronic Publishing House.All rights reserved.http://www.cnki.nethand , a mobile agent can move to a service discov2 ery server , utilize the system interface to access t he search engine’s database and obtain an itinerar2 y t hat includes a list of ranked host addresses of t he data service p roviders. Based on t he given itin2 erary , t he mobile agent may travel from host to host to carry out a DDM application. Figure 1 gives an example of service discovery and data min2 ing process. The application programming interface of data service discovery for mobile agents is a built2in predicate , namely , web_ search ( Query , Number , Result) , where Query is a compound term specif2 ying characteristics of t he search , Number is an in2 teger indicating what is t he maximum number of results expected , and Result is a variable to hold ret urn values. For example , suppose a food com2 pany wants to analyze t he customer transaction re2 cords for quickly developing successf ul business strategies , its DDM agent may move to a known I2 MA GO service discovery server and t hen issue a query predicate requesting up to 10 possible food industry database locations: web_ search (locate “( food”,“customer trans2 action”,“imago data server”) , 10 , R) The agent is blocked and control is transferred to t he service discovery module of t he hosting I2 MA GO server. The discovery module will commu2 nicate wit h t he searcher , wait for search results , and resume t he execution of the blocked agent. Search results will be delivered to the requesting a2 gent in the form of list , where entries of t he list are ranked in priorities from high to low. 2 Data mining facilities Obviously , representing content of a database in logic terms may be achieved by using different met hods. As a Prolog program itself is somehow t hought of as a database , one nat ural approach is fact2driven , namely , to append t he content of a ta2 ble as a set of fact clauses to t he end of t he p ro2 gram. The advantages of such approach are sim2 plicity and ease of use , but the disadvantages are dynamical modification of the original program and creation of garbage code because part of t he appen2 ded facts might be useless. In IMA GO system , we intend to provide two data representation schemes , i. e. , fact2driven and data2driven , which would broaden t he range of choices accessible by applica2 tion programmer. Data2driven approach converts content of a table to a list of rows where each row is a sub2list of fields. In other words , t he results obtained from a database query will be automatical2 ly transformed to t he IMA GO Prolog internal data struct ures. Having received a list of database addresses t hrough t he service discovery module , an agent may move from host to host to access t hese data2 bases or clone multiple agents wit h assigned data2 base addresses to start a DDM application. In or2 der to bridge logic based mobile agents with data2 base systems , t he IMA GO system provides a set of database predicates , which enables agents to estab2 lish connection with data sources and make re2 quests for desired information. To be able to access a database , an agent has to find which database drivers are supported by t he underlying system. For t his p urpose , built2in predicate db_drivers( ? list) can be invoked to col2 lect a list of all supported database drivers. A driv2 er identifier must be unique and is commonly named based on t he database implementation , such as mysql , oracle , and so on. A database connection is established by issu2 ing a predicate of t he form db_connect (2conn , + db _U RL) . A valid db_URL looks like : [ driver :/ / ] [ username [ : password ] @] host2 name[ :port ][/ database ] where driver indicates t he specific database imple2 mentation , username and password are used for aut hentication , host name gives t he network loca2 tion of t he database server ,port is used to establish a TCP connection if required , and database speci2 fies t he act ual database name which t he agent wants to access. Upon success , variable conn is in2 stantiated with the database connection handler which will be used in the subsequent database ac2 cesses. To disconnect a database , t he agent may issue a predicate db_disconnection ( + conn) , where conn rep resents a previously established connec2 ·184 · 智 能 系 统 学 报 第 3 卷
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有