Summary of the invention
In view of the foregoing deficiencies of prior art, the purpose of the present invention is to provide a kind of method for down loading, system and institutes
Applicable router, when obtaining a large amount of downloading requests for solving server-side concentrative time interval in the prior art, each client can not
The problem of efficient downloading data.
In order to achieve the above objects and other related objects, the present invention provides a kind of method for down loading, comprising the following steps: is based on
Whether the download channel of transmitted downloading request, the corresponding downloading request of monitoring meets preset unobstructed condition;If so,
The data of the corresponding downloading request are obtained by the download channel;Conversely, the weight for then disconnecting the download channel, and being delayed
The download channel is newly established, monitors whether the download channel meets the unobstructed condition, until determining the downloading request
Corresponding data downloading finishes.
Preferably, the data include: the software package for router.
Preferably, the unobstructed condition comprises at least one of the following: receiving the corresponding downloading within a preset period of time and asks
The feedback information asked;It is greater than pre-set velocity threshold by the speed that the download channel obtains the data of the corresponding downloading request
Value.
Preferably, the mode for re-establishing the download channel of the delay includes: to be based on currently disconnecting the downloading
The number in channel, setting re-establish the time delay interval of the download channel;From when currently disconnecting the download channel, according to institute
It states time delay interval and carries out timing, and re-establish the download channel at the end of timing.
Preferably, the mode that the corresponding data downloading of the determination downloading request finishes includes: that institute is received
At least partly carry out cryptographic check in all data, and compare whether the value after cryptographic check matches preset value;If so,
Determine that downloading finishes;It is on the contrary, it is determined that not download and finish.
Based on above-mentioned purpose, the present invention also provides a kind of download systems, comprising: communication module, for sending downloading request;
Monitoring modular, for being requested based on the downloading, it is preset logical whether the download channel of the corresponding downloading request of monitoring meets
Smooth condition;If so, the communication module is allowed to obtain the data that the corresponding downloading is requested by the download channel;Instead
It, then indicate that the communication module disconnects the download channel, and indicate the communication module delay re-establish it is described under
Channel is carried, monitors whether the download channel meets the unobstructed condition, until determining the corresponding data of the downloading request
Downloading finishes.
Preferably, the data include: the software package for router.
Preferably, the unobstructed condition comprises at least one of the following: receiving the corresponding downloading within a preset period of time and asks
The feedback information asked;It is greater than pre-set velocity threshold by the speed that the download channel obtains the data of the corresponding downloading request
Value.
Preferably, the monitoring modular is used for based on the number for currently disconnecting the download channel, and setting re-establishes institute
State the time delay interval of download channel;From when currently disconnecting the download channel, indicating the communication module according between the delay
Every progress timing, and the download channel is re-established at the end of the timing.
Preferably, the monitoring modular be used for by least partly carry out cryptographic check in received all data, and
Whether the value after comparing cryptographic check matches preset value;If so, determining that downloading finishes;It is on the contrary, it is determined that not download and finish.
Based on above-mentioned purpose, the present invention also provides a kind of routers, comprising: as above any download system.
As described above, method for down loading of the invention, system and the router being applicable in, have the advantages that and pass through
It whether unobstructed monitors download channel, to determine whether the downloading data that is delayed, server-side concentration can effectively be overcome to issue software package
When own hardware performance and network bandwidth it is insufficient caused by can not download or download the disadvantages of slow;In addition, being delayed in order to prevent
Downloading is still concentrated afterwards, and the present invention is used based on the number for currently disconnecting the download channel, and setting re-establishes the downloading
Thus the mode of the time delay interval in channel effectively reduces between each client the repetition of time delay interval or close to probability;Also
Have, at least partly carry out cryptographic check in the data downloaded, can effectively solve the packet loss or solution in data transmission procedure
The problems such as code is wrong, improves data receiver accuracy rate;In addition, download system of the present invention is applied in router, favorably
It being capable of high speed, efficient acquisition software upgrading packet in the more routers controlled by same control server-side.
Specific embodiment
Illustrate embodiments of the present invention below by way of specific specific example, those skilled in the art can be by this specification
Other advantages and efficacy of the present invention can be easily understood for disclosed content.The present invention can also pass through in addition different specific realities
The mode of applying is embodied or practiced, the various details in this specification can also based on different viewpoints and application, without departing from
Various modifications or alterations are carried out under spirit of the invention.It should be noted that in the absence of conflict, following embodiment and implementation
Feature in example can be combined with each other.
It should be noted that illustrating the basic structure that only the invention is illustrated in a schematic way provided in following embodiment
Think, only shown in schema then with related component in the present invention rather than component count, shape and size when according to actual implementation
Draw, when actual implementation kenel, quantity and the ratio of each component can arbitrarily change for one kind, and its assembly layout kenel
It is likely more complexity.
Referring to Fig. 1, the present invention provides a kind of method for down loading.The method for down loading is mainly used for receiving the client of data
End.The client obtains the data to be downloaded to server-side by sending downloading request.The client sends downloading and asks
The entry condition asked includes but is not limited to any of the following: 1) server-side determine update software package version when, actively to
Each client sends version information, each client based on received version information compared with itself current version information, really
It orients the server-side and sends downloading request, to obtain newest software package (i.e. acquisition data).2) client periodically to
Server-side sends version updating request, and the ratio of the version information based on server-side feedback and itself current version information
Compared with, it is determining to send downloading request to the server-side, to obtain newest software package (i.e. acquisition data).3) client's end group
The download instruction caused by user's operation sends downloading request to server-side, and obtains corresponding data.
The client includes but is not limited to: router, user equipment, mobile device etc..The server-side includes but not
It is limited to: control server, the file server in internet etc. being in each router in same local area network.
The method for down loading is mainly executed by being mounted on the download system of client.It is specific as follows:
In step sl, the download system is requested based on transmitted downloading, under the corresponding downloading request of monitoring
Carry whether channel meets preset unobstructed condition.
Specifically, when the download system, which is based on above-mentioned entry condition, sends downloading request, transmitted downloading request
Address information, the even receiving port information etc. for including: wanted downloading data.The download system is sending the downloading request
When, whether the download channel of the also corresponding downloading request of monitoring meets preset unobstructed condition.
Here, the unobstructed condition comprises at least one of the following:
1) feedback information of the corresponding downloading request is received within a preset period of time.Specifically, when the download system
When sending downloading request, preset time period described in the download system opening timing device and timing, if when described default
Between receive corresponding feedback information in section, it is determined that the download channel is unobstructed, and establishes the download channel, then execute step
Rapid S2.Conversely, if not receiving corresponding feedback information in the preset time period, it is determined that the download channel is unsmooth
It is logical, and execute step S3.
2) speed that the data of the corresponding downloading request are obtained by the download channel is greater than pre-set velocity threshold value.Tool
Body, after the download system receives corresponding feedback information within a preset period of time, the download channel is established, and hold
During row step S2, when whether the speed that monitoring obtains data is greater than the threshold speed, if so, continuing to execute step
S2, to obtain data, conversely, thening follow the steps S3.For example, the download system is according to continuous received data several times
Time interval and total amount of data to calculate the speed for obtaining data, and are compared, if more than then with preset threshold speed
Step S2 is executed, conversely, thening follow the steps S3.
Here, the download channel is the data transmission link that is constituted based on http protocol, Transmission Control Protocol or udp protocol.
In step s 2, the download system obtains the data of the corresponding downloading request by the download channel.
In step s3, the download system disconnects the download channel, and what is be delayed re-establishes the download channel,
Monitor whether the download channel meets the unobstructed condition, until determining that the corresponding data of the downloading request have been downloaded
Finish.
Here, the mode that the download system disconnects the download channel includes but is not limited to: 1) being received in the last time
When to data, the not response message of feedback reception to the data.For example, the download system is monitoring that present speed is lower than
When preset threshold speed, then not to server-side feedback reception to the response message of last one group of data, when the server-side exists
The response message is not received in preset time, then disconnects the download channel.2) when do not receive within a preset period of time from clothes
The corresponding of end of being engaged in downloads the feedback information requested, then monitors the port of the corresponding download channel, not to reach described in disconnection
The purpose of download channel.3) the response letter when the last time receiving data, to server-side feedback comprising disconnecting download channel
Breath.For example, the download system then includes disconnected to server-side feedback when monitoring present speed lower than preset threshold speed
Open the response message of download channel;The server-side is based on the response message and disconnects the download channel.
Here, when the download system disconnects the download channel all data downloaded can be deleted, and in weight
It is re-downloaded after newly establishing connection.The download system can also keep in each data downloaded, and re-establish it is described under
After carrying channel, the downloading request of the relevant information comprising last group of received data is sent, to server-side to service
Continue to send not sent remaining data in end.
Here, the mode for re-establishing the download channel of the download system delay can be when preset fixed
Between randomly select time delay interval in section, and re-establish the download channel according to selected time delay interval.
Preferably, the selected time delay interval of multiple client is excessively close in order to prevent, and server-side is caused still can not to provide
The mode for re-establishing the download channel of efficient download transmission, the download system delay includes: step S31, S32.
(being unillustrated)
In step S31, the download system re-establishes institute based on the number for currently disconnecting the download channel, setting
State the time delay interval of download channel.
Specifically, download system statistics disconnects the number of download channel, and according to it is preset with the number be to be
Several formula determines the time interval for choosing time delay interval, between one delay of random selection in identified time interval
Every, and execute step S32.
For example, the current number for disconnecting download channel of download system statistics is for the first time that according to formula: yt=kM is true
The fixed time interval for choosing time delay interval is [0, M], then the download system randomly selects one from the time interval and prolongs
Time is divided into yt1, and executes step S32.Wherein, M is fixed value, and k is disconnection times.
For another example, the current number for disconnecting download channel of download system statistics is third time, and according to formula: yt=kM is true
The fixed time interval for choosing time delay interval is [0,3M], then the download system randomly selects one from the time interval and prolongs
Time is divided into yt2, and executes step S32.Wherein, M is fixed value, and k is disconnection times.
In step s 32, the download system is carried out from when currently disconnecting the download channel according to the time delay interval
Timing, and the download channel is re-established at the end of the timing.
For example, the download system sets according to obtained time delay interval and starts timer, when timer timing to 0
When, the downloading request of the relevant information comprising download link, and/or last group of data is retransmitted, to re-establish
Download channel is stated, and continues to obtain data.The download system re-execute the steps S1 when sending downloading request, until
Determine that the corresponding data downloading of the downloading request finishes.
Here, the download system based on the received the last one include data agreement package in flag bit it is true
Fixed all data downloadings finish.
In the present embodiment, after the download system receives data every time, by least portion in received all data
Divide and carry out cryptographic check, and compares whether the value after cryptographic check matches preset value;If so, determining that downloading finishes;If it is not,
It then determines not download and finish.
For example, the download system by check bit in received all data or all data carry out md5 encryption school
It tests, and the value after cryptographic check is compared with preset value, if equal, it is determined that downloading finishes, on the contrary then continue to download.
Referring to Fig. 2, the present invention provides a kind of download system.The download system is mainly used for receiving the client of data
End.The client obtains the data to be downloaded to server-side by sending downloading request.The client sends downloading and asks
The entry condition asked includes but is not limited to any of the following: 1) server-side determine update software package version when, actively to
Each client sends version information, each client based on received version information compared with itself current version information, really
It orients the server-side and sends downloading request, to obtain newest software package (i.e. acquisition data).2) client periodically to
Server-side sends version updating request, and the ratio of the version information based on server-side feedback and itself current version information
Compared with, it is determining to send downloading request to the server-side, to obtain newest software package (i.e. acquisition data).3) client's end group
The download instruction caused by user's operation sends downloading request to server-side, and obtains corresponding data.
The client includes but is not limited to: router, user equipment, mobile device etc..The server-side includes but not
It is limited to: control server, the file server in internet etc. being in each router in same local area network.
The download system 1 specifically includes: communication module 11, monitoring modular 12.
The communication module 11 is used to send the downloading request to server-side and receives the data from server-side.
Wherein, the communication module 11 also informs the starting of monitoring modular 12 operation when sending downloading request.
Whether the monitoring modular 12 is met based on the download channel of the corresponding downloading request of the downloading request monitoring
Preset unobstructed condition;It is requested if so, the communication module 11 is allowed to obtain the corresponding downloading by the download channel
Data;Conversely, then indicating that the communication module 11 disconnects the download channel, and indicate the weight that the communication module 11 is delayed
The download channel is newly established, monitors whether the download channel meets the unobstructed condition, until determining the downloading request
Corresponding data downloading finishes.
Specifically, when the communication module 11, which is based on above-mentioned entry condition, sends downloading request, transmitted downloading is asked
Ask the address information for including: wanted downloading data, even receiving port information etc..Under the monitoring of monitoring modular 12 correspondence is described
Whether the download channel for carrying request meets preset unobstructed condition.
Here, the unobstructed condition comprises at least one of the following:
1) feedback information of the corresponding downloading request is received within a preset period of time.Specifically, when the communication module
When 11 transmission downloading request, preset time period described in the 12 opening timing device of monitoring modular and timing, if described pre-
If receiving corresponding feedback information in the period, it is determined that the download channel is unobstructed, and indicates that the communication module 11 is built
Found the download channel.Conversely, if not receiving corresponding feedback information in the preset time period, it is determined that the downloading
Channel is not smooth, and indicates that the communication module 11 disconnects the download channel, monitor the download channel whether meet it is described
Unobstructed condition, until determining that the corresponding data downloading of the downloading request finishes.
2) speed that the data of the corresponding downloading request are obtained by the download channel is greater than pre-set velocity threshold value.Tool
Body, after the monitoring modular 12 receives corresponding feedback information within a preset period of time, indicate the communication module 11
The download channel is established, and the communication module 11 is allowed to obtain the number that the corresponding downloading is requested by the download channel
According to.In the process, when whether the speed that the monitoring modular 12 also monitors acquisition data is greater than the threshold speed, if so,
Then continue that the communication module 11 is allowed to obtain data;Conversely, then indicating that the communication module 11 disconnects the download channel, supervise
Survey whether the download channel meets the unobstructed condition, until determining that the corresponding data downloading of the downloading request finishes.
For example, the download system 1 is according to the continuously time interval and total amount of data of received data several times, to calculate acquisition number
According to speed, and be compared with preset threshold speed, if more than then allowing the communication module 11 logical by the downloading
The data that road obtains the corresponding downloading request monitor institute conversely, then indicating that the communication module 11 disconnects the download channel
State whether download channel meets the unobstructed condition, until determining that the corresponding data downloading of the downloading request finishes.
Here, the download channel is the data transmission link that is constituted based on http protocol, Transmission Control Protocol or udp protocol.
Here, the communication module 11 is in such a way that the download channel obtains the data of the corresponding downloading request
The prior art, this will not be detailed here.
Here, the monitoring modular 12 indicates that the mode that the communication module 11 disconnects the download channel includes but unlimited
In: 1) when the last time receive data, the not response message of feedback reception to the data.For example, the monitoring modular
12 when monitoring present speed lower than preset threshold speed, then indicate the communication module 11 not to server-side feedback reception
To the response message of last one group of data, when the server-side does not receive the response message within a preset time, then described in disconnection
Download channel.2) when the monitoring modular 12 does not receive the feedback of the corresponding downloading request from server-side within a preset period of time
Information then closes the communication module 11, is allowed to not to monitor the port of the corresponding download channel, with reach disconnect it is described under
Carry the purpose in channel.3) monitoring modular 12 receives data according to described 11 the last time of communication module, indicates described logical
Believe response message of the module 11 to server-side feedback comprising disconnecting download channel.For example, the monitoring modular 12 is monitoring to work as
When preceding speed is lower than preset threshold speed, sound of the communication module 11 to server-side feedback comprising disconnecting download channel is indicated
Answer information;The server-side is based on the response message and disconnects the download channel.
Here, all data downloaded can be deleted when the monitoring modular 12 is when disconnecting the download channel, and
It is re-downloaded after re-establishing connection.The download system 1 can also keep in each data downloaded, and re-establishing
After stating download channel, the downloading request of the relevant information comprising last group of received data is sent to server-side, so as to
Server-side continues to send not sent remaining data.
Here, the monitoring modular 12 indicates the mode for re-establishing the download channel that the communication module 11 is delayed
It can be and randomly select time delay interval in preset fixed time period, and re-establish according to selected time delay interval described
Download channel.
Preferably, the selected time delay interval of multiple client is excessively close in order to prevent, and server-side is caused still can not to provide
Efficient download transmission, the monitoring modular 12 are also used to based on the number for currently disconnecting the download channel, and setting is built again
Found the time delay interval of the download channel;From when currently disconnecting the download channel, indicating the communication module 11 according to described
Time delay interval carries out timing, and the download channel is re-established at the end of the timing.
Specifically, the statistics of monitoring modular 12 disconnects the number of download channel, and is with the number according to preset
The formula of coefficient determines the time interval for choosing time delay interval, in one delay of random selection from identified time interval
Interval;Then, from when currently disconnecting the download channel, indicate that the communication module 11 is counted according to the time delay interval
When, and the download channel is re-established at the end of the timing.
For example, the monitoring modular 12 counts the current number for disconnecting download channel for first time, according to formula: yt=kM
Determine that the time interval for choosing time delay interval is [0, M], then the download system 1 randomly selects one from the time interval
Time delay interval is yt1.Then, the monitoring modular 12 indicates the communication module 11 from when currently disconnecting the download channel
Timing is carried out according to the time delay interval, and re-establishes the download channel at the end of timing.Wherein, M is to fix
Value, k is disconnection times.
For another example, the monitoring modular 12 counts the current number for disconnecting download channel for third time, according to formula: yt=kM
Determine that the time interval for choosing time delay interval is [0,3M], then the download system 1 is randomly selected from the time interval
One time delay interval is yt2.Then, the monitoring modular 12 indicates the communication module from when currently disconnecting the download channel
11 carry out timing according to the time delay interval, and the download channel is re-established at the end of the timing.Wherein, M is solid
Definite value, k are disconnection times.
Here, the monitoring modular 12 carries out timing according to the time delay interval from when currently disconnecting the download channel,
And the mode that the download channel is re-established at the end of the timing is exemplified below:
For example, the monitoring modular 12 sets according to obtained time delay interval and starts timer, when timer timing
When to 0, the downloading request of the relevant information comprising download link, and/or last group of data is retransmitted, to re-establish
The download channel, and continue to obtain data.The monitoring modular 12 monitors corresponding institute when sending downloading request again
Whether the download channel for stating downloading request meets preset unobstructed condition, until determining under the corresponding data of the downloading request
Load finishes.
Here, the monitoring modular 12 based on the received the last one include data agreement package in flag bit
Determine that all data downloadings finish.
In the present embodiment, after the monitoring modular 12 receives data every time, by received all data at least
Part carries out cryptographic check, and compares whether the value after cryptographic check matches preset value;If so, determining that downloading finishes;If
It is no, it is determined that not download and finish.
For example, the monitoring modular 12 by check bit in received all data or all data carry out md5 encryption
Verification, and the value after cryptographic check is compared with preset value, if equal, it is determined that download and finish, it is on the contrary then under continuing
It carries.
In conclusion it is of the invention, it is whether unobstructed by monitoring download channel, it, can to determine whether the downloading data that is delayed
It can not download or download caused by own hardware performance and network bandwidth are insufficient when server-side concentration effectively being overcome to issue software package
The disadvantages of slow;In addition, still concentrating downloading after being delayed in order to prevent, the present invention, which uses, to be based on currently disconnecting the download channel
Number, setting re-establish the download channel time delay interval mode, thus effectively reduce and prolong between each client
When interval repetition or close to probability;In addition, can effectively be solved at least partly carry out cryptographic check in the data downloaded
Certainly the packet loss in data transmission procedure or decoding it is wrong the problems such as, improve data receiver accuracy rate.So the present invention is effective
It overcomes various shortcoming in the prior art and has high industrial utilization value.
The above-described embodiments merely illustrate the principles and effects of the present invention, and is not intended to limit the present invention.It is any ripe
The personage for knowing this technology all without departing from the spirit and scope of the present invention, carries out modifications and changes to above-described embodiment.Cause
This, institute is complete without departing from the spirit and technical ideas disclosed in the present invention by those of ordinary skill in the art such as
At all equivalent modifications or change, should be covered by the claims of the present invention.