A file downloading method, computer device and storage medium
By splitting the downloaded file into multiple split files and utilizing the network interconnection characteristics between terminal devices for transmission, the problem of network pressure on remote devices when multiple terminal devices download at the same time is solved, and efficient and stable file downloading is achieved. .
Patent Information
- Application Number
- CN202210756948.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-30
- Publication Date
- 2025-01-17
- Estimated Expiration
- 2042-06-30
AI Technical Summary
In the cloud-edge collaborative interaction system, when multiple terminal devices download files at the same time, the remote device will bear a greater network pressure, which can easily lead to short-term network peaks, affect other application systems in the LAN, and may lead to download failure.
By splitting the downloaded file into multiple split files, each terminal device downloads the non-overlapping split files, uses the network interconnection characteristics between the terminal devices to transmit the split files, and finally splices them into a complete download file. .
This solution reduces the network pressure on remote devices when multiple terminal devices download simultaneously, improves download efficiency, avoids short-term network peaks, and enhances download stability and success rate.
Smart Images

Figure CN115102950B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of Internet of Things, and more specifically, to a file downloading method, a computer device and a storage medium. Background Art
[0002] In the cloud-edge collaborative interactive system, the remote device often directly connects with multiple terminal devices. For example, Figure 1 As shown, each client is connected to a remote device separately to form a transmission channel. The remote device sends the pictures and videos to be displayed, which are then displayed on the terminal device.
[0003] When the number of terminal devices downloading files is small, the pressure on the remote device is small. However, when multiple terminal devices need to download files at the same time, the remote device server will be under greater instantaneous download pressure, which can easily cause a short-term network peak, affect other application systems in the LAN, and cause download failures. Summary of the invention
[0004] The object of the present invention is to provide a file downloading method, a computer device and a storage medium to solve at least one of the problems existing in the prior art.
[0005] In order to achieve the above object, the present invention adopts the following technical solutions:
[0006] A first aspect of the present invention provides a file downloading method, which is applied to a terminal device, and the method comprises:
[0007] Each of the terminal devices sends a working status, and receives a download instruction corresponding to each of the terminal devices in the same group generated by the remote device according to the working status, and the terminal devices in the same group communicate with each other;
[0008] Each of the terminal devices downloads the split files constituting the file according to the download instruction, wherein the split files downloaded by each of the terminal devices do not overlap, and all of the split files are spliced together to form a complete download file;
[0009] The different terminal devices transmit the downloaded split files in the connection network to obtain the complete downloaded file.
[0010] Furthermore, each of the terminal devices sending the working status further includes:
[0011] Each of the terminal devices outputs its own gateway information, online status and routing table information to the remote device, and the gateway information includes its own IP address information or machine code information.
[0012] Further, downloading the split files according to the download instruction further includes:
[0013] Determine the location of the split file to be downloaded according to the download instruction,
[0014] If there is already a terminal device among the terminal devices that has completed downloading the split files corresponding to the download instruction, downloading the split files from the terminal device that has completed downloading;
[0015] If the terminal devices are all downloading the split files corresponding to the download instruction for the first time, the split files are downloaded from the remote device.
[0016] Furthermore, the different terminal devices transmit the downloaded split files in the connection network to obtain the complete downloaded file, further comprising:
[0017] Obtaining the transmission instruction and the download information of the terminal device after the download is completed from the remote device;
[0018] generating a file transfer request to other terminal devices in the connection network according to the transfer instruction and the download information;
[0019] The remaining split files are obtained from other terminal devices and spliced.
[0020] Furthermore, the number of split files is determined according to the number of terminal devices uploaded to the remote device and the working status.
[0021] The split file includes a plurality of sub-file blocks, and the number of the sub-file blocks is determined according to the downloading requirements of the terminal device that downloads the split file.
[0022] The terminal device downloads the split files by using a breakpoint download method.
[0023] A second aspect of the present invention provides a file downloading method, which is applied to the remote device, and the method further includes:
[0024] Splitting the download file stored in the remote device according to the working state, and outputting download instructions for each split file;
[0025] Obtaining download information generated when all the terminal devices download the split files, and updating it synchronously;
[0026] A transmission instruction is generated according to the download information, and the download information of the terminal device after downloading and the transmission instruction are output to other terminal devices.
[0027] Furthermore, the step of splitting the download file stored in the remote device according to the working state and outputting download instructions for each split file further includes:
[0028] Obtaining the working status uploaded by each of the terminal devices;
[0029] According to the working status, the interconnected terminal devices are set to be the same group,
[0030] A split file is generated according to the working status and the download instruction is output to each of the terminal devices in the same group.
[0031] Further, the download instruction includes one or more of a download path of the split file on the remote device, a download method of the remote device, a download path of the terminal device, a download method of the terminal device, a download requirement of the terminal device, offset information, length information, and checksum information;
[0032] or
[0033] The number of split files is determined according to the number of terminal devices uploaded to the remote device and the working status,
[0034] The split file includes a plurality of sub-file blocks, and the number of the sub-file blocks is determined according to the downloading requirements of the terminal device that downloads the split file.
[0035] Furthermore, the step of splitting the download file stored in the remote device according to the working state and outputting download instructions for each split file also includes:
[0036] Determine, according to the working status, whether the terminal device has already completed downloading at least part of the download file, and generate a download instruction according to the determination result;
[0037] If not, generating a split file according to the working status and outputting the download instruction to each of the terminal devices in the same group;
[0038] If so, the download instruction is outputted to the other terminal devices according to the download information of the terminal device that has downloaded at least part of the download file, and according to the download information of the terminal device that has not downloaded the download file.
[0039] Furthermore, the method further comprises:
[0040] If the number of the terminal devices in the same group is less than the number of the terminal devices when the download instruction is output, the split files corresponding to the download instructions of the missing terminal devices are distributed to other terminal devices;
[0041] If the number of the terminal devices in the same group increases compared to the number of the terminal devices when the download instruction is output, the address information and download status of the terminal device that has completed the download are output to the newly added terminal device.
[0042] A third aspect of the present invention provides a file downloading method, which is applied to a management terminal connected to the remote device, and the method further includes:
[0043] Uploading the downloaded file to the remote device, and obtaining the storage status fed back by the remote device;
[0044] Selecting a file to be sent from the files stored in the remote device, and checking the sending status of the download instruction output by the remote device;
[0045] The download status outputted by the terminal device to the remote device is obtained.
[0046] A fourth aspect of the present invention provides a file downloading method for an interactive system, wherein the interactive system comprises a remote device and a terminal device.
[0047] The remote device is used to execute the method provided by the second aspect of the present invention;
[0048] The terminal device is used to execute the method provided by the first aspect of the present invention; or
[0049] The interactive system also includes a management terminal for executing the method provided by the third aspect of the present invention.
[0050] The fifth aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, characterized in that when the program is executed by a processor, it implements the method provided in the second aspect of the present invention, or executes the method provided in the first aspect of the present invention, or executes the method provided in the third aspect of the present invention.
[0051] The sixth aspect of the present invention provides a computer 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, it implements the method provided in the second aspect of the present invention, or executes the method provided in the first aspect of the present invention, or executes the method provided in the third aspect of the present invention.
[0052] The beneficial effects of the present invention are as follows:
[0053] The technical solution described in the present invention is the technical solution of this embodiment. The files downloaded by each terminal device in the same group according to the download instruction are split files. After each terminal device completes the download of the corresponding split file, the network interconnection characteristics of the same group are utilized to transmit the respective split files between the terminal devices. After all the split files are spliced, each terminal device can finally download the complete download file. This solution can reduce the network pressure on the remote device when multiple terminal devices are downloading at the same time, and improve the download efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] The specific implementation modes of the present invention will be further described in detail below in conjunction with the accompanying drawings.
[0055] Figure 1 A schematic diagram showing the connection between a remote device and a terminal device in the related art;
[0056] Figure 2 A schematic diagram showing a flow chart of a file downloading method applied to a terminal device according to an embodiment of the present invention;
[0057] Figure 3 Show Figure 2 A schematic diagram of the connection between the remote device and the terminal device in the method shown;
[0058] Figure 4 An interactive system according to another embodiment of the present invention is shown;
[0059] Figure 5 A schematic diagram showing the interaction of applications at each end in the interactive system according to an embodiment of the present invention;
[0060] Figure 6 A schematic diagram showing a flow chart of a file downloading method applied to a management terminal according to an embodiment of the present invention;
[0061] Figure 7 A schematic diagram showing a flow chart of a file downloading method applied to a remote device according to an embodiment of the present invention;
[0062] Figure 8 A schematic diagram showing a flow chart of "splitting the download file stored in the remote device according to the working state and outputting download instructions for each split file" in an embodiment of the present invention;
[0063] Fig. 9 A schematic diagram showing a flow chart of "different terminal devices transmitting the downloaded split files in a connected network to obtain the complete downloaded file" in an embodiment of the present invention;
[0064] Fig.10 A schematic diagram of a computer device showing another embodiment of the present invention. DETAILED DESCRIPTION
[0065] In order to explain the present invention more clearly, the present invention is further described below in conjunction with embodiments and drawings. Similar components in the drawings are represented by the same reference numerals. It should be understood by those skilled in the art that the content specifically described below is illustrative rather than restrictive, and the protection scope of the present invention should not be limited thereto.
[0066] In an interactive system based on the Internet of Things, remote devices often use direct connections with multiple terminal devices. For example, Figure 1 As shown, Q terminal devices are individually connected to the remote device to form a transmission channel.
[0067] When the number of terminal devices downloading files is small, the pressure on the remote device is small. When multiple terminal devices need to download files at the same time, a large number of terminal devices that are cross-regional and have regional relevance and different regions are all managed by one remote device. For example, in the scenario of information release, the terminal devices of information release and display in different cities are managed by a unified remote device.
[0068] In the above-mentioned information transmission scenario, the network bandwidth of the terminal device is often shared with other businesses. For example, a bank branch is equipped with multiple information transmission display terminal devices. Each information transmission display terminal device plays the same material, and different branch outlets are connected to the same remote device. In the branch outlet, under the same network, there are also terminal devices for other businesses, such as terminal devices for managing transaction information. Therefore, when multiple information transmission display terminal devices of the branch outlet simultaneously request to download files from the remote device, it will cause a short-term network peak and affect other business systems.
[0069] In actual construction, the network bus resources from remote devices to terminal devices are often expensive and fixed, which often causes network congestion when dealing with such a large number of tasks suddenly being issued.
[0070] In view of this, the present invention proposes a file downloading method, a computer device and a storage medium to solve the above problems.
[0071] like Figure 2 As shown, the first embodiment of the present invention provides a file downloading method, which is applied to a terminal device, and the method includes:
[0072] S21, each of the terminal devices sends a working status, and receives a download instruction corresponding to each of the terminal devices in the same group generated by the remote device according to the working status, and the terminal devices in the same group communicate with each other and are connected to the remote device through the same network interface;
[0073] S23, each of the terminal devices downloads the split files constituting the file according to the download instruction, wherein the split files downloaded by each of the terminal devices do not overlap, and all of the split files are spliced into a complete download file;
[0074] S25. According to the transmission instruction output by the remote device, different terminal devices transmit the downloaded split files within the connection network of the group to obtain the complete downloaded file.
[0075] According to the technical solution of this embodiment, the files downloaded by each terminal device in the same group according to the download instruction are split files. After each terminal device completes the download of the corresponding split file, the network interconnection characteristics of the same group are utilized to transmit the respective split files between the terminal devices. After all the split files are spliced together, each terminal device can finally download the complete download file. This solution can reduce the network pressure on the remote device when multiple terminal devices are downloading at the same time, and improve the download efficiency.
[0076] In a specific example, if Figure 1 In the network environment shown, each branch has 5 terminal devices. These 5 terminal devices are in the same network. If each terminal device is directly connected to the remote device and downloads the file to be published, and each terminal device needs to download a 100M file, then the export traffic required for the ten terminal devices in the branch to complete the file download is 100M*5, which is about 500M traffic.
[0077] The solution of this embodiment is as follows Figure 3 As shown in the figure, each branch has 5 terminal devices. These 5 terminal devices are in the same network and connected to the remote device through the same gateway interface. Each terminal device downloads a part of the entire file. For example, each terminal device downloads a 20M split file, and the 5 20M split files are spliced to form a complete download file. Then the export traffic required for the 5 terminal devices to complete the download of the corresponding split files is 20M*5, which is about 100M traffic.
[0078] Therefore, compared with the above-mentioned direct download solution, the solution of this embodiment effectively reduces the network pressure on the remote device, avoids short-term network peaks, and improves network stability. Moreover, each terminal device only needs to download 20 files, and the terminal devices in the same group have the interconnection characteristics of the same local area network, and the transmission speed will reach more than G. Therefore, the split files of each terminal device can be transmitted more quickly, thereby effectively improving the efficiency of file downloading and the success rate of file downloading.
[0079] The file download method of this embodiment is applied to Figure 4The edge-cloud interaction system shown in
[0080] In an optional embodiment, the interactive system includes:
[0081] The management end is used to upload files to the remote device, select the uploaded files and generate instructions to send to the remote device, and view the status of the uploaded files in the remote device, such as upload status, storage status, download status or allocation status.
[0082] The remote device is used to schedule the files to be sent and the terminal devices to execute the download tasks according to the instructions sent by the management end, and output the download instructions.
[0083] The terminal device is used to download the split files according to the download instruction and realize the mutual transmission of the split files in the same group. Figure 2 The method shown.
[0084] In a specific example, the interactive system of this embodiment is an edge-cloud interactive system, and illustratively, the remote device is the cloud, and the terminal device is an edge device. In another specific example, the remote device of this embodiment is a server that is arranged at a different location from the terminal. Exemplarily, the interactive system of this embodiment can be applied to scenarios where a remote device controls multiple terminal devices, and multiple terminal devices may have geographical correlation and a wide distribution range, such as bank branches, various display screens in shopping malls, smart park management platforms or stations, etc., and has broad application prospects.
[0085] In the interactive system of this embodiment, the remote device performs download instructions and file splitting according to the working status of the terminal device, thereby realizing unified scheduling of the remote device. Each terminal device in the same group downloads the split files according to the download instructions, and utilizes the network interconnection characteristics of the same group of terminal devices to transmit their respective split files between each other's terminal devices to realize the acquisition of the complete file. This solution can reduce the network pressure on the remote device when multiple terminal devices are downloading at the same time, and effectively improves the download efficiency.
[0086] The method executed by each end is now described with specific embodiments.
[0087] For the management end, in an optional embodiment, as Figure 5 and Figure 6 As shown, the method also includes:
[0088] S61: Upload the file to the remote device, and obtain the storage status fed back by the remote device.
[0089] For example, this embodiment does not limit the type of uploaded files, which will not be described in detail here. For example, the management end can upload files to the remote device by clicking, filtering, selecting or dragging, and obtain the storage status of the uploaded files by the remote device. For example, after the remote device completes the storage of the file, it will generate a prompt feedback to the management end.
[0090] S63: Select a file to be sent from the files stored in the remote device, and check the sending status of the download instruction output by the remote device.
[0091] In this embodiment, due to the diversity of files stored in the remote device, the management end selects files to be sent to each terminal device from the remote device and generates a sending instruction. After the remote device accepts the sending instruction, the remote device will generate a download instruction based on the status of each terminal device according to the file to be sent, and perform unified scheduling. In a specific example, the management end can check the sending status of the remote device at any time, that is, whether the remote device has started processing the sending of the file, and the progress of the current file sending, so as to control the effective progress information.
[0092] S65: Obtain the download status output by the terminal device to the remote device.
[0093] In a specific example, when the remote device has processed the task of sending the file and the terminal device downloads it according to the download instruction of the remote device, the terminal device will synchronously feedback the download status to the remote device. At this time, the management end can also view the download status of each terminal device from the remote device to obtain the download progress in fact.
[0094] For remote devices, in an optional embodiment, such as Figure 7 and Figure 5 As shown, the method also includes:
[0095] S71. Split the download file stored in the remote device according to the working status, and output download instructions for each split file.
[0096] In an optional embodiment, the download instruction includes one or more of the download path of the split file on the remote device, the download method of the remote device, the download path of the terminal device, the download method of the terminal device, download history information, offset information, length information and verification code information.
[0097] In this step, based on the working status of the terminal device and the download file, the remote device performs unified download scheduling of the split files, splits the files into split files suitable for each terminal device, realizes unified scheduling and accurate downloading of the terminal devices, avoids network waste between the remote device and each terminal device, and realizes efficient downloading of files.
[0098] In an optional embodiment, the split file includes a plurality of sub-file blocks, and the number of the sub-file blocks is determined according to the download requirements of the terminal device downloading the split file. In this embodiment, on the basis that the split file itself is an incomplete download file, the remote device further fragments the split file downloaded by each terminal device according to the working status uploaded by each terminal device, such as the download requirements of the terminal device, and sets the split file into a plurality of sub-file blocks.
[0099] For example, take the above 5 terminal devices downloading a 100M file as an example, the split file A is 20M, including 10 sub-file blocks, and the size of each sub-file block is 2M after even splitting. This setting can avoid the problem of repeated downloading of the split files when the download is resumed when the split file download is abnormal, so as to further improve the download efficiency of the split files.
[0100] For example, if the split files are not split a second time, the terminal device downloads each split file according to the download instruction. When the terminal device has downloaded part of the split files, a download exception occurs. After resuming the download, the split files must be downloaded again. In this case, even if part of the split files have been downloaded in the previous process, they still cannot be applied.
[0101] Therefore, this embodiment splits the split files downloaded by each terminal device for a second time through a remote device, so that after the terminal device recovers from an abnormality and re-downloads, there is no need to download the already downloaded sub-file blocks again, thereby improving download efficiency and resource utilization and avoiding repeated downloads.
[0102] In an optional embodiment, if Figure 8 As shown, step S71 "splitting the download file stored in the remote device according to the working state, and outputting download instructions for each split file" further includes:
[0103] S711, obtaining the working status uploaded by each terminal device.
[0104] In an optional embodiment, the working status of each terminal device includes its own gateway information, online status, routing table information and other information that can distinguish each terminal device. For example, the gateway information includes its own IP address information or machine code information. Through this setting, the remote device can accurately schedule and split files according to the working status uploaded by each terminal device.
[0105] S713: Setting the interconnected terminal devices into the same group according to the working status.
[0106] In this embodiment, since the remote device and the terminal device are one-to-many, that is, one remote device corresponds to multiple terminal devices, and not all of the terminal devices need to download files. Figure 3 Taking the multiple terminal devices shown as an example, they not only include information publishing and display terminal devices, but also include multiple computer devices for recording transaction information and other different types of terminal devices. The above devices all belong to the same bandwidth network and respectively realize connection with remote devices.
[0107] Therefore, for the file to be downloaded by the Xinfa display terminal device, other terminal devices do not need to download the file. In this embodiment, the terminal devices are grouped according to their working status, that is, the terminal devices that need to execute file downloads are set to the same group, and the download of the split files is allocated to the terminal devices in the group to achieve accurate allocation of terminal devices that execute file download tasks.
[0108] S715: Generate split files according to the working status and output the download instructions to each of the terminal devices in the same group.
[0109] Exemplarily, this step further includes determining the number of split files according to the number of online terminal devices in the same group, such as Figure 3 As shown, 5 Xinfa display terminal devices are located in the same group of the branch network. The total number of Xinfa display terminal devices that need to download files is 10, but there are 3 terminal devices currently online. Therefore, the remote device of this embodiment splits the file according to the number of terminal devices currently online.
[0110] For example, taking the aforementioned transmission of a 100M file as an example, the remote device may split the file into 5 split files, that is, each split file may be 20M. For example, terminal device 1 downloads split file A of 1 to 20M, terminal device 2 downloads split file B of 20 to 40M, and so on, terminal device 5 downloads split file N of 80 to 100M. Therefore, through this setting, the number of online terminal devices and the number of split files are matched to the maximum, so that the split files downloaded by each terminal device are minimized, thereby maximizing the download capacity of the terminal devices.
[0111] It is worth noting that this embodiment does not limit the size of the split files and the download order of the split files by the terminal device. For example, the above example splits the entire file evenly. In another specific example, the split files can be generated by random splitting. In another example, the size of the split files can be determined according to the resource configuration of different terminal devices. For example, according to the CPU, memory, etc. of the terminal device, the size of the split files of the terminal device with better performance can be set to be larger than the size of the split files of the terminal device with slightly worse performance, thereby further improving the download efficiency.
[0112] In an optional embodiment, step S71 "splitting the download file stored in the remote device according to the working state and outputting download instructions for each split file" further includes:
[0113] S717, judging, according to the working status, whether the terminal device has already completed downloading at least part of the download file, and generating a download instruction according to the judgment result;
[0114] If not, generating a split file according to the working status and outputting the download instruction to each of the terminal devices in the same group;
[0115] If so, the download instruction is outputted to the other terminal devices according to the download information of the terminal device that has downloaded at least part of the download file, and according to the download information of the terminal device that has not downloaded the download file.
[0116] In a specific example, when all terminal devices in the group download the file for the first time, all online terminal devices download the file from the remote device, and the remote device splits the file according to the download information.
[0117] In another specific example, when there are terminal devices in the group that are not the initial downloaders of the file, for example, they have already downloaded part of the file, the remote device splits the file into a first split file downloaded by the existing terminal devices and a second split file that is the initial download, and further splits the second split file into multiple sub-split files according to the number of online terminal devices in the current group. Furthermore, the remote device outputs the download information of the terminal device corresponding to the first split file to other terminal devices for transmission.
[0118] In this step, the download history of the terminal devices is analyzed based on the working status of the terminal devices in the group to avoid repeated downloading of files, further achieving accurate downloading of files and improving file download efficiency.
[0119] S73. Obtain download information generated when all the terminal devices download the split files, and update it synchronously.
[0120] In this step, when downloading, the terminal device generates download information, such as the location where the split files are stored, the local IP information, and the local download status, such as whether the download is completed, the download progress, etc. According to the content uploaded by the terminal device, the remote device can obtain the download status of the current file in real time for unified scheduling.
[0121] S75. Generate a transmission instruction according to the download information, and output the download information of the terminal device that has completed downloading and the transmission instruction to the other terminal devices.
[0122] Exemplarily, based on the download information obtained in the previous step, the remote device can know whether any terminal device has completed the download of the split files. If there is a terminal device that has completed the download, its download information is sent to other terminal devices. Exemplarily, if the number of terminal devices that have completed the download of the split files is 1, its download information is preferentially sent to the terminal device with the most download progress. After the terminal device completes the download, the split files of the terminal device that completed the download can be downloaded. In another example, if the number of terminal devices that have completed the download of the split files is greater than 1, the download information of the terminal device that has completed the download is output to other terminal devices that have completed the download, and the mutual transmission of the downloaded split files is preferentially completed.
[0123] In an optional embodiment, the method further comprises:
[0124] If the number of the terminal devices in the same group is less than the number of the terminal devices when the download instruction is output, the split files corresponding to the download instructions of the missing terminal devices are distributed to other terminal devices;
[0125] If the number of the terminal devices in the same group increases compared to the number of the terminal devices when the download instruction is output, the address information and download status of the terminal device that has completed the download are output to the newly added terminal device.
[0126] In this embodiment, as described in the previous embodiment, after the remote device sets the size of the split file and outputs the download instruction according to the number of terminal devices in the group, there is a situation where the working status of the terminal device changes. For example, there are 4 online among 5 terminal devices in the same group. When the remote device splits the file into 4 split files and outputs the download instruction according to the number of online terminal devices, in the process of the terminal device executing the download task, there may be a situation where the terminal device executing the task is offline, for example, the number of online terminal devices drops from 4 to 3, and there may also be a situation where a terminal device that is not assigned a download task goes online, for example, the number of online terminal devices increases from 4 to 5. Therefore, this embodiment is designed for the situation when the working status of the terminal device changes.
[0127] Exemplarily, when a terminal device executing a task is offline, 3 out of 4 online terminal devices are offline. After the remote device obtains the change in its working status, the remote device re-outputs the download instruction and reallocates the split files, and distributes the download instruction of the offline terminal device and the split files to be downloaded to the terminal device that is working normally. Exemplarily, the remote device can reselect the terminal device in a random allocation manner. In another example, the remote device can also distribute the download instruction of the offline terminal device and the split files to be downloaded to the terminal device with the fastest download progress, ensuring the download efficiency of the file when the line is abnormal, and realizing the timely scheduling of the remote device.
[0128] In another example, when a new terminal device is added to the group, the number of online terminal devices increases from 4 to 5. After the remote device obtains the change in its working status, the remote device outputs the download information of the terminal device that has completed the download of the split files, such as address information and download status, to the newly added terminal device based on the working status of the terminal device that executes the download task. This allows the newly added terminal device to download the split files of other terminal devices that have executed the task first in the local area network interconnected by the group, rather than downloading the files from the remote device, thereby avoiding the occupation of the bandwidth network, improving the file download efficiency, and reducing the network pressure on the remote device.
[0129] In this embodiment, the remote device splits the download instructions and files according to the working status of the terminal device to achieve unified scheduling of the remote device. Each terminal device in the same group downloads the split files according to the download instructions, and utilizes the network interconnection characteristics of the same group in the terminal devices to transmit their respective split files between each other's terminal devices to achieve the acquisition of the complete file. This solution can reduce the network pressure on the remote device when multiple terminal devices are downloading at the same time, and effectively improve the download efficiency.
[0130] In an optional embodiment, the remote device includes a file server and a cloud computing server. The file server is used to store files uploaded by the management terminal, and the cloud computing server is used to implement the output of download instructions, the calculation of file splitting, and the distribution of download information to achieve unified scheduling and accurate downloading.
[0131] For the terminal device, the execution method is as follows: Figure 2 and Figure 5 As shown, the process is now described:
[0132] S21, each of the terminal devices sends a working status, and receives a download instruction generated by a remote device according to the working status and corresponding to each of the terminal devices in the same group.
[0133] In an optional embodiment, the step S21 "each of the terminal devices sends a working status" further includes:
[0134] Each of the terminal devices outputs its own gateway information, online status and routing table information to the remote device, and the gateway information includes its own IP address information or machine code information.
[0135] In this embodiment, each terminal device sends its own information to the terminal, so that the remote device can group the terminal devices according to the received working status. For example, Figure 3 In the branch network shown, 5 display terminal devices for information release are set to the same group. The information release display terminal devices in the group have different identification IDs in the remote device, which is convenient for the remote device to accurately call during the file download process. Exemplarily, the routing table information also includes download history information, etc., which is convenient for the remote device to accurately split the file when splitting the file.
[0136] In an optional embodiment, the number of split files is determined based on the number of terminal devices uploading to the remote device and the working status. For example, among the five terminal devices in the group uploading to the remote device, there are four online terminal devices, that is, there are currently four terminal devices that can download the file. Therefore, the remote device splits the file into four, so that each terminal device currently online can download it, thereby maximizing the download efficiency.
[0137] S23. Each of the terminal devices downloads the split files constituting the file according to the download instruction, wherein the split files downloaded by each of the terminal devices do not overlap, and all of the split files are spliced into a complete download file.
[0138] After the remote device calculates and distributes the download tasks, the split files downloaded by each terminal device are fragmented complete files, that is, the split files downloaded by each terminal device are not complete download files. Furthermore, since each terminal device is in the same group, for example, each terminal device is set in the same local area network, the terminal devices in the same group can perform internal file transmission. Figure 3 As shown, terminal device 1 transmits the split file A it downloads to terminal devices 2 to 5 respectively. Through this solution, terminal device 1 can obtain the split files transmitted by the other four terminal devices. After terminal device 1 splices all the split files, it forms a complete file sent by the remote device. Exemplarily, the split files include checksum information to ensure that each terminal device performs correct splicing locally.
[0139] In an optional embodiment, the split file includes a plurality of sub-file blocks, and the number of the sub-file blocks is determined according to the downloading requirements of the terminal device that downloads the split file.
[0140] In this embodiment, on the basis that the split file itself is an incomplete download file, the remote device further fragments the split file downloaded by each terminal device according to the working status uploaded by each terminal device, such as the download demand of the terminal device, and sets the split file to multiple sub-file blocks. For example, split file A is 20M, including 10 sub-file blocks, and the size of each sub-file block is 2M under uniform splitting. This setting can avoid the problem of repeated downloading of the split file when the download of the split file is resumed when the download is abnormal, so as to further improve the download efficiency of the split file.
[0141] Exemplarily, if the split files are not split twice, the terminal device downloads the respective split files according to the download instruction. When the terminal device has downloaded part of the split files, a download anomaly occurs. After resuming the download, the split files must be downloaded again. In this case, even if part of the split files have been downloaded in the previous process, they cannot be used. Therefore, the split files downloaded by the terminal device of this embodiment are sub-file blocks. When the terminal device downloads again, it is not necessary to download the sub-file blocks that have been downloaded again, and the sub-file blocks after being split can be used normally, thereby improving download efficiency and resource utilization and avoiding repeated downloads.
[0142] In an optional embodiment, the terminal device downloads the split files by a breakpoint download method, that is, the download process can be paused or interrupted, and then the terminal device can continue to download the split files according to the downloaded sub-file blocks and download instructions.
[0143] In an optional embodiment, step S23 "downloading the split files according to the download instruction" further includes:
[0144] Determine the location of the split file to be downloaded according to the download instruction,
[0145] If the terminal devices are all downloading the split files corresponding to the download instruction for the first time, the split files are downloaded from the remote device. In a specific example, when all the terminal devices in the group are downloading the file for the first time, all the online terminal devices download the file from the remote device, and the remote device splits the file according to the download information.
[0146] If there is already a terminal device among the terminal devices that has completed downloading the split files corresponding to the download instruction, the split files are downloaded from the terminal device that has completed the download.
[0147] In another specific example, when there is a terminal device in the group that is not the initial downloader of the file, for example, a terminal device that has already downloaded part of the file, the remote device splits the file into a first split file that has been downloaded by the terminal device and a second split file that is the initial download. For the second split file, all terminal devices are downloading it for the first time, and according to the download instruction issued by the remote device after splitting the second split file, the second split file is downloaded from the remote device.
[0148] For the first split file, for example, there is already a part of the file that has been downloaded in 4 online terminal devices, that is, this part is used as the first split file, and the remote device outputs the information of the terminal device that has downloaded the first split file as a download instruction to other terminal devices that are downloading the first split file. The other terminal devices transmit the first split file from the intranet according to the download instruction and utilize the network characteristics of the same group, instead of downloading the first split file from the remote device, thereby further realizing accurate downloading of files and improving file download efficiency, and reducing network pressure on remote devices.
[0149] S25. According to the transmission instruction output by the remote device, different terminal devices transmit the downloaded split files in the connection network to obtain the complete downloaded file.
[0150] In an optional embodiment, if Fig. 9 As shown, step S25 "different terminal devices transmit the downloaded split files in the connection network to obtain the complete downloaded file" further includes:
[0151] S251, obtaining a transmission instruction and download information of the terminal device after downloading is completed from the remote device.
[0152] In this embodiment, the download information includes the address information and download status of the split files in the corresponding terminal device, the address information is used to clarify the storage location of the split files downloaded by the terminal device, and the download status is used to clarify the download progress of the terminal device.
[0153] The remote device obtains the download information of the terminal device in real time, and generates a transmission instruction after the terminal device completes the download of the corresponding split file, realizing the global scheduling of file download, so that the terminal device performs internal transmission from other terminal devices in its group.
[0154] That is, after completing the split file downloading of its own task, the terminal device receives the transfer instruction and the download information of other terminal devices that have completed the downloading, and clarifies the sending object of the transfer request to realize the transmission of the remaining split files using the internal network.
[0155] S253: Generate a file transfer request to other terminal devices in the connection network according to the transfer instruction and the download information.
[0156] Exemplarily, terminal device 1 has completed the download of the corresponding split file A, terminal device 2 has completed the download of the corresponding split file B, and terminal device 3 has completed the download of the corresponding split file C. The three terminal devices have all completed the download of the split files of their own tasks. The remote device generates a transmission instruction based on the download status transmitted in real time by the above-mentioned terminal devices.
[0157] For terminal device 1, the transmission instruction it receives is to request terminal device 2 to transmit split file B, and to request terminal device 3 to transmit split file C. For terminal device 2, the transmission instruction it receives is to request terminal device 1 to transmit split file A, and to request terminal device 3 to transmit split file C. For terminal device 3, the transmission instruction it receives is to request terminal device 2 to transmit split file B, and to request terminal device 1 to transmit split file A. Through the above steps, the sending object of the transmission request is clarified, so as to realize the transmission of the remaining split files using the internal network.
[0158] S255: Obtain the remaining split files from other terminal devices and splice them.
[0159] For example, for terminal device 1, after requesting to transmit split file B to terminal device 2 and requesting to transmit split file C to terminal device 3, high-speed transmission is performed between terminal device 1 and terminal device 2, and between terminal device 1 and terminal device 3 using the internal network, and split file B and split file C are received and spliced. Through this setting, the characteristic of terminal devices in the same group to clearly communicate with each other is utilized to improve communication efficiency, complete the mutual transmission of split files, and complete the download of the entire file after splicing.
[0160] In this embodiment, the remote device splits the download instructions and files according to the working status of the terminal device to achieve unified scheduling of the remote device. Each terminal device in the same group downloads the split files according to the download instructions, and utilizes the network interconnection characteristics of the same group in the terminal devices to transmit their respective split files between each other's terminal devices to achieve the acquisition of the complete file. This solution can reduce the network pressure on the remote device when multiple terminal devices are downloading at the same time, and effectively improve the download efficiency.
[0161] Another embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the file download method applied to the remote device of the above embodiment, the file download method applied to the management end of the above embodiment, and the file download method applied to the terminal device of the above embodiment.
[0162] In practical applications, the computer-readable storage medium can adopt any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, but not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present embodiment, the computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, device or device or used in combination with it.
[0163] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0164] The program code embodied on the computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0165] Computer program code for performing the operations of the present invention may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0166] like Fig.10As shown, a structural schematic diagram of a computer device provided by another embodiment of the present invention. Fig.10 The computer device 12 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0167] like Fig.10 As shown, the computer device 12 is in the form of a general-purpose computing device. The components of the computer device 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, and a bus 18 that connects various system components (including the system memory 28 and the processing unit 16).
[0168] Bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor or a local bus using any of a variety of bus architectures. By way of example, these architectures include, but are not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MAC) bus, an Enhanced ISA bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus.
[0169] The computer device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the computer device 12, including volatile and non-volatile media, removable and non-removable media.
[0170] The system memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. The computer device 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 34 may be used to read and write non-removable, non-volatile magnetic media ( Fig.10 not shown, usually called a "hard drive"). Although Fig.10 Not shown in the figure, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk"), and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, a DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to the bus 18 via one or more data medium interfaces. The memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of the various embodiments of the present invention.
[0171] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in the memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment. The program modules 42 generally perform the functions and / or methods of the embodiments described herein.
[0172] The computer device 12 may also communicate with one or more external devices 14 (e.g., keyboards, pointing devices, displays 24, etc.), one or more devices that enable a user to interact with the computer device 12, and / or any device that enables the computer device 12 to communicate with one or more other computing devices (e.g., network cards, modems, etc.). Such communication may be performed through an input / output (I / O) interface 22. Furthermore, the computer device 12 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) through a network adapter 20. Fig.10 As shown, the network adapter 20 communicates with other modules of the computer device 12 via the bus 18. It should be understood that although Fig.10 Not shown, other hardware and / or software modules may be used in conjunction with computer device 12, including but not limited to microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0173] The processor unit 16 executes various functional applications and data processing by running programs stored in the system memory 28, such as implementing a file downloading method provided by an embodiment of the present invention.
[0174] It should also be noted that, in the description of the present invention, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the statement "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element.
[0175] Obviously, the above embodiments of the present invention are merely examples for clearly illustrating the present invention, and are not limitations on the embodiments of the present invention. For those skilled in the art, other different forms of changes or modifications can be made based on the above description. It is impossible to list all the embodiments here. All obvious changes or modifications derived from the technical solution of the present invention are still within the scope of protection of the present invention.
Claims
1. A file downloading method, characterized in that: Applied to a terminal device, the method comprises: Each of the terminal devices sends a working status, and receives a download instruction generated by a remote device according to the working status and corresponding to each of the terminal devices in the same group, wherein the terminal devices in the same group communicate with each other and are connected to the remote device through the same network interface; Each of the terminal devices downloads the split files constituting the file according to the download instruction, wherein the split files downloaded by each of the terminal devices do not overlap, and all of the split files are spliced into a complete file; According to the transmission instruction output by the remote device, different terminal devices transmit the downloaded split files in the connection network of the group to obtain the complete file; The remote device is further used for: if the number of the terminal devices in the same group is less than the number of the terminal devices when the download instruction is output, then the split files corresponding to the download instructions of the missing terminal devices are distributed to other terminal devices; and if the number of the terminal devices in the same group is more than the number of the terminal devices when the download instruction is output, then the address information and download status of the terminal device that has completed the download are output to the newly added terminal device; The working status of each terminal device includes its own gateway information, online status and routing table information; The remote device is further used to: set the interconnected terminal devices into the same group according to the working state, split the files stored in the remote device according to the working state, and output download instructions for each split file; The step of splitting the file stored in the remote device according to the working state and outputting download instructions for each split file also includes: According to the working status, it is determined whether the terminal device has already completed the download of at least part of the file. If not, a split file is generated according to the working status and the download instruction is output to each of the terminal devices in the same group. If so, the download information of the terminal device that has downloaded at least part of the file is output to the other terminal devices, and the download instruction is output based on the download information of the terminal device that has not downloaded the file.
2. The method according to claim 1, characterized in that The downloading of the split files according to the download instruction further comprises: Determine the location of the split file to be downloaded according to the download instruction, If there is already a terminal device among the terminal devices that has completed downloading the split files corresponding to the download instruction, then download the split files from the terminal device that has completed downloading, If the terminal devices are all downloading the split files corresponding to the download instruction for the first time, the split files are downloaded from the remote device.
3. The method according to claim 1, characterized in that: According to the transmission instruction output by the remote device, different terminal devices transmit the downloaded split files in the connection network of the group to obtain the complete file, further comprising: Acquire the transmission instruction and the download information of the terminal device on which the download is completed from the remote device; generating a file transfer request to other terminal devices in the connection network according to the transfer instruction and the download information; The remaining split files are obtained from other terminal devices and spliced.
4. The method according to claim 1, characterized in that: The number of split files is determined according to the number of terminal devices uploaded to the remote device and the working status, The split file includes a plurality of sub-file blocks, and the number of the sub-file blocks is determined according to the downloading requirements of the terminal device that downloads the split file. The terminal device downloads the split files by using a breakpoint download method.
5. A file downloading method, characterized in that: Applied to a remote device, the method further comprises: Splitting the file stored in the remote device according to the working status, and outputting download instructions for each split file; Obtain the download information generated when all terminal devices download split files, and update them synchronously; Generate a transmission instruction according to the download information, and output the download information of the terminal device that has completed downloading and the transmission instruction to other terminal devices; The method further comprises: If the number of the terminal devices in the same group is less than the number of the terminal devices when the download instruction is output, the split files corresponding to the download instructions of the missing terminal devices are distributed to other terminal devices; If the number of the terminal devices in the same group increases compared to the number of the terminal devices when the download instruction is output, the address information and download status of the terminal device that has completed the download are output to the newly added terminal device; The working status of each terminal device includes its own gateway information, online status and routing table information; The method of splitting the file stored in the remote device according to the working state and outputting download instructions for each split file further includes: Obtaining the working status uploaded by each of the terminal devices; According to the working status, the interconnected terminal devices are set to be the same group, Generate split files according to the working status and output the download instructions to each terminal device in the same group; The step of splitting the file stored in the remote device according to the working state and outputting download instructions for each split file also includes: Determine, according to the working status, whether the terminal device has already completed downloading at least part of the file, and generate a download instruction according to the determination result; If not, generating a split file according to the working status and outputting the download instruction to each of the terminal devices in the same group; If so, the download instruction is outputted to the other terminal devices according to the download information of the terminal device that has downloaded at least part of the file, and according to the download information of the terminal device that has not downloaded the file.
6. The method according to claim 5, characterized in that The download instruction includes one or more of the download path of the split file on the remote device, the download method of the remote device, the download path of the terminal device, the download method of the terminal device, the download requirement of the terminal device, offset information, length information and check code information; or The number of split files is determined according to the number of terminal devices uploaded to the remote device and the working status, The split file includes a plurality of sub-file blocks, and the number of the sub-file blocks is determined according to the downloading requirements of the terminal device that downloads the split file.
7. A file downloading method, characterized in that: Applied to a management terminal connected to a remote device, the method further comprises: Uploading the file to the remote device, and obtaining the storage status fed back by the remote device; Selecting a file to be sent from the files stored in the remote device, and checking the sending status of the download instruction output by the remote device; Obtaining a download status outputted from a terminal device to the remote device; Each of the terminal devices sends a working status, and receives a download instruction generated by a remote device according to the working status and corresponding to each of the terminal devices in the same group, wherein the terminal devices in the same group communicate with each other and are connected to the remote device through the same network interface; Each of the terminal devices downloads the split files constituting the file according to the download instruction, wherein the split files downloaded by each of the terminal devices do not overlap, and all of the split files are spliced into a complete file; According to the transmission instruction output by the remote device, different terminal devices transmit the downloaded split files in the connection network of the group to obtain the complete file; The remote device is further configured to distribute the split files corresponding to the download instructions of the missing terminal devices to other terminal devices if the number of the terminal devices in the same group is less than the number of the terminal devices when the download instruction is output; and output the address information and download status of the terminal device that has completed the download to the newly added terminal device if the number of the terminal devices in the same group is more than the number of the terminal devices when the download instruction is output; The working status of each terminal device includes its own gateway information, online status and routing table information; The remote device is further used to: set the interconnected terminal devices into the same group according to the working state, split the files stored in the remote device according to the working state, and output download instructions for each split file; The step of splitting the file stored in the remote device according to the working state and outputting download instructions for each split file also includes: According to the working status, it is determined whether the terminal device has already completed the download of at least part of the file. If not, a split file is generated according to the working status and the download instruction is output to each of the terminal devices in the same group. If so, the download information of the terminal device that has downloaded at least part of the file is output to the other terminal devices, and the download instruction is output based on the download information of the terminal device that has not downloaded the file.
8. A file downloading method for an interactive system, characterized in that: The interactive system includes a remote device and a terminal device. The remote device is used to execute the method of any one of claims 5 to 6; The terminal device is used to execute the method in any one of claims 1 to 4; or The interactive system also includes a management terminal for executing the method of claim 7.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, it implements the method as claimed in any one of claims 5 to 6, or executes the method as claimed in any one of claims 1 to 4, or executes the method as claimed in claim 7.
10. A computer 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, it implements the method as claimed in any one of claims 5 to 6, or executes the method as claimed in any one of claims 1 to 4, or executes the method as claimed in claim 7.
Citation Information
Patent Citations
Method for achieving software upgrade by cooperation among network elements, equipment and system therefor
CN101447884A
Method, device and system for downloading file
CN103237300A
A safety protection method based on a remote upgraded version
CN109271184A