CN108683693B - Method and system for realizing multi-element efficient downloading service - Google Patents

Method and system for realizing multi-element efficient downloading service Download PDF

Info

Publication number
CN108683693B
CN108683693B CN201810225500.3A CN201810225500A CN108683693B CN 108683693 B CN108683693 B CN 108683693B CN 201810225500 A CN201810225500 A CN 201810225500A CN 108683693 B CN108683693 B CN 108683693B
Authority
CN
China
Prior art keywords
downloading
mode
download
value
downloading mode
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810225500.3A
Other languages
Chinese (zh)
Other versions
CN108683693A (en
Inventor
钱行
王海亮
王磊
罗引
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Zhongke Wenge Technology Co ltd
Original Assignee
Beijing Zhongke Wenge Technology Co ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Beijing Zhongke Wenge Technology Co ltd filed Critical Beijing Zhongke Wenge Technology Co ltd
Priority to CN201810225500.3A priority Critical patent/CN108683693B/en
Publication of CN108683693A publication Critical patent/CN108683693A/en
Application granted granted Critical
Publication of CN108683693B publication Critical patent/CN108683693B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Mobile Radio Communication Systems (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The invention relates to a method and a system for realizing a multi-element high-efficiency downloading service, wherein the method comprises the following steps: acquiring an interface of a downloading service, and calling the interface to download in an optimal downloading mode; when the optimal downloading mode fails to download, calling an interface to download according to other common downloading modes; and when the downloading of the common downloading mode is successful, stopping downloading, and taking the downloading mode with the maximum weight value in the optimal downloading mode and the common downloading mode as a new optimal downloading mode. According to the embodiment of the invention, the corresponding interfaces are called to download according to the optimal downloading mode or the common downloading mode in sequence according to the weighted values of the downloading modes corresponding to different interfaces, so that the optimal downloading mode is selected to download according to different interfaces, the downloading task corresponding to the interface is quickly completed, and a diversified high-concurrency downloading service response mechanism with universality, high efficiency, high reliability and high expansibility is realized.

Description

Method and system for realizing multi-element efficient downloading service
Technical Field
The invention relates to the technical field of communication, in particular to a method and a system for realizing a multi-element efficient downloading service.
Background
The generic download service is the first step in big data processing and is one of the most important steps. At present, few download services which are simultaneously integrated with high efficiency, fault tolerance, diversification and high concurrency are available. Most products can only provide a single-scene and service tightly-coupled downloading service, the dynamic analysis performance is poor, the efficient and multivariate mass resource downloading service cannot be realized, the cost-efficiency ratio of the required downloading resources for the same data requirement is generally lower based on the current big data environment, and the effective utilization rate of the resources is obviously insufficient.
Disclosure of Invention
In order to solve the problems in the prior art, at least one embodiment of the present invention provides a method for implementing a multivariate high-efficiency download service, including:
acquiring an interface of a downloading service, judging whether the interface has an optimal downloading mode, and calling the interface to download through the optimal downloading mode if the interface has the optimal downloading mode;
when the optimal downloading mode fails to download, reducing the weight value of the optimal downloading mode, and calling the interface to download by using the common downloading mode according to the weight value sequence of the common downloading mode;
when the downloading of the common downloading mode is successful, stopping downloading, increasing the weight value of the common downloading mode with successful downloading, and reducing the weight value of the common downloading mode with failed downloading;
and storing the optimal downloading mode, the weight value of the optimal downloading mode, the common downloading mode and the weight value of the common downloading mode corresponding to the interface, and taking the downloading mode with the maximum weight value in the optimal downloading mode and the common downloading mode as a new optimal downloading mode.
Based on the above technical solutions, the embodiments of the present invention may be further improved as follows.
Optionally, the method further includes:
when any one of the optimal downloading mode or the common downloading mode is successfully downloaded, judging whether the downloading frequency of the corresponding downloading mode exceeds a preset value;
when the download times N of the corresponding download modes do not exceed a preset value, calculating the weight values of the corresponding download modes through the following formula;
F=g+s*100/t;
wherein, F is the weighted value of the corresponding downloading mode after successful downloading, g is the weighted value of 1 time before the corresponding downloading mode succeeds in downloading, s is a preset constant value, and t is the downloading duration of the corresponding downloading mode;
or, when the download times N of the corresponding download modes exceed a preset value, calculating the weight values of the corresponding download modes through the following formula;
F'=g+s*100/t;
Figure BDA0001601219720000021
wherein, F is the weight value of the corresponding downloading mode after successful downloading, F' is the weight spare value of the corresponding downloading mode after successful downloading, F (i) is the weight value of the ith downloading of the corresponding downloading mode, M is a preset integer, g is the weight value of 1 time before successful downloading of the corresponding downloading mode, s is a preset constant value, and t is the downloading time length of the corresponding downloading mode.
Optionally, the method further includes:
when any one of the optimal downloading mode or the common downloading mode fails to download, judging whether the downloading frequency of the corresponding downloading mode exceeds a preset value;
when the download times N of the corresponding download modes do not exceed a preset value, calculating the weight values of the corresponding download modes through the following calculation formula;
Figure BDA0001601219720000022
wherein, L is the weighted value of the corresponding downloading mode after the downloading fails, h is the weighted value of 1 time before the downloading fails in the corresponding downloading mode, and count is the number of times of successful downloading in the corresponding downloading mode;
or when the download times N of the corresponding download modes exceed a preset value, the weight values of the corresponding download modes are calculated firstly through the following calculation formula;
Figure BDA0001601219720000031
Figure BDA0001601219720000032
wherein, L is a weighted value of the corresponding downloading mode after the downloading fails, L' is a weighted pre-value of the corresponding downloading mode after the downloading fails, L (i) is a weighted value of the ith downloading mode in the corresponding downloading mode, M is a preset integer, h is a weighted value of 1 time before the downloading fails in the corresponding downloading mode, and count is the number of times of the downloading success in the corresponding downloading mode.
Optionally, the method further includes:
when the interface does not have the optimal downloading mode, calling the interface to download by using all common downloading modes;
calculating the weight value of each common downloading mode according to the downloading time length of each common downloading mode;
and storing the weight values of the interface corresponding to all the common downloading modes and the common downloading modes, wherein the common downloading mode with the largest weight value is the optimal downloading mode.
Optionally, calculating a weight value of each common downloading mode according to the downloading duration of each common downloading mode specifically includes:
when the common downloading mode is successfully downloaded within a preset time length, calculating a weight value of the common downloading mode through a weight calculation formula;
f=s*100/t;
wherein f is a weighted value of the common downloading mode, s is a preset value constant, and t is a downloading time length of the common downloading mode;
or, when the downloading of the common downloading mode fails within a preset time length, the weight value of the common downloading mode is 0.
The embodiment of the invention also provides a multielement high-efficiency download service system, which is applied to a Dubbo service framework and comprises the following components: the system comprises a data downloading subsystem, a weight value calculating subsystem and a database; the data downloading subsystem can download data in various downloading modes;
the data downloading subsystem is used for acquiring an interface of a downloading service, inquiring whether a corresponding optimal downloading mode exists in the database according to the interface, and calling the interface to download through the optimal downloading mode if the optimal downloading mode exists;
the data downloading subsystem is further configured to, when the downloading of the optimal downloading mode fails, reduce the weight value of the optimal downloading mode through the weight value calculating subsystem, and sequentially use the common downloading mode to call the interface for downloading according to the weight value order of the common downloading mode stored in the database;
the data downloading subsystem is also used for stopping downloading when the downloading of the common downloading mode is successful, increasing the weight value of the common downloading mode with successful downloading through the weight value calculating subsystem and reducing the weight value of the common downloading mode with failed downloading;
the data downloading subsystem is further configured to store, in the database, the interface corresponding to the optimal downloading mode, the weight value of the optimal downloading mode, the weight values of the common downloading modes and the common downloading modes, and use the downloading mode with the largest weight value in the optimal downloading mode and the common downloading mode as a new optimal downloading mode.
Optionally, the data downloading subsystem is further configured to, when the downloading of any one of the optimal downloading method and the normal downloading method is successful, determine whether the number of downloading times of the corresponding downloading method exceeds a preset value;
when the download times N of the corresponding download modes do not exceed a preset value, calling the weight value calculation subsystem to calculate the weight values of the corresponding download modes through the following formula;
F=g+s*100/t;
wherein, F is the weighted value of the corresponding downloading mode after successful downloading, g is the weighted value of 1 time before the corresponding downloading mode succeeds in downloading, s is a preset constant value, and t is the downloading duration of the corresponding downloading mode;
or when the download times N of the corresponding download modes exceed a preset value, calling the weight value calculation subsystem to calculate the weight values of the corresponding download modes through the following formula;
F'=g+s*100/t;
Figure BDA0001601219720000051
wherein, F is the weight value of the corresponding downloading mode after successful downloading, F' is the weight spare value of the corresponding downloading mode after successful downloading, F (i) is the weight value of the ith downloading of the corresponding downloading mode, M is a preset integer, g is the weight value of 1 time before successful downloading of the corresponding downloading mode, s is a preset constant value, and t is the downloading time length of the corresponding downloading mode.
Optionally, the data downloading subsystem is further configured to determine whether the number of downloading times of the corresponding downloading method exceeds a preset value when the downloading of any one of the optimal downloading method and the normal downloading method fails;
when the download times N of the corresponding download modes do not exceed a preset value, calling the weight value calculation subsystem to calculate the weight values of the corresponding download modes through the following calculation formula;
Figure BDA0001601219720000052
wherein, L is the weighted value of the corresponding downloading mode after the downloading fails, h is the weighted value of 1 time before the downloading fails in the corresponding downloading mode, and count is the number of times of successful downloading in the corresponding downloading mode;
or when the download times N of the corresponding download modes exceed a preset value, calling the weight value calculation subsystem to calculate the weight values of the corresponding download modes firstly through the following calculation formula;
Figure BDA0001601219720000053
Figure BDA0001601219720000061
wherein, L is a weighted value of the corresponding downloading mode after the downloading fails, L' is a weighted pre-value of the corresponding downloading mode after the downloading fails, L (i) is a weighted value of the ith downloading mode in the corresponding downloading mode, M is a preset integer, h is a weighted value of 1 time before the downloading fails in the corresponding downloading mode, and count is the number of times of the downloading success in the corresponding downloading mode.
Optionally, the data downloading subsystem is further configured to query whether a corresponding optimal downloading mode exists in the database according to the interface, and when the optimal downloading mode does not exist in the interface, call the interface to perform downloading using all common downloading modes; calling the weight value calculation subsystem to calculate the weight value of each common downloading mode according to the downloading time length of each common downloading mode; and storing the weight values of the interface corresponding to all the common downloading modes and the common downloading modes, wherein the common downloading mode with the largest weight value is the optimal downloading mode.
Optionally, the weight value calculating subsystem is specifically configured to calculate a weight value of the ordinary downloading mode according to the following weight calculation formula when the ordinary downloading mode is successfully downloaded within a preset time;
f=s*100/t;
wherein f is a weighted value of the common downloading mode, s is a preset value constant, and t is a downloading time length of the common downloading mode;
or, when the downloading of the common downloading mode fails within a preset time length, the weight value of the common downloading mode is 0.
Compared with the prior art, the technical scheme of the invention has the following advantages: according to the embodiment of the invention, the corresponding interfaces are called to download according to the optimal downloading mode or the common downloading mode in sequence according to the weighted values of the downloading modes corresponding to different interfaces, so that the optimal downloading mode is selected to download according to different interfaces, the downloading task corresponding to the interface is quickly completed, and a diversified high-concurrency downloading service response mechanism with universality, high efficiency, high reliability and high expansibility is realized.
Drawings
Fig. 1 is a schematic flow chart of a method for implementing a multi-source efficient download service according to an embodiment of the present invention;
FIG. 2 is a flow chart illustrating a method for implementing a multi-source efficient download service according to another embodiment of the present invention;
fig. 3 is a schematic structural diagram of a multi-source efficient download service system according to another embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be obtained by a person skilled in the art without any inventive step based on the embodiments of the present invention, are within the scope of the present invention.
As shown in fig. 1, a method for implementing a multivariate high-efficiency download service provided in an embodiment of the present invention includes:
acquiring an interface of a downloading service, judging whether the interface has an optimal downloading mode, and if so, calling the interface to download through the optimal downloading mode;
specifically, different information download addresses correspond to different interfaces, for example, different URL addresses are uniform resource locators, which are a concise representation of the location and access method of resources available from the internet and are addresses of standard resources on the internet. The interface is stored with the weight values of each downloading mode and each downloading mode, when the interface is not used, the weight values of the downloading modes are 0 or the weight values do not exist, after the interface is used, different downloading efficiencies are provided corresponding to different downloading modes, and at the moment, the optimal downloading mode is selected to call the interface to download data according to the weight value sequence of the downloading modes.
When the downloading of the optimal downloading mode fails, reducing the weight value of the optimal downloading mode, and sequentially calling the interfaces to download by using the common downloading mode according to the weight value of the common downloading mode;
specifically, when the downloading of the optimal downloading mode fails, the weight value of the optimal downloading mode is reduced through the following calculation formula, and whether the downloading frequency of the optimal downloading mode exceeds a preset value is judged;
when the download times N of the corresponding download mode do not exceed a preset value, calculating the weight value of the corresponding download mode through the following calculation formula;
Figure BDA0001601219720000081
wherein, L is the weighted value of the corresponding downloading mode after the downloading fails, h is the weighted value of 1 time before the downloading fails in the corresponding downloading mode, and count is the number of times of successful downloading in the corresponding downloading mode;
or when the download times N of the corresponding download mode exceed a preset value, firstly calculating the weight value of the corresponding download mode through the following calculation formula;
Figure BDA0001601219720000082
Figure BDA0001601219720000083
wherein, L is the weighted value of the corresponding downloading mode after the downloading fails, L' is the weighted pre-value of the corresponding downloading mode after the downloading fails, L (i) is the weighted value of the ith downloading mode corresponding to the downloading mode, M is a preset integer, h is the weighted value of 1 time before the downloading fails in the corresponding downloading mode, and count is the number of times of successful downloading in the corresponding downloading mode. Under different conditions, the weight values to be reduced are calculated through different calculation formulas, wherein when the number of times of the historical downloading success of the optimal downloading mode is higher and the downloading fails, the reduced weight values are smaller, the interference of the downloading failure on the weight values of the optimal downloading mode due to server fluctuation and the like is avoided, and then the interface is sequentially called to download according to the weight values of other common downloading modes.
When the downloading of the common downloading mode is successful, stopping downloading, increasing the weight value of the common downloading mode with successful downloading, and reducing the weight value of the common downloading mode with failed downloading;
specifically, when the other common downloading modes are successfully downloaded, the downloading is stopped, the other common downloading modes are not called for downloading any more, the weight value of the successfully downloaded common downloading mode is increased through the following calculation formula, and whether the downloading frequency of the common downloading mode exceeds a preset value is judged;
when the download times N of the corresponding download mode do not exceed a preset value, calculating the weight value of the corresponding download mode through the following formula;
F=g+s*100/t;
f is the weight value of the corresponding downloading mode after successful downloading, g is the weight value of 1 time before successful downloading of the corresponding downloading mode, s is a preset constant value, and t is the downloading time length of the corresponding downloading mode;
or when the download times N of the corresponding download mode exceed a preset value, calculating the weight value of the corresponding download mode through the following formula;
F'=g+s*100/t;
Figure BDA0001601219720000091
f is a weighted value of the corresponding downloading mode after successful downloading, F' is a weighted standby value of the corresponding downloading mode after successful downloading, F (i) is a weighted value of the ith downloading mode corresponding to the downloading mode, M is a preset integer, g is a weighted value of 1 time before successful downloading of the corresponding downloading mode, s is a preset constant value, and t is the downloading time length of the corresponding downloading mode.
Reducing the weight value of the common downloading mode with failed downloading through the following calculation formula, and judging whether the downloading frequency of the common downloading mode exceeds a preset value or not;
when the download times N of the corresponding download mode do not exceed a preset value, calculating the weight value of the corresponding download mode through the following formula;
F=g+s*100/t;
f is the weight value of the corresponding downloading mode after successful downloading, g is the weight value of 1 time before successful downloading of the corresponding downloading mode, s is a preset constant value, and t is the downloading time length of the corresponding downloading mode;
or when the download times N of the corresponding download mode exceed a preset value, calculating the weight value of the corresponding download mode through the following formula;
F'=g+s*100/t;
Figure BDA0001601219720000101
f is a weighted value of the corresponding downloading mode after successful downloading, F' is a weighted standby value of the corresponding downloading mode after successful downloading, F (i) is a weighted value of the ith downloading mode corresponding to the downloading mode, M is a preset integer, g is a weighted value of 1 time before successful downloading of the corresponding downloading mode, s is a preset constant value, and t is the downloading time length of the corresponding downloading mode.
Storing the optimal downloading mode, the weight value of the optimal downloading mode, the common downloading mode and the weight value of the common downloading mode corresponding to the interface, and taking the downloading mode with the maximum weight value in the optimal downloading mode and the common downloading mode as a new optimal downloading mode;
specifically, the downloading modes corresponding to the interfaces and the weight value of each downloading mode are stored, and the downloading mode with the largest weight value is used as a new optimal downloading mode, so that the efficiency of downloading data next time is improved.
In the above embodiment, the weight values of different downloading manners are calculated for each interface, where the downloading manner includes: the Http downloading mode, the overseas agent downloading mode and the socks agent downloading mode are not limited in the types of the downloading modes, downloading can be performed in other common downloading modes, the interfaces are called to download according to the weight values of different downloading modes, the downloading efficiency is improved, punishment is performed on the weight value of the downloading mode with downloading failure, the weight value of the downloading mode with downloading success is improved, therefore, the change of the optimal downloading mode of different interfaces is realized, and each interface is guaranteed to download in the most effective downloading mode.
In this embodiment, when the optimal downloading mode is successfully downloaded, whether the downloading frequency of the corresponding downloading mode exceeds a preset value is judged;
when the download times N of the corresponding download mode do not exceed a preset value, calculating the weight value of the corresponding download mode through the following formula;
F=g+s*100/t;
f is the weight value of the corresponding downloading mode after successful downloading, g is the weight value of 1 time before successful downloading of the corresponding downloading mode, s is a preset constant value, and t is the downloading time length of the corresponding downloading mode;
or when the download times N of the corresponding download mode exceed a preset value, calculating the weight value of the corresponding download mode through the following formula;
F'=g+s*100/t;
Figure BDA0001601219720000111
f is a weighted value of the corresponding downloading mode after successful downloading, F' is a weighted standby value of the corresponding downloading mode after successful downloading, F (i) is a weighted value of the ith downloading mode corresponding to the downloading mode, M is a preset integer, g is a weighted value of 1 time before successful downloading of the corresponding downloading mode, s is a preset constant value, and t is the downloading time length of the corresponding downloading mode.
As shown in fig. 2, in a specific embodiment, an interface of a download service is obtained, whether the interface has an optimal download mode is determined, and when the interface does not have the optimal download mode, all common download modes are used to call the interface for downloading;
calculating the weight value of each common downloading mode according to the downloading time length of each common downloading mode;
and storing the weight values of the interface corresponding to all the common downloading modes and the common downloading modes, wherein the common downloading mode with the largest weight value is the optimal downloading mode.
In this embodiment, when the interface does not have the corresponding optimal downloading mode, that is, the interface has not performed the downloading task, all downloading modes corresponding to the interface call the interface to perform data downloading, the weight value of each downloading mode is calculated according to the downloading duration, then the interface, the downloading modes and the weight values of the downloading modes are stored, and the downloading mode with the largest weight value is used as the optimal downloading mode, so that the interface is called for downloading next time.
In this embodiment, calculating the weight value of each common downloading manner according to the downloading duration of each common downloading manner specifically includes:
when the common downloading mode is successfully downloaded within the preset time length, calculating a weighted value of the common downloading mode through the following weight calculation formula;
f=s*100/t;
wherein f is a weighted value of the common downloading mode, s is a preset value constant, and t is the downloading time of the common downloading mode; the weight value of the common downloading mode is inversely proportional to the downloading time of the common downloading mode, i.e., the larger the downloading time is, the smaller the weight value of the common downloading mode is.
Or, when the downloading of the common downloading mode fails within the preset time length, the weight value of the common downloading mode is 0.
As shown in fig. 3, an embodiment of the present invention further provides a multi-element efficient download service system, which is applied to a Dubbo service framework, and includes: the system comprises a data downloading subsystem, a weight value calculating subsystem and a database; the data downloading subsystem can download data in various downloading modes; the Dubbo service framework is an open source distributed service framework, so that the application can realize the output and input functions of the service through high-performance remote calling.
In this embodiment, the data downloading subsystem is configured to obtain an interface of a downloading service, query whether a corresponding optimal downloading mode exists in the database according to the interface, and if so, invoke the interface to download through the optimal downloading mode;
the data downloading subsystem is also used for reducing the weight value of the optimal downloading mode through the weight value calculating subsystem when the downloading of the optimal downloading mode fails, and specifically, judging whether the downloading frequency of the corresponding downloading mode exceeds a preset value or not;
when the download times N of the corresponding download modes do not exceed a preset value, calling a weight value calculation subsystem to calculate the weight values of the corresponding download modes through the following calculation formula;
Figure BDA0001601219720000121
wherein, L is the weighted value of the corresponding downloading mode after the downloading fails, h is the weighted value of 1 time before the downloading fails in the corresponding downloading mode, and count is the number of times of successful downloading in the corresponding downloading mode;
or when the download times N of the corresponding download modes exceed a preset value, calling the weight value calculation subsystem to calculate the weight value of the corresponding download modes firstly through the following calculation formula;
Figure BDA0001601219720000131
Figure BDA0001601219720000132
wherein, L is the weighted value of the corresponding downloading mode after the downloading fails, L' is the weighted preset value of the corresponding downloading mode after the downloading fails, L (i) is the weighted value of the ith downloading mode corresponding to the downloading mode, M is a preset integer, h is the weighted value of 1 time before the downloading fails in the corresponding downloading mode, and count is the number of times of successful downloading in the corresponding downloading mode; and sequentially calling the interfaces to download according to the weight value sequence of the common downloading mode stored in the database.
In this embodiment, the data downloading subsystem is further configured to stop downloading when the downloading of the common downloading manner is successful, increase a weight value of the successfully downloaded common downloading manner through the weight value calculating subsystem, and specifically, determine whether the downloading frequency of the corresponding downloading manner exceeds a preset value;
when the download times N of the corresponding download modes do not exceed a preset value, calling a weight value calculation subsystem to calculate the weight values of the corresponding download modes through the following formula;
F=g+s*100/t;
f is the weight value of the corresponding downloading mode after successful downloading, g is the weight value of 1 time before successful downloading of the corresponding downloading mode, s is a preset constant value, and t is the downloading time length of the corresponding downloading mode;
or when the download times N of the corresponding download modes exceed a preset value, calling the weight value calculation subsystem to calculate the weight values of the corresponding download modes through the following formula;
F'=g+s*100/t;
Figure BDA0001601219720000133
f is a weighted value of a corresponding downloading mode after successful downloading, F' is a weighted standby value of the corresponding downloading mode after successful downloading, F (i) is a weighted value of the ith downloading mode corresponding to the downloading mode, M is a preset integer, g is a weighted value of 1 time before successful downloading of the corresponding downloading mode, s is a preset constant value, and t is a downloading time length of the corresponding downloading mode; reducing the weight value of the common downloading mode with failed downloading, specifically judging whether the downloading frequency of the corresponding downloading mode exceeds a preset value;
when the download times N of the corresponding download modes do not exceed a preset value, calling a weight value calculation subsystem to calculate the weight values of the corresponding download modes through the following calculation formula;
Figure BDA0001601219720000141
wherein, L is the weighted value of the corresponding downloading mode after the downloading fails, h is the weighted value of 1 time before the downloading fails in the corresponding downloading mode, and count is the number of times of successful downloading in the corresponding downloading mode;
or when the download times N of the corresponding download modes exceed a preset value, calling the weight value calculation subsystem to calculate the weight value of the corresponding download modes firstly through the following calculation formula;
Figure BDA0001601219720000142
Figure BDA0001601219720000143
wherein, L is the weighted value of the corresponding downloading mode after the downloading fails, L' is the weighted preset value of the corresponding downloading mode after the downloading fails, L (i) is the weighted value of the ith downloading mode corresponding to the downloading mode, M is a preset integer, h is the weighted value of 1 time before the downloading fails in the corresponding downloading mode, and count is the number of times of successful downloading in the corresponding downloading mode; and sequentially calling the interfaces to download according to the weight value sequence of the common downloading mode stored in the database.
In this embodiment, the data downloading subsystem is further configured to store, in the database, the interface corresponding to the optimal downloading mode, the weight value of the optimal downloading mode, and the weight values of the normal downloading mode and the normal downloading mode, and use the downloading mode with the largest weight value in the optimal downloading mode and the normal downloading mode as the new optimal downloading mode.
In this embodiment, the data downloading subsystem is further configured to, when the optimal downloading manner is successfully downloaded, determine whether the number of downloading times of the corresponding downloading manner exceeds a preset value;
when the download times N of the corresponding download modes do not exceed a preset value, calling a weight value calculation subsystem to calculate the weight values of the corresponding download modes through the following formula;
F=g+s*100/t;
f is the weight value of the corresponding downloading mode after successful downloading, g is the weight value of 1 time before successful downloading of the corresponding downloading mode, s is a preset constant value, and t is the downloading time length of the corresponding downloading mode;
or when the download times N of the corresponding download modes exceed a preset value, calling the weight value calculation subsystem to calculate the weight values of the corresponding download modes through the following formula;
F'=g+s*100/t;
Figure BDA0001601219720000151
f is a weighted value of the corresponding downloading mode after successful downloading, F' is a weighted standby value of the corresponding downloading mode after successful downloading, F (i) is a weighted value of the ith downloading mode corresponding to the downloading mode, M is a preset integer, g is a weighted value of 1 time before successful downloading of the corresponding downloading mode, s is a preset constant value, and t is the downloading time length of the corresponding downloading mode.
In a specific embodiment, the data downloading subsystem is further configured to obtain an interface of the downloading service, query whether a corresponding optimal downloading mode exists in the database according to the interface, and call the interface to download by using all common downloading modes when the optimal downloading mode does not exist in the interface; calling a weight value calculation subsystem to calculate the weight value of each common downloading mode according to the downloading time length of each common downloading mode; and storing the weight values of the interface corresponding to all the common downloading modes and the common downloading modes, wherein the common downloading mode with the largest weight value is the optimal downloading mode.
In this embodiment, the weight value calculating subsystem is specifically configured to calculate a weight value of the ordinary downloading mode according to the following weight calculation formula when the ordinary downloading mode succeeds in downloading within a preset time;
f=s*100/t;
wherein f is a weighted value of the common downloading mode, s is a preset value constant, and t is the downloading time of the common downloading mode;
or, when the downloading of the common downloading mode fails within the preset time length, the weight value of the common downloading mode is 0.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (10)

1. A method for implementing a multi-element efficient download service is characterized by comprising the following steps:
acquiring an interface of a downloading service, judging whether the interface has an optimal downloading mode, and calling the interface to download through the optimal downloading mode if the interface has the optimal downloading mode;
when the optimal downloading mode fails to download, reducing the weight value of the optimal downloading mode, and calling the interface to download by using the common downloading mode according to the weight value sequence of the common downloading mode;
when the downloading of the common downloading mode is successful, stopping downloading, increasing the weight value of the common downloading mode with successful downloading, and reducing the weight value of the common downloading mode with failed downloading;
and storing the optimal downloading mode, the weight value of the optimal downloading mode, the common downloading mode and the weight value of the common downloading mode corresponding to the interface, and taking the downloading mode with the maximum weight value in the optimal downloading mode and the common downloading mode as a new optimal downloading mode.
2. The method for implementing the multiple efficient download service according to claim 1, further comprising:
when any one of the optimal downloading mode or the common downloading mode is successfully downloaded, judging whether the downloading frequency of the corresponding downloading mode exceeds a preset value;
when the download times N of the corresponding download modes do not exceed a preset value, calculating the weight values of the corresponding download modes through the following formula;
F=g+s*100/t;
wherein, F is the weighted value of the corresponding downloading mode after successful downloading, g is the weighted value of 1 time before the corresponding downloading mode succeeds in downloading, s is a preset constant value, and t is the downloading duration of the corresponding downloading mode;
or, when the download times N of the corresponding download modes exceed a preset value, calculating the weight values of the corresponding download modes through the following formula;
F'=g+s*100/t;
Figure FDA0002617642150000021
wherein, F is the weight value of the corresponding downloading mode after successful downloading, F' is the weight spare value of the corresponding downloading mode after successful downloading, F (i) is the weight value of the ith downloading of the corresponding downloading mode, M is a preset integer, g is the weight value of 1 time before successful downloading of the corresponding downloading mode, s is a preset constant value, and t is the downloading time length of the corresponding downloading mode.
3. The method for implementing the multiple efficient download service according to claim 1, further comprising:
when any one of the optimal downloading mode or the common downloading mode fails to download, judging whether the downloading frequency of the corresponding downloading mode exceeds a preset value;
when the download times N of the corresponding download modes do not exceed a preset value, calculating the weight values of the corresponding download modes through the following calculation formula;
Figure FDA0002617642150000022
wherein, L is the weighted value of the corresponding downloading mode after the downloading fails, h is the weighted value of 1 time before the downloading fails in the corresponding downloading mode, and count is the number of times of successful downloading in the corresponding downloading mode;
or when the download times N of the corresponding download modes exceed a preset value, the weight values of the corresponding download modes are calculated firstly through the following calculation formula;
Figure FDA0002617642150000023
Figure FDA0002617642150000024
wherein, L is a weighted value of the corresponding downloading mode after the downloading fails, L' is a weighted pre-value of the corresponding downloading mode after the downloading fails, L (i) is a weighted value of the ith downloading mode in the corresponding downloading mode, M is a preset integer, h is a weighted value of 1 time before the downloading fails in the corresponding downloading mode, and count is the number of times of the downloading success in the corresponding downloading mode.
4. The method for implementing the multiple efficient download service according to any one of the claims 1 to 3, further comprising:
when the interface does not have the optimal downloading mode, calling the interface to download by using all common downloading modes;
calculating the weight value of each common downloading mode according to the downloading time length of each common downloading mode;
and storing the weight values of the interface corresponding to all the common downloading modes and the common downloading modes, wherein the common downloading mode with the largest weight value is the optimal downloading mode.
5. The method for implementing a multivariate high-efficiency download service according to claim 4, wherein the step of calculating the weight value of each common download mode according to the download duration of each common download mode specifically comprises the steps of:
when the common downloading mode is successfully downloaded within a preset time length, calculating a weight value of the common downloading mode through a weight calculation formula;
f=s*100/t;
wherein f is a weighted value of the common downloading mode, s is a preset value constant, and t is a downloading time length of the common downloading mode;
or, when the downloading of the common downloading mode fails within a preset time length, the weight value of the common downloading mode is 0.
6. A multi-element high-efficiency download service system is applied to a Dubbo service framework and is characterized by comprising: the system comprises a data downloading subsystem, a weight value calculating subsystem and a database; the data downloading subsystem can download data in various downloading modes;
the data downloading subsystem is used for acquiring an interface of a downloading service, inquiring whether a corresponding optimal downloading mode exists in the database according to the interface, and calling the interface to download through the optimal downloading mode if the optimal downloading mode exists;
the data downloading subsystem is further configured to, when the downloading of the optimal downloading mode fails, reduce the weight value of the optimal downloading mode through the weight value calculating subsystem, and sequentially use the common downloading mode to call the interface for downloading according to the weight value order of the common downloading mode stored in the database;
the data downloading subsystem is also used for stopping downloading when the downloading of the common downloading mode is successful, increasing the weight value of the common downloading mode with successful downloading through the weight value calculating subsystem and reducing the weight value of the common downloading mode with failed downloading;
the data downloading subsystem is further configured to store, in the database, the interface corresponding to the optimal downloading mode, the weight value of the optimal downloading mode, the weight values of the common downloading modes and the common downloading modes, and use the downloading mode with the largest weight value in the optimal downloading mode and the common downloading mode as a new optimal downloading mode.
7. The multi-element efficient download service system of claim 6, wherein the data download subsystem is further configured to determine whether the number of downloads of the corresponding download mode exceeds a predetermined value when the download of any of the optimal download mode or the normal download mode is successful;
when the download times N of the corresponding download modes do not exceed a preset value, calling the weight value calculation subsystem to calculate the weight values of the corresponding download modes through the following formula;
F=g+s*100/t;
wherein, F is the weighted value of the corresponding downloading mode after successful downloading, g is the weighted value of 1 time before the corresponding downloading mode succeeds in downloading, s is a preset constant value, and t is the downloading duration of the corresponding downloading mode;
or when the download times N of the corresponding download modes exceed a preset value, calling the weight value calculation subsystem to calculate the weight values of the corresponding download modes through the following formula;
F'=g+s*100/t;
Figure FDA0002617642150000041
wherein, F is the weight value of the corresponding downloading mode after successful downloading, F' is the weight spare value of the corresponding downloading mode after successful downloading, F (i) is the weight value of the ith downloading of the corresponding downloading mode, M is a preset integer, g is the weight value of 1 time before successful downloading of the corresponding downloading mode, s is a preset constant value, and t is the downloading time length of the corresponding downloading mode.
8. The multi-element efficient download service system of claim 6, wherein the data download subsystem is further configured to determine whether the number of downloads of the corresponding download mode exceeds a predetermined value when any download mode of the optimal download mode or the normal download mode fails;
when the download times N of the corresponding download modes do not exceed a preset value, calling the weight value calculation subsystem to calculate the weight values of the corresponding download modes through the following calculation formula;
Figure FDA0002617642150000051
wherein, L is the weighted value of the corresponding downloading mode after the downloading fails, h is the weighted value of 1 time before the downloading fails in the corresponding downloading mode, and count is the number of times of successful downloading in the corresponding downloading mode;
or when the download times N of the corresponding download modes exceed a preset value, calling the weight value calculation subsystem to calculate the weight values of the corresponding download modes firstly through the following calculation formula;
Figure FDA0002617642150000052
Figure FDA0002617642150000053
wherein, L is a weighted value of the corresponding downloading mode after the downloading fails, L' is a weighted pre-value of the corresponding downloading mode after the downloading fails, L (i) is a weighted value of the ith downloading mode in the corresponding downloading mode, M is a preset integer, h is a weighted value of 1 time before the downloading fails in the corresponding downloading mode, and count is the number of times of the downloading success in the corresponding downloading mode.
9. The multiple efficient download service system according to any of the claims 6-8, wherein the data download subsystem is further configured to query whether there is a corresponding optimal download mode in the database according to the interface, and when there is no optimal download mode in the interface, call the interface for downloading using all common download modes; calling the weight value calculation subsystem to calculate the weight value of each common downloading mode according to the downloading time length of each common downloading mode; and storing the weight values of the interface corresponding to all the common downloading modes and the common downloading modes, wherein the common downloading mode with the largest weight value is the optimal downloading mode.
10. The multi-element efficient download service system according to claim 9, wherein the weight value calculating subsystem is specifically configured to calculate a weight value of the normal download mode according to the following weight calculation formula when the normal download mode succeeds in downloading within a preset time period;
f=s*100/t;
wherein f is a weighted value of the common downloading mode, s is a preset value constant, and t is a downloading time length of the common downloading mode;
or, when the downloading of the common downloading mode fails within a preset time length, the weight value of the common downloading mode is 0.
CN201810225500.3A 2018-03-19 2018-03-19 Method and system for realizing multi-element efficient downloading service Active CN108683693B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810225500.3A CN108683693B (en) 2018-03-19 2018-03-19 Method and system for realizing multi-element efficient downloading service

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810225500.3A CN108683693B (en) 2018-03-19 2018-03-19 Method and system for realizing multi-element efficient downloading service

Publications (2)

Publication Number Publication Date
CN108683693A CN108683693A (en) 2018-10-19
CN108683693B true CN108683693B (en) 2020-10-23

Family

ID=63799395

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810225500.3A Active CN108683693B (en) 2018-03-19 2018-03-19 Method and system for realizing multi-element efficient downloading service

Country Status (1)

Country Link
CN (1) CN108683693B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101227460A (en) * 2007-01-19 2008-07-23 秦晨 Method for uploading and downloading distributed document and apparatus and system thereof
CN101383751A (en) * 2008-07-24 2009-03-11 四川长虹电器股份有限公司 Network downloading method
CN102055805A (en) * 2010-12-30 2011-05-11 Tcl集团股份有限公司 Device and method for point-to-point (P2P) downloading based on internetwork protocol standards
CN103414770A (en) * 2013-08-05 2013-11-27 贝壳网际(北京)安全技术有限公司 File downloading method and device and file downloading suggestion method and device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8831041B2 (en) * 2011-06-27 2014-09-09 Citrix Systems, Inc. Prioritizing highly compressed traffic to provide a predetermined quality of service

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101227460A (en) * 2007-01-19 2008-07-23 秦晨 Method for uploading and downloading distributed document and apparatus and system thereof
CN101383751A (en) * 2008-07-24 2009-03-11 四川长虹电器股份有限公司 Network downloading method
CN102055805A (en) * 2010-12-30 2011-05-11 Tcl集团股份有限公司 Device and method for point-to-point (P2P) downloading based on internetwork protocol standards
CN103414770A (en) * 2013-08-05 2013-11-27 贝壳网际(北京)安全技术有限公司 File downloading method and device and file downloading suggestion method and device

Also Published As

Publication number Publication date
CN108683693A (en) 2018-10-19

Similar Documents

Publication Publication Date Title
US7363369B2 (en) Monitoring thread usage to dynamically control a thread pool
CN111092877B (en) Data processing method and device, electronic equipment and storage medium
CN103841134B (en) Based on API transmission, the method for receive information, apparatus and system
JP6180430B2 (en) Dynamic voice menu technology
CN112148711B (en) Batch processing task processing method and device
CN110633442A (en) Pushing method and device and electronic equipment
CN112054998A (en) Proxy service method, device, equipment and computer readable storage medium
CN105338063A (en) Multi-server user session sharing method and device
CN112015578B (en) Wind control system and method based on pre-synchronous processing and post-asynchronous processing
US7685603B2 (en) Selecting client adapters
CN110650209A (en) Method and device for realizing load balance
US7739389B2 (en) Providing web services from a service environment with a gateway
CN109347918A (en) Call method, calling device, server, terminal and computer readable storage medium
CN101667139A (en) Service program invocation method based on aggregate type object, device and system therefor
CN107249019A (en) Data handling system, method, device and server based on business
US8510426B2 (en) Communication and coordination between web services in a cloud-based computing environment
CN108683693B (en) Method and system for realizing multi-element efficient downloading service
CN111294377B (en) Dependency network request sending method, terminal device and storage medium
CN109271259B (en) Enterprise service bus system, data processing method, terminal and storage medium
CN113127335A (en) System testing method and device
CN116319988A (en) Data processing method, system, storage medium and equipment
CN110636073A (en) Distributed asynchronous remote service arranging and calling technology
CN112333270B (en) Method and system for dynamic routing of micro-services
CN112988405B (en) Automatic degradation method and device for micro-service and computing equipment
CN111131643B (en) Call control method and device

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
GR01 Patent grant
GR01 Patent grant