Batch file downloading method, device, electronic device and storage medium

By establishing QUIC connections in advance between the client and the server, creating control and transmitting data streams, fast batch file downloads are achieved, solving the problem of long time for network link establishment and file resource preparation in the existing technology, improving download speed and saving resources.

CN115883541BActive Publication Date: 2025-08-22BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211558607.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-06
Publication Date
2025-08-22
Estimated Expiration
2042-12-06

AI Technical Summary

Technical Problem

现有技术在大批量文件下载过程中,网络链路建立和文件资源准备时间较长,导致下载速度较慢。

Method used

By establishing a QUIC connection between the client and the server, creating a control data flow and transmitting data flow, sending resource preparation instructions and file transfer requests, the server loads and caches file resources in file identification and order, and the client receives file resources.

Benefits of technology

It shortens the time for network link creation, improves the speed of batch file download, saves resource usage, supports individual file cancellation, and realizes fast and efficient batch file transfer.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115883541B_ABST
    Figure CN115883541B_ABST
Patent Text Reader

Abstract

The present disclosure provides a batch file downloading method, device, electronic device and storage medium, which relates to the field of data processing, specifically to technical fields such as data downloading and data transmission. The specific implementation scheme is as follows: when the client detects a file download task, it creates a control data stream and a transmission data stream on the QUIC link pre-established with the server, and sends a resource preparation instruction to the server through the control data stream, wherein the resource preparation instruction includes the identifiers and sequence of multiple files to be downloaded; the server receives the resource preparation instruction, and loads and caches the resources of each file to be downloaded according to the identifier and sequence of each file to be downloaded; the client sends a file transfer request to the server through the transmission data stream; the server receives the file transfer request, and transmits the resources of the file to be downloaded corresponding to the file transfer request to the client; the client receives the resources of the file to be downloaded transmitted from the server, thereby realizing the rapid download of batch files.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of data processing, and further to technical fields such as data downloading and data transmission, and in particular to a batch file downloading method, device, electronic device and storage medium. Background Art

[0002] With the development of network technology, the application of technologies such as cloud storage is becoming more and more widespread, and more and more files are stored in storage devices. When a user needs to use or download a file, he needs to send a data download request to the storage device storing the file to realize the file download. Summary of the Invention

[0003] The present disclosure provides a batch file downloading method, device, electronic device and storage medium.

[0004] According to one aspect of the present disclosure, a batch file downloading method is provided, which is applied to a client and includes:

[0005] When a file download task is detected, a control data stream and a transmission data stream are created on the QUIC link of the Internet transport layer protocol pre-established with the server;

[0006] Sending a resource preparation instruction corresponding to the file download task to the server through the control data flow, wherein the resource preparation instruction includes identifiers and sequences of multiple files to be downloaded;

[0007] A file transfer request is sent to the server via the transmission data stream, and resources of the file to be downloaded transmitted from the server are received.

[0008] According to another aspect of the present disclosure, a batch file downloading method is provided, which is applied to a server and includes:

[0009] Receiving a resource preparation instruction sent by a client through a control data stream, the resource preparation instruction including identifiers and sequences of multiple files to be downloaded; the server pre-establishing an Internet transport layer protocol QUIC connection with the client;

[0010] Loading resources of each file to be downloaded according to the identifier and order of each file to be downloaded, and caching the loaded resources of the file to be downloaded locally;

[0011] A file transfer request is received from the client via a transmission data stream, and resources of a file to be downloaded corresponding to the file transfer request are transferred to the client.

[0012] According to another aspect of the present disclosure, a batch file downloading device is provided, which is applied to a client and includes:

[0013] A stream creation module is used to create a control data stream and a transmission data stream on a QUIC link pre-established with the server when a file download task is detected;

[0014] An instruction sending module, configured to send a resource preparation instruction corresponding to the file download task to the server through the control data stream, wherein the resource preparation instruction includes identifiers and sequences of multiple files to be downloaded;

[0015] The request sending module is used to send a file transfer request to the server through the transmission data stream, and receive the resource of the file to be downloaded transmitted from the server.

[0016] According to another aspect of the present disclosure, a batch file downloading device is provided, which is applied to a server and includes:

[0017] An instruction receiving module is configured to receive a resource preparation instruction sent by a client via a control data stream, wherein the resource preparation instruction includes identifiers and sequences of multiple files to be downloaded; the server pre-establishes a QUIC connection with the client;

[0018] A resource preparation module is used to load resources of each file to be downloaded according to the identification and order of each file to be downloaded, and cache the loaded resources of the file to be downloaded locally;

[0019] The file transfer module is configured to receive a file transfer request sent by the client via a transmission data stream, and transfer resources of a file to be downloaded corresponding to the file transfer request to the client.

[0020] According to another aspect of the present disclosure, there is provided an electronic device, comprising:

[0021] at least one processor; and

[0022] a memory communicatively connected to the at least one processor; wherein,

[0023] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform any one of the methods described in the present disclosure.

[0024] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to cause the computer to execute any one of the methods of the present disclosure.

[0025] According to another aspect of the present disclosure, a computer program product is provided, comprising a computer program, wherein the computer program implements any one of the methods of the present disclosure when executed by a processor.

[0026] The disclosed embodiments enable fast downloading of batch files.

[0027] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present disclosure, nor are they intended to limit the scope of the present disclosure. Other features of the present disclosure will become readily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] The accompanying drawings are provided to facilitate a better understanding of the present invention and do not constitute a limitation of the present disclosure.

[0029] Figure 1 This is a schematic diagram of a scenario for batch file downloading according to the present disclosure;

[0030] Figure 2 is a schematic diagram of a batch file downloading method according to the present disclosure;

[0031] Figure 3 It is a schematic diagram of the implementation process of the batch file downloading method disclosed in the present invention;

[0032] Figure 4 is another schematic diagram of the batch file downloading method according to the present disclosure;

[0033] Figure 5 is an interactive schematic diagram of the batch file downloading method according to the present disclosure;

[0034] Figure 6 is another interactive schematic diagram of the batch file downloading method according to the present disclosure;

[0035] Figure 7 is a schematic diagram of a batch file downloading device according to the present disclosure;

[0036] Figure 8 is another schematic diagram of the batch file downloading device according to the present disclosure;

[0037] Figure 9 It is a block diagram of an electronic device used to implement the batch file downloading method according to an embodiment of the present disclosure. DETAILED DESCRIPTION

[0038] The following description of exemplary embodiments of the present disclosure is made in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding. These details should be considered as merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.

[0039] First, the relevant terms in this disclosure are explained:

[0040] QUIC (Quick UDP Internet Connection) is an Internet transport layer protocol, specifically a low-latency Internet transport layer protocol based on the UDP (User Datagram Protocol). Each data stream established on a QUIC link can independently complete network request and response, and each data stream is functionally independent of each other.

[0041] With the continuous development of Internet technology, the application of technologies such as cloud storage is becoming more and more extensive, and more and more files are stored in storage devices. When a user needs to use or download a file, he or she sends a data download request to the storage device storing the file through an electronic device to download and use the file.

[0042] For example, when a user needs to download a large number of small files from a network disk stored in a file system, the client used by the user first establishes a network link with the network disk (server), then the network disk prepares the file resources to be downloaded, and then transmits the prepared file resources to the client via the established network link. During this process, the establishment of the network link and the preparation of the file resources to be downloaded by the network disk take a long time, resulting in a slow file download speed.

[0043] In order to achieve fast downloading of batch files, the present disclosure provides a batch file download method, in which, when the client detects a file download task, it creates a control data stream and a transmission data stream on the QUIC link pre-established with the server, and sends a resource preparation instruction corresponding to the file download task to the server through the control data stream, wherein the resource preparation instruction includes the identifiers and sequence of multiple files to be downloaded, and sends a file transfer request to the server through the transmission data stream. The server receives the resource preparation instruction sent by the client through the control data stream, loads the resources of each file to be downloaded according to the identifier and sequence of each file to be downloaded, and caches the loaded resources of the file to be downloaded locally, and receives the file transfer request sent by the client through the transmission data stream, and transmits the resources of the file to be downloaded corresponding to the file transfer request to the client. The client receives the resources of the file to be downloaded transmitted from the server.

[0044] In the disclosed embodiment, since a QUIC connection is pre-established between the client and the server, there is no need to re-establish a connection between the client and the server when the client initiates a file download task, thus saving the time for creating a network link when the client initiates a file download task. Furthermore, the client creates a control data stream on the QUIC link and uses the control data stream to send a resource preparation instruction corresponding to the file download task to the server, thereby notifying the server in advance to prepare the resources for the file to be downloaded. Furthermore, when the client sends a file transfer request to the server via the transmission data stream, the server can quickly respond to the file transfer request and transmit the resources of the file to be downloaded corresponding to the file transfer request to the client, thereby shortening the resource response time of the server and realizing the rapid download of batch files.

[0045] The batch file downloading method provided by the embodiment of the present disclosure can be applied to application scenarios such as downloading large batches of small files.

[0046] For example, the application scenario of the batch file download method provided by the embodiment of the present disclosure is as follows: Figure 1 As shown, a network connection is established between a client and a server. The client can be, for example, a mobile terminal, a portable laptop, or a smartphone, and the server can be, for example, a portable laptop, a desktop computer, a cloud server, or a storage device. The server stores files. When a client needs to use a file, it first establishes a data transmission link with the server and then sends a file download request to the server to download the file stored on the server.

[0047] The batch file downloading method provided by the embodiment of the present disclosure is described in detail below.

[0048] See also Figure 2 , Figure 2 A flow chart of a batch file downloading method provided in an embodiment of the present disclosure, applied to a client, includes the following steps:

[0049] S201, when a file download task is detected, a control data stream and a transmission data stream are created on the Internet transport layer protocol QUIC link pre-established with the server.

[0050] In one possible implementation, after startup, the client pre-establishes a QUIC connection with the server. In one example, after startup, the client sends a QUIC connection request to the server. Upon receiving the QUIC connection request, the server sends a response message to the client. The client receives the response message from the server and establishes a QUIC connection with the server. The QUIC connection established between the client and the server is a persistent connection.

[0051] In one possible implementation, after the client establishes a QUIC connection with the server, the client can create an activation data stream on the QUIC link and periodically send activation messages to the server through the activation data stream.

[0052] In one example, after the client establishes a QUIC connection with the server, the client can periodically send an activation message to the server, which is equivalent to creating an activation data stream on the QUIC link and periodically sending activation messages to the server through the activation data stream. The timing can be a preset interval, such as an interval of 5 minutes, 10 minutes, or 30 minutes, etc. The activation data stream can be a long connection to ensure the survival of the link between the client and the server. Preferably, if the client survives, the QUIC link between the client and the server survives.

[0053] Exemplarily, the activity report message may be a PING (Packet Internet Groper) message, for example. The PING message can be used to test whether the client and the server can perform data interaction, that is, to test the availability of the network connection between the client and the server.

[0054] In the embodiment of the present disclosure, the client periodically sends an activation message to the server via an activation data stream to ensure the availability and reliability of the connection with the server.

[0055] The user can select the file to be downloaded through the client's interactive interface and trigger the download of the file. Correspondingly, when the user triggers the file download through the interactive interface, the client generates a file download task, and when it detects that there is a file download task, it creates a control data stream and a transmission data stream on the QUIC link pre-established between the client and the server.

[0056] S202: Send a resource preparation instruction corresponding to the file download task to the server by controlling the data flow.

[0057] In one example, when a client detects a file download task, it loads and generates task information, which may include the order and identifiers of the files to be downloaded. Furthermore, through the QUIC link pre-established with the server, the client sends a resource preparation instruction corresponding to the file download task to the server. This is equivalent to creating a control data stream and sending the resource preparation instruction corresponding to the file download task to the server through the control data stream. The resource preparation instruction includes the identifiers and order of multiple files to be downloaded, where the identifier of the file to be downloaded may be the name of the file to be downloaded, encoding information representing the file to be downloaded, and so on.

[0058] For example, the file download task includes downloading 100 files. Accordingly, the resource preparation instruction includes the names or encoding information of the 100 files, as well as the sequence numbers of the 100 files.

[0059] S203: Send a file transfer request to the server by transmitting a data stream, and receive the resource of the file to be downloaded transmitted from the server.

[0060] In one example, upon detecting a file download task, the client sends a file transfer request to the server via the pre-established QUIC link between the client and the server. This is equivalent to creating a transmission data stream and sending the file transfer request to the server via the transmission data stream. The file transfer request may include the identifier and sequence number of the file to be downloaded. The client then receives the resource of the file to be downloaded from the server, thereby downloading the file to be downloaded. The sequence number of the file to be downloaded included in the file transfer request ensures the integrity of the file download and avoids omissions and confusion in the file download.

[0061] The above step S203 sending the file transfer request to the server via the transmission data stream and the step S202 sending the resource preparation instruction corresponding to the file download task to the server via the control data stream can be performed synchronously or asynchronously.

[0062] In the disclosed embodiment, since a QUIC connection is pre-established between the client and the server, there is no need to re-establish a connection between the client and the server when the client initiates a file download task, thus saving the time for creating a network link when the client initiates a file download task. Furthermore, the client creates a control data stream on the QUIC link and uses the control data stream to send a resource preparation instruction corresponding to the file download task to the server, thereby notifying the server in advance to prepare the resources for the file to be downloaded. Furthermore, when the client sends a file transfer request to the server via the transmission data stream, the server can quickly respond to the file transfer request and transmit the resources of the file to be downloaded corresponding to the file transfer request to the client, thereby shortening the resource response time of the server and realizing the rapid download of batch files.

[0063] In addition, during the file download process, only one QUIC connection is required, which does not occupy too many resources on the client and server, thereby saving resources on the client and server. Of course, multiple QUIC connections can also be created to download batch files.

[0064] In one possible implementation, the creating of the control data stream and the transport data stream on the QUIC link pre-established with the server may include: creating a control data stream and a preset number of first transport data streams on the QUIC link pre-established with the server;

[0065] Accordingly, the implementation process of the above step S203 of sending a file transfer request to the server through the transmission data stream and receiving the resource of the file to be downloaded transmitted from the server may include:

[0066] Sending download requests including identifiers of first target files to be downloaded to the server via the first transmission data streams according to the order of the files to be downloaded in the resource preparation instruction;

[0067] Receive, via the first transmission data stream, a resource of a first target file to be downloaded corresponding to the download request of the first transmission data stream returned by the server;

[0068] When the resource reception corresponding to the first target file to be downloaded is completed through the first transmission data stream, the first transmission data stream is closed.

[0069] In one example, when a file download task is detected, the client can synchronously create a control data stream and a preset number of first transmission data streams on the QUIC link pre-established with the server. Accordingly, while sending the resource preparation instruction corresponding to the file download task to the server through the control data stream, the client sends a download request containing the identifier of the first target file to be downloaded to the server through each first transmission data stream in the order of each file to be downloaded in the resource preparation instruction. The preset number can be determined based on data such as the actual number of files to be downloaded or the network status, and this is not limited in the embodiments of the present disclosure. A transmission data stream can be responsible for the transmission of one or more files. The embodiments of the present disclosure are explained by taking the example of a transmission data stream being responsible for the transmission of one file.

[0070] Exemplarily, the resource preparation instruction includes the names or encoding information of 100 files, as well as the sequence numbers of these 100 files, with a preset number of 10. While the resource preparation instruction corresponding to the file download task is sent to the server via the control data stream, download requests containing the identifiers of the first target files to be downloaded are sent to the server via 10 first transmission data streams. For example, a download request containing the name of the first target file to be downloaded with a sequence number of 1 is sent to the server via the first first transmission data stream, a download request containing the name of the first target file to be downloaded with a sequence number of 2 is sent to the server via the second first transmission data stream, and so on.

[0071] Because each data stream established on the QUIC link can independently complete the network request response, the functions of the data streams are independent of each other. Accordingly, the first transmission data stream can be used to receive the resources of the first target file to be downloaded corresponding to the download request of the first transmission data stream returned by the server, and the first transmission data stream can be closed when the reception of the resources corresponding to the first target file to be downloaded is completed through the first transmission data stream.

[0072] In related technologies, when transferring a single file, the server wastes link resources while preparing the file resources to be downloaded, thus failing to properly utilize user-side bandwidth. When downloading multiple files in parallel, even if multiple files are using a network link at a given moment, the combined bandwidth of each link may still not be able to properly utilize user-side bandwidth due to the small size of the total files. Furthermore, expanding the number of links to enable concurrent downloads of multiple files incurs a cost in creating each link.

[0073] In the embodiment of the present disclosure, each data stream can independently complete the network request response, the functions of the data streams are independent of each other, and because the data stream is a logical concept, there is no cost for creating the data stream. Therefore, according to the order of the files to be downloaded in the resource preparation instruction, the download request containing the identifier of the first target file to be downloaded is sent to the server through each first transmission data stream, and the resource of the first target file to be downloaded corresponding to the download request of the first transmission data stream returned by the server is received through the first transmission data stream. After completing the reception of the resource corresponding to the first target file to be downloaded through the first transmission data stream, the first transmission data stream is closed. Compared with the existing method of expanding the number of links to achieve concurrent downloading of multiple files, the cost of link creation is saved, and the file transmission is achieved through a preset number of first transmission data streams to reasonably utilize the user-side bandwidth resources.

[0074] In one possible implementation, the client controls the data flow to send resource preparation instructions corresponding to the file download task to the server, allowing the server to understand and prepare the resources required for the file to be downloaded. Upon completing resource caching for a file to be downloaded, the server sends a "prepare complete" message to the client. Correspondingly, upon receiving the "prepare complete" message from the server after completing resource caching for a file to be downloaded, the client creates a second transport data stream on the QUIC link.

[0075] Furthermore, the implementation process of the above step S203 of sending a file transfer request to the server through the transmission data stream and receiving the resource of the file to be downloaded transmitted from the server may also include:

[0076] Sending a transmission request for the file to be downloaded corresponding to the ready message to the server via the second transmission data stream;

[0077] The resource of the file to be downloaded corresponding to the preparation completion message transmitted from the server is received, and when the resource is completely received, the second transmission data stream is closed.

[0078] The preparation completion message may include the identifier and sequence number of the file to be downloaded.

[0079] When the client receives the ready message, it indicates that the server has loaded and cached the resources of the file to be downloaded. At this time, a second transmission data stream is created, and a transmission request for the file to be downloaded corresponding to the ready message is sent to the server through the second transmission data stream. Corresponding to the ready message, the transmission request may include the identifier and sequence number of the file to be downloaded, etc. Further, the resource of the file to be downloaded corresponding to the ready message transmitted from the server is received, and the second transmission data stream is closed when the resource is received.

[0080] In the embodiment of the present disclosure, when the client receives the ready message, it will give priority to creating a second transmission data stream, and directly transmit the resources of the file to be downloaded corresponding to the ready message that are loaded and cached by the server to the local computer through the second transmission data stream, without waiting for the server to load the resources of the file to be downloaded, thereby speeding up the download speed of the file to be downloaded.

[0081] In a possible implementation, when the first transmission data stream is closed and the client has not received a ready message sent by the server, the client may further perform the following steps:

[0082] Create a target number of new first transport data streams on the QUIC link;

[0083] Sending download requests including identifiers of second target files to be downloaded to the server via each new first transmission data stream according to the order of the files to be downloaded in the resource preparation instruction;

[0084] Receive, via the new first transmission data stream, a resource of a second target file to be downloaded corresponding to the download request of the new first transmission data stream returned by the server;

[0085] When the resource reception corresponding to the second target file to be downloaded is completed through the new first transmission data stream, the new first transmission data stream is closed.

[0086] In one example, the target number can be determined based on the number of closed first transmission data streams. For example, the target number can be the number of closed first transmission data streams, or a value between the number of closed first transmission data streams and a preset number.

[0087] Exemplarily, the client has three first transmission data streams closed, and has not currently received the preparation completion message sent by the server. The client has currently completed the resource transmission of the files to be downloaded with sequence numbers 4-6, and the resources of the files to be downloaded with sequence numbers 1-3 and 7-10 are being transmitted through the first transmission data stream. At this time, the client creates three new first transmission data streams on the QUIC link, and sends a download request containing the identifier of the second target file to be downloaded to the server through the three new first transmission data streams according to the order of the files to be downloaded in the resource preparation instruction. For example, a download request containing the identifier of the file to be downloaded with sequence number 11 may be sent to the server through the first new first transmission data stream, a download request containing the identifier of the file to be downloaded with sequence number 12 may be sent to the server through the second new first transmission data stream, and a download request containing the identifier of the file to be downloaded with sequence number 13 may be sent to the server through the third new first transmission data stream. Furthermore, the resource of the file to be downloaded with sequence number 11 returned by the server is received through the first new first transmission data stream, and when the resource reception of the file to be downloaded with sequence number 11 is completed, the new first transmission data stream is closed, and so on.

[0088] For example, the client has two closed first transmission data streams and has not yet received the ready message sent by the server. The client has currently completed the transmission of resources for files to be downloaded with sequence numbers 1-20 and 26-27, and the resources for files to be downloaded with sequence numbers 21-25 and 28-30 are being transmitted through a new first transmission data stream, and the resources for files to be downloaded with sequence numbers 31-32 are being transmitted through a second transmission data stream. At this time, two new first transmission data streams are created on the QUIC link. A download request containing the identifier of the file to be downloaded with sequence number 33 is sent to the server through the first new first transmission data stream, and a download request containing the identifier of the file to be downloaded with sequence number 34 is sent to the server through the second new first transmission data stream. Furthermore, the resources for the file to be downloaded with sequence number 33 returned by the server are received through the first new first transmission data stream, and when the resources for the file to be downloaded with sequence number 33 are received, the new first transmission data stream is closed, and so on.

[0089] In the embodiment of the present disclosure, when the first transmission data stream is closed and the client has not received the preparation completion message sent by the server, the client creates a target number of new first transmission data streams on the QUIC link, and sends a download request containing the identifier of the second target file to be downloaded to the server through each new first transmission data stream in the order of each file to be downloaded in the resource preparation instruction, so that the transmission data streams of the resource for downloading the file to be downloaded are not less than a preset number, so as to fully utilize the QUIC link resources and client bandwidth resources.

[0090] In a possible implementation, the above method may further include:

[0091] When receiving the download cancellation instruction for the third target file to be downloaded, the client sends the download cancellation instruction for the third target file to be downloaded to the server by controlling the data flow.

[0092] When the user does not need to download a certain file, the user can choose to cancel the downloaded file through the client. Accordingly, the client can receive a download cancellation instruction for a third target file to be downloaded, and when receiving the download cancellation instruction for the third target file to be downloaded, the client sends the download cancellation instruction for the third target file to be downloaded to the server by controlling the data flow to cancel the download of the third target file to be downloaded.

[0093] Compared with the existing situation of downloading files in batches, when the user pre-packages the files, it is impossible to cancel the download of individual files during the download process. In the embodiment of the present disclosure, when the user does not need to download a certain file, he can directly send a download cancellation instruction of the third target file to be downloaded to the server through the client, which will not affect the download of other files to be downloaded.

[0094] For example, Figure 3 As shown, the implementation process of a batch file downloading method provided by an embodiment of the present disclosure is applied to a client, including:

[0095] S301, establish a QUIC connection with the server;

[0096] After startup, the client establishes a QUIC connection with the server.

[0097] S302: Create an active data stream on the QUIC link and periodically send active messages to the server through the active data stream.

[0098] Periodically send live messages to the server to ensure the survival of the QUIC link.

[0099] S303: When a file download task is detected, the task information is loaded, and a control data stream and N (preset number) first transmission data streams are created on the QUIC link;

[0100] S304, sending a resource preparation instruction corresponding to the file download task to the server by controlling the data flow, wherein the resource preparation instruction includes the identifiers and order of multiple files to be downloaded;

[0101] S305, detecting whether there is any file to be downloaded that has not been downloaded;

[0102] If there is a file to be downloaded that has not been downloaded, execute step S306, otherwise end.

[0103] S306, sending download requests including identifiers of first target files to be downloaded to the server via the first transmission data streams according to the order of the files to be downloaded in the resource preparation instruction;

[0104] S307, receiving, through the first transmission data stream, the resource of the first target file to be downloaded corresponding to the download request of the first transmission data stream, and closing the first transmission data stream when the resource reception is completed;

[0105] S308: Upon receiving a ready message sent by the server after completing resource caching of a file to be downloaded, creating a second transmission data stream on the QUIC link, and sending a transmission request for the file to be downloaded corresponding to the ready message to the server via the second transmission data stream;

[0106] S309, receiving the resource of the file to be downloaded corresponding to the preparation completion message, and closing the second transmission data stream when the resource is received;

[0107] S310: When the first transport data stream is closed and no preparation completion message is received from the server, a target number of new first transport data streams are created on the QUIC link, and a download request including an identifier of a second target file to be downloaded is sent to the server through each new first transport data stream in the order of the files to be downloaded in the resource preparation instruction.

[0108] S311, receiving the resources of the second target file to be downloaded corresponding to the download request of the new first transmission data stream returned by the server through the new first transmission data stream, and closing the new first transmission data stream after completing the reception of the resources corresponding to the second target file to be downloaded.

[0109] Step S305 is further executed to detect whether there is any file to be downloaded that has not been downloaded, and if no file to be downloaded has not been downloaded, the process is terminated.

[0110] See also Figure 4, Figure 4 A flowchart of another batch file downloading method provided in an embodiment of the present disclosure, applied to a server, includes the following steps:

[0111] S401: Receive a resource preparation instruction sent by a client via a control data flow.

[0112] After startup, the client pre-establishes a QUIC connection with the server, that is, the server pre-establishes a QUIC connection with the client.

[0113] In a possible implementation, the server receives an activation message sent by the client through an activation data stream, and when determining that data interaction with the client is possible, feeds back a confirmation message to the client.

[0114] In one example, if the server can receive the active message sent by the client, it means that the server and the client can exchange data. In this case, a confirmation message is fed back to the client. The active message can be, for example, a PING message.

[0115] In the embodiment of the present disclosure, the client sends an activation message to the server periodically through the activation data stream. When the server determines that data interaction with the client is possible, it feeds back a confirmation message to the client to ensure the availability and reliability of the connection between the client and the server.

[0116] When the client detects a file download task, it creates a control data stream and a transmission data stream on the QUIC link established between the client and the server, and sends a resource preparation instruction corresponding to the file download task to the server through the control data stream. The server receives the resource preparation instruction sent by the client through the control data stream, which includes the identifiers and order of multiple files to be downloaded.

[0117] S402: Load resources of each file to be downloaded according to the identifier and sequence of each file to be downloaded, and cache the loaded resources of the file to be downloaded locally.

[0118] In one example, after receiving a resource preparation instruction from a client via a control data stream, the server loads the resources for each file to be downloaded from the corresponding storage device according to the identifiers and order of the files to be downloaded in the resource preparation instruction, and caches the loaded resources locally. The storage device represents the storage location of the files to be downloaded, such as a database or cloud.

[0119] Exemplarily, the server reads data corresponding to the identifiers of the files to be downloaded from the storage device in sequence according to the order of the files to be downloaded in the resource preparation instruction, and loads and caches the read data locally.

[0120] S403: Receive a file transfer request sent by the client via a transmission data stream, and transmit resources of the to-be-downloaded file corresponding to the file transfer request to the client.

[0121] The server receives a file transfer request sent by the client through a transmission data stream. The file transfer request may include an identifier and a sequence number of the file to be downloaded. The server transfers the resources of the file to be downloaded corresponding to the file transfer request that are loaded and cached locally to the client, or loads the resources of the file to be downloaded corresponding to the file transfer request and transfers the loaded resources to the client.

[0122] In the disclosed embodiment, since a QUIC connection is pre-established between the client and the server, there is no need to re-establish a connection between the client and the server when the client initiates a file download task, thus saving the time required to create a network link when the client initiates a file download task. Furthermore, the server receives resource preparation instructions sent by the client via a control data stream, so as to prepare resources for the files to be downloaded in advance. Furthermore, upon receiving a file transfer request sent by the client via a transmission data stream, the server can quickly respond to the file transfer request and transfer the resources of the files to be downloaded corresponding to the file transfer request to the client, thereby shortening the resource response time of the server and achieving rapid downloading of batch files.

[0123] In a possible implementation, the implementation process of receiving the file transfer request sent by the client via the transmission data stream in step S403 and transmitting the resource of the to-be-downloaded file corresponding to the file transfer request to the client may include:

[0124] receiving a download request including an identifier of a first target file to be downloaded, sent by a client through each first transmission data stream;

[0125] According to the identifier of the first target file to be downloaded, the resources of each first target file to be downloaded are loaded, and the resources of the first target file to be downloaded corresponding to the download request of the first transmission data stream are sent to the client through the first transmission data stream.

[0126] In one example, when the client detects a file download task, the client sends a resource preparation instruction corresponding to the file download task to the server through the control data stream. At the same time, according to the order of each file to be downloaded in the resource preparation instruction, the client sends a download request containing the identifier of the first target file to be downloaded to the server through each first transmission data stream. The server receives the download request containing the identifier of the first target file to be downloaded sent by the client through each first transmission data stream. In this case, the server has not yet loaded and cached the resources of the file to be downloaded, and then loads the resources of each first target file to be downloaded according to the identifier of the first target file to be downloaded, and sends the resources of the first target file to be downloaded corresponding to the downloaded download request of the first transmission data stream to the client through the first transmission data stream.

[0127] In the embodiment of the present disclosure, the client sends a download request containing the identifier of the first target file to be downloaded to the server through each created first transmission data stream. The server loads the resources of each first target file to be downloaded according to the identifier of the first target file to be downloaded, and sends the resources of the first target file to be downloaded corresponding to the download request of the loaded first transmission data stream to the client through the first transmission data stream. Because each data stream can independently complete the network request response, the functions of the data streams are independent of each other, and because the data stream is a logical concept, there is no cost for creating the data stream. Compared with the existing method of expanding the number of links to achieve concurrent downloading of multiple files, the cost of link creation is saved. By realizing the transmission of files through multiple first transmission data streams, bandwidth resources can be reasonably utilized.

[0128] In one possible implementation, the server receives a resource preparation instruction sent by the client through a control data stream, loads the resources of each file to be downloaded from the corresponding storage device according to the identification and order of each file to be downloaded in the resource preparation instruction, and caches the loaded resources of the file to be downloaded locally. When the resource caching of a file to be downloaded is completed, a preparation completion message is sent to the client.

[0129] When the client receives a ready message sent by the server after completing the resource caching of a file to be downloaded, it creates a second transmission data stream on the QUIC link and sends a transmission request for the file to be downloaded corresponding to the ready message to the server via the second transmission data stream. The server receives the transmission request sent by the client via the second transmission data stream, sends the resources of the file to be downloaded corresponding to the transmission request that are cached in the local cache to the client via the second transmission data stream, and deletes the resources of the file to be downloaded corresponding to the transmission request from the local cache.

[0130] In the embodiment of the present disclosure, when the server completes the resource caching of a file to be downloaded, it sends a ready message to the client, so that when the client receives the ready message, it creates a second transmission data stream, and directly transmits the resources of the file to be downloaded corresponding to the ready message that are loaded and cached by the server to the local computer through the second transmission data stream, without waiting for the server to load the resources of the file to be downloaded, thereby speeding up the download speed of the file to be downloaded.

[0131] In a possible implementation, when the first transport data stream is closed and the client has not received a preparation completion message sent by the server, the client creates a new first transport data stream on the QUIC link and sends a download request containing the identifier of the second target file to be downloaded to the server through each new first transport data stream in the order of the files to be downloaded in the resource preparation instruction. The server receives the download request containing the identifier of the second target file to be downloaded sent by the client through each new first transport data stream, and determines whether the resource of the second target file to be downloaded is being loaded and cached based on the identifier of the second target file to be downloaded. If the resource of the second target file to be downloaded is being loaded and cached, the cached part is sent to the client through the corresponding new first transport data stream, and the caching of the resource of the second target file to be downloaded is stopped, and the uncached part is loaded and sent to the client through the corresponding new first transport data stream. If the resource of the second target file to be downloaded is not being loaded and cached, the resource of the second target file to be downloaded is loaded, and the loaded resource of the second target file to be downloaded is sent to the client through the corresponding new first transport data stream.

[0132] For example, the client has currently completed the resource transmission of the files to be downloaded with sequence numbers 1-10 and 12-15, the resources of the files to be downloaded with sequence numbers 11 and 16-20 are being transmitted through the new first transmission data stream, and the server is currently loading and caching the resources of the files to be downloaded with sequence numbers 21-30. At this time, the server receives 4 download requests sent by the new first transmission data stream containing the identifiers of the second target files to be downloaded. The sequence numbers of the files to be downloaded corresponding to the identifiers of the second target files to be downloaded are 21-24 respectively. The server then determines whether the resources of each second target file to be downloaded are being loaded and cached based on the identifiers of the second target files to be downloaded. If the files to be downloaded with sequence numbers 21-22 have been loaded and cached, the cached parts of the files to be downloaded with sequence numbers 21-22 will be sent to the client through the corresponding new first transmission data stream, and the caching of the resources of the files to be downloaded with sequence numbers 21-22 will be stopped. The uncached parts will be loaded and sent to the client through the corresponding new first transmission data stream. If the files to be downloaded with sequence numbers 23-24 have not yet been loaded into the cache, the resources of the files to be downloaded with sequence numbers 23-24 are loaded, and the loaded resources of the files to be downloaded with sequence numbers 23-24 are sent to the client via the corresponding new first transmission data stream.

[0133] In the embodiment of the present disclosure, the server receives a download request including an identifier of a second target file to be downloaded, which is sent by the client through each new first transmission data stream. Based on the identifier of the second target file to be downloaded, the server determines whether the resource of the second target file to be downloaded is being loaded and cached. If so, the cached portion is sent to the client through the corresponding new first transmission data stream, and the caching of the resource of the second target file to be downloaded is stopped. The uncached portion is loaded and sent to the client through the corresponding new first transmission data stream, so that the server can quickly respond to the client's download request, thereby improving the download speed of the file to be downloaded.

[0134] In a possible implementation, the implementation of loading resources of each file to be downloaded according to the identifier and order of each file to be downloaded may include:

[0135] The resources of the files to be downloaded are loaded in batches according to the identifiers and sequence of the files to be downloaded, wherein the number of the batch-loaded files to be downloaded is determined according to the number of transmission data streams that are transmitting the resources of the files to be downloaded.

[0136] For example, the number of files to be downloaded in batch loading can be a multiple of the number of transport data streams currently transmitting the file resources to be downloaded. For example, the number of files to be downloaded in batch loading can be 1, 2, or 3 times the number of transport data streams currently transmitting the file resources to be downloaded. The number of files to be downloaded in batch loading can also be a value greater than the number of transport data streams currently transmitting the file resources to be downloaded. For example, if the number of transport data streams currently transmitting the file resources to be downloaded is 10, the number of files to be downloaded in batch loading can be a multiple of 10, or a number greater than 10.

[0137] In the embodiment of the present disclosure, the server loads the resources of each file to be downloaded in batches according to the identification and order of each file to be downloaded, so as to ensure that the server loads and caches the number of files to be downloaded, so that the resource transmission of the files to be downloaded is seamlessly connected with the download request, saving resource preparation time and improving the download speed of the files to be downloaded.

[0138] In a possible implementation, the above method may further include: the server receives a download cancellation instruction for the third target file to be downloaded sent by the client through the control data stream, cancels the resource loading of the third target file to be downloaded, or deletes the resources of the third target file to be downloaded from the local cache.

[0139] When the client receives a download cancellation instruction for a third target file to be downloaded, the client sends the download cancellation instruction for the third target file to be downloaded to the server through the control data flow. The server receives the download cancellation instruction for the third target file to be downloaded sent by the client through the control data flow, and cancels the loading of the resources of the third target file to be downloaded if the resources of the third target file to be downloaded have not been loaded. When the resources of the third target file to be downloaded have been loaded and cached, the server deletes the resources of the third target file to be downloaded from the local cache.

[0140] In the embodiment of the present disclosure, when the user does not need to download a certain file, the user can directly send a download cancellation instruction of the third target file to be downloaded to the server through the client, which will not affect the download of other files to be downloaded.

[0141] For example, Figure 5 As shown, the implementation process of batch file downloading in the embodiment of the present disclosure includes:

[0142] S501, after startup, the client 510 sends a QUIC connection request to the server 520;

[0143] S502, the server 520 receives the QUIC connection request and feeds back a response message to the client 510;

[0144] S503, the client 510 receives the response message fed back by the server 520, establishes a QUIC connection with the server 520, and creates a live data stream on the QUIC link (see Figure 6 );

[0145] S504, the client 510 sends an activation message to the server 520 via the activation data stream at regular intervals;

[0146] S505, the server 520 receives the activation message;

[0147] S506: When the server 520 determines that data exchange with the client 510 is possible, the server 520 sends a confirmation message to the client 510;

[0148] S507, when the client 510 detects the file download task, it creates a control data stream and a preset number of first transmission data streams (see Figure 6 );

[0149] S508, the client 510 sends a resource preparation instruction corresponding to the file download task to the server 520 by controlling the data flow, where the resource preparation instruction includes the identifiers and order of multiple files to be downloaded;

[0150] S509: The server 520 receives the resource preparation instruction, loads the resources of each file to be downloaded according to the identifier and order of each file to be downloaded in the resource preparation instruction, and caches the loaded resources of the file to be downloaded locally;

[0151] S510, the client 510 sends a download request including an identifier of a first target file to be downloaded to the server 520 via each first transmission data stream according to the order of the files to be downloaded in the resource preparation instruction;

[0152] S511, the server 520 receives a download request including an identifier of a first target file to be downloaded, and loads resources of each first target file to be downloaded according to the identifier of the first target file to be downloaded;

[0153] S512, the server 520 sends the resource of the first target file to be downloaded corresponding to the download request of the first transmission data stream to the client 510 via the first transmission data stream;

[0154] S513: The client 510 receives, through the first transmission data stream, the resource of the first target file to be downloaded corresponding to the download request of the first transmission data stream, and closes the first transmission data stream when the resource reception is completed.

[0155] S514, when the server 520 completes caching of a resource for a file to be downloaded, it sends a ready message to the client 510;

[0156] S515: Upon receiving the ready message, the client 510 creates a second transmission data stream on the QUIC link.

[0157] S516, the client 510 sends a transmission request for the file to be downloaded corresponding to the ready message to the server 520 via the second transmission data stream;

[0158] S517: The server 520 receives the transfer request, sends the resource of the file to be downloaded corresponding to the transfer request that is cached in the local cache to the client 511 via the second transmission data stream, and deletes the resource of the file to be downloaded corresponding to the transfer request from the local cache.

[0159] S518, the client 510 receives the resource of the file to be downloaded corresponding to the preparation completion message, and closes the second transmission data stream when the resource is received;

[0160] S519: When the first transport data stream is closed and the client 510 does not receive a ready message sent by the server 520, it creates a target number of new first transport data streams on the QUIC link.

[0161] S520, the client 510 sends a download request including an identifier of the second target file to be downloaded to the server 520 via each new first transmission data stream according to the order of the files to be downloaded in the resource preparation instruction;

[0162] S521: The server 520 receives a download request including an identifier of a second target file to be downloaded. Based on the identifier of the second target file to be downloaded, the server 520 determines whether resources of the second target file to be downloaded are currently being loaded and cached. If so, the server 520 sends the cached portion of the resource to the client 510 via a corresponding new first transmission data stream, stops caching resources of the second target file to be downloaded, and loads the uncached portion of the resource to be downloaded and sends it to the client 510 via a corresponding new first transmission data stream.

[0163] S522: The client 510 receives, via the new first transmission data stream, the resource of the second target file to be downloaded corresponding to the download request of the new first transmission data stream returned by the server 520, and closes the new first transmission data stream upon completing reception of the resource corresponding to the second target file to be downloaded.

[0164] S523, when the client 510 receives the download cancellation instruction for the third target file to be downloaded, it sends the download cancellation instruction for the third target file to be downloaded to the server 520 by controlling the data flow;

[0165] S524 , the server 520 receives a download cancellation instruction for the third target file to be downloaded, cancels resource loading of the third target file to be downloaded, or deletes the resource of the third target file to be downloaded from the local cache.

[0166] The present disclosure also provides a batch file downloading device, which is applied to the client. Figure 7 , the device comprises:

[0167] The stream creation module 701 is configured to create a control data stream and a transmission data stream on a QUIC link pre-established with the server when a file download task is detected;

[0168] The instruction sending module 702 is used to send a resource preparation instruction corresponding to the file download task to the server by controlling the data flow. The resource preparation instruction includes the identifiers and order of multiple files to be downloaded;

[0169] The request sending module 703 is configured to send a file transfer request to the server via a transmission data stream, and receive the resource of the file to be downloaded transmitted from the server.

[0170] In the disclosed embodiment, since a QUIC connection is pre-established between the client and the server, there is no need to re-establish a connection between the client and the server when the client initiates a file download task, thus saving the time for creating a network link when the client initiates a file download task. Furthermore, the client creates a control data stream on the QUIC link and uses the control data stream to send a resource preparation instruction corresponding to the file download task to the server, thereby notifying the server in advance to prepare the resources for the file to be downloaded. Furthermore, when the client sends a file transfer request to the server via the transmission data stream, the server can quickly respond to the file transfer request and transmit the resources of the file to be downloaded corresponding to the file transfer request to the client, thereby shortening the resource response time of the server and realizing the rapid download of batch files.

[0171] In one possible implementation, the stream creation module 701 is specifically configured to: upon detecting a file download task, create a control data stream and a preset number of first transmission data streams on a QUIC link pre-established with the server;

[0172] The request sending module 703 is specifically configured to:

[0173] Sending download requests including identifiers of first target files to be downloaded to the server via the first transmission data streams according to the order of the files to be downloaded in the resource preparation instruction;

[0174] Receiving, via the first transmission data stream, a resource of a first target file to be downloaded corresponding to the download request of the first transmission data stream returned by the server;

[0175] When the resource reception corresponding to the first target file to be downloaded is completed through the first transmission data stream, the first transmission data stream is closed.

[0176] In a possible implementation, the above device further includes:

[0177] A transport stream creation module, configured to create a second transport data stream on the QUIC link upon receiving a ready message sent by the server after the server completes caching of resources for a file to be downloaded;

[0178] a transmission request sending module, configured to send a transmission request for a file to be downloaded corresponding to the ready message to the server via a second transmission data stream;

[0179] The first resource receiving module is configured to receive the resource of the file to be downloaded corresponding to the preparation completion message transmitted from the server, and close the second transmission data stream when the resource is received.

[0180] In a possible implementation, the above device further includes:

[0181] A download stream creation module, configured to create a target number of new first transport data streams on the QUIC link when the first transport data stream is closed and no ready message sent by the server is received;

[0182] a download request sending module, configured to send download requests including identifiers of second target files to be downloaded to the server via each new first transmission data stream according to the order of the files to be downloaded in the resource preparation instruction;

[0183] A second resource receiving module is configured to receive, via a new first transmission data stream, a resource of a second target file to be downloaded corresponding to the download request of the new first transmission data stream returned by the server;

[0184] The stream closing module is used to close the new first transmission data stream when the resource reception corresponding to the second target file to be downloaded is completed through the new first transmission data stream.

[0185] In a possible implementation, the above device further includes:

[0186] The live stream creation module is used to create live data streams on the QUIC link;

[0187] The activity request module is used to send activity messages to the server at regular intervals through the activity data stream.

[0188] In a possible implementation, the above device further includes:

[0189] The cancellation instruction sending module is used to send the cancellation instruction for the third target file to be downloaded to the server by controlling the data flow when receiving the cancellation instruction for the third target file to be downloaded.

[0190] The present disclosure also provides a batch file downloading device, which is applied to the server. Figure 8 , the device comprises:

[0191] The instruction receiving module 801 is configured to receive a resource preparation instruction sent by the client via a control data stream, wherein the resource preparation instruction includes identifiers and sequences of multiple files to be downloaded; the server and the client pre-establish an Internet transport layer protocol QUIC connection;

[0192] The resource preparation module 802 is used to load the resources of each file to be downloaded according to the identification and order of each file to be downloaded, and cache the loaded resources of the file to be downloaded locally;

[0193] The file transmission module 803 is configured to receive a file transmission request sent by a client via a transmission data stream, and transmit the resource of the to-be-downloaded file corresponding to the file transmission request to the client.

[0194] In the disclosed embodiment, since a QUIC connection is pre-established between the client and the server, there is no need to re-establish a connection between the client and the server when the client initiates a file download task, thus saving the time required to create a network link when the client initiates a file download task. Furthermore, the server receives resource preparation instructions sent by the client via a control data stream, so as to prepare resources for the files to be downloaded in advance. Furthermore, upon receiving a file transfer request sent by the client via a transmission data stream, the server can quickly respond to the file transfer request and transfer the resources of the files to be downloaded corresponding to the file transfer request to the client, thereby shortening the resource response time of the server and achieving rapid downloading of batch files.

[0195] In a possible implementation, the file transfer module 803 is specifically configured to:

[0196] receiving a download request including an identifier of a first target file to be downloaded, sent by a client through each first transmission data stream;

[0197] According to the identifier of the first target file to be downloaded, the resources of each first target file to be downloaded are loaded, and the resources of the first target file to be downloaded corresponding to the download request of the first transmission data stream are sent to the client through the first transmission data stream.

[0198] In a possible implementation, the above device further includes:

[0199] The message sending module is used to send a ready message to the client when the resource cache of a file to be downloaded is completed;

[0200] a transmission request receiving module, configured to receive a transmission request sent by a client via a second transmission data stream;

[0201] The resource transmission module is used to send the resource of the file to be downloaded corresponding to the transmission request that is cached in the local cache to the client through the second transmission data stream, and delete the resource of the file to be downloaded corresponding to the transmission request from the local cache.

[0202] In a possible implementation, the above device further includes:

[0203] A download request receiving module, configured to receive a download request including an identifier of a second target file to be downloaded, sent by the client via each new first transmission data stream;

[0204] a cache determination module, configured to determine whether the resource of the second target file to be downloaded is being loaded and cached according to the identifier of the second target file to be downloaded;

[0205] The resource feedback module is used to send the cached part to the client through the corresponding new first transmission data stream, stop caching the resources of the second target file to be downloaded, and load the uncached part and send it to the client through the corresponding new first transmission data stream when the cache determination module determines that the resources of the second target file to be downloaded are being loaded and cached.

[0206] In a possible implementation, the above device further includes:

[0207] A message receiving module is used to receive the activation message sent by the client through the activation data stream;

[0208] The message confirmation module is used to feed back a confirmation message to the client when it is determined that data interaction with the client is possible.

[0209] In a possible implementation, the resource preparation module 802 is specifically used to batch load the resources of each file to be downloaded according to the identification and order of each file to be downloaded, wherein the number of batch loaded files to be downloaded is determined according to the number of transmission data streams that are transmitting the file resources to be downloaded.

[0210] In a possible implementation, the above device further includes:

[0211] The loading cancellation module is used to receive a download cancellation instruction of a third target file to be downloaded sent by the client through the control data stream, cancel the resource loading of the third target file to be downloaded, or delete the resource of the third target file to be downloaded from the local cache.

[0212] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium, and a computer program product.

[0213] The present disclosure provides an electronic device, comprising:

[0214] at least one processor; and

[0215] a memory communicatively connected to at least one processor; wherein,

[0216] The memory stores instructions that can be executed by at least one processor. The instructions are executed by the at least one processor to enable the at least one processor to perform any method in the present disclosure.

[0217] The present disclosure provides a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable a computer to execute any one of the methods in the present disclosure.

[0218] The present disclosure provides a computer program product, including a computer program. When the computer program is executed by a processor, it implements any one of the methods in the present disclosure.

[0219] The collection, storage, use, processing, transmission, provision, and disclosure of user personal information in the technical solutions disclosed herein comply with relevant laws and regulations and do not violate public order and good morals. It should be noted that the head model in this embodiment is not a head model for a specific user and does not reflect the personal information of a specific user. It should be noted that the two-dimensional facial images in this embodiment are derived from a public dataset.

[0220] Figure 9A schematic block diagram of an example electronic device 900 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are provided as examples only and are not intended to limit the implementation of the present disclosure described and / or claimed herein.

[0221] like Figure 9 As shown, the device 900 includes a computing unit 901, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 902 or a computer program loaded from a storage unit 908 into a random access memory (RAM) 903. Various programs and data required for the operation of the device 900 can also be stored in the RAM 903. The computing unit 901, the ROM 902, and the RAM 903 are connected to each other via a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904.

[0222] Various components in the device 900 are connected to the I / O interface 905, including an input unit 906, such as a keyboard, a mouse, etc.; an output unit 907, such as various types of displays, speakers, etc.; a storage unit 908, such as a magnetic disk, an optical disk, etc.; and a communication unit 909, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 909 allows the device 900 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.

[0223] The computing unit 901 can be a variety of general-purpose and / or specialized processing components with processing and computing capabilities. Some examples of the computing unit 901 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units that run machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 901 performs the various methods and processes described above, such as the batch file download method. For example, in some embodiments, the batch file download method can be implemented as a computer software program that is tangibly contained in a machine-readable medium, such as the storage unit 908. In some embodiments, part or all of the computer program can be loaded and / or installed on the device 900 via the ROM 902 and / or the communication unit 909. When the computer program is loaded into the RAM 903 and executed by the computing unit 901, one or more steps of the batch file download method described above can be performed. Alternatively, in other embodiments, the computing unit 901 can be configured to perform the batch file download method by any other appropriate means (e.g., by means of firmware).

[0224] Various embodiments of the systems and techniques described above can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), system-on-chip systems (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include being implemented in one or more computer programs that are executable and / or interpreted on a programmable system that includes at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0225] The program code for implementing the method of the present disclosure can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device so that when the program code is executed by the processor or controller, the functions / operations specified in the flow chart and / or block diagram are implemented. The program code can be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.

[0226] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in conjunction with an instruction execution system, device or equipment. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium can include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0227] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0228] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network (LAN), a wide area network (WAN), and the Internet.

[0229] A computer system may include a client and a server. The client and server are generally remote from each other and typically interact through a communication network. The client-server relationship arises through computer programs running on the respective computers and having a client-server relationship with each other. The server may be a cloud server, a server in a distributed system, or a server integrated with a blockchain.

[0230] It should be understood that the various forms of the processes shown above can be used to reorder, add, or delete steps. For example, the steps described in this disclosure can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved. This is not limited herein.

[0231] The above specific embodiments do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may be made based on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure shall be included within the scope of protection of this disclosure.

Claims

1. A batch file downloading method, applied to a client, comprising: When a file download task is detected, a control data stream and a preset number of first transmission data streams are synchronously created on a QUIC link pre-established with the server; sending a resource preparation instruction corresponding to the file download task to the server via the control data stream, and simultaneously sending a download request including an identifier of a first target file to be downloaded to the server via each of the first transmission data streams according to the order of the files to be downloaded in the resource preparation instruction; the resource preparation instruction including the identifiers and order of the multiple files to be downloaded; A transmission data stream is responsible for the transmission of a file; Receiving, via the first transmission data stream, a resource of a first target file to be downloaded corresponding to the download request of the first transmission data stream returned by the server; When receiving the resource corresponding to the first target file to be downloaded is completed through the first transmission data stream, closing the first transmission data stream; Upon receiving a ready message sent by the server after completing resource caching of a file to be downloaded, creating a second transmission data stream on the QUIC link; Sending a transmission request for the to-be-downloaded file corresponding to the ready message to the server through the second transmission data stream; Receive the resource of the file to be downloaded corresponding to the preparation completion message transmitted from the server, and close the second transmission data stream when the resource is completely received.

2. The method according to claim 1, further comprising: when the first transmission data stream is closed and the server does not receive a ready message sent by the server; Creating a target number of new first transport data streams on the QUIC link; sending, to the server through each of the new first transmission data streams, download requests containing identifiers of the second target files to be downloaded according to the order of the files to be downloaded in the resource preparation instruction; Receiving, via the new first transmission data stream, a resource of a second target file to be downloaded corresponding to the download request of the new first transmission data stream returned by the server; When the resource reception corresponding to the second target file to be downloaded is completed through the new first transmission data stream, the new first transmission data stream is closed.

3. The method according to claim 1, further comprising: Creating a live data stream on the QUIC link; The activation message is sent to the server at regular intervals via the activation data stream.

4. The method according to any one of claims 1 to 3, further comprising: When a download cancellation instruction for a third target file to be downloaded is received, the download cancellation instruction for the third target file to be downloaded is sent to the server through the control data flow.

5. A batch file downloading method, applied to a server, comprising: receiving a resource preparation instruction sent by a client via a control data stream, wherein the resource preparation instruction includes identifiers and an order of multiple files to be downloaded; The server and the client pre-establish an Internet transport layer protocol QUIC connection; wherein, when the client detects a file download task, it synchronously creates a control data stream and a preset number of first transmission data streams on the QUIC link pre-established with the server; and sends a resource preparation instruction corresponding to the file download task to the server via the control data stream, and at the same time, according to the order of each to-be-downloaded file in the resource preparation instruction, sends a download request containing an identifier of a first target to-be-downloaded file to the server via each of the first transmission data streams; Loading resources of each file to be downloaded according to the identifier and order of each file to be downloaded, and caching the loaded resources of the file to be downloaded locally; receiving a download request including an identifier of a first target file to be downloaded, sent by the client via each first transmission data stream; wherein one transmission data stream is responsible for the transmission of one file; loading resources of each of the first target files to be downloaded according to the identifier of the first target file to be downloaded, and sending the resources of the first target file to be downloaded corresponding to the download request of the first transport data stream to the client through the first transport data stream; When the resource cache of a file to be downloaded is completed, a ready message is sent to the client; receiving a transmission request sent by the client via a second transmission data stream; The resource of the file to be downloaded corresponding to the transmission request that is cached in the local cache is sent to the client through the second transmission data stream, and the resource of the file to be downloaded corresponding to the transmission request is deleted from the local cache.

6. The method according to claim 5, further comprising: receiving a download request including an identifier of a second target file to be downloaded, sent by the client through each new first transmission data stream; determining, according to the identifier of the second target file to be downloaded, whether resources of the second target file to be downloaded are being loaded and cached; When the resources of the second target file to be downloaded are being loaded and cached, the cached part is sent to the client through the corresponding new first transmission data stream, and the caching of the resources of the second target file to be downloaded is stopped, and the uncached part is loaded and sent to the client through the corresponding new first transmission data stream.

7. The method according to claim 5, further comprising: Receiving an activation message sent by the client via an activation data stream; When it is determined that data interaction with the client is possible, a confirmation message is fed back to the client.

8. The method according to claim 5, wherein The step of loading resources of each file to be downloaded according to the identifier and sequence of each file to be downloaded includes: The resources of the files to be downloaded are loaded in batches according to the identifiers and sequence of the files to be downloaded, wherein the number of the batch-loaded files to be downloaded is determined according to the number of transmission data streams that are transmitting the resources of the files to be downloaded.

9. The method according to any one of claims 5 to 8, further comprising: Receive a download cancellation instruction for a third target file to be downloaded sent by the client through the control data stream, cancel resource loading of the third target file to be downloaded, or delete the resource of the third target file to be downloaded from the local cache.

10. A batch file downloading device, applied to a client, comprising: A stream creation module, configured to synchronously create a control data stream and a preset number of first transport data streams on a QUIC link pre-established with a server when a file download task is detected; An instruction sending module, configured to send a resource preparation instruction corresponding to the file download task to the server through the control data stream, wherein the resource preparation instruction includes identifiers and sequences of multiple files to be downloaded; The request sending module is configured to send, to the server side, download requests containing identifiers of first target files to be downloaded via the first transmission data streams in the order of the files to be downloaded in the resource preparation instructions, while the instruction sending module sends the resource preparation instructions corresponding to the file download task to the server side; receive, via the first transmission data stream, resources of the first target files to be downloaded corresponding to the download requests of the first transmission data stream returned by the server side; and close the first transmission data stream when the reception of the resources corresponding to the first target files to be downloaded is completed via the first transmission data stream; wherein, one transmission data stream is responsible for the transmission of one file; a transport stream creation module, configured to create a second transport data stream on the QUIC link upon receiving a ready message sent by the server after completing resource caching of a file to be downloaded; a transmission request sending module, configured to send a transmission request for the to-be-downloaded file corresponding to the ready message to the server via the second transmission data stream; The first resource receiving module is configured to receive the resource of the file to be downloaded corresponding to the preparation completion message transmitted from the server, and close the second transmission data stream when the resource is received.

11. A batch file downloading device, applied to a server, comprising: An instruction receiving module is configured to receive a resource preparation instruction sent by a client via a control data stream, wherein the resource preparation instruction includes the identifiers and order of multiple files to be downloaded; the server and the client pre-establish an Internet transport layer protocol QUIC connection; wherein, upon detecting a file download task, the client synchronously creates a control data stream and a preset number of first transport data streams on the QUIC link pre-established with the server; and, via the control data stream, sends the resource preparation instruction corresponding to the file download task to the server, and at the same time, according to the order of each file to be downloaded in the resource preparation instruction, sends a download request including the identifier of a first target file to be downloaded to the server via each of the first transport data streams; A resource preparation module is used to load resources of each file to be downloaded according to the identification and order of each file to be downloaded, and cache the loaded resources of the file to be downloaded locally; a file transfer module configured to receive a download request including an identifier of a first target file to be downloaded, sent by the client via each first transmission data stream; load resources of each first target file to be downloaded according to the identifier of the first target file to be downloaded; and send the resources of the first target file to be downloaded corresponding to the download request of the first transmission data stream loaded to the client via the first transmission data stream, wherein one transmission data stream is responsible for the transmission of one file; A message sending module, configured to send a ready message to the client upon completion of resource caching of a file to be downloaded; a transmission request receiving module, configured to receive a transmission request sent by the client via a second transmission data stream; The resource transmission module is used to send the resource of the file to be downloaded corresponding to the transmission request that is cached in the local cache to the client through the second transmission data stream, and delete the resource of the file to be downloaded corresponding to the transmission request from the local cache.

12. An electronic device comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 9.

13. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1 to 9.

14. A computer program product comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • File transmission method and device, electronic equipment, medium and product

    CN114172998A

  • Data transmission method and device, electronic equipment and storage medium

    CN115134553A