基于缓存技术的多线程下载软件的改进研究
2018-01-05谌颃
谌颃



摘 要:本文通过对WEB浏览器访问网络资源特性的研究,将浏览器缓存技术应用到下载软件系统,提出一种新的基于图片资源缓存的下载软件设计方法,可实现多线程、断点续传、限速等功能,改进了传统软件下载图片时的不足。测试结果表明,该设计具备良好的稳定性和可行性,图片资源下载速度较传统软件有了较大提升。
关键词:多线程;断点续传;下载;图片缓存
中图分类号:TP301 文献标识码:A
Abstract:Based on the characteristics of web browsers to access network resources,the study applies the browser cache technology into the download software and puts forward a new download software design method based on image resource cache,which can achieve the functions of multi-thread transferring,broken-point continuingly-transferring and download rate restriction,etc.,and improve the image download through the traditional software.The test results show that the design has good stability and feasibility,and the image download rate is greatly increased.
Keywords:multi-thread;broken-point continuingly-transferring;download;image cache
1 引言(Introduction)
互联网的飞速发展促进了网络资源爆炸式成长。用户通常使用浏览器获取网络资源信息,而通过下载软件下载资源则成为用户最普遍的应用[1],主流的下载软件国内有迅雷、快车,国外有Orbit、TuoTu和电驴等。
研究浏览器访问网络资源的特点发现,为了提高网页访问速度,通常它会采用累积式加速的方法,即将曾经访问过的网页内容,如图片、cookie等存放到本地的缓存区域,当有访问请求时,浏览器将首先搜索该目录。如果内容已存在,则直接从缓存中读取内容,以此达到提高访问速度的目的。本课题基于IE浏览器缓存机制,将该技术应用到下载软件系统的设计中,提出了一种基于图片资源缓存的下载软件设计方法,改进了传统软件下载图片资源的不足。
2 主要技术原理分析(Main technical principle
analysis)
2.1 线程与线程同步
本系统采用了线程技术,与进程相比,线程的主要特点有:轻型实体,独立调度,可并发执行,共享进程资源[2]。由于线程很“轻”,故线程的切换非常迅速而且开销小,并发执行和共享资源方面优于进程。……
