File downloading method and device, storage medium and electronic equipment

By sending file download requests to the server in the team instant messaging application and downloading file fragments from other clients, the problem of slow file download speeds is solved and more efficient file downloads are achieved.

CN119316432APending Publication Date: 2025-01-14TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310875996.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-07-14
Publication Date
2025-01-14

AI Technical Summary

Technical Problem

In the prior art, file download speed is slower, especially when the file size to be downloaded is larger.

Method used

By sending a file download request to the server, the server returns the client query results, and the client downloads file fragments from other clients based on the results, thereby realizing file downloading.

Benefits of technology

This method effectively increases the file download speed, reduces the operating burden on the server, and avoids download speed limitations caused by external network bandwidth bottlenecks between the server and the client.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119316432A_ABST
    Figure CN119316432A_ABST
Patent Text Reader

Abstract

The invention discloses a file downloading method and device, a storage medium and electronic equipment, and the method is applied to a first client side and comprises the steps that a file downloading request is sent to a server, and the file downloading request carries a file identifier of a to-be-downloaded file and a first client side identifier of the first client side; the file downloading request is used for indicating to return a client query result corresponding to the file identifier to the first client, the client query result comprises at least one second client identifier, and a second client corresponding to the second client identifier and the first client access the same target network; determining at least one target client from the second clients according to the returned second client identifier; determining at least one target file fragment corresponding to the to-be-downloaded file in each target client; and the corresponding target file fragment is downloaded from the target client, so that the client does not need to download the file from the server, the operation burden of the server is reduced, and the file downloading speed is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of computer technology, and in particular, relates to a file downloading method, device, storage medium and electronic device. Background Art

[0002] Team instant messaging applications usually support a file download function, that is, the file is stored in the background server of the team instant messaging application. When a user needs the file, the user can request the background server to download the file through the team instant messaging client to obtain the file.

[0003] Currently, a client usually uses the Hyper Text Transfer Protocol (HTTP) to request a server to download a file, but when the size of the file to be downloaded is large, the download speed of the file is slow. Summary of the invention

[0004] The present application aims to solve at least one of the technical problems existing in the prior art. To this end, the present application proposes a file downloading method, device, storage medium and electronic device, which can effectively improve the download speed of files.

[0005] In a first aspect, the present application provides a file downloading method, which is applied to a first client, where the first client runs in a first terminal device, and the file downloading method includes:

[0006] Sending a file download request to a server, the file download request carrying a file identifier of a file to be downloaded and a first client identifier of the first client, the file download request being used to instruct to return a client query result corresponding to the file identifier to the first client, the client query result including at least one second client identifier, and a second client corresponding to the second client identifier and the first client are connected to the same target network;

[0007] Determine at least one target client from the second clients according to the returned second client identifier;

[0008] Determine at least one target file segment corresponding to the file to be downloaded in each of the target clients;

[0009] Download the corresponding target file segment from the target client to download the file to be downloaded.

[0010] In a second aspect, the present application provides a file downloading method, which is applied to a second client, where the second client runs in a second terminal device, and the file downloading method includes:

[0011] receiving a segment download instruction sent by a first client, wherein the segment download instruction carries at least one target segment identifier and is used to instruct to return a target file segment corresponding to the at least one target segment identifier to the first client, and the first client and the second client are connected to the same target network;

[0012] According to each target fragment identifier of the at least one target fragment identifier, determining the corresponding target file fragment from the file to be downloaded, wherein all the target file fragments include part or all of the file to be downloaded;

[0013] Generate a data packet according to the target file fragments, and send the data packet to the first client, so that the first client downloads the file to be downloaded.

[0014] In a third aspect, the present application provides a file downloading method, which is applied to a server, and the file downloading method includes:

[0015] Receive a file download request sent by a first client, where the file download request carries a file identifier of a file to be downloaded and a first client identifier of the first client;

[0016] According to the file download request, searching a preset database for at least one second client identifier corresponding to the file identifier and the first client identifier, wherein the second client corresponding to the second client identifier and the first client are connected to the same target network;

[0017] A client query result is generated according to the at least one second client identifier, and the client query result is sent to the first client, so that the first client downloads the file to be downloaded according to the client query result.

[0018] In a fourth aspect, the present application provides a file downloading apparatus, which is applied to a first client, where the first client runs in a first terminal device, and the file downloading apparatus includes:

[0019] a sending module, configured to send a file download request to a server, wherein the file download request carries a file identifier of a file to be downloaded and a first client identifier of the first client, wherein the file download request is used to instruct to return a client query result corresponding to the file identifier to the first client, wherein the client query result includes at least one second client identifier, and a second client corresponding to the second client identifier and the first client are connected to the same target network;

[0020] a determination module, configured to determine at least one target client from the second clients according to the returned second client identifier;

[0021] A fragmentation module, used to determine at least one target file fragment corresponding to the file to be downloaded in each target client;

[0022] The download module is used to download the corresponding target file segment from the target client to download the file to be downloaded.

[0023] In some embodiments, the sharding module is specifically used to:

[0024] Divide the file to be downloaded into at least one file segment, and obtain the total number of the at least one file segment;

[0025] Determine the number of shards corresponding to each target client according to the number of the target clients and the total number;

[0026] A portion or all of the file slices equal to the number of the slices are determined from the at least one file slice as target file slices for the corresponding target client.

[0027] In some embodiments, the file downloading device further includes an updating module, which is used to:

[0028] receiving a first client update notification forwarded by the target client, where the first client update notification is used to indicate that downloading of a first file segment from a third client in the target network is allowed, and the file to be downloaded includes the first file segment;

[0029] According to the update notification of the first client, detecting the target file segment that is not currently downloaded;

[0030] If the target file segments that are not currently downloaded include the first file segment, the first file segment is downloaded from the third client.

[0031] In some embodiments, the download module is further used to:

[0032] When the download of the current target file segment is completed, the current target file segment is used as the second file segment;

[0033] generating a second client update notification according to the second file segment and the first client identifier, where the second client update notification is used to indicate that other clients in the target network are allowed to download the second file segment from the first client;

[0034] The second client update notification is sent to the target client, so that the target client forwards the second client update notification to other recorded clients in the target network except the first client.

[0035] In some embodiments, the download module is used to:

[0036] Determine a target segment identifier for each target file segment in the at least one target file segment;

[0037] Generate a segment download instruction according to all the target segment identifiers, and send the segment download instruction to the corresponding target client, wherein the segment download instruction is used to instruct to return the at least one target file segment to the first client;

[0038] A data packet returned by the target client is received, where the data packet includes the at least one target file segment.

[0039] In some embodiments, the download module is further used to:

[0040] Merging the downloaded target file segments;

[0041] When all the target files are merged, generating file reporting information according to the first client identifier and the file identifier;

[0042] The file reporting information is sent to the server, so that the first client identifier and the file identifier are stored in association in a preset database in the server.

[0043] In some embodiments, the client query result also includes file verification information corresponding to the file identifier, and the determination module is used to:

[0044] Generate a download authorization request according to the file verification information, where the download authorization request is used to indicate that the first client is granted permission to download the file to be downloaded;

[0045] sending the download authorization request to the corresponding second client according to the returned second client identifier, so that the second client returns a corresponding authorization result according to the download authorization request;

[0046] When the returned authorization result indicates that downloading of the file to be downloaded is allowed, the corresponding second client is used as the target client.

[0047] In a fifth aspect, the present application provides a file downloading apparatus, which is applied to a second client, where the second client runs in a second terminal device, and the file downloading apparatus includes:

[0048] A receiving module, configured to receive a fragment download instruction sent by a first client, wherein the fragment download instruction carries at least one target fragment identifier and is configured to instruct to return a target file fragment corresponding to the at least one target fragment identifier to the first client, wherein the first client and the second client are connected to the same target network;

[0049] A determination module, configured to determine the corresponding target file segment from the file to be downloaded according to each target segment identifier in the at least one target segment identifier, wherein all the target file segments include part or all of the file to be downloaded;

[0050] The sending module is used to generate a data packet according to the target file fragments, and send the data packet to the first client, so that the first client downloads the file to be downloaded.

[0051] In some embodiments, the sending module is specifically used for:

[0052] If the number of all the target file segments is less than or equal to a preset threshold, generating a data packet corresponding to all the target file segments;

[0053] If the number of all the target file fragments is greater than the preset threshold, detecting all recorded clients in the target network except the first client and requesting the second client to download the file to be downloaded;

[0054] Determine the total number of times each of the target file segments has been downloaded in the recorded client;

[0055] Determining the download order of the target file segments according to the total number of downloads;

[0056] A plurality of sub-data packets corresponding to all the target file segments are generated according to the downloading order, and each of the sub-data packets includes at least one target file segment.

[0057] In some embodiments, the sending module is used to:

[0058] According to the order of the total number of downloads from small to large, the download order of the target file segments is set from early to late.

[0059] In some embodiments, the file downloading device further includes a forwarding module, which is used to:

[0060] receiving a first client update notification sent by a third client, where the first client update notification is used to indicate that downloading of a first file segment from the third client in the target network is allowed, and the file to be downloaded includes the first file segment;

[0061] The first client update notification is forwarded to the other recorded clients except the third client in the target network.

[0062] In some embodiments, the forwarding module is further configured to:

[0063] After receiving the first client update notification sent by the third client, detecting the target file segment that is not currently sent;

[0064] If the target file segments that are not currently sent include the first file segment, the first file segment is deleted from the target file segments that are not currently sent.

[0065] In some embodiments, the forwarding module is further configured to:

[0066] receiving a second client update notification sent by the first client, where the second client update notification is used to indicate that downloading of a second file segment from the first client is allowed, and the target file segment includes the second file segment;

[0067] The second client update notification is forwarded to the other recorded clients except the first client in the target network.

[0068] In some embodiments, the receiving module is further configured to:

[0069] Before receiving the segment download instruction sent by the first client, receiving a download authorization request sent by the first client, the download authorization request carrying file verification information corresponding to the file identifier of the file to be downloaded and used to indicate that the first client is granted permission to download the file to be downloaded;

[0070] Generate a file verification instruction corresponding to the file verification information according to the download authorization request, and send the file verification instruction to the server, wherein the file verification instruction is used to instruct to return a verification result corresponding to the file to be downloaded to the second client;

[0071] An authorization result is generated according to the returned verification result, and the authorization result is sent to the first client, so that the first client determines the target client according to the authorization result.

[0072] In some embodiments, the receiving module is used to:

[0073] When the returned verification result indicates that the verification is successful, generating an authorization result indicating that downloading of the file to be downloaded is allowed;

[0074] When the returned verification result indicates that the verification fails, an authorization result indicating that downloading of the file to be downloaded is not allowed is generated.

[0075] In some embodiments, the receiving module is further configured to:

[0076] When the returned verification result indicates that the verification is successful, the first client is regarded as a recorded client requesting to download the file to be downloaded.

[0077] In a sixth aspect, the present application provides a file downloading device, which is applied to a server, and the file downloading device includes:

[0078] A receiving module, configured to receive a file download request sent by a first client, wherein the file download request carries a file identifier of a file to be downloaded and a first client identifier of the first client;

[0079] a search module, configured to search, according to the file download request, from a preset database for at least one second client identifier corresponding to the file identifier and the first client identifier, wherein the second client corresponding to the second client identifier and the first client are connected to the same target network;

[0080] The sending module is used to generate a client query result according to the at least one second client identifier, and send the client query result to the first client, so that the first client downloads the file to be downloaded according to the client query result.

[0081] In some embodiments, the sending module is specifically used for:

[0082] Generate corresponding file verification information according to the file identifier;

[0083] A client query result is generated according to the at least one second client identifier and the file verification information.

[0084] In some embodiments, the sending module is further used to:

[0085] Receiving a file verification instruction sent by the second client, wherein the file verification instruction carries target file verification information;

[0086] A verification result corresponding to the file to be downloaded is generated according to the target file verification information and the file verification information, and the verification result is sent to the second client, so that the second client generates an authorization result according to the verification result.

[0087] In some embodiments, the sending module is further used to:

[0088] Receiving file reporting information sent by the first client, the file reporting information including the first client identifier and the file identifier;

[0089] The first client identifier and the file identifier are associated and stored in the preset database.

[0090] In a seventh aspect, the present application provides a non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that when the computer program is executed by a processor, it implements any of the file downloading methods described above.

[0091] In an eighth aspect, the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements any of the file downloading methods described above when executing the program.

[0092] The file download method, device, storage medium and electronic device provided by the embodiments of the present application send a file download request to a server, the file download request carries the file identifier of the file to be downloaded and the first client identifier of the first client, the file download request is used to indicate to return the client query result corresponding to the file identifier to the first client, the client query result includes at least one second client identifier, and the second client corresponding to the second client identifier and the first client are connected to the same target network; according to the returned second client identifier, at least one target client is determined from the second client; at least one target file segment corresponding to each target client is determined from the file to be downloaded; the corresponding target file segment is downloaded from the target client to download the file to be downloaded, so that the client does not need to download the file from the server, which reduces the operating burden of the server, and the file download speed will not be affected by the bandwidth bottleneck of the external network between the server and the client, which is conducive to improving the file download speed. BRIEF DESCRIPTION OF THE DRAWINGS

[0093] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, in which:

[0094] Figure 1 It is a schematic diagram of an application scenario of the file downloading method provided in an embodiment of the present application;

[0095] Figure 2 It is a flowchart of a file downloading method provided in an embodiment of the present application;

[0096] Figure 3 It is a schematic diagram of the framework structure of the file downloading system provided in the embodiment of the present application;

[0097] Figure 4 It is a schematic diagram showing a resource sharing interface provided in an embodiment of the present application;

[0098] Figure 5 yes Figure 3 Schematic diagram of file segment transmission between clients;

[0099] Figure 6 It is a flowchart of another file downloading method provided in an embodiment of the present application;

[0100] Figure 7 yes Figure 3 Schematic diagram of the interaction process between the server, the first client A and the second client B1;

[0101] Figure 8 It is a flowchart of another file downloading method provided in an embodiment of the present application;

[0102] Fig. 9 It is a structural diagram of a file downloading device provided in an embodiment of the present application;

[0103] Fig.10 is a structural diagram of another file downloading device provided in an embodiment of the present application;

[0104] Fig.11 is a structural diagram of another file downloading device provided in an embodiment of the present application;

[0105] Fig.12 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application;

[0106] Fig.13 It is a schematic diagram of the hardware structure of the electronic device provided in the embodiment of the present application. DETAILED DESCRIPTION

[0107] The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present application, and cannot be understood as limiting the present application.

[0108] The following is an introduction to some of the nouns involved in this application:

[0109] Client: refers to the client corresponding to any application that supports resource downloading, which runs on the terminal device. Users can communicate with other devices (such as servers or terminal devices) through the client running on the terminal device, such as accessing services or data provided by other devices.

[0110] File: refers to a resource content that can be read from a device, or other resource content that can be displayed on a computer device. The file type can be a combination of one or more images, audio, video, text, emoticons, etc. For example, the client can read from the device through a special program interface and display it in the client according to the user's needs.

[0111] Intranet: Also known as Local Area Network (LAN), it refers to a network consisting of multiple computers and network devices in a certain area, such as a campus network, government network, etc. A LAN is a closed type, which can be composed of two computers in an office or thousands of computers in a company. A LAN is generally used for communication between computers within the LAN.

[0112] Extranet: Also known as wide area network or public network, it is a long-distance network that connects local area networks or metropolitan area networks in different regions. It usually spans a large physical range, ranging from tens of kilometers to thousands of kilometers. It can connect multiple regions, cities and countries, or span several states and provide long-distance communications, forming an international long-distance network.

[0113] Peer-to-peer transmission: It can also be called peer-to-peer Internet technology. It means that it relies on the computing power and bandwidth of each node (device) in the participating network (such as the intranet) to provide services for the participating nodes, rather than concentrating all the dependencies on a few servers. In the peer-to-peer transmission network structure, each node (peer) is both a provider of resources (services and content) and a resource acquirer. Taking the download in peer-to-peer transmission as an example, when device A and device B are both participating devices in the same local area network, and device B stores a shared file, then device A can directly request the shared file from device B, without requesting the shared file from a few servers, so as to improve network transmission efficiency.

[0114] Embodiments of the present application provide a file downloading method, device, storage medium and electronic device.

[0115] See also Figure 1 , Figure 1 : This is a schematic diagram of an application scenario of the file download method provided in an embodiment of the present application. The application scenario includes multiple terminal devices and a server. A client is installed in each terminal device. Multiple terminal devices are connected to the same intranet, and the terminal devices and the server communicate through an external network. The client can be a pre-installed client, a web version of the client, or a client embedded in a third-party application. This application does not limit the specific type of the client. The client can be a client of an instant messaging application, such as a client of a team instant messaging application, and the server is a background server corresponding to the instant messaging application.

[0116] Among them, the terminal device can be referred to as the terminal for short. The terminal device can be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, etc., but is not limited to this. The terminal device and the server can be directly or indirectly connected via wired or wireless communication, and this application does not limit this. The server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDN), and big data and artificial intelligence platforms.

[0117] exist Figure 1 In the figure, multiple terminal devices 110-1, 110-2 and 110-3, and multiple clients 111-1, 111-2 and 111-3 are taken as an example, and these clients are clients of a team instant messaging application, and the server 120 is the background server of the team instant messaging application. There is no specific limit on the number of terminal devices and clients.

[0118] Among them, a user can upload a shared file to the server 120 through his corresponding client. After the server 120 obtains the shared file, it can store the shared file. For example, the server 120 can store the shared file in a preset database, which can be set in the server 120, or stored in other storage devices accessible to the server 120. The server 120 can further share the file information (metadata) of the shared file with the clients of other users in the team in the form of messages, so that the clients of other users can display the file information of the shared file, so that other users can perform corresponding operations on the shared file, such as viewing operations, downloading operations, previewing operations, online editing operations or forwarding operations.

[0119] For example, when a user needs to download the shared file, the user can perform a file download operation on client 111-1. Client 111-1 sends a file download request to server 120 in response to the file download operation. Server 120 returns a client query result according to the file download request. The client query result may include at least one client identifier. Client 111-1 can download the shared file from one or more other clients in the form of file segments according to the client query result. For example, if the client query result includes the client identifiers of clients 111-2 and 111-3, client 111-1 can download different file segments of the shared file from clients 111-2 and 111-3. The specific content of downloading a shared file will be introduced below.

[0120] In an embodiment of the present application, a point-to-point transmission method is introduced when downloading a shared file, wherein the server can provide the client (e.g., the first client) that needs to download the shared file with the client query results of other clients (e.g., the second client) that can support the download service of the shared file based on the ownership of the shared file by each user in the same intranet within the team. The first client downloads the shared file from the second client based on the client query results. Therefore, on the one hand, the first client does not need to download the shared file from the server, which reduces the operating burden of the server, and the download speed will not be affected by the bandwidth bottleneck of the external network between the server and the client. On the other hand, if there are multiple second clients, the first client can further set an appropriate number of file fragments for different second clients through file fragmentation and download them synchronously, which is conducive to improving the download speed.

[0121] It should be noted that Figure 1 The application scenario shown is only an example of the application scenario of the file download method involved in the embodiment of the present application, and does not actually limit the application scenario of the file download method involved in the embodiment of the present application.

[0122] based on Figure 1 The following describes the file download method provided by the embodiment of the present application. Figure 2 and Figure 3 , Figure 2 is a flowchart of a file downloading method provided in an embodiment of the present application, Figure 3 201 to 204, wherein:

[0123] 201. Send a file download request to a server, where the file download request carries a file identifier of a file to be downloaded and a first client identifier of the first client, where the file download request is used to indicate that a client query result corresponding to the file identifier is returned to the first client, where the client query result includes at least one second client identifier, and a second client corresponding to the second client identifier and the first client are connected to the same target network.

[0124] The target network mainly refers to the intranet (local area network), which can be a network composed of hundreds or even thousands of computers in the same company. The devices in the target network can communicate with each other through the target network. Figure 3In the example, the file download system includes multiple clients, such as a first client A, second clients B1 and B2, and third clients C1 and C2. These clients can be run in different terminal devices and access the same target network. These clients can communicate with each other through the target network. The file download system also includes a server. Each client in the target network can communicate with the server through an external network via a network module (such as a router).

[0125] The file to be downloaded may be any file displayed on the user interface of the first client. The first client may be a client of a team instant messaging application. The user interface may be an interface in the team instant messaging application, such as a resource sharing interface in the team instant messaging application. For example, see Figure 4 , Figure 4 It is a display schematic diagram of the resource sharing interface provided by the embodiment of the present application, wherein the resource sharing interface can provide associated display information of multiple resource groups, for example, the resource groups include groups A to E, each resource group includes multiple resources, and the resources in group A can include the file to be downloaded. The associated display information may include information such as the file name, file uploader, file upload time and file size of the resources in each resource group, and may also provide buttons for downloading, viewing, previewing, online editing or forwarding for each resource. When the user clicks the download button of the file to be downloaded, the first client can generate and send a request to download the file to the server.

[0126] The file identifier (e.g., fid) is used to identify the file, which can be a string assigned by the server to each file. The client identifier (e.g., the first client identifier and the second client identifier) ​​is used to uniquely identify the link address of the client. The client identifier (e.g., vid) can include the network IP address of the terminal device where the client is located, the MAC address of the terminal device, and the port of the client on the terminal device. The file identifier and the client identifier can be stored in Figure 3 In the file status table and target network file status table shown, the file status table can store the records of each uploaded file in the entire Internet, such as the file identification, file name, uploader, upload time, file size, and downloader information of the uploaded file, and the target network file status table can store the records of each uploaded file in the target network, such as file identification, file name, which client in the target network uploaded the uploaded file, which clients in the target network have downloaded the uploaded file, and so on.

[0127] It should be explained that when the server receives a file download request sent by the first client, it will first search for the record of the file to be downloaded from the target network participated by the first client, such as mainly searching from the above-mentioned target network file status table. Once it is found that there are one or more second clients in the target network that have the file to be downloaded, for example, please continue to refer to the above Figure 3 , the local area network (target network) involved can be determined based on the network IP address in the client identifier, and the file records of other devices in the target network can be detected. If it is detected that the second clients B1 and B2 both have the file to be downloaded, the client query result generated by the server will include the client identifiers of the second clients B1 and B2, and then the result will be fed back to the first client, so that the first client can download the file to be downloaded from the second client through the target network. If no other client with the file to be downloaded is found in the target network, the server can directly send the file to be downloaded to the first client, so that the first client can download the file from the server through the external network. At the same time, if the first client is downloading the file through the target network, the user interaction interface can be used to prompt the user that the download operation is performed in the target network. For example, please continue to refer to Figure 4 , Figure 4 The text "LAN acceleration" can be displayed to remind the user that the download operation is performed in the local area network, and the network transmission speed during the download process can be further displayed in real time, such as "66MB / S".

[0128] 202. Determine at least one target client from the second clients according to the returned second client identifier.

[0129] Among them, the second client identification of the second client provided in the client query result is determined by the server based on the record of uploaded files in a preset database, and does not take into account the current real-time operating status of the second client. For example, some second clients may currently be in a shutdown state or unable to communicate with the outside world. At this time, the first client needs to further confirm which second clients can download files.

[0130] For example, in some embodiments, the client query result may further include file verification information corresponding to the file identifier, and the above step 202 may specifically include:

[0131] Generate a download authorization request according to the file verification information, where the download authorization request is used to indicate that the first client is granted permission to download the file to be downloaded;

[0132] Sending the download authorization request to the corresponding second client according to the returned second client identifier, so that the second client returns a corresponding authorization result according to the download authorization request;

[0133] When the returned authorization result indicates that downloading of the file to be downloaded is allowed, the corresponding second client is used as the target client.

[0134] Among them, the file verification information is also a temporary identity token (token), and the server can generate a corresponding token for each file. The first client can traverse and query each second client in the client query result by sending a download authorization request carrying a token. If the second client is currently in a communication state, an authorization result will be returned as a response information based on the token sent by the first client. The authorization result may include two situations, one is to indicate that the file to be downloaded is allowed to be downloaded, and the other is to indicate that the file to be downloaded is not allowed to be downloaded. When the authorization result indicates that the file to be downloaded is allowed to be downloaded, the first client can download it. If the second client is currently in a state where it cannot communicate, such as a shutdown state, the first client will not receive the response information of the second client. In this regard, when the first client does not receive a response message within a period of time, it defaults to receiving the authorization result of the second client as not allowing the file to be downloaded.

[0135] 203. Determine at least one target file segment corresponding to the file to be downloaded in each target client.

[0136] The first client may download the file to be downloaded in a fragmented manner, and may determine the fragmentation strategy according to the number of target clients and actual operating conditions.

[0137] For example, in some embodiments, the above step 203 may specifically include:

[0138] Divide the file to be downloaded into at least one file segment, and obtain the total number of the at least one file segment;

[0139] Determine the number of shards corresponding to each target client according to the number of the target clients and the total number;

[0140] A portion or all of the file slices equal in number to the at least one file slice are determined from the at least one file slice as target file slices for the corresponding target client.

[0141] Among them, if the size of the file to be downloaded is relatively small, such as less than or equal to a preset value (for example, 2M), it can be directly used as a file fragment. If the size of the file to be downloaded is relatively large, such as greater than a preset value, it can be fragmented according to a fixed size (for example, 2M) to obtain multiple file fragments. If there is only one target client, all file fragments can be used as the target file fragments of the target client. If there are multiple target clients, the corresponding number of fragments can be further determined according to the operation status of each target client. For example, for a target client with a larger bandwidth or a better network status, the number of fragments set can be more, and for a target client with a smaller bandwidth or a relatively poor network status, the number of fragments set can be less. At this time, the first client needs to further detect the network operation status of the target client. After the number of fragments is determined, file fragments with the same number of fragments can be randomly specified from the file fragments in the file to be downloaded as the target file fragments that need to be obtained from the corresponding second client.

[0142] For example, see above Figure 3 If the file to be downloaded can be divided into 1-100 file segments, and the second clients B1 and B2 have both granted the first client A file download permission, then B1 and B2 can both be target clients, and if the network status of B1 and B2 are both good, the number of their segments can be set to 50. At this time, the first client can randomly determine 50 target file segments for B1 and B2 respectively. For example, the target file segments corresponding to B1 can be file segments 1-50, and the target file segments corresponding to B2 can be file segments 51-100.

[0143] 204. Download the corresponding target file segment from the target client to download the file to be downloaded.

[0144] Among them, if there is only one target file segment, the first client can download it directly. If the target file segment is multiple, the first client can randomly select multiple segments for download through parallel downloading. The target file segments downloaded each time can be from the same target client or from different target clients, and there is no restriction here.

[0145] In some embodiments, the above step 204 may specifically include:

[0146] Determine a target segment identifier for each target file segment in the at least one target file segment;

[0147] Generate a segment download instruction according to all the target segment identifiers, and send the segment download instruction to the corresponding target client, where the segment download instruction is used to instruct to return the at least one target file segment to the first client;

[0148] A data packet returned by the target client is received, where the data packet includes the at least one target file segment.

[0149] Among them, the target fragment identifier can be considered as the starting and ending position of the target file fragment in the file to be downloaded. The target fragment identifier can be used to find the file to be downloaded where the target file fragment is located, as well as its starting and ending positions in the file to be downloaded. When the target client grants the first client the permission to download the file to be downloaded, the first client can subsequently obtain the corresponding target file fragment from the target client once or multiple times by sending a fragment download instruction. For example, if it is necessary to obtain all target file fragments from the target client at one time, a fragment download instruction is sent once, and the fragment download instruction carries the target fragment identifiers of all target file fragments. Accordingly, the target client only returns one data packet, which includes all target file fragments. If it is necessary to obtain all target file fragments from the target client multiple times, multiple fragment download instructions are sent successively, and each fragment download instruction sent only carries the target fragment identifiers of some target file fragments. Accordingly, the target client will return multiple sub-data packets, each of which only includes the target file fragments specified by the corresponding fragment download instruction, and all sub-data packets are the above-mentioned data packets.

[0150] Furthermore, the first client may merge all target file segments after downloading them to obtain a complete file to be downloaded, or may merge them while downloading, thereby improving the file download speed. After merging to obtain a complete file to be downloaded, it is necessary to further report it to the server for recording. That is, in the above step of "downloading the corresponding target file segments from the target client", the file download method may further include:

[0151] Merge the downloaded fragments of the target file;

[0152] When all the target files are merged, file reporting information is generated according to the first client identifier and the file identifier;

[0153] The file reporting information is sent to the server, so that the first client identifier and the file identifier are stored in association in a preset database in the server.

[0154] Among them, sparse files (the content is all 0 bytes, but does not occupy any space, only the real data blocks will be written to the disk as is) can be used to allocate space for the files to be downloaded in advance. Different file fragments are stored in different positions of the sparse file, and non-sequential fragment merging is supported, so that merging can be done while downloading. When all file fragments are downloaded, the merging is basically completed, which does not take up merging time and greatly improves the file download speed.

[0155] When the first client completes the download operation of the file to be downloaded, it can generate file reporting information to inform the server that it already has the file to be downloaded, so as to update the record status of the file to be downloaded in the server, such as mainly updating the above Figure 3 The file status table in and the target network file status table.

[0156] In addition, considering that each target client can provide download services for the file to be downloaded to multiple other clients in the target network at the same time, and based on the point-to-point transmission mode, each client can serve as both a resource provider (download source) and a resource downloader, during the process of the first client downloading the file to be downloaded, the file downloading method can also include:

[0157] receiving a first client update notification forwarded by the target client, where the first client update notification is used to indicate that downloading of a first file segment from a third client in the target network is allowed, and the file to be downloaded includes the first file segment;

[0158] According to the update notification of the first client, detecting the target file segment that is not currently downloaded;

[0159] If the target file segments that are not currently downloaded include the first file segment, the first file segment is downloaded from the third client.

[0160] Among them, the above-mentioned third client is a client that owns some file segments of the file to be downloaded, and can be considered as a temporary source. The above-mentioned first client is a client that needs to download the file to be downloaded, and can be considered as a downloader. The above-mentioned target client is a client that owns the complete content of the file to be downloaded, and can be considered as a download source. The file segments downloaded by different downloaders from the same download source may be completely identical, different, or partially identical.

[0161] For example, please continue to see Figure 3 and Figure 5 , Figure 5 yes Figure 3 Schematic diagram of transmission of file segments between clients in , assuming that target clients (i.e., the second client that grants the first client file downloading authority) B2 and B1 both provide download service for the file to be downloaded to the first client A, and target clients B1 and B2 simultaneously provide download service for the file to be downloaded to the third clients C1 and C2, then the target clients B2 and B1 are the download sources of the file to be downloaded, the first client A, the third clients C1 and C2 are the downloaders, and the first client A, the third clients C1 and C2 can serve as temporary sources of some file segments for each other.

[0162] That is, for the first client A, each time the third clients C1 and C2 download any file segment (that is, the first file segment) in the file to be downloaded, they can act as the resource provider (temporary source) of the first file segment to provide download services for the first client A. The third clients C1 and C2 can inform the first client A of the message through the target clients B1 and B2 by notification (that is, generating the first client update notification). For example, for the third client C1, when it downloads the first file segment, it can generate a first client update notification for the first file segment and send it to the target clients B1 and B2, so that the notification can be forwarded to other downloaders A and C2 except itself through the target clients B1 and B2. After receiving the notification, if other downloaders detect that they have not downloaded the first file segment, for example, the first client A finds that it has not downloaded the first file segment, then the first client A can download from the third client C1 instead of from the target clients B1 and B2, which is equivalent to the third client C1 acting as a temporary source for the downloader A.

[0163] In addition, please continue to see Figure 5 It is easy to understand that, in addition to other downloaders C1 and C2 being able to serve as temporary sources for the first client A, the first client A can also serve as a temporary source for other downloaders C1 and C2, that is, in the above step of "downloading the corresponding target file segment from the target client", the file downloading method can also include:

[0164] When the download of the current target file segment is completed, the current target file segment is used as the second file segment;

[0165] Generate a second client update notification according to the second file segment and the first client identifier, where the second client update notification is used to indicate that other clients in the target network are allowed to download the second file segment from the first client;

[0166] The second client update notification is sent to the target client, so that the target client forwards the second client update notification to other recorded clients in the target network except the first client.

[0167] The other recorded clients are downloaders other than the first client that request to download the file to be downloaded from the target client, such as the Figure 5The third clients C1 and C2 request to download the file to be downloaded from the target client B1. When the first client A downloads any target file segment (that is, the second file segment mentioned above), the second client update notification mentioned above can be generated and sent to the target clients B1 and B2, so as to be forwarded to other downloaders via the target clients B1 and B2, thereby informing other downloaders that they can download the second file segment from the first client A. After receiving the notification, if other downloaders detect that they have not downloaded the second file segment, for example, if the third client C1 finds that it has not downloaded the second file segment, then the third client C1 can download it from the first client A instead of from the target clients B1 and B2, which is equivalent to the first client A serving as a temporary source for the downloader C1.

[0168] It should be emphasized that through the above-mentioned segmented downloading method, the number of clients (temporary sources) that can provide the same download service can be continuously increased during the download process of the file to be downloaded, and the phenomenon of multiple downloaders in the target network concentrating on downloading files to the same download source can be avoided as much as possible, which affects the normal operation of the download source. The download speed of each downloader can also become faster as the number of temporary sources continues to increase, effectively improving the file download rate.

[0169] As can be seen from the above, the file download method provided in the embodiment of the present application is applied to the first client, by sending a file download request to the server, the file download request carries the file identifier of the file to be downloaded and the first client identifier of the first client, the file download request is used to indicate the return of the client query result corresponding to the file identifier to the first client, the client query result includes at least one second client identifier, the second client corresponding to the second client identifier and the first client are connected to the same target network; according to the returned second client identifier, at least one target client is determined from the second client; at least one target file segment corresponding to the file to be downloaded in each target client is determined; the corresponding target file segment is downloaded from the target client to download the file to be downloaded, so that the client does not need to download the file from the server, which reduces the operating burden of the server, and the file download speed will not be affected by the bandwidth bottleneck of the external network between the server and the client, and the client can download files from other clients through a flexible segment download method, which is conducive to improving the file download speed.

[0170] According to the method described in the above embodiment, the present application embodiment also provides another file download method, see Figure 6 , Figure 6301-303 is a flowchart of another file download method provided in an embodiment of the present application. The file download method can be applied to a second client, which is one of the target clients that grant the first client file download permission. The second client runs in a second terminal device. The method specifically includes the following steps 301-303, wherein:

[0171] 301. Receive a segment download instruction sent by a first client, the segment download instruction carries at least one target segment identifier and is used to instruct to return a target file segment corresponding to the at least one target segment identifier to the first client, and the first client and the second client are connected to the same target network.

[0172] Among them, the fragment download instruction can carry the fragment identifiers of all file fragments in the file to be downloaded, that is, the target fragment identifier includes the fragment identifiers of all file fragments in the file to be downloaded, or it can only carry the fragment identifiers of some file fragments, which depends on the number of target clients and the fragmentation strategy of the first client (see the introduction in the above steps 202 and 203, which will not be repeated here).

[0173] For example, when the second client (i.e., the target client in the above embodiment) grants the first client file download permission, the first client can send a fragment download instruction to the second client to download some or all of the file fragments in the file to be downloaded. Figure 3 , the above Figure 5 and Figure 7 , Figure 7 yes Figure 3 Schematic diagram of the interaction process between the server, the first client A and the second client (target client) B1, wherein the second client B1 can directly send a segment download instruction to the first client A through the target network.

[0174] In some embodiments, before the above step 301, the file downloading method may further include the following steps:

[0175] receiving a download authorization request sent by the first client, the download authorization request carrying file verification information corresponding to the file identifier of the file to be downloaded and used to indicate that the first client is granted permission to download the file to be downloaded;

[0176] Generate a file verification instruction corresponding to the file verification information according to the download authorization request, and send the file verification instruction to the server, where the file verification instruction is used to instruct to return a verification result corresponding to the file to be downloaded to the second client;

[0177] An authorization result is generated according to the returned verification result, and the authorization result is sent to the first client, so that the first client determines the target client according to the authorization result.

[0178] Before the first client downloads the file segment, it needs to first ask the second client to authorize its download permission for the file to be downloaded. The granting process of the download permission needs to be completed with the help of the server. For example, please continue to refer to the above Figure 7 , the server can provide the first client A with the file verification information (token) corresponding to the file identifier. The first client can generate a download authorization request based on the file verification information (for details, see step 202 in the above embodiment) and send it to the second client B1. The second client B1 will generate a file verification instruction corresponding to the token and send it to the server for verification, and return the verification result. The second client B1 can further decide whether to grant the first client A file download permission based on the verification result, and generate a corresponding authorization result and feedback it to the first client A. About Figure 7 Other details are described in the following embodiments.

[0179] In some embodiments, the above step of "generating an authorization result according to the returned verification result" may specifically include:

[0180] When the returned verification result indicates that the verification is successful, an authorization result indicating that downloading of the file to be downloaded is allowed is generated;

[0181] When the returned verification result indicates that the verification has failed, an authorization result is generated indicating that downloading of the file to be downloaded is not allowed.

[0182] That is, when the verification result indicates that the verification is successful, the second client B1 will grant the first client A the permission to download the file to be downloaded, and will generate a corresponding authorization result and send it to the first client A to inform the first client A that it can start downloading the file segments.

[0183] In addition, when the returned verification result indicates that the verification is successful, the file download method may further include:

[0184] The first client is regarded as a recorded client that requests to download the file to be downloaded.

[0185] That is, the second client B1 will record each other client (that is, the recorded client) that is granted file download permission, and usually stores the client identifier of the client and the corresponding file identifier in association with each other. For example, when the second client B1 grants the above-mentioned first client A file download permission, the first client identifier of the first client A and the file identifier of the file to be downloaded can be stored in association with each other.

[0186] 302. According to each target segment identifier in the at least one target segment identifier, determine the corresponding target file segment from the file to be downloaded, and all the target file segments include part or all of the file to be downloaded.

[0187] The target segment identifier can be considered as the starting and ending positions of the target file segment in the file to be downloaded. The file to be downloaded where the target file segment is located and its starting and ending positions in the file to be downloaded can be found through the target segment identifier.

[0188] 303. Generate a data packet according to the target file segment, and send the data packet to the first client, so that the first client downloads the file to be downloaded.

[0189] The second client B1 may generate data packets for all target file segments at one time or in multiple times, depending on the data size of the target file segments. When generating data packets in multiple times, the second client (download source) may determine the order in which the target file segments are generated. For example, the above step of "generating data packets according to the target file segments" may specifically include:

[0190] If the number of all the target file segments is less than or equal to a preset threshold, a data packet corresponding to all the target file segments is generated;

[0191] If the number of all the target file segments is greater than the preset threshold, detecting all recorded clients in the target network, except the first client, that request the second client to download the file to be downloaded;

[0192] Determine the total number of times each target file segment has been downloaded in the recorded client;

[0193] Determine the download order of the target file segments according to the total number of downloads;

[0194] A plurality of sub-data packets corresponding to all the target file segments are generated according to the downloading sequence, and each sub-data packet includes at least one target file segment.

[0195] The preset threshold value can be set by the second client B1 according to its own network status. For example, the better the network status, the larger the preset threshold value can be. If the total number of target file segments required to be provided by the second client B1 is relatively small, such as 10, which is less than or equal to the preset threshold value, the data packets of these 10 segments can be generated at one time. If the total number of target file segments required to be provided by the second client B1 is relatively large, such as 50, which is greater than the preset threshold value, these 50 segments can be generated multiple times, that is, multiple sub-data packets are generated, and these sub-data packets are sent to the first client A multiple times. At the same time, in the process of generating sub-data packets multiple times, the second client B1 can set the generation order of the target file segments (that is, the download order of each target file segment in the first client A) according to the total number of times each target file segment has been downloaded by other downloaders in the target network.

[0196] In some embodiments, the above step of “determining the download order of the target file segments according to the total number of downloads” may specifically include:

[0197] According to the total number of downloads from small to large, the download order of the target file segments is set from early to late.

[0198] That is, the smaller the total number of downloads of the target file segment, the higher its download order, and the higher the priority of the first client to download the target file segment, so as to balance the download status of each file segment in the file to be downloaded as much as possible, so that more other downloaders can be used as temporary sources, maximize resource utilization, and improve file download speed. For example, please continue to refer to the above Figure 3 and Figure 5 If the file to be downloaded includes 1-100 file segments, the second client B1 needs to provide 50 of the file segments to the first client A, such as file segments 1-50 (that is, the above-mentioned target file segments), and finds that other downloaders, such as the third client C1, have downloaded file segments 1-20 of the 50 file segments, and the third client C2 has downloaded file segments 10-30 of the 50 file segments. It can be learned that the total number of downloads of file segments 11-20 of the target file segments is 2, the total number of downloads of file segments 1-10 and 21-30 is 1, and the total number of downloads of file segments 31-50 is 0. Then, in the order of the total number of downloads from small to large, the download order of file segments 31-50 takes precedence over file segments 1-10 and 21-30, and the download order of file segments 1-10 and 21-30 takes precedence over file segments 11-20.

[0199] Of course, if other downloaders have not downloaded these target file segments, for example, other downloaders and the first client A need to download completely different file segments from the second client B1, the second client B1 can randomly set the download order of these target file segments.

[0200] In addition, as described above, each client in the target network can be used as both a resource provider and a resource downloader. Therefore, in the process of the first client A downloading the file to be downloaded, the file downloading method can also include:

[0201] receiving a first client update notification sent by a third client, where the first client update notification is used to indicate that downloading of a first file segment from the third client in the target network is allowed, where the file to be downloaded includes the first file segment;

[0202] The first client update notification is forwarded to other recorded clients in the target network except the third client.

[0203] Please continue to refer to the above Figure 3 and Figure 5 For example, for the third client C1, when it finishes downloading the first file segment, it can generate a first client update notification for the first file segment and send it to other downloaders, such as the second client B1 and other second clients B2 in this embodiment, so as to forward the notification to other downloaders other than itself, such as A and C2, via the second clients B1 and B2.

[0204] Furthermore, after the second client receives the first client update notification sent by the third client, the file download method may further include:

[0205] Detect the target file segments that are not currently sent;

[0206] If the target file segments that are not currently sent include the first file segment, the first file segment is deleted from the target file segments that are not currently sent.

[0207] Among them, since other clients, such as the first client A, after receiving the notification, if they have not downloaded the first file segment, will give priority to the third client C1 as a temporary source to download the first file segment from it, rather than downloading it from the second client B1, in order to avoid repeated transmission of the first file segment in the target network, after receiving the notification, the second client B1 can adjust the content of the segment sent to the first client A. For example, if it is detected that the first file segment has not been sent to the first client A, the first file segment may not be sent as the target file segment subsequently.

[0208] In addition, during the process of the first client A downloading the file to be downloaded, the file downloading method may further include:

[0209] receiving a second client update notification sent by the first client, where the second client update notification is used to indicate that downloading of a second file segment from the first client is allowed, and the target file segment includes the second file segment;

[0210] The second client update notification is forwarded to other recorded clients in the target network except the first client.

[0211] Please continue to refer to the above Figure 3 and Figure 5 For example, when the first client A has downloaded any target file segment (that is, the second file segment mentioned above), the notification can be generated and sent to the second clients B1 and B2, so that the notification can be forwarded to other downloaders via the second clients B1 and B2, thereby informing other downloaders that they can download the second file segment from the first client A. At this time, the first client A becomes a temporary source.

[0212] It should be noted that other specific details of steps 301-303 in this embodiment have been described in detail in steps 201-204 in the previous embodiment and will not be repeated here.

[0213] As can be seen from the above, the file download method provided in the embodiment of the present application is applied to the second client, by receiving a segment download instruction sent by the first client, the segment download instruction carries at least one target segment identifier, and is used to indicate the return of the target file segment corresponding to the at least one target segment identifier to the first client, and the first client and the second client are connected to the same target network; according to each target segment identifier in the at least one target segment identifier, the corresponding target file segment is determined from the file to be downloaded, and all the target file segments include part or all of the file to be downloaded; a data packet is generated according to the target file segment, and the data packet is sent to the first client, so that the first client downloads the file to be downloaded, so that the client does not need to download the file from the server, which reduces the operating burden of the server, and the file download speed will not be affected by the bandwidth bottleneck of the external network between the server and the client, and the client can download files from other clients through a flexible segment download method, which is conducive to improving the file download speed.

[0214] According to the method described in the above embodiment, the present application embodiment also provides another file download method, see Figure 8 , Figure 8 4 is a flow chart of another file downloading method provided in an embodiment of the present application. The file downloading method can be applied to a server. The method specifically includes the following steps 401-403, wherein:

[0215] 401. Receive a file download request sent by a first client, where the file download request carries a file identifier of a file to be downloaded and a first client identifier of the first client.

[0216] Please continue to refer to the above Figure 3 , Figure 5 and Figure 7 Any downloader in the target network who needs to download the file to be downloaded (such as the downloaders A, C1 and C2 mentioned above) can send a file download request to the server. For example, the first client A can send a file download request to the server by operating the user interaction interface (for details, please refer to the relevant introduction of 201 above).

[0217] 402. According to the file download request, search a preset database for at least one second client identifier corresponding to the file identifier and the first client identifier, wherein the second client corresponding to the second client identifier and the first client access the same target network.

[0218] The preset database can store records of all uploaded files, for example, Figure 3 The file status table in the target network and the file status table of the target network are recorded. When the server receives a file download request, it can be searched from the target network file status table and the target network file status table (for details, please refer to the description in the above step 201), so that the first client can subsequently download from other devices in the target network.

[0219] Of course, it is easy to understand that if the server does not find the second client that owns the file to be downloaded in the target network (that is, it is not found in the target network file status table), and only finds it in the file status table, the server can directly send the file to be downloaded to the first client, so that the first client can download the file from the server through the external network.

[0220] 403. Generate a client query result according to the at least one second client identifier, and send the client query result to the first client, so that the first client downloads the file to be downloaded according to the client query result.

[0221] If there is only one second client, the first client can download all the files to be downloaded from the second client. If there are multiple second clients, the first client can download the files to be downloaded from multiple second clients at the same time, and each second client can only download a part of the file segments.

[0222] In some embodiments, the above step of “generating a client query result according to the at least one second client identifier” may specifically include:

[0223] Generate corresponding file verification information according to the file identifier;

[0224] A client query result is generated according to the at least one second client identifier and the file verification information.

[0225] That is, please continue to refer to the above Figure 7 The client query result sent by the server may include file verification information (token) and the second client identifier.

[0226] In some embodiments, the file download method may further include:

[0227] Receive a file verification instruction sent by the second client, where the file verification instruction carries target file verification information;

[0228] A verification result corresponding to the file to be downloaded is generated according to the target file verification information and the file verification information, and the verification result is sent to the second client, so that the second client generates an authorization result according to the verification result.

[0229] That is, before the first client downloads the file segment, it is necessary to first ask the second client to authorize its download permission for the file to be downloaded. The granting process of the download permission needs to be completed with the help of the server and the file verification information provided by it (for details, see the above embodiment Figure 7 ), which will not be repeated here.

[0230] In some embodiments, the file download method may further include:

[0231] Receiving file reporting information sent by the first client, where the file reporting information includes the first client identifier and the file identifier;

[0232] The first client identifier and the file identifier are associated and stored in the preset database.

[0233] Among them, the main update is Figure 3 The file status table and the target network file status table of the preset database can record the owner information of each uploaded file.

[0234] It should be noted that other specific details of steps 401-403 in this embodiment have been described in detail in steps 201-204 and 301-303 in the previous embodiments, and will not be repeated here.

[0235] As can be seen from the above, the file download method provided in the embodiment of the present application is applied to the server, by receiving a file download request sent by a first client, the file download request carries the file identifier of the file to be downloaded and the first client identifier of the first client; according to the file download request, at least one second client identifier corresponding to the file identifier and the first client identifier is searched from a preset database, and the second client corresponding to the second client identifier and the first client are connected to the same target network; a client query result is generated according to the at least one second client identifier, and the client query result is sent to the first client, so that the first client downloads the file to be downloaded according to the client query result, so that the client does not need to download the file from the server, which reduces the operating burden of the server, and the file download speed will not be affected by the bandwidth bottleneck of the external network between the server and the client, and the client can download files from other clients through a flexible segmented download method, which is conducive to improving the file download speed.

[0236] According to the method described in the above embodiment, the present application embodiment also provides a file downloading device for executing the steps in the above file downloading method. Fig. 9 , Fig. 9 Schematic diagram of the structure of the file downloading device provided in the embodiment of the present application. The file downloading device 500 is applied to the first client, and the first client runs in the first terminal device. The file downloading device includes:

[0237] A sending module 501 is used to send a file download request to a server, where the file download request carries a file identifier of a file to be downloaded and a first client identifier of the first client, where the file download request is used to indicate that a client query result corresponding to the file identifier is returned to the first client, where the client query result includes at least one second client identifier, and a second client corresponding to the second client identifier and the first client are connected to the same target network;

[0238] A determination module 502, configured to determine at least one target client from the second clients according to the returned second client identifier;

[0239] A fragmentation module 503, used to determine at least one target file fragment corresponding to the file to be downloaded in each target client;

[0240] The download module 504 is used to download the corresponding target file segment from the target client to download the file to be downloaded.

[0241] In some embodiments, the sharding module 503 is specifically used to:

[0242] Divide the file to be downloaded into at least one file segment, and obtain the total number of the at least one file segment;

[0243] Determine the number of shards corresponding to each target client according to the number of the target clients and the total number;

[0244] A portion or all of the file slices equal in number to the at least one file slice are determined from the at least one file slice as target file slices for the corresponding target client.

[0245] In some embodiments, the file downloading device 500 further includes an updating module for:

[0246] receiving a first client update notification forwarded by the target client, where the first client update notification is used to indicate that downloading of a first file segment from a third client in the target network is allowed, and the file to be downloaded includes the first file segment;

[0247] According to the update notification of the first client, detecting the target file segment that is not currently downloaded;

[0248] If the target file segments that are not currently downloaded include the first file segment, the first file segment is downloaded from the third client.

[0249] In some embodiments, the download module 504 is further used to:

[0250] When the download of the current target file segment is completed, the current target file segment is used as the second file segment;

[0251] Generate a second client update notification according to the second file segment and the first client identifier, where the second client update notification is used to indicate that other clients in the target network are allowed to download the second file segment from the first client;

[0252] The second client update notification is sent to the target client, so that the target client forwards the second client update notification to other recorded clients in the target network except the first client.

[0253] In some embodiments, the download module 504 is used to:

[0254] Determine a target segment identifier for each target file segment in the at least one target file segment;

[0255] Generate a segment download instruction according to all the target segment identifiers, and send the segment download instruction to the corresponding target client, where the segment download instruction is used to instruct to return the at least one target file segment to the first client;

[0256] A data packet returned by the target client is received, where the data packet includes the at least one target file segment.

[0257] In some embodiments, the download module 504 is further used to:

[0258] Merge the downloaded fragments of the target file;

[0259] When all the target files are merged, file reporting information is generated according to the first client identifier and the file identifier;

[0260] The file reporting information is sent to the server, so that the first client identifier and the file identifier are stored in association in a preset database in the server.

[0261] In some embodiments, the client query result also includes file verification information corresponding to the file identifier, and the determination module 502 is used to:

[0262] Generate a download authorization request according to the file verification information, where the download authorization request is used to indicate that the first client is granted permission to download the file to be downloaded;

[0263] Sending the download authorization request to the corresponding second client according to the returned second client identifier, so that the second client returns a corresponding authorization result according to the download authorization request;

[0264] When the returned authorization result indicates that downloading of the file to be downloaded is allowed, the corresponding second client is used as the target client.

[0265] It should be noted that the specific details of each module unit in the above-mentioned file downloading device 500 have been described in detail in the above-mentioned embodiment of the file downloading method applied to the first client, and will not be repeated here.

[0266] According to the method described in the above embodiment, the present application embodiment also provides a file downloading device for executing the steps in the above file downloading method. Fig.10 , Fig.10 600 is a schematic diagram of the structure of another file downloading device provided in an embodiment of the present application. The file downloading device 600 is applied to a second client, and the second client runs in a second terminal device. The file downloading device 600 includes:

[0267] The receiving module 601 is used to receive a fragment download instruction sent by a first client, the fragment download instruction carries at least one target fragment identifier, and is used to instruct to return a target file fragment corresponding to the at least one target fragment identifier to the first client, and the first client and the second client are connected to the same target network;

[0268] A determination module 602 is configured to determine, according to each target segment identifier in the at least one target segment identifier, a corresponding target file segment from the file to be downloaded, wherein all the target file segments include part or all of the file to be downloaded;

[0269] The sending module 603 is used to generate a data packet according to the target file segment, and send the data packet to the first client, so that the first client downloads the file to be downloaded.

[0270] In some embodiments, the sending module 603 is specifically used to:

[0271] If the number of all the target file segments is less than or equal to a preset threshold, a data packet corresponding to all the target file segments is generated;

[0272] If the number of all the target file segments is greater than the preset threshold, detecting all recorded clients in the target network, except the first client, that request the second client to download the file to be downloaded;

[0273] Determine the total number of times each target file segment has been downloaded in the recorded client;

[0274] Determine the download order of the target file segments according to the total number of downloads;

[0275] A plurality of sub-data packets corresponding to all the target file segments are generated according to the downloading sequence, and each sub-data packet includes at least one target file segment.

[0276] In some embodiments, the sending module 603 is used to:

[0277] According to the total number of downloads from small to large, the download order of the target file segments is set from early to late.

[0278] In some embodiments, the file downloading device further includes a forwarding module for:

[0279] receiving a first client update notification sent by a third client, where the first client update notification is used to indicate that downloading of a first file segment from the third client in the target network is allowed, where the file to be downloaded includes the first file segment;

[0280] The first client update notification is forwarded to other recorded clients in the target network except the third client.

[0281] In some embodiments, the forwarding module is further configured to:

[0282] After receiving the first client update notification sent by the third client, detecting the target file segment that is not currently sent;

[0283] If the target file segments that are not currently sent include the first file segment, the first file segment is deleted from the target file segments that are not currently sent.

[0284] In some embodiments, the forwarding module is further configured to:

[0285] receiving a second client update notification sent by the first client, where the second client update notification is used to indicate that downloading of a second file segment from the first client is allowed, and the target file segment includes the second file segment;

[0286] The second client update notification is forwarded to other recorded clients in the target network except the first client.

[0287] In some embodiments, the receiving module 601 is further used for:

[0288] Before receiving the segment download instruction sent by the first client, receiving a download authorization request sent by the first client, the download authorization request carrying file verification information corresponding to the file identifier of the file to be downloaded and used to indicate that the first client is granted permission to download the file to be downloaded;

[0289] Generate a file verification instruction corresponding to the file verification information according to the download authorization request, and send the file verification instruction to the server, where the file verification instruction is used to instruct to return a verification result corresponding to the file to be downloaded to the second client;

[0290] An authorization result is generated according to the returned verification result, and the authorization result is sent to the first client, so that the first client determines the target client according to the authorization result.

[0291] In some embodiments, the receiving module 601 is used to:

[0292] When the returned verification result indicates that the verification is successful, an authorization result indicating that downloading of the file to be downloaded is allowed is generated;

[0293] When the returned verification result indicates that the verification has failed, an authorization result is generated indicating that downloading of the file to be downloaded is not allowed.

[0294] In some embodiments, the receiving module 601 is further used for:

[0295] When the returned verification result indicates that the verification is successful, the first client is regarded as a recorded client requesting to download the file to be downloaded.

[0296] It should be noted that the specific details of each module unit in the above-mentioned file downloading device 600 have been described in detail in the above-mentioned embodiment of the file downloading method applied to the second client, and will not be repeated here.

[0297] According to the method described in the above embodiment, the present application embodiment also provides a file downloading device for executing the steps in the above file downloading method. Fig.11 , Fig.11 700 is a schematic diagram of another file downloading device provided in an embodiment of the present application. The file downloading device 700 is applied to a server, and the file downloading device 700 includes:

[0298] A receiving module 701 is configured to receive a file download request sent by a first client, where the file download request carries a file identifier of a file to be downloaded and a first client identifier of the first client;

[0299] A search module 702 is used to search, according to the file download request, at least one second client identifier corresponding to the file identifier and the first client identifier from a preset database, wherein the second client corresponding to the second client identifier is connected to the same target network as the first client;

[0300] The sending module 703 is configured to generate a client query result according to the at least one second client identifier, and send the client query result to the first client, so that the first client downloads the file to be downloaded according to the client query result.

[0301] In some embodiments, the sending module 703 is specifically used for:

[0302] Generate corresponding file verification information according to the file identifier;

[0303] A client query result is generated according to the at least one second client identifier and the file verification information.

[0304] In some embodiments, the sending module 703 is further used to:

[0305] Receive a file verification instruction sent by the second client, where the file verification instruction carries target file verification information;

[0306] A verification result corresponding to the file to be downloaded is generated according to the target file verification information and the file verification information, and the verification result is sent to the second client, so that the second client generates an authorization result according to the verification result.

[0307] In some embodiments, the sending module 703 is further used to:

[0308] Receiving file reporting information sent by the first client, where the file reporting information includes the first client identifier and the file identifier;

[0309] The first client identifier and the file identifier are associated and stored in the preset database.

[0310] It should be noted that the specific details of each module unit in the above-mentioned file downloading device 700 have been described in detail in the above-mentioned embodiment of the file downloading method applied to the server, and will not be repeated here.

[0311] In some embodiments, the file downloading device in the embodiment of the present application can be an electronic device, or a component in the electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal or a server. Exemplarily, the electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, a car-mounted electronic device, a mobile Internet device (Mobile Internet Device, MID), an augmented reality (augmented reality, AR) / virtual reality (virtual reality, VR) device, a robot, a wearable device, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook or a personal digital assistant (personal digital assistant, PDA), etc., and can also be a server, a network attached storage (Network Attached Storage, NAS), a personal computer (personal computer, PC), a television (television, TV), a teller machine or a self-service machine, etc., which is not specifically limited in the embodiment of the present application.

[0312] In some embodiments, Fig.12 As shown, an embodiment of the present application also provides an electronic device 800, including a processor 801, a memory 802, and a computer program stored in the memory 802 and executable on the processor 801. When the program is executed by the processor 801, each process of the above-mentioned file download method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be described here.

[0313] It should be noted that the electronic devices in the embodiments of the present application include the mobile electronic devices and non-mobile electronic devices mentioned above.

[0314] Fig.13 A schematic diagram of the hardware structure of an electronic device to implement an embodiment of the present application.

[0315] The electronic device 900 includes but is not limited to: a radio frequency unit 901, a network module 902, an audio output unit 903, an input unit 904, a sensor 905, a display unit 906, a user input unit 907, an interface unit 908, a memory 909, a processor 910 and other components.

[0316] Those skilled in the art will appreciate that the electronic device 900 may also include a power source (such as a battery) for supplying power to each component, and the power source may be logically connected to the processor 910 through a power management system, thereby implementing functions such as managing charging, discharging, and power consumption management through the power management system. Fig.13 The electronic device structure shown in the figure does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently, which will not be described in detail here.

[0317] It should be understood that in the embodiment of the present application, the input unit 904 may include a graphics processor (Graphics Processing Unit, GPU) 9041 and a microphone 9042, and the graphics processor 9041 processes the image data of the static picture or video obtained by the image capture device (such as a camera) in the video capture mode or the image capture mode. The display unit 906 may include a display panel 9061, and the display panel 9061 may be configured in the form of a liquid crystal display, an organic light emitting diode, etc. The user input unit 907 includes a touch panel 9071 and at least one of other input devices 9072. The touch panel 9071 is also called a touch screen. The touch panel 9071 may include two parts: a touch detection device and a touch controller. Other input devices 9072 may include, but are not limited to, a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which will not be repeated here.

[0318] The memory 909 can be used to store software programs and various data. The memory 909 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data, wherein the first storage area may store an operating system, an application program or instructions required for at least one function (such as a sound playback function, an image playback function, etc.), etc. In addition, the memory 909 may include a volatile memory or a non-volatile memory, or the memory 909 may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), a static random access memory (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a double data rate synchronous dynamic random access memory (DDRSDRAM), an enhanced synchronous dynamic random access memory (ESDRAM), a synchronous link dynamic random access memory (SLDRAM) and a direct memory bus random access memory (DRRAM). The memory 909 in the embodiment of the present application includes but is not limited to these and any other suitable types of memory.

[0319] The processor 910 may include one or more processing units; the processor 910 integrates an application processor and a modem processor, wherein the application processor mainly processes operations related to an operating system, a user interface, and application programs, and the modem processor mainly processes wireless communication signals, such as a baseband processor. It is understandable that the modem processor may not be integrated into the processor 910.

[0320] An embodiment of the present application also provides a non-transitory computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the various processes of the above-mentioned file download method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0321] The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk.

[0322] An embodiment of the present application also provides a computer program product, including a computer program, which implements the above-mentioned file downloading method when executed by a processor.

[0323] The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk.

[0324] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.

[0325] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0326] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.

[0327] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.

[0328] In the description of the present application, “plurality” means two or more.

[0329] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "illustrative embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials, or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.

[0330] It should also be understood that the terms “include” and / or “comprising” used herein specify the presence of stated features, integers, steps, operations, units and / or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, units, components and / or combinations thereof.

[0331] Although the embodiments of the present application have been shown and described, those skilled in the art will appreciate that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present application, and that the scope of the present application is defined by the claims and their equivalents.

Claims

1. A file downloading method, characterized in that: Applied to a first client, the first client running in a first terminal device, the file downloading method includes: Sending a file download request to a server, the file download request carrying a file identifier of a file to be downloaded and a first client identifier of the first client, the file download request being used to instruct to return a client query result corresponding to the file identifier to the first client, the client query result including at least one second client identifier, and a second client corresponding to the second client identifier and the first client are connected to the same target network; Determine at least one target client from the second clients according to the returned second client identifier; Determine at least one target file segment corresponding to the file to be downloaded in each of the target clients; Download the corresponding target file segment from the target client to download the file to be downloaded.

2. The method according to claim 1, characterized in that The determining at least one target file segment corresponding to the file to be downloaded in each target client includes: Divide the file to be downloaded into at least one file segment, and obtain the total number of the at least one file segment; Determine the number of shards corresponding to each target client according to the number of the target clients and the total number; A portion or all of the file slices equal to the number of the slices are determined from the at least one file slice as target file slices for the corresponding target client.

3. The method according to claim 1, characterized in that Also includes: receiving a first client update notification forwarded by the target client, where the first client update notification is used to indicate that downloading of a first file segment from a third client in the target network is allowed, and the file to be downloaded includes the first file segment; According to the update notification of the first client, detecting the target file segment that is not currently downloaded; If the target file segments that are not currently downloaded include the first file segment, the first file segment is downloaded from the third client.

4. The method according to claim 1, characterized in that In the process of downloading the corresponding target file segment from the target client, it also includes: When the download of the current target file segment is completed, the current target file segment is used as the second file segment; generating a second client update notification according to the second file segment and the first client identifier, where the second client update notification is used to indicate that other clients in the target network are allowed to download the second file segment from the first client; The second client update notification is sent to the target client, so that the target client forwards the second client update notification to other recorded clients except the first client in the target network.

5. The method according to claim 1, characterized in that The downloading the corresponding target file segment from the target client includes: Determine a target segment identifier for each target file segment in the at least one target file segment; Generate a segment download instruction according to all the target segment identifiers, and send the segment download instruction to the corresponding target client, wherein the segment download instruction is used to instruct to return the at least one target file segment to the first client; A data packet returned by the target client is received, where the data packet includes the at least one target file segment.

6. The method according to any one of claims 1 to 5, characterized in that The client query result also includes file verification information corresponding to the file identifier, and determining at least one target client from the second clients according to the returned second client identifier includes: Generate a download authorization request according to the file verification information, where the download authorization request is used to indicate that the first client is granted permission to download the file to be downloaded; sending the download authorization request to the corresponding second client according to the returned second client identifier, so that the second client returns a corresponding authorization result according to the download authorization request; When the returned authorization result indicates that downloading of the file to be downloaded is allowed, the corresponding second client is used as the target client.

7. A file downloading method, characterized in that: Applied to a second client, the second client running in a second terminal device, the file downloading method includes: receiving a segment download instruction sent by a first client, wherein the segment download instruction carries at least one target segment identifier and is used to instruct to return a target file segment corresponding to the at least one target segment identifier to the first client, and the first client and the second client are connected to the same target network; According to each target fragment identifier of the at least one target fragment identifier, determining the corresponding target file fragment from the file to be downloaded, wherein all the target file fragments include part or all of the file to be downloaded; Generate a data packet according to the target file fragments, and send the data packet to the first client, so that the first client downloads the file to be downloaded.

8. The method according to claim 7, characterized in that The step of generating data packets according to the target file segments includes: If the number of all the target file segments is less than or equal to a preset threshold, generating a data packet corresponding to all the target file segments; If the number of all the target file fragments is greater than the preset threshold, detecting all recorded clients in the target network except the first client and requesting the second client to download the file to be downloaded; Determine the total number of times each of the target file segments has been downloaded in the recorded client; Determining the download order of the target file segments according to the total number of downloads; A plurality of sub-data packets corresponding to all the target file segments are generated according to the downloading order, and each of the sub-data packets includes at least one target file segment.

9. The method according to claim 8, characterized in that Also includes: receiving a first client update notification sent by a third client, where the first client update notification is used to indicate that downloading of a first file segment from the third client in the target network is allowed, and the file to be downloaded includes the first file segment; The first client update notification is forwarded to the other recorded clients except the third client in the target network.

10. The method according to claim 8, characterized in that Also includes: receiving a second client update notification sent by the first client, where the second client update notification is used to indicate that downloading of a second file segment from the first client is allowed, and the target file segment includes the second file segment; The second client update notification is forwarded to the other recorded clients except the first client in the target network.

11. The method according to any one of claims 7 to 10, characterized in that: Before receiving the segment download instruction sent by the first client, the method further includes: receiving a download authorization request sent by the first client, wherein the download authorization request carries file verification information corresponding to the file identifier of the file to be downloaded and is used to indicate that the first client is granted permission to download the file to be downloaded; Generate a file verification instruction corresponding to the file verification information according to the download authorization request, and send the file verification instruction to the server, wherein the file verification instruction is used to instruct to return a verification result corresponding to the file to be downloaded to the second client; An authorization result is generated according to the returned verification result, and the authorization result is sent to the first client, so that the first client determines the target client according to the authorization result.

12. A file downloading method, characterized in that: Applied to the server, the file downloading method includes: Receive a file download request sent by a first client, where the file download request carries a file identifier of a file to be downloaded and a first client identifier of the first client; According to the file download request, searching a preset database for at least one second client identifier corresponding to the file identifier and the first client identifier, wherein the second client corresponding to the second client identifier and the first client are connected to the same target network; A client query result is generated according to the at least one second client identifier, and the client query result is sent to the first client, so that the first client downloads the file to be downloaded according to the client query result.

13. The method according to claim 12, characterized in that The generating a client query result according to the at least one second client identifier includes: Generate corresponding file verification information according to the file identifier; A client query result is generated according to the at least one second client identifier and the file verification information.

14. The method according to claim 13, characterized in that The method further comprises: Receiving a file verification instruction sent by the second client, wherein the file verification instruction carries target file verification information; A verification result corresponding to the file to be downloaded is generated according to the target file verification information and the file verification information, and the verification result is sent to the second client, so that the second client generates an authorization result according to the verification result.

15. The method according to claim 12, characterized in that The method further comprises: Receiving file reporting information sent by the first client, the file reporting information including the first client identifier and the file identifier; The first client identifier and the file identifier are associated and stored in the preset database.

16. A file downloading device, characterized in that: Applied to a first client, the first client is running in a first terminal device, and the file downloading device includes: a sending module, configured to send a file download request to a server, wherein the file download request carries a file identifier of a file to be downloaded and a first client identifier of the first client, wherein the file download request is used to instruct to return a client query result corresponding to the file identifier to the first client, wherein the client query result includes at least one second client identifier, and a second client corresponding to the second client identifier and the first client are connected to the same target network; a determination module, configured to determine at least one target client from the second clients according to the returned second client identifier; A fragmentation module, used to determine at least one target file fragment corresponding to the file to be downloaded in each target client; The download module is used to download the corresponding target file segment from the target client to download the file to be downloaded.

17. A file downloading device, characterized in that: Applied to a second client, the second client is run in a second terminal device, and the file downloading device includes: A receiving module, configured to receive a fragment download instruction sent by a first client, wherein the fragment download instruction carries at least one target fragment identifier and is configured to instruct to return a target file fragment corresponding to the at least one target fragment identifier to the first client, wherein the first client and the second client are connected to the same target network; A determination module, configured to determine the corresponding target file segment from the file to be downloaded according to each target segment identifier in the at least one target segment identifier, wherein all the target file segments include part or all of the file to be downloaded; The sending module is used to generate a data packet according to the target file fragments, and send the data packet to the first client, so that the first client downloads the file to be downloaded.

18. A file downloading device, characterized in that: Applied to a server, the file downloading device comprises: A receiving module, configured to receive a file download request sent by a first client, wherein the file download request carries a file identifier of a file to be downloaded and a first client identifier of the first client; a search module, configured to search, according to the file download request, from a preset database for at least one second client identifier corresponding to the file identifier and the first client identifier, wherein the second client corresponding to the second client identifier and the first client are connected to the same target network; The sending module is used to generate a client query result according to the at least one second client identifier, and send the client query result to the first client, so that the first client downloads the file to be downloaded according to the client query result.

19. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the file downloading method according to any one of claims 1 to 6 is implemented, or the file downloading method according to any one of claims 7 to 11 is executed, or the file downloading method according to any one of claims 12 to 15 is executed.

20. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the file download method according to any one of claims 1 to 6 is implemented, or the file download method according to any one of claims 7 to 11 is implemented, or the file download method according to any one of claims 12 to 15 is implemented.