CN108111561B - Data downloading method and equipment thereof - Google Patents

Data downloading method and equipment thereof Download PDF

Info

Publication number
CN108111561B
CN108111561B CN201611059732.3A CN201611059732A CN108111561B CN 108111561 B CN108111561 B CN 108111561B CN 201611059732 A CN201611059732 A CN 201611059732A CN 108111561 B CN108111561 B CN 108111561B
Authority
CN
China
Prior art keywords
data
url
application server
alternative
target data
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
CN201611059732.3A
Other languages
Chinese (zh)
Other versions
CN108111561A (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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201611059732.3A priority Critical patent/CN108111561B/en
Publication of CN108111561A publication Critical patent/CN108111561A/en
Application granted granted Critical
Publication of CN108111561B publication Critical patent/CN108111561B/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]

Abstract

The embodiment of the invention discloses a data downloading method and equipment thereof, wherein the method comprises the following steps: sending a data downloading request carrying a data name of target data to an application server so that the application server obtains an original URL corresponding to the data name; acquiring an original URL returned by an application server, and detecting the original URL; when detecting that the original URL is the hijacked URL, sending an alternative downloading request carrying the data name to an application server so that the application server obtains an alternative URL corresponding to the data name; acquiring an alternative URL returned by an application server, and acquiring a first data volume of target data by adopting the alternative URL; and when the error between the first data volume and the preset data volume of the target data is less than or equal to a preset threshold value, downloading the target data in the application server by adopting the alternative URL. By adopting the invention, the safety of data downloading can be ensured, the accuracy of data is improved, and the efficiency of data downloading is further ensured.

Description

Data downloading method and equipment thereof
Technical Field
The invention relates to the technical field of internet, in particular to a data downloading method and equipment.
Background
With the continuous development and improvement of internet technology, terminals such as mobile phones and tablet computers become an indispensable part of people's lives, and people can communicate by using the terminals and can also transmit files, pick up images, play games and the like.
Data in a terminal (e.g., terminal application data, multimedia data, etc.) can be obtained from a corresponding application server based on the internet, the application server generally issues a Uniform Resource Locator (URL) corresponding to the data to the terminal, and the terminal downloads the data from the application server based on the URL, however, the URL is often tampered with maliciously by an external network in a transmission process, that is, the URL has a hijacked behavior, so that the actually downloaded data is not expected data, the security of data downloading is affected, the accuracy of the data is reduced, and the efficiency of data downloading is further affected.
Disclosure of Invention
The embodiment of the invention provides a data downloading method and equipment thereof, which can ensure the safety of data downloading, improve the accuracy of data and further ensure the efficiency of data downloading.
A first aspect of an embodiment of the present invention provides a data downloading method, which may include:
sending a data downloading request carrying a data name of target data to an application server so that the application server obtains an original URL corresponding to the data name;
acquiring the original URL returned by the application server, and detecting the original URL;
when detecting that the original URL is a hijacked URL, sending an alternative downloading request carrying the data name to the application server so that the application server obtains an alternative URL corresponding to the data name;
acquiring the alternative URL returned by the application server, and acquiring a first data volume of the target data by adopting the alternative URL;
and when the error between the first data volume and the preset data volume of the target data is smaller than or equal to a preset threshold value, downloading the target data in the application server by adopting the alternative URL.
A second aspect of an embodiment of the present invention provides a data downloading device, which may include:
a data request sending unit, configured to send a data download request carrying a data name of target data to an application server, so that the application server obtains an original URL corresponding to the data name;
the locator detection unit is used for acquiring the original URL returned by the application server and detecting the original URL;
an alternative request sending unit, configured to send an alternative download request carrying the data name to the application server when detecting that the original URL is a hijacked URL, so that the application server obtains an alternative URL corresponding to the data name;
a first data volume obtaining unit, configured to obtain the alternative URL returned by the application server, and obtain a first data volume of the target data by using the alternative URL;
and the data downloading unit is used for downloading the target data in the application server by adopting the alternative URL when the error between the first data volume and the preset data volume of the target data is less than or equal to a preset threshold value.
In the embodiment of the invention, when the original URL of the target data is the hijacked URL, the alternative URL is requested to the server, the first data volume of the target data corresponding to the alternative URL is preliminarily detected, and when the error between the first data volume and the preset data volume is less than or equal to the preset threshold value, the alternative URL is adopted to download the target data. The alternative URL is provided under the condition that the original URL is hijacked, and the theoretical data volume is provided as a judgment basis for judging whether the URL is hijacked, so that the safety of data downloading is effectively guaranteed, the accuracy of data is improved, and the efficiency of data downloading is further guaranteed.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a schematic flowchart of a data downloading method according to an embodiment of the present invention;
fig. 2 is a schematic flowchart of another data downloading method according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of a data downloading device according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of another data downloading device provided in the embodiment of the present invention;
FIG. 5 is a schematic structural diagram of a locator detection unit according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of a first data amount obtaining unit according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of another data downloading device according to an embodiment of the present invention.
Detailed Description
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 only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The data downloading method provided by the embodiment of the invention can be applied to the scene of downloading data (such as terminal application data, multimedia data and the like) in the terminal, for example: the data downloading equipment sends a data downloading request carrying a data name of target data to an application server so that the application server obtains an original Uniform Resource Locator (URL) corresponding to the data name, the data downloading equipment obtains the original URL returned by the application server and detects the original URL, when the original URL is detected to be a hijacked URL, the data downloading equipment sends an alternative downloading request carrying the data name to the application server so that the application server obtains an alternative URL corresponding to the data name, the data downloading equipment obtains the alternative URL returned by the application server and obtains a first data volume of the target data by adopting the alternative URL, and when an error between the first data volume and a preset data volume of the target data is smaller than or equal to a preset threshold value, and the data downloading equipment adopts the alternative URL to download the scene of the target data in the application server, and the like. The alternative URL is provided under the condition that the original URL is hijacked, and the theoretical data volume is provided as a judgment basis for judging whether the URL is hijacked, so that the safety of data downloading is effectively guaranteed, the accuracy of data is improved, and the efficiency of data downloading is further guaranteed.
The data downloading device related to the embodiment of the invention may include: terminal devices such as tablet computers, smart phones, notebook computers, palmtop computers, personal computers, and Mobile Internet Devices (MID); the application server can be a URL for providing data downloading and background service equipment for storing data; the target data can be terminal application data, multimedia data and other terminal data which need to be downloaded from an application server.
A data downloading method according to an embodiment of the present invention will be described in detail below with reference to fig. 1 and fig. 2.
Referring to fig. 1, a flow chart of a data downloading method according to an embodiment of the present invention is shown. As shown in fig. 1, the method of the embodiment of the present invention may include the following steps S101 to S105.
S101, sending a data downloading request carrying a data name of target data to an application server;
specifically, the data downloading device may send a data downloading request carrying a data name of target data to an application server, where the application server obtains an original URL corresponding to the data name and sends the original URL to the data downloading device, where the original URL is a default downloading URL set by the application server for the target data.
S102, acquiring the original URL returned by the application server, and detecting the original URL;
specifically, the data downloading device obtains the original URL returned by the application server, and may detect the original URL in advance, for example: and acquiring the actual downloaded data size of the target data from an application server by using the original URL, detecting an error between the actual downloaded data size and a theoretical data size, wherein if the error is larger than a preset threshold value, the data downloading equipment can determine that the original URL is maliciously tampered by an external network, and the data downloading equipment can determine that the original URL is a hijacked URL.
S103, when detecting that the original URL is the hijacked URL, sending an alternative downloading request carrying the data name to the application server;
specifically, when the data downloading device detects that an original URL of target data is a hijacked URL, the data downloading device may send an alternative downloading request for the target data to an application server, where the alternative downloading request may carry a data name of the target data, the clamped URL is used to indicate that a currently acquired URL (for example, the original URL) is maliciously tampered by an external network, and the original URL is a default downloading URL set by the application server for the target data. The application server may obtain an alternative URL corresponding to the data name.
It should be noted that, when an error between the second data amount and a preset data amount of the target data is smaller than or equal to a preset threshold, for example, the error is smaller than or equal to 1KB, the data downloading device may determine as an original URL for effective downloading, and the data downloading device may download the target data in the application server by using the original URL.
S104, obtaining the alternative URL returned by the application server, and obtaining a first data volume of the target data by adopting the alternative URL;
specifically, the data downloading device obtains the alternative URL returned by the application server, and may obtain a first data size of the target data by using the alternative URL, that is, obtain an actually downloaded data size of the target data indicated by the alternative URL.
S105, when the error between the first data volume and the preset data volume of the target data is smaller than or equal to a preset threshold value, downloading the target data in the application server by adopting the alternative URL;
specifically, when an error between the first data amount and a preset data amount of the target data is smaller than or equal to a preset threshold, for example, the error is smaller than or equal to 1KB, the data downloading device may determine that the candidate URL is not maliciously tampered by an external network, that is, the candidate URL is a valid candidate URL for downloading, and the data downloading device may download the target data in the application server by using the candidate URL.
In the embodiment of the invention, when the original URL of the target data is the hijacked URL, the alternative URL is requested to the server, the first data volume of the target data corresponding to the alternative URL is preliminarily detected, and when the error between the first data volume and the preset data volume is less than or equal to the preset threshold value, the alternative URL is adopted to download the target data. The alternative URL is provided under the condition that the original URL is hijacked, and the theoretical data volume is provided as a judgment basis for judging whether the URL is hijacked, so that the safety of data downloading is effectively guaranteed, the accuracy of data is improved, and the efficiency of data downloading is further guaranteed.
Referring to fig. 2, a flow chart of another data downloading method according to an embodiment of the present invention is shown. As shown in fig. 2, the method of the embodiment of the present invention may include the following steps S201 to S208.
S201, sending a data downloading request carrying a data name of target data to an application server;
specifically, the data downloading device may send a data downloading request carrying a data name of target data to an application server, where the application server obtains an original URL corresponding to the data name and sends the original URL to the data downloading device, where the original URL is a default downloading URL set by the application server for the target data.
Of course, in order to guarantee the data downloading rate, the application server may dynamically adjust the original URL set for the target data, such as: optionally, the data downloading device may send a data downloading request carrying a data name of target data and current geographical location information to the application server, where the application server obtains a URL list corresponding to the data name, and the application server determines, in the URL list, an original URL associated with the current geographical location information, for example: the current geographic position information indicates that the data downloading device is located in shenzhen, the application server can obtain an original URL associated with shenzhen in the URL list and send the original URL to the data downloading device, and the data downloading device can request a server located in shenzhen in the application server to obtain the target data based on the original URL, so as to reduce the time delay of data transmission; similarly, the original URL may be configured according to the stability of the historical download of the URL, and the specific manner may refer to the above execution process, which is not described herein again.
S202, acquiring the original URL returned by the application server, and acquiring a second data volume of the target data by adopting the original URL;
specifically, the data downloading device obtains the original URL returned by the application server, and obtains a second data size of the target data by using the original URL, that is, obtains an actually downloaded data size of the target data indicated by the original URL, and the data downloading device may further obtain an error between the second data size and a preset data size of the target data, that is, a difference between the second data size and the preset data size, where the preset data size is a theoretical data size in which the target data is stored in the data downloading device in advance.
S203, when the error between the second data volume and the preset data volume of the target data is larger than a preset threshold value, determining the original URL as a hijacked URL;
specifically, when an error between the second data amount and a preset data amount of the target data is greater than a preset threshold, for example, the error is greater than 1KB, the data downloading device may determine that the original URL is maliciously tampered with by an external network, and the data downloading device may determine that the original URL is a hijacked URL.
S204, when detecting that the original URL is the hijacked URL, sending an alternative downloading request carrying the data name to the application server;
specifically, when the data downloading device detects that an original URL of target data is a hijacked URL, the data downloading device may send an alternative downloading request for the target data to an application server, where the alternative downloading request may carry a data name of the target data, and the clamped URL is used to indicate that a currently acquired URL (for example, the original URL) is maliciously tampered by an external network, and further, the application server may acquire an alternative URL list corresponding to the data name, where the alternative URL list includes at least one URL other than the original URL.
It should be noted that, when an error between the second data amount and a preset data amount of the target data is smaller than or equal to a preset threshold, for example, the error is smaller than or equal to 1KB, the data downloading device may determine as an original URL for effective downloading, and the data downloading device may download the target data in the application server by using the original URL.
S205, acquiring an alternative URL list returned by the application server;
s206, selecting the current URL as an alternative URL according to the arrangement sequence of the at least one URL, and acquiring a first data volume of the target data by using the alternative URL;
specifically, the data downloading device may obtain an alternative URL list returned by the application server, the data downloading device may select a current URL as the alternative URL according to the arrangement sequence of the at least one URL, it may be understood that the data downloading device may sequentially obtain one URL as the alternative URL according to the arrangement sequence of the at least one URL, and obtain a first data amount of the target data by using the alternative URL, the data downloading device may further obtain an error between the first data amount and a preset data amount of the target data, that is, a difference between the first data amount and the preset data amount, where the preset data amount is a theoretical data size in which the target data is stored in the data downloading device in advance.
S207, when the error between the first data volume and the preset data volume of the target data is smaller than or equal to a preset threshold value, downloading the target data in the application server by using the alternative URL;
specifically, when an error between the first data amount and a preset data amount of the target data is smaller than or equal to a preset threshold, for example, the error is smaller than or equal to 1KB, the data downloading device may determine that the candidate URL is not maliciously tampered by an external network, that is, the candidate URL is a valid candidate URL for downloading, and the data downloading device may download the target data in the application server by using the candidate URL.
S208, when the error between the first data volume and the preset data volume of the target data is larger than a preset threshold value, taking the next URL of the current URL as an alternative URL;
specifically, when the error between the first data size and the preset data size of the target data is greater than a preset threshold, for example, the error is greater than 1KB, which indicates that the current URL is maliciously tampered by an external network, in order to be hijacked, the data downloading device may use a next URL of the current URL as an alternative URL, that is, obtain a next URL of the current URL as an alternative URL according to the arrangement sequence of the at least one URL, and the data downloading device may again go to the step of obtaining the first data size of the target data using the alternative URL in step S206 of the embodiment of the present invention, and again obtain the error between the first data size and the preset data size of the target data and make a judgment until an alternative URL whose error between the first data size and the preset data size is smaller than or equal to the preset threshold is detected in the at least one URL, if the alternative URL with the error between the first data volume and the preset data volume smaller than or equal to the preset threshold value does not exist in the at least one URL, the situation that the at least one URL is maliciously tampered by an external network is indicated, and the data downloading equipment can output prompt information that the target data cannot be obtained.
In the embodiment of the invention, when the original URL of the target data is the hijacked URL, the alternative URL is requested to the server, the first data volume of the target data corresponding to the alternative URL is preliminarily detected, and when the error between the first data volume and the preset data volume is less than or equal to the preset threshold value, the alternative URL is adopted to download the target data. The alternative URL is provided under the condition that the original URL is hijacked, and the theoretical data volume is provided as a judgment basis for judging whether the URL is hijacked, so that the safety of data downloading is effectively ensured, the accuracy of data is improved, and the efficiency of data downloading is further ensured; the original URL of the target data is dynamically adjusted by adopting the modes of geographical position information or historical downloading stability and the like, so that the data downloading speed is ensured.
The data downloading device provided by the embodiment of the invention will be described in detail with reference to fig. 3 to 5. It should be noted that, the data downloading devices shown in fig. 3 to fig. 5 are used for executing the method of the embodiment shown in fig. 1 and fig. 2 of the present invention, for convenience of description, only the portions related to the embodiment of the present invention are shown, and details of the specific technology are not disclosed, please refer to the embodiment shown in fig. 1 and fig. 2 of the present invention.
Referring to fig. 3, a schematic structural diagram of a data downloading device is provided in an embodiment of the present invention. As shown in fig. 3, the data downloading device 1 according to the embodiment of the present invention may include: a data request transmitting unit 11, a locator detecting unit 12, an alternative request transmitting unit 13, a first data amount acquiring unit 14, and a data downloading unit 15.
A data request sending unit 11, configured to send a data download request carrying a data name of target data to an application server;
in a specific implementation, the data request sending unit 11 may send a data download request carrying a data name of target data to an application server, where the application server obtains an original URL corresponding to the data name and sends the original URL to the data download device, where the original URL is a default download URL set by the application server for the target data.
A locator detecting unit 12, configured to obtain the original URL returned by the application server, and detect the original URL;
in a specific implementation, the locator detecting unit 12 obtains the original URL returned by the application server, and may detect the original URL in advance, for example: the original URL is adopted to obtain the actually downloaded data size of the target data from the application server, and an error between the actually downloaded data size and the theoretical data size is detected, if the error is greater than a preset threshold, the locator detecting unit 12 may determine that the original URL is maliciously tampered by an external network, and the locator detecting unit 12 may determine that the original URL is a hijacked URL.
An alternative request sending unit 13, configured to send an alternative download request carrying the data name to the application server when detecting that the original URL is a hijacked URL;
in a specific implementation, when the data downloading device 1 detects that an original URL of target data is a hijacked URL, the alternative request sending unit 13 may send an alternative downloading request for the target data to an application server, where the alternative downloading request may carry a data name of the target data, the clamped URL is used to indicate that a currently acquired URL (for example, the original URL) is maliciously tampered by an external network, and the original URL is a default downloading URL set by the application server for the target data. The application server may obtain an alternative URL corresponding to the data name.
It should be noted that, when an error between the second data amount and a preset data amount of the target data is smaller than or equal to a preset threshold, for example, the error is smaller than or equal to 1KB, the data downloading device 1 may determine as an original URL for effective downloading, and the data downloading device 1 may download the target data in the application server by using the original URL.
A first data volume obtaining unit 14, configured to obtain the alternative URL returned by the application server, and obtain a first data volume of the target data by using the alternative URL;
in a specific implementation, the first data amount obtaining unit 14 obtains the alternative URL returned by the application server, and may obtain the first data amount of the target data by using the alternative URL, that is, obtain the data size actually downloaded of the target data indicated by the alternative URL.
A data downloading unit 15, configured to download the target data in the application server by using the alternative URL when an error between the first data amount and a preset data amount of the target data is smaller than or equal to a preset threshold;
in a specific implementation, when an error between the first data amount and a preset data amount of the target data is smaller than or equal to a preset threshold, for example, the error is smaller than or equal to 1KB, the data downloading unit 15 may determine that the candidate URL is not maliciously tampered by an external network, that is, the candidate URL is a valid candidate for downloading, and the data downloading unit 15 may download the target data in the application server by using the candidate URL.
In the embodiment of the invention, when the original URL of the target data is the hijacked URL, the alternative URL is requested to the server, the first data volume of the target data corresponding to the alternative URL is preliminarily detected, and when the error between the first data volume and the preset data volume is less than or equal to the preset threshold value, the alternative URL is adopted to download the target data. The alternative URL is provided under the condition that the original URL is hijacked, and the theoretical data volume is provided as a judgment basis for judging whether the URL is hijacked, so that the safety of data downloading is effectively guaranteed, the accuracy of data is improved, and the efficiency of data downloading is further guaranteed.
Referring to fig. 4, a schematic structural diagram of another data downloading device is provided in the embodiment of the present invention. As shown in fig. 4, the data downloading device 1 according to the embodiment of the present invention may include: a data request transmitting unit 11, a locator detecting unit 12, an alternative request transmitting unit 13, a first data amount acquiring unit 14, a data downloading unit 15, and a notification unit 16.
A data request sending unit 11, configured to send a data download request carrying a data name of target data to an application server;
in a specific implementation, the data request sending unit 11 may send a data download request carrying a data name of target data to an application server, where the application server obtains an original URL corresponding to the data name and sends the original URL to the data download device 1, where the original URL is a default download URL set by the application server for the target data.
Of course, in order to guarantee the data downloading rate, the application server may dynamically adjust the original URL set for the target data, such as: optionally, the data request sending unit 11 may send a data download request carrying a data name of target data and current geographical location information to the application server, where the application server obtains a URL list corresponding to the data name, and the application server determines an original URL associated with the current geographical location information in the URL list, for example: the current geographic location information indicates that the data download device 1 is located in shenzhen, the application server may obtain an original URL associated with shenzhen in the URL list and send the original URL to the data download device 1, and the data download device 1 may request a server located in shenzhen in the application server to obtain the target data based on the original URL, so as to reduce the time delay of data transmission; similarly, the original URL may be configured according to the stability of the historical download of the URL, and the specific manner may refer to the above execution process, which is not described herein again.
A locator detecting unit 12, configured to obtain the original URL returned by the application server, and detect the original URL;
in a specific implementation, the locator detecting unit 12 obtains the original URL returned by the application server, and may detect the original URL in advance, for example: the original URL is adopted to obtain the actually downloaded data size of the target data from the application server, and an error between the actually downloaded data size and the theoretical data size is detected, if the error is greater than a preset threshold, the locator detecting unit 12 may determine that the original URL is maliciously tampered by an external network, and the locator detecting unit 12 may determine that the original URL is a hijacked URL.
Specifically, please refer to fig. 5, which provides a schematic structural diagram of the locator detecting unit according to an embodiment of the present invention. As illustrated in fig. 5, the locator detecting unit 12 may include:
a second data volume obtaining subunit 121, configured to obtain the original URL returned by the application server, and obtain a second data volume of the target data by using the original URL;
in a specific implementation, the second data amount obtaining subunit 121 obtains the original URL returned by the application server, and obtains a second data amount of the target data by using the original URL, that is, obtains a data size actually downloaded to the target data indicated by the original URL, and the second data amount obtaining subunit 121 may further obtain an error between the second data amount and a preset data amount of the target data, that is, a difference between the second data amount and the preset data amount, where the preset data amount is a theoretical data size in which the target data is stored in the data downloading device 1 in advance.
A determining subunit 122, configured to determine, when an error between the second data amount and a preset data amount of the target data is greater than a preset threshold, that the original URL is a hijacked URL;
in a specific implementation, when an error between the second data amount and a preset data amount of the target data is greater than a preset threshold, for example, the error is greater than 1KB, the determining subunit 122 may determine that the original URL is maliciously tampered with by an external network, and the determining subunit 122 may determine that the original URL is a hijacked URL.
An alternative request sending unit 13, configured to send an alternative download request carrying the data name to the application server when detecting that the original URL is a hijacked URL;
in a specific implementation, when the data downloading device 1 detects that an original URL of target data is a hijacked URL, the alternative request sending unit 13 may send an alternative downloading request for the target data to an application server, where the alternative downloading request may carry a data name of the target data, and the clamped URL is used to indicate that a currently acquired URL (for example, the original URL) is maliciously tampered by an external network, and further, the application server may acquire an alternative URL list corresponding to the data name, where the alternative URL list includes at least one URL other than the original URL.
It should be noted that, when an error between the second data amount and a preset data amount of the target data is smaller than or equal to a preset threshold, for example, the error is smaller than or equal to 1KB, the data downloading device 1 may determine as an original URL for effective downloading, and the data downloading device 1 may download the target data in the application server by using the original URL.
A first data volume obtaining unit 14, configured to obtain the alternative URL returned by the application server, and obtain a first data volume of the target data by using the alternative URL;
in a specific implementation, the first data amount obtaining unit 14 obtains the alternative URL returned by the application server, and may obtain the first data amount of the target data by using the alternative URL, that is, obtain the data size actually downloaded of the target data indicated by the alternative URL.
Specifically, please refer to fig. 6, which provides a schematic structural diagram of the first data amount obtaining unit according to an embodiment of the present invention. As shown in fig. 6, the first data amount obtaining unit 14 may include:
a list obtaining subunit 141, configured to obtain a list of alternative URLs returned by the application server;
a first data size obtaining subunit 142, configured to select a current URL as an alternative URL according to the arrangement order of the at least one URL, and obtain a first data size of the target data by using the alternative URL;
in a specific implementation, the list obtaining subunit 141 may obtain a list of alternative URLs returned by the application server, the first data amount obtaining subunit 142 may select a current URL as the alternative URL according to the arrangement sequence of the at least one URL, it may be understood that the data downloading device 1 may sequentially obtain one URL as the alternative URL according to the arrangement sequence of the at least one URL, and obtain a first data amount of the target data by using the alternative URL, the first data amount obtaining subunit 142 may further obtain an error between the first data amount and a preset data amount of the target data, that is, a difference between the first data amount and the preset data amount, where the preset data amount is a theoretical data size in which the target data is stored in the data downloading device 1 in advance.
A data downloading unit 15, configured to download the target data in the application server by using the alternative URL when an error between the first data amount and a preset data amount of the target data is smaller than or equal to a preset threshold;
in a specific implementation, when an error between the first data amount and a preset data amount of the target data is smaller than or equal to a preset threshold, for example, the error is smaller than or equal to 1KB, the data downloading unit 15 may determine that the candidate URL is not maliciously tampered by an external network, that is, the candidate URL is a valid candidate for downloading, and the data downloading unit 15 may download the target data in the application server by using the candidate URL.
A notifying unit 16, configured to, when an error between the first data amount and a preset data amount of the target data is greater than a preset threshold, take a next URL of the current URL as an alternative URL, and notify the first data amount obtaining unit 14 to execute obtaining of the first data amount of the target data by using the alternative URL until it is detected that the error between the first data amount and the preset data amount of the target data is less than or equal to the preset threshold;
in a specific implementation, when an error between the first data amount and a preset data amount of the target data is greater than a preset threshold, for example, the error is greater than 1KB, which indicates that the current URL is maliciously tampered by an external network, in order to be hijacked, the notification unit 16 may use a next URL of the current URL as an alternative URL, that is, a next URL of the current URL is obtained as an alternative URL according to an arrangement order of the at least one URL, and the notification unit 16 may notify the first data amount obtaining unit 14 to perform the step of obtaining the first data amount of the target data by using the alternative URL again, and obtain the error between the first data amount and the preset data amount of the target data again and determine the error until an alternative URL whose error between the first data amount and the preset data amount is smaller than or equal to the preset threshold is detected in the at least one URL, if there is no alternative URL in the at least one URL where the error between the first data amount and the preset data amount is smaller than or equal to the preset threshold, it indicates that all the URLs are maliciously tampered by the external network, and the data downloading device 1 may output prompt information that the target data cannot be acquired.
In the embodiment of the invention, when the original URL of the target data is the hijacked URL, the alternative URL is requested to the server, the first data volume of the target data corresponding to the alternative URL is preliminarily detected, and when the error between the first data volume and the preset data volume is less than or equal to the preset threshold value, the alternative URL is adopted to download the target data. The alternative URL is provided under the condition that the original URL is hijacked, and the theoretical data volume is provided as a judgment basis for judging whether the URL is hijacked, so that the safety of data downloading is effectively ensured, the accuracy of data is improved, and the efficiency of data downloading is further ensured; the original URL of the target data is dynamically adjusted by adopting the modes of geographical position information or historical downloading stability and the like, so that the data downloading speed is ensured.
Referring to fig. 7, a schematic structural diagram of another data downloading device according to an embodiment of the present invention is provided. As shown in fig. 7, the data download apparatus 1000 may include: at least one processor 1001, such as a CPU, at least one network interface 1004, a user interface 1003, memory 1005, at least one communication bus 1002. Wherein a communication bus 1002 is used to enable connective communication between these components. The user interface 1003 may include a Display screen (Display) and a Keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a standard wireless interface. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1005 may be a high-speed RAM memory or a non-volatile memory (non-volatile memory), such as at least one disk memory. The memory 1005 may optionally be at least one memory device located remotely from the processor 1001. As shown in fig. 7, the memory 1005, which is a kind of computer storage medium, may include therein an operating system, a network communication module, a user interface module, and a data download application program.
In the data downloading apparatus 1000 shown in fig. 7, the user interface 1003 is mainly used as an interface for providing input for a user, and acquiring data input by the user; and the processor 1001 may be configured to call the data downloading application stored in the memory 1005, and specifically perform the following operations:
sending a data downloading request carrying a data name of target data to an application server so that the application server obtains an original URL corresponding to the data name;
acquiring the original URL returned by the application server, and detecting the original URL;
when detecting that the original URL is a hijacked URL, sending an alternative downloading request carrying the data name to the application server so that the application server obtains an alternative URL corresponding to the data name;
acquiring the alternative URL returned by the application server, and acquiring a first data volume of the target data by adopting the alternative URL;
and when the error between the first data volume and the preset data volume of the target data is smaller than or equal to a preset threshold value, downloading the target data in the application server by adopting the alternative URL.
In an embodiment, when the processor 1001 acquires the original URL returned by the application server and detects the original URL, the following operations are specifically performed:
sending a data downloading request carrying a data name of target data to an application server so that the application server obtains an original URL corresponding to the data name;
acquiring the original URL returned by the application server, and acquiring a second data volume of the target data by adopting the original URL;
and when the error between the second data volume and the preset data volume of the target data is larger than a preset threshold value, determining the original URL as a hijacked URL.
In an embodiment, when executing sending the alternative download request carrying the data name to the application server, so that the application server obtains the alternative URL corresponding to the data name, the processor 1001 specifically executes the following operations:
and sending a data downloading request carrying the data name and the current geographical location information to the application server, so that the application server obtains a URL list corresponding to the data name, and the application server determines an original URL associated with the current geographical location information in the URL list.
In an embodiment, when the processor 1001 acquires the alternative URL returned by the application server and acquires the first data size of the target data by using the alternative URL, specifically:
acquiring an alternative URL list returned by the application server, wherein the alternative URL list comprises at least one URL except the original URL;
and selecting the current URL as an alternative URL according to the arrangement sequence of the at least one URL, and acquiring the first data volume of the target data by adopting the alternative URL.
In one embodiment, the processor 1001 further performs the following operations:
and when the error between the first data volume and the preset data volume of the target data is larger than a preset threshold value, taking the next URL of the current URL as an alternative URL, and executing the step of acquiring the first data volume of the target data by using the alternative URL until the error between the first data volume and the preset data volume of the target data is detected to be smaller than or equal to the preset threshold value.
In the embodiment of the invention, when the original URL of the target data is the hijacked URL, the alternative URL is requested to the server, the first data volume of the target data corresponding to the alternative URL is preliminarily detected, and when the error between the first data volume and the preset data volume is less than or equal to the preset threshold value, the alternative URL is adopted to download the target data. The alternative URL is provided under the condition that the original URL is hijacked, and the theoretical data volume is provided as a judgment basis for judging whether the URL is hijacked, so that the safety of data downloading is effectively ensured, the accuracy of data is improved, and the efficiency of data downloading is further ensured; the original URL of the target data is dynamically adjusted by adopting the modes of geographical position information or historical downloading stability and the like, so that the data downloading speed is ensured.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), or the like.
The above disclosure is only for the purpose of illustrating the preferred embodiments of the present invention, and it is therefore to be understood that the invention is not limited by the scope of the appended claims.

Claims (8)

1. A method for downloading data, comprising:
sending a data downloading request carrying a data name of target data and current geographical position information to an application server so that the application server obtains an original Uniform Resource Locator (URL) list corresponding to the data name and determines an original URL associated with the current geographical position information in the URL list; the original URL is a default downloading URL set by the application server aiming at the target data, and the original URL is dynamically adjusted according to the current geographical position information of the data downloading equipment;
acquiring the original URL returned by the application server, and acquiring a second data volume of the target data by adopting the original URL; the second data amount is a data size of actual downloading of the target data indicated by the original URL;
when the error between the second data volume and the preset data volume of the target data is smaller than or equal to a preset threshold value, determining the original URL as an effectively downloaded original URL, and downloading the target data in the application server by adopting the original URL;
when the error between the second data volume and the preset data volume of the target data is larger than a preset threshold value, determining the original URL as a hijacked URL; the preset data volume is the theoretical data size of the target data, the hijacked URL is used for representing the condition that the currently acquired URL is maliciously tampered by an external network, and the currently acquired URL comprises the original URL;
when detecting that the original URL is a hijacked URL, sending an alternative downloading request carrying the data name to the application server so that the application server obtains an alternative URL corresponding to the data name;
acquiring the alternative URL returned by the application server, and acquiring a first data volume of the target data by adopting the alternative URL;
and when the error between the first data volume and the preset data volume of the target data is smaller than or equal to a preset threshold value, downloading the target data in the application server by adopting the alternative URL.
2. The method of claim 1, wherein the obtaining the alternative URL returned by the application server and obtaining the first data size of the target data using the alternative URL comprises:
acquiring an alternative URL list returned by the application server, wherein the alternative URL list comprises at least one URL except the original URL;
and selecting the current URL as an alternative URL according to the arrangement sequence of the at least one URL, and acquiring the first data volume of the target data by adopting the alternative URL.
3. The method of claim 2, further comprising:
and when the error between the first data volume and the preset data volume of the target data is larger than a preset threshold value, taking the next URL of the current URL as an alternative URL, and executing the step of acquiring the first data volume of the target data by using the alternative URL until the error between the first data volume and the preset data volume of the target data is detected to be smaller than or equal to the preset threshold value.
4. A data download device, comprising:
a data request sending unit, configured to send a data download request carrying a data name of target data and current geographic location information to an application server, so that the application server obtains an original URL list corresponding to the data name, and determines an original URL associated with the current geographic location information in the URL list; the original URL is a default downloading URL set by the application server aiming at the target data, and the original URL is dynamically adjusted according to the current geographical position information of the data downloading equipment;
a second data volume obtaining subunit, configured to obtain the original URL returned by the application server, and obtain a second data volume of the target data by using the original URL;
a determining subunit, configured to determine, when an error between the second data amount and a preset data amount of the target data is smaller than or equal to a preset threshold, that the original URL is an effectively downloaded original URL, and download the target data in the application server by using the original URL;
a determining subunit, configured to determine that the original URL is a hijacked URL when an error between the second data amount and a preset data amount of the target data is greater than a preset threshold; the preset data volume is the theoretical data size of the target data, the hijacked URL is used for representing the condition that the currently acquired URL is maliciously tampered by an external network, and the currently acquired URL comprises the original URL;
an alternative request sending unit, configured to send an alternative download request carrying the data name to the application server when detecting that the original URL is a hijacked URL, so that the application server obtains an alternative URL corresponding to the data name;
a first data volume obtaining unit, configured to obtain the alternative URL returned by the application server, and obtain a first data volume of the target data by using the alternative URL;
and the data downloading unit is used for downloading the target data in the application server by adopting the alternative URL when the error between the first data volume and the preset data volume of the target data is less than or equal to a preset threshold value.
5. The apparatus according to claim 4, wherein the first data amount acquisition unit includes:
the list acquiring subunit is configured to acquire an alternative URL list returned by the application server, where the alternative URL list includes at least one URL other than the original URL;
and the first data volume acquisition subunit is used for selecting the current URL as the alternative URL according to the arrangement sequence of the at least one URL and acquiring the first data volume of the target data by adopting the alternative URL.
6. The apparatus of claim 5, further comprising:
and the notification unit is used for taking the next URL of the current URL as an alternative URL when the error between the first data volume and the preset data volume of the target data is larger than a preset threshold, and notifying the first data volume acquisition unit to execute acquisition of the first data volume of the target data by using the alternative URL until the error between the first data volume and the preset data volume of the target data is detected to be smaller than or equal to the preset threshold.
7. A data download device, comprising: a processor, at least one network interface, a user interface, and a memory; wherein the memory includes a data download application program, and the processor is configured to call the data download application program to perform the data download method according to any one of claims 1 to 3.
8. A computer storage medium having stored thereon one or more program instructions adapted to be loaded by a processor and to perform a data download method according to any of claims 1-3.
CN201611059732.3A 2016-11-25 2016-11-25 Data downloading method and equipment thereof Active CN108111561B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611059732.3A CN108111561B (en) 2016-11-25 2016-11-25 Data downloading method and equipment thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611059732.3A CN108111561B (en) 2016-11-25 2016-11-25 Data downloading method and equipment thereof

Publications (2)

Publication Number Publication Date
CN108111561A CN108111561A (en) 2018-06-01
CN108111561B true CN108111561B (en) 2021-03-02

Family

ID=62205425

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611059732.3A Active CN108111561B (en) 2016-11-25 2016-11-25 Data downloading method and equipment thereof

Country Status (1)

Country Link
CN (1) CN108111561B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020206662A1 (en) * 2019-04-11 2020-10-15 深圳市欢太科技有限公司 Browser anti-hijacking method and device, electronic equipment and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8230499B1 (en) * 2008-05-29 2012-07-24 Symantec Corporation Detecting and blocking unauthorized downloads
CN102663060A (en) * 2012-03-30 2012-09-12 奇智软件(北京)有限公司 Method and device for identifying tampered webpage
CN102752326A (en) * 2011-04-19 2012-10-24 腾讯科技(深圳)有限公司 Method, client, server and system for processing data in file downloading
CN104079673A (en) * 2014-07-30 2014-10-01 北京奇虎科技有限公司 Method, device and system for preventing DNS hijack during application download
CN104239577A (en) * 2014-10-09 2014-12-24 北京奇虎科技有限公司 Method and device for detecting authenticity of webpage data
CN104283933A (en) * 2013-07-12 2015-01-14 腾讯科技(深圳)有限公司 Data downloading method, client-side and system
CN105227673A (en) * 2015-10-16 2016-01-06 北京奇虎科技有限公司 The data download method of anti-abduction, client, server and system

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8230499B1 (en) * 2008-05-29 2012-07-24 Symantec Corporation Detecting and blocking unauthorized downloads
CN102752326A (en) * 2011-04-19 2012-10-24 腾讯科技(深圳)有限公司 Method, client, server and system for processing data in file downloading
CN102663060A (en) * 2012-03-30 2012-09-12 奇智软件(北京)有限公司 Method and device for identifying tampered webpage
CN104283933A (en) * 2013-07-12 2015-01-14 腾讯科技(深圳)有限公司 Data downloading method, client-side and system
CN104079673A (en) * 2014-07-30 2014-10-01 北京奇虎科技有限公司 Method, device and system for preventing DNS hijack during application download
CN104239577A (en) * 2014-10-09 2014-12-24 北京奇虎科技有限公司 Method and device for detecting authenticity of webpage data
CN105227673A (en) * 2015-10-16 2016-01-06 北京奇虎科技有限公司 The data download method of anti-abduction, client, server and system

Also Published As

Publication number Publication date
CN108111561A (en) 2018-06-01

Similar Documents

Publication Publication Date Title
CN106534277B (en) Data sharing method and device
CN107491320B (en) Loading method and device based on mixed-mode mobile application
WO2015169188A1 (en) Method, apparatus, and system for loading webpage application program
CN107766747B (en) Method for verifying integrity of application program installation package, mobile terminal and server
JP2018517603A5 (en)
CN107483401B (en) Multimedia data transmission method and equipment, storage medium and server thereof
CN105988805B (en) Application program management method and mobile terminal
CN104181567B (en) Terminal device positioning method, terminal device and terminal device positioning system
CN104980414B (en) File transmission method and terminal
CN103825938A (en) Method of downloading resources and device
CN106375866B (en) Page loading method and terminal
CN105302802A (en) Picture uploading method and system and browser
US10938773B2 (en) Method and apparatus for synchronizing contact information and medium
CN105530232B (en) Account login method and device
MX2014009375A (en) Application installation method, apparatus and device.
CN107563188B (en) Application security evaluation method and device and computer storage medium
CN108111561B (en) Data downloading method and equipment thereof
CN103825912A (en) Data transmission method, electronic device and server
CN112913267B (en) Resource processing method, device, terminal, server and readable storage medium
CN103631621A (en) Method and device for prompting information
CN106302821B (en) Data request method and equipment thereof
CN103729440A (en) Method and device for having access to website
CN108572985B (en) Page display method and device
CN106376096B (en) Wireless network connection method and equipment thereof
CN105491400B (en) Video stream downloading 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