数据流体系结构风格.ppt
《数据流体系结构风格.ppt》由会员分享,可在线阅读,更多相关《数据流体系结构风格.ppt(50页珍藏版)》请在三一办公上搜索。
1、软件体系结构及应用4 数据流体系结构风格,主要内容,4.1 数据流体系结构风格的基本特征4.2 管道-过滤器(pipe-and-filter)4.3 批处理(batch sequential)4.4 批处理与管道-过滤器的比较,4.1 数据流体系结构风格的基本特征,数据流风格的直观理解,A data flow system is one in which the availability of data controls the omputation(数据的可用性决定着处理是否执行)the structure of the design is dominated by orderly moti
2、on of data from process to process(系统结构:数据在各处理之间的有序移动)in a pure data flow system,there is no other interaction between processes(在纯数据流系统中,处理之间除了数据交换,没有任何其他的交互),数据流风格的基本构件(COMPONENT),Components:data processing components(基本构件:数据处理)Interfaces are input ports and output ports(构件接口:输入端口和输出端口)Input ports
3、 read data;output ports write data(从输入端口读取数据,向输出端口写入数据)Computational model:read data from input ports,compute,write data to output ports(计算模型:从输入端口读数,经过计算/处理,然后写到输出端口),数据流风格的连接件(CONNECTOR),Connectors:data flow(data stream)(连接件:数据流)Uni-directional,usually asynchronous,buffered(单向、通常是异步、有缓冲)Interfaces
4、 are reader and writer roles(接口角色:reader和writer)Computational model(计算模型:把数据从一个处理的输出端口传送到另一个处理的输入端口),数据流风格的拓扑结构(TOPOLOGY),数据流VS.控制流,在von Neumann的计算机体系结构中,有控制流与数据流之分;控制流(Control flow)数据流(Data flow)讨论:二者有什么区别和联系?能否分别举出几个例子?,两种典型的数据流风格,Pipe-and-Filter(管道-过滤器)Batch Sequential(批处理),4.2 管道与过滤器风格PIPE-AND-F
5、ILTER,从“自来水管道系统”看Pipe-And-Filter,基本定义,语境:数据源源不断的产生,系统需要对这些数据进行若干处理(分析、计算、转换等)。解决方案:把系统分解为几个序贯的处理步骤,这些步骤之间通过数据流连接,一个步骤的输出是另一个步骤的输入;每个处理步骤由一个过滤器构件(Filter)实现;处理步骤之间的数据传输由管道(Pipe)负责。每个处理步骤(过滤器)都有一组输入和输出,过滤器从管道中读取输入的数据流,经过内部处理,然后产生输出数据流并写入管道中。,Pipe-And-Filter风格的基本构成,Components:Filters process data stream
6、s(构件:过滤器,处理数据流)A filter encapsulates a processing step(algorithm or computation)(一个过滤器封装了一个处理步骤)Data source and data sink are particular filters(数据源点和数据终止点可以看作是特殊的过滤器)Connectors:A pipe connects a source and a sink filter(连接件:管道,连接一个源和一个目的过滤器)Pipes move data from a filter output to a filter input(转发数
7、据流)Data is a stream of“objects”(数据是特定类型的“对象”流)Topology:Connectors define data flow graph(连接器定义了数据流图,形成拓扑结构),1 过滤器(Filter),Incrementally transform some of the source data into sink data(目标:将源数据变换成目标数据)Stream to stream transformation(从“数据流”“数据流”的变换)enrich data by computation and adding information(通过计
8、算和增加信息来丰富数据)refine by distilling data or removing irrelevant data(通过浓缩和删减来精炼数据)transform data by changing its representation(通过改变数据表现方式来转化数据)decompose data to multiple streams(将一个数据流分解为多个数据流)merge multiple streams into one stream(将多个数据流合并为一个数据流),过滤器对数据流的五种变换类型,过滤器读取与处理数据流的方式,Incrementally transform
9、data from the source to the sink(递增的读取和消费数据流)在输入被完全消费之前,输出便产生了。,过滤器的一些基本特征,Filters are independent entities,i.e.,no context in processing streams(无上下文信息)no state preservation between instantiations(不保留状态)no knowledge of upstream/downstream filters(对其他过滤器无任何了解)collections can be used to buffer the da
10、ta passed through pipes:files,arrays,dictionaries,trees,etc.(可使用数据缓冲区临时保存数据流)蓄水池,2 管道(Pipe),Move data from a filters output to a filters input(or to a device or file)(作用:在过滤器之间传送数据)One way flow from one data source to one data sink(单向流)A pipe may implement a buffer(可能具有缓冲区)Pipes form data transmissi
11、on graph(管道形成传输图)不同的管道中流动的数据流,具有不同的数据格式(Data format)。原因:数据在流过每一个过滤器时,被过滤器进行了丰富、精练、转换、融合、分解等操作,因而发生了变化。,管道中流动的数据类型,Pipe between two threads of a single process(e.g.,Java Streams)Stream may contain references to shared language objectsPipe between two processes on a single host computer(e.g.,UNIX Name
12、d Pipes)stream may contain references to shared OS objects(e.g.,files)Pipe between two processes in a distributed system(e.g.,Internet Sockets)Stream contents limited to raw bytes Protocols implement high-level abstractions(e.g.,pass pipes as reference,pass COBA object references),管道中流动的数据类型,Tradeof
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 数据流 体系结构 风格

链接地址:https://www.31ppt.com/p-6296707.html