版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、2008 international conference on advanced computer theory and engineering2008年高级计算机理论与控制工程国际会议an effective remote control system based on tcp/ip一种基于tcp / ip协议的有效远程控制系统xueyu gengschool of civil engineering 土木工程学院qingdao technological university 青岛理工大学qingdao, 266033, china 中国青岛 26603gengxy gengxyshun
2、yao wu, jinlong wang, and peng lischool of computer engineering 计算机工程学院qingdao technological university 青岛理工大学qingdao, 266033, china 中国青岛 266033wangjinlong wangjinlongwith the network technology development, remote technology is gradually occupying the technology mainstream. it has become more and m
3、ore popular in the home officeand distance education. the rapid development provides a broad world to the remote control software. pcanywhere,damewhere, qq remote assistance, and other remote control software have emerged. in remote control, improving efficiency and ensuring accuracy of the transmis
4、sion are paramount to evaluate the success of a remote control software.this paper has developed a remote control system,and focuses on intercepting the control and the images, and tcp-stick packages. solving these problems well is useful to improve the efficiency of the system and ease the pressure
5、on network. finally, through analysis and experiments, methods are proved to be effective.随着网络技术的发展,远程技术逐渐占据了技术的主流。对在家里办公和远程教育的人来说,它已经变得越来越受欢迎。它的快速发展为远程控制软件提供了广阔的天地。pcanywhere, damewhere, qq远程协助及其他远程控制软件已经出现,在远程控制领域,提高效率和确保准确的传输对评价一个远程控制软件的成功与否是极为重要的。本文描述了一种远程控制系统,并侧重于拦截控制、图像及tcp粘包。有效的解决这些问题,有利于提高系统
6、的效率和缓解网络的压力。最后,通过分析和试验,方法被证明是有效的。1. introduction1. 引言the rapid development of network technology, home office and distance education provides a broad world to the remote control software. as early as 1998, idc expected the remote control software market would be the third fastest growing area in the
7、 consumer market which was supported by the software technology 1.随着网络技术的飞速发展,家庭办公和远程教育为远程控制软件提供了广阔的天地。早在1998年,idc就预测远程控制软件的市场将是第三个由软件技术支持的消费市场里增长最快的领域。remote control 1, 2, 3, 4 is a technology that administrators connect the target computer through the network by remote dialing or the way that both
8、 dial into internet, then manage and maintain the remote computers by local host 1. the remote control software is based on the client/server model oriented towards connection agreement(tcp/ip). it includes a server program installed on the client, and a client program on the host. the general opera
9、ting principle of remote control is shown in figure 1.远程控制是一种管理员通过远程拨号上网或双方拨号接入internet的方式连接目标计算机,然后通过本地主机管理和维护远程计算机的技术。远程控制软件是基于客户机/服务器模式面向连接协议(tcp / ip)。它包括安装在客户端上的服务器程序和在主机上的客户端程序。远程控制的基本工作原理见图1。figure 1. one-to-one network topology remote control.图1 一对一远程控制网络拓扑图first of all, the client should se
10、t two kinds of authorities of passwords, and tell the ip address and password to the host.after building the connection, the host should set the image quality and fps (frames per second). then, the client captures the screen, compresses the images and sends the images to the host. after receiving th
11、e screen images, the host can watch the screen of the client. finally, the host can control the client. when the host operates on the graphical interface, the mouse action and the keyboard input should be packaged to the client. the client operates the information,and sends the screen images to the
12、host, and so on.首先,客户应设置两种类型的密码权限,告诉主机ip地址和密码。建立连接后,主机应设置图像质量和fps(帧每秒),然后,客户端捕获屏幕,压缩图像并将图像传送到主机。收到屏幕图像后,主机可以查看客户端的屏幕。最后,主机可以控制客户端。当主机在图形界面上进行操作,鼠标的操作和键盘的输入被打包到客户端。客户端运行这些信息,并将屏幕图像等发送到主机。according to the basic process of the remote control as shown in figure 1, the paper developed a remote control so
13、ftware, focused on intercepting the control and the images, and tcp-stick packages. solving these problems well is useful to improve the efficiency of the system and ease the pressure on network. finally, with analysis and experiments, methods are proved to be effective.依据如图1所示的远程控制的基本过程,本论文描述了一个远程控
14、制软件,侧重于拦截控制、图像及tcp粘包。有效的解决这些问题,有利于提高系统的效率和缓解网络的压力。最后,通过分析和试验,方法被证明是有效的。the rest of the paper is organized as follows. section 2 introduces the overview framework of remote control system and the function of each subsystem. the detailedmethod to solve the control interception will be introduced in se
15、ction 3, and the method to solve the image capture and the image display is described in section 4, and the solution of the tcp-stick packages in section 5. the experimentalanalysis is described in section 6. the paper is concluded in the last section.本文的其余部分具体如下。第2部分介绍远程控制系统的框架概述和各子系统的功能。第3部分介绍控制拦截
16、的详细的解决方法,第4部分介绍图像采集和图像显示的解决方法,第5部分介绍tcp粘包解决方案,第6部分中介绍实验分析,论文最后部分得出结论。2. overview framework2. 框架概述figure 2. the relations among the six subsystems.图2 六个子系统之间的关系the paper divided remote control system into six subsystems, authority subsystem, communications subsystem,captured images subsystem, images
17、display subsystem, intercepted control subsystem, and simulation control subsystem.figure 2 is a brief diagram of the relations among the six subsystems.本文将远程控制系统分为六个子系统,权限子系统、通信子系统、捕捉图像子系统、图像显示子系统、截获控制子系统及仿真控制子系统。图2是六个子系统关系的简要图。the functions of the six subsystems are as follows:六个子系统的功能如下:1. author
18、ity subsystem manages the user authority. the client can set two kinds of passwords, one only to watch and the other to control. two kinds of passwords are stored in the document after encrypted. the host inputs the respective password to get the appropriate authority.1. 权限子系统管理用户的权限。客户端可以设置两种密码权限,一
19、种只浏览,另一种可控制。两种类型的密码都存储在加密后的文件里。主机输入相应的密码以获得相应的权限。2. communications subsystem is primarily responsible for communications between the host and the client.the subsystem is divided into host and client module. host module is mainly responsible for transmitting the image information to the client, while
20、 client module is mainly responsible for transmitting the mouse action and the keyboard input to the host.2. 通信子系统主要负责主机和客户端的沟通。该子系统分为主机和客户端模块。主机模块主要负责向客户端传输图像信息,而客户端模块主要负责向主机传递鼠标操作和键盘输入命令。3. intercepted control subsystem intercepts the mouse action and the keyboard of the host, and gives these info
21、rmation to host module of communications subsystemafter packaging them. then, host module transmit these information to the client.3. 截获控制子系统截取主机的鼠标操作和键盘输入,打包后向通信子系统的主机模块给出了这些信息,然后,主机模块发送这些信息给客户端。4. simulation control subsystem obtains the mouse action and the keyboard input from client module of co
22、mmunications subsystem.4. 仿真控制子系统获得来自通信子系统客户端模块的鼠标操作和键盘输入。5. captured images subsystem calls the function to capture screen in the client, and stores the images formatted in bmp in memory, and converts bmp images tojpeg images, in order to facilitate the rapid transmission on the network.5. 捕捉图像子系统在
23、客户端调用函数捕获屏幕,将图像以bmp格式存储在内存中,并且为了便于在网络上迅速传播,将bmp图像转换为jpeg图像。6. images display subsystem reverts the data received from communications subsystem to jpeg images, and converts them to bmp images, and displays these images on the screen in the host.6. 图像显示子系统将来自通信子系统的数据还原为jpeg格式图像,并将其转换为bmp格式图像,在主机屏幕上显示这
24、些图像。3. intercepted control subsystem3. 截获控制子系统generally speaking, intercepted control subsystem is mainly responsible for the interception of the mouse action and keyboard input. the intercepted accuracy will directly affect the accuracy of simulation control subsystem. for example, users move the m
25、ouse to the location of a folders over the graphical interface, while the coordinates of the mouse is (0,0). then double click operates it, but coordinatesof the mouse which is got by intercepted control subsystem is (1,0). this may result in errors that the client can not correctly implement, and i
26、s unable to open the selectedfolder. in addition, when the subsystem intercepts information, it should be payed a lot attentions on the validity.we can avoid intercepting unnecessary information toimprove the efficiency. when authentication successes and user operate the host, intercepted control su
27、bsystem should take different measures by user authority. if the authority is to control, it will intercept the mouse action and keyboard input; if not, it will not. once intercepted control subsystem intercept the mouse action and keyboard input, the problem of the interception field should be put
28、first. when user operatesthe host, it will never be always intercepted. some other things may be solved. if intercepted control subsystem do not fix the interception field, some useless information will be intercepted. this will result in some very difficult problems that simulation control subsyste
29、m is difficult to design and implement. in addition, it will reduce the efficiency.一般来说,截获控制子系统主要负责鼠标操作和键盘输入的拦截。被拦截的精度将直接影响仿真控制子系统的精度。例如,用户移动鼠标到一个文件夹的图形界面位置,鼠标的坐标是(0,0),然后双击运行它,但截取图像子系统上的鼠标的坐标变为(1,0)。这可能因为错误导致客户端不能正确执行,并且无法打开选定的文件夹。此外,当子系统截取信息时,应当多关注有效性。我们可以避免不必要的信息拦截进而提高效率。当身份验证成功,用户操作主机时,截获控制子系统应当
30、通过用户权限采取不同的措施应对。如果权限是控制,它会拦截鼠标操作和键盘输入,反之,则不会。一旦截获控制子系统拦截鼠标操作和键盘输入,截取领域出现的问题应放在一位。当用户操作主机,它将永远不会被截获。一些其他的事情可能得到解决。如果拦截控制子系统不能控制拦截领域,一些无用的信息将被拦截。这将导致出现一些非常棘手的问题,仿真控制子系统将很难设计和实施。此外,它会降低工作效率。in order to solve the problem about the interception field, the paper tried several measures:为了解决拦截领域出现的问题,本文尝试了几
31、种措施:1. with hook to achieve the interception of mouse actionand keyboard input. the basis for determining the interception field, two points must be met at the same time.1.将鼠标操作和键盘输入挂钩实现拦截。确定拦截领域的基础是,以下两点必须同时满足。 intercepting only if the system window is active; if the system window is active, the po
32、sition of the mouse should be in the working area.仅在系统的窗口处于活动状态时拦截如果系统窗口处于活动状态,鼠标的位置应在工作区表1 3种方法的比较复杂性困难性效率方法1困难更难低方法2容易更难低方法3容易-高2. with the functions such as pretranslatemessag, windowsproc and so on to intercept. although implementing these functions is easier than hook, the interceptedinformatio
33、n is almost all the windows messages. thus choosing this method should do the same work as the above one.2. 如拦截pretranslatemessag,windowsproc的功能等。虽然实施这些功能比挂钩容易,被拦截的几乎所有都是windows信息。因此,选择此方法应做上述同样的工作之一。3. overloading the mouse message function of cview class; while the keyboard input is also intercept
34、ed by the function pretranslatemessag. the mouse messagefunctions are the member functions of cview class.only if the mouse move in the working area, interception is doing. in this way, there is no need to determinewhether the mouse is in the working area. the method saves time and space, and improv
35、es efficiency.3.重载cview类的鼠标消息功能,而键盘输入也是由函数pretranslatemessag截获。鼠标消息函数是cview类的成员函数。只有当鼠标在工作区移动,拦截才是有效的。用这种方法,没有必要再确定鼠标是否在工作区。该方法节省了时间和空间,提高了效率。table 1 analyzes and compares three methods from the complexity, the difficulty to intercept field and efficiency.as a result, this paper selected the third m
36、ethod. themethod is easy to implement, does not determine the interception field and has a higher efficiency.表1分析和比较三种方法的复杂性,拦截领域的难易度和效率。因此,本文选择了第三种方法。该方法容易实现,不决定拦截领域,具有更高的效率。4. capture and display images4. 捕捉和显示图像in the development of captured images subsystem and images display subsystem, we shoul
37、d put the use of bandwidth first. as remote control system is mainly used forlan transmission1. the transmission speed in local area network is usually 10 mbps to 100mbps. therefore, the transmission bandwidth should reach 10mbps. the clientshould set the image quality and the transmission speed on
38、the basis of network bandwidth. the captured images are stored in bmp format. each 1024*768 bmp with 24-bit color graphics needs more than 2mb space. even if the transmission fps is 1 fps, the bandwidth needs reach at least 16 mbps, far more than 10 mbps. so the images must be compressed before tran
39、smission.随着捕获图像子系统和图像显示子系统的发展,我们应该把它首先应用于宽带。远程控制系统主要用于局域网的传输1。在局域网的传输速度一般为10 mbps到100mbps的。因此,要达到10mbps的传输带宽。客户应在网络宽带的基础上设置图像质量和传输速度。截获的图像存储为bmp格式。每个24彩色的1024*768的bmp图像需要超过2mb的空间。即使是一帧帧传输,需要的带宽至少达到16 mbps,远远超过10 mbps。因此,图像必须压缩后传输。after capturing the images, the system will store them in a certain fo
40、rmat, such as bmp, jpeg. the two methods are different. although using bmp is easy, data traffic need a harsh bandwidth, and scalability is not strong. it is not conductive to operate in the future. however, jpeg compression is convenient, with large compression ratio and small distortion. therefore
41、, the paper made use of cximage class library to compress jpeg.拍摄的照片后,系统会存储在一个特定格式,如bmp,jpeg格式。这两种格式是不同的。虽然bmp使用容易,但需要一个较大的数据流量的带宽,可扩展性不强。这在未来不利于经营。然而,jpeg压缩方便,拥有大压缩比和失真小的特点。因此,本文使用cximage类库压缩jpeg图像。after captured images subsystem does the screen-shot, it will pass the image formatted in memory bloc
42、k to the cx-image category formatted. cximage class can immediately convert the memory blocks to jpeg image. with cximage class, system will do a jpeg compression operation. the process sets the compression quality, from 0 to 100 (the numerical representation for image quality). after compression,co
43、mmunications subsystem will send them to the host.通过截获图像子系统截图后,它会通过在内存块格式化为cximage的图像类型。cximage可以立即将内存块转换为jpeg图像。系统用cximage做一个jpeg压缩操作。该程序压缩质量从0到100(图像质量数值表示)。压缩后,通信子系统将它们发送到主机。secondly, we should solve how to make users convenient to set image quality, transmission speed and so on. if we compress t
44、he images in a fixed proportion following the same pattern, and do not consider the state of users network,it may happen that users whos bandwidth is low feel the screen is not coherent, while users whos bandwidth is high feel image quality is not good. therefore, in the actualuse process, users sho
45、uld be able to adjust the image compression level according to the current state of the network.其次,我们要解决如何使用户方便地设置图像质量、传输速度等问题。如果我们压缩在一个固定比例的图像千篇一律,不考虑用户的网络状态,有可能发生有些用户带宽感觉画面不连贯,有些用户感觉宽带感觉图像质量不好。因此,在实际使用过程中,用户应该能够根据网络当前状态调整图像的压缩级别。thirdly, we should consider the transmission number per second. on th
46、e basis of different purposes, different realtime levels is need. so, it need users to set the imagefps. when a user requests high realtime level, the image fps should be improved. then, the change of the image will be faster, and the user needs will be met.第三,我们在不同用途不同实时级别的基础上应该考虑每秒传输次数是很必要的。因此,用户需
47、要设置图像帧。当用户要求高的水平,图像的fps应该加以改进。这样,图像的变化会更快,用户需求将得到满足。in the middle level compression, a 1024*768 jpeg image whos plans are 32 color need only 80 kb. in the 4/s fps, occupied bandwidth is about 2.5 mbps. it is good to adapt to the local area network bandwidth requirements, and image quality and fluenc
48、y can meet users requirements.中间级别压缩的时候,计划是32色彩的1024 * 768的jpeg图像只需要80 kb。4/s帧时,占用带宽大约是2.5 mbps。这能很好的适应本地区域网络带宽的要求,满足用户图像质量和流畅度的要求。5. the solution of tcp-stick packages5.tcp粘包的解决方案communications subsystem is responsible for communication between the client and the host. firstly, the subsystem is nec
49、essary to ensure the accuracy of the data transmission, avoiding data loss. however, if you use the default tcp protocol, the interception information can not be completely simulated in the host. the reason is that the interception information is all relatively short. it is prone to stick the tcp pa
50、ckages, and ultimately, it will result in the illusion that lost data packages.通讯子系统负责客户端和主机的通信。首先,该子系统是要保证数据传输的准确性,避免数据丢失。但是,如果您使用默认的tcp协议,截取信息不能完全在主机上模拟。其原因是,拦截的信息都相对较短。它很容易粘贴tcp程序包,并最终会因为错觉失去数据包。with the method2, towards tcp-stick packages caused by sender, we can avoid this problem through progr
51、am setting, and make use of the operation push supplied by tcp, which can immediately transmit the data. once tcp receives the operation, it will immediately send out data in this paragraph, rather than waiting until the buffer is full. towards the tcp-stick packages caused by receiver, we can recei
52、ve data in time, through optimizing the program design, simplifying the workload of the receiving process, improving the priority of the receiving process, and so on. furthermore, the data packages can be set to field structure. it is controlled by sender, and multiply received in human control. fin
53、ally, we can merge them. the method can completelyavoid tcp-stick packages in the case of paying a little efficiency .使用方法2,针对发件人引起tcp粘包,我们可以通过程序设置避免这个问题,并使用有tcp提供的可以立即传输数据的操作推进。一旦tcp收到的操作,它会立即发出在本段数据,而不是等到缓冲区满。对接收器引起的tcp粘包,我们可以及时收到数据,通过优化方案设计,简化了接收过程的工作量,提高接收进程优先级,等等。此外,数据包可以被设置为外地结构。它是由发件人和认为控制的加快
54、接收器控制。最后,我们可以将它们合并。这种方法可以完全避免tcp粘包效率低的情况。the paper selected the third method. the method designed the communication protocol, and packed all the data. before sending data, data head exmsg in a fixed-sized will be sent. the data head includes the type and size of the followingdata. this will receive
55、the following data in fixed size, and the problem of tcp-stick packages will be naturally solved.本文选择了第三种方法。该方法设计的通信协议,包装了所有数据。发送数据前,数据头exmsg将固定大小发送。数据头包括以下数据类型和大小。这将获得适合大小的数据,tcp粘包的问题将自然解决。struct exmsg3msgtype msgtype;/head message commandint size;/the size of the command or data ;enum msgtype4comm
56、and, /commandkeyboard, /keyboard inputmouse, /mouse actionpassword, /the connection passwordconfirm, /the return value after connection is bulitimage, /imageimagequality, /image qualityimagefps, /image fpsdefinition / resolution;exmsg3结构msgtype msgtype / /头信息命令int size,/ /命令或数据大小;例如 msgtype4command,
57、/ /命令keyboard, / /键盘输入mouse,/ /鼠标动作password,/ /连接密码confirm,/ /连接后的返回值是储存卡image,/ /图像imagequality,/ /图像质量imagefps,/ /图像帧definition / /分辨率;6. experimental result and analysis6. 实验结果及分析6.1. comparisons of the image capacity6.1 图像存储容量的比较this section will compare bmp and jpeg from image quality and capac
58、ity. for the convenient of testing, the client program should be changed. the captured images not only are converted data flow to send to communications subsystem, but also are stored on the hard drive formatted in bmp and jpeg. then, we can compare their image quality and image capacity.本部分将从质量和容量上比较bmp和jpeg图像。为了方便测试,客户端程序应有所改变。捕捉的图像不仅是转换后的数据流发送到通信子系统,而且是以bmp和jpeg格式存储在硬盘驱动器。这样,我们可以比较其图像质量和
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 常规课课件教学课件
- 助理职业规划
- 睡眠障碍研究
- 2024年度企业采购原材料交易合同3篇
- 《高血压病》课件
- 施工临时用电安全管理培训
- 简述工程招投标与合同管理关系
- 生活垃圾清运承包合同
- 公务员培训课件
- 监护仪故障应急预案及处理流程
- 【初中道法】爱护身体+课件-2024-2025学年统编版(2024)道德与法治七年级上
- 2024年医疗器械经营质量管理规范培训课件
- 景区旅游安全风险评估报告
- GB/T 36187-2024冷冻鱼糜
- 建筑施工安全生产治本攻坚三年行动方案(2024-2026年)
- 人教版小学英语单词表(完整版)
- DL-T 1476-2023 电力安全工器具预防性试验规程
- 中国戏曲剧种鉴赏智慧树知到期末考试答案章节答案2024年上海戏剧学院等跨校共建
- 国开《Windows网络操作系统管理》形考任务4-配置故障转移群集服务实训
- 星轮毕业设计
- 新苏教版四年级上册科学 4.12《点亮小灯泡》教案设计
评论
0/150
提交评论