"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
Xiaolin Wang - Managing and Integrating Geography Models in Distributed Environment.ppt
1. Managing and Integrating Geography Models in Distributed Environment Xiaolin Wang, Yingwei Luo [email_address] Dept. of Computer Science and Technology, Peking University 2011.7
2.
3.
4. Geographical Model Executing Environment Geographical Modeling Environment http://net.pku.edu.cn Distributed Geographical Modeling Environment Mapping Associating 地理计算 模型执行 地理计算 模型执行 地理计算 模型执行 地理计算 模型执行 Geographical Concepts Geographical Concept Model Geographical Executing Model Interpreting 地理计算 模型执行 Geographical Computing Model Executing Geographical Model Sharing Environment Geographical Problems Existing Geographical Model Resources Solving Result for Geographical Problems Basic Geographical Computing Model Lib Method Lib Algorithm Lib Interpreting Encapsulating Modeling
21. One atomic model and one composite model example http://net.pku.edu.cn Rainfall model Surface river model Surface water infiltration model Surface water model Surface water model struct Rainfall model Surface river model Surface water infiltration model Surface water model Input data Output data
22. One atomic model and one composite model example http://net.pku.edu.cn
23. One atomic model and one composite model example http://net.pku.edu.cn
24. One atomic model and one composite model example http://net.pku.edu.cn
25. One atomic model and one composite model example http://net.pku.edu.cn
26. One atomic model and one composite model example http://net.pku.edu.cn
27. One atomic model and one composite model example http://net.pku.edu.cn
Metadata Standard for Geography Model A detailed description of the metadata of the heterogeneous geography model models info.(flag) in model_contract Integration Standard for Geographic Model Integrates the standardized geography model through some combinations method and uses them to simulate new geographical scenarios to achieve new geography functions (structs info.(flag) in model_contract) Work flow: ExecStream flag in model_contract
How to describe a geography model’s features Geography model metadata standard provides a detailed description of the metadata of the heterogeneous geography model, and achieves the automatic matching of the input and output data in the model. Design of Semantic Database To achieve the automatic matching of the input and output data in the model, we describe the input and output parameters in the semantic level, such as the parameter name, data type, and unit and so on. We design the semantic database of the geography model, including data type, data unit, and file format and so on, which improves the standardization of the inputs and outputs. The library makes the parameters’ auto-mapping possible when integrate models, which could release the geographers largely. Specific Design of Metadata Standard To make the geography models be well shared, we should research on the standardization in the aspect of computer science because the building of geography models is closely related to the computer science. We abstract the Geography model to five major behavior features: entry command, input data, output data, calling of the other models and triggering of the geographic events, which can be well described in our metadata specification with other necessary information. According to this metadata information, we can get all the information from the function to the structure. The specific content of the metadata includes 9 parts, as figure 1 shown.
atomModel 是原子模型标签。该标签的 schema 如图所示,主要包括如下内容: modelID ,这是模型被上传发布到执行环境中的时候,由系统生成的,作为该模型的独一无二的标志。 模型的静态描述信息,包括模型的名称 (name) ,版本 (version) ,创建日期 (date) ,一些描述信息 (desc) 。这些信息让用户更好地了解模型。 模型的动态调用信息,包括模型的编写语言 ( 虽然 web 服务跨平台,但是对于不同的语言编写的 web 服务,客户端调用的时候要采取不同的策略 ) ,模型的部署信息,模型可能会被部署在多台机器上。对于每一个位置的部署信息,则需要知道具体发布部署的端点,对外暴露的方法,模型的输入数据和输出数据。 模型所产生的地理事件信息,包括该事件的 id ,用来标识事件;事件的类型是同步还是异步;该地理事件的具体事件内容,将作为文件生成,消费该地理事件的模型的信息,主要是模型的 id 信息。
compositeModel 是组合模型对外表现信息标签。该标签的 schema 图如图所示,该标签主要包括以下内容: modelID ,这是模型被上传发布到执行环境中的时候,由系统生成的,作为该模型的独一无二的标志。 模型的静态描述信息,包括模型的名称( name ),版本 (version) ,创建日期 (date) ,一些描述信息 (desc) 。这些信息让用户更好地了解模型。 模型的动态调用信息,这里主要是输入和输出。因为我们认为组合模型是由原子模型或组合模型组合而成。组合模型的模型契约经过解析以后是若干原子模型的集合,因此组合模型没有整体对外的 endPoint 和 method 信息,但是有整体输入输出参数,通过变量映射到内部子模型,故这里没有像原子模型那样需要 deployments 信息。考虑到组合模型的内部结构是对外公开的,所以用户在开始使用的时候,可能会给多个子模型提供输入数据。故这里的 input 有多个。一个和多个 input 表示给一个模型提供输入数据。用一个变量和每个子模型的 id 对应起来,这样在 ExecStream 的执行流程中,实际的输入数据直接和每个变量对应起来。在原子模型的 schema 中,我们就采用了这种策略,不过在原子模型中,一个 input 的 id 元素是没用的, input 之间的顺序是重要的;而在组合模型中,不仅 input 之间的顺序重要,而且 input 的 id 元素是很重要的,通过 id 能将变量和模型对应起来;而对于相同 id 的 input ,其之间的顺序决定了参数的顺序。
Model integration is the most common form for geography model reuse. It integrates the standardized geography model through some combinations method and uses them to simulate new geographical scenarios to achieve new geography functions. We use concept model contract and executable model contract to describe model integration information. The former is the contract built by geographers from the practical geographical problem. It shows the combination relationships between models. The latter is the texture contract translated from the concept contract, which can be parsed and executed in the model runtime environment. Geographers integrate multiple geography models at the concept of logic, and build them as conceptual model contract. It records the connection and combination between each model and predetermined conditions and so on. Conceptual model contract needs to be translated into executable model contract. Executable model contract corresponds to the conceptual model contract which the geographers build, it contains the combination relations between models, and also describes the relations of parameters between the models so that the integrated models can execute automatically.
执行环境的执行引擎是整个执行环境的核心,执行引擎实现了 SOA 中有关编排和协作的功能,针对地理模型契约中的要求,组织各种地理资源及其交互,根据模型契约所要求的时序、反馈关系完成地理模型的计算过程;在执行引擎的执行过程中需要与元数据结点、数据结点进行交互,并在需要时调用 / 取得相关地理资源。 执行引擎具有以下重要的功能: ( 1 )解析模型契约:执行引擎从控制节点读入模型契约,将其解析成相应的地理模型的内存格式后,提供给执行环境,以使执行环境了解模型的运行时刻的需求。 ( 2 )解释执行模型:执行引擎将模型契约解析完毕,转化为相应的内存格式后,就要开始执行解释执行模型。解释执行模型的过程中,要做到以下几点: ( a )获得模型的部署信息,一些模型的部署信息可以从契约中获得,另外一些则必须要从元数据结点获取。 ( b )确认模型的输入数据来源,特别是要通过与人进行交互的方式来获取的,则需要提供与人交互的处理机制。当是来源于上一个模型的输出的时候,则可能需要调用适配器来实现两个模型间的数据的转换,虽然适配器由模型契约的编写者来提供,但是执行引擎需要准确无误地调用相应的数据适配器,来完成调用前模型所需数据格式的转换工作。 ( c )准备好数据。这里主要涉及到数据传输方式。执行环境提供了三种方式的支持, socket , ftp , soap 。具体采用哪种传输方式由用户来选择。 ( d )负责控制数据传输:数据传输在环境中主要涉及到是为调用模型而准备的数据,当涉及到模型集成的时候,组合起来的模型分布在多个运行节点上,所以要将数据在不同的运行节点上进行传输。 ( e )远程调用模型。对于选择调用模型的情况,则需要根据模型所在的运行结点的实际情况,做出决断。调用模型的发布的对外接口即部署的端点,要调用的方法名,输入和输出参数,即可顺利调用 web service 。 ( f )处理地理事件,若该模型会产生地理事件,则需要处理地理事件。
In order to achieve the sharing and reuse of geography model, we design a description of the geographical metadata standard, integration standard and model management environment. This make geographers can easily reuse existing geography model, and build new application scenarios based on existing models. There is also some work can improve in the future. We can provide a labeling modeling environment which can provide the manner of dragging the icons to create geographical concept model contract, then translate concept model contract into an executable contract model automatically according to a model translation engine.