WO2019227427A1 - 文件下载方法、装置及设备/终端/服务器 - Google Patents

文件下载方法、装置及设备/终端/服务器 Download PDF

Info

Publication number
WO2019227427A1
WO2019227427A1 PCT/CN2018/089358 CN2018089358W WO2019227427A1 WO 2019227427 A1 WO2019227427 A1 WO 2019227427A1 CN 2018089358 W CN2018089358 W CN 2018089358W WO 2019227427 A1 WO2019227427 A1 WO 2019227427A1
Authority
WO
WIPO (PCT)
Prior art keywords
download
file
segment
request
downloaded
Prior art date
Application number
PCT/CN2018/089358
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 优视科技新加坡有限公司
Priority to PCT/CN2018/089358 priority Critical patent/WO2019227427A1/zh
Priority to CN201880001152.XA priority patent/CN109496418B/zh
Publication of WO2019227427A1 publication Critical patent/WO2019227427A1/zh

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]

Definitions

  • the present application relates to the field of computer technology, and specifically to the field of Internet technology, and in particular, to a file downloading method, device, and device / terminal / server.
  • the file download link requested by the client may not be able to support multi-threaded segmented download, so it is necessary to determine in advance whether the server supports multi-threaded segmented download when downloading the file.
  • the traditional judgment method is to identify whether the file can be downloaded in segments according to the Accept-Range field in the response header of the HTTP request for file download (in the HTTP protocol, this field is used to indicate whether the download is supported in segments). If you support segmentation, you can think of it as supporting multi-threaded segmented download. However, this method of judgment does not guarantee 100% accuracy. For example, the server itself supports segmented download.
  • the Accept-Range field of the header of the response message to the download request is bytes.
  • the purpose of this application is to propose a file downloading method, device, and device / terminal / server to solve the problem that the existing file downloading method cannot accurately determine whether the file download link supports segmented downloading.
  • the present application provides a file downloading method, including: sending a first segment download request through a first thread, receiving a first response message for the first segment download request; and, through a second thread, Sending a second segment download request and receiving a second response message to the second segment download request; wherein the first segment download request is used to request download of a first portion of data of a file to be downloaded, and the second The segment download request is used to request to download the second part of the data of the file to be downloaded; if both the first response message and the second response message indicate that the corresponding segment download request was successfully executed, Download the file for multi-threaded segmented download.
  • an embodiment of the present application provides a file downloading apparatus, which includes: a request sending module configured to send a first segment download request through a first thread, and receive a first segment download request for the first segment download request. A response message; and sending a second segment download request through a second thread to receive a second response message for the second segment download request; wherein the first segment download request is used to request download to be downloaded.
  • the first partial data of the file, the second partial download request is used to request to download the second partial data of the file to be downloaded; the partial download module is configured to be used when the first response message and the second response
  • the messages all indicate that the multi-threaded segment download is performed on the file to be downloaded when the corresponding segment download request is successfully executed.
  • an embodiment of the present application provides a device / terminal / server, including: one or more processors; a memory for storing one or more programs; and when one or more programs are processed by one or more The processor executes such that one or more processors implement the method as described above.
  • an embodiment of the present application provides a computer-readable storage medium on which a computer program is stored, and when the program is executed by a processor, the method as described above is implemented.
  • the file downloading method, device, device / terminal / server and computer-readable storage medium provided in this application send a first segmented download request through a first thread, and a second thread send a second segmented download request to pass a second request
  • the file provider such as a server
  • the file provider can support multi-threaded segmented file downloads. If both the first response message responding to the first segment download request and the second response message responding to the second download request indicate that the segment download request was executed correctly , It indicates that the file providing end, such as the server, supports multi-threaded segmented downloading, and then downloads the file to be downloaded through the first and second threads or establishes more threads.
  • This method of detecting whether a file to be downloaded can be downloaded in multiple threads by using a secondary request can effectively ensure the accuracy of the detection result and avoid the Accept-Range field in the response header of a request that simply passes the HTTP protocol in the prior art.
  • the problem of judging whether a file can be downloaded in sections is that the inaccurate judgment causes errors in the downloaded file, which ensures the accuracy and success rate of the file download.
  • FIG. 1 is a flowchart of steps in a file download method according to the first embodiment of the present application
  • FIG. 3 is a structural block diagram of a file downloading device according to a third embodiment of the present application.
  • FIG. 4 is a structural block diagram of a file downloading device according to a fourth embodiment of the present application.
  • FIG. 5 is a schematic structural diagram of a device / terminal / server according to Embodiment 5 of the present application.
  • FIG. 1 shows a flowchart of steps in a file download method according to the first embodiment of the present application.
  • the file download method in this embodiment includes the following steps:
  • Step 102 Send a first segment download request through a first thread, receive a first response message for the first segment download request; and send a second segment download request through a second thread, and receive a second segment download Requested second response message.
  • the first segment download request is used to request download of the first part of data of the file to be downloaded
  • the second segment download request is used to request to download the second part of data of the file to be downloaded.
  • the first part of the data and the second part of the data may be completely different data, or may be the same data, or may have partially overlapping data, or may be a subset of the other.
  • the first part of the data is the entire data of the file to be downloaded
  • the second part of the data is the partial data of the file to be downloaded.
  • the first thread and the second thread are different threads.
  • description is made by taking data interaction and downloading a file through the HTTP protocol as an example.
  • the client may send a first segment download request through a first thread, and receive a corresponding first response message.
  • the first segment download request may be a request message (request) based on the HTTP protocol, which requests a segment download by adding a Range field to a header.
  • the first response message may be a response message (response) based on the HTTP protocol, which may indicate whether the first segment download request is successfully executed, and may further include the content requested to be downloaded by the first segment download request.
  • the second segment download request may refer to the description of the first segment download request
  • the second response message may refer to the description of the first response message
  • Step 104 If both the first response message and the second response message indicate that the corresponding segmented download request is successfully executed, perform multi-threaded segmented download of the file to be downloaded.
  • both the first response message and the second response message indicate that the corresponding segmented download request was successfully executed, it indicates that the file was downloaded through the multi-threaded segmented download method, and the file provider (for example, the server) can support multi-threaded segmentation. Segment download, and in the current state can correctly respond to and process multi-threaded segment download requests. According to this, multi-threaded segmented downloading can be performed on the downloaded file to improve the download efficiency.
  • the file provider for example, the server
  • a new thread sends a new segment download request through the new thread, and receives a corresponding response message to download other data segments of the file to be downloaded.
  • a first segmented download request is sent by a first thread
  • a second segmented download request is sent by a second thread to detect whether a file provider, such as a server, can support multi-threaded segmented file downloads through a secondary request. If both the first response message responding to the first segment download request and the second response message responding to the second download request indicate that the segment download request was performed correctly, it indicates that the file provider, such as a server, supports multi-threaded segment download, and further Download the files to be downloaded through the first and second threads or further establish more threads.
  • This method of detecting whether a file to be downloaded can be downloaded in multiple threads by using a secondary request can effectively ensure the accuracy of the detection result and avoid the Accept-Range field in the response header of a request that simply passes the HTTP protocol in the prior art.
  • the problem of judging whether a file can be downloaded in sections is that the inaccurate judgment causes errors in the downloaded file, which ensures the accuracy and success rate of the file download.
  • the file download method in this embodiment may be executed by a suitable application such as a browser or the like or a suitable functional component or a suitable electronic device (such as a tablet computer, a mobile phone, a desktop computer, a server, etc.) with data processing capabilities.
  • a suitable application such as a browser or the like or a suitable functional component or a suitable electronic device (such as a tablet computer, a mobile phone, a desktop computer, a server, etc.) with data processing capabilities.
  • Step S202 Send the first segment download request through the first thread, receive a first response message for the first segment download request; and send the second segment download request through the second thread, and receive the second segment download Requested second response message.
  • step S202 includes the following sub-steps:
  • Step S202a Send a first segment download request through a first thread, and receive a first response message for the first segment download request.
  • the first segment download request is used to request to download the first part of the data of the file to be downloaded.
  • the first part of the data may be part of the data of the file to be downloaded, or all of the data of the file to be downloaded.
  • the first part of the data is the entire data of the file to be downloaded as an example for description.
  • the first thread may send the first segment download request in any appropriate transmission mode, which is not limited in this embodiment.
  • the first thread sends a first segment download request by sending an HTTP protocol request message.
  • the first segment download request may be a request message using a GET method, and a Range field is added to the request message to perform a segment download request.
  • the value of the Range field may be "0-" to indicate that all data of the file to be downloaded is requested.
  • the first segment download request may be:
  • the address of the file to be downloaded in the GET method can be obtained from the file download link.
  • the first response message for the first segmented download request response will carry the size of the requested data.
  • the HTTP response message the HTTP In the protocol, the structure of the response message can be divided into two parts, the header and the message entity.
  • the content in the header file mainly includes an identifier (such as HTTP / 1.1) used to identify the corresponding HTTP version of the server, a status code (such as 200) used to indicate the processing result, and other response header fields (such as content -length, content-type, etc.).
  • the content in the message entity is mainly the resource entity (such as the data requested by the download request).
  • the content-length field (also called the transmission length field) that can be carried in the header of the response message is used to indicate the message entity transmission length of the first response message, that is, the size of the data requested by the Range field in the request message . This makes it easy to determine the size of the file to be downloaded.
  • the status code carried in the header of the response message is used to indicate whether the request was successfully executed and responded.
  • the corresponding status code is 206 (partial content), which indicates that the request containing the Range field was successfully executed.
  • the header of the response message may carry a transfer-encoding field, which is used to indicate the type of transfer encoding of the first response message, such as chunked.
  • a transfer-encoding field is used to indicate the type of transfer encoding of the first response message, such as chunked.
  • the status code in the first response message is 206, the following steps are continued; otherwise, the information indicated by the status code can be used. Execute the corresponding strategy. If the status code is 404, stop downloading and report an error.
  • Step S202b It is determined whether the first response message contains information used to indicate that the type of transmission coding is block coding.
  • the HTTP protocol it can be determined whether the value of the transfer-encoding field in the first response message is chunked, and whether the transmission encoding type of the first response message is block encoding.
  • the first response message carries a transfer-encoding field and the value is chunked, it is determined that the first response message includes information indicating that the type of the transmission encoding is block encoding, otherwise, it is determined that the first response message does not include Information used to indicate that the transmission encoding type is block encoding.
  • the response message is transmitted by the block encoding transmission method, which makes it difficult to determine the file size of the file to be downloaded, and it is not convenient to subsequently send a segmented download request.
  • the first thread can be directly used for single-threaded downloading of the file to be downloaded.
  • step S202b may be omitted and the second segment download request may be sent directly.
  • the value of the Range field in the second segment download request may be randomly determined or preset, such as 500-1000 and the like.
  • step S202f of sending a second segment download request through a second thread and receiving a second response message for the second segment download request may be directly performed, and Steps S202c to e described below may be performed, and then step S202f of sending a second segment download request through a second thread and receiving a second response message for the second segment download request may be performed.
  • Step S202c Obtain the file size of the file to be downloaded from the first response message.
  • the header file of the first response message includes a content-length field (transmission length field), which is used to indicate the message entity transmission length of the first response message.
  • transmission length field since the first part of the data requested by the first segment download request is the entire data of the file to be downloaded, the message entity transmission length of the first response message is the size of the file to be downloaded.
  • the content-length field in the response message determines the size of the file to be downloaded.
  • the value of the transmission length field (that is, the content-length) in the first response message is acquired, and the file size of the file to be downloaded is set to the value of the transmission length field.
  • step S202c may be omitted; or, the file size of the requested partial data is obtained from the first response message.
  • the value of the transmission length field (that is, content-length) in the first response message is acquired, and the file size of the requested partial data is set to the value of the transmission length field.
  • the file size of the file to be downloaded may also be obtained by other appropriate methods, such as requesting the file size from the server through another request different from the current request.
  • Step S202d Set N data download segments for the file to be downloaded according to the file size, where N is a positive integer greater than or equal to 2.
  • the file to be downloaded (or part of the requested data) can be segmented for subsequent multi-threaded segmented download. For example, in this embodiment, the file to be downloaded (or the requested partial data) is divided into N segments on an average, that is, N data download segments are set for the file to be downloaded (or the requested partial data).
  • the specific value of N can be determined according to requirements, for example, the specific value of N is determined according to the computing capacity of the client's computing device, the network status, and the like, as long as N is greater than or equal to 2 and is a positive integer.
  • Step S202e Select a segment from the N data download segments, and generate a second segment download request according to the selected segment.
  • the size of each segment is filesize / N, where filesize is the file of the file to be downloaded (or part of the requested data) Size, which is the value of content-length.
  • filesize / N is not an integer, those skilled in the art can use any appropriate strategy to treat it as an integer, such as rounding up or down, etc. (in this case, the size of the last segment may be Different from other segments), this embodiment of the present application does not limit this.
  • the selected segment is the last segment of the N data download segments.
  • the value of the Range field is the start position and end position of the data requested to be downloaded (the end position can be omitted).
  • the segment corresponding to the download request is the last segment of the file to be downloaded, so the value of the Range field can be easily and simply determined, and the efficiency of the secondary request detection is improved.
  • the starting position of the corresponding second segment data in the Range field may be: filesize -filesize / N; the end position of the second part of the data is filesize-1.
  • the filesize / N is not an integer, it can be processed by the person skilled in the art into any integer using any appropriate strategy.
  • Step S202f Send a second segment download request through a second thread, and receive a second response message for the second segment download request.
  • the second segment download request is generated, the second segment download request is sent through the second thread, and a second response message for the second segment download request is received.
  • step S204 is performed; otherwise, the first thread is used for single-thread downloading of the file to be downloaded.
  • Step S204 If both the first response message and the second response message indicate that the corresponding segmented download request is successfully executed, perform multi-threaded segmented download of the file to be downloaded.
  • the first thread and the second thread may continue to download, or one or two of them may be ended, and a new thread may be re-created for segmented download, or one of them may be Or based on both, continue to create new threads for downloading.
  • segment download request where each of the N-1 segment download requests is used to request download of data of one segment of the N-1 segments, and each requested segment is different; Send N-1 segment download requests through corresponding N-1 threads, and receive corresponding response messages to complete each segment download of the file to be downloaded, thereby completing the download of the entire file to be downloaded.
  • the first thread may be terminated or released to avoid repeated downloads occupying storage space and bandwidth.
  • N-2 threads can be created, and a new segment download request is sent using the first thread.
  • the download rate of the file to be downloaded can be increased, and time can be saved.
  • a first segmented download request is sent by a first thread
  • a second segmented download request is sent by a second thread to detect whether a file provider, such as a server, can support multi-threaded segmented file downloads through a secondary request. If both the first response message responding to the first segment download request and the second response message responding to the second download request indicate that the segment download request was performed correctly, it indicates that the file provider, such as a server, supports multi-threaded segment download, and further Download the files to be downloaded through the first and second threads or further establish more threads.
  • This method of detecting whether a file to be downloaded can be downloaded in multiple threads by using a secondary request can effectively ensure the accuracy of the detection result and avoid the Accept-Range field in the response header of a request that simply passes the HTTP protocol in the prior art.
  • the problem of judging whether a file can be downloaded in sections is that the inaccurate judgment causes errors in the downloaded file, which ensures the accuracy and success rate of the file download.
  • the file download method in this embodiment may be executed by a suitable application such as a browser or the like or a suitable functional component or a suitable electronic device (such as a tablet computer, a mobile phone, a desktop computer, a server, etc.) with data processing capabilities.
  • a suitable application such as a browser or the like or a suitable functional component or a suitable electronic device (such as a tablet computer, a mobile phone, a desktop computer, a server, etc.) with data processing capabilities.
  • the application scenario is described as an example of file downloading through the HTTP protocol, but it should be understood that the file downloading method can be applied to other scenarios, such as ftp protocol downloading. As long as the solution of detecting whether the file download link supports segment downloading through a secondary request is within the protection scope of this application.
  • FIG. 3 shows a structural block diagram of a file downloading apparatus according to Embodiment 3 of the present application.
  • the file downloading device of this embodiment includes: a request sending module 302 configured to send a first segment download request through a first thread, and receive a first response message for the first segment download request; and send via a second thread
  • the second segment download request receives a second response message for the second segment download request; wherein the first segment download request is used to request to download the first part of the data of the file to be downloaded, and the second segment download request is used to request Download the second part of the data of the file to be downloaded;
  • the segment download module 304 is configured to perform multi-thread segmentation on the file to be downloaded when the first response message and the second response message indicate that the corresponding segment download request is successfully performed download.
  • the first thread is used to send a first segmented download request
  • the second thread is used to send a second segmented download request to detect whether the file provider, such as a server, can support multi-threaded segmented file download through a second request. If both the first response message responding to the first segment download request and the second response message responding to the second download request indicate that the segment download request was performed correctly, it indicates that the file provider, such as a server, supports multi-threaded segment download, and then passes The first and second threads or further threads are created to download the file to be downloaded.
  • This method of detecting whether a file to be downloaded can be downloaded in multiple threads by using a secondary request can effectively ensure the accuracy of the detection result and avoid the Accept-Range field in the response header of a request that simply passes the HTTP protocol in the prior art.
  • the problem of judging whether a file can be downloaded in sections is that the inaccurate judgment causes errors in the downloaded file, which ensures the accuracy and success rate of the file download.
  • FIG. 4 shows a structural block diagram of a file download apparatus according to Embodiment 4 of the present application.
  • the file downloading device of this embodiment includes: a request sending module 402 configured to send a first segment download request through a first thread, and receive a first response message for the first segment download request; and send via a second thread
  • the second segment download request receives a second response message for the second segment download request; wherein the first segment download request is used to request to download the first part of the data of the file to be downloaded, and the second segment download request is used to request Download the second part of the data of the file to be downloaded;
  • the segment download module 404 is configured to perform multi-thread segmentation on the file to be downloaded when the first response message and the second response message indicate that the corresponding segment download request is successfully performed download.
  • the first part of the data is all the data of the file to be downloaded; the device further includes: a file size obtaining module 406 configured to obtain the to-be-read from the first response message before sending the second segment download request through the second thread
  • the file size of the downloaded file is configured to set N data download segments for the file to be downloaded according to the file size, where N is a positive integer greater than or equal to 2;
  • a second segment download request is generated Module 410 is configured to select a segment from the N data download segments, and generate a second segment download request according to the selected segment.
  • the first response message includes a transmission length field for indicating a transmission length of the message entity of the first response message; the file size obtaining module 406 is configured to obtain a value of the transmission length field in the first response message, The file size of the downloaded file is set to the value of the transmission length field to obtain the file size of the file to be downloaded from the first response message.
  • the segment download module 404 includes a remaining request creation module 4041 configured to generate corresponding N-1 segment download requests for the remaining N-1 segments of the N data download segments, Among them, each of the N-1 segment download requests is used to request download of data of one segment of the N-1 segments, and each requested segment is different; the remaining request sending module 4042 , Configured to send N-1 segmented download requests through corresponding N-1 threads, and receive corresponding response messages.
  • a remaining request creation module 4041 configured to generate corresponding N-1 segment download requests for the remaining N-1 segments of the N data download segments, Among them, each of the N-1 segment download requests is used to request download of data of one segment of the N-1 segments, and each requested segment is different; the remaining request sending module 4042 , Configured to send N-1 segmented download requests through corresponding N-1 threads, and receive corresponding response messages.
  • the selected segment is the last segment of the N data download segments.
  • the apparatus further includes: a transmission code determining module 412 configured to determine whether the first response message includes a type used to indicate that the type of the transmission code is a sub-address before the request sending module sends the second segment download request through the second thread. If the block-encoded information is not included, then it goes to the request sending module 402 to execute the step of sending the second segment download request through the second thread.
  • a transmission code determining module 412 configured to determine whether the first response message includes a type used to indicate that the type of the transmission code is a sub-address before the request sending module sends the second segment download request through the second thread. If the block-encoded information is not included, then it goes to the request sending module 402 to execute the step of sending the second segment download request through the second thread.
  • the transmission encoding determining module 412 is further configured to perform single-threaded downloading of the file to be downloaded using the first thread when the first response message includes information indicating that the transmission encoding type is block encoding.
  • the first thread is used to send a first segmented download request
  • the second thread is used to send a second segmented download request to detect whether the file provider, such as a server, can support multi-threaded segmented file download through a second request. If both the first response message responding to the first segment download request and the second response message responding to the second download request indicate that the segment download request was performed correctly, it indicates that the file provider, such as a server, supports multi-threaded segment download, and then passes The first and second threads or further threads are created to download the file to be downloaded.
  • This method of detecting whether a file to be downloaded can be downloaded in multiple threads by using a secondary request can effectively ensure the accuracy of the detection result and avoid the Accept-Range field in the response header of a request that simply passes the HTTP protocol in the prior art.
  • the problem of judging whether a file can be downloaded in sections is that the inaccurate judgment causes errors in the downloaded file, which ensures the accuracy and success rate of the file download.
  • FIG. 5 a schematic structural diagram of a device / terminal / server according to Embodiment 5 of the present application is shown.
  • the device / terminal / server may include a processor 502 and one or more memory devices 504.
  • the processor 502 is configured to execute a program 506, and may specifically perform related steps in the foregoing file download method embodiment.
  • the program 506 may include program code, where the program code includes a computer operation instruction.
  • the processor 502 may be a central processing unit CPU, or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application.
  • the terminal device includes one or more processors, which can be processors of the same type, such as one or more CPUs; or different types of processors, such as one or more CPUs and one or more ASICs.
  • the electronic storage device 504 is configured to store one or more programs 506.
  • the storage device 504 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), for example, at least one magnetic disk memory.
  • the program 506 may be specifically configured to cause the processor 502 to perform the following operations: sending a first segment download request through a first thread, and receiving a first response message for the first segment download request; and sending a second segment through a second thread A segment download request receives a second response message for a second segment download request; wherein the first segment download request is used to request the download of the first part of the file to be downloaded, and the second segment download request is used to request the download of the to-be-downloaded The second part of the data of the file; if both the first response message and the second response message indicate that the corresponding segmented download request was successfully executed, the multi-threaded segmented download of the file to be downloaded is performed.
  • the program 506 is further configured to cause the processor 502 to respond from the first response before sending the second segmented download request through the second thread.
  • Get the file size of the file to be downloaded in the message ; set N data download segments for the file to be downloaded according to the file size, where N is a positive integer greater than or equal to 2; select one segment from the N data download segments And generate a second segment download request based on the selected segment.
  • the program 506 is further configured to cause the processor 502 to obtain in the first response message When the file size of the file to be downloaded is obtained, the value of the transmission length field in the first response message is obtained, and the file size of the file to be downloaded is set to the value of the transmission length field.
  • the program 506 is further configured to cause the processor 502 to separately generate the remaining N-1 segments of the N data download segments when performing multi-threaded segment download of the file to be downloaded.
  • Corresponding N-1 segment download requests wherein each of the N-1 segment download requests is used to request download of data of one segment of the N-1 segments, and each request is The requested segments are different; N-1 segment download requests are sent through corresponding N-1 threads, and corresponding response messages are received.
  • the selected segment is the last segment of the N data download segments.
  • the program 506 is further configured to cause the processor 502 to determine whether the first response message includes a block used to indicate that the transmission encoding type is a block before sending the second segment download request through the second thread. Encoded information; if not, perform the step of sending a second segmented download request through a second thread.
  • the program 510 is further configured to cause the processor 502 to use the first thread to perform single-threading of the file to be downloaded when the first response message includes information indicating that the transmission encoding type is block encoding. download.
  • the first threaded download request is sent by the first thread
  • the second threaded download request is sent by the second thread to detect whether the file providing end such as the server can support the file through the second request.
  • Multi-threaded segment download If both the first response message responding to the first segment download request and the second response message responding to the second download request indicate that the segment download request was executed correctly, it indicates that the file provider, such as a server, supports multi-threading. Download in sections, and then download files to be downloaded through the first and second threads or further threads.
  • This method of detecting whether a file to be downloaded can be downloaded in multiple threads by using a secondary request can effectively ensure the accuracy of the detection result and avoid the Accept-Range field in the response header of a request that simply passes the HTTP protocol in the prior art.
  • the problem of judging whether a file can be downloaded in sections is that the inaccurate judgment causes errors in the downloaded file, which ensures the accuracy and success rate of the file download.
  • the process described above with reference to the flowchart may be implemented as a computer software program.
  • embodiments of the present application include a computer program product including a computer program carried on a computer-readable medium, the computer program containing program code for performing the method shown in the flowchart.
  • the computer program may be downloaded and installed from a network through a communication section, and / or installed from a removable medium.
  • CPU central processing unit
  • the above functions defined in the method of the present application are performed.
  • the computer-readable medium described in this application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the two.
  • the computer-readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections with one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable Programming read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the foregoing.
  • a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in combination with an instruction execution system, apparatus, or device.
  • a computer-readable signal medium may include a data signal that is included in baseband or propagated as part of a carrier wave, and which carries computer-readable program code. Such a propagated data signal may take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing.
  • the computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, and the computer-readable medium may send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device .
  • Program code embodied on a computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
  • Computer program code for performing the operations of this application may be written in one or more programming languages, or a combination thereof, including programming languages such as Java, Smalltalk, C ++, and also conventional Procedural programming language—such as "C" or a similar programming language.
  • the program code can be executed entirely on the user's computer, partly on the user's computer, as an independent software package, partly on the user's computer, partly on a remote computer, or entirely on a remote computer or server.
  • the remote computer can be connected to the user's computer through any kind of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (such as through an Internet service provider) Internet connection).
  • LAN local area network
  • WAN wide area network
  • Internet service provider Internet service provider
  • each block in the flowchart or block diagram may represent a module, a program segment, or a part of code, which contains one or more functions to implement a specified logical function Executable instructions.
  • the functions labeled in the blocks may also occur in a different order than those labeled in the drawings. For example, two successively represented boxes may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved.
  • each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts can be implemented by a dedicated hardware-based system that performs the specified function or operation , Or it can be implemented with a combination of dedicated hardware and computer instructions.
  • the units described in the embodiments of the present application may be implemented by software or hardware.
  • the described unit may also be provided in a processor, for example, it may be described as: a processor includes a receiving unit, a parsing unit, an information selecting unit, and a generating unit.
  • a processor includes a receiving unit, a parsing unit, an information selecting unit, and a generating unit.
  • the names of these units do not in any way constitute a limitation on the unit itself.
  • the receiving unit may also be described as a "unit that receives a user's web browsing request.”
  • the present application also provides a computer-readable medium having stored thereon a computer program that implements the file download method when executed by a processor.
  • the computer-readable medium may be included in the device described in the foregoing embodiments; it may also exist alone without being assembled into the device.
  • the computer-readable medium carries one or more programs, and when the one or more programs are executed by the device, the device causes the device to send a first segment download request through a first thread and receive the first segment download request.
  • a first response message for the download request and sending a second segment download request through a second thread, and receiving a second response message for the second segment download request; wherein the first segment download request is used for Request to download the first part of the data of the file to be downloaded, and the second segment download request is used to request to download the second part of the data of the file to be downloaded; if both the first response message and the second response message indicate correspondence If the segment download request is successfully executed, multi-thread segment download is performed on the file to be downloaded.

Landscapes

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

Abstract

本申请公开了一种文件下载方法、装置及设备/终端/服务器。该方法的一具体实施方式包括:通过第一线程发送第一分段下载请求,接收针对所述第一分段下载请求的第一响应消息;并且,通过第二线程发送第二分段下载请求,接收针对所述第二分段下载请求的第二响应消息;其中,所述第一分段下载请求用于请求下载待下载文件的第一部分数据,所述第二分段下载请求用于请求下载所述待下载文件的第二部分数据;若所述第一响应消息和所述第二响应消息均指示对应的分段下载请求被成功执行,则对所述待下载文件进行多线程分段下载。该实施方式实现了准确判断文件下载链接是否支持分段下载。

Description

文件下载方法、装置及设备/终端/服务器 技术领域
本申请涉及计算机技术领域,具体涉及互联网技术领域,尤其涉及文件下载方法、装置及设备/终端/服务器。
背景技术
在日常使用网络下载文件的时候,为了提升下载速度,节省下载时间,会使用多线程下载文件,这是因为通过多个线程同时下载,可以获得更好的下载速度。
但是在复杂的网络环境和不同的服务器环境中,客户端请求的文件下载链接并不一定能够支持多线程分段下载,因而需要在下载文件时预先判断服务器是否支持多线程分段下载。传统的判断方法是根据文件下载HTTP请求的响应头中的Accept-Range字段(在HTTP协议中,该字段用于指示是否支持分段下载)是否等于bytes来识别文件是否可以分段下载,通常情况下,如果支持分段就可以认为是支持多线程分段下载。但是,这种判断方法并不能保证百分百准确。例如,服务器本身支持分段下载,其针对下载请求的响应消息的头部(header)的Accept-Range字段的值为bytes,但在服务器运行过程中可能出现错误或故障,如服务器出现缓存读取问题,导致其不能正确响应分段下载请求。这种情况下,如果采用了多线程分段下载方式下载文件,那么下载完成的文件肯定是一个错误的文件,无法实现正常的文件下载的目的,并且造成时间和资源的浪费。
综上所述,现有技术中的文件下载方法不能准确判断服务器是否支持多线程分段下载,进而导致下载文件错误。
发明内容
本申请的目的在于提出一种文件下载方法、装置及设备/终端/服务器,来解决现有文件下载方法不能准确判断文件下载链接是否支持分段 下载的问题。
第一方面,本申请提供了一种文件下载方法,包括:通过第一线程发送第一分段下载请求,接收针对所述第一分段下载请求的第一响应消息;并且,通过第二线程发送第二分段下载请求,接收针对所述第二分段下载请求的第二响应消息;其中,所述第一分段下载请求用于请求下载待下载文件的第一部分数据,所述第二分段下载请求用于请求下载所述待下载文件的第二部分数据;若所述第一响应消息和所述第二响应消息均指示对应的分段下载请求被成功执行,则对所述待下载文件进行多线程分段下载。
第二方面,本申请实施例提供了一种文件下载装置,装置包括:请求发送模块,配置用于通过第一线程发送第一分段下载请求,接收针对所述第一分段下载请求的第一响应消息;并且,通过第二线程发送第二分段下载请求,接收针对所述第二分段下载请求的第二响应消息;其中,所述第一分段下载请求用于请求下载待下载文件的第一部分数据,所述第二分段下载请求用于请求下载所述待下载文件的第二部分数据;分段下载模块,配置用于当所述第一响应消息和所述第二响应消息均指示对应的分段下载请求被成功执行时,对所述待下载文件进行多线程分段下载。
第三方面,本申请实施例提供了一种设备/终端/服务器,包括:一个或多个处理器;存储器,用于存储一个或多个程序;当一个或多个程序被一个或多个处理器执行,使得一个或多个处理器实现如上述的方法。
第四方面,本申请实施例提供了一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现如上述的方法。
本申请提供的文件下载方法、装置及设备/终端/服务器及计算机可读存储介质,通过第一线程发送第一分段下载请求,第二线程发送第二分段下载请求,以通过二次请求来探测文件提供端如服务器是否能够支持文件多线程分段下载,若响应第一分段下载请求的第一响应消息和响应第二下载请求的第二响应消息均指示分段下载请求被正确执行,则表明文件提供端如服务器支持多线程分段下载,进而通过第一和第二线程或者进而建立更多的线程下载待下载文件。这种通过二次请求探测待下载文件是否能够进行多线程分段下载的方法可以有效保证探测结果的准 确性,避免现有技术中简单地通过HTTP协议的请求的响应头中的Accept-Range字段判断文件是否能够进行分段下载存在的判断不准确造成下载文件错误的问题,保证了文件下载的准确性和成功率。
附图说明
通过阅读参照以下附图所作的对非限制性实施例所作的详细描述,本申请的其它特征、目的和优点将会变得更明显:
图1是根据本申请实施例一的一种文件下载方法的步骤流程图;
图2是根据本申请实施例二的一种文件下载方法的步骤流程图;
图3是根据本申请实施例三的一种文件下载装置的结构框图;
图4是根据本申请实施例四的一种文件下载装置的结构框图;
图5根据本申请实施例五的一种设备/终端/服务器的结构示意图。
具体实施方式
下面结合附图和实施例对本申请作进一步的详细说明。可以理解的是,此处所描述的具体实施例仅仅用于解释相关发明,而非对该发明的限定。另外还需要说明的是,为了便于描述,附图中仅示出了与有关发明相关的部分。
需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互组合。下面将参考附图并结合实施例来详细说明本申请。
图1示出了根据本申请实施例一的一种文件下载方法的步骤流程图。
如图1所示,本实施例的文件下载方法包括以下步骤:
步骤102:通过第一线程发送第一分段下载请求,接收针对第一分段下载请求的第一响应消息;并且,通过第二线程发送第二分段下载请求,接收针对第二分段下载请求的第二响应消息。
其中,第一分段下载请求用于请求下载待下载文件的第一部分数据,第二分段下载请求用于请求下载待下载文件的第二部分数据。
第一部分数据和第二部分数据可以是完全不同的数据,也可以是相同的数据,还可以是存在部分重叠的数据,或者可以一个为另一个的子集。例如,第一部分数据为待下载文件的全部数据,第二部分数据为待下载文件的部分数据。而第一线程和第二线程则为不同的线程。
在本实施例中,以通过HTTP协议进行数据交互并下载文件为例进行说明。
例如,客户端在通过本申请实施例的文件下载方法进行文件下载时,可以通过第一线程发送第一分段下载请求,并接收对应的第一响应消息。该第一分段下载请求可以是一个基于HTTP协议的请求消息(request),其通过在头文件(header)中加入Range字段请求进行分段下载。该第一响应消息可以是一个基于HTTP协议的响应消息(response),其可以指示第一分段下载请求是否被成功执行,其中还可以包括第一分段下载请求所请求下载的内容。
类似地,第二分段下载请求可参照第一分段下载请求的描述,第二响应消息可参照第一响应消息的描述。
步骤104:若第一响应消息和第二响应消息均指示对应的分段下载请求被成功执行,则对待下载文件进行多线程分段下载。
若第一响应消息和第二响应消息均指示对应的分段下载请求被成功执行,则表明通过多线程分段下载方式进行了文件下载,文件的提供端(例如,服务器)能够支持多线程分段下载,且当前状态下能够正确响应和处理多线程分段下载请求。据此可以对待下载文件进行多线程分段下载,以提升下载效率。
在对待下载文件进行多线程分段下载时,可以不继续创建更多线程,使用已建立的第一线程和第二线程继续下载,直至完成对待下载文件的下载;也可以继续创建一个或多个(两个及两个以上)新的线程,通过新的线程发送新的分段下载请求,并接收对应的响应消息,以进行待下载文件的其它数据分段的下载。
在本实施例中,通过第一线程发送第一分段下载请求,第二线程发送第二分段下载请求,以通过二次请求来探测文件提供端如服务器是否能够支持文件多线程分段下载,若响应第一分段下载请求的第一响应消息和响应第二下载请求的第二响应消息均指示分段下载请求被正确执行,则表明文件提供端如服务器支持多线程分段下载,进而通过第一和第二线程或者进而建立更多的线程下载待下载文件。这种通过二次请求探测待下载文件是否能够进行多线程分段下载的方法可以有效保证探测结果的准确性,避免现有技术中简单地通过HTTP协议的请求的响应头中的 Accept-Range字段判断文件是否能够进行分段下载存在的判断不准确造成下载文件错误的问题,保证了文件下载的准确性和成功率。
本实施例的文件下载方法可以由适当的应用如浏览器等或适当的功能组件或适当的具有数据处理能力的电子设备(如平板电脑、手机、台式机、服务器等)执行。
继续参考图2,示出了根据本申请实施例二的一种文件下载方法的步骤流程图。
本实施例的文件下载方法包括以下步骤:
步骤S202:通过第一线程发送第一分段下载请求,接收针对第一分段下载请求的第一响应消息;并且,通过第二线程发送第二分段下载请求,接收针对第二分段下载请求的第二响应消息。
在一种可行方式中,步骤S202包括以下子步骤:
步骤S202a:通过第一线程发送第一分段下载请求,接收针对第一分段下载请求的第一响应消息。
其中,第一分段下载请求用于请求下载待下载文件的第一部分数据。根据需要的不同,第一部分数据可以是待下载文件的部分数据,也可以是待下载文件的全部数据。在本实施例中,以第一部分数据为待下载文件的全部数据为例进行说明。
第一线程可以通过任意适当的传输方式发送第一分段下载请求,本实施例对此不作限定。例如,第一线程以发送HTTP协议请求消息的方式发送第一分段下载请求。在进行待下载文件的下载时,第一分段下载请求可以是使用GET方法的请求消息,在该请求消息中加入Range字段,以进行分段下载请求。在请求下载待下载文件的全部数据时,Range字段的值可以是“0-”,以指示请求待下载文件的全部数据。
例如,第一分段下载请求可以是:
GET/index.html HTTP/1.1
Host:192.168.1.1
Range:0-
其中,GET方法中的待下载文件的地址可以从文件下载链接中获得。
由于利用Range字段请求下载待下载文件的全部数据,因此,在针 对第一分段下载请求响应的第一响应消息中会携带被请求的数据的大小,以HTTP协议的响应消息为例,在HTTP协议中,响应消息的结构可以分为两部分,头文件(header)和报文实体。其中,头文件中的内容主要包括用于标识服务器对应的HTTP版本的标识(如HTTP/1.1)、用于表示处理结果的状态码(status code,如200)、以及其他响应首部字段(如content-length、content-type等)。报文实体中的内容主要是资源实体(如下载请求所请求的数据)。
在响应消息的头文件(header)中可以携带的content-length字段(也作传输长度字段),用于指示第一响应消息的消息实体传输长度,即请求消息中Range字段所请求的数据的大小。这样可以方便地确定待下载文件的大小。
在响应消息的头文件(header)中携带的状态码用于指示请求是否被成功执行和响应。以HTTP协议为例,当第一分段下载请求通过Range字段请求时,相应的状态码是206(partial content)表示包含Range字段的请求被成功执行。
在响应消息的头文件(header)中可以携带传输编码字段(transfer-encoding),用于指示第一响应消息的传输编码类型,如分块编码(chunked)。当传输编码字段为chunked时,表示第一响应消息采用分块编码的传输方式。
在通过第一线程发送第一分段下载请求,并接收到第一响应消息后,若第一响应消息中的状态码为206,则继续执行下述步骤;反之则可以根据状态码指示的信息执行相应的策略,如状态码为404,则停止下载并报错。
步骤S202b:确定第一响应消息中是否包含用于指示传输编码类型为分块编码的信息。
以HTTP协议为例,可以通过确定第一响应消息中的transfer-encoding字段的值是否为chunked,确定第一响应消息的传输编码类型是否为分块编码。
若第一响应消息中携带有transfer-encoding字段,且值为chunked,则确定第一响应消息中包含用于指示传输编码类型为分块编码的信息,反之,则确定第一响应消息中未包含用于指示传输编码类型为分块编码 的信息。
当包含用于指示传输编码类型为分块编码的信息时,由于响应消息通过分块编码传输方式传输,使得待下载文件的文件大小不容易确定,不便于后续发送分段下载请求,因此,此种情况下,可以直接使用第一线程对待下载文件进行单线程下载。
当然,在其他实施例中,也可以省略步骤S202b,直接发送第二分段下载请求,在第二分段下载请求中Range字段的值可以随机确定或预先设定,如500-1000等。
当未包含用于指示传输编码类型为分块编码的信息时,可以直接执行通过第二线程发送第二分段下载请求,接收针对第二分段下载请求的第二响应消息的步骤S202f,也可以执行下述的步骤S202c~e之后执行通过第二线程发送第二分段下载请求,接收针对第二分段下载请求的第二响应消息的步骤S202f。
步骤S202c:从第一响应消息中获取待下载文件的文件大小。
以HTTP协议为例,在第一响应消息的头文件中包含content-length字段(传输长度字段),用于指示第一响应消息的消息实体传输长度。本实施例中,由于第一分段下载请求所请求的第一部分数据为待下载文件的全部数据,故而第一响应消息的消息实体传输长度为待下载文件的大小,因此,可以直接从第一响应消息中的content-length字段确定待下载文件的大小。
例如,获取第一响应消息中的传输长度字段(即content-length)的值,将待下载文件的文件大小设置为传输长度字段的值。
当第一部分数据不为全部数据时,则可以省略步骤S202c;或者,从第一响应消息中获取请求的部分数据的文件大小。例如,获取第一响应消息中的传输长度字段(即content-length)的值,将请求的部分数据的文件大小设置为传输长度字段的值。或者,当第一部分数据不为全部数据时,也可以通过其它适当方式获取待下载文件的文件大小,如通过不同于当前请求的其它请求向服务器请求文件大小等方式。步骤S202d:根据文件大小为待下载文件设定N个数据下载分段,其中,N为大于或等于2的正整数。
确定待下载文件(或请求的部分数据)的大小后,可以对待下载文 件(或请求的部分数据)进行分段,以便后续进行多线程分段下载。例如,在本实施例中,将待下载文件(或请求的部分数据)平均分为N段,即为待下载文件(或请求的部分数据)设定N个数据下载分段。N的具体取值可以根据需求确定,例如,根据客户端的计算设备的计算能力、网络状态等确定N的具体数值,只要保证N大于或等于2,且为正整数即可。
步骤S202e:从N个数据下载分段中选择一个分段,并根据选择的分段生成第二分段下载请求。
将待下载文件(或请求的部分数据)进行平均分段形成N个下载分段后,每个分段的大小为filesize/N,其中,filesize为待下载文件(或请求的部分数据)的文件大小,即content-length的值。需要说明的是,若filesize/N不为整数,则可以由本领域技术人员采用任意适当的策略将其处理为整数,如向上或向下取整等(此种情况下最后一个分段的大小可能与其它分段不同),本申请实施例对此不作限制。生成第二分段下载请求时,可以随机选择一个分段,并根据选择的分段生成第二分段下载请求,或者可以预先设定某一个分段作为选择的分段,如每个待下载文件的最后一个分段,根据选择的分段生成第二分段下载请求。
可选地,在本实施例中,选择的分段为N个数据下载分段中的最后一个分段。在第二分段下载请求的头文件中,通过Range字段进行分段下载请求时,Range字段的值是请求下载的数据的起始位置和终止位置(终止位置可以省略),若第二分段下载请求对应的分段为待下载文件的最后一个分段,那么可以方便简单地确定Range字段的值,提高二次请求探测的效率。在根据待下载文件(或请求的部分数据)的最后一个分段生成第二分段下载请求,请求下载第二部分数据时,Range字段中对应的第二部分数据的起始位置可以为:filesize-filesize/N;第二部分数据的终止位置为filesize-1。如前,若filesize/N不为整数,则可以由本领域技术人员采用任意适当的策略将其处理为整数。
步骤S202f:通过第二线程发送第二分段下载请求,接收针对第二分段下载请求的第二响应消息。
生成第二分段下载请求后,通过第二线程发送第二分段下载请求,接收针对第二分段下载请求的第二响应消息。
从第二响应消息的头文件的状态码中可以确定第二分段下载请求是 否被成功执行。以HTTP协议为例,若状态码为206,则表示第二分段下载请求被成功执行。此种情况下确定待下载文件可以进行多线程分段下载。
换而言之,若第一响应消息和第二响应消息的状态码均为206,则执行步骤S204,反之,则使用第一线程对待下载文件进行单线程下载。
步骤S204:若第一响应消息和第二响应消息均指示对应的分段下载请求被成功执行,则对待下载文件进行多线程分段下载。
在对待下载文件进行多线程分段下载时,可以是第一线程和第二线程继续下载,也可以结束其中一个或两个,并重新创建新的线程进行分段下载,或者是在其中的一个或两个的基础上,继续建立新的线程进行下载。
下面以结束第一线程,并重新创建新的的线程为例进行说明。
在确定第一分段下载请求和第二分段下载请求被成功执行后,为了提高下载效率,针对N个数据下载分段中剩余的N-1个分段,分别生成对应的N-1个分段下载请求,其中,N-1个分段下载请求中的每个请求用于请求下载N-1个分段中的一个分段的数据,且,每个请求所请求的分段不同;通过对应的N-1个线程发送N-1个分段下载请求,并接收对应的响应消息,以完成待下载文件的各个分段下载,从而完成整个待下载文件的下载。
此外,为了减少资源占用,可以将第一线程结束或释放,避免重复下载占用存储空间和带宽。
当然,在其他实施例中,针对N个数据下载分段中剩余的N-1个分段,可以仅创建N-2个线程,并利用第一线程发送新的分段下载请求。这样通过把一个待下载文件切分N个分段,然后创建N个线程去负责下载不同的分段,可以提高待下载文件的下载速率,更加节省时间。
在本实施例中,通过第一线程发送第一分段下载请求,第二线程发送第二分段下载请求,以通过二次请求来探测文件提供端如服务器是否能够支持文件多线程分段下载,若响应第一分段下载请求的第一响应消息和响应第二下载请求的第二响应消息均指示分段下载请求被正确执行,则表明文件提供端如服务器支持多线程分段下载,进而通过第一和第二线程或者进而建立更多的线程下载待下载文件。这种通过二次请求探测 待下载文件是否能够进行多线程分段下载的方法可以有效保证探测结果的准确性,避免现有技术中简单地通过HTTP协议的请求的响应头中的Accept-Range字段判断文件是否能够进行分段下载存在的判断不准确造成下载文件错误的问题,保证了文件下载的准确性和成功率。
本实施例的文件下载方法可以由适当的应用如浏览器等或适当的功能组件或适当的具有数据处理能力的电子设备(如平板电脑、手机、台式机、服务器等)执行。
需要说明的是,在本实施例中,以应用场景为通过HTTP协议进行文件下载为例进行了说明,但应当明了的是,该文件下载方法可以应用至其他场景,如ftp协议下载中。只要是通过二次请求探测文件下载链接是否支持分段下载的方案均应在本申请的保护范围内。
继续参见图3,图3示出了根据本申请实施例三的一种文件下载装置的结构框图。
本实施例的文件下载装置包括:请求发送模块302,配置用于通过第一线程发送第一分段下载请求,接收针对第一分段下载请求的第一响应消息;并且,通过第二线程发送第二分段下载请求,接收针对第二分段下载请求的第二响应消息;其中,第一分段下载请求用于请求下载待下载文件的第一部分数据,第二分段下载请求用于请求下载待下载文件的第二部分数据;分段下载模块304,配置用于当第一响应消息和第二响应消息均指示对应的分段下载请求被成功执行时,对待下载文件进行多线程分段下载。
通过本实施例,利用第一线程发送第一分段下载请求,第二线程发送第二分段下载请求,以通过二次请求来探测文件提供端如服务器是否能够支持文件多线程分段下载,若响应第一分段下载请求的第一响应消息和响应第二下载请求的第二响应消息均指示分段下载请求被正确执行,则表明文件提供端如服务器支持多线程分段下载,进而通过第一和第二线程或者进而建立更多的线程下载待下载文件。这种通过二次请求探测待下载文件是否能够进行多线程分段下载的方法可以有效保证探测结果的准确性,避免现有技术中简单地通过HTTP协议的请求的响应头中的Accept-Range字段判断文件是否能够进行分段下载存在的判断不准确造 成下载文件错误的问题,保证了文件下载的准确性和成功率。
进一步参考图4,其示出了根据本申请实施例四的一种文件下载装置的结构框图。
本实施例的文件下载装置包括:请求发送模块402,配置用于通过第一线程发送第一分段下载请求,接收针对第一分段下载请求的第一响应消息;并且,通过第二线程发送第二分段下载请求,接收针对第二分段下载请求的第二响应消息;其中,第一分段下载请求用于请求下载待下载文件的第一部分数据,第二分段下载请求用于请求下载待下载文件的第二部分数据;分段下载模块404,配置用于当第一响应消息和第二响应消息均指示对应的分段下载请求被成功执行时,对待下载文件进行多线程分段下载。
可选地,第一部分数据为待下载文件的全部数据;装置还包括:文件大小获取模块406,配置用于在通过第二线程发送第二分段下载请求之前,从第一响应消息中获取待下载文件的文件大小;文件分段模块408,配置用于根据文件大小为待下载文件设定N个数据下载分段,其中,N为大于或等于2的正整数;第二分段下载请求生成模块410,配置用于从N个数据下载分段中选择一个分段,并根据选择的分段生成第二分段下载请求。
可选地,第一响应消息包括用于指示第一响应消息的消息实体传输长度的传输长度字段;文件大小获取模块406,配置用于获取第一响应消息中的传输长度字段的值,将待下载文件的文件大小设置为传输长度字段的值,以从第一响应消息中获取待下载文件的文件大小。
可选地,分段下载模块404包括:剩余请求创建模块4041,配置用于针对N个数据下载分段中剩余的N-1个分段,分别生成对应的N-1个分段下载请求,其中,N-1个分段下载请求中的每个请求用于请求下载N-1个分段中的一个分段的数据,且,每个请求所请求的分段不同;剩余请求发送模块4042,配置用于通过对应的N-1个线程发送N-1个分段下载请求,并接收对应的响应消息。
可选地,选择的分段为N个数据下载分段中的最后一个分段。
可选地,装置还包括:传输编码确定模块412,配置用于在请求发送 模块通过第二线程发送第二分段下载请求之前,确定第一响应消息中是否包含用于指示传输编码类型为分块编码的信息,若未包含,则转到请求发送模块402执行通过第二线程发送第二分段下载请求的步骤。
可选地,传输编码确定模块412还配置用于当第一响应消息中包含用于指示传输编码类型为分块编码的信息时,使用第一线程对待下载文件进行单线程下载。
通过本实施例,利用第一线程发送第一分段下载请求,第二线程发送第二分段下载请求,以通过二次请求来探测文件提供端如服务器是否能够支持文件多线程分段下载,若响应第一分段下载请求的第一响应消息和响应第二下载请求的第二响应消息均指示分段下载请求被正确执行,则表明文件提供端如服务器支持多线程分段下载,进而通过第一和第二线程或者进而建立更多的线程下载待下载文件。这种通过二次请求探测待下载文件是否能够进行多线程分段下载的方法可以有效保证探测结果的准确性,避免现有技术中简单地通过HTTP协议的请求的响应头中的Accept-Range字段判断文件是否能够进行分段下载存在的判断不准确造成下载文件错误的问题,保证了文件下载的准确性和成功率。
参考图5,示出了根据本申请实施例五的一种设备/终端/服务器的结构示意图,
如图5所示,该设备/终端/服务器可以包括:处理器(processor)502、一个或者多个存储装置(memory)504。
其中:
处理器502,用于执行程序506,具体可以执行上述文件下载方法实施例中的相关步骤。
具体地,程序506可以包括程序代码,该程序代码包括计算机操作指令。
处理器502可能是中央处理器CPU,或者是特定集成电路ASIC(Application Specific Integrated Circuit),或者是被配置成实施本申请实施例的一个或多个集成电路。终端设备包括的一个或多个处理器,可以是同一类型的处理器,如一个或多个CPU;也可以是不同类型的处理器,如一个或多个CPU以及一个或多个ASIC。
电子存储装置504,用于存放一个或多个程序506。存储装置504可能包含高速RAM存储器,也可能还包括非易失性存储器(non-volatile memory),例如至少一个磁盘存储器。
程序506具体可以用于使得处理器502执行以下操作:通过第一线程发送第一分段下载请求,接收针对第一分段下载请求的第一响应消息;并且,通过第二线程发送第二分段下载请求,接收针对第二分段下载请求的第二响应消息;其中,第一分段下载请求用于请求下载待下载文件的第一部分数据,第二分段下载请求用于请求下载待下载文件的第二部分数据;若第一响应消息和第二响应消息均指示对应的分段下载请求被成功执行,则对待下载文件进行多线程分段下载。
在一种可选的实施方式中,若第一部分数据为待下载文件的全部数据,则程序506还用于使得处理器502在通过第二线程发送第二分段下载请求之前,从第一响应消息中获取待下载文件的文件大小;根据文件大小为待下载文件设定N个数据下载分段,其中,N为大于或等于2的正整数;从N个数据下载分段中选择一个分段,并根据选择的分段生成第二分段下载请求。
在一种可选的实施方式中,若第一响应消息包括用于指示第一响应消息的消息实体传输长度的传输长度字段,则程序506还用于使得处理器502在第一响应消息中获取待下载文件的文件大小时,获取第一响应消息中的传输长度字段的值,将待下载文件的文件大小设置为传输长度字段的值。
在一种可选的实施方式中,程序506还用于使得处理器502在对待下载文件进行多线程分段下载时,针对N个数据下载分段中剩余的N-1个分段,分别生成对应的N-1个分段下载请求,其中,N-1个分段下载请求中的每个请求用于请求下载N-1个分段中的一个分段的数据,且,每个请求所请求的分段不同;通过对应的N-1个线程发送N-1个分段下载请求,并接收对应的响应消息。
在一种可选的实施方式中,选择的分段为N个数据下载分段中的最后一个分段。
在一种可选的实施方式中,程序506还用于使得处理器502在通过第二线程发送第二分段下载请求之前,确定第一响应消息中是否包含用 于指示传输编码类型为分块编码的信息;若未包含,则执行通过第二线程发送第二分段下载请求的步骤。
在一种可选的实施方式中,程序510还用于使得处理器502在第一响应消息中包含用于指示传输编码类型为分块编码的信息时,使用第一线程对待下载文件进行单线程下载。
程序506中各步骤的具体实现可以参见上述文件下载方法实施例中的相应步骤和单元中对应的描述,在此不赘述。所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的设备和模块的具体工作过程,可以参考前述方法实施例中的对应过程描述,在此不再赘述。
通过本实施例的设备/终端/服务器,通过第一线程发送第一分段下载请求,第二线程发送第二分段下载请求,以通过二次请求来探测文件提供端如服务器是否能够支持文件多线程分段下载,若响应第一分段下载请求的第一响应消息和响应第二下载请求的第二响应消息均指示分段下载请求被正确执行,则表明文件提供端如服务器支持多线程分段下载,进而通过第一和第二线程或者进而建立更多的线程下载待下载文件。这种通过二次请求探测待下载文件是否能够进行多线程分段下载的方法可以有效保证探测结果的准确性,避免现有技术中简单地通过HTTP协议的请求的响应头中的Accept-Range字段判断文件是否能够进行分段下载存在的判断不准确造成下载文件错误的问题,保证了文件下载的准确性和成功率。
特别地,根据本申请的实施例,上文参考流程图描述的过程可以被实现为计算机软件程序。例如,本申请的实施例包括一种计算机程序产品,其包括承载在计算机可读介质上的计算机程序,该计算机程序包含用于执行流程图所示的方法的程序代码。在这样的实施例中,该计算机程序可以通过通信部分从网络上被下载和安装,和/或从可拆卸介质被安装。在该计算机程序被中央处理单元(CPU)执行时,执行本申请的方法中限定的上述功能。需要说明的是,本申请所述的计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质或者是上述两者的任意组合。计算机可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的***、装置或器件,或者任意以上的组合。 计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本申请中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行***、装置或者器件使用或者与其结合使用。而在本申请中,计算机可读的信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读的信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读介质可以发送、传播或者传输用于由指令执行***、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:无线、电线、光缆、RF等等,或者上述的任意合适的组合。
可以以一种或多种程序设计语言或其组合来编写用于执行本申请的操作的计算机程序代码,所述程序设计语言包括面向对象的程序设计语言—诸如Java、Smalltalk、C++,还包括常规的过程式程序设计语言—诸如”C”语言或类似的程序设计语言。程序代码可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络——包括局域网(LAN)或广域网(WAN)—连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。
附图中的流程图和框图,图示了按照本申请各种实施例的***、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,该模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个 接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的***来实现,或者可以用专用硬件与计算机指令的组合来实现。
描述于本申请实施例中所涉及到的单元可以通过软件的方式实现,也可以通过硬件的方式来实现。所描述的单元也可以设置在处理器中,例如,可以描述为:一种处理器包括接收单元、解析单元、信息选取单元和生成单元。其中,这些单元的名称在某种情况下并不构成对该单元本身的限定,例如,接收单元还可以被描述为“接收用户的网页浏览请求的单元”。
作为另一方面,本申请还提供了一种计算机可读介质,其上存储有计算机程序,该程序被处理器执行时实现所述文件下载方法。
具体地,该计算机可读介质可以是上述实施例中描述的装置中所包含的;也可以是单独存在,而未装配入该装置中。上述计算机可读介质承载有一个或者多个程序,当上述一个或者多个程序被该装置执行时,使得该装置:通过第一线程发送第一分段下载请求,接收针对所述第一分段下载请求的第一响应消息;并且,通过第二线程发送第二分段下载请求,接收针对所述第二分段下载请求的第二响应消息;其中,所述第一分段下载请求用于请求下载待下载文件的第一部分数据,所述第二分段下载请求用于请求下载所述待下载文件的第二部分数据;若所述第一响应消息和所述第二响应消息均指示对应的分段下载请求被成功执行,则对所述待下载文件进行多线程分段下载。
以上描述仅为本申请的较佳实施例以及对所运用技术原理的说明。本领域技术人员应当理解,本申请中所涉及的发明范围,并不限于上述技术特征的特定组合而成的技术方案,同时也应涵盖在不脱离上述发明构思的情况下,由上述技术特征或其等同特征进行任意组合而形成的其它技术方案。例如上述特征与本申请中公开的(但不限于)具有类似功能的技术特征进行互相替换而形成的技术方案。

Claims (16)

  1. 一种文件下载方法,其特征在于,所述方法包括:
    通过第一线程发送第一分段下载请求,接收针对所述第一分段下载请求的第一响应消息;并且,通过第二线程发送第二分段下载请求,接收针对所述第二分段下载请求的第二响应消息;其中,所述第一分段下载请求用于请求下载待下载文件的第一部分数据,所述第二分段下载请求用于请求下载所述待下载文件的第二部分数据;
    若所述第一响应消息和所述第二响应消息均指示对应的分段下载请求被成功执行,则对所述待下载文件进行多线程分段下载。
  2. 根据权利要求1所述的方法,其特征在于,所述第一部分数据为所述待下载文件的全部数据;
    在所述通过第二线程发送第二分段下载请求之前,所述方法还包括:
    从所述第一响应消息中获取所述待下载文件的文件大小;
    根据所述文件大小为所述待下载文件设定N个数据下载分段,其中,N为大于或等于2的正整数;
    从所述N个数据下载分段中选择一个分段,并根据选择的所述分段生成所述第二分段下载请求。
  3. 根据权利要求2所述的方法,其特征在于,所述第一响应消息包括用于指示所述第一响应消息的消息实体传输长度的传输长度字段;
    从所述第一响应消息中获取所述待下载文件的文件大小,包括:
    获取所述第一响应消息中的传输长度字段的值,将所述待下载文件的文件大小设置为所述传输长度字段的值。
  4. 根据权利要求2所述的方法,其特征在于,对所述待下载文件进行多线程分段下载,包括:
    针对所述N个数据下载分段中剩余的N-1个分段,分别生成对应的N-1个分段下载请求,其中,所述N-1个分段下载请求中的每个请求用于请求下载所述N-1个分段中的一个分段的数据,且,每个请求所请求的分段不同;
    通过对应的N-1个线程发送所述N-1个分段下载请求,并接收对应的响应消息。
  5. 根据权利要求2-4中任一项所述的方法,其特征在于,所述选择 的分段为所述N个数据下载分段中的最后一个分段。
  6. 根据权利要求1所述的方法,其特征在于,在所述通过第二线程发送第二分段下载请求之前,所述方法还包括:
    确定所述第一响应消息中是否包含用于指示传输编码类型为分块编码的信息;
    若未包含,则执行所述通过所述第二线程发送第二分段下载请求的步骤。
  7. 根据权利要求6所述的方法,其特征在于,所述方法还包括:若所述第一响应消息中包含用于指示传输编码类型为分块编码的信息,则使用所述第一线程对所述待下载文件进行单线程下载。
  8. 一种文件下载装置,其特征在于,所述装置包括:
    请求发送模块,配置用于通过第一线程发送第一分段下载请求,接收针对所述第一分段下载请求的第一响应消息;并且,通过第二线程发送第二分段下载请求,接收针对所述第二分段下载请求的第二响应消息;其中,所述第一分段下载请求用于请求下载待下载文件的第一部分数据,所述第二分段下载请求用于请求下载所述待下载文件的第二部分数据;
    分段下载模块,配置用于当所述第一响应消息和所述第二响应消息均指示对应的分段下载请求被成功执行时,对所述待下载文件进行多线程分段下载。
  9. 根据权利要求8所述的文件下载装置,其特征在于,所述第一部分数据为所述待下载文件的全部数据;
    所述装置还包括:
    文件大小获取模块,配置用于在所述通过第二线程发送第二分段下载请求之前,从所述第一响应消息中获取所述待下载文件的文件大小;
    文件分段模块,配置用于根据所述文件大小为所述待下载文件设定N个数据下载分段,其中,N为大于或等于2的正整数;
    第二分段下载请求生成模块,配置用于从所述N个数据下载分段中选择一个分段,并根据选择的所述分段生成所述第二分段下载请求。
  10. 根据权利要求9所述的文件下载装置,其特征在于,所述第一响应消息包括用于指示所述第一响应消息的消息实体传输长度的传输长 度字段;
    所述文件大小获取模块,配置用于获取所述第一响应消息中的传输长度字段的值,将所述待下载文件的文件大小设置为所述传输长度字段的值。
  11. 根据权利要求9所述的文件下载装置,其特征在于,所述分段下载模块包括:
    剩余请求创建模块,配置用于针对所述N个数据下载分段中剩余的N-1个分段,分别生成对应的N-1个分段下载请求,其中,所述N-1个分段下载请求中的每个请求用于请求下载所述N-1个分段中的一个分段的数据,且,每个请求所请求的分段不同;
    剩余请求发送模块,配置用于通过对应的N-1个线程发送所述N-1个分段下载请求,并接收对应的响应消息。
  12. 根据权利要求9-11中任一项所述的文件下载装置,其特征在于,所述选择的分段为所述N个数据下载分段中的最后一个分段。
  13. 根据权利要求8所述的文件下载装置,其特征在于,所述装置还包括:
    传输编码确定模块,配置用于在所述请求发送模块通过第二线程发送第二分段下载请求之前,确定所述第一响应消息中是否包含用于指示传输编码类型为分块编码的信息,若未包含,则转到所述请求发送模块执行通过所述第二线程发送第二分段下载请求的步骤。
  14. 根据权利要求13所述的文件下载装置,其特征在于,所述传输编码确定模块还配置用于当所述第一响应消息中包含用于指示传输编码类型为分块编码的信息时,使用所述第一线程对所述待下载文件进行单线程下载。
  15. 一种设备/终端/服务器,包括:
    一个或多个处理器;
    存储装置,用于存储一个或多个程序,
    当所述一个或多个程序被所述一个或多个处理器执行,使得所述一个或多个处理器实现如权利要求1-7中任一所述的方法。
  16. 一种计算机可读存储介质,其上存储有计算机程序,其特征在于,该程序被处理器执行时实现如权利要求1-7中任一所述的方法。
PCT/CN2018/089358 2018-05-31 2018-05-31 文件下载方法、装置及设备/终端/服务器 WO2019227427A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2018/089358 WO2019227427A1 (zh) 2018-05-31 2018-05-31 文件下载方法、装置及设备/终端/服务器
CN201880001152.XA CN109496418B (zh) 2018-05-31 2018-05-31 文件下载方法、装置及设备/终端/服务器

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2018/089358 WO2019227427A1 (zh) 2018-05-31 2018-05-31 文件下载方法、装置及设备/终端/服务器

Publications (1)

Publication Number Publication Date
WO2019227427A1 true WO2019227427A1 (zh) 2019-12-05

Family

ID=65713828

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/089358 WO2019227427A1 (zh) 2018-05-31 2018-05-31 文件下载方法、装置及设备/终端/服务器

Country Status (2)

Country Link
CN (1) CN109496418B (zh)
WO (1) WO2019227427A1 (zh)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112311897A (zh) * 2020-11-17 2021-02-02 腾讯科技(深圳)有限公司 资源文件下载方法、装置、设备及介质
CN114338651A (zh) * 2021-12-27 2022-04-12 中电金信软件有限公司 文件传输方法、装置、电子设备及可读存储介质
CN116028247A (zh) * 2023-03-27 2023-04-28 中新宽维传媒科技有限公司 一种基于消息中间件的文件采集***

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112311721B (zh) * 2019-07-25 2022-11-22 深信服科技股份有限公司 一种检测下载行为的方法及装置
CN114500496A (zh) * 2020-10-27 2022-05-13 华为终端有限公司 一种目标数据的下载方法及设备
CN112769949A (zh) * 2021-01-20 2021-05-07 杭州鸿泉物联网技术股份有限公司 文件传输方法及装置、电子设备和存储介质
CN114979113B (zh) * 2021-02-23 2023-12-15 华为技术有限公司 一种文件传输方法、装置及***
CN113132489A (zh) * 2021-04-22 2021-07-16 中国工商银行股份有限公司 下载文件的方法、装置、计算设备和介质
CN118041929A (zh) * 2024-04-12 2024-05-14 云筑信息科技(成都)有限公司 一种基于流式实现浏览器大文件分片下载的方法

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104702592A (zh) * 2015-01-08 2015-06-10 三星电子(中国)研发中心 流媒体下载方法和装置
US9197702B2 (en) * 2013-12-06 2015-11-24 Cellco Partnership System for and method for media upload multithreading for large file uploads
CN105933445A (zh) * 2016-06-27 2016-09-07 乐视控股(北京)有限公司 一种资源请求方法和装置
CN106982249A (zh) * 2017-03-03 2017-07-25 广州优视网络科技有限公司 多线程分段下载方法、设备、客户端设备及电子设备

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3896625B2 (ja) * 1997-03-07 2007-03-22 ソニー株式会社 データ送信装置、データ受信装置、データ送信方法およびデータ受信方法
CN102137278B (zh) * 2010-12-30 2013-08-07 广州市动景计算机科技有限公司 基于移动终端的流媒体播放分发***及其方法
CN102368213B (zh) * 2011-09-26 2014-08-13 奇智软件(北京)有限公司 一种ie内核浏览器的页面下载控制方法和***
CN103685480A (zh) * 2013-11-29 2014-03-26 云海创想信息技术(无锡)有限公司 一种传输控制协议网络实现方法以及一种服务器
CN103929427A (zh) * 2014-04-23 2014-07-16 无锡天脉聚源传媒科技有限公司 一种动态多线程下载装置及其下载方法
CN104506950A (zh) * 2014-12-29 2015-04-08 珠海全志科技股份有限公司 网络流媒体播放中的多线程下载方法、装置及下载设备
CN105430434A (zh) * 2015-11-17 2016-03-23 北京奇虎科技有限公司 下载视频的方法与装置
CN105897911A (zh) * 2016-05-20 2016-08-24 广州优视网络科技有限公司 下载文件的方法、装置及用户终端

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9197702B2 (en) * 2013-12-06 2015-11-24 Cellco Partnership System for and method for media upload multithreading for large file uploads
CN104702592A (zh) * 2015-01-08 2015-06-10 三星电子(中国)研发中心 流媒体下载方法和装置
CN105933445A (zh) * 2016-06-27 2016-09-07 乐视控股(北京)有限公司 一种资源请求方法和装置
CN106982249A (zh) * 2017-03-03 2017-07-25 广州优视网络科技有限公司 多线程分段下载方法、设备、客户端设备及电子设备

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112311897A (zh) * 2020-11-17 2021-02-02 腾讯科技(深圳)有限公司 资源文件下载方法、装置、设备及介质
CN114338651A (zh) * 2021-12-27 2022-04-12 中电金信软件有限公司 文件传输方法、装置、电子设备及可读存储介质
CN116028247A (zh) * 2023-03-27 2023-04-28 中新宽维传媒科技有限公司 一种基于消息中间件的文件采集***
CN116028247B (zh) * 2023-03-27 2023-06-13 中新宽维传媒科技有限公司 一种基于消息中间件的文件采集***

Also Published As

Publication number Publication date
CN109496418B (zh) 2021-10-08
CN109496418A (zh) 2019-03-19

Similar Documents

Publication Publication Date Title
WO2019227427A1 (zh) 文件下载方法、装置及设备/终端/服务器
US8321503B2 (en) Context-specific network resource addressing model for distributed services
US9699625B2 (en) Push notification middleware
WO2017190641A1 (zh) 拦截爬虫的方法、装置、服务器终端以及计算机可读介质
WO2019000871A1 (zh) 用于提供语音服务的方法、装置和服务器
US9088462B2 (en) Common web accessible data store for client side page processing
JP6314252B2 (ja) ネットワークビデオ再生方法及び装置
WO2013071747A1 (zh) 一种获取文件的方法和装置
CN110784528B (zh) 一种文件下载方法、装置和存储介质
US20150296014A1 (en) Picture download method and apparatus
CN108600377B (zh) 一种文件下载的暂停方法、装置、终端和存储介质
US20170034311A1 (en) Method for selecting between multiple RPC frameworks during a TCP/IP session
JP2022536387A (ja) ビデオデータの処理方法、装置、電子機器およびコンピュータ可読媒体
CN111800223B (zh) 生成发送报文、处理接收报文的方法、装置和***
CN107332854B (zh) 一种报文序列化协商方法及服务提供设备
CN108595574B (zh) 数据库集群的连接方法、装置、设备及存储介质
CN115297164A (zh) 网络代理方法、装置、电子设备及计算机可读存储介质
CN108600378B (zh) 一种文件下载方法、装置、终端和存储介质
TWI673983B (zh) 一種資料壓縮傳輸方法和系統、及其終端和伺服器
CN109218338B (zh) 信息处理***、方法和装置
CN110740138B (zh) 数据传输方法和装置
WO2023083367A1 (zh) 文件后台续传方法、装置、存储介质及电子设备
CN115714805A (zh) 一种跨平台通信连接方法、***及电子设备
CN114844870A (zh) 一种媒体流获取方法、装置、电子设备及存储介质
US11366613B2 (en) Method and apparatus for writing data

Legal Events

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

Ref document number: 18921221

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18921221

Country of ref document: EP

Kind code of ref document: A1