Browser-based data downloading method, system, electronic device and storage medium

By adjusting the length and connection status of the data windows of the browser and server, the pause and recovery of data downloads are achieved, and the task recovery failure after download is solved, which improves the success rate and efficiency of data downloads.

CN113536171BActive Publication Date: 2024-12-20龙芯中科(合肥)技术有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110753534.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-07-02
Publication Date
2024-12-20
Estimated Expiration
2041-07-02

AI Technical Summary

Technical Problem

When a browser encounters an interrupt scenario during the download process, it is easy to cause the download task to fail to recover and lead to the failure of data download.

Method used

By adjusting the length of the data receiving window and sending window between the browser and the server, the pause and recovery of data downloads is achieved, including adjusting the window length to 0 when the pause download operation is detected, and restoring the original length when the download is restored. If paused for a long time, disconnect and re-establish to resume downloads through a renewal request.

Benefits of technology

Effectively recovering the data download process in the interrupt scenario increases the success rate of data download, ensuring that the download task can continue on the basis of the original progress, and is compatible with download recovery under the special processing logic of the server.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113536171B_ABST
    Figure CN113536171B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention provides a browser-based data download method, system, electronic device and storage medium, which relates to the field of communication technology. The method includes: when downloading, when it is necessary to pause the download, the receiving window length is adjusted to 0, and timing is started; the sending window length is adjusted to 0, and the download is paused; when the timing is short, when the download is resumed, the timing is stopped, and the receiving window length is restored; the sending window length is restored; when the timing is long, the connection is disconnected; when the download needs to be resumed, the connection is reconnected, and the download is resumed. In the present invention, when the download is paused for a short time, the receiving window length of the browser and the sending window length of the server are adjusted to 0, and the download is paused. When the download is resumed after a short pause, the receiving and sending window lengths are restored, and the download is resumed. When the download is paused for a long time, the connection is disconnected. When the download is resumed, the server is reconnected, and the download is resumed through a resume request. After the interruption scenario occurs, the remaining data can be continued to be downloaded, thereby improving the download success rate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of communication technology, and in particular to a browser-based data downloading method, system, electronic device and storage medium. Background Art

[0002] With the development of data communication technology, there are more and more scenarios where users interact with servers through browsers. For example, users can download files from servers through browsers. However, when users use browsers to download data, the download task may encounter various interruption scenarios such as long pauses, browser restarts, and special processing logic on the server. After the interruption scenario occurs, the download task is prone to failure to recover, which in turn easily leads to data download failure. Summary of the invention

[0003] In view of the above problems, an embodiment of the present invention is proposed to provide a browser-based data download method that overcomes the above problems or at least partially solves the above problems, so as to solve the problem that the browser data download process is difficult to recover after interruption and data download failure is likely to occur.

[0004] Correspondingly, the embodiment of the present invention also provides a browser, a server, a system, two electronic devices and two storage media to ensure the implementation and application of the above method.

[0005] In order to solve the above problem, an embodiment of the present invention discloses a browser-based data download method, which is applied to the browser and includes:

[0006] In the process of downloading target data from the server, when a trigger operation for pausing downloading is detected, the length of the data receiving window is adjusted from a first initial length to 0, and timing is started;

[0007] Sending a first response message to the server, so that when the server receives the first response message, the length of the data sending window is adjusted from the second initial length to 0 to suspend downloading; the first response message carries information that the length of the data receiving window is 0;

[0008] In the case where the timing duration does not exceed the preset duration, when a trigger operation for resuming downloading is detected, the timing is stopped, and the length of the data receiving window is restored to the first initial length;

[0009] Sending a second response message to the server, so that when the server receives the second response message, the server restores the length of the data sending window to the second initial length to resume downloading; the second response message carries information that the length of the data receiving window is the first initial length;

[0010] When the timing duration exceeds the preset duration, disconnecting from the server;

[0011] When the trigger operation for resuming downloading is detected, re-establishing a connection with the server;

[0012] A resume request is sent to the server to resume downloading; the resume request is used to request the server to send the remaining data in the target data to the browser.

[0013] Optionally, the method further comprises:

[0014] When the timing duration does not exceed the preset duration, when the browser completes the restart, re-establishing the connection with the server;

[0015] Send the resume request to the server.

[0016] Optionally, the method further comprises:

[0017] In the process of downloading the target data from the server, when the browser completes the restart, re-establishing the connection with the server;

[0018] Send the resume request to the server.

[0019] Optionally, the resume request is an HTTP request, and the resume request includes a Range field, and the Range field includes a receivable data range in the remaining data.

[0020] In order to solve the above problem, an embodiment of the present invention discloses a browser-based data download method, which is applied to a server. The method includes:

[0021] When receiving a first response message sent by the browser, adjusting the length of the data sending window from the second initial length to 0 to suspend downloading; the first response message is sent to the server after the browser detects a trigger operation for suspending downloading during the process of downloading target data from the server, adjusts the length of the data receiving window from the first initial length to 0, starts timing, and carries information that the length of the data receiving window is 0;

[0022] When receiving the second response message sent by the browser, the length of the data sending window is restored to the second initial length to resume downloading; the second response message is sent to the server after stopping the timing and restoring the length of the data receiving window to the first initial length when a trigger operation for resuming downloading is detected, provided that the timing duration does not exceed the preset duration, and the second response message carries information that the length of the data receiving window is the first initial length;

[0023] When a resume request sent by the browser is received, the remaining data in the target data is sent to the browser to resume downloading; the resume request is sent to the server after re-establishing the connection with the server when the timing duration exceeds the preset duration and the connection with the server is disconnected and the trigger operation for resuming downloading is detected; the resume request is used to request the server to send the remaining data in the target data to the browser.

[0024] Optionally, when receiving the resume request sent by the browser, sending the remaining data in the target data to the browser to resume downloading includes:

[0025] When receiving the resume request sent by the browser, sending a resume response message to the browser; the resume response message is used to indicate that the server will send the remaining data in the target data to the browser;

[0026] The remaining data in the target data is sent to the browser to resume downloading.

[0027] Optionally, the resume response message is an HTTP request, and the resume response message includes a Content-Range field, and the Content-Range field includes a data range that can be sent in the remaining data and a data amount of the remaining data.

[0028] In order to solve the above problems, an embodiment of the present invention discloses a browser-based data download method, which is applied to a system including a browser and a server. The method includes:

[0029] When the browser detects a trigger operation for pausing downloading during the process of downloading target data from the server, the browser adjusts the length of the data receiving window from the first initial length to 0 and starts timing; sends a first response message to the server; the first response message carries information that the length of the data receiving window is 0;

[0030] When the server receives the first response message, the server adjusts the length of the data sending window from the second initial length to 0 to suspend downloading;

[0031] When the browser detects a trigger operation for resuming downloading and the timing does not exceed the preset time, the browser stops timing and restores the length of the data receiving window to the first initial length; sends a second response message to the server; the second response message carries information that the length of the data receiving window is the first initial length;

[0032] When the server receives the second response message, the server restores the length of the data sending window to the second initial length to resume downloading;

[0033] The browser disconnects from the server when the timing duration exceeds the preset duration; re-establishes connection with the server when the trigger operation for resuming download is detected; and sends a resume request to the server; the resume request is used to request the server to send the remaining data in the target data to the browser to resume downloading;

[0034] When the server receives the resume request, it sends the remaining data in the target data to the browser to resume downloading.

[0035] Optionally, the method further comprises:

[0036] When the browser completes the restart and the timing duration does not exceed the preset duration, the browser re-establishes a connection with the server;

[0037] The browser sends the resume request to the server.

[0038] Optionally, the method further comprises:

[0039] The browser re-establishes a connection with the server when the browser completes the restart during the process of downloading the target data from the server;

[0040] The browser sends the resume request to the server.

[0041] Optionally, when the server receives the resume request, sending the remaining data in the target data to the browser to resume downloading, including:

[0042] When the server receives the resume request, the server sends a resume response message to the browser; the resume response message is used to indicate that the server will send the remaining data in the target data to the browser;

[0043] The server sends the remaining data in the target data to the browser to resume downloading.

[0044] Optionally, the resume request is an HTTP request, and the resume request includes a Range field, and the Range field includes a receivable data range in the remaining data.

[0045] Optionally, the resume response message is an HTTP request, and the resume response message includes a Content-Range field, and the Content-Range field includes a data range that can be sent in the remaining data and a data amount of the remaining data.

[0046] The embodiment of the present invention further discloses a browser, comprising:

[0047] A first adjustment module is used to adjust the length of the data receiving window from the first initial length to 0 and start timing when a trigger operation for pausing downloading is detected during the process of downloading target data from the server;

[0048] a first sending module, configured to send a first response message to the server, so that when the server receives the first response message, the length of the data sending window is adjusted from the second initial length to 0 to suspend downloading; the first response message carries information that the length of the data receiving window is 0;

[0049] A first recovery module, configured to stop timing and restore the length of the data receiving window to the first initial length when a trigger operation for resuming downloading is detected if the timing duration does not exceed a preset duration;

[0050] a second sending module, configured to send a second response message to the server, so that when the server receives the second response message, the length of the data sending window is restored to the second initial length to resume downloading; the second response message carries information that the length of the data receiving window is the first initial length;

[0051] A disconnection module, used to disconnect from the server when the timing duration exceeds the preset duration;

[0052] A first connection module, configured to re-establish a connection with the server when the trigger operation for resuming downloading is detected;

[0053] The third sending module is used to send a resume request to the server to resume downloading; the resume request is used to request the server to send the remaining data in the target data to the browser.

[0054] Optionally, the browser further includes:

[0055] A second connection module is used to re-establish a connection with the server when the browser completes restarting if the timing duration does not exceed the preset duration;

[0056] The fifth sending module is used to send the resume request to the server.

[0057] Optionally, the browser further includes:

[0058] A third connection module, used for re-establishing a connection with the server when the browser completes restarting during the process of downloading the target data from the server;

[0059] The sixth sending module is used to send the resume request to the server.

[0060] Optionally, the resume request is an HTTP request, and the resume request includes a Range field, and the Range field includes a receivable data range in the remaining data.

[0061] The embodiment of the present invention further discloses a server, including:

[0062] a second adjustment module, configured to adjust the length of the data sending window from the second initial length to 0 to suspend downloading when receiving a first response message sent by the browser; the first response message is sent to the server after the browser detects a trigger operation for suspending downloading during the process of downloading target data from the server, adjusts the length of the data receiving window from the first initial length to 0, starts timing, and carries information that the length of the data receiving window is 0;

[0063] a second recovery module, configured to restore the length of the data sending window to the second initial length to resume downloading when receiving a second response message sent by the browser; the second response message is a message sent to the server after stopping timing and restoring the length of the data receiving window to the first initial length when a trigger operation for resuming downloading is detected, provided that the timing duration does not exceed a preset duration, and the second response message carries information that the length of the data receiving window is the first initial length;

[0064] The fourth sending module is used to send the remaining data in the target data to the browser to resume downloading when receiving a resume request sent by the browser; the resume request is sent to the server after re-establishing the connection with the server when the timing duration exceeds the preset duration and the connection with the server is disconnected, and when the trigger operation for resuming downloading is detected; the resume request is used to request the server to send the remaining data in the target data to the browser.

[0065] Optionally, the fourth sending module includes:

[0066] A first sending submodule is used to send a resume transmission response message to the browser when receiving a resume transmission request sent by the browser; the resume transmission response message is used to indicate that the server will send the remaining data in the target data to the browser;

[0067] The second sending submodule is used to send the remaining data in the target data to the browser to resume downloading.

[0068] Optionally, the resume response message is an HTTP request, and the resume response message includes a Content-Range field, and the Content-Range field includes a data range that can be sent in the remaining data and a data amount of the remaining data.

[0069] The embodiment of the present invention also discloses a system, including a browser and a server;

[0070] The browser is configured to adjust the length of the data receiving window from a first initial length to 0 and start timing when a trigger operation for pausing downloading is detected during the process of downloading target data from the server; send a first response message to the server; the first response message carries information that the length of the data receiving window is 0;

[0071] The server is configured to adjust the length of the data sending window from the second initial length to 0 to suspend downloading when receiving the first response message;

[0072] The browser is further configured to, when the timing duration does not exceed the preset duration and a trigger operation for resuming download is detected, stop timing and restore the length of the data receiving window to the first initial length; send a second response message to the server; the second response message carries information that the length of the data receiving window is the first initial length;

[0073] The server is further configured to restore the length of the data sending window to the second initial length to resume downloading when receiving the second response message;

[0074] The browser is further configured to disconnect from the server when the timing duration exceeds the preset duration; re-establish a connection with the server when the trigger operation for resuming downloading is detected; and send a resume request to the server; the resume request is used to request the server to send the remaining data in the target data to the browser to resume downloading;

[0075] The server is further configured to send the remaining data in the target data to the browser when receiving the resume request, so as to resume downloading.

[0076] Optionally, the browser is further configured to re-establish a connection with the server when the restart is completed if the timing duration does not exceed the preset duration;

[0077] The browser is also used to send the resume request to the server.

[0078] Optionally, the browser is further configured to re-establish a connection with the server when the restart is completed during the process of downloading the target data from the server;

[0079] The browser is also used to send the resume request to the server.

[0080] Optionally, the server is specifically configured to send a resume response message to the browser upon receiving the resume request; the resume response message is configured to indicate that the server will send the remaining data in the target data to the browser;

[0081] The server is further specifically configured to send the remaining data in the target data to the browser to resume downloading.

[0082] Optionally, the resume request is an HTTP request, and the resume request includes a Range field, and the Range field includes a receivable data range in the remaining data.

[0083] Optionally, the resume response message is an HTTP request, and the resume response message includes a Content-Range field, and the Content-Range field includes a data range that can be sent in the remaining data and a data amount of the remaining data.

[0084] The embodiment of the present invention further discloses an electronic device, wherein the electronic device is installed with a browser, and the electronic device includes a memory and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by one or more processors, wherein the one or more programs include instructions for performing the following operations:

[0085] In the process of downloading target data from the server, when a trigger operation for pausing downloading is detected, the length of the data receiving window is adjusted from a first initial length to 0, and timing is started;

[0086] Sending a first response message to the server, so that when the server receives the first response message, the length of the data sending window is adjusted from the second initial length to 0 to suspend downloading; the first response message carries information that the length of the data receiving window is 0;

[0087] In the case where the timing duration does not exceed the preset duration, when a trigger operation for resuming downloading is detected, the timing is stopped, and the length of the data receiving window is restored to the first initial length;

[0088] Sending a second response message to the server, so that when the server receives the second response message, the server restores the length of the data sending window to the second initial length to resume downloading; the second response message carries information that the length of the data receiving window is the first initial length;

[0089] When the timing duration exceeds the preset duration, disconnecting from the server;

[0090] When the trigger operation for resuming downloading is detected, re-establishing a connection with the server;

[0091] A resume request is sent to the server to resume downloading; the resume request is used to request the server to send the remaining data in the target data to the browser.

[0092] An embodiment of the present invention further discloses a readable storage medium. When instructions in the storage medium are executed by a processor of an electronic device equipped with a browser, the electronic device can execute one or more of the browser-based data downloading methods executed by the browser in the embodiment of the present invention.

[0093] The embodiment of the present invention further discloses an electronic device, comprising a memory and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by one or more processors, wherein the one or more programs include instructions for performing the following operations:

[0094] When receiving a first response message sent by the browser, adjusting the length of the data sending window from the second initial length to 0 to suspend downloading; the first response message is sent to the server after the browser detects a trigger operation for suspending downloading during the process of downloading target data from the server, adjusts the length of the data receiving window from the first initial length to 0, starts timing, and carries information that the length of the data receiving window is 0;

[0095] When receiving the second response message sent by the browser, the length of the data sending window is restored to the second initial length to resume downloading; the second response message is sent to the server after stopping the timing and restoring the length of the data receiving window to the first initial length when a trigger operation for resuming downloading is detected, provided that the timing duration does not exceed the preset duration, and the second response message carries information that the length of the data receiving window is the first initial length;

[0096] When a resume request sent by the browser is received, the remaining data in the target data is sent to the browser to resume downloading; the resume request is sent to the server after re-establishing the connection with the server when the timing duration exceeds the preset duration and the connection with the server is disconnected and the trigger operation for resuming downloading is detected; the resume request is used to request the server to send the remaining data in the target data to the browser.

[0097] The embodiment of the present invention further discloses a readable storage medium. When the instructions in the storage medium are executed by the processor of the electronic device, the electronic device can execute one or more of the browser-based data downloading methods executed by the server in the embodiment of the present invention.

[0098] The embodiments of the present invention include the following advantages:

[0099] In an embodiment of the present invention, in an interruption scenario where the download process of the target data is briefly paused, the data receiving window length of the browser and the data sending window length of the server can be adjusted to 0, thereby achieving the effect of pausing the data download. When a trigger operation for resuming the download is detected after a short pause, the data receiving window length of the browser and the data sending window length of the server are restored to the original length, thereby resuming the data download process. In an interruption scenario where the download process of the target data is paused for a long time, the browser can disconnect from the server, and then when a trigger operation for resuming the download is detected, the browser can re-establish a connection with the server, and resume the data download through a resume request, so that after the above interruption scenario occurs, the data download process can be resumed, and the remaining data can be continued to be downloaded on the basis of retaining the original downloaded content, thereby improving the success rate of data download. BRIEF DESCRIPTION OF THE DRAWINGS

[0100] Figure 1 is a flow chart of steps of an embodiment of a data downloading method of the present invention;

[0101] Figure 2 is a flowchart of another data downloading method embodiment of the present invention;

[0102] Figure 3 is a flowchart of steps of another data downloading method embodiment of the present invention;

[0103] Figure 4 is a structural block diagram of a browser embodiment of the present invention;

[0104] Figure 5 It is a structural block diagram of a server embodiment of the present invention;

[0105] Figure 6 is a structural block diagram of a system embodiment of the present invention;

[0106] Figure 7 The present invention is a structural block diagram of an electronic device for downloading data according to an exemplary embodiment. DETAILED DESCRIPTION

[0107] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.

[0108] One of the core concepts of the embodiments of the present invention is that in an interruption scenario where the download process of the target data is briefly paused, the data receiving window length of the browser and the data sending window length of the server can be adjusted to 0, thereby achieving the effect of pausing the data download. When a trigger operation for resuming the download is detected after a short pause, the data receiving window length of the browser and the data sending window length of the server are restored to the original length, thereby resuming the data download process. In an interruption scenario where the download process of the target data is paused for a long time, the browser can disconnect from the server, and then when a trigger operation for resuming the download is detected, the browser can re-establish a connection with the server, and resume the data download through a resume request, so that after the above interruption scenario occurs, the data download process can be resumed, and the remaining data can be continued to be downloaded on the basis of retaining the original downloaded content.

[0109] Reference Figure 1 , shows a flowchart of a method for downloading data based on a browser according to an embodiment of the present invention, the method for downloading data is applied to a system including a browser and a server, and may specifically include the following steps:

[0110] Step 101: When the browser detects a trigger operation for pausing downloading during the process of downloading target data from the server, the browser adjusts the length of the data receiving window from a first initial length to 0 and starts timing; sends a first response message to the server; the first response message carries information that the length of the data receiving window is 0.

[0111] In the embodiment of the present invention, a TCP (Transmission Control Protocol) connection can be established between the browser and the server. TCP is a connection-oriented, reliable, byte-stream-based transport layer communication protocol defined by IETF RFC 793. When the application layer sends a data stream represented by 8-bit bytes for Internet transmission to the TCP layer, the TCP layer divides the data stream into segments of appropriate lengths. The maximum transmission segment size (MSS) is usually limited by the maximum transmission unit (MTU) of the data link layer of the network to which the computer is connected. The TCP layer then passes the data packet to the IP layer, which transmits the data packet to the TCP layer of the receiving entity through the network.

[0112] In order to ensure the reliability of message transmission, TCP gives each data packet a sequence number, which also ensures that the data packets transmitted to the receiving entity are received in order. The receiving entity then sends back a corresponding confirmation (ACK) for the bytes that have been successfully received. If the sending entity does not receive an acknowledgment for a data packet within a reasonable round-trip time (RTT), the data (considered to be lost) will be retransmitted.

[0113] There is a Window Size field in the TCP message header, which refers to the window of the receiving end, that is, the data receiving window, which is used to inform the sending end of the amount of data it can receive, thereby achieving a part of the flow control purpose. During the entire data transmission process, TCP also measures the current network status in order to maintain a healthy and stable transmission process. Therefore, data is transmitted under the control of certain mechanisms, which is the window mechanism.

[0114] For the sender of a TCP session, the data in its send buffer at any time can be divided into four categories, including "sent and received ACK from the other end", "sent but not received ACK from the other end", "not sent but allowed by the other end", and "not sent and not allowed by the other end". Among them, "sent but not received ACK from the other end" and "not sent but allowed by the other end" can be called the data sending window.

[0115] TCP is a duplex protocol. Both parties in a session can send and receive data. Both parties in a TCP session maintain a data send window and a data receive window. The length of the data receive window depends on the limitations of the application, system, and hardware (the TCP transmission rate cannot be greater than the data processing rate of the application), and the requirements for the data send window depend on the data receive window announced by the other end.

[0116] It should be noted that, in the embodiment of the present invention, for a data download process, the browser is the data receiver and the server is the data sender. Therefore, the data receiving window mentioned in the embodiment of the present invention refers to the data receiving window of the browser, and the data sending window mentioned in the embodiment of the present invention refers to the data sending window of the server.

[0117] In an embodiment of the present invention, when a browser needs to download target data from a server, the browser can establish a TCP connection with the server and send a download request for the target data to the server. When the server receives the download request, it can respond and start sending the target data, thereby starting the download process of the target data. In the process of the browser downloading the target data from the server, when the browser detects a trigger operation for pausing the download, for example, when the user clicks the pause icon of the target data download progress in the browser interface, the browser can adjust the length of its own data receiving window from the current first initial length to 0, and start a timer to start timing. At the same time, the browser can also send a first response message to the server to inform the server of the information that the length of the data receiving window is adjusted to 0.

[0118] Wherein, the download request of the target data can be an HTTP (Hypertext Transfer Protocol) request. HTTP is a simple request-response protocol, which usually runs on the basis of TCP connection. It specifies the request sent by the browser to the server and the response returned by the server to the browser. The header of the request and response message is given in ASCII code, and the message content has a format similar to MIME (Multipurpose Internet Mail Extensions). The HTTP protocol communicates based on the B / S (Browser / Server) architecture. The implementation programs of the server using the HTTP protocol include httpd, nginx, etc. The implementation programs of the browser using the HTTP protocol are mainly Web browsers, such as Firefox, Google, chrome, Safari, Opera, etc. Optionally, in an embodiment of the present invention, the server can be a browser server, or a third-party server corresponding to the third-party data requested by the browser. For example, when the third-party data requested by the browser is video data, the server is a third-party video server.

[0119] Step 102: When the server receives the first response message, it adjusts the length of the data sending window from the second initial length to 0 to suspend downloading.

[0120] In this step, when the server receives the first response message sent by the browser, it can be determined that the length of the current data receiving window is adjusted to 0, and then the server can adjust the length of its own data sending window from the current second initial length to 0. So far, the lengths of the data sending window and the data receiving window are both 0, the server cannot send data, and the browser cannot receive data, so the download process is suspended.

[0121] Step 103: When the browser detects a trigger operation for resuming downloading and the timing duration does not exceed the preset duration, the browser stops timing and restores the length of the data receiving window to the first initial length; and sends a second response message to the server; the second response message carries the information that the length of the data receiving window is the first initial length.

[0122] In this step, if the timing duration does not exceed the preset duration, a trigger operation for resuming downloading is detected, that is, the download task is suspended for a short time and then resumed. In this case, the browser can stop timing and restore the length of the data receiving window from 0 to the original first initial length. At the same time, the browser can also send a second response message to the server to inform the server of the information that the length of the data receiving window is restored to the first initial length.

[0123] The trigger operation for resuming downloading may be, for example, a click operation performed by the user on a continue downloading icon of the target data download progress in the browser interface.

[0124] In a standard protocol, data is encapsulated into data packets according to a certain byte length when being sent. Therefore, in the embodiment of the present invention, the first initial length and the second initial length may both refer to the number of data packets.

[0125] Step 104: When the server receives the second response message, it restores the length of the data sending window to the second initial length to resume downloading.

[0126] In this step, when the server receives the second response message sent by the browser, it can be determined that the length of the current data receiving window is restored to the first initial length, and then the server can restore the length of its own data sending window from 0 to the original second initial length. At this point, the lengths of the data sending window and the data receiving window are restored to their original lengths, the server can continue to send data, and the browser can also continue to receive data, so the download process is restored.

[0127] In existing applications, some browsers will actively disconnect from the server when the data download process is paused for a short time. If the user manually resumes the download later, the browser will reconnect with the server to continue the download process. For some servers, the URL (Uniform Resource Locator) address, that is, the download address, provided by the server is the same after the connection is reestablished and before the connection is disconnected for the same downloaded data. Therefore, by adopting the above method, the download can be continued after reconnecting to the server. However, some servers have special processing logic. For example, some servers reallocate URL addresses according to different connections. In this way, if the above method is adopted, the original download task cannot be continued after reconnecting to the server, because the URL address of the downloaded data has changed after reconnecting. In this case, the browser can only restart the download according to the new URL address, but cannot continue the download from the original progress, thereby causing the original download task to fail and increasing the download time.

[0128] In an embodiment of the present invention, when the data download process is briefly paused, the effect of pausing the data download can be achieved by adjusting the data receiving window length of the browser and the data sending window length of the server to 0, so that the browser does not need to disconnect from the server. In this way, when the download process is resumed, the URL address of the downloaded data will not change. Therefore, the remaining data can be continued to be downloaded from the original progress, thereby being compatible with the server with special processing logic for the URL address change after reconnection, and being able to ensure that the download task can be successfully resumed in the scenario of a short pause, and the remaining data can be incrementally downloaded on the basis of retaining the original downloaded content.

[0129] Step 105: When the timing duration exceeds the preset duration, the browser disconnects from the server; when the trigger operation for resuming downloading is detected, the browser re-establishes the connection with the server; and sends a resume request to the server; the resume request is used to request the server to send the remaining data in the target data to the browser to resume downloading.

[0130] In this step, when the timing duration exceeds the preset duration, that is, when the download task is suspended for a long time, the browser can actively send a RST (reset) packet to the server, thereby actively disconnecting from the server. Afterwards, when a trigger operation for resuming the download is detected, the browser can re-establish a connection with the server and send a resume request to the server to request the remaining data.

[0131] In an embodiment of the present invention, when the data download process is paused for a long time, the browser can actively disconnect from the server, and then re-establish the connection with the server when it is necessary to continue downloading, and request the remaining data from the server through a resume request. In this way, after the data download process is paused for a long time, the data download process can be resumed, and the remaining data can be incrementally downloaded on the basis of retaining the original downloaded content.

[0132] Step 106: When the server receives the resume request, it sends the remaining data in the target data to the browser to resume downloading.

[0133] Optionally, this step can be implemented in the following ways:

[0134] When the server receives the resume request, the server sends a resume response message to the browser; the resume response message is used to indicate that the server will send the remaining data in the target data to the browser;

[0135] The server sends the remaining data in the target data to the browser to resume downloading.

[0136] Optionally, the retransmission request may be an HTTP request, and the retransmission request may include a Range field, where the Range field includes a receivable data range in the remaining data.

[0137] Optionally, the resume response message may be an HTTP request, and the resume response message may include a Content-Range field, and the Content-Range field includes a data range that can be sent in the remaining data and a data amount of the remaining data.

[0138] In actual applications, the HTTP 1.1 protocol can support obtaining partial content of a file. This function can be implemented through two parameters in the header. When the browser sends a request, it carries the Range field in the header to specify the location of the first byte and the last byte of the requested data in the file. After receiving a resume request carrying the Range field, the server can carry the Content-Range field in the resume response to return the current data range that can be returned and the total size of the remaining data. Among them, the header content of the resume response message can be HTTP / 1.1 206Partial Content, indicating the use of breakpoint resume mode.

[0139] Further optionally, the method may further include the following steps:

[0140] When the browser completes the restart and the timing duration does not exceed the preset duration, the browser re-establishes a connection with the server;

[0141] The browser sends the resume request to the server.

[0142] Among them, when the timing duration does not exceed the preset duration, that is, when the download task is suspended for a short time, when the browser restarts and completes the restart, the browser can re-establish a connection with the server and send a resume request carrying the Range field to the server. In this way, when the browser restarts during the pause of the data download process, the download can be resumed, and the remaining data can be incrementally downloaded on the basis of retaining the original downloaded content.

[0143] Further optionally, the method may further include the following steps:

[0144] The browser re-establishes a connection with the server when the browser completes the restart during the process of downloading the target data from the server;

[0145] The browser sends the resume request to the server.

[0146] Among them, during the process of downloading the target data on the server side, that is, during the execution of the download task, when the browser restarts and completes the restart, the browser can re-establish the connection with the server and send a resume request carrying the Range field to the server, so that during the data download process, if the browser restarts, the download can be resumed, and the remaining data can be incrementally downloaded on the basis of retaining the original downloaded content.

[0147] In an embodiment of the present invention, in an interruption scenario where the download process of the target data is briefly paused, the data receiving window length of the browser and the data sending window length of the server can be adjusted to 0, thereby achieving the effect of pausing the data download. When a trigger operation for resuming the download is detected after a short pause, the data receiving window length of the browser and the data sending window length of the server are restored to the original length, thereby resuming the data download process. In an interruption scenario where the download process of the target data is paused for a long time, the browser is restarted during the pause of the data download process, and the browser is restarted during the data download process, the browser can re-establish a connection with the server and resume the data download through a resume request, so that after the above interruption scenario occurs, the data download process can be resumed, and the remaining data can be continued to be downloaded on the basis of retaining the original downloaded content, thereby improving the success rate of data download.

[0148] Reference Figure 2 , shows a flowchart of another embodiment of a data download method based on a browser of the present invention. The data download method is applied to a browser and may specifically include the following steps:

[0149] Step 201: in the process of downloading target data from a server, when a trigger operation for pausing downloading is detected, the length of the data receiving window is adjusted from a first initial length to 0, and timing is started;

[0150] Step 202: Send a first response message to the server, so that when the server receives the first response message, it adjusts the length of the data sending window from the second initial length to 0 to suspend downloading; the first response message carries information that the length of the data receiving window is 0;

[0151] Step 203: When the timing duration does not exceed the preset duration and a trigger operation for resuming downloading is detected, the timing is stopped and the length of the data receiving window is restored to the first initial length;

[0152] Step 204: Send a second response message to the server, so that when the server receives the second response message, it restores the length of the data sending window to the second initial length to resume downloading; the second response message carries information that the length of the data receiving window is the first initial length;

[0153] Step 205: When the timing duration exceeds the preset duration, disconnecting from the server;

[0154] Step 206: When the trigger operation for resuming downloading is detected, re-establishing a connection with the server;

[0155] Step 207: Send a resume request to the server to resume downloading; the resume request is used to request the server to send the remaining data in the target data to the browser.

[0156] Optionally, the method further comprises:

[0157] When the timing duration does not exceed the preset duration, when the browser completes the restart, re-establishing the connection with the server;

[0158] Send the resume request to the server.

[0159] Optionally, the method further comprises:

[0160] In the process of downloading the target data from the server, when the browser completes the restart, re-establishing the connection with the server;

[0161] Send the resume request to the server.

[0162] Optionally, the resume request is an HTTP request, and the resume request includes a Range field, and the Range field includes a receivable data range in the remaining data.

[0163] In one embodiment, the preset duration is shorter than the first duration set by the server, and when the server stops transmitting for more than the first duration, the server will actively disconnect from the browser. In this embodiment, before the browser pauses data downloading and the server actively disconnects from the browser, the browser actively disconnects from the server to ensure the preservation of the current download information for the necessary information contained in the subsequent generation of the resume request.

[0164] In an embodiment of the present invention, in an interruption scenario where the download process of the target data is briefly paused, the data receiving window length of the browser and the data sending window length of the server can be adjusted to 0, thereby achieving the effect of pausing the data download. When a trigger operation for resuming the download is detected after a short pause, the data receiving window length of the browser and the data sending window length of the server are restored to the original length, thereby resuming the data download process. In an interruption scenario where the download process of the target data is paused for a long time, the browser can disconnect from the server, and then when a trigger operation for resuming the download is detected, the browser can re-establish a connection with the server, and resume the data download through a resume request, so that after the above interruption scenario occurs, the data download process can be resumed, and the remaining data can be continued to be downloaded on the basis of retaining the original downloaded content, thereby improving the success rate of data download.

[0165] Reference Figure 3 , shows a flowchart of another embodiment of a data download method based on a browser of the present invention, the data download method is applied to the server, and specifically may include the following steps:

[0166] Step 301: when receiving a first response message sent by the browser, adjusting the length of the data sending window from the second initial length to 0 to suspend downloading; the first response message is sent to the server after the browser detects a trigger operation for suspending downloading during the process of downloading target data from the server, adjusts the length of the data receiving window from the first initial length to 0, starts timing, and carries information that the length of the data receiving window is 0;

[0167] Step 302: when receiving the second response message sent by the browser, restoring the length of the data sending window to the second initial length to resume downloading; the second response message is sent to the server after stopping the timing and restoring the length of the data receiving window to the first initial length when a trigger operation for resuming downloading is detected, provided that the timing duration does not exceed the preset duration, and the second response message carries information that the length of the data receiving window is the first initial length;

[0168] Step 303: When a resume request is received from the browser, the remaining data in the target data is sent to the browser to resume downloading; the resume request is sent to the server after re-establishing the connection with the server when the timing duration exceeds the preset duration and the connection with the server is disconnected and the trigger operation for resuming download is detected; the resume request is used to request the server to send the remaining data in the target data to the browser.

[0169] Optionally, when receiving the resume request sent by the browser, sending the remaining data in the target data to the browser to resume downloading includes:

[0170] When receiving the resume request sent by the browser, sending a resume response message to the browser; the resume response message is used to indicate that the server will send the remaining data in the target data to the browser;

[0171] The remaining data in the target data is sent to the browser to resume downloading.

[0172] Optionally, the resume response message is an HTTP request, and the resume response message includes a Content-Range field, and the Content-Range field includes a data range that can be sent in the remaining data and a data amount of the remaining data.

[0173] In an embodiment of the present invention, in an interruption scenario where the download process of the target data is briefly paused, the data receiving window length of the browser and the data sending window length of the server can be adjusted to 0, thereby achieving the effect of pausing the data download. When a trigger operation for resuming the download is detected after a short pause, the data receiving window length of the browser and the data sending window length of the server are restored to the original length, thereby resuming the data download process. In an interruption scenario where the download process of the target data is paused for a long time, the browser can disconnect from the server, and then when a trigger operation for resuming the download is detected, the browser can re-establish a connection with the server, and resume the data download through a resume request, so that after the above interruption scenario occurs, the data download process can be resumed, and the remaining data can be continued to be downloaded on the basis of retaining the original downloaded content, thereby improving the success rate of data download.

[0174] It should be noted that, for the sake of simplicity, the method embodiments are described as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.

[0175] Reference Figure 4 , shows a structural block diagram of a browser embodiment of the present invention, and the browser 400 may specifically include the following modules:

[0176] The first adjustment module 401 is used for adjusting the length of the data receiving window from the first initial length to 0 and starting timing when a trigger operation for pausing downloading is detected during the process of downloading target data from the server;

[0177] A first sending module 402 is used to send a first response message to the server, so that when the server receives the first response message, the length of the data sending window is adjusted from the second initial length to 0 to suspend downloading; the first response message carries information that the length of the data receiving window is 0;

[0178] A first recovery module 403 is used to stop timing and restore the length of the data receiving window to the first initial length when a trigger operation for resuming downloading is detected if the timing duration does not exceed a preset duration;

[0179] A second sending module 404 is used to send a second response message to the server, so that when the server receives the second response message, the length of the data sending window is restored to the second initial length to resume downloading; the second response message carries information that the length of the data receiving window is the first initial length;

[0180] A disconnection module 405, configured to disconnect from the server when the timing duration exceeds the preset duration;

[0181] A first connection module 406, configured to re-establish a connection with the server when the trigger operation for resuming downloading is detected;

[0182] The third sending module 407 is used to send a resume request to the server to resume downloading; the resume request is used to request the server to send the remaining data in the target data to the browser.

[0183] Optionally, the browser further includes:

[0184] A second connection module is used to re-establish a connection with the server when the browser completes restarting if the timing duration does not exceed the preset duration;

[0185] The fifth sending module is used to send the resume request to the server.

[0186] Optionally, the browser further includes:

[0187] A third connection module, used for re-establishing a connection with the server when the browser completes restarting during the process of downloading the target data from the server;

[0188] The sixth sending module is used to send the resume request to the server.

[0189] Optionally, the resume request is an HTTP request, and the resume request includes a Range field, and the Range field includes a receivable data range in the remaining data.

[0190] In an embodiment of the present invention, in an interruption scenario where the download process of the target data is briefly paused, the data receiving window length of the browser and the data sending window length of the server can be adjusted to 0, thereby achieving the effect of pausing the data download. When a trigger operation for resuming the download is detected after a short pause, the data receiving window length of the browser and the data sending window length of the server are restored to the original length, thereby resuming the data download process. In an interruption scenario where the download process of the target data is paused for a long time, the browser can disconnect from the server, and then when a trigger operation for resuming the download is detected, the browser can re-establish a connection with the server, and resume the data download through a resume request, so that after the above interruption scenario occurs, the data download process can be resumed, and the remaining data can be continued to be downloaded on the basis of retaining the original downloaded content, thereby improving the success rate of data download.

[0191] Reference Figure 5 , shows a structural block diagram of a server embodiment of the present invention, the server 500 may specifically include the following modules:

[0192] The second adjustment module 501 is configured to adjust the length of the data sending window from the second initial length to 0 to suspend downloading when receiving a first response message sent by the browser; the first response message is sent to the server after the browser detects a trigger operation for suspending downloading during the process of downloading target data from the server, adjusts the length of the data receiving window from the first initial length to 0, starts timing, and carries information that the length of the data receiving window is 0;

[0193] The second recovery module 502 is used to restore the length of the data sending window to the second initial length to resume downloading when receiving a second response message sent by the browser; the second response message is sent to the server after stopping timing and restoring the length of the data receiving window to the first initial length when a trigger operation for resuming downloading is detected, provided that the timing duration does not exceed a preset duration, and the second response message carries information that the length of the data receiving window is the first initial length;

[0194] The fourth sending module 503 is used to send the remaining data in the target data to the browser to resume downloading when receiving a resume request sent by the browser; the resume request is sent to the server after re-establishing the connection with the server when the timing duration exceeds the preset duration and the connection with the server is disconnected and the trigger operation for resuming downloading is detected; the resume request is used to request the server to send the remaining data in the target data to the browser.

[0195] Optionally, the fourth sending module includes:

[0196] A first sending submodule is used to send a resume transmission response message to the browser when receiving a resume transmission request sent by the browser; the resume transmission response message is used to indicate that the server will send the remaining data in the target data to the browser;

[0197] The second sending submodule is used to send the remaining data in the target data to the browser to resume downloading.

[0198] Optionally, the resume response message is an HTTP request, and the resume response message includes a Content-Range field, and the Content-Range field includes a data range that can be sent in the remaining data and a data amount of the remaining data.

[0199] In an embodiment of the present invention, in an interruption scenario where the download process of the target data is briefly paused, the data receiving window length of the browser and the data sending window length of the server can be adjusted to 0, thereby achieving the effect of pausing the data download. When a trigger operation for resuming the download is detected after a short pause, the data receiving window length of the browser and the data sending window length of the server are restored to the original length, thereby resuming the data download process. In an interruption scenario where the download process of the target data is paused for a long time, the browser can disconnect from the server, and then when a trigger operation for resuming the download is detected, the browser can re-establish a connection with the server, and resume the data download through a resume request, so that after the above interruption scenario occurs, the data download process can be resumed, and the remaining data can be continued to be downloaded on the basis of retaining the original downloaded content, thereby improving the success rate of data download.

[0200] Reference Figure 6 , shows a structural block diagram of a system embodiment of the present invention, the system 600 includes a browser 601 and a server 602;

[0201] The browser 601 is used for adjusting the length of the data receiving window from the first initial length to 0 and starting timing when a trigger operation for pausing downloading is detected during the process of downloading target data from the server; sending a first response message to the server; the first response message carries information that the length of the data receiving window is 0;

[0202] The server 602 is configured to adjust the length of the data sending window from the second initial length to 0 to suspend downloading when receiving the first response message;

[0203] The browser 601 is further configured to, when the timing duration does not exceed the preset duration and a trigger operation for resuming download is detected, stop timing and restore the length of the data receiving window to the first initial length; send a second response message to the server; the second response message carries information that the length of the data receiving window is the first initial length;

[0204] The server 602 is further configured to restore the length of the data sending window to the second initial length to resume downloading when receiving the second response message;

[0205] The browser 601 is further configured to disconnect from the server when the timing duration exceeds the preset duration; re-establish a connection with the server when the trigger operation for resuming download is detected; and send a resume request to the server; the resume request is used to request the server to send the remaining data in the target data to the browser to resume downloading;

[0206] The server 602 is further configured to send the remaining data in the target data to the browser when receiving the resume request, so as to resume downloading.

[0207] Optionally, the browser is further configured to re-establish a connection with the server when the restart is completed if the timing duration does not exceed the preset duration;

[0208] The browser is also used to send the resume request to the server.

[0209] Optionally, the browser is further configured to re-establish a connection with the server when the restart is completed during the process of downloading the target data from the server;

[0210] The browser is also used to send the resume request to the server.

[0211] Optionally, the server is specifically configured to send a resume response message to the browser upon receiving the resume request; the resume response message is configured to indicate that the server will send the remaining data in the target data to the browser;

[0212] The server is further specifically configured to send the remaining data in the target data to the browser to resume downloading.

[0213] Optionally, the resume request is an HTTP request, and the resume request includes a Range field, and the Range field includes a receivable data range in the remaining data.

[0214] Optionally, the resume response message is an HTTP request, and the resume response message includes a Content-Range field, and the Content-Range field includes a data range that can be sent in the remaining data and a data amount of the remaining data.

[0215] In an embodiment of the present invention, in an interruption scenario where the download process of the target data is briefly paused, the data receiving window length of the browser and the data sending window length of the server can be adjusted to 0, thereby achieving the effect of pausing the data download. When a trigger operation for resuming the download is detected after a short pause, the data receiving window length of the browser and the data sending window length of the server are restored to the original length, thereby resuming the data download process. In an interruption scenario where the download process of the target data is paused for a long time, the browser can disconnect from the server, and then when a trigger operation for resuming the download is detected, the browser can re-establish a connection with the server, and resume the data download through a resume request, so that after the above interruption scenario occurs, the data download process can be resumed, and the remaining data can be continued to be downloaded on the basis of retaining the original downloaded content, thereby improving the success rate of data download.

[0216] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0217] Figure 7 1 is a structural block diagram of an electronic device 700 for downloading data according to an exemplary embodiment, wherein a browser is installed in the electronic device 700. For example, the electronic device 700 may be a computer or the like.

[0218] Reference Figure 7 , the electronic device 700 may include one or more of the following components: a processing component 702 , a memory 704 , a power component 706 , a multimedia component 708 , an audio component 710 , an input / output (I / O) interface 712 , a sensor component 714 , and a communication component 716 .

[0219] The processing component 702 generally controls the overall operation of the electronic device 700, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 702 may include one or more processors 720 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 702 may include one or more modules to facilitate the interaction between the processing component 702 and other components. For example, the processing component 702 may include a multimedia module to facilitate the interaction between the multimedia component 708 and the processing component 702.

[0220] The memory 704 is configured to store various types of data to support operations on the device 700. Examples of such data include instructions for any application or method operating on the electronic device 700, contact data, phone book data, messages, pictures, videos, etc. The memory 704 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0221] The power supply component 706 provides power to the various components of the electronic device 700. The power supply component 706 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the electronic device 700.

[0222] The multimedia component 708 includes a screen that provides an output interface between the electronic device 700 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 708 includes a front camera and / or a rear camera. When the electronic device 700 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.

[0223] The audio component 710 is configured to output and / or input audio signals. For example, the audio component 710 includes a microphone (MIC), and when the electronic device 700 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 704 or sent via the communication component 716. In some embodiments, the audio component 710 also includes a speaker for outputting audio signals.

[0224] I / O interface 712 provides an interface between processing component 702 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.

[0225] The sensor assembly 714 includes one or more sensors for providing various aspects of status assessment for the electronic device 700. For example, the sensor assembly 714 can detect the open / closed state of the device 700, the relative positioning of components, such as the display and keypad of the electronic device 700, and the sensor assembly 714 can also detect the position change of the electronic device 700 or a component of the electronic device 700, the presence or absence of contact between the user and the electronic device 700, the orientation or acceleration / deceleration of the electronic device 700, and the temperature change of the electronic device 700. The sensor assembly 714 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 714 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 714 may also include an accelerometer, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

[0226] The communication component 716 is configured to facilitate wired or wireless communication between the electronic device 700 and other devices. The electronic device 700 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 716 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 716 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.

[0227] In an exemplary embodiment, the electronic device 700 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the above methods.

[0228] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 704 including instructions, and the instructions can be executed by a processor 720 of an electronic device 700 to perform the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0229] A non-transitory computer-readable storage medium, when the instructions in the storage medium are executed by a processor of an electronic device installed with a browser, enables the electronic device to perform a method for browser-based data downloading, the method comprising:

[0230] In the process of downloading target data from the server, when a trigger operation for pausing downloading is detected, the length of the data receiving window is adjusted from a first initial length to 0, and timing is started;

[0231] Sending a first response message to the server, so that when the server receives the first response message, the length of the data sending window is adjusted from the second initial length to 0 to suspend downloading; the first response message carries information that the length of the data receiving window is 0;

[0232] In the case where the timing duration does not exceed the preset duration, when a trigger operation for resuming downloading is detected, the timing is stopped, and the length of the data receiving window is restored to the first initial length;

[0233] Sending a second response message to the server, so that when the server receives the second response message, the server restores the length of the data sending window to the second initial length to resume downloading; the second response message carries information that the length of the data receiving window is the first initial length;

[0234] When the timing duration exceeds the preset duration, disconnecting from the server;

[0235] When the trigger operation for resuming downloading is detected, re-establishing a connection with the server;

[0236] A resume request is sent to the server to resume downloading; the resume request is used to request the server to send the remaining data in the target data to the browser.

[0237] Optionally, the method further comprises:

[0238] When the timing duration does not exceed the preset duration, when the browser completes the restart, re-establishing the connection with the server;

[0239] Send the resume request to the server.

[0240] Optionally, the method further comprises:

[0241] In the process of downloading the target data from the server, when the browser completes the restart, re-establishing the connection with the server;

[0242] Send the resume request to the server.

[0243] Optionally, the resume request is an HTTP request, and the resume request includes a Range field, and the Range field includes a receivable data range in the remaining data.

[0244] Another non-transitory computer-readable storage medium, when the instructions in the storage medium are executed by a processor of an electronic device, enables the electronic device to execute a data download method executed by a server, the method comprising:

[0245] When receiving a first response message sent by the browser, adjusting the length of the data sending window from the second initial length to 0 to suspend downloading; the first response message is sent to the server after the browser detects a trigger operation for suspending downloading during the process of downloading target data from the server, adjusts the length of the data receiving window from the first initial length to 0, starts timing, and carries information that the length of the data receiving window is 0;

[0246] When receiving the second response message sent by the browser, the length of the data sending window is restored to the second initial length to resume downloading; the second response message is sent to the server after stopping the timing and restoring the length of the data receiving window to the first initial length when a trigger operation for resuming downloading is detected, provided that the timing duration does not exceed the preset duration, and the second response message carries information that the length of the data receiving window is the first initial length;

[0247] When a resume request sent by the browser is received, the remaining data in the target data is sent to the browser to resume downloading; the resume request is sent to the server after re-establishing the connection with the server when the timing duration exceeds the preset duration and the connection with the server is disconnected and the trigger operation for resuming downloading is detected; the resume request is used to request the server to send the remaining data in the target data to the browser.

[0248] Optionally, when receiving the resume request sent by the browser, sending the remaining data in the target data to the browser to resume downloading includes:

[0249] When receiving the resume request sent by the browser, sending a resume response message to the browser; the resume response message is used to indicate that the server will send the remaining data in the target data to the browser;

[0250] The remaining data in the target data is sent to the browser to resume downloading.

[0251] Optionally, the resume response message is an HTTP request, and the resume response message includes a Content-Range field, and the Content-Range field includes a data range that can be sent in the remaining data and a data amount of the remaining data.

[0252] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0253] It will be appreciated by those skilled in the art that the embodiments of the present invention may be provided as methods, devices, or computer program products. Therefore, the embodiments of the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the embodiments of the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

[0254] The embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0255] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing terminal device to operate in a predictable manner, so that the instructions stored in the computer readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0256] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0257] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present invention.

[0258] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.

[0259] The browser-based data download method, browser, server, system, electronic device and storage medium provided by the present invention are introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of ​​the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.

Claims

1. A data download method based on a browser, characterized in that: Applied to a browser, the method comprises: In the process of downloading target data from the server, when a trigger operation for pausing downloading is detected, the length of the data receiving window is adjusted from the first initial length to 0, and timing is started; Sending a first response message to the server, so that when the server receives the first response message, the length of the data sending window is adjusted from the second initial length to 0 to suspend downloading; the first response message carries information that the length of the data receiving window is 0; In the case where the timing duration does not exceed the preset duration, when a trigger operation for resuming downloading is detected, the timing is stopped and the length of the data receiving window is restored to the first initial length; Sending a second response message to the server, so that when the server receives the second response message, the server restores the length of the data sending window to the second initial length to resume downloading; the second response message carries information that the length of the data receiving window is the first initial length; When the timing duration exceeds the preset duration, disconnecting from the server; When the trigger operation for resuming downloading is detected, re-establishing a connection with the server; A resume request is sent to the server to resume downloading; the resume request is used to request the server to send the remaining data in the target data to the browser.

2. The method according to claim 1, characterized in that The method further comprises: When the timing duration does not exceed the preset duration, when the browser completes the restart, re-establishing the connection with the server; Send the resume request to the server.

3. The method according to claim 1, characterized in that The method further comprises: In the process of downloading the target data from the server, when the browser completes the restart, re-establishing the connection with the server; Send the resume request to the server.

4. The method according to any one of claims 1 to 3, characterized in that: The resume request is an HTTP request, and the resume request includes a Range field, and the Range field includes a receivable data range in the remaining data.

5. A browser-based data download method, characterized in that: Applied to the server, the method includes: When receiving a first response message sent by the browser, adjusting the length of the data sending window from the second initial length to 0 to suspend downloading; the first response message is sent to the server after the browser detects a trigger operation for suspending downloading during the process of downloading target data from the server, adjusts the length of the data receiving window from the first initial length to 0, starts timing, and carries information that the length of the data receiving window is 0; When receiving the second response message sent by the browser, the length of the data sending window is restored to the second initial length to resume downloading; the second response message is sent to the server after stopping the timing and restoring the length of the data receiving window to the first initial length when a trigger operation for resuming downloading is detected, provided that the timing duration does not exceed the preset duration, and the second response message carries information that the length of the data receiving window is the first initial length; When a resume request sent by the browser is received, the remaining data in the target data is sent to the browser to resume downloading; the resume request is sent to the server after re-establishing the connection with the server when the timing duration exceeds the preset duration and the connection with the server is disconnected and the trigger operation for resuming downloading is detected; the resume request is used to request the server to send the remaining data in the target data to the browser.

6. The method according to claim 5, characterized in that When receiving the resume request sent by the browser, sending the remaining data in the target data to the browser to resume downloading, comprising: When receiving the resume request sent by the browser, sending a resume response message to the browser; the resume response message is used to indicate that the server will send the remaining data in the target data to the browser; The remaining data in the target data is sent to the browser to resume downloading.

7. The method according to claim 6, characterized in that The resume response message is an HTTP request, and the resume response message includes a Content-Range field. The Content-Range field includes a data range that can be sent in the remaining data and a data amount of the remaining data.

8. A browser-based data download method, characterized in that: Applied to a system including a browser and a server, the method includes: When the browser detects a trigger operation for pausing downloading during the process of downloading target data from the server, the browser adjusts the length of the data receiving window from the first initial length to 0 and starts timing; sends a first response message to the server; the first response message carries information that the length of the data receiving window is 0; When the server receives the first response message, the server adjusts the length of the data sending window from the second initial length to 0 to suspend downloading; When the browser detects a trigger operation for resuming downloading and the timing does not exceed the preset time, the browser stops timing and restores the length of the data receiving window to the first initial length; sends a second response message to the server; the second response message carries information that the length of the data receiving window is the first initial length; When the server receives the second response message, the server restores the length of the data sending window to the second initial length to resume downloading; The browser disconnects from the server when the timing duration exceeds the preset duration; re-establishes connection with the server when the trigger operation for resuming download is detected; and sends a resume request to the server; the resume request is used to request the server to send the remaining data in the target data to the browser to resume downloading; When the server receives the resume request, it sends the remaining data in the target data to the browser to resume downloading.

9. The method according to claim 8, characterized in that The method further comprises: When the browser completes the restart and the timing duration does not exceed the preset duration, the browser re-establishes a connection with the server; The browser sends the resume request to the server.

10. The method according to claim 8, characterized in that The method further comprises: The browser re-establishes a connection with the server when the browser completes the restart during the process of downloading the target data from the server; The browser sends the resume request to the server.

11. The method according to claim 8, characterized in that When the server receives the resume request, the server sends the remaining data in the target data to the browser to resume downloading, including: When the server receives the resume request, the server sends a resume response message to the browser; the resume response message is used to indicate that the server will send the remaining data in the target data to the browser; The server sends the remaining data in the target data to the browser to resume downloading.

12. A browser, characterized in that: include: A first adjustment module is used to adjust the length of the data receiving window from the first initial length to 0 and start timing when a trigger operation for pausing downloading is detected during the process of downloading target data from the server; a first sending module, configured to send a first response message to the server, so that when the server receives the first response message, the length of the data sending window is adjusted from the second initial length to 0 to suspend downloading; the first response message carries information that the length of the data receiving window is 0; A first recovery module, configured to stop timing and restore the length of the data receiving window to the first initial length when a trigger operation for resuming downloading is detected if the timing duration does not exceed a preset duration; a second sending module, configured to send a second response message to the server, so that when the server receives the second response message, the length of the data sending window is restored to the second initial length to resume downloading; the second response message carries information that the length of the data receiving window is the first initial length; A disconnection module, used to disconnect from the server when the timing duration exceeds the preset duration; A first connection module, configured to re-establish a connection with the server when the trigger operation for resuming downloading is detected; The third sending module is used to send a resume request to the server to resume downloading; the resume request is used to request the server to send the remaining data in the target data to the browser.

13. A system, characterized in that: Including browser and server; The browser is used to adjust the length of the data receiving window from the first initial length to 0 and start timing when a trigger operation for pausing downloading is detected during the process of downloading target data from the server; and send a first response message to the server; The first response message carries information that the length of the data receiving window is 0; The server is configured to adjust the length of the data sending window from the second initial length to 0 to suspend downloading when receiving the first response message; The browser is further configured to stop timing and restore the length of the data receiving window to the first initial length when a trigger operation for resuming downloading is detected if the timing duration does not exceed a preset duration; Sending a second response message to the server; the second response message carries information that the length of the data receiving window is the first initial length; The server is further configured to restore the length of the data sending window to the second initial length to resume downloading when receiving the second response message; The browser is further configured to disconnect from the server when the timing duration exceeds the preset duration; When the trigger operation for resuming download is detected, reconnecting with the server; sending a resume request to the server; the resume request is used to request the server to send the remaining data in the target data to the browser to resume downloading; The server is further configured to send the remaining data in the target data to the browser when receiving the resume request, so as to resume downloading.

14. An electronic device, characterized in that: The electronic device is installed with a browser, and includes a memory and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by one or more processors, and the one or more programs include instructions for performing the following operations: In the process of downloading target data from the server, when a trigger operation for pausing downloading is detected, the length of the data receiving window is adjusted from the first initial length to 0, and timing is started; Sending a first response message to the server, so that when the server receives the first response message, the length of the data sending window is adjusted from the second initial length to 0 to suspend downloading; the first response message carries information that the length of the data receiving window is 0; In the case where the timing duration does not exceed the preset duration, when a trigger operation for resuming downloading is detected, the timing is stopped and the length of the data receiving window is restored to the first initial length; Sending a second response message to the server, so that when the server receives the second response message, the server restores the length of the data sending window to the second initial length to resume downloading; the second response message carries information that the length of the data receiving window is the first initial length; When the timing duration exceeds the preset duration, disconnecting from the server; When the trigger operation for resuming downloading is detected, re-establishing a connection with the server; A resume request is sent to the server to resume downloading; the resume request is used to request the server to send the remaining data in the target data to the browser.

15. A readable storage medium, characterized in that: When the instructions in the storage medium are executed by a processor of an electronic device equipped with a browser, the electronic device is enabled to execute the browser-based data downloading method as described in one or more of method claims 1-4.

16. An electronic device, characterized in that: The system comprises a memory and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by one or more processors, wherein the one or more programs include instructions for performing the following operations: When receiving a first response message sent by the browser, adjusting the length of the data sending window from the second initial length to 0 to suspend downloading; the first response message is sent to the server after the browser detects a trigger operation for suspending downloading during the process of downloading target data from the server, adjusts the length of the data receiving window from the first initial length to 0, starts timing, and carries information that the length of the data receiving window is 0; When receiving the second response message sent by the browser, the length of the data sending window is restored to the second initial length to resume downloading; the second response message is sent to the server after stopping the timing and restoring the length of the data receiving window to the first initial length when a trigger operation for resuming downloading is detected, provided that the timing duration does not exceed the preset duration, and the second response message carries information that the length of the data receiving window is the first initial length; When a resume request sent by the browser is received, the remaining data in the target data is sent to the browser to resume downloading; the resume request is sent to the server after re-establishing the connection with the server when the timing duration exceeds the preset duration and the connection with the server is disconnected and the trigger operation for resuming downloading is detected; the resume request is used to request the server to send the remaining data in the target data to the browser.

17. A readable storage medium, characterized in that: When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the browser-based data downloading method as described in one or more of method claims 5-7.