版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領
文檔簡介
1、2008 international conference on advanced computer theory and engineering2008年高級計算機理論與控制工程國際會議an effective remote control system based on tcp/ip一種基于tcp / ip協議的有效遠程控制系統(tǒng)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.隨著網絡技術的發(fā)展,遠程技術逐漸占據了技術的主流。對在家里辦公和遠程教育的人來說,它已經變得越來越受歡迎。它的快速發(fā)展為遠程控制軟件提供了廣闊的天地。pcanywhere, damewhere, qq遠程協助及其他遠程控制軟件已經出現,在遠程控制領域,提高效率和確保準確的傳輸對評價一個遠程控制軟件的成功與否是極為重要的。本文描述了一種遠程控制系統(tǒng),并側重于攔截控制、圖像及tcp粘包。有效的解決這些問題,有利于提高系統(tǒng)
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.隨著網絡技術的飛速發(fā)展,家庭辦公和遠程教育為遠程控制軟件提供了廣闊的天地。早在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(幀每秒),然后,客戶端捕獲屏幕,壓縮圖像并將圖像傳送到主機。收到屏幕圖像后,主機可以查看客戶端的屏幕。最后,主機可以控制客戶端。當主機在圖形界面上進行操作,鼠標的操作和鍵盤的輸入被打包到客戶端??蛻舳诉\行這些信息,并將屏幕圖像等發(fā)送到主機。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粘包。有效的解決這些問題,有利于提高系統(tǒng)的效率和緩解網絡的壓力。最后,通過分析和試驗,方法被證明是有效的。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部分介紹遠程控制系統(tǒng)的框架概述和各子系統(tǒng)的功能。第3部分介紹控制攔截
16、的詳細的解決方法,第4部分介紹圖像采集和圖像顯示的解決方法,第5部分介紹tcp粘包解決方案,第6部分中介紹實驗分析,論文最后部分得出結論。2. overview framework2. 框架概述figure 2. the relations among the six subsystems.圖2 六個子系統(tǒng)之間的關系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.本文將遠程控制系統(tǒng)分為六個子系統(tǒng),權限子系統(tǒng)、通信子系統(tǒng)、捕捉圖像子系統(tǒng)、圖像顯示子系統(tǒng)、截獲控制子系統(tǒng)及仿真控制子系統(tǒng)。圖2是六個子系統(tǒng)關系的簡要圖。the functions of the six subsystems are as follows:六個子系統(tǒng)的功能如下: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. 權限子系統(tǒng)管理用戶的權限??蛻舳丝梢栽O置兩種密碼權限,一
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. 通信子系統(tǒng)主要負責主機和客戶端的溝通。該子系統(tǒng)分為主機和客戶端模塊。主機模塊主要負責向客戶端傳輸圖像信息,而客戶端模塊主要負責向主機傳遞鼠標操作和鍵盤輸入命令。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. 截獲控制子系統(tǒng)截取主機的鼠標操作和鍵盤輸入,打包后向通信子系統(tǒng)的主機模塊給出了這些信息,然后,主機模塊發(fā)送這些信息給客戶端。4. simulation control subsystem obtains the mouse action and the keyboard input from client module of co
22、mmunications subsystem.4. 仿真控制子系統(tǒng)獲得來自通信子系統(tǒng)客戶端模塊的鼠標操作和鍵盤輸入。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. 捕捉圖像子系統(tǒng)在
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. 圖像顯示子系統(tǒng)將來自通信子系統(tǒng)的數據還原為jpeg格式圖像,并將其轉換為bmp格式圖像,在主機屏幕上顯示這
24、些圖像。3. intercepted control subsystem3. 截獲控制子系統(tǒng)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.一般來說,截獲控制子系統(tǒng)主要負責鼠標操作和鍵盤輸入的攔截。被攔截的精度將直接影響仿真控制子系統(tǒng)的精度。例如,用戶移動鼠標到一個文件夾的圖形界面位置,鼠標的坐標是(0,0),然后雙擊運行它,但截取圖像子系統(tǒng)上的鼠標的坐標變?yōu)椋?,0)。這可能因為錯誤導致客戶端不能正確執(zhí)行,并且無法打開選定的文件夾。此外,當子系統(tǒng)截取信息時,應當多關注有效性。我們可以避免不必要的信息攔截進而提高效率。當身份驗證成功,用戶操作主機時,截獲控制子系統(tǒng)應當
30、通過用戶權限采取不同的措施應對。如果權限是控制,它會攔截鼠標操作和鍵盤輸入,反之,則不會。一旦截獲控制子系統(tǒng)攔截鼠標操作和鍵盤輸入,截取領域出現的問題應放在一位。當用戶操作主機,它將永遠不會被截獲。一些其他的事情可能得到解決。如果攔截控制子系統(tǒng)不能控制攔截領域,一些無用的信息將被攔截。這將導致出現一些非常棘手的問題,仿真控制子系統(tǒng)將很難設計和實施。此外,它會降低工作效率。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.僅在系統(tǒng)的窗口處于活動狀態(tài)時攔截如果系統(tǒng)窗口處于活動狀態(tài),鼠標的位置應在工作區(qū)表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類的成員函數。只有當鼠標在工作區(qū)移動,攔截才是有效的。用這種方法,沒有必要再確定鼠標是否在工作區(qū)。該方法節(jié)省了時間和空間,提高了效率。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.隨著捕獲圖像子系統(tǒng)和圖像顯示子系統(tǒng)的發(fā)展,我們應該把它首先應用于寬帶。遠程控制系統(tǒng)主要用于局域網的傳輸1。在局域網的傳輸速度一般為10 mbps到100mbps的。因此,要達到10mbps的傳輸帶寬??蛻魬诰W絡寬帶的基礎上設置圖像質量和傳輸速度。截獲的圖像存儲為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.拍攝的照片后,系統(tǒng)會存儲在一個特定格式,如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.通過截獲圖像子系統(tǒng)截圖后,它會通過在內存塊格式化為cximage的圖像類型。cximage可以立即將內存塊轉換為jpeg圖像。系統(tǒng)用cximage做一個jpeg壓縮操作。該程序壓縮質量從0到100(圖像質量數值表示)。壓縮后,通信子系統(tǒng)將它們發(fā)送到主機。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.其次,我們要解決如何使用戶方便地設置圖像質量、傳輸速度等問題。如果我們壓縮在一個固定比例的圖像千篇一律,不考慮用戶的網絡狀態(tài),有可能發(fā)生有些用戶帶寬感覺畫面不連貫,有些用戶感覺寬帶感覺圖像質量不好。因此,在實際使用過程中,用戶應該能夠根據網絡當前狀態(tài)調整圖像的壓縮級別。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。這能很好的適應本地區(qū)域網絡帶寬的要求,滿足用戶圖像質量和流暢度的要求。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.通訊子系統(tǒng)負責客戶端和主機的通信。首先,該子系統(tǒng)是要保證數據傳輸的準確性,避免數據丟失。但是,如果您使用默認的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,針對發(fā)件人引起tcp粘包,我們可以通過程序設置避免這個問題,并使用有tcp提供的可以立即傳輸數據的操作推進。一旦tcp收到的操作,它會立即發(fā)出在本段數據,而不是等到緩沖區(qū)滿。對接收器引起的tcp粘包,我們可以及時收到數據,通過優(yōu)化方案設計,簡化了接收過程的工作量,提高接收進程優(yōu)先級,等等。此外,數據包可以被設置為外地結構。它是由發(fā)件人和認為控制的加快
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.本文選擇了第三種方法。該方法設計的通信協議,包裝了所有數據。發(fā)送數據前,數據頭exmsg將固定大小發(fā)送。數據頭包括以下數據類型和大小。這將獲得適合大小的數據,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圖像。為了方便測試,客戶端程序應有所改變。捕捉的圖像不僅是轉換后的數據流發(fā)送到通信子系統(tǒng),而且是以bmp和jpeg格式存儲在硬盤驅動器。這樣,我們可以比較其圖像質量和
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯系上傳者。文件的所有權益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網頁內容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經權益所有人同意不得將文件中的內容挪作商業(yè)或盈利用途。
- 5. 人人文庫網僅提供信息存儲空間,僅對用戶上傳內容的表現方式做保護處理,對用戶上傳分享的文檔內容本身不做任何修改或編輯,并不能對任何下載內容負責。
- 6. 下載文件中如有侵權或不適當內容,請與我們聯系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 2025年度物流倉儲代理居間合同標準范本4篇
- 年產1000套氣體凈化設備可行性研究報告建議書申請備案
- 2025年度個人貨物航空貨運代理服務合同4篇
- 《新能源汽車電池培訓》課件
- 2025年收養(yǎng)協議書范本與合同糾紛處理3篇
- 2025年度二手車置換合同樣本(含車輛評估)4篇
- 2025年國家中遠海運港口有限公司招聘筆試參考題庫含答案解析
- 2025年通勤車租賃合同公務及商務出行服務協議6篇
- 2025年度消防設備節(jié)能改造采購合同模板4篇
- 2025年山東通匯資本管理有限公司招聘筆試參考題庫含答案解析
- 表B. 0 .11工程款支付報審表
- 警務航空無人機考試題庫及答案
- 空氣自動站儀器運營維護項目操作說明以及簡單故障處理
- 新生兒窒息復蘇正壓通氣課件
- 2022年12月Python-一級等級考試真題(附答案-解析)
- 法律顧問投標書
- 班主任培訓簡報4篇(一)
- 成都市數學八年級上冊期末試卷含答案
- T-CHSA 020-2023 上頜骨缺損手術功能修復重建的專家共識
- 危重癥患者轉運指南-課件
- Hypermesh lsdyna轉動副連接課件完整版
評論
0/150
提交評論