WO2017198079A1 - 下载文件的方法、装置、用户终端及机器可读存储介质 - Google Patents

下载文件的方法、装置、用户终端及机器可读存储介质 Download PDF

Info

Publication number
WO2017198079A1
WO2017198079A1 PCT/CN2017/083270 CN2017083270W WO2017198079A1 WO 2017198079 A1 WO2017198079 A1 WO 2017198079A1 CN 2017083270 W CN2017083270 W CN 2017083270W WO 2017198079 A1 WO2017198079 A1 WO 2017198079A1
Authority
WO
WIPO (PCT)
Prior art keywords
byte length
total byte
file
downloading
server
Prior art date
Application number
PCT/CN2017/083270
Other languages
English (en)
French (fr)
Inventor
蔡灿
Original Assignee
广州优视网络科技有限公司
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 广州优视网络科技有限公司 filed Critical 广州优视网络科技有限公司
Publication of WO2017198079A1 publication Critical patent/WO2017198079A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/40Support for services or applications
    • 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/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • 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]

Definitions

  • the present invention relates to the field of computer applications, and in particular, to a method, an apparatus, a user terminal, and a non-transitory machine readable storage for downloading files.
  • the download file byte data is garbled or the data source data is mixed with the data, which may cause the installation to fail; or the operator may redirect the download link or replace the downloaded content.
  • the downloaded application file becomes an application promoted by other operators, and the installed application is not the application file expected by the user. In both cases, the user's traffic is wasted, the download failure rate is high, and the user experience is poor.
  • an object of the embodiments of the present invention is to provide a method, an apparatus, and a user terminal for downloading a file to solve the above problem.
  • an embodiment of the present invention provides a method for downloading a file, the method comprising: receiving a download link returned by a first server, where the download link includes a first total byte length of the target file; The second server corresponding to the download link initiates an HTTP request for downloading the target file; receiving HTTP response header information returned by the second server, where the HTTP response header information includes a second total byte length of the current file; When the first total byte length coincides with the second total byte length, the downloading of the current file begins.
  • an embodiment of the present invention provides an apparatus for downloading a file, where the apparatus includes: a first receiving module, configured to receive a download link returned by a first server, where the download link includes a first total word of the target file a sending module, configured to initiate an HTTP request for downloading the target file to a second server corresponding to the download link, and a second receiving module, configured to receive an HTTP response header information returned by the second server, where The HTTP response header information includes a second total byte length of the current file; and a downloading module, configured to: when the first total byte length is When the second total byte length is the same, the download of the current file is started.
  • an embodiment of the present invention provides a user terminal, where the user terminal includes a processor and a memory, the memory is coupled to the processor, and the memory stores an instruction when the instruction is processed by the When the device is executed, the user terminal is configured to: receive a download link returned by the first server, the download link includes a first total byte length of the target file; and initiate a download to the second server corresponding to the download link An HTTP request for the target file; receiving HTTP response header information returned by the second server, the HTTP response header information including a second total byte length of the current file; when the first total byte length and the first When the total length of the two bytes is the same, the current file is downloaded.
  • an embodiment of the present invention provides a non-transitory machine-readable storage medium having stored thereon executable code, when executed by a processor, causing a processor to perform the foregoing The method of downloading files.
  • a method, an apparatus, a user terminal, and a non-transitory machine-readable storage medium for downloading a file are provided by the embodiment of the present invention, and the first total of the target file is verified before downloading the current file. Whether the byte length is consistent with the second total byte length of the current file, so as to verify the validity of the currently downloaded file, the method does not need to modify the interface protocol between the client and the server, and the implementation is simple and efficient, and the solution is solved.
  • Downloading the application file byte data is garbled or the data source data is mixed with the webpage source data, causing the installation to fail, and the operator redirects the download link to cause the installed application to be non-user expected application file, which improves the download success rate and the user download experience.
  • FIG. 1 is a schematic diagram of a user terminal interacting with a server according to an embodiment of the present invention.
  • FIG. 2 is a schematic structural diagram of a user terminal according to an embodiment of the present invention.
  • FIG. 3 is a flowchart of a method for downloading a file according to a first embodiment of the present invention.
  • FIG. 4 is a flowchart of a method for downloading a file according to a second embodiment of the present invention.
  • FIG. 5 is a flowchart of a method for downloading a file according to a third embodiment of the present invention.
  • FIG. 6 is a flowchart of a method for downloading a file according to a fourth embodiment of the present invention.
  • FIG. 7 is a flowchart of a method for downloading a file according to a fifth embodiment of the present invention.
  • FIG. 8 is a flowchart of a method for downloading a file according to a sixth embodiment of the present invention.
  • FIG. 9 is a structural block diagram of a device for downloading a file according to an embodiment of the present invention.
  • FIG. 1 is a schematic diagram of interaction between a server 200 and a user terminal 100 according to an embodiment of the present invention.
  • the server 200 is in communication with one or more user terminals 100 over a network 300 for data communication or interaction.
  • the server 200 can be a web server, a database server, or the like.
  • the user terminal 100 may be a personal computer (PC), a tablet computer, a smart phone, a personal digital assistant (PDA), an in-vehicle device, a wearable device, or the like.
  • PC personal computer
  • PDA personal digital assistant
  • FIG. 2 shows a block diagram of a structure of a user terminal 100 that can be applied to an embodiment of the present invention.
  • the user terminal 100 can include a memory 102, a memory controller 104, one or more (only one shown) processor 106, peripheral interface 108, radio frequency module 110, audio module 112, and touch. Screen 114 and the like. These components communicate with one another via one or more communication bus/signal lines 116.
  • the memory 102 can be used to store software programs and modules, such as a method of downloading files in the embodiment of the present invention and program instructions/modules corresponding to the devices.
  • the processor 106 executes various programs by running software programs and modules stored in the memory 102. Functional application and data processing, such as the method for downloading a file provided by an embodiment of the present invention.
  • Memory 102 can include high speed random access memory and can also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid state memory. Access to the memory 102 by the processor 106 and other possible components can be performed under the control of the memory controller 104.
  • non-volatile memory such as one or more magnetic storage devices, flash memory, or other non-volatile solid state memory. Access to the memory 102 by the processor 106 and other possible components can be performed under the control of the memory controller 104.
  • Peripheral interface 108 can couple various input/input devices to processor 106 and memory 102.
  • peripheral interface 108, processor 106, and memory controller 104 can be implemented in a single chip. In other instances, they can be implemented by separate chips.
  • the radio frequency module 110 is configured to receive and transmit electromagnetic waves, and realize mutual conversion between electromagnetic waves and electric signals, thereby communicating with a communication network or other devices.
  • the audio module 112 provides an audio interface to the user, which may include one or more microphones, one or more speakers, and audio circuitry.
  • the touch screen 114 provides an output and input interface simultaneously between the user terminal 100 and the user. Specifically, the touch screen 114 can display video output to the user, and the content of the video output can include text, graphics, video, and any combination thereof.
  • FIG. 1 is merely illustrative, and the user terminal 100 may further include more or less components than those shown in FIG. 2 or have a different configuration from that shown in FIG. 2.
  • the components shown in Figure 2 can be implemented in hardware, software, or a combination thereof.
  • the client terminal 100 is installed with a client, and the client may be a third-party application software, which corresponds to the server (Server) and follows the same set of data protocols, so that the server and the client can mutually Parse out the other party's data and provide users with download services, such as downloading files, downloading videos, downloading audio, etc.
  • server server
  • download services such as downloading files, downloading videos, downloading audio, etc.
  • FIG. 3 is a flowchart of a method for downloading a file according to a first embodiment of the present invention. Referring to FIG. 3, this embodiment describes a process flow of a client, where the method includes the following steps.
  • Step S301 Receive a download link returned by the first server, where the download link includes a first total byte length of the target file.
  • the first total byte length in the download link may be the total byte length of each file obtained by the first server processing the existing file in advance. After the first server obtains the total byte length of each file, it can add the total byte length parameter after the download link of each file, obtain a new download link, and update the database of the first server. when After receiving the download link request of the client, the first server returns the download link corresponding to the target file to the client.
  • download link corresponding to the file A stored in the first server is: http://android-apps.25pp.com/fs01/2015/01/29/5/0_dd84568d3e5831df12dac8cedc556e52.apk,
  • the first server calculates the total byte length of the file A by calculation. If it is assumed to be 19736456, the first server updates the download link corresponding to the file A to:
  • Step S302 initiating an HTTP request for downloading the target file to a second server corresponding to the download link.
  • the download link is:
  • the corresponding second server initiates an HTTP request to download the target file.
  • first server and the second server may be the same server, that is, the content of the target file may be separately stored in the second server, or the download link of the target file may be stored on the first server at the same time. And the content of the target file.
  • Step S303 receiving HTTP response header information returned by the second server, where the HTTP response header information includes a second total byte length of the current file.
  • the HTTP response information includes HTTP response header information and HTTP response body information. Parsing the HTTP response header information in the HTTP response information, where the HTTP response header information may include multiple fields, and extract a field indicating a total byte length of the current file, such as a “content-range” field, through which the field
  • the first server can know the size of the file currently requested to be downloaded, that is, the second total byte length.
  • Step S304 when the first total byte length is consistent with the second total byte length, The current file is downloaded.
  • the first total byte length and the first The total length of the two bytes is inconsistent, so when the first total byte length is inconsistent with the second total byte length, it can be determined that the current download file is not the target file. Therefore, when the first total byte length is inconsistent with the second total byte length, an HTTP request to download the target file may be initiated to the second server.
  • the method for downloading a file checks whether the current downloaded file is verified by checking whether the first total byte length of the target file is consistent with the second total byte length of the current file before downloading the current file. Whether the target file is the same file or not, the method is to check before downloading, instead of requesting the server to check during the downloading process, saving the inspection time and avoiding that the current file is not the target file after the download has been started, avoiding The problem of wasting user traffic.
  • the verification process also does not require the server to cooperate, so there is no need to introduce new complex logic, and there is no need to modify the interface protocol between the client and the server. It is only necessary to regenerate the download link corresponding to the target file in the database in advance, which is simple and effective. To some extent, the problem that the application file byte data is disordered or the data source data in the data is mixed causes the installation to fail and the operator redirects the download link to cause the installed application to be not the user's expected application file.
  • FIG. 4 is a flowchart of a method for downloading a file according to a second embodiment of the present invention. Referring to FIG. 4, this embodiment describes a process flow of a client, where the method includes the following steps.
  • Step S401 Receive a download link returned by the first server, where the download link includes a first total byte length of the target file.
  • Step S402 initiating an HTTP request for downloading the target file to a second server corresponding to the download link.
  • Step S403 receiving HTTP response header information returned by the second server, where the HTTP response header information includes a second total byte length of the current file.
  • Step S404 determining whether the first total byte length is consistent with the second total byte length.
  • step S405 to step S410 may be performed, when the first total byte length is consistent with the second total byte length.
  • step S411 can be performed.
  • Step S405 Determine whether the number of times to restart the HTTP request for downloading the target file with the second server reaches a preset number of times.
  • Step S406 initiating an HTTPS request to the second server corresponding to the download link.
  • HTTPS is the hypertext transmission security protocol.
  • the main purpose of this protocol is to provide identity authentication for network servers and to protect the privacy and integrity of interactive data. Therefore, using HTTPS for download requests can ensure that download requests are relatively secure and the chances of being hijacked are greatly reduced.
  • HTTPS protocol requires high encryption and decryption for each communication because of the need for encryption and decryption. Therefore, HTTPS is used for downloading when the HTTP request is retried repeatedly.
  • the preset number of times may also be zero, that is, after the HTTP request is initiated to the second server, if the first total byte length and the second total byte length are If they are inconsistent, an HTTPS request can be initiated to the second server corresponding to the download link.
  • Step S407 Receive HTTPS response header information returned by the second server, where the HTTPS response header information includes a second total byte length of the current file.
  • Step S408 determining whether the first total byte length is consistent with the second total byte length.
  • step S409 is performed, and when the first total byte length is consistent with the second total byte length, step S411 is performed.
  • Step S409 determining whether the number of times to restart the HTTPS request for downloading the target file with the second server reaches a preset number of times.
  • the preset number of times can be zero. That is, in this case, only the HTTPS request to download the target file is initiated to the second server.
  • the setting of the preset number of times may also be determined according to the importance of the target file, and when the target file is important, the value of the preset number of times may be set larger.
  • step S406 to step S407 are performed, otherwise step S410 is performed.
  • Step S410 displaying information for prompting the user to be abnormal in the network.
  • the reason still fails is mostly due to the busy network, network interruption or handover of the 2G/3G network, for example, the display is used to prompt the user to be abnormal.
  • the information can be further instructed to the client after the user sees the prompt information.
  • Step S411 starting to download the current file.
  • the method for downloading a file provided by the embodiment of the present invention, in addition to solving the problem that can be solved by the previous embodiment, after the number of times of sending an HTTP request to the second server to download the target file reaches a preset number of times, The second server initiates an HTTPS request, which further solves the problem that the HTTP file is hijacked multiple times and the current file downloaded is not the target file and cannot be downloaded, which improves the success rate of the download.
  • FIG. 5 is a flowchart of a method for downloading a file according to a third embodiment of the present invention.
  • the embodiment describes a processing flow of a client, and the method includes the following steps.
  • Step S501 Receive a download link returned by the first server, where the download link includes a first total byte length of the target file and a first digital signature of the downloaded file.
  • the first digital signature is a fixed length value obtained by calculating a file content of the target file by using a hash algorithm such as a digest algorithm or a hash algorithm, and the fixed length value is a first digital signature, such as SHA. -1 signature, RIPEMD signature and Hava signature.
  • the first digital signature may be an MD5 signature.
  • the MD5 value of a file is like the "digital fingerprint" of this file.
  • the MD5 value of each file is different. If anyone makes any changes to the file, the MD5 value of the corresponding "digital fingerprint" will change.
  • the download link for the target download file is:
  • Step S502 initiating an HTTP request for downloading the target file to a second server corresponding to the download link.
  • Step S503 receiving HTTP response header information returned by the second server, where the HTTP response header information includes a second total byte length of the current file.
  • Step S504 determining whether the first total byte length is consistent with the second total byte length.
  • step S505 to step S510 are performed, when the first total byte length is consistent with the second total byte length, execution is performed. Step S511 to step S513.
  • the second total byte length of the current file included in the HTTP response header information is: 19736456
  • Step S505 determining whether the number of times of re-initiating the HTTP request for downloading the target file with the second server reaches a preset number of times;
  • step S502 to step S504 are performed, otherwise step S506 is performed.
  • Step S506 initiating an HTTPS request to the second server corresponding to the download link.
  • Step S507 Receive HTTPS response header information returned by the second server, where the HTTPS response header information includes a second total byte length of the current file.
  • Step S508 determining whether the first total byte length is consistent with the second total byte length
  • step S509 When the first total byte length is inconsistent with the second total byte length, step S509 is performed, and when the first total byte length is consistent with the second total byte length, step S511 is performed. Step S513.
  • Step S509 determining whether the number of times to restart the HTTPS request for downloading the target file with the second server reaches a preset number of times
  • step S506 to step S507 are performed, otherwise step S510 is performed.
  • Step S510 displaying information for prompting the user to be abnormal in the network.
  • Step S511 starting to download the current file.
  • Step S512 after the downloading of the current file is completed, calculating a second digital signature of the current file; determining whether the first digital signature is consistent with the second digital signature, and if they are consistent, determining that the current file is The target file is successfully downloaded. Otherwise, the download fails.
  • the current file may be hijacked, replaced, or tampered with, but its second total byte size may coincide with the first total byte size of the target file, so after the download is complete, It is again checked whether the first digital signature is consistent with the second digital signature, and the legitimacy and integrity of the downloaded file can be more ensured.
  • the second digital signature of the current file is calculated according to the same method as the first digital signature of the calculation target file. If they are consistent, that is, the second digital signature of the current file is: 7ca110f191c0d918f137efd072123273, the current current is determined.
  • the file is the target file, the download is successful, and the download fails.
  • step S513 if the download fails, information for prompting the user to re-download is displayed.
  • the first digital signature is inconsistent with the second digital signature, it indicates that the content of the current file has been hijacked, replaced or tampered with, so that the user is required to display information for prompting the user to re-download. To prevent users from installing current files that have been hijacked, replaced or tampered with.
  • the method for downloading a file provided by the embodiment of the present invention further solves the method that can be solved by the above two embodiments, and further ensures the legality of downloading the file by detecting the digital signature of the current file after the current file is downloaded. Sex and integrity.
  • FIG. 6 is a flowchart of a method for downloading a file according to a fourth embodiment of the present invention.
  • the embodiment describes a processing flow of a client, and the method includes the following steps.
  • Step S601 receiving a download link returned by the first server, where the download link includes a first total byte length of the target file.
  • Step S602 allocating a plurality of threads according to the first total byte length.
  • the downloading of the current file can be performed in a multi-threaded manner or in a single-threaded manner, and whether multi-threading is adopted, there are many strategies to be selected, which can be The statistical comparison of the download speed with the number of segments and the file size is determined, and it is relatively simple and effective to determine according to the first total byte length. For example, when the first total byte length is 256 bytes, a single thread is used, and when the first total byte length is greater than 256 bytes and less than 512 bytes, dual threads are used, and the first total byte length is greater than 512 bytes. Use three threads. It can be understood that the implementation of selecting multiple threads can be various, and is not limited to the above embodiments.
  • Step S603 the HTTP request for downloading the target file is initiated by the plurality of threads to the second server corresponding to the download link.
  • Step S604 receiving, by the multiple threads, HTTP response header information returned by the second server, where the HTTP response header information includes a second total byte length of the current file.
  • Step S605 when the first total byte length is consistent with the second total byte length, each thread starts to download the current file respectively.
  • step S603 and the step S605 and the step S302 to the step S304 in the first embodiment differs that the embodiment uses multi-threading to perform segment downloading of the current file, and is implemented in each thread.
  • step S302 to step S304, the related content will not be described again.
  • the method for downloading a file provided by the embodiment of the present invention can solve the problem that can be solved by the first embodiment, and also perform segment downloading by using multiple threads, speeding up the downloading of files, and each thread performs the first total
  • the verification of the byte length and the second total byte length further enhances the user download experience.
  • FIG. 7 is a flowchart of a method for downloading a file according to a fifth embodiment of the present invention. Referring to FIG. 7, this embodiment describes a process flow of a client, and the method includes the following steps.
  • Step S701 Receive a download link returned by the first server, where the download link includes a first total byte length of the target file.
  • Step S702 allocating a plurality of threads according to the first total byte length.
  • Step S703 the HTTP request for downloading the target file is initiated by the plurality of threads to the second server corresponding to the download link.
  • Step S704 receiving, by the multiple threads, HTTP response header information returned by the second server, where the HTTP response header information includes a second total byte length of the current file.
  • Step S705 each thread determines whether the first total byte length is consistent with the second total byte length.
  • step S712 is performed.
  • Step S706 determining whether the number of times to restart the HTTP request for downloading the target file with the second server reaches a preset number of times.
  • step S703 to step S705 are performed, otherwise step S707 is performed.
  • Step S707 initiating an HTTP request to the second server corresponding to the download link again.
  • Step S708 Receive HTTPS response header information returned by the second server, where the HTTPS response header information includes a second total byte length of the current file.
  • Step S709 determining whether the first total byte length is consistent with the second total byte length.
  • step S710 When the first total byte length is inconsistent with the second total byte length, step S710 is performed, and when the first total byte length is consistent with the second total byte length, step S711 is performed.
  • Step S710 determining whether the number of times to restart the HTTPS request for downloading the target file with the second server reaches a preset number of times.
  • step S707 to step S708 are performed, otherwise step S711 is performed.
  • Step S711 displaying information for prompting the user to be abnormal in the network.
  • Step S712 each thread starts downloading the current file.
  • step S703 and the step S712 and the step S402 to the step S411 in the second embodiment uses multi-threading to perform segment downloading of the current file, and is implemented in each thread.
  • step S402 to step S411, the related content will not be described again.
  • the method for downloading a file provided by the embodiment of the present invention can solve the problem that can be solved by the second embodiment, and also performs segment downloading by using multiple threads, speeding up the downloading of the file, and each thread is going to the second server.
  • the HTTPS request is initiated to the second server, which further solves the problem that the HTTP file is not hijacked and the current file is not the target file and cannot be downloaded.
  • the success rate of the download further improves the user download experience.
  • FIG. 8 is a flowchart of a method for downloading a file according to a sixth embodiment of the present invention. Referring to FIG. 8, this embodiment describes a process flow of a client, and the method includes the following steps.
  • Step S801 receiving a download link returned by the first server, where the download link includes a first total byte length of the target file.
  • Step S802 allocating a plurality of threads according to the first total byte length.
  • Step S803 the HTTP request for downloading the target file is initiated by the plurality of threads to the second server corresponding to the download link.
  • Step S804 receiving, by the multiple threads, HTTP response header information returned by the second server, where the HTTP response header information includes a second total byte length of the current file.
  • Step S805 each thread determines whether the first total byte length is consistent with the second total byte length.
  • step S812 is performed.
  • Step S806 determining whether the number of times to restart the HTTP request for downloading the target file with the second server reaches a preset number of times.
  • step S803 to step S805 are performed, otherwise step S807 is performed.
  • Step S807 initiating an HTTP request to the second server corresponding to the download link again.
  • Step S808 receiving HTTPS response header information returned by the second server, where the HTTPS response header information includes a second total byte length of the current file.
  • Step S809 determining whether the first total byte length is consistent with the second total byte length.
  • step S810 When the first total byte length is inconsistent with the second total byte length, step S810 is performed, and when the first total byte length is consistent with the second total byte length, step S811 is performed.
  • Step S810 determining whether the number of times to restart the HTTPS request for downloading the target file with the second server reaches a preset number of times.
  • step S807 to step S808 are performed, otherwise step S811 is performed.
  • Step S811 displaying information for prompting the user to be abnormal in the network.
  • Step S812 each thread starts downloading the current file.
  • the content downloaded by each thread is part of the current file. For example, if the current file size is 100 bytes and is downloaded by 3 threads, then the first thread requests to download 0-33 bytes, the second thread requests to download 34-67 bytes, and the third thread requests download. 68-100 bytes.
  • Step S813 when each thread is downloaded, that is, the current file is downloaded, the second digital signature of the current file is calculated; and it is determined whether the first digital signature is consistent with the second digital signature, and if they are consistent, the determination is performed.
  • the current file is the target file, and the download succeeds. Otherwise, the download fails.
  • Step S814 when the current file download fails, displaying information for prompting the user to re-download.
  • step S803 and the step S814 and the step S502 to the step S513 in the second embodiment uses multi-threading to perform segment downloading of the current file, and is implemented in each thread.
  • step S502 to step S513, the related content will not be described again.
  • the method for downloading a file provided by the embodiment of the present invention can solve the problem that can be solved by the third embodiment, and also performs segment downloading by using multiple threads, which speeds up the downloading of the file, and after each thread is downloaded, After the current file is downloaded, the digital signature of the current file is detected to ensure that the current file is consistent with the target file, ensuring the correctness of the distribution, and further improving the user download experience.
  • FIG. 9 is a functional block diagram of an apparatus 200 for downloading a file according to an embodiment of the present invention.
  • the device 200 for downloading a file includes a first receiving module 201, a sending module 202, a second receiving module 203, and a downloading module 204.
  • the first receiving module 201 is configured to receive a download link returned by the first server, where the download link includes a first total byte length of the target file;
  • the sending module 202 is configured to initiate an HTTP request for downloading the target file to a second server corresponding to the download link.
  • the second receiving module 203 is configured to receive HTTP response header information returned by the second server, where the HTTP response header information includes a second total byte length of the current file.
  • the downloading module 204 is configured to start downloading the current file when the first total byte length is consistent with the second total byte length.
  • the device further includes: a first requesting module 205, configured to, when the first total byte length is inconsistent with the second total byte length, correspond to the download link again
  • the second server initiates an HTTP request.
  • the device further includes: a second request module 206, and the second request module 206 is configured to After the second server corresponding to the download link initiates a preset number of HTTP requests, if the first total byte length is still inconsistent with the second total byte length, then the second server corresponding to the download link is initiated. HTTPS request.
  • the link further includes a first digital signature of the downloaded file, the device further comprising a determining module 207, configured to: after the downloading the module 204 starts downloading the current file, after the downloading of the current file is completed Calculating a second digital signature of the current file; determining whether the first digital signature is consistent with the second digital signature, and if yes, determining that the current file is the target file, the download is successful, otherwise, downloading failure.
  • the device further includes an allocating module 208, and the allocating module 208 is configured to The first total byte length, the plurality of threads are allocated;
  • the sending module 202 is further configured to initiate, by the plurality of threads, an HTTP request for downloading the target file to a second server corresponding to the download link, respectively;
  • the second receiving module 203 is further configured to receive HTTP response header information returned by the second server by using the multiple threads, where the HTTP response header information includes a second total byte length of the current file;
  • the downloading module 204 is further configured to: when the first total byte length is consistent with the second total byte length, each thread starts to download the current file respectively.
  • the first requesting module 205 is further configured to: when it is determined that the first total byte length is inconsistent with the second total byte length, determine that the inconsistent thread is again to the second server corresponding to the download link. Initiate an HTTP request.
  • the second request module 206 is further configured to: after the determining that the inconsistent thread initiates a preset number of HTTP requests to the second server corresponding to the download link, the first total byte length and the first When the two total byte lengths are still inconsistent, the thread that determines the inconsistency initiates an HTTPS request to the second server corresponding to the download link.
  • Each of the above modules may be implemented by software code.
  • each of the above modules may be stored in the memory 102 of the user terminal 100.
  • the above modules can also be implemented by hardware such as an integrated circuit chip.
  • the device embodiment does not mention the part, and reference may be made to the corresponding content in the foregoing method embodiment. .
  • the technology in the embodiments of the present invention can be implemented by means of software plus necessary general hardware including general-purpose integrated circuits, general-purpose CPUs, general-purpose memories, general-purpose components, and the like. It can be implemented by dedicated hardware including an application specific integrated circuit, a dedicated CPU, a dedicated memory, a dedicated component, etc., but in many cases the former is a better implementation. Based on such understanding, the technical solution in the embodiments of the present invention may be embodied in the form of a software product in essence or in the form of a software product, which may be stored in a storage medium such as a read-only memory.
  • ROM Read-Only Memory
  • RAM Random Access Memory
  • CD Compact Disc
  • the above technical concept of the present invention can also be embodied as a non-transitory machine readable storage medium having executable code stored thereon.
  • the processor When the executable code is executed by the processor, the processor is caused to perform the method of downloading the file as described above.
  • the above technical concept of the present invention can also be embodied as a computing device including a processor and a non-transitory machine readable storage medium.
  • the non-transitory machine readable storage medium stores executable code thereon.
  • the processor is caused to perform the method described above.
  • the method according to the invention can also be implemented as a computer program comprising computer program code instructions for performing the various steps defined above in the above method of the invention.
  • the method according to the invention may also be embodied as a computer program product comprising a computer readable medium on which is stored a computer for performing the above-described functions defined in the above method of the invention program.
  • a computer program product comprising a computer readable medium on which is stored a computer for performing the above-described functions defined in the above method of the invention program.
  • each block of the flowchart or block diagram can represent a module, a program segment, or a portion of code that includes one or more of the Executable instructions.
  • the functions noted in the blocks may also occur in a different order than the ones in the drawings. For example, two consecutive blocks may be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending upon the functionality involved.
  • each block of the block diagrams and/or flowcharts, and combinations of blocks in the block diagrams and/or flowcharts can be implemented in a dedicated hardware-based system that performs the specified function or operation. Or it can be implemented by a combination of dedicated hardware and computer instructions.

Landscapes

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

Abstract

本发明实施例提供一种下载文件的方法、装置及用户终端及机器可读存储介质,所述方法包括:接收第一服务器返回的下载链接,所述下载链接包括目标文件的第一总字节长度;向与所述下载链接对应的第二服务器发起下载所述目标文件的HTTP请求;接收所述第二服务器返回的HTTP响应头信息,所述HTTP响应头信息包括当前文件的第二总字节长度;当所述第一总字节长度与所述第二总字节长度一致时,开始下载所述当前文件。所述方法简单高效,无需修改客户端与服务端的接口协议,并且确保了应用分发的正确性,提高了下载成功率以及用户下载体验。

Description

下载文件的方法、装置、用户终端及机器可读存储介质 技术领域
本发明涉及计算机应用领域,具体而言,涉及一种下载文件的方法、装置、用户终端及非暂时性机器可读存储。
背景技术
当前下载软件在下载应用文件时,可能会出现下载文件字节数据错乱或数据里混杂着网页源码数据,导致安装失败的情况;或者会出现由于运营商重定向了下载链接或替换了下载内容,使得所下载的应用文件变成了其它运营商推广的应用,而导致安装的应用非用户预期的应用文件的情况。这两种情况会使用户的流量被浪费、下载失败率高且用户体验较差。
发明内容
有鉴于此,本发明实施例的目的在于提供一种下载文件的方法、装置及用户终端,以解决上述问题。
为了实现上述目的,本发明实施例采用的技术方案如下:
第一方面,本发明实施例提供了一种下载文件的方法,所述方法包括:接收第一服务器返回的下载链接,所述下载链接包括目标文件的第一总字节长度;向与所述下载链接对应的第二服务器发起下载所述目标文件的HTTP请求;接收所述第二服务器返回的HTTP响应头信息,所述HTTP响应头信息包括当前文件的第二总字节长度;当所述第一总字节长度与所述第二总字节长度一致时,开始下载所述当前文件。
第二方面,本发明实施例提供了一种下载文件的装置,所述装置包括:第一接收模块,用于接收第一服务器返回的下载链接,所述下载链接包括目标文件的第一总字节长度;发送模块,用于向与所述下载链接对应的第二服务器发起下载所述目标文件的HTTP请求;第二接收模块,用于接收所述第二服务器返回的HTTP响应头信息,所述HTTP响应头信息包括当前文件的第二总字节长度;下载模块,用于当所述第一总字节长度与所述 第二总字节长度一致时,开始下载所述当前文件。
第三方面,本发明实施例提供了一种用户终端,所述用户终端包括处理器以及存储器,所述存储器耦接到所述处理器,所述存储器存储指令,当所述指令由所述处理器执行时使所述用户终端执行以下操作:接收第一服务器返回的下载链接,所述下载链接包括目标文件的第一总字节长度;向与所述下载链接对应的第二服务器发起下载所述目标文件的HTTP请求;接收所述第二服务器返回的HTTP响应头信息,所述HTTP响应头信息包括当前文件的第二总字节长度;当所述第一总字节长度与所述第二总字节长度一致时,开始下载所述当前文件。
第四方面,本发明实施例提供了一种非暂时性机器可读存储介质,其上存储有可执行代码,当所述可执行代码被处理器执行时,使处理器执行上文所述的下载文件的方法。
与现有技术相比,本发明实施例提供的一种下载文件的方法、装置、用户终端及非暂时性机器可读存储介质,通过在下载当前文件之前,检验目标文件的所述第一总字节长度与当前文件的所述第二总字节长度是否一致,以实现对当前下载文件的合法性的检验,所述方法无需修改客户端与服务端的接口协议,实现起来简单高效,解决了下载应用文件字节数据错乱或数据里混杂着网页源码数据导致安装失败、以及运营商重定向了下载链接导致安装的应用非用户预期的应用文件的问题,提高了下载成功率以及用户下载体验。
为使本发明的上述目的、特征和优点能更明显易懂,下文特举较佳实施例,并配合所附附图,作详细说明如下。
附图说明
通过结合附图对本公开示例性实施方式进行更详细的描述,本公开的上述以及其它目的、特征和优势将变得更加明显,其中,在本公开示例性实施方式中,相同的参考标号通常代表相同部件。
图1是本发明实施例提供的用户终端与服务器进行交互的示意图。
图2是本发明实施例提供的用户终端的结构示意图。
图3是本发明第一实施例提供的一种下载文件的方法的流程图。
图4是本发明第二实施例提供的一种下载文件的方法的流程图。
图5是本发明第三实施例提供的一种下载文件的方法的流程图。
图6是本发明第四实施例提供的一种下载文件的方法的流程图。
图7是本发明第五实施例提供的一种下载文件的方法的流程图。
图8是本发明第六实施例提供的一种下载文件的方法的流程图。
图9是本发明实施例提供的一种下载文件装置的结构框图。
具体实施方式
下面将参照附图更详细地描述本公开的优选实施方式。虽然附图中显示了本公开的优选实施方式,然而应该理解,可以以各种形式实现本公开而不应被这里阐述的实施方式所限制。相反,提供这些实施方式是为了使本公开更加透彻和完整,并且能够将本公开的范围完整地传达给本领域的技术人员。
应注意到:相似的标号和字母在下面的附图中表示类似项,因此,一旦某一项在一个附图中被定义,则在随后的附图中不需要对其进行进一步定义和解释。同时,在本发明的描述中,术语“第一”、“第二”等仅用于区分描述,而不能理解为指示或暗示相对重要性。
图1示出了本发明实施例提供的服务器200与用户终端100进行交互的示意图。所述服务器200通过网络300与一个或多个用户终端100进行通信连接,以进行数据通信或交互。所述服务器200可以是网络服务器、数据库服务器等。所述用户终端100可以是个人电脑(personal computer,PC)、平板电脑、智能手机、个人数字助理(personal digital assistant,PDA)、车载设备、穿戴设备等。
图2示出了一种可应用于本发明实施例中的用户终端100的结构框图。如图2所示,用户终端100可以包括存储器102、存储控制器104,一个或多个(图中仅示出一个)处理器106、外设接口108、射频模块110、音频模块112、触控屏幕114等。这些组件通过一条或多条通讯总线/信号线116相互通讯。
存储器102可用于存储软件程序以及模块,如本发明实施例中的下载文件的方法以及装置对应的程序指令/模块,处理器106通过运行存储在存储器102内的软件程序以及模块,从而执行各种功能应用以及数据处理,如本发明实施例提供的下载文件的方法。
存储器102可包括高速随机存储器,还可包括非易失性存储器,如一个或者多个磁性存储装置、闪存、或者其他非易失性固态存储器。处理器106以及其他可能的组件对存储器102的访问可在存储控制器104的控制下进行。
外设接口108可以将各种输入/输入装置耦合至处理器106以及存储器102。在一些实施例中,外设接口108,处理器106以及存储控制器104可以在单个芯片中实现。在其他一些实例中,他们可以分别由独立的芯片实现。
射频模块110用于接收以及发送电磁波,实现电磁波与电信号的相互转换,从而与通讯网络或者其他设备进行通讯。
音频模块112向用户提供音频接口,其可包括一个或多个麦克风、一个或者多个扬声器以及音频电路。
触控屏幕114在用户终端100与用户之间同时提供一个输出及输入界面。具体地,触控屏幕114可以向用户显示视频输出,这些视频输出的内容可包括文字、图形、视频及其任意组合。
可以理解,图1所示的结构仅为示意,用户终端100还可包括比图2中所示更多或者更少的组件,或者具有与图2所示不同的配置。图2中所示的各组件可以采用硬件、软件或其组合实现。
于本发明实施例中,用户终端100中安装有客户端,该客户端可以是第三方应用软件,与服务器(Server)端相对应,共同遵循同一套数据协议,使得服务端跟客户端能够互相解析出对方的数据,为用户提供下载服务,例如下载文件,下载视频,下载音频等。
图3示出了本发明第一实施例提供的一种下载文件的方法的流程图,请参阅图3,本实施例描述的是客户端的处理流程,所述方法包括如下步骤。
步骤S301,接收第一服务器返回的下载链接,所述下载链接包括目标文件的第一总字节长度。
可以理解的是,所述下载链接中的第一总字节长度,可以是由所述第一服务器预先将已有的文件进行处理得到的每个文件的总字节长度。第一服务器得到每个文件的总字节长度后可以在每个文件的下载链接后添加总字节长度这个参数,得到新的下载链接,并更新第一服务器的数据库。当 所述第一服务器接收到客户端的下载链接请求后,将目标文件对应的下载链接返回给客户端。
例如,假设第一服务器中之前存储的文件A对应的下载链接为:http://android-apps.25pp.com/fs01/2015/01/29/5/0_dd84568d3e5831df12dac8cedc556e52.apk,
第一服务器通过计算求出文件A的总字节长度,假设为19736456,则第一服务器将文件A对应的下载链接更新为:
http://android-apps.25pp.com/fs01/2015/01/29/5/0_dd84568d3e5831df12dac8cedc556e52.apk?size=19736456,其中,size=19736456是目标文件A的总字节长度。
当所述第一服务器接收到以文件A作为目标文件的下载链接请求后,可以将包含size=19736456的下载链接返回给客户端。
步骤S302,向与所述下载链接对应的第二服务器发起下载所述目标文件的HTTP请求。
例如,在前述示例中,当客户端接收到目标文件A对应的下载链接后,向所述下载链接:
http://android-apps.25pp.com/fs01/2015/01/29/5/0_dd84568d3e5831df12dac8cedc556e52.apk?size=19736456,
对应的第二服务器发起下载所述目标文件的HTTP请求。
可以理解的是,所述第一服务器跟所述第二服务器可以为同一个服务器,即可以将目标文件的内容单独存放在第二服务器,也可以同时在第一服务器上存储目标文件的下载链接以及目标文件的内容。
步骤S303,接收所述第二服务器返回的HTTP响应头信息,所述HTTP响应头信息包括当前文件的第二总字节长度。
第二服务器接收到所述HTTP请求后,会返回HTTP响应信息。其中,HTTP响应信息包括HTTP响应头信息和HTTP响应正文信息。解析所述HTTP响应信息中的HTTP响应头信息,其中,HTTP响应头信息中可以包括多个字段,取出表示当前文件的总字节长度的字段,例如“content-range”字段,通过该字段,第一服务器就可以获知当前请求下载的文件的大小,也就是第二总字节长度。
步骤S304,当所述第一总字节长度与所述第二总字节长度一致时,开 始下载所述当前文件。
可以理解的是,如果应用文件字节数据错乱或数据里混杂着网页源码数据,或者运营商重定向了下载链接或替换了下载内容,通常会导致所述第一总字节长度与所述第二总字节长度不一致,因此当所述第一总字节长度与所述第二总字节长度不一致时,可以判定当前下载文件并非目标文件。因此当所述第一总字节长度与所述第二总字节长度不一致时,可以重新向与第二服务器发起下载所述目标文件的HTTP请求。
本发明实施例提供的下载文件的方法,通过在下载当前文件之前,检验目标文件的所述第一总字节长度与当前文件的所述第二总字节长度是否一致,来检验当前下载文件与目标文件是否为同一个文件,所述方法是在下载之前进行检验,而不是在下载过程中请求服务器进行检验,节约了检验的时间,避免了已经开始下载才发现当前文件并非目标文件,避免了浪费用户流量的问题。检验过程也无需服务器进行配合,因此无需引入新的复杂的逻辑,并且无需修改客户端与服务端的接口协议,只需要预先重新生成数据库中目标文件对应的下载链接即可,这种方式简单有效,且一定程度上解决了应用文件字节数据错乱或数据里混杂着网页源码数据导致安装失败以及运营商重定向了下载链接导致安装的应用非用户预期的应用文件的问题。
图4示出了本发明第二实施例提供的一种下载文件的方法的流程图,请参阅图4,本实施例描述的是客户端的处理流程,所述方法包括如下步骤。
步骤S401,接收第一服务器返回的下载链接,所述下载链接包括目标文件的第一总字节长度。
步骤S402,向与所述下载链接对应的第二服务器发起下载所述目标文件的HTTP请求。
步骤S403,接收所述第二服务器返回的HTTP响应头信息,所述HTTP响应头信息包括当前文件的第二总字节长度。
可以理解的是,步骤S401至步骤S403的实施方式可以参考上一实施例中的步骤S301至步骤S303的实施方式,此处不再赘述。
步骤S404,判断所述第一总字节长度与所述第二总字节长度是否一致。
当所述第一总字节长度与所述第二总字节长度不一致时,可以判定当 前下载文件并非目标文件。因此当所述第一总字节长度与所述第二总字节长度不一致时,可以执行步骤S405至步骤S410,当所述第一总字节长度与所述第二总字节长度一致时,可以执行步骤S411。
步骤S405,判断重新向与第二服务器发起下载所述目标文件的HTTP请求的次数是否达到预设次数。
可以理解的是,考虑到客户端重新向与第二服务器发起下载所述目标文件的HTTP请求的次数太多会影响文件下载请求的响应速度,因此客户端需要设置一个预设次数,当重新向与第二服务器发起下载所述目标文件的HTTP请求的次数没有达到预设次数,执行步骤S402至步骤S404,否则执行步骤S406。
步骤S406,向所述下载链接对应的第二服务器发起HTTPS请求。
可以理解的是,当所述目标文件的第一总字节长度与所述当前文件的第二总字节长度不一致时,判定当前HTTP请求可能被劫持,并且多次重试仍然被劫,此时采用HTTPS协议来发起下载请求。HTTPS即超文本传输安全协议,该协议的主要目的是提供对网络服务器的身份认证,保护交互数据的隐私和完整性。因此采用HTTPS进行下载请求可以保证下载请求相对安全,并且被劫持的几率大大降低。但是,可以理解的是,HTTPS协议由于每次通信需要加解密,对服务器性能开销大,成本高,所以在多次重试HTTP请求未果的情况下才会使用HTTPS进行请求下载。
可以理解的是,在其他实施方式中,预设次数也可以为零,即,当向第二服务器发起HTTP请求一次后,若所述第一总字节长度与所述第二总字节长度不一致,则可以立即向所述下载链接对应的第二服务器发起HTTPS请求。
步骤S407,接收所述第二服务器返回的HTTPS响应头信息,所述HTTPS响应头信息包括当前文件的第二总字节长度。
步骤S408,判断所述第一总字节长度与所述第二总字节长度是否一致。
当所述第一总字节长度与所述第二总字节长度不一致时,执行步骤S409,当所述第一总字节长度与所述第二总字节长度一致时,执行步骤S411。
步骤S409,判断重新向与第二服务器发起下载所述目标文件的HTTPS请求的次数是否达到预设次数。
可以理解的是,同样的,所述预设次数可以为零次。即,这种情况下只会向与第二服务器发起一次下载所述目标文件的HTTPS请求。另外,预设次数的设置也可以是根据目标文件的重要性来决定,当目标文件比较重要时,预设次数的值可以设置较大。
当向与第二服务器发起下载所述目标文件的HTTPS请求的次数没有达到预设次数,执行步骤S406至步骤S407,否则执行步骤S410。
步骤S410,显示用于提示用户网络异常的信息。
可以理解的是,通常来说,当进行多次HTTPS请求,仍然失败的原因,大多数是由于网络繁忙,网络中断或者例如2G/3G网络的切换导致的,此时显示用于提示用户网络异常的信息,以使用户看到所述提示信息后,可以进一步向客户端发起指示。
步骤S411,开始下载所述当前文件。
本发明实施例提供的下载文件的方法,除了解决了上一实施例可以解决的问题外,通过在向与第二服务器发起下载所述目标文件的HTTP请求的次数达到预设次数后,向第二服务器发起HTTPS请求,进一步解决了HTTP请求多次被劫持而导致下载的当前文件并非目标文件以及无法下载的问题,提高了下载的成功率。
图5示出了本发明第三实施例提供的一种下载文件的方法的流程图,请参阅图5,本实施例描述的是客户端的处理流程,所述方法包括如下步骤。
步骤S501,接收第一服务器返回的下载链接,所述下载链接包括目标文件的第一总字节长度及下载文件的第一数字签名;
其中,第一数字签名,是指对目标文件的文件内容通过摘要算法或者哈希算法等杂凑算法进行运算后求出的一个固定长度值,所述固定长度值即为第一数字签名,例如SHA-1签名,RIPEMD签名以及Hava签名等。
优选的,第一数字签名可以为MD5签名。可以理解的,文件的MD5值就像是这个文件的“数字指纹”。每个文件的MD5值是不同的,如果任何人对文件做了任何改动,其MD5值也就是对应的“数字指纹”就会发生变化。
例如目标下载文件的下载链接为:
http://android-apps.25pp.com/fs01/2015/01/29/5/0_dd84568d3e5831df12d ac8cedc556e52.apk?size=19736456&md5=7ca110f191c0d918f137efd072123273,
其中,size=19736456表示的是该目标文件的第一总字节长度:19736456,md5=7ca110f191c0d918f137efd072123273表示的是该目标文件的第一数字签名为:7ca110f191c0d918f137efd072123273。
步骤S502,向与所述下载链接对应的第二服务器发起下载所述目标文件的HTTP请求。
步骤S503,接收所述第二服务器返回的HTTP响应头信息,所述HTTP响应头信息包括当前文件的第二总字节长度。
步骤S504,判断所述第一总字节长度与所述第二总字节长度是否一致。
当所述第一总字节长度与所述第二总字节长度不一致时,执行步骤S505至步骤S510,当所述第一总字节长度与所述第二总字节长度一致时,执行步骤S511至步骤S513。
假设所述HTTP响应头信息中包括的当前文件的第二总字节长度为:19736456,可以判定出所述第一总字节长度与第二总字节长度一致,则可以开始下载。如果此时第二总字节长度不为19736456,则执行步骤S505至步骤S510,所述步骤S505至步骤S510与上一实施例中的步骤S405至步骤S410实施方式一致,此处就不再赘述。
步骤S505,判断重新向与第二服务器发起下载所述目标文件的HTTP请求的次数是否达到预设次数;
当向与第二服务器发起下载所述目标文件的HTTP请求的次数没有达到预设次数,执行步骤S502至步骤S504,否则执行步骤S506。
步骤S506,向所述下载链接对应的第二服务器发起HTTPS请求。
步骤S507,接收所述第二服务器返回的HTTPS响应头信息,所述HTTPS响应头信息包括当前文件的第二总字节长度;
步骤S508,判断所述第一总字节长度与所述第二总字节长度是否一致;
当所述第一总字节长度与所述第二总字节长度不一致时,执行步骤S509,当所述第一总字节长度与所述第二总字节长度一致时,执行步骤S511至步骤S513。
步骤S509,判断重新向与第二服务器发起下载所述目标文件的HTTPS请求的次数是否达到预设次数;
当重新向与第二服务器发起下载所述目标文件的HTTPS请求的次数没有达到预设次数,执行步骤S506至步骤S507,否则执行步骤S510。
步骤S510,显示用于提示用户网络异常的信息。
步骤S511,开始下载所述当前文件。
步骤S512,当所述当前文件下载完成后,计算所述当前文件的第二数字签名;判断所述第一数字签名与所述第二数字签名是否一致,如果一致,则判定所述当前文件为所述目标文件,下载成功,否则,下载失败。
可以理解的是,有时候可能会出现当前文件即使被劫持过、替换过或者篡改,但是其第二总字节大小可能恰好与目标文件的第一总字节大小一致,因此在下载完成后,再次检验所述第一数字签名与所述第二数字签名是否一致,可以更加确保下载文件的合法性以及完整性。
例如,当下载完成后,根据与计算目标文件的第一数字签名同样的方法计算出当前文件的第二数字签名,如果一致,即当前文件的第二数字签名为:7ca110f191c0d918f137efd072123273,则判定所述当前文件为所述目标文件,下载成功,反之下载失败。
步骤S513,若下载失败,显示用于提示用户重新下载的信息。
可以理解的是,当所述第一数字签名与所述第二数字签名不一致时,说明当前文件的内容被劫持过,替换过或者篡改过,因此需要向用户显示用于提示用户重新下载的信息,防止用户安装已经被劫持过,替换过或者篡改过的当前文件。
本发明实施例提供的下载文件的方法,除了解决了上两个实施例可以解决的方法外,并且通过在当前文件下载完成后对当前文件的数字签名进行检测,进一步的确保了下载文件的合法性以及完整性。
图6示出了本发明第四实施例提供的一种下载文件的方法的流程图,请参阅图6,本实施例描述的是客户端的处理流程,所述方法包括如下步骤。
步骤S601,接收第一服务器返回的下载链接,所述下载链接包括目标文件的第一总字节长度。
步骤S602,根据所述第一总字节长度,分配多个线程。
可以理解的是,对于当前文件的下载可以采用多线程的方式或者单线程的方式进行下载,而是否采用多线程,有许多策略可以选择,可以根据 下载速度与分段数及文件大小的关联性的统计对比来确定,比较简单有效的是根据所述第一总字节长度来决定。例如第一总字节长度为256个字节时的采用单线程,第一总字节长度大于256字节且小于512字节时,采用双线程,第一总字节长度大于512字节时采用三线程。可以理解的是,选择多线程的实施方式可以有多种,并不局限于上述实施方式。
步骤S603,通过所述多个线程分别向与所述下载链接对应的第二服务器发起下载所述目标文件的HTTP请求。
步骤S604,通过所述多个线程分别接收所述第二服务器返回的HTTP响应头信息,所述HTTP响应头信息包括当前文件的第二总字节长度。
步骤S605,当所述第一总字节长度与所述第二总字节长度一致时,每个线程分别开始下载所述当前文件。
可以理解的是,所述步骤S603至步骤S605与第一实施例中的步骤S302至步骤S304中的区别在于,本实施例是采用多线程进行当前文件的分段下载,在每个线程中实现步骤S302至步骤S304中的方法,相关内容就不再赘述。
本发明实施例提供的下载文件的方法,除了可以解决第一实施例可以解决的问题,还通过多线程进行分段下载,加快了下载文件的速度,并且每个线程都会进行所述第一总字节长度与所述第二总字节长度的检验,进一步提高了用户下载的体验。
图7示出了本发明第五实施例提供的一种下载文件的方法的流程图,请参阅图7,本实施例描述的是客户端的处理流程,所述方法包括如下步骤。
步骤S701,接收第一服务器返回的下载链接,所述下载链接包括目标文件的第一总字节长度。
步骤S702,根据所述第一总字节长度,分配多个线程。
步骤S703,通过所述多个线程分别向与所述下载链接对应的第二服务器发起下载所述目标文件的HTTP请求。
步骤S704,通过所述多个线程分别接收所述第二服务器返回的HTTP响应头信息,所述HTTP响应头信息包括当前文件的第二总字节长度。
步骤S705,每个线程判断所述第一总字节长度与所述第二总字节长度是否一致。
当所述第一总字节长度与所述第二总字节长度不一致时,判定出不一致的线程执行步骤S706至步骤S711,当所述第一总字节长度与所述第二总字节长度一致时,执行步骤S712。
步骤S706,判断重新向与第二服务器发起下载所述目标文件的HTTP请求的次数是否达到预设次数。
当向与第二服务器发起下载所述目标文件的HTTP请求的次数没有达到预设次数,执行步骤S703至步骤S705,否则执行步骤S707。
步骤S707,再次向所述下载链接对应的第二服务器发起HTTP请求。
步骤S708,接收所述第二服务器返回的HTTPS响应头信息,所述HTTPS响应头信息包括当前文件的第二总字节长度。
步骤S709,判断所述第一总字节长度与所述第二总字节长度是否一致。
当所述第一总字节长度与所述第二总字节长度不一致时,执行步骤S710,当所述第一总字节长度与所述第二总字节长度一致时,执行步骤S711。
步骤S710,判断重新向与第二服务器发起下载所述目标文件的HTTPS请求的次数是否达到预设次数。
当向与第二服务器发起下载所述目标文件的HTTPS请求的次数没有达到预设次数,执行步骤S707至步骤S708,否则执行步骤S711。
步骤S711,显示用于提示用户网络异常的信息。
步骤S712,每个线程开始下载所述当前文件。
可以理解的是,所述步骤S703至步骤S712与第二实施例中的步骤S402至步骤S411中的区别在于,本实施例是采用多线程进行当前文件的分段下载,在每个线程中实现步骤S402至步骤S411中的方法,相关内容就不再此赘述。
本发明实施例提供的下载文件的方法,除了可以解决第二实施例可以解决的问题,还通过多线程进行分段下载,加快了下载文件的速度,并且每个线程都会在向与第二服务器发起下载所述目标文件的HTTP请求的次数达到预设次数后,向第二服务器发起HTTPS请求,进一步解决了HTTP请求多次被劫持而导致下载的当前文件并非目标文件以及无法下载的问题,提高了下载的成功率,进一步提高了用户下载的体验。
图8示出了本发明第六实施例提供的一种下载文件的方法的流程图, 请参阅图8,本实施例描述的是客户端的处理流程,所述方法包括如下步骤。
步骤S801,接收第一服务器返回的下载链接,所述下载链接包括目标文件的第一总字节长度。
步骤S802,根据所述第一总字节长度,分配多个线程。
步骤S803,通过所述多个线程分别向与所述下载链接对应的第二服务器发起下载所述目标文件的HTTP请求。
步骤S804,通过所述多个线程分别接收所述第二服务器返回的HTTP响应头信息,所述HTTP响应头信息包括当前文件的第二总字节长度。
步骤S805,每个线程判断所述第一总字节长度与所述第二总字节长度是否一致。
当所述第一总字节长度与所述第二总字节长度不一致时,判定出不一致的线程执行步骤S806至步骤S811,当所述第一总字节长度与所述第二总字节长度一致时,执行步骤S812。
步骤S806,判断重新向与第二服务器发起下载所述目标文件的HTTP请求的次数是否达到预设次数。
当向与第二服务器发起下载所述目标文件的HTTP请求的次数没有达到预设次数,执行步骤S803至步骤S805,否则执行步骤S807。
步骤S807,再次向所述下载链接对应的第二服务器发起HTTP请求。
步骤S808,接收所述第二服务器返回的HTTPS响应头信息,所述HTTPS响应头信息包括当前文件的第二总字节长度。
步骤S809,判断所述第一总字节长度与所述第二总字节长度是否一致。
当所述第一总字节长度与所述第二总字节长度不一致时,执行步骤S810,当所述第一总字节长度与所述第二总字节长度一致时,执行步骤S811。
步骤S810,判断重新向与第二服务器发起下载所述目标文件的HTTPS请求的次数是否达到预设次数。
当向与第二服务器发起下载所述目标文件的HTTPS请求的次数没有达到预设次数,执行步骤S807至步骤S808,否则执行步骤S811。
步骤S811,显示用于提示用户网络异常的信息。
步骤S812,每个线程开始下载所述当前文件。
可以理解的是,每个线程下载的内容为当前文件的一部分。例如:当前文件大小100个字节,分3个线程进行下载,那么第一线程就请求下载0-33个字节,第二线程就请求下载34-67个字节,第三线程就请求下载68-100的字节。
步骤S813,当每个线程下载完毕,即当前文件下载完毕,计算所述当前文件的第二数字签名;判断所述第一数字签名与所述第二数字签名是否一致,如果一致,则判定所述当前文件为所述目标文件,下载成功,否则,下载失败。
步骤S814,当所述当前文件下载失败,显示用于提示用户重新下载的信息。
可以理解的是,所述步骤S803至步骤S814与第二实施例中的步骤S502至步骤S513中的区别在于,本实施例是采用多线程进行当前文件的分段下载,在每个线程中实现步骤S502至步骤S513中的方法,相关内容就不再此赘述。
本发明实施例提供的下载文件的方法,除了可以解决第三实施例可以解决的问题,还通过多线程进行分段下载,加快了下载文件的速度,并且在每个线程下载完成后,会对当前文件下载完成后对当前文件的数字签名进行检测,确保当前文件与目标文件一致,确保分发的正确性,进一步提高了用户下载的体验。
请参阅图9,是本发明实施例提供的下载文件的装置200的功能模块示意图。所述下载文件的装置200包括第一接收模块201,发送模块202,第二接收模块203以及下载模块204。
所述第一接收模块201,用于接收第一服务器返回的下载链接,所述下载链接包括目标文件的第一总字节长度;
所述发送模块202,用于向与所述下载链接对应的第二服务器发起下载所述目标文件的HTTP请求;
所述第二接收模块203,用于接收所述第二服务器返回的HTTP响应头信息,所述HTTP响应头信息包括当前文件的第二总字节长度;
所述下载模块204,用于当所述第一总字节长度与所述第二总字节长度一致时,开始下载所述当前文件。
考虑当HTTP请求会被劫持后还需要继续下载文件,因此,优选的, 所述装置还包括:第一请求模块205,所述第一请求模块205,用于当所述第一总字节长度与所述第二总字节长度不一致时,再次向所述下载链接对应的第二服务器发起HTTP请求。
进一步的,考虑如果发起多次HTTP请求仍被劫持后,还需要继续下载文件,因此,优选的,所述装置还包括:第二请求模块206,所述第二请求模块206,用于向所述下载链接对应的第二服务器发起预设次数的HTTP请求后,所述第一总字节长度与所述第二总字节长度仍不一致时,则向所述下载链接对应的第二服务器发起HTTPS请求。
进一步的,考虑到下载到的当前文件跟目标文件的总字节大小如果一致,但是还可能出现文件的内容并不一致的情况,因此,优选的所述第一接收模块201接收到的所述下载链接还包括下载文件的第一数字签名,所述装置还包括判断模块207,所述判断模块207,用于在所述下载模块204开始下载所述当前文件之后,当所述当前文件下载完成后,计算所述当前文件的第二数字签名;判断所述第一数字签名与所述第二数字签名是否一致,如果一致,则判定所述当前文件为所述目标文件,下载成功,否则,下载失败。
进一步的,考虑到目标文件的大小不一,可能出现较大文件时,采用多线程能够加快下载的速度,因此优选的,所述装置还包括分配模块208,所述分配模块208用于根据所述第一总字节长度,分配多个线程;所述发送模块202,还用于通过所述多个线程分别向与所述下载链接对应的第二服务器发起下载所述目标文件的HTTP请求;所述第二接收模块203,还用于通过所述多个线程分别接收所述第二服务器返回的HTTP响应头信息,所述HTTP响应头信息包括当前文件的第二总字节长度;所述下载模块204,还用于当所述第一总字节长度与所述第二总字节长度一致时,每个线程分别开始下载所述当前文件。所述第一请求模块205,还用于当判定出所述第一总字节长度与所述第二总字节长度不一致时,判定出不一致的线程再次向所述下载链接对应的第二服务器发起HTTP请求。所述第二请求模块206,还用于在所述判定出不一致的线程向所述下载链接对应的第二服务器发起预设次数的HTTP请求之后,所述第一总字节长度与所述第二总字节长度仍不一致时,所述判定出不一致的线程向所述下载链接对应的第二服务器发起HTTPS请求。
以上各模块可以是由软件代码实现,此时,上述的各模块可存储于用户终端100的存储器102内。以上各模块同样可以由硬件例如集成电路芯片实现。
需要说明的是,本说明书中的各个实施例均采用递进的方式描述,每个实施例重点说明的都是与其他实施例的不同之处,各个实施例之间相同相似的部分互相参见即可。
本发明实施例所提供的下载文件的装置,其实现原理及产生的技术效果和前述方法实施例相同,为简要描述,装置实施例部分未提及之处,可参考前述方法实施例中相应内容。
本领域的技术人员可以清楚地了解到本发明实施例中的技术可借助软件加必需的通用硬件的方式来实现,通用硬件包括通用集成电路、通用CPU、通用存储器、通用元器件等,当然也可以通过专用硬件包括专用集成电路、专用CPU、专用存储器、专用元器件等来实现,但很多情况下前者是更佳的实施方式。基于这样的理解,本发明实施例中的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品可以存储在存储介质中,如只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟、光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本发明各个实施例或者实施例的某些部分所述的方法。
因此,本发明的上述技术构思还可以被实施为一种非暂时性机器可读存储介质,其上存储有可执行代码。当该可执行代码被处理器执行时,使该处理器执行上文所述的下载文件的方法。
另一方面,本发明的上述技术构思还可以被实施为一种计算设备,该计算设备包括处理器和非暂时性机器可读存储介质。该非暂时性机器可读存储介质上存储有可执行代码。当该可执行代码被该处理器执行时,使该处理器执行上文所述的方法。
此外,根据本发明的方法还可以实现为一种计算机程序,该计算机程序包括用于执行本发明的上述方法中限定的上述各步骤的计算机程序代码指令。或者,根据本发明的方法还可以实现为一种计算机程序产品,该计算机程序产品包括计算机可读介质,在该计算机可读介质上存储有用于执行本发明的上述方法中限定的上述功能的计算机程序。本领域技术人员还 将明白的是,结合这里的公开所描述的各种示例性逻辑块、模块、电路和算法步骤可以被实现为电子硬件、计算机软件或两者的组合。
附图中的流程图和框图显示了根据本发明的多个实施例的系统和方法的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段或代码的一部分,所述模块、程序段或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标记的功能也可以以不同于附图中所标记的顺序发生。例如,两个连续的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。
以上已经描述了本发明的各实施例,上述说明是示例性的,并非穷尽性的,并且也不限于所披露的各实施例。在不偏离所说明的各实施例的范围和精神的情况下,对于本技术领域的普通技术人员来说许多修改和变更都是显而易见的。本文中所用术语的选择,旨在最好地解释各实施例的原理、实际应用或对市场中的技术的改进,或者使本技术领域的其它普通技术人员能理解本文披露的各实施例。

Claims (20)

  1. 一种下载文件的方法,其特征在于,所述方法包括:
    接收第一服务器返回的下载链接,所述下载链接包括目标文件的第一总字节长度;
    向与所述下载链接对应的第二服务器发起下载所述目标文件的HTTP请求;
    接收所述第二服务器返回的HTTP响应头信息,所述HTTP响应头信息包括当前文件的第二总字节长度;
    当所述第一总字节长度与所述第二总字节长度一致时,开始下载所述当前文件。
  2. 根据权利要求1所述的方法,其特征在于,所述方法还包括:
    当所述第一总字节长度与所述第二总字节长度不一致时,再次向所述下载链接对应的第二服务器发起HTTP请求。
  3. 根据权利要求1所述的方法,其特征在于,所述方法还包括:向所述下载链接对应的第二服务器发起预设次数的HTTP请求后,所述第一总字节长度与所述第二总字节长度仍不一致时,则向所述下载链接对应的第二服务器发起HTTPS请求。
  4. 根据权利要求3所述的方法,其特征在于,在所述向所述下载链接对应的第二服务器发起HTTPS请求之后,所述方法还包括:
    当所述HTTPS请求失败,显示用于提示用户网络异常的信息。
  5. 根据权利要求1所述的方法,其特征在于,所述下载链接还包括下载文件的第一数字签名,在所述开始下载所述当前文件之后,所述方法还包括:
    当所述当前文件下载完成后,计算所述当前文件的第二数字签名;
    判断所述第一数字签名与所述第二数字签名是否一致,如果一致,则判定所述当前文件为所述目标文件,下载成功,否则,下载失败。
  6. 根据权利要求5所述的方法,其特征在于,在所述下载失败之后,所述方法还包括:显示用于提示用户重新下载的信息。
  7. 根据权利要求5所述的方法,其特征在于,所述第一数字签名和第二数字签名为MD5签名。
  8. 根据权利要求1所述的方法,其特征在于,向与所述下载链接对应的第二服务器发起下载所述目标文件的HTTP请求,接收所述第二服务器返回的HTTP响应头信息,所述HTTP响应头信息包括当前文件的第二总字节长度,当所述第一总字节长度与所述第二总字节长度一致时,开始下载所述当前文件,具体包括:
    根据所述第一总字节长度,分配多个线程;
    通过所述多个线程分别向与所述下载链接对应的第二服务器发起下载所述目标文件的HTTP请求;
    通过所述多个线程分别接收所述第二服务器返回的HTTP响应头信息,所述HTTP响应头信息包括当前文件的第二总字节长度;
    当所述第一总字节长度与所述第二总字节长度一致时,每个线程分别开始下载所述当前文件。
  9. 根据权利要求8所述的方法,其特征在于,所述方法还包括:当判定出所述第一总字节长度与所述第二总字节长度不一致时,判定出不一致的线程再次向所述下载链接对应的第二服务器发起HTTP请求。
  10. 根据权利要求9所述的方法,其特征在于,所述方法还包括:在所述判定出不一致的线程向所述下载链接对应的第二服务器发起预设次数的HTTP请求之后,所述第一总字节长度与所述第二总字节长度仍不一致时,所述判定出不一致的线程向所述下载链接对应的第二服务器发起HTTPS请求。
  11. 根据权利要求1所述的方法,其特征在于,所述第一服务器与所 述第二服务器为同一服务器。
  12. 一种下载文件的装置,其特征在于,所述装置包括:
    第一接收模块,用于接收第一服务器返回的下载链接,所述下载链接包括目标文件的第一总字节长度;
    发送模块,用于向与所述下载链接对应的第二服务器发起下载所述目标文件的HTTP请求;
    第二接收模块,用于接收所述第二服务器返回的HTTP响应头信息,所述HTTP响应头信息包括当前文件的第二总字节长度;
    下载模块,用于当所述第一总字节长度与所述第二总字节长度一致时,开始下载所述当前文件。
  13. 根据权利要求12所述的装置,其特征在于,所述装置还包括:第一请求模块,
    所述第一请求模块,用于当所述第一总字节长度与所述第二总字节长度不一致时,再次向所述下载链接对应的第二服务器发起HTTP请求。
  14. 根据权利要求12所述的装置,其特征在于,所述装置还包括:第二请求模块,
    所述第二请求模块,用于向所述下载链接对应的第二服务器发起预设次数的HTTP请求后,所述第一总字节长度与所述第二总字节长度仍不一致时,则向所述下载链接对应的第二服务器发起HTTPS请求。
  15. 根据权利要求12所述的装置,其特征在于,所述第一接收模块接收到的所述下载链接还包括下载文件的第一数字签名,所述装置还包括判断模块,
    所述判断模块,用于在所述下载模块开始下载所述当前文件之后,当所述当前文件下载完成后,计算所述当前文件的第二数字签名;判断所述第一数字签名与所述第二数字签名是否一致,如果一致,则判定所述当前文件为所述目标文件,下载成功,否则,下载失败。
  16. 根据权利要求12所述的装置,其特征在于,所述装置还包括分配模块,所述分配模块用于根据所述第一总字节长度,分配多个线程;所述发送模块,还用于通过所述多个线程分别向与所述下载链接对应的第二服务器发起下载所述目标文件的HTTP请求;所述第二接收模块,还用于通过所述多个线程分别接收所述第二服务器返回的HTTP响应头信息,所述HTTP响应头信息包括当前文件的第二总字节长度;所述下载模块,还用于当所述第一总字节长度与所述第二总字节长度一致时,通过每个线程分别开始下载所述当前文件。
  17. 根据权利要求16所述的装置,其特征在于,所述装置还包括:第一请求模块,用于当判定出所述第一总字节长度与所述第二总字节长度不一致时,通过判定出不一致的线程再次向所述下载链接对应的第二服务器发起HTTP请求。
  18. 根据权利要求17所述的装置,其特征在于,所述装置还包括:第二请求模块,用于在所述判定出不一致的线程向所述下载链接对应的第二服务器发起预设次数的HTTP请求之后,所述第一总字节长度与所述第二总字节长度仍不一致时,通过所述判定出不一致的线程向所述下载链接对应的第二服务器发起HTTPS请求。
  19. 一种用户终端,其特征在于,所述用户终端包括处理器以及存储器,所述存储器耦接到所述处理器,所述存储器存储指令,当所述指令由所述处理器执行时使所述用户终端执行以下操作:
    接收第一服务器返回的下载链接,所述下载链接包括目标文件的第一总字节长度;
    向与所述下载链接对应的第二服务器发起下载所述目标文件的HTTP请求;
    接收所述第二服务器返回的HTTP响应头信息,所述HTTP响应头信息包括当前文件的第二总字节长度;
    当所述第一总字节长度与所述第二总字节长度一致时,开始下载所述当前文件。
  20. 一种非暂时性机器可读存储介质,其上存储有可执行代码,当所述可执行代码被处理器执行时,使所述处理器执行根据权利要求1-11中任一项所述的方法。
PCT/CN2017/083270 2016-05-20 2017-05-05 下载文件的方法、装置、用户终端及机器可读存储介质 WO2017198079A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610345945.6 2016-05-20
CN201610345945.6A CN105897911A (zh) 2016-05-20 2016-05-20 下载文件的方法、装置及用户终端

Publications (1)

Publication Number Publication Date
WO2017198079A1 true WO2017198079A1 (zh) 2017-11-23

Family

ID=56717164

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/083270 WO2017198079A1 (zh) 2016-05-20 2017-05-05 下载文件的方法、装置、用户终端及机器可读存储介质

Country Status (2)

Country Link
CN (1) CN105897911A (zh)
WO (1) WO2017198079A1 (zh)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111431851A (zh) * 2020-02-18 2020-07-17 视联动力信息技术股份有限公司 数据包下载方法、装置及可读存储介质
CN114422499A (zh) * 2021-12-27 2022-04-29 北京奇艺世纪科技有限公司 一种文件下载方法、系统及装置
CN115086297A (zh) * 2022-05-30 2022-09-20 一点灵犀信息技术(广州)有限公司 文件处理方法及设备

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105897911A (zh) * 2016-05-20 2016-08-24 广州优视网络科技有限公司 下载文件的方法、装置及用户终端
CN106982249A (zh) * 2017-03-03 2017-07-25 广州优视网络科技有限公司 多线程分段下载方法、设备、客户端设备及电子设备
CN109496418B (zh) * 2018-05-31 2021-10-08 杭州橙云科技创新服务有限公司 文件下载方法、装置及设备/终端/服务器
CN109240721A (zh) * 2018-08-24 2019-01-18 江苏恒宝智能系统技术有限公司 一种mcu在线升级的方法
CN109639666B (zh) * 2018-12-07 2020-12-25 国能日新科技股份有限公司 气象数据文件传输方法和装置
CN110311972B (zh) * 2019-06-27 2022-02-22 百度在线网络技术(北京)有限公司 用于应用软件分发的检测方法、装置、设备及介质
CN115878676B (zh) * 2023-02-08 2023-05-05 成都数联云算科技有限公司 一种预览文件的方法、装置、设备和介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104079673A (zh) * 2014-07-30 2014-10-01 北京奇虎科技有限公司 一种应用下载中防止dns劫持的方法、装置和系统
CN105302617A (zh) * 2015-11-25 2016-02-03 魅族科技(中国)有限公司 一种下载应用程序的方法及服务器
CN105516246A (zh) * 2015-11-25 2016-04-20 魅族科技(中国)有限公司 一种防应用程序下载劫持的方法及服务器
CN105897911A (zh) * 2016-05-20 2016-08-24 广州优视网络科技有限公司 下载文件的方法、装置及用户终端

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101656754A (zh) * 2008-08-21 2010-02-24 北京亿企通信息技术有限公司 一种在即时通信工具中穿越防火墙的方法
GB2500229B (en) * 2012-03-14 2014-08-06 Canon Kk Method,system and server device for transmitting a digital resource in a client-server communication system
CN103401836A (zh) * 2013-07-01 2013-11-20 北京卓易讯畅科技有限公司 一种用于判断网页是否被isp劫持的方法与设备
CN103885806B (zh) * 2014-04-02 2017-07-07 深圳市兰丁科技有限公司 机顶盒的系统软件在线升级的实现方法和装置
CN104506950A (zh) * 2014-12-29 2015-04-08 珠海全志科技股份有限公司 网络流媒体播放中的多线程下载方法、装置及下载设备

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104079673A (zh) * 2014-07-30 2014-10-01 北京奇虎科技有限公司 一种应用下载中防止dns劫持的方法、装置和系统
CN105302617A (zh) * 2015-11-25 2016-02-03 魅族科技(中国)有限公司 一种下载应用程序的方法及服务器
CN105516246A (zh) * 2015-11-25 2016-04-20 魅族科技(中国)有限公司 一种防应用程序下载劫持的方法及服务器
CN105897911A (zh) * 2016-05-20 2016-08-24 广州优视网络科技有限公司 下载文件的方法、装置及用户终端

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111431851A (zh) * 2020-02-18 2020-07-17 视联动力信息技术股份有限公司 数据包下载方法、装置及可读存储介质
CN111431851B (zh) * 2020-02-18 2022-08-23 视联动力信息技术股份有限公司 数据包下载方法、装置及可读存储介质
CN114422499A (zh) * 2021-12-27 2022-04-29 北京奇艺世纪科技有限公司 一种文件下载方法、系统及装置
CN114422499B (zh) * 2021-12-27 2023-12-05 北京奇艺世纪科技有限公司 一种文件下载方法、系统及装置
CN115086297A (zh) * 2022-05-30 2022-09-20 一点灵犀信息技术(广州)有限公司 文件处理方法及设备

Also Published As

Publication number Publication date
CN105897911A (zh) 2016-08-24

Similar Documents

Publication Publication Date Title
WO2017198079A1 (zh) 下载文件的方法、装置、用户终端及机器可读存储介质
CN110944330B (zh) Mec平台部署方法及装置
WO2018036314A1 (zh) 一种单点登录认证方法及装置、存储介质
WO2017177383A1 (zh) 一种远程管理方法及设备
CN107852572B (zh) 与附近的设备共享访问
JP6371919B2 (ja) セキュアなソフトウェアの認証と検証
WO2017071207A1 (zh) 一种应用安装方法、相关装置及应用安装系统
CN109951546B (zh) 基于智能合约的事务请求处理方法、装置、设备和介质
US12001824B2 (en) Application package splitting and reassembly method and apparatus, and application package running method and apparatus
WO2019201040A1 (zh) 一种管理更新文件的方法、系统及终端设备
WO2019061629A1 (zh) 一种数据校验方法及服务器
CN109309651A (zh) 一种文件传输方法、装置、设备和存储介质
CN112491776B (zh) 安全认证方法及相关设备
US10621335B2 (en) Method and device for verifying security of application
CN110650112B (zh) 一种通用鉴权方法、装置及云服务网络系统
CN105812313B (zh) 恢复会话的方法和服务器、生成会话凭证的方法和装置
EP3819802A1 (en) Data consistency checking method and data uploading/downloading apparatus
CN110958119A (zh) 身份验证方法和装置
CN110247897B (zh) 一种系统登录方法、设备、网关及计算机可读存储介质
WO2017076051A1 (zh) 一种获取超级用户权限的方法及装置
CN109067746B (zh) 客户端与服务器之间的通信方法及装置
US20210099432A1 (en) Data consistency verification method, and data uploading and downloading device
JP2018519596A (ja) アプリケーションダウンロード方法及び装置
KR20160006925A (ko) 앱 무결성 검증 장치 및 그 방법
CN111654379B (zh) 多服务器的统一令牌生成方法及认证方法

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE

121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17798642

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 17798642

Country of ref document: EP

Kind code of ref document: A1