CN105282238B - A kind of method for managing resource - Google Patents
A kind of method for managing resource Download PDFInfo
- Publication number
- CN105282238B CN105282238B CN201510591390.9A CN201510591390A CN105282238B CN 105282238 B CN105282238 B CN 105282238B CN 201510591390 A CN201510591390 A CN 201510591390A CN 105282238 B CN105282238 B CN 105282238B
- Authority
- CN
- China
- Prior art keywords
- resource
- resource packet
- packet
- module
- packaged
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/02—Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/06—Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
Abstract
The invention discloses a kind of method for managing resource, resource packet sends resource access request using module to resource packet download module;Resource packet download module judges whether corresponding resource packet, if so, corresponding resource packet, which is sent to resource packet, uses module;Otherwise, resource packet download module Connection Service device, download corresponding resource packet and be sent to resource packet use module;Resource packet uses module resolving resource packet, and extracts the fileinfo in resource packet;Resource packet download module Connection Service device, the adjacent resource packet of pre-download;Resource packet download module deletes unwanted resource packet, and releasing memory space.Primary time overhead will be connected the invention avoids each resource, directly loaded data from the resource packet of pre-download, avoided the connection with server, accelerate system response time, increase user experience;And avoid the risk that client memory headroom is depleted.
Description
Technical field
The present invention relates to computer communication technology fields, particularly relate to a kind of micro-wave oven.
Background technology
Browser forms the framework of BS with server, and B refers to browser in base, and S refers to server.Essence is client
It is special with one kind of server end CS frameworks to hold.Wherein C refers to client, and S refers to server.
HTTP is a kind of hypertext transfer protocol realized based on TCP/IP.Browser relies on http protocol and server end
Interaction.General process is that browser sends HTTP request, and server returns to the resource of browse request.Resource includes the page
(html file), script (JS files), style sheet (CSS files) and picture (BMP, GIF, JPG, PNG file).All resources are all
It is to send to ask by http protocol.
Existing resource downloading, using being that each resource corresponds to a connection.Establishment of connection and destruction, occupy preciousness
Time.In the case where the page needs to quote more resource, the time of accumulation can cause user experience bad.
Invention content
The present invention proposes a kind of method for managing resource, solves in the prior art that the resource downloading time loss time is long, uses
The problem of family experience difference.
The technical proposal of the invention is realized in this way:
A kind of method for managing resource, including client and server end, client are equipped with resource packet download module and resource
Packet uses module, includes the following steps:
(1) resource packet sends resource access request using module to resource packet download module;
(2) resource packet download module judges whether to have existed the corresponding resource packet of resource access request, if so, will
Corresponding resource packet is sent to resource packet and uses module;Otherwise, it enters step (3);
(3) resource packet download module is downloaded corresponding resource packet and is sent to according to resource access request Connection Service device
Resource packet uses module;
(4) resource packet uses module resolving resource packet, and extracts the fileinfo in resource packet;
(5) resource packet download module is that identifier, and Connection Service device is arranged in resource packet, downloads the adjacent resource of resource packet
Packet;
(6) resource packet download module deletes unwanted resource packet according to algorithm, and discharges the interior of resource packet occupancy
Deposit space.
Further, in step (3), server is packaged http resource to obtain corresponding resource packet in advance.
Further, resource packaging method includes the following steps:
(a) establishment file list, listed files are used to provide the routing information for being packaged resource;
(b) listed files is traversed, obtains and is packaged resource, statistics is packaged in quantity, title, data length and the data of resource
Hold;
(c) title and data for the quantity for being packaged resource being recorded in the resource packet header of resource packet, and resource being packaged
The data content for being packaged resource is replicated in the resource content area of resource packet by length records in the resource information area of resource packet;
(d) it is packaged according to the sequence in resource packet header, resource information area, resource content area.Further, resource packet
Head further includes ident value, the first retention, version number, file generated time, the second retention and fixed value;
Ident value is to be packaged to generate by above-mentioned resource packaging method for identifying resource packet;
First retention and the second retention are used to edition upgrading or format expands;
Fixed value terminates for identifying resource packet header.
Resource information area further includes data offset and check value.
Further, resource packet specifically includes following steps using module resolving resource packet in step (4):
(401) resource packet header is obtained, the quantity for being packaged resource is obtained;
(402) title, data length, data offset and the check value of all packing resources in traversal resource information area,
And extract corresponding data content in resource content area.
Further, server uses Pagination Display pattern, and the resource that each paging is included is packaged.More into
One step, include pageindex parameters in the uniform resource locator of resource.
Further, resource packet download module be equipped with resource packet management list, resource packet management list include identifier, under
Carry time, download state, access times, last usage time and use state.
The beneficial effects of the present invention are:
(1) all resource files are packaged by server by utilizing resource packaging method, and client request is accessed
Resource is all sent to client, saves download time, and resource information and resource data are opened respectively, is conducive to client
Accelerate to read the operation of fileinfo in end.
(2) client is equipped with resource packet download module, can download relevant resource packet, better user experience in advance.
(3) resource packet download module can manage and delete useless resource packet, and releasing memory space avoids system space
The risk being depleted, meanwhile, it ensure that the surfing of related resource packet.
Description of the drawings
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below
There is attached drawing needed in technology description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this
Some embodiments of invention without having to pay creative labor, may be used also for those of ordinary skill in the art
With obtain other attached drawings according to these attached drawings.
Fig. 1 is a kind of flow chart of method for managing resource of the present invention.
Specific implementation mode
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete
Site preparation describes, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on
Embodiment in the present invention, those of ordinary skill in the art are obtained every other without creative efforts
Embodiment shall fall within the protection scope of the present invention.
As shown in Figure 1, the present invention proposes a kind of method for managing resource, including client and server end, client can
It, can be by 3G or 4G or Ethernet to being attached with server and data transmission, separately for mobile phone or tablet computer or computer
Outside, client is equipped with resource packet download module and resource packet uses module, resource packet download module to be increased newly for browser attached
Software module, existing client browser directly send to server and ask, and in the present embodiment, client browser passes through money
Source packet download module Connection Service device.
The present invention is based on a kind of resource packaging methods, carry out the download of resource packet, resource packet pre-download and the deletion of resource packet etc.
Function.
First, server coping resources are packaged, and signified resource can be web page resources herein, and web page resources include figure
Piece, word, voice, hyperlink and video etc..In the present embodiment, it is picture and voice that need to be packaged resource.
Resource packaging method includes the following steps:
(a) establishment file list, listed files are used to provide the routing information for being packaged resource;It is packaged resource and refers to owning
Need the routing information of the picture being packaged or voice, that is, picture and language included by the web page resources of client request access
Sound;It includes being packaged money that establishment in working directory (i.e. work at present catalogue where this document strapping tool), which can be packaged, in current file
The listed files of source path information, it includes being packaged resource that can also be created in other catalogues that current file is packaged outside working directory
The listed files of routing information.Server establishment file information list, by the phase of all packing resources of storage in the server
It closes information to be arranged in fileinfo list, fileinfo list includes serial number, title, data length, data content, bit of storage
It sets and routing information, wherein data length refers to being packaged the occupied storage space of resource, unit BYTE.
(b) listed files is traversed, server can be according to the title and fileinfo of all packing resources in listed files
List is compared, and is obtained and is packaged resource, and statistics is packaged quantity, title, data length and the data content of resource;
(c) title and data for the quantity for being packaged resource being recorded in the resource packet header of resource packet, and resource being packaged
The data content for being packaged resource is replicated in the resource content area of resource packet by length records in the resource information area of resource packet;It beats
Packing resource is compared to an article by a analogy, this step, which is equivalent to, separates the abstract and text of article, need to only be checked and be plucked
It wants, you can confirm the content of all texts, easy-to-look-up confirmation.
(d) it is packaged according to the sequence in resource packet header, resource information area, resource content area.The format of encapsulation such as following table
It is shown:
In table, resource information 1, resource information 2, resource information 3 and resource information N are resource information area, represent 1-N
It is packaged the title and data length of resource;Data content 1, data content 2, data content 3 and data content N are resource content
Area represents the data content of the 1-N packing resource.
Specifically, resource packet header is used to record the information of resource packet entirety, resource packet header includes quantity, ident value, first
Retention, version number, file generated time, the second retention and fixed value;
Ident value is to be packaged to generate by above-mentioned resource packaging method for identifying resource packet;
First retention and the second retention are used to edition upgrading or format expands;
Fixed value terminates for identifying resource packet header.The regular length in resource packet header is 32 bytes.
Resource information area includes data content, data offset and check value.Can according to data offset and check value from
Some data content for being packaged resource is accurately found in resource information area.
After server is packaged resource, resource packet download module asks to download resource packet to server.
The present invention proposes a kind of method for managing resource, can be based on resource packaging method carry out resource downloading, resource it is pre- under
It carries and resource deletes recycling, include the following steps:
(1) client sends resource access request to resource packet download module;Specifically, client in the present embodiment,
Resource packet download module and server are all made of http protocol, and client sends resource access request to resource packet, as sends
HTTP web access requests, the banner comprising HTTP webpages and/or page elements mark in access request, for example, at this
In embodiment, that include in resource access request is the URL of some webpage.
(2) resource packet download module judges whether to have existed the corresponding resource packet of resource access request, if so, will
Corresponding resource packet is sent to client;Specifically, resource packet is equipped with resource packet header, resource information area, resource content area, resource
Whether packet download module is scanned for and is compared to the URL in resource packet header and webpage, judge in the resource packet downloaded
There are the corresponding resource packet that client request accesses, resource packet download module only searches for comparison resource packet header, greatlys save
Search time;Otherwise, it if the resource packet that client request accesses is not present, enters step (3);In addition, in this step
In, the resource packet that resource packet download module has been downloaded is stored in the storage device of client.
(3) if resource packet download module does not search the resource packet of client request access, resource packet is downloaded
Module sends resource to server by http protocol and accesses according to resource access request Connection Service device, resource packet download module
It asks, the URL of some webpage is included in resource access request, server can confirm corresponding money according to the URL of the webpage
Source is wrapped, and establishes a HTTP long connection with resource packet download module, keeps prolonged download channel, resource packet download module
Download corresponding resource packet;Resource packet download module downloads the flow that resource packet still downloads resource using general HTTP, downloads
Resource packet include the contents of multiple resources.
Specifically, in step (3), server is packaged http resource to obtain corresponding resource packet in advance.
Server uses Pagination Display pattern, and the resource that each paging is included is packaged.The unified money of resource
Include pageindex parameters in the finger URL of source.Server by utilizing pageindex parameters carry out all resources of a long webpage
Paging can be divided into the multiple pagings of pageindex=1, pageindex=2, pageindex=3, pageindex=4 etc., tool
The quantity of the paging of body can sets itself.
When client request accesses the webpage of pageindex=1, resource packet download module can be asked to download to server
The resource packet of pageindex=1, and the resource packet is sent to client.
(4) resource packet uses module resolving resource packet, and extracts the fileinfo in resource packet;
Resource packet specifically includes following steps using module resolving resource packet in step (4):
(401) resource packet header is obtained, the quantity for being packaged resource is obtained;
(402) title, data length, data offset and the check value of all packing resources in traversal resource information area,
And extract corresponding data content in resource content area.
At this point, client shows that the webpage of pageindex=1 checks that under normal circumstances, user clicks some for user
Webpage, after webpage is opened, user understands the direct viewing webpage, after it has browsed current webpage, then clicks lower one page, so
Existing resource downloading method needs client to send request to server again afterwards, then downloads resource, comparatively, waste
Many times, make the user experience very poor.
And the present invention provides resource pre-download methods, as shown in step (5), resource packet download module can download money in advance
Source is wrapped, when descend one page when the user clicks, client can direct resolving resource packet, reduce the time to wait for downloads, can allow user
Feel using much smoother.
(5) resource packet download module is that identifier, and Connection Service device is arranged in resource packet, downloads the adjacent resource of resource packet
Packet;Resource packet download module is that identifier is arranged in resource, convenient to be distinguished to it.
When client is showing the webpage of pageindex=1, resource packet download module can download neighbouring money in advance
It wraps in source.The number of the resource packet of pre-download can be determined according to system and the concrete condition of network.For example, working as pre-download resource
When packet number is 2, resource packet download module can download the resource packet of pageindex=2 and pageindex=3, pre-download in advance
Benefit be when user jumps to second page from first page, the resource packet of second page may download completion.At this moment, according to
Preferentially from resource packet load resource flow, second page content present when, browser need not reconnect server into
The download of row resource, substantially increases response speed, increases user experience.And when user's page turning is to page 2, under resource packet
The resource packet of pth ageindex=4 can further be downloaded in advance by carrying module.
The memory headroom of client is limited, with the progress of user's page turning, resource packet can accumulate it is more and more, when long
Between run in the case of, need consider resource packet recycling.Otherwise, the memory headroom of client can be totally consumed and finish.Tool
Body as shown in step (6).
(6) resource packet download module deletes unwanted resource packet according to algorithm, and discharges the interior of resource packet occupancy
Deposit space.
Resource packet download module be equipped with resource packet management list, resource packet management list include identifier, download time, under
Load state, access times, last usage time and use state.
Resource packet download module can determine unwanted according to algorithm is not used at most recently from resource packet management list
Resource packet, and delete the resource packet." use " of resource packet download module resource packet refers to that browser is loaded with from resource packet
The content of one resource.
In conclusion benefit of the invention is:
1, resource, which is packaged, downloads
Primary time overhead will be connected by avoiding each resource
2, resource packet pre-download
When user's page turning, data directly are loaded from the resource packet of pre-download, are avoided with server
Connection, accelerates system response time, increases user experience.
3, resource assures reason and recycling
Using algorithm is not used at most recently, the risk that client memory headroom is depleted is avoided, ensure that simultaneously
The speed of neighbouring resource packet browsing.
The above is merely preferred embodiments of the present invention, be not intended to limit the invention, it is all the present invention spirit and
Within principle, any modification, equivalent replacement, improvement and so on should all be included in the protection scope of the present invention.
Claims (7)
1. a kind of method for managing resource, including client and server end, the client is equipped with resource packet download module and money
Source packet uses module, which is characterized in that includes the following steps:
(1) the resource packet sends resource access request using module to the resource packet download module;
(2) the resource packet download module judges whether to have existed the corresponding resource packet of resource access request, if so, will
Corresponding resource packet is sent to the resource packet and uses module;Otherwise, it enters step (3);
(3) the resource packet download module connects the server according to the resource access request, downloads corresponding resource packet
And it is sent to the resource packet and uses module;
(4) the resource packet parses the resource packet using module, and extracts the fileinfo in the resource packet;
(5) the resource packet download module is that identifier, and Connection Service device is arranged in the resource packet, downloads the resource packet phase
Adjacent resource packet;The server uses Pagination Display pattern, and the resource that each paging is included is packaged;The money
Include pageindex parameters in the uniform resource locator in source;
(6) the resource packet download module deletes unwanted resource packet according to algorithm, and discharges the interior of resource packet occupancy
Deposit space.
2. a kind of method for managing resource according to claim 1, which is characterized in that in step (3), the server is advance
Http resource is packaged to obtain corresponding resource packet.
3. a kind of method for managing resource according to claim 2, which is characterized in that the resource packaging method includes following
Step:
(a) establishment file list, the listed files are used to provide the routing information for being packaged resource;
(b) listed files is traversed, obtains and is packaged resource, statistics is packaged quantity, title, data length and the data content of resource;
(c) title and data for the quantity for being packaged resource being recorded in the resource packet header of the resource packet, and resource being packaged
The data content for being packaged resource is replicated in the resource information area of the resource packet in the resource of the resource packet by length records
Hold area;
(d) it is packaged according to the sequence in resource packet header, resource information area, resource content area.
4. a kind of method for managing resource according to claim 3, which is characterized in that the resource packet header further includes mark
Value, the first retention, version number, file generated time, the second retention and fixed value;
The ident value is to be packaged to generate by above-mentioned resource packaging method for identifying the resource packet;
First retention and second retention are used to edition upgrading or format expands;
The fixed value terminates for identifying the resource packet header.
5. a kind of method for managing resource according to claim 3, which is characterized in that the resource information area further includes data
Offset and check value.
6. according to claim 1,3,4 or a kind of method for managing resource of 5 any one of them, which is characterized in that institute in step (4)
It states resource packet and parses the resource packet using module and specifically include following steps:
(401) the resource packet header is obtained, the quantity for being packaged resource is obtained;
(402) title, data length, data offset and the check value of all packing resources in traversal resource information area, and carry
Take corresponding data content in the resource content area.
7. a kind of method for managing resource according to claim 1, which is characterized in that the resource packet download module is equipped with money
Source packet management list, the resource packet management list include identifier, download time, download state, access times, finally use
Time and use state.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510591390.9A CN105282238B (en) | 2015-09-16 | 2015-09-16 | A kind of method for managing resource |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510591390.9A CN105282238B (en) | 2015-09-16 | 2015-09-16 | A kind of method for managing resource |
Publications (2)
Publication Number | Publication Date |
---|---|
CN105282238A CN105282238A (en) | 2016-01-27 |
CN105282238B true CN105282238B (en) | 2018-11-13 |
Family
ID=55150543
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510591390.9A Active CN105282238B (en) | 2015-09-16 | 2015-09-16 | A kind of method for managing resource |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105282238B (en) |
Families Citing this family (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107026884A (en) * | 2016-02-02 | 2017-08-08 | 阿里巴巴集团控股有限公司 | Acquisition methods, client, server and the system of resource file |
CN109376002A (en) * | 2018-08-14 | 2019-02-22 | 广东格兰仕集团有限公司 | A kind of internal memory optimization control method based on oven control system |
CN111045698A (en) * | 2019-12-24 | 2020-04-21 | 五八有限公司 | Redundant picture deleting method and device, electronic equipment and storage medium |
CN112685613B (en) * | 2021-01-06 | 2022-10-25 | 青岛海尔科技有限公司 | Resource package query method and device and information processing system |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101465861A (en) * | 2009-01-16 | 2009-06-24 | 香港应用科技研究院有限公司 | System, method and computer programming product for transmitting and/or receiving medium current |
CN101963992A (en) * | 2010-10-20 | 2011-02-02 | 深圳市茁壮网络股份有限公司 | Method and browser for increasing webpage display speed |
CN102004781A (en) * | 2010-11-23 | 2011-04-06 | 北京酷我科技有限公司 | Method and system for acquiring website test data |
CN102694851A (en) * | 2012-05-17 | 2012-09-26 | 江苏中科梦兰电子科技有限公司 | Intelligentized distribution processing method for network files |
CN103685381A (en) * | 2012-09-12 | 2014-03-26 | 腾讯科技(深圳)有限公司 | Method, system and device for downloading webpage resources |
CN104360884A (en) * | 2014-11-18 | 2015-02-18 | 久邦计算机技术(广州)有限公司 | Plug-in resource packet loading method based on Android system |
CN104580267A (en) * | 2013-10-09 | 2015-04-29 | 北京奇虎科技有限公司 | A resource downloading method, device, server and corresponding system |
-
2015
- 2015-09-16 CN CN201510591390.9A patent/CN105282238B/en active Active
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101465861A (en) * | 2009-01-16 | 2009-06-24 | 香港应用科技研究院有限公司 | System, method and computer programming product for transmitting and/or receiving medium current |
CN101963992A (en) * | 2010-10-20 | 2011-02-02 | 深圳市茁壮网络股份有限公司 | Method and browser for increasing webpage display speed |
CN102004781A (en) * | 2010-11-23 | 2011-04-06 | 北京酷我科技有限公司 | Method and system for acquiring website test data |
CN102694851A (en) * | 2012-05-17 | 2012-09-26 | 江苏中科梦兰电子科技有限公司 | Intelligentized distribution processing method for network files |
CN103685381A (en) * | 2012-09-12 | 2014-03-26 | 腾讯科技(深圳)有限公司 | Method, system and device for downloading webpage resources |
CN104580267A (en) * | 2013-10-09 | 2015-04-29 | 北京奇虎科技有限公司 | A resource downloading method, device, server and corresponding system |
CN104360884A (en) * | 2014-11-18 | 2015-02-18 | 久邦计算机技术(广州)有限公司 | Plug-in resource packet loading method based on Android system |
Also Published As
Publication number | Publication date |
---|---|
CN105282238A (en) | 2016-01-27 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104063460B (en) | A kind of method and apparatus loading webpage in a browser | |
CN105095280A (en) | Caching method and apparatus for browser | |
CN105282238B (en) | A kind of method for managing resource | |
US20060294396A1 (en) | Multiplatform synchronized data access from mobile devices of dynamically aggregated content | |
CN102737116A (en) | Method and device for storing webpage resources | |
CN106294648A (en) | A kind of processing method and processing device for page access path | |
CN103810176A (en) | Pre-fetching accessing method and device of webpage information | |
CN107545058B (en) | A kind of page loading method, server and browser | |
CN105787091B (en) | Support the content delivering system and method for multiple terminals | |
CN107463657B (en) | File operation method and terminal | |
EP2399209A1 (en) | Content access platform and methods and apparatus providing access to internet content for heterogeneous devices | |
RU2316131C2 (en) | Method for storing pages in memory of mobile device (variants) and mobile device for realization of the method | |
CN102880679B (en) | A kind of info web storage means and device | |
WO2013175560A1 (en) | Information communicating system and information converting method | |
CN105068802A (en) | Cross device running Web application software implementation system and method | |
CN106557584A (en) | A kind of web site collection method and device | |
CN101770511B (en) | Browse system for accelerating backspace operation of mobile communication equipment terminal and application method thereof | |
CN102955852A (en) | Method, device and equipment for webpage resource processing | |
KR20120122959A (en) | Method and Device for Collecting Web Contents and Computer-readable Recording Medium for the same | |
JP2004287978A (en) | Method and program for dividing structured document | |
CN103312736B (en) | Web page processing method and system and proxy server | |
CN105677688A (en) | Page data loading method and system | |
CN102694802B (en) | Network access information recording method and device | |
US20120254728A1 (en) | Content acquiring method and client terminal | |
JP5245629B2 (en) | Relay device, communication relay method, program thereof, and relay system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |