CN107528825A - A kind of resource downloading method, terminal and computer-readable recording medium - Google Patents
A kind of resource downloading method, terminal and computer-readable recording medium Download PDFInfo
- Publication number
- CN107528825A CN107528825A CN201710548091.6A CN201710548091A CN107528825A CN 107528825 A CN107528825 A CN 107528825A CN 201710548091 A CN201710548091 A CN 201710548091A CN 107528825 A CN107528825 A CN 107528825A
- Authority
- CN
- China
- Prior art keywords
- address
- downloaded
- resources
- read
- source
- 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.)
- Pending
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/12—Applying verification of the received information
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L61/00—Network arrangements, protocols or services for addressing or naming
- H04L61/45—Network directories; Name-to-address mapping
- H04L61/4505—Network directories; Name-to-address mapping using standardised directories; using standardised directory access protocols
- H04L61/4511—Network directories; Name-to-address mapping using standardised directories; using standardised directory access protocols using domain name system [DNS]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/02—Network architectures or network communication protocols for network security for separating internal from external traffic, e.g. firewalls
- H04L63/0227—Filtering policies
- H04L63/0236—Filtering by address, protocol, port number or service, e.g. IP-address or URL
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/12—Applying verification of the received information
- H04L63/126—Applying verification of the received information the source of the received data
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/14—Network architectures or network communication protocols for network security for detecting or protecting against malicious traffic
- H04L63/1441—Countermeasures against malicious traffic
- H04L63/1466—Active attacks involving interception, injection, modification, spoofing of data unit addresses, e.g. hijacking, packet injection or TCP sequence number attacks
-
- 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]
-
- 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/50—Network services
- H04L67/56—Provisioning of proxy services
- H04L67/568—Storing data temporarily at an intermediate stage, e.g. caching
Landscapes
- Engineering & Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer Hardware Design (AREA)
- Computing Systems (AREA)
- General Engineering & Computer Science (AREA)
- Information Transfer Between Computers (AREA)
Abstract
The invention discloses a kind of resource downloading method,Terminal and computer-readable recording medium,By obtaining resources to be downloaded corresponding source download address and corresponding distribution download address on caching server on source server,Source download address and distribution download address according to getting read the data resource in resources to be downloaded same position respectively and are compared from source server and caching server,Then judged whether to download the resources to be downloaded from caching server according to comparative result,Namely in this programme before the resources to be downloaded are downloaded from caching server,Can identifies whether the resources to be downloaded are reliable in advance,So as to handle in advance the resources to be downloaded,Because this programme need not get off the complete file download of resources to be downloaded with regard to that can judge whether the resources to be downloaded are reliable,So as to save the time of user,Save the occupancy of bandwidth,Improve the satisfaction of Consumer's Experience.
Description
Technical field
The present invention relates to communication technical field, more particularly to a kind of resource downloading method, terminal and computer-readable storage
Medium.
Background technology
In existing communication system, smart machine and traditional computer when downloading file are provided by service provider
Locating resource is carried out in address to URL (Uniform Resource Locator, URL), but is driven by interests,
It is likely to cause user please in unsafe public network or in the case that router device is invaded by rogue program
Ask intercepted, for example, when user clicks on a download link by terminal, invasion side may be in terminal by download link pair
During the domain name answered is converted to IP address, the IP (Internet of user access resources are replaced using the abduction of domain name
Protocol, Internet protocol) address, in other words, invasion side may modify correct resource reference address, this
Sample, the resource that user is downloaded to by resource reference address are probably harmful resource to be not the desired money of user
Source, so needing means to confirm the reliability of resource downloading.
For resource downloading, because the bandwidth of its occupancy is more, concurrent request is high, so generally larger money
Source ISP can improve the download of user by CDN (Content Delivery Network, content distributing network)
Performance, specifically some caching servers are distributed in area or the network that user accesses Relatively centralized, in source station
Content is buffered in these caching servers, and when user accesses website, the access of user is pointed into closest work
On normal caching server, asked by caching server directly in response to user, whether resource downloading reliably then transfers to CDN service
Provider that is to say to ensure and transfer to caching server to ensure.And in general (invader is by correct resource for Domain Hijacking
The process that reference address is modified) all it is just to be had occurred that before resource access request not yet reaches caching server,
Do not gone to control by the quality of CDN service, so still needing means to confirm resource while with CDN or similar service
Reliability.It is typically all after complete resource file is downloaded in existing scheme, passes through similar MD5 (Message
Digest Algorithm MD5, eap-message digest the 5th edition) algorithm calculate the unique value of whole resource file, and same source station
In value corresponding to the resource file contrasted.Although this scheme can define the validity of resource, poor-performing both consumed
Having taken the time also takes up user bandwidth, it is impossible to carries out the identification of resource reliability as early as possible, resource is just able to verify that after the completion of download
Whether abnormal, Consumer's Experience is bad.
The content of the invention
The technical problem to be solved in the present invention is:It can only be finished complete resource file is downloaded in the prior art
Afterwards, the reliability of the resource file could be verified, causes the reliability of the resource file can not be identified as early as possible,
Cause to lose time, take user bandwidth, the problem of Consumer's Experience is bad.
In order to solve the above technical problems, the present invention provides a kind of resource downloading method, including:
Obtain resources to be downloaded corresponding source download address and corresponding distribution on caching server on source server
Download address;
According to the source download address and the distribution download address respectively from the source server and the buffer service
The data resource in the resources to be downloaded same position is read on device;Read from the source server and the caching server
The data resource taken is a part of data resource of the resources to be downloaded;
The number in resources to be downloaded same position that will be read respectively from the source server and the caching server
It is compared according to resource;
Judged whether to download the resources to be downloaded from the caching server according to comparative result.
Further, the data resource by the resources to be downloaded same position read respectively be compared including:
Data money in the resources to be downloaded same position that will be read from the source server and the caching server
Source contents are compared;
Or,
According to the default checking algorithm money to be downloaded to being read from the source server and the caching server respectively
Data resource in the same position of source carries out that check value is calculated, and the check value being calculated is compared.
Further, it is described according to the source download address and the distribution download address respectively from the source server and
Include before the data resource in the resources to be downloaded same position is read on the caching server:
The size of the resources to be downloaded is obtained from the source server according to the source download address, and according to described
The size of resources to be downloaded determines to be used for the portion for indicating the resources to be downloaded on the source server and the caching server
The reading address that divided data resource is read, the size of the resources to be downloaded are more than data resource corresponding to the reading address
Size;
Or,
First address and the tail address of the resources to be downloaded are obtained from the source server according to the source download address,
According to the first address and the tail address determine on the source server and the caching server be used for indicate described in treat down
Carry the reading address that the partial data resource of resource is read, the reading address between the first address and the tail address it
Between.
Further, it is described according to the source download address and the distribution when it is determined that reading address including at least 2
Download address reads the number in the resources to be downloaded same position from the source server and the caching server respectively
According to resource, and by the data resource in the resources to be downloaded same position read respectively be compared including:
Selection one reads address as target from the reading address;
The resources to be downloaded same target is read from the source server and the caching server respectively and reads ground
Data resource on location;
The target read is read into the data resource on address to be compared, and selected from remaining reading address
One is selected as new target and reads address, and according to the new target read address carry out the reading of data resource with than
Compared with until being read according to all reading addresses from the source server and the caching server and completeer same position
On data resource.
Further, the data resource that the target read is read on address also wraps after being compared
Include:
The resources to be downloaded same target for judging to read from the source server and the caching server reads address
On data resource it is whether consistent, in this way, selection one reads address as new target from remaining reading address again,
Otherwise, stop selecting new target to read address from remaining reading address.
Further, it is described to be judged whether to download the resources to be downloaded from the caching server according to comparative result
Including:
Exist in the comparative result data resource that is read from the source server with from the caching server
During the inconsistent comparative result of data resource in the same position of middle reading, judge that the distribution download address is invalid, otherwise,
Judge to download the resources to be downloaded from the caching server according to the distribution download address.
Further, it is described that the resources to be downloaded are downloaded from the caching server according to the distribution download address
Including:
To the number in the resources to be downloaded on the caching server in addition to data resource corresponding to the same position
It is downloaded according to resource.
Further, methods described be additionally included in judge it is described distribution download address it is invalid when, according to the source download ground
The resources to be downloaded are downloaded from the source server in location.
Further, the present invention also provides a kind of terminal, and the terminal includes:Processor, memory and it is stored in described
On memory and the resource downloading program that can run on the processor, the resource downloading program is by the computing device
Shi Shixian as described above any resource downloading method the step of.
Further, it is described computer-readable to be stored with money present invention also offers a kind of computer-readable recording medium
Source downloads, and the resource downloading program realizes the step of any one resource downloading method as described above when being performed
Suddenly.
Beneficial effect
Resource downloading method, terminal and computer-readable recording medium proposed by the present invention, by obtaining resources to be downloaded
Corresponding source download address and the corresponding distribution download address on caching server on source server, according to the source got
Download address and distribution download address are read in resources to be downloaded same position from source server and caching server respectively
Data resource, the data resource in the resources to be downloaded same position read respectively from source server and caching server is entered
Row compares, and the data resource read from source server and caching server is a part of data resource of the resources to be downloaded,
Then judged whether to download the resources to be downloaded from caching server according to comparative result, namely above and below caching server
Before carrying the resources to be downloaded, the number in the resources to be downloaded same position will be read from caching server and source server
According to resource and it is compared, so as to identify whether resource is reliable before the resources to be downloaded are downloaded, compared to existing skill
Need to get off the complete file download of the resources to be downloaded for the scheme for carrying out reliability verification in art, this programme is due to can
To identify whether the resources to be downloaded are reliable in advance, so as to handle in advance the resources to be downloaded, and due to
This programme need not get off the complete file download of resources to be downloaded with regard to that can judge whether the resources to be downloaded are reliable, so as to
Save the time of user, save the occupancy of bandwidth, improve the satisfaction of Consumer's Experience.
Brief description of the drawings
Fig. 1 is the hardware architecture diagram for realizing each optional mobile terminal of embodiment one of the present invention;
Fig. 2 is the communications network system framework map of the mobile terminal shown in Fig. 1;
Fig. 3 is the schematic flow sheet of resource downloading method in first embodiment of the invention;
Fig. 4 is the first pass schematic diagram that address is read in generation in first embodiment of the invention;
Fig. 5 is the second procedure schematic diagram that address is read in generation in first embodiment of the invention;
Fig. 6 is the schematic flow sheet for the data resource for comparing reading in first embodiment of the invention;
Fig. 7 is the schematic flow sheet of resource downloading method in second embodiment of the invention;
Fig. 8 is the structural representation of terminal in third embodiment of the invention;
Fig. 9 is the structural representation of terminal in fourth embodiment of the invention.
Embodiment
It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, it is not intended to limit the present invention.
In follow-up description, the suffix using such as " module ", " part " or " unit " for representing element is only
Be advantageous to the explanation of the present invention, itself there is no a specific meaning.Therefore, " module ", " part " or " unit " can mix
Ground uses.
Terminal can be implemented in a variety of manners.For example, the terminal described in the present invention can include such as mobile phone, flat board
Computer, notebook computer, palm PC, personal digital assistant (Personal Digital Assistant, PDA), portable
Media player (Portable Media Player, PMP), guider, wearable device, Intelligent bracelet, pedometer etc. move
Dynamic terminal, and the fixed terminal such as digital TV, desktop computer.
It will be illustrated in subsequent descriptions by taking mobile terminal as an example, it will be appreciated by those skilled in the art that except special
Outside element for moving purpose, construction according to the embodiment of the present invention can also apply to the terminal of fixed type.
Referring to Fig. 1, its hardware architecture diagram for a kind of mobile terminal of each embodiment of the realization present invention, the shifting
Dynamic terminal 100 can include:RF (Radio Frequency, radio frequency) unit 101, WiFi module 102, audio output unit
103rd, A/V (audio/video) input block 104, sensor 105, display unit 106, user input unit 107, interface unit
108th, the part such as memory 109, processor 110 and power supply 111.It will be understood by those skilled in the art that shown in Fig. 1
Mobile terminal structure does not form the restriction to mobile terminal, and mobile terminal can be included than illustrating more or less parts,
Either combine some parts or different parts arrangement.
The all parts of mobile terminal are specifically introduced with reference to Fig. 1:
Radio frequency unit 101 can be used for receiving and sending messages or communication process in, the reception and transmission of signal, specifically, by base station
Downlink information receive after, handled to processor 110;In addition, up data are sent to base station.Generally, radio frequency unit 101
Including but not limited to antenna, at least one amplifier, transceiver, coupler, low-noise amplifier, duplexer etc..In addition, penetrate
Frequency unit 101 can also be communicated by radio communication with network and other equipment.Above-mentioned radio communication can use any communication
Standard or agreement, including but not limited to GSM (Global System of Mobile communication, global system for mobile telecommunications
System), GPRS (General Packet Radio Service, general packet radio service), CDMA2000 (Code
Division Multiple Access 2000, CDMA 2000), WCDMA (Wideband Code Division
Multiple Access, WCDMA), TD-SCDMA (Time Division-Synchronous Code
Division Multiple Access, TD SDMA), FDD-LTE (Frequency Division
Duplexing-Long Term Evolution, FDD Long Term Evolution) and TDD-LTE (Time Division
Duplexing-Long Term Evolution, time division duplex Long Term Evolution) etc..
WiFi belongs to short range wireless transmission technology, and mobile terminal can help user to receive and dispatch electricity by WiFi module 102
Sub- mail, browse webpage and access streaming video etc., it has provided the user wireless broadband internet and accessed.Although Fig. 1 shows
Go out WiFi module 102, but it is understood that, it is simultaneously not belonging to must be configured into for mobile terminal, completely can be according to need
To be omitted in the essential scope for do not change invention.
Audio output unit 103 can be in call signal reception pattern, call mode, record mould in mobile terminal 100
When under the isotypes such as formula, speech recognition mode, broadcast reception mode, by radio frequency unit 101 or WiFi module 102 it is receiving or
It is sound that the voice data stored in memory 109, which is converted into audio signal and exported,.Moreover, audio output unit 103
The audio output related to the specific function that mobile terminal 100 performs can also be provided (for example, call signal receives sound, disappeared
Breath receives sound etc.).Audio output unit 103 can include loudspeaker, buzzer etc..
A/V input blocks 104 are used to receive audio or video signal.A/V input blocks 104 can include graphics processor
(Graphics Processing Unit, GPU) 1041 and microphone 1042, graphics processor 1041 is in video acquisition mode
Or the static images or the view data of video obtained in image capture mode by image capture apparatus (such as camera) are carried out
Reason.Picture frame after processing may be displayed on display unit 106.Picture frame after the processing of graphics processor 1041 can be deposited
Storage is transmitted in memory 109 (or other storage mediums) or via radio frequency unit 101 or WiFi module 102.Mike
Wind 1042 can connect in telephone calling model, logging mode, speech recognition mode etc. operational mode via microphone 1042
Quiet down sound (voice data), and can be voice data by such acoustic processing.Audio (voice) data after processing can
To be converted to the form output that mobile communication base station can be sent to via radio frequency unit 101 in the case of telephone calling model.
Microphone 1042 can implement various types of noises and eliminate (or suppression) algorithm to eliminate (or suppression) in reception and send sound
Caused noise or interference during frequency signal.
Mobile terminal 100 also includes at least one sensor 105, such as optical sensor, motion sensor and other biographies
Sensor.Specifically, optical sensor includes ambient light sensor and proximity transducer, wherein, ambient light sensor can be according to environment
The light and shade of light adjusts the brightness of display panel 1061, and proximity transducer can close when mobile terminal 100 is moved in one's ear
Display panel 1061 and/or backlight.As one kind of motion sensor, accelerometer sensor can detect in all directions (general
For three axles) size of acceleration, size and the direction of gravity are can detect that when static, the application available for identification mobile phone posture
(such as horizontal/vertical screen switching, dependent game, magnetometer pose calibrating), Vibration identification correlation function (such as pedometer, percussion) etc.;
The fingerprint sensor that can also configure as mobile phone, pressure sensor, iris sensor, molecule sensor, gyroscope, barometer,
The other sensors such as hygrometer, thermometer, infrared ray sensor, will not be repeated here.
Display unit 106 is used for the information for showing the information inputted by user or being supplied to user.Display unit 106 can wrap
Display panel 1061 is included, liquid crystal display (Liquid Crystal Display, LCD), Organic Light Emitting Diode can be used
Forms such as (Organic Light-Emitting Diode, OLED) configures display panel 1061.
User input unit 107 can be used for the numeral or character information for receiving input, and produce the use with mobile terminal
The key signals input that family is set and function control is relevant.Specifically, user input unit 107 may include contact panel 1071 with
And other input equipments 1072.Contact panel 1071, also referred to as touch-screen, collect touch operation of the user on or near it
(for example user uses any suitable objects or annex such as finger, stylus on contact panel 1071 or in contact panel 1071
Neighbouring operation), and corresponding attachment means are driven according to formula set in advance.Contact panel 1071 may include touch detection
Two parts of device and touch controller.Wherein, the touch orientation of touch detecting apparatus detection user, and detect touch operation band
The signal come, transmits a signal to touch controller;Touch controller receives touch information from touch detecting apparatus, and by it
Contact coordinate is converted into, then gives processor 110, and the order sent of reception processing device 110 and can be performed.In addition, can
To realize contact panel 1071 using polytypes such as resistance-type, condenser type, infrared ray and surface acoustic waves.Except contact panel
1071, user input unit 107 can also include other input equipments 1072.Specifically, other input equipments 1072 can wrap
Include but be not limited to physical keyboard, in function key (such as volume control button, switch key etc.), trace ball, mouse, action bars etc.
One or more, do not limit herein specifically.
Further, contact panel 1071 can cover display panel 1061, detect thereon when contact panel 1071 or
After neighbouring touch operation, processor 110 is sent to determine the type of touch event, is followed by subsequent processing device 110 according to touch thing
The type of part provides corresponding visual output on display panel 1061.Although in Fig. 1, contact panel 1071 and display panel
1061 be the part independent as two to realize the input of mobile terminal and output function, but in certain embodiments, can
Input and the output function of mobile terminal are realized so that contact panel 1071 and display panel 1061 is integrated, is not done herein specifically
Limit.
Interface unit 108 is connected the interface that can pass through as at least one external device (ED) with mobile terminal 100.For example,
External device (ED) can include wired or wireless head-band earphone port, external power source (or battery charger) port, wired or nothing
Line FPDP, memory card port, the port for connecting the device with identification module, audio input/output (I/O) end
Mouth, video i/o port, ear port etc..Interface unit 108 can be used for receiving the input from external device (ED) (for example, number
It is believed that breath, electric power etc.) and the input received is transferred to one or more elements in mobile terminal 100 or can be with
For transmitting data between mobile terminal 100 and external device (ED).
Memory 109 can be used for storage software program and various data.Memory 109 can mainly include storing program area
And storage data field, wherein, storing program area can storage program area, application program (such as the sound needed at least one function
Sound playing function, image player function etc.) etc.;Storage data field can store according to mobile phone use created data (such as
Voice data, phone directory etc.) etc..In addition, memory 109 can include high-speed random access memory, can also include non-easy
The property lost memory, a for example, at least disk memory, flush memory device or other volatile solid-state parts.
Processor 110 is the control centre of mobile terminal, utilizes each of various interfaces and the whole mobile terminal of connection
Individual part, by running or performing the software program and/or module that are stored in memory 109, and call and be stored in storage
Data in device 109, the various functions and processing data of mobile terminal are performed, so as to carry out integral monitoring to mobile terminal.Place
Reason device 110 may include one or more processing units;Preferably, processor 110 can integrate application processor and modulatedemodulate is mediated
Device is managed, wherein, application processor mainly handles operating system, user interface and application program etc., and modem processor is main
Handle radio communication.It is understood that above-mentioned modem processor can not also be integrated into processor 110.
Mobile terminal 100 can also include the power supply 111 (such as battery) to all parts power supply, it is preferred that power supply 111
Can be logically contiguous by power-supply management system and processor 110, so as to realize management charging by power-supply management system, put
The function such as electricity and power managed.
Although Fig. 1 is not shown, mobile terminal 100 can also will not be repeated here including bluetooth module etc..
For the ease of understanding the embodiment of the present invention, the communications network system being based on below to the mobile terminal of the present invention enters
Row description.
Referring to Fig. 2, Fig. 2 is a kind of communications network system Organization Chart provided in an embodiment of the present invention, the communication network system
Unite as the LTE system of universal mobile communications technology, the UE that the LTE system includes communicating connection successively (User Equipment, is used
Family equipment) 201, E-UTRAN (Evolved UMTS Terrestrial Radio Access Network, evolved UMTS lands
Ground wireless access network) 202, EPC (Evolved Packet Core, evolved packet-based core networks) 203 and operator IP operation
204。
Specifically, UE201 can be above-mentioned terminal 100, and here is omitted.
E-UTRAN202 includes eNodeB2021 and other eNodeB2022 etc..Wherein, eNodeB2021 can be by returning
Journey (backhaul) (such as X2 interface) is connected with other eNodeB2022, and eNodeB2021 is connected to EPC203,
ENodeB2021 can provide UE201 to EPC203 access.
EPC203 can include MME (Mobility Management Entity, mobility management entity) 2031, HSS
(Home Subscriber Server, home subscriber server) 2032, other MME2033, SGW (Serving Gate Way,
Gateway) 2034, PGW (PDN Gate Way, grouped data network gateway) 2035 and PCRF (Policy and
Charging Rules Function, policy and rate functional entity) 2036 etc..Wherein, MME2031 be processing UE201 and
The control node of signaling between EPC203, there is provided carrying and connection management.HSS2032 is all to manage for providing some registers
Such as the function of attaching position register (not shown) etc, and preserve some and used about service features, data rate etc.
The special information in family.All customer data can be transmitted by SGW2034, and PGW2035 can provide UE 201 IP
Address is distributed and other functions, and PCRF2036 is strategy and the charging control strategic decision-making of business data flow and IP bearing resources
Point, it selects and provided available strategy and charging control decision-making with charge execution function unit (not shown) for strategy.
IP operation 204 can include internet, Intranet, IMS (IP Multimedia Subsystem, IP multimedia
System) or other IP operations etc..
Although above-mentioned be described by taking LTE system as an example, those skilled in the art it is to be understood that the present invention not only
Suitable for LTE system, be readily applicable to other wireless communication systems, such as GSM, CDMA2000, WCDMA, TD-SCDMA with
And following new network system etc., do not limit herein.
Based on above-mentioned mobile terminal hardware configuration and communications network system, each embodiment of the inventive method is proposed.
First embodiment
In order to solve in the prior art can only by complete resource file download finish after, could be to the resource file
Reliability verified, cause the reliability of the resource file can not be identified as early as possible, cause to lose time, take use
Family bandwidth, the problem of Consumer's Experience is bad, the present embodiment provides a kind of resource downloading method, shown in Figure 3, including:
S301:Obtain resources to be downloaded on source server corresponding source download address and on caching server corresponding to
Distribute download address.
It should be appreciated that the source server in the present embodiment refers to the origin server of the resources to be downloaded, that is to say
The server of the original storage resources to be downloaded, and caching server refers to the server for caching the resources to be downloaded, caching clothes
Business device can obtain the download resource from source server, and the resources to be downloaded are preserved, generally, for a net
For network system, user access Relatively centralized area or node in be all distributed with caching server, the money in source server
Source can be cached in caching server, during a certain by the terminal downloads resources to be downloaded of such user, just do not have to take from source
The resources to be downloaded are accessed in business device, but directly can be downloaded nearby from caching server, can so save access money
The time in source, therefore, for step S301, the resources to be downloaded are all stored with source server and caching server.
In order to preferably be understood, illustrated here so that user is by terminal downloads " QQ applications " as an example, Yong Hu
QQ applications download link therein is clicked on after a certain network address is opened in terminal, at this moment source server and caching server can be to
Terminal return store the QQ application domain name addresses, terminal carried out after the two domain name addresses are received domain name mapping by this two
Individual domain name addresses is converted into IP address, and it is right respectively on source server and caching server that the two IP address that is to say that QQ applies
The source download address and distribution download address answered.
S302:Read respectively from source server and caching server according to the source download address of acquisition and distribution download address
Take the data resource in the resources to be downloaded same position.
The data resource read in step S302 from source server and caching server is one of the resources to be downloaded
Divided data resource, it that is to say and do not read the complete file of resources to be downloaded, but have read the one of resources to be downloaded
Partial data resource.
It should be noted that can be from random read take resources to be downloaded on source server and caching server in the present embodiment
Partial data resource, as long as ensureing that the data resource that is read from source server and the data read from caching server provide
Source is the data resource belonged in the resources to be downloaded same position.
S303:Data in the resources to be downloaded same position read respectively from source server and caching server are provided
Source is compared.
For step S303, manner of comparison therein can specifically include:
Mode one:By the data resource in the resources to be downloaded same position read from source server and caching server
Content be compared, that is to say and binary system comparison is carried out to the content of reading;
Or,
Mode two:According to default checking algorithm resources to be downloaded to being read from source server and caching server respectively
Data resource in same position carries out that check value is calculated, and the check value being calculated is compared, school therein
Checking method can be the arbitrary checking algorithm set by developer, for example, it may be MD5 algorithms.
In certain embodiments, can be in combination with two kinds of above-mentioned ratios if multiple discontinuous same positions be present
It is compared compared with mode.For example, work as according to source download address and distribution download address respectively from source server and caching server
On when have read the data resource on the resources to be downloaded location A and B location, can be to being treated on source server and caching server
The comparison that corresponding data resource on resource location A carries out data resource using aforesaid way one is downloaded, source server is eased up
Deposit the comparison that corresponding data resource uses aforesaid way two to carry out data resource on resources to be downloaded B location on server.
S304:Judged whether to download the resources to be downloaded from caching server according to comparative result.
In certain embodiments, specifically may refer to shown in Fig. 4, according to source download address and distribution download address difference
It can also include such as before the data resource in the resources to be downloaded same position is read from source server and caching server
Lower step:
S401:The size of resources to be downloaded is obtained from source server according to source download address.
S402:Determine to be used to indicate the money to be downloaded on source server and caching server according to the size of resources to be downloaded
The reading address that the partial data resource in source is read.
It should be noted that the reading address in the present embodiment can generate at random, as long as ensureing the resources to be downloaded
Size is more than the size for reading data resource corresponding to address, if for example, the size of resources to be downloaded is 2MB, reads
The size of data resource indicated by address should be less than 2MB.After determining and reading address, could according to source download address and
Distribution download address respectively from source server with read on caching server the resources to be downloaded it is identical read address on data
Resource is simultaneously compared.
It should be noted that a reading address can only correspond to a data in the present embodiment, now, in step S402
Continuous reading address can be included in the reading address of determination, discrete reading address can also be included, for purposes of illustration only, this
In will continuously read address and be referred to as a reading group of addresses, namely one is read in group of addresses and continuous reads ground comprising multiple
Location, when determining multiple reading group of addresses, each size for reading data resource corresponding to group of addresses can with different,
It is the reading address that varying number can be included in different reading group of addresses, for example, when the size of resources to be downloaded is 2MB
When, multiple reading addresses can be generated at random, wherein it is possible to read address and discrete reading address including continuous, it is assumed that
Random to generate 3 and read group of addresses, it is necessary to explanation, it can be interruption that this 3, which are read between group of addresses, at this moment this 3
The size of data resource corresponding to individual reading group of addresses can be respectively 10KB, 50KB, 100KB, it is necessary to explanation, now without
By the comparison that data resource is carried out using which kind of above-mentioned mode, it can read and treat from source server and caching server respectively
3 groups of data resources in 3 same positions of resource are downloaded, this 3 groups of data resources have corresponded to 10KB data, 50KB number respectively
According to the data with 100KB, illustrate so that the size of one group of data resource is 10KB as an example, now enter according to aforesaid way one
Row compare, then can respectively from source server and caching server by 10KB data contents read after, then will respectively from
Each data content in this 10KB data content read on source server and caching server is compared respectively, Huo Zheye
The comparison of data can be carried out during this 10KB data content is read;Now it is compared according to aforesaid way two,
Then can be after 10KB data contents be read from source server and caching server, then use default checking algorithm pair
The 10KB data contents read from source server be calculated check value, and to being read from caching server
10KB data contents carry out that check value is calculated, and obtain two check values are compared.
Of course, can be that is to say in advance with the pre-set continuous quantity for reading address in certain embodiments
The length what a reads group of addresses is set, for example, it can be set to 1/20 for resources to be downloaded size, at this moment, it can give birth at random
Into multiple reading group of addresses, likewise, can also be interruption between this multiple reading group of addresses, wherein, each read address
The size of data resource corresponding to group can all be 0.1MB, such as, 4 can be generated and read group of addresses, it is necessary to illustrate,
At this moment data resource corresponding to this 4 reading group of addresses can be with non-overlapping copies, can also an overlapping part.
It should be appreciated that one is read address and can also correspond to one piece of data, now the reading address is also the section
The first address of data, while need to generate the offset for reading address according to the size of resources to be downloaded, the offset indicates
How many data can be read since first address, now, in order to from resources to be downloaded phase on source server and caching server
Data are read on same position, it is used to indicate that the reading address of digital independent not only to need identical, its corresponding offset
It should also be as identical.
In some other embodiment, specifically it may refer to shown in Fig. 5, according to source download address and distribution download address
It can also be wrapped before reading the data resource in the resources to be downloaded same position from source server and caching server respectively
Include following steps:
S501:First address and the tail address of the resources to be downloaded are obtained from source server according to source download address.
S502:Determine to be used to indicate the resources to be downloaded portion on source server and buffer service according to first address and tail address
The reading address that divided data resource is read.
Wherein, reading address can be between first address and tail address, certainly, and reading address can also treat down including this
The first address or tail address, the data resource at this moment read from source server and caching server for carrying resource also include this
Data resource corresponding to the first address of resources to be downloaded or tail address.For example, the first address and tail of resources to be downloaded
Location is p and p+n respectively, at this moment can also may be used certainly using address corresponding to p to the optional position between p+n as address is read
So that p and p+n as address is read, to be of coursed, the size of data resource should also be as to be downloaded less than this corresponding to reading address
The size of resource.
In the present embodiment, determine comprise at least two read address when, can according to the reading address determined from
Corresponding data resource is read to finish on source server and caching server and is compared again afterwards;Or can also every basis
One is read address and read after its corresponding data resource with regard to the comparison of progress data resource, specifically may refer to Fig. 6 institutes
Show, including:
S61:From selection one in address is read address is read as target.
S62:The resources to be downloaded same target is read from source server and caching server respectively to read on address
Data resource.
S63:The target read is read into the data resource on address to be compared.
S64:The new target of selection one reads address from remaining reading address, and reads ground according to the new target
Location carries out the reading of data resource compared with, untill according to all reading address readings and completeer data resource.
Of course, for step S63, gone back after the target read is read the data resource on address be compared
It can include:
The resources to be downloaded same target for judging to read from source server and caching server reads the data on address
Whether resource is consistent, and in this way, selection one reads address as new target from remaining reading address again, otherwise, stops
Only new target is selected to read address from remaining reading address.
Specifically, can include in above-mentioned steps S304:The number read from source server in comparative result be present
During this result inconsistent with data resource in the same position that reads from caching server according to resource, point obtained is judged
It is invalid to give set address, otherwise, it is determined that downloading the resources to be downloaded from caching server according to the distribution download address.Institute
If the data resource read from the target reading group of addresses on source server and caching server is inconsistent, to stop
While selecting the new target to read address from remaining reading address, can also judge the distribution download address that obtains without
Effect.
It should be noted that due to have read money to be downloaded from source server and caching server in the present embodiment
Data resource in a part of same position in source, therefore be somebody's turn to do judging to be downloaded from caching server according to distribution download address
During resources to be downloaded, the data money removed in resources to be downloaded beyond data resource corresponding to the same position can be only downloaded
Source, download time so can be saved, save user bandwidth.
Of course, in certain embodiments, judge distribution download address it is invalid when, can also according to source download address from
The resources to be downloaded are downloaded on source server, certainly, it is corresponding now can also only to download removing same position in resources to be downloaded
Data resource beyond data resource;Or user's download request can also be prompted invalid, such user can click on again
Download link, so as to assign new download request.
The resource downloading method that the present embodiment provides, due to can be before resources to be downloaded are downloaded, according to what is got
Source download address and distribution download address are enterprising from the same position of resources to be downloaded on source server and caching server respectively
The reading of row data resource is compared with, if there is a situation where, comparative result is inconsistent, illustrates that distributing download address may be robbed
Hold, if comparative result is completely the same, illustrate that the distribution download address may not be held as a hostage, namely provide by the present embodiment
Scheme, can just identify whether the resource reliable before resources to be downloaded are downloaded, so as to sentence according to recognition result
It is disconnected whether the resource to be downloaded, bandwidth resources are not only saved, can also avoid user that some are useless or even harmful
Resource downloading is got off, and improves the satisfaction of Consumer's Experience.
Second embodiment
In order to be better understood from the present invention, the present embodiment provides a kind of more specifically money on the basis of first embodiment
Source method for down loading, it is shown in Figure 7, including:
S701:Obtain resources to be downloaded on source server corresponding source download address and on caching server corresponding to
Distribute download address.
The download request that terminal is issued by user can get resources to be downloaded in source server and caching server
Source download address corresponding to upper difference and distribution download address.User issues download request often by download link is clicked on,
Each download link can correspond to a resources to be downloaded, and in addition, in the download link can also include source services
The information of the source domain name addresses of the resources to be downloaded is stored on device, and the distribution domain of the resources to be downloaded is stored on caching server
The information of name address, namely following information can be included in download link:Resources to be downloaded, and the resources to be downloaded respectively with
Mapping relations between source domain name addresses and distribution domain name addresses, that is to say the download request issued by user, terminal is first
The source domain name addresses and distribution domain name addresses of the resources to be downloaded can be got, then terminal can will get source domain name addresses
Domain name addresses is carried out to the conversion of IP address with distribution domain name addresses, obtains the resources to be downloaded respectively in source server and caching
Source download address and distribution download address on server.
S702:The size of resources to be downloaded is obtained from source server according to source download address.
S703:Determine to be used to indicate the money to be downloaded on source server and caching server according to the size of resources to be downloaded
The reading address that the partial data resource in source is read.
Assuming that generating multiple reading addresses in the present embodiment at random, and address is read including continuous, for purposes of illustration only,
Here it will continuously read address and be referred to as a reading group of addresses, namely one is read in group of addresses comprising multiple continuous readings
Address, assume in the present embodiment to generate three reading group of addresses, in actual applications, reading group of addresses can be with offset address
Form embody, one is assumed in the present embodiment, and to read group of addresses be also an offset address, if resources to be downloaded is big
Small is 1M, namely 1048576 bytes, then the size of data resource corresponding to an offset address should be less than 1048576 bytes,
Assuming that three offset address in the present embodiment correspond to the data resource of 64 bytes, 128 bytes and 256 bytes respectively.Need
Illustrate, in certain embodiments, the size of data resource corresponding to these three offset address can be with identical, in the present embodiment
Three offset address of generation can be collectively stored in a set of offsets, when reading data every time just from the set of offsets
Offset address is chosen to be read out
S704:An offset address is chosen from set of offsets as target offset address.
Due to including three different offset address in the present embodiment, therefore it can therefrom randomly select one and be used as target
Offset address, the choosing of target offset address can also be carried out by the descending or ascending order of the length of offset address
Take, after a certain offset address is chosen for into target offset address, can delete the offset address from set of offsets.
S705:Read respectively from source server and caching server on the resources to be downloaded same target offset address
Data resource.
It should be appreciated that read in the present embodiment according to the target offset address from source server and caching server
, can be from the reading of the enterprising row data in the optional position of resources to be downloaded, as long as ensureing to ease up from source server during data resource
It is identical to deposit the reading position read on the resources to be downloaded on server.
It should also be noted that, due to needing to read part from the resources to be downloaded on source server and caching server
Data resource, so the source server and caching server in the present embodiment should support breakpoint transmission function.
S706:By the number on the resources to be downloaded same target offset address read from source server and caching server
It is compared according to the content of resource.
The content of reading can be subjected to binary comparison in step S706, be provided with data corresponding to target offset address
Source size needs exist for this 64 word that will be read respectively from source server and caching server to be illustrated exemplified by 64 bytes
Each in section data resource is compared;Of course can also use default checking algorithm respectively to from source server and
The data of 64 bytes in resources to be downloaded same position read on caching server carry out that two check values are calculated, so
Be calculated 2 check values are compared afterwards.
S707:Judge whether the data resource on the resources to be downloaded same target offset address of reading is consistent, in this way, turn
To S708, otherwise, S710 is gone to.
Similarly, illustrated so that data resource size corresponding to target offset address is 64 bytes as an example, when to reading
Content carry out it is binary relatively when, if in the resources to be downloaded same position read from source server and caching server
64 byte datas in the data money that each is all consistent, then judges on the resources to be downloaded same target offset address that reads
Source is consistent;If being compared according to check value, when two check values are identical, the resources to be downloaded same target read is judged
Data resource on offset address is consistent.
S708:Judge whether the offset address in set of offsets is all chosen to finish, in this way, go to S709, otherwise, go to
S704。
S709:The resources to be downloaded are downloaded from caching server according to distribution download address.
S710:Judge that distribution download address is invalid, the resources to be downloaded are downloaded from source server according to source download address.
Carried it should be noted that when judging that distribution download address is invalid, in the present embodiment terminal can also be controlled to show
Awake information, to prompt user that the link may be harmful to.
The resource downloading method provided by the present embodiment, can identify that the resources to be downloaded are before resource downloading
It is no reliable, and can recognize the resource reliability it is very low when notify user, downloaded completely in resource so as to avoid
Into can just note abnormalities later, the usage experience of user is influenceed, the can especially when identifying that the resource reliability is very low
The resource is not downloaded, could judge its reliability after completion compared to needing completely to download resource in existing scheme
Scheme, the scheme that the present embodiment provides can save the time of user and save bandwidth.
3rd embodiment
It is shown in Figure 8, based on above-mentioned mobile terminal hardware configuration and communication system, propose the reality of terminal of the present invention
Example is applied, specifically, terminal provided by the invention includes acquisition module 81, read module 82, comparison module 83 and processing mould
Block 84.
Wherein, acquisition module 81 is used to obtaining resources to be downloaded corresponding source download address and is caching on source server
Corresponding distribution download address on server;Read module 82 is used for source download address and distribution download address point according to acquisition
The data resource in the resources to be downloaded same position is not read from source server and caching server, is eased up from source server
Deposit a part of data resource that the data resource read on server is the resources to be downloaded;Comparison module 83 be used for will respectively from
The data resource in resources to be downloaded same position read on source server and caching server is compared;Processing module 84
For being judged whether to download the resources to be downloaded from caching server according to comparative result.
It should be appreciated that the source server in the present embodiment refers to the origin server of the resources to be downloaded, that is to say
The server of the original storage resources to be downloaded, and caching server refers to the server for caching the resources to be downloaded, caching clothes
Business device can obtain the download resource from source server, and the resources to be downloaded are preserved, generally, for a net
For network system, user access Relatively centralized area or node in be all distributed with caching server, the money in source server
Source can be cached in caching server, during a certain by the terminal downloads resources to be downloaded of such user, just do not have to take from source
The resources to be downloaded are accessed in business device, but directly can be downloaded nearby from caching server, can so save access money
The time in source, therefore, the resources to be downloaded are all stored with source server and caching server.
In order to preferably be understood, illustrated here so that user is by terminal downloads " QQ applications " as an example, Yong Hu
QQ applications download link therein is clicked on after a certain network address is opened in terminal, at this moment source server and caching server can be to
Terminal return store the QQ application domain name addresses, terminal carried out after the two domain name addresses are received domain name mapping by this two
Individual domain name addresses is converted into IP address, and it is right respectively on source server and caching server that the two IP address that is to say that QQ applies
The source download address and distribution download address answered.
It should be noted that the read module 82 in the present embodiment can be from random write on source server and caching server
Take the partial data resource of resources to be downloaded, if ensure the data resource that is read from source server with from caching server
The data resource of reading is the data resource belonged in the resources to be downloaded same position.
For the present embodiment, the processor 110 in Fig. 1 can include the work(of all functional modules in the present embodiment
Can, and processor 110 can realize following steps:
First, obtain resources to be downloaded on source server corresponding source download address and on caching server corresponding to
Distribute download address;
Then, read respectively from source server and caching server according to the source download address of acquisition and distribution download address
Take the data resource in the resources to be downloaded same position;It should be noted that read from source server and caching server
Data resource be the resources to be downloaded a part of data resource;
Then, the data resource in resources to be downloaded same position read respectively from source server and caching server
It is compared;
Finally, judged whether to download the resources to be downloaded from caching server according to comparative result.
The terminal provided by the present embodiment, it can download ground according to the source got before resources to be downloaded are downloaded
Location and distribution download address are respectively from the enterprising row data money of same position of resources to be downloaded on source server and caching server
The reading in source is compared with, if there is a situation where, comparative result is inconsistent, illustrates that distributing download address may be held as a hostage, if than
It is completely the same compared with result, then illustrate that the distribution download address may not be held as a hostage, namely the terminal provided by the present embodiment, can
Just to identify whether the resource is reliable before resources to be downloaded are downloaded, so as to be judged whether according to recognition result to this
Resource is downloaded, and not only saves bandwidth resources, can also avoid user by under some useless or even harmful resource downloadings
Come, improve the satisfaction of Consumer's Experience.
Fourth embodiment
Shown in Figure 9, the present embodiment provides a kind of terminal, and the terminal can at least include:Input and output (IO) are total
Line 91, processor 92, memory 93, internal memory 94, input module 95, communication module 96 and it is stored on memory 93 and can locating
The resource downloading program run on reason device 92.
Input and output (IO) bus 91 respectively with itself belonging to terminal other parts it is (processor 92, memory 93, interior
Deposit 94, input module 95 and communication module 96) connection, and provide transmission lines for other parts.
Processor 92 generally controls the overall operation of the terminal belonging to itself.Calculate and confirm for example, processor 92 performs
Deng operation.Wherein, processor 92 can be central processing unit 92 (CPU).
The software code that processor 92 is readable, processor 92 is executable is stored with memory 93, it, which is included, is used to control
Processor 92 performs the instruction (i.e. software perform function) of functions described herein.In the present embodiment, in memory 93 at least
Need to be stored with and realize that processor 92 performs the program that above-mentioned function needs.
Wherein, in terminal provided by the invention, realize that the software code of all functions of modules of Fig. 8 is storable in memory 93
In, and performed after being performed or compiled by processor 92.
Internal memory 94, typically using semiconductor memory cell, including random access memory 93 (RAM), read-only storage 93
(ROM), and cache (CACHE), RAM are most important of which memories 93.Internal memory 94 is portion important in computer
One of part, it is the bridge linked up with processor 92, and the operation of all programs is carried out in internal memory 94 in computer
, it is for temporarily depositing the operational data in processor 92, and the number exchanged with external memory storages 93 such as hard disks that it, which is acted on,
According to as long as computer is in operation, processor 92 will carry out computing needing the data of computing to be transferred in internal memory 94, work as computing
Complete preprocessor 92 again to send out result, the operation of internal memory 94 also determines the stable operation of computer.
Input module 95 can include such as microphone 1042, sensor 105 and contact panel 1071, for realizing user
Input, and the result that user is inputted is transferred to processor 92.
Communication module 96 can include radio frequency unit 101 etc., for being communicated with the external world.
It is real when the resource downloading program in the present embodiment is performed by processor 92 on the basis of the terminal member shown in Fig. 9
Existing following steps:
Obtain resources to be downloaded corresponding source download address and corresponding distribution on caching server on source server
Download address;
Being read respectively from source server and caching server according to the source download address of acquisition and distribution download address should
Data resource in resources to be downloaded same position, the data resource read from source server and caching server are treated down for this
Carry a part of data resource of resource;
Data resource in the resources to be downloaded same position read respectively from source server and caching server is entered
Row compares;
Judged whether to download the resources to be downloaded from caching server according to comparative result.
In certain embodiments, processor 92 will be respectively from source server and caching to realize in execution resource downloading program
During the step for data resource in resources to be downloaded same position read on server is compared, resource can also carry out
Download and realize following steps:
By the content of the data resource in the resources to be downloaded same position read from source server and caching server
It is compared, that is to say and binary system comparison is carried out to the content of reading;
Or,
According to default checking algorithm resources to be downloaded identical bits to being read from source server and caching server respectively
The data resource put carries out that check value is calculated, and the check value being calculated is compared, checking algorithm therein
Can be the arbitrary checking algorithm set by developer, for example, it may be MD5 algorithms.
In certain embodiments, resource downloading program of the processor 92 in the present embodiment is performed is real downloads now according to source
Address and distribution download address read the number in the resources to be downloaded same position from source server and caching server respectively
Before the step for resource, it can also carry out resource downloading program and realize following steps:
The size of resources to be downloaded is obtained from source server according to source download address.
Determine to be used to indicate the resources to be downloaded on source server and caching server according to the size of resources to be downloaded
The reading address that partial data resource is read.
It should be noted that the reading address in the present embodiment can generate at random, as long as ensureing the resources to be downloaded
Size is more than the size for reading data resource corresponding to address, if for example, the size of resources to be downloaded is 2MB, reads
The size of data resource indicated by address should be less than 2MB.After determining and reading address, could according to source download address and
Distribution download address respectively from source server with read on caching server the resources to be downloaded it is identical read address on data
Resource is simultaneously compared.
A reading address can only correspond to a data in the present embodiment, now, can in the reading address determined
To read address comprising continuous, discrete reading address can also be included, for purposes of illustration only, will continuously read address here
Referred to as one reading group of addresses, namely one read in group of addresses comprising it is multiple it is continuous read addresses, when determining multiple readings
When taking group of addresses, each size for reading data resource corresponding to group of addresses can that is to say different reading addresses with different
The reading address of varying number can be included in group, for example, when the size of resources to be downloaded is 2MB, can be generated at random more
Individual reading address, wherein it is possible to read address and discrete reading address including continuous, it is assumed that generate 3 readings at random
Group of addresses, it is necessary to explanation, this 3 read group of addresses between can be interruption, at this moment this 3 read group of addresses corresponding to
The size of data resource can be respectively 10KB, 50KB, 100KB;It should be noted that now no matter which kind of above-mentioned mode used
The comparison of data resource is carried out, 3 identical bits of resources to be downloaded can be read from source server and caching server respectively
The 3 groups of data resources put, this 3 groups of data resources have corresponded to the data of 10KB data, 50KB data and 100KB respectively,
Illustrate so that the size of one group of data resource is 10KB as an example, can now be incited somebody to action respectively from source server and caching server
After 10KB data contents are read, then by this 10KB data content read respectively from source server and caching server
Each data content be compared respectively, or the ratio of data can also be carried out during this 10KB data content is read
It is right;Or it can be verified after 10KB data contents are read from source server and caching server, then using default
Algorithm carries out that check value is calculated to the 10KB data contents read from source server, and to being read from caching server
The 10KB data contents taken carry out that check value is calculated, and obtain two check values are compared.
Of course, can be that is to say in advance with the pre-set continuous quantity for reading address in certain embodiments
The length what a reads group of addresses is set, for example, it can be set to 1/20 for resources to be downloaded size, at this moment, it can give birth at random
Into multiple reading group of addresses, likewise, can also be interruption between this multiple reading group of addresses, wherein, each read address
The size of data resource corresponding to group can all be 0.1MB, such as, 4 continuous group of addresses that read can be generated, it is necessary to illustrate
, at this moment data resource corresponding to this 4 continuous reading group of addresses can be with non-overlapping copies, can also an overlapping part.
It should be appreciated that one is read address and can also correspond to one piece of data, now the reading address is also the section
The first address of data, while need to generate the offset for reading address according to the size of resources to be downloaded, the offset indicates
How many data can be read since first address, now, in order to from resources to be downloaded phase on source server and caching server
Data are read on same position, it is used to indicate that the reading address of digital independent not only to need identical, its corresponding offset
It should also be as identical.
In some other embodiment, resource downloading program of the processor 92 in the present embodiment is performed is real now according to source
Download address and distribution download address are read from source server and caching server in the resources to be downloaded same position respectively
Data resource the step for before, can also carry out resource downloading program and realize following steps:
First address and the tail address of the resources to be downloaded are obtained from source server according to source download address.
Determine to be used to indicate the resources to be downloaded part number on source server and buffer service according to first address and tail address
The reading address read according to resource.
Wherein, reading address can be between first address and tail address, certainly, and reading address can also treat down including this
The first address or tail address, the data resource at this moment read from source server and caching server for carrying resource also include this
Data resource corresponding to the first address of resources to be downloaded or tail address.For example, the first address and tail of resources to be downloaded
Location is p and p+n respectively, at this moment can also may be used certainly using address corresponding to p to the optional position between p+n as address is read
So that p and p+n as address is read, to be of coursed, the size of data resource should also be as to be downloaded less than this corresponding to reading address
The size of resource.
In the present embodiment, determine comprise at least two read address when, can according to the reading address determined from
Corresponding data resource is read to finish on source server and caching server and is compared again afterwards;Or can also every basis
One is read address and read after its corresponding data resource with regard to the comparison of progress data resource, specifically, in the present embodiment
Processor 92 during the data resource for performing resource downloading program to realize according to reading is compared, can perform
Resource downloading program realizes following steps:
From selection one in address is read address is read as target.
The data on resources to be downloaded same target reading address are read from source server and caching server respectively
Resource.
The target read is read into the data resource on address to be compared.
The new target of selection one reads address from remaining reading address, and reads address according to the new target and enter
The reading of row data resource is compared with, untill according to all reading address readings and completeer data resource.
Certainly, processor 92 realizes that the target that will be read reads the data in group of addresses and provided in execution resource downloading program
After source is compared, it can also carry out resource downloading program and realize following steps:
The resources to be downloaded same target for judging to read from source server and caching server reads the data on address
Whether resource is consistent, and in this way, selection one reads address as new target from remaining reading address again, otherwise, stops
Only new target is selected to read address from remaining reading address.
Processor 92 in the present embodiment is realized in execution resource downloading program to be judged whether from caching according to comparative result
It the resources to be downloaded are downloaded on server can perform resource downloading program during this and realize following steps:
It is identical with what is read from caching server to there is the data resource read from source server in comparative result
During inconsistent this result of data resource on position, judge that the distribution download address that obtains is invalid, otherwise, it is determined that according to this point
Give set address and the resources to be downloaded are downloaded from caching server.
It is so inconsistent if reading the data resource read in group of addresses from the target on source server and caching server
When, while stopping selecting new target to read address from remaining reading address, under the distribution that acquisition can also be judged
Set address is invalid.
The resources to be downloaded are downloaded from caching server according to the distribution download address in execution judgement in the present embodiment
During, resource downloading program can be performed and realize following steps:
The data removed in resources to be downloaded beyond data resource corresponding to the same position are downloaded from caching server
Resource,
Resource downloading program can be performed in the present embodiment during execution judges that distribution download address is invalid to realize
Following steps:
The resources to be downloaded are downloaded from source server according to source download address;
Or,
The display alarm information on the display interface of terminal, to prompt user that the download request is invalid.
Meanwhile the present embodiment also provides a kind of computer-readable recording medium, stored in the computer-readable recording medium
There is resource downloading program, realized when the resource downloading program is performed by processor 92 such as the step in above-mentioned either method.
The terminal and computer-readable recording medium provided by the present embodiment, can identify this before resource downloading
Whether resources to be downloaded reliable, and can recognize the resource reliability it is very low when notify user, provided so as to avoid
Source can just note abnormalities after downloading completion completely, influence the usage experience of user, especially identifying the resource reliability
Can is not downloaded to the resource when very low, completes just sentence afterwards compared to needing completely to download resource in existing scheme
The scheme for its reliability of breaking, the scheme that the present embodiment provides can save the time of user and save bandwidth.
It should be noted that herein, term " comprising ", "comprising" or its any other variant are intended to non-row
His property includes, so that process, method, article or device including a series of elements not only include those key elements, and
And also include the other element being not expressly set out, or also include for this process, method, article or device institute inherently
Key element.In the absence of more restrictions, the key element limited by sentence "including a ...", it is not excluded that including this
Other identical element also be present in the process of key element, method, article or device.
The embodiments of the present invention are for illustration only, do not represent the quality of embodiment.
Through the above description of the embodiments, those skilled in the art can be understood that above-described embodiment side
Method can add the mode of required general hardware platform to realize by software, naturally it is also possible to by hardware, but in many cases
The former is more preferably embodiment.Based on such understanding, technical scheme is substantially done to prior art in other words
Going out the part of contribution can be embodied in the form of software product, and the computer software product is stored in a storage medium
In (such as ROM/RAM, magnetic disc, CD), including some instructions to cause a station terminal equipment (can be mobile phone, computer, clothes
Be engaged in device, air conditioner, or network equipment etc.) perform method described in each embodiment of the present invention.
Embodiments of the invention are described above in conjunction with accompanying drawing, but the invention is not limited in above-mentioned specific
Embodiment, above-mentioned embodiment is only schematical, rather than restricted, one of ordinary skill in the art
Under the enlightenment of the present invention, in the case of present inventive concept and scope of the claimed protection is not departed from, it can also make a lot
Form, these are belonged within the protection of the present invention.
Claims (10)
- A kind of 1. resource downloading method, it is characterised in that including:Obtain resources to be downloaded corresponding source download address and corresponding distribution download on caching server on source server Address;According to the source download address and the distribution download address respectively from the source server and the caching server Read the data resource in the resources to be downloaded same position;Read from the source server and the caching server Data resource is a part of data resource of the resources to be downloaded;Data money in the resources to be downloaded same position that will be read respectively from the source server and the caching server Source is compared;Judged whether to download the resources to be downloaded from the caching server according to comparative result.
- 2. resource downloading method as claimed in claim 1, it is characterised in that described that the resources to be downloaded read respectively are identical Data resource on position be compared including:The data resource in resources to be downloaded same position that will be read from the source server and the caching server Content is compared;Or,According to the default checking algorithm resources to be downloaded phase to being read from the source server and the caching server respectively Carry out that check value is calculated with the data resource on position, and the check value being calculated is compared.
- 3. resource downloading method as claimed in claim 1, it is characterised in that described according to the source download address and described point Set address is given to read from the source server and the caching server in the resources to be downloaded same position respectively Include before data resource:The size of the resources to be downloaded is obtained from the source server according to the source download address, and is treated down according to described The size for carrying resource determines to be used for the part number for indicating the resources to be downloaded on the source server and the caching server The reading address read according to resource, the size of the resources to be downloaded are more than the big of data resource corresponding to the reading address It is small;Or,First address and the tail address of the resources to be downloaded are obtained from the source server according to the source download address, according to The first address and the tail address determine to be used to indicate the money to be downloaded on the source server and the caching server The reading address that the partial data resource in source is read, the reading address is between the first address and the tail address.
- 4. resource downloading method as claimed in claim 3, it is characterised in that when it is determined that reading address including at least 2, institute State and read respectively from the source server and the caching server according to the source download address and the distribution download address The data resource in the resources to be downloaded same position is taken, and by the resources to be downloaded same position read respectively Data resource be compared including:Selection one reads address as target from the reading address;The resources to be downloaded same target is read from the source server and the caching server respectively to read on address Data resource;The target read is read into the data resource on address to be compared, and one is selected from remaining reading address It is individual as new target to read address, and address is read according to the new target and carries out the reading of data resource compared with, directly Extremely read according to all reading addresses from the source server and the caching server and in completeer same position Data resource.
- 5. resource downloading method as claimed in claim 4, it is characterised in that described that the target read is read into address On data resource be compared after also include:The resources to be downloaded same target for judging to read from the source server and the caching server is read on address Whether data resource is consistent, and in this way, selection one reads address as new target from remaining reading address again, no Then, stop selecting new target to read address from remaining reading address.
- 6. the resource downloading method as described in claim any one of 1-5, it is characterised in that described to be according to comparative result judgement It is no the resources to be downloaded are downloaded from the caching server to include:The data resource read from the source server in the comparative result be present with being read from the caching server During the inconsistent comparative result of the data resource in same position that takes, judge that the distribution download address is invalid, otherwise, it is determined that The resources to be downloaded are downloaded from the caching server according to the distribution download address.
- 7. resource downloading method as claimed in claim 6, it is characterised in that it is described according to the distribution download address from described The resources to be downloaded are downloaded in caching server to be included:Data in resources to be downloaded on the caching server in addition to data resource corresponding to the same position are provided Source is downloaded.
- 8. resource downloading method as claimed in claim 6, it is characterised in that methods described, which is additionally included in, to be judged under the distribution When set address is invalid, the resources to be downloaded are downloaded from the source server according to the source download address.
- 9. a kind of terminal, it is characterised in that the terminal includes:Processor, memory and it is stored on the memory and can The resource downloading program run on the processor, the resource downloading program are realized such as right during the computing device It is required that the step of resource downloading method any one of 1-8.
- 10. a kind of computer-readable recording medium, it is characterised in that be stored with the computer-readable recording medium under resource Program is carried, is realized when the resource downloading program is performed such as the resource downloading method any one of claim 1-8 Step.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710548091.6A CN107528825A (en) | 2017-07-06 | 2017-07-06 | A kind of resource downloading method, terminal and computer-readable recording medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710548091.6A CN107528825A (en) | 2017-07-06 | 2017-07-06 | A kind of resource downloading method, terminal and computer-readable recording medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN107528825A true CN107528825A (en) | 2017-12-29 |
Family
ID=60748876
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710548091.6A Pending CN107528825A (en) | 2017-07-06 | 2017-07-06 | A kind of resource downloading method, terminal and computer-readable recording medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107528825A (en) |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108667827A (en) * | 2018-04-25 | 2018-10-16 | 北京白山耘科技有限公司 | Cloud distribution network cache contents method of calibration, device, network, storage medium and computing device |
CN108683668A (en) * | 2018-05-18 | 2018-10-19 | 腾讯科技(深圳)有限公司 | Resource checksum method, apparatus, storage medium and equipment in content distributing network |
CN109492436A (en) * | 2018-11-29 | 2019-03-19 | 深圳市网心科技有限公司 | A kind of file verification method and relevant apparatus |
CN109995866A (en) * | 2019-04-03 | 2019-07-09 | 深圳市网心科技有限公司 | Distributed document method of calibration, device, computer installation and storage medium |
CN111159075A (en) * | 2019-12-31 | 2020-05-15 | 成都海光微电子技术有限公司 | Data transmission method and data transmission device |
CN111416863A (en) * | 2020-03-20 | 2020-07-14 | 上海圣剑网络科技股份有限公司 | Diversified download management method, terminal and medium based on client |
CN112580098A (en) * | 2020-12-23 | 2021-03-30 | 光大兴陇信托有限责任公司 | Business data comparison method and system |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103379139A (en) * | 2012-04-17 | 2013-10-30 | 百度在线网络技术(北京)有限公司 | A verification method and a verification system for distributed cache content, and apparatuses |
WO2015002525A1 (en) * | 2013-07-03 | 2015-01-08 | Mimos Berhad | A system and method for synchronizing of cache remotely with pre-fetching of non-protected contents and protected contents |
CN104283933A (en) * | 2013-07-12 | 2015-01-14 | 腾讯科技(深圳)有限公司 | Data downloading method, client-side and system |
CN104735086A (en) * | 2015-04-14 | 2015-06-24 | 广东欧珀移动通信有限公司 | Method and device for downloading files safely |
CN105025025A (en) * | 2015-07-22 | 2015-11-04 | 国家计算机网络与信息安全管理中心 | Cloud-platform-based domain name active detecting method and system |
-
2017
- 2017-07-06 CN CN201710548091.6A patent/CN107528825A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103379139A (en) * | 2012-04-17 | 2013-10-30 | 百度在线网络技术(北京)有限公司 | A verification method and a verification system for distributed cache content, and apparatuses |
WO2015002525A1 (en) * | 2013-07-03 | 2015-01-08 | Mimos Berhad | A system and method for synchronizing of cache remotely with pre-fetching of non-protected contents and protected contents |
CN104283933A (en) * | 2013-07-12 | 2015-01-14 | 腾讯科技(深圳)有限公司 | Data downloading method, client-side and system |
CN104735086A (en) * | 2015-04-14 | 2015-06-24 | 广东欧珀移动通信有限公司 | Method and device for downloading files safely |
CN105025025A (en) * | 2015-07-22 | 2015-11-04 | 国家计算机网络与信息安全管理中心 | Cloud-platform-based domain name active detecting method and system |
Cited By (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108667827A (en) * | 2018-04-25 | 2018-10-16 | 北京白山耘科技有限公司 | Cloud distribution network cache contents method of calibration, device, network, storage medium and computing device |
CN108667827B (en) * | 2018-04-25 | 2019-07-26 | 北京白山耘科技有限公司 | Cloud distribution network cache contents method of calibration, device, network, storage medium and calculating equipment |
CN108683668A (en) * | 2018-05-18 | 2018-10-19 | 腾讯科技(深圳)有限公司 | Resource checksum method, apparatus, storage medium and equipment in content distributing network |
CN108683668B (en) * | 2018-05-18 | 2021-01-22 | 腾讯科技(深圳)有限公司 | Resource checking method, device, storage medium and equipment in content distribution network |
CN109492436A (en) * | 2018-11-29 | 2019-03-19 | 深圳市网心科技有限公司 | A kind of file verification method and relevant apparatus |
CN109995866A (en) * | 2019-04-03 | 2019-07-09 | 深圳市网心科技有限公司 | Distributed document method of calibration, device, computer installation and storage medium |
CN109995866B (en) * | 2019-04-03 | 2022-04-29 | 深圳市网心科技有限公司 | Distributed file verification method and device, computer device and storage medium |
CN111159075A (en) * | 2019-12-31 | 2020-05-15 | 成都海光微电子技术有限公司 | Data transmission method and data transmission device |
CN111159075B (en) * | 2019-12-31 | 2021-11-05 | 成都海光微电子技术有限公司 | Data transmission method and data transmission device |
CN111416863A (en) * | 2020-03-20 | 2020-07-14 | 上海圣剑网络科技股份有限公司 | Diversified download management method, terminal and medium based on client |
CN112580098A (en) * | 2020-12-23 | 2021-03-30 | 光大兴陇信托有限责任公司 | Business data comparison method and system |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107528825A (en) | A kind of resource downloading method, terminal and computer-readable recording medium | |
CN108536481A (en) | A kind of application program launching method, mobile terminal and computer storage media | |
CN107463602A (en) | A kind of log processing method and server, client | |
CN107508892A (en) | A kind of page access method, server and computer-readable recording medium | |
CN107193889A (en) | Ad blocking method, terminal and computer-readable recording medium | |
CN107885665A (en) | With case script method of testing, mobile terminal and computer-readable recording medium | |
CN108563499A (en) | CDN server switching method, mobile terminal and computer readable storage medium | |
CN108566304A (en) | Interface control method, electronic equipment and computer readable storage medium | |
CN107967322A (en) | Document classification display methods, mobile terminal and computer-readable recording medium | |
CN107038245A (en) | Page switching method, mobile terminal and storage medium | |
CN107220050A (en) | Adaptive display method, terminal and computer-readable recording medium | |
CN107239522A (en) | Picture storage method, equipment and computer-readable storage medium | |
CN107426304A (en) | Method, system and the proxy server of interactive media resource | |
CN109922078A (en) | Upgrade control method, mobile terminal and computer readable storage medium | |
CN107580336A (en) | A kind of method for connecting network, terminal and computer-readable recording medium | |
CN107911536A (en) | A kind of across application program access method, equipment and computer-readable recording medium | |
CN107124466A (en) | One kind prevents caching penetrating method and device, computer-readable recording medium | |
CN107193379A (en) | Application program launching method, terminal and computer-readable recording medium | |
CN108509586A (en) | The method, apparatus and computer readable storage medium of cache management | |
CN108121546A (en) | A kind of information processing method and mobile terminal | |
CN107688639A (en) | Using recommendation method, server and computer-readable recording medium | |
CN108595672A (en) | The method, apparatus and readable storage medium storing program for executing of file type are downloaded in a kind of identification | |
CN108449736A (en) | A kind of data transmission method, terminal and computer readable storage medium | |
CN106888225A (en) | A kind of control method of single-sign-on application, mobile terminal and computer-readable medium | |
CN107609066A (en) | Method, equipment and the computer for clearing up file can storage mediums |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20171229 |
|
RJ01 | Rejection of invention patent application after publication |