Method, device and electronic device for uploading files

By dynamically adjusting the number of channels and shard sizes of file uploads, and based on the historical upload parameters of the target file, the problems of network congestion and low upload efficiency in the existing technology are solved, and efficient and reliable data upload is achieved.

CN115065676BActive Publication Date: 2025-03-18SHENZHEN GREEN CONNECTION TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202210534590.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-17
Publication Date
2025-03-18
Estimated Expiration
2042-05-17

AI Technical Summary

Technical Problem

Existing file upload technology can easily lead to network congestion when bandwidth is limited, reduce upload efficiency, and cannot flexibly adjust the number of channels to adapt to network conditions.

Method used

By obtaining the historical upload parameters of the target file, dynamically determine the number of upload channels and shard size, and create an upload queue to achieve efficient data upload.

Benefits of technology

It realizes efficient data upload that adapts to network conditions, reducing the failure and errors of data upload.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115065676B_ABST
    Figure CN115065676B_ABST
Patent Text Reader

Abstract

The present invention discloses a method, device, equipment, storage medium and program product for uploading files, the method comprising: obtaining historical upload parameters of a target file; determining the number of upload channels of the target file according to the historical upload parameters; creating an upload queue for the target file based on the number of upload channels, and uploading the target file through the upload queue. It can be seen that the present invention can determine the number of upload channels for uploading files based on the historical upload parameters of the target file, and implement uploading based on the determined number of upload channels, so that the number of upload channels can be adjusted more flexibly according to the upload parameters, and efficient data upload can be achieved to adapt to network conditions, and reduce failures and errors in data upload.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data transmission, and in particular to a method, device, equipment, storage medium and program product for uploading files. Background Art

[0002] With the continuous updating and improvement of basic network equipment, more and more devices adopt the method of uploading files to cloud servers to save files, which also poses new challenges to the efficiency and accuracy of file uploading.

[0003] Existing file upload technologies generally only consider adopting a single channel or a fixed number of multi-channel upload methods to reduce the error rate of file upload. Although the increase in the number of channels will help improve efficiency to a certain extent, it will also cause network congestion when bandwidth is limited, which will reduce the upload efficiency. The existing technology does not consider flexibly adjusting the number of channels for file upload, and therefore cannot adapt to network conditions to achieve the best data upload effect. It can be seen that the existing technology has defects that need to be solved urgently. Summary of the invention

[0004] The present invention provides a method, device, equipment, storage medium and program product for uploading files, which can more flexibly adjust the number of upload channels according to upload parameters, realize efficient data uploading adapted to network conditions, and reduce failures and errors in data uploading.

[0005] In order to solve the above technical problem, the first aspect of the present invention discloses a method for uploading a file, the method comprising:

[0006] Get the historical upload parameters of the target file;

[0007] Determining the number of upload channels for the target file according to the historical upload parameters;

[0008] Based on the number of upload channels, an upload queue is created for the target file, and the target file is uploaded through the upload queue.

[0009] As an optional implementation, in the first aspect of the present invention, the historical upload parameters include the upload speed and / or upload success rate of the target file in at least one upload channel in at least one historical time period.

[0010] As an optional implementation manner, in the first aspect of the present invention, determining the number of upload channels for the target file according to the historical upload parameters includes:

[0011] Determine the number of historical upload channels of the target file;

[0012] Determine whether the historical upload parameter is greater than a preset first parameter threshold, and obtain a first determination result;

[0013] According to the first judgment result, the number of historical upload channels is corrected to obtain the number of upload channels for the target file.

[0014] As an optional implementation manner, in the first aspect of the present invention, the correcting the number of historical upload channels to obtain the number of upload channels for the target file according to the first judgment result includes:

[0015] If the first judgment result is yes, increase the number of historical upload channels to obtain the number of upload channels for the target file;

[0016] If the first judgment result is no, the number of historical upload channels is reduced to obtain the number of upload channels for the target file.

[0017] As an optional implementation manner, in the first aspect of the present invention, the correcting the number of historical upload channels to obtain the number of upload channels for the target file according to the first judgment result includes:

[0018] Determine a channel parameter interval corresponding to the target file;

[0019] According to the first judgment result, the historical upload channel number is corrected to obtain the upload channel number of the target file; the upload channel number is within the channel parameter range.

[0020] As an optional implementation manner, in the first aspect of the present invention, after obtaining the historical upload parameters of the target file, the method further includes:

[0021] Determine the upload fragment size of the target file according to the historical upload parameters;

[0022] And, creating an upload queue for the target file based on the number of upload channels, and uploading the target file through the upload queue, comprises:

[0023] Based on the upload segment size and the number of upload channels, an upload queue is created for the target file, and the target file is uploaded through the upload queue.

[0024] As an optional implementation, in the first aspect of the present invention, the upload segment size is the upload segment size of the target file in any at least one upload channel, or a unified upload segment size in all upload channels.

[0025] As an optional implementation manner, in the first aspect of the present invention, determining the upload segment size of the target file according to the historical upload parameter includes:

[0026] Determine the historical upload fragment size of the target file;

[0027] Determine whether the historical upload parameter is greater than a preset second parameter threshold, and obtain a second determination result;

[0028] According to the second judgment result, the historical upload segment size is corrected to obtain the upload segment size of the target file.

[0029] A second aspect of the present invention discloses a device for uploading a file, the device comprising:

[0030] Parameter acquisition module, used to obtain the historical upload parameters of the target file;

[0031] A channel determination module, used to determine the number of upload channels for the target file according to the historical upload parameters;

[0032] The file upload module is used to create an upload queue for the target file based on the number of upload channels, and upload the target file through the upload queue.

[0033] As an optional implementation, in the second aspect of the present invention, the historical upload parameters include the upload speed and / or upload success rate of the target file in at least one upload channel in at least one historical time period.

[0034] As an optional implementation, in the second aspect of the present invention, the channel determination module includes:

[0035] A history determination unit, used to determine the number of historical upload channels of the target file;

[0036] A threshold judgment unit, used to judge whether the historical upload parameter is greater than a preset first parameter threshold, and obtain a first judgment result;

[0037] The quantity determination unit is used to correct the number of historical upload channels according to the first judgment result to obtain the number of upload channels for the target file.

[0038] As an optional implementation, in the second aspect of the present invention, the specific manner in which the quantity determination unit corrects the number of historical upload channels to obtain the number of upload channels for the target file according to the first judgment result includes:

[0039] If the first judgment result is yes, increase the number of historical upload channels to obtain the number of upload channels for the target file;

[0040] If the first judgment result is no, the number of historical upload channels is reduced to obtain the number of upload channels for the target file.

[0041] As an optional implementation, in the second aspect of the present invention, the specific manner in which the quantity determination unit corrects the number of historical upload channels to obtain the number of upload channels for the target file according to the first judgment result includes:

[0042] Determine a channel parameter interval corresponding to the target file;

[0043] According to the first judgment result, the historical upload channel number is corrected to obtain the upload channel number of the target file; the upload channel number is within the channel parameter range.

[0044] As an optional implementation, in the second aspect of the present invention, the device further includes:

[0045] A fragment determination module, used to determine the upload fragment size of the target file according to the historical upload parameters;

[0046] Furthermore, the file upload module creates an upload queue for the target file based on the number of upload channels, and a specific method of uploading the target file through the upload queue includes:

[0047] Based on the upload segment size and the number of upload channels, an upload queue is created for the target file, and the target file is uploaded through the upload queue.

[0048] As an optional implementation, in the second aspect of the present invention, the upload segment size is the upload segment size of the target file in any at least one upload channel, or a unified upload segment size in all upload channels.

[0049] As an optional implementation, in the second aspect of the present invention, the specific manner in which the fragment determination module determines the upload fragment size of the target file according to the historical upload parameters includes:

[0050] Determine the historical upload fragment size of the target file;

[0051] Determine whether the historical upload parameter is greater than a preset second parameter threshold, and obtain a second determination result;

[0052] According to the second judgment result, the historical upload segment size is corrected to obtain the upload segment size of the target file.

[0053] A third aspect of the present invention discloses an electronic device, comprising:

[0054] A memory storing executable program code;

[0055] a processor coupled to the memory;

[0056] The processor calls the executable program code stored in the memory to execute part or all of the steps in the method for uploading files disclosed in the first aspect of the present invention.

[0057] The fourth aspect of the present invention discloses a computer storage medium, which stores computer instructions. When the computer instructions are called, they are used to execute some or all of the steps in the method for uploading files disclosed in the first aspect of the present invention.

[0058] A fifth aspect of the present invention discloses a computer program product, which includes a computer program / instructions, and when the computer program / instructions are executed by a processor, they implement part or all of the steps in the method for uploading files disclosed in the first aspect of the present invention.

[0059] Compared with the prior art, the present invention has the following beneficial effects:

[0060] The present invention can determine the number of upload channels for uploading files based on historical upload parameters of target files, and implement uploading based on the determined number of upload channels, so that the number of upload channels can be adjusted more flexibly according to the upload parameters, thereby achieving efficient data uploading that adapts to network conditions and reducing failures and errors in data uploading. BRIEF DESCRIPTION OF THE DRAWINGS

[0061] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0062] Figure 1 It is a flowchart of a method for uploading files disclosed in an embodiment of the present invention;

[0063] Figure 2 It is a flowchart of another method for uploading files disclosed in an embodiment of the present invention;

[0064] Figure 3 It is a structural schematic diagram of a device for uploading files disclosed in an embodiment of the present invention;

[0065] Figure 4 It is a structural schematic diagram of another device for uploading files disclosed in an embodiment of the present invention;

[0066] Figure 5It is a structural schematic diagram of an electronic device disclosed in an embodiment of the present invention. DETAILED DESCRIPTION

[0067] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0068] The terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish different objects rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, device, product or end including a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units that are not listed, or may optionally include other steps or units inherent to these processes, methods, products or ends.

[0069] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present invention. The appearance of the phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0070] The present invention discloses a method, device, equipment, storage medium and program product for uploading files, which can determine the number of upload channels for uploading files based on historical upload parameters of target files, and implement uploading based on the determined number of upload channels, so that the number of upload channels can be adjusted more flexibly according to the upload parameters, and efficient data uploading can be achieved to adapt to network conditions, and data uploading failures and errors can be reduced. The following are detailed descriptions.

[0071] Embodiment 1

[0072] See also Figure 1 , Figure 1 : is a flowchart of a method for uploading files disclosed in an embodiment of the present invention. Figure 1 The described method can be applied to a corresponding file uploading device, such as a transmission terminal, a transmission device or a transmission server for uploading data, and the server can be a cloud server or a local server, which is not limited in the embodiment of the present invention. Figure 1As shown, the method for uploading a file may include the following operations:

[0073] 101. Obtain the historical upload parameters of the target file.

[0074] In the embodiment of the present invention, the target file can be any type of file, such as a video file, a photo file or a document file, which is not limited by the present invention. Optionally, the historical upload parameter can be a real-time upload parameter during the transmission of the target file. At this time, it is still the upload parameter of the target file in the historical time period, but the time distance between the historical time period and the current time period is smaller. Optionally, the target file can also be a file uploaded by piecewise uploading. The method of the present invention can improve the efficiency of piecewise uploading files.

[0075] Optionally, the historical upload parameter includes the upload speed and / or upload success rate of the target file in at least one upload channel in at least one historical time period. Optionally, the upload speed of the target file may be the file size of the target file uploaded per unit time. When the historical upload parameter includes information of multiple upload channels, it may be the product of the size of the file uploaded per unit time in a single channel and the number of channels.

[0076] Optionally, the upload success rate may be the ratio of the number or size of successfully uploaded data packets to the total number or size of data packets uploaded. Optionally, the upload success rate may be determined by obtaining historical network transmission records of the target file and analyzing information such as network link error records therein.

[0077] 102. Determine the number of upload channels for the target file based on historical upload parameters.

[0078] Optionally, the current number of channels of the target file can be adjusted according to the upload effect of the target file represented by the historical upload parameters to determine the number of upload channels. Optionally, the number of upload channels is used to indicate the number of concurrent channels during the transmission of the target file.

[0079] 103. Based on the number of upload channels, create an upload queue for the target file, and upload the target file through the upload queue.

[0080] Optionally, an upload queue with the same number of concurrent channels as the number of upload channels can be created for the target file according to the number of upload channels, and the target file can be uploaded to the target file location by executing the upload operation of the upload queue. Optionally, if the target file is a file being transmitted, its transmission can be interrupted, and the remaining untransmitted file portion of the target file can be uploaded based on the upload queue.

[0081] It can be seen that the method described in the embodiment of the present invention can determine the number of upload channels for uploading files based on the historical upload parameters of the target files, and implement the upload based on the determined number of upload channels, so that the number of upload channels can be adjusted more flexibly according to the upload parameters, thereby achieving efficient data upload that adapts to network conditions and reducing data upload failures and errors.

[0082] As an optional embodiment, in the above step 102, determining the number of upload channels for the target file according to the historical upload parameters includes:

[0083] Determine the number of historical upload channels for the target file;

[0084] Determine whether the historical upload parameter is greater than a preset first parameter threshold, and obtain a first determination result;

[0085] According to the first judgment result, the number of historical upload channels is corrected to obtain the number of upload channels for the target file.

[0086] Optionally, the number of historical upload channels of the target file may be determined by obtaining upload information of a historical transmission queue of the target file.

[0087] Optionally, the first parameter threshold may be a first upload success rate threshold or a first upload speed threshold, corresponding to specific parameters of historical upload parameters, which may be determined by an operator based on experimental values ​​or empirical values, and adjusted based on actual effects.

[0088] It can be seen that through this optional embodiment, the number of historical upload channels can be corrected to obtain the number of upload channels for the target file based on the judgment result of whether the historical upload parameter is greater than the preset first parameter threshold, so that the number of upload channels can be determined more accurately to achieve efficient data upload that adapts to network conditions.

[0089] As an optional embodiment, in the above step, according to the first judgment result, correcting the number of historical upload channels to obtain the number of upload channels of the target file includes:

[0090] If the first judgment result is yes, increase the number of historical upload channels to obtain the number of upload channels for the target file;

[0091] If the first judgment result is no, the number of historical upload channels is reduced to obtain the number of upload channels for the target file.

[0092] One of the purposes of this optional embodiment is that when the first judgment result shows that the historical upload parameter is greater than the first parameter threshold, that is, the upload effect of the target file is better, it means that the network environment can withstand more concurrent channels at this time, and the number of historical upload channels is increased to further utilize network resources. When the first judgment result shows that the historical upload parameter is not greater than the first parameter threshold, that is, the upload effect of the target file is poor, it means that the number of concurrent channels is too large, resulting in network congestion, and the number of historical upload channels is reduced to avoid reducing network transmission efficiency.

[0093] Optionally, the specific numerical value of increasing or decreasing the number of historical upload channels can be determined based on the difference between the historical upload parameter and the first parameter threshold. Optionally, the specific numerical value of increasing or decreasing the number of historical upload channels is proportional to the absolute value of the difference between the historical upload parameter and the first parameter threshold.

[0094] It can be seen that through this optional embodiment, the number of historical upload channels can be increased or decreased to obtain the number of upload channels for the target file based on the judgment result of whether the historical upload parameter is greater than the preset first parameter threshold, so that the number of upload channels that adapts to the network situation can be determined more accurately to achieve data upload that maximizes the use of network resources.

[0095] As an optional embodiment, in the above step, according to the first judgment result, correcting the number of historical upload channels to obtain the number of upload channels of the target file includes:

[0096] Determine the channel parameter interval corresponding to the target file;

[0097] According to the first judgment result, the number of historical upload channels is corrected to obtain the number of upload channels for the target file, wherein the number of upload channels is within the channel parameter range.

[0098] Optionally, according to the first judgment result, the specific method of correcting the number of historical upload channels to obtain the number of upload channels of the target file can refer to the details in the previous optional embodiment.

[0099] Optionally, the channel parameter interval is generally related to the device processing capacity of the upload device where the target file is located and / or the receiving file device of the target transmission, and at least includes a maximum channel parameter and a minimum channel parameter. Optionally, considering the performance difference of the upload device and the difference in the processing capacity of the receiving file device, the minimum channel parameter is generally controlled to 1 channel, or 2 to 3 channels, and the maximum channel parameter is at most twice the number of CPU core processors of the upload device or the receiving file device. Optionally, the channel parameter interval can also be set by the operator according to experimental values ​​or experience values, and adjusted according to the actual operation effect.

[0100] It can be seen that through this optional embodiment, the determined number of upload channels can be controlled to be within the channel parameter range, so that the number of upload channels suitable for the device situation can be determined more accurately, so as to avoid excessive number of channels causing excessively high device processing costs or reduced transmission efficiency, and further achieve more efficient data upload.

[0101] Embodiment 2

[0102] See also Figure 2 , Figure 2 is a flow chart of another method for uploading files disclosed in an embodiment of the present invention. Figure 2 The described method can be applied to a corresponding file uploading device, such as a transmission terminal, a transmission device or a transmission server for uploading data, and the server can be a cloud server or a local server, which is not limited in the embodiment of the present invention. Figure 2 As shown, the method for uploading a file may include the following operations:

[0103] 201. Obtain historical upload parameters of the target file.

[0104] 202. Determine the number of upload channels for the target file according to the historical upload parameters.

[0105] The specific technical details in steps 201-202 may refer to the corresponding descriptions of steps 101-102 in the first embodiment, and will not be elaborated in this embodiment.

[0106] 203. Determine the upload segment size of the target file based on the historical upload parameters.

[0107] Optionally, the execution order of steps 202 and 203 is not limited, and they can be executed simultaneously or in any order.

[0108] Optionally, the current fragment size of the target file may be adjusted according to the upload effect of the target file represented by the historical upload parameters to determine the upload fragment size. Optionally, the upload fragment size is used to indicate the data volume of each fragment of the target file during transmission.

[0109] Optionally, the upload segment size can be the upload segment size of the target file in any at least one upload channel, or a unified upload segment size in all upload channels. Optionally, when the upload segment size is the upload segment size of the target file in any at least one upload channel, the upload channel corresponding to it corresponds to the upload channel corresponding to the historical upload parameter, so that the segment size for a specific upload channel can be adjusted.

[0110] 204. Based on the upload segment size and the number of upload channels, an upload queue is created for the target file, and the target file is uploaded through the upload queue.

[0111] Optionally, the number of remaining fragments can be calculated according to the upload fragment size, and the start and end bytes of each fragment can be calculated based on the remaining number of fragments and the upload fragment size to fragment the target file to obtain multiple fragment files, and according to the number of upload channels, an upload queue with a concurrent channel number equal to the number of upload channels is created for the multiple fragment files, and the upload operation of the upload queue is executed to upload the target file to the target file location. Optionally, if the target file is a file being transmitted, its transmission can also be interrupted, and the remaining untransmitted file portion of the target file can be fragmented according to the upload fragment size and uploaded based on the upload queue.

[0112] Specifically, if the size of the target file is less than or equal to the upload segment size, a single channel single segment is used for upload, and if the size of the target file is larger than the upload segment size, an upload queue constructed with the upload segment size and the number of upload channels is obtained.

[0113] It can be seen that through the embodiments of the present invention, the number of upload channels and the size of upload segments for uploading files can be determined based on the historical upload parameters of the target file, and the segmented upload of files can be implemented based on the determined number of upload channels and the size of upload segments, thereby achieving more efficient data upload that adapts to network conditions and reducing failures and errors in segmented uploads.

[0114] As an optional embodiment, in the above step 203, determining the upload segment size of the target file according to the historical upload parameters includes:

[0115] Determine the historical upload segment size of the target file;

[0116] Determine whether the historical upload parameter is greater than a preset second parameter threshold, and obtain a second determination result;

[0117] According to the second judgment result, the historical upload segment size is corrected to obtain the upload segment size of the target file.

[0118] Optionally, the historical upload segment size of the target file can be determined by obtaining the upload information of the historical transmission queue of the target file. Optionally, the second parameter threshold can be a second upload success rate threshold or a second upload speed threshold, corresponding to the specific parameters of the historical upload parameters, which can be determined by the operator according to experimental values ​​or experience values, and adjusted according to actual effects.

[0119] Optionally, the method of correcting the size of the historical upload fragments can be performed simultaneously with the specific method of correcting the historical upload channels in step 202 (see the technical details in the first embodiment). For example, the fragment size and the number of channels can be increased at the same time to meet better network conditions and increase the upload efficiency, or the upload fragment size and the number of fragments can be reduced at the same time to ensure the upload success rate under poor network conditions. For another example, in order to ensure the efficiency of file transmission, a smoother adjustment of the overall efficiency can be achieved by reducing the number of channels on the one hand and slightly increasing the fragment size on the other hand, or increasing the number of channels on the one hand and reducing the upload fragment size on the other hand to meet different network link conditions and device performance differences.

[0120] It can be seen that through this optional embodiment, the historical upload segment size can be corrected to obtain the upload segment size of the target file based on the judgment result of whether the historical upload parameter is greater than the second parameter threshold, so that the appropriate upload segment size can be determined more accurately to achieve more efficient data upload that adapts to network conditions.

[0121] As an optional embodiment, in the above step, according to the second judgment result, correcting the historical upload segment size to obtain the upload segment size of the target file includes:

[0122] If the second judgment result is yes, increase the historical upload segment size to obtain the upload segment size of the target file;

[0123] If the second judgment result is no, reduce the historical upload segment size to obtain the upload segment size of the target file.

[0124] One of the purposes of this optional embodiment is that the size of the uploaded segment will also affect the efficiency of file uploading and is also related to the transmission cost. If the uploaded segment size is too small, the amount of valid data in a single request of the upload channel will be too small, wasting resources. If it is too large, it will cause too many resources to be consumed in uploading a single segment, and the server's acceptance, storage and verification time will be longer, and the overall time will be longer. At the same time, if the network link status is not good, it may cause the segment upload to fail and need to be re-uploaded, and the resource consumption will be too large, and the time to provide user feedback will also be longer, affecting the user experience.

[0125] Therefore, in this optional embodiment, when the second judgment result shows that the historical upload parameter is greater than the second parameter threshold, that is, the upload effect of the target file is better, indicating that the number of fragments at this time can achieve a better transmission effect, the size of the historical upload fragments is increased, the number of fragments is reduced, and the transmission cost is reduced. When the second judgment result shows that the historical upload parameter is not greater than the second parameter threshold, that is, the upload effect of the target file is poor, indicating that the number of fragments is too small at this time, resulting in reduced transmission efficiency. The size of the historical upload fragments is reduced, and the number of fragments is increased to improve network transmission efficiency.

[0126] Optionally, the specific value of increasing or decreasing the size of the historical upload segments can be determined based on the difference between the historical upload parameter and the second parameter threshold. Optionally, the specific value of increasing or decreasing the size of the historical upload segments is proportional to the absolute value of the difference between the historical upload parameter and the second parameter threshold.

[0127] It can be seen that through this optional embodiment, the historical upload segment size can be increased or decreased to obtain the upload segment size of the target file based on the judgment result of whether the historical upload parameter is greater than the second parameter threshold, thereby more accurately determining the upload segment size that is lower in cost and more adaptable to network conditions, so as to achieve efficient and low-cost data upload.

[0128] As an optional embodiment, in the above step, according to the second judgment result, correcting the historical upload segment size to obtain the upload segment size of the target file includes:

[0129] Determine the shard parameter range corresponding to the target file;

[0130] According to the second judgment result, the historical upload segment size is corrected to obtain the upload segment size of the target file, wherein the upload segment size is within the segment parameter range.

[0131] Optionally, based on the second judgment result, the specific method of correcting the historical upload segment size to obtain the upload segment size of the target file can refer to the details in the previous optional embodiment.

[0132] Optionally, the upload fragment size and / or the historical upload fragment size can be a multiple of the preset minimum fragment size to facilitate the cutting calculation. Optionally, the fragment parameter interval includes at least a maximum fragment parameter and a minimum fragment parameter. For example, if the minimum fragment size is set to 512KB, then the maximum fragment parameter can be set to 8192KB, and the minimum number of fragment size corrections each time is 512KB. In this way, even if the current upload is unsuccessful, it can be cut into multiple minimum fragments during the next upload to meet the minimum upload efficiency requirement.

[0133] It can be seen that through this optional embodiment, the determined upload segment size can be controlled to be within the segment parameter range, so that the upload segment size that is convenient for cutting calculation can be determined more accurately, so as to avoid segment size confusion causing obstacles to subsequent cutting calculations or network transmission, and further achieve more efficient data upload.

[0134] Embodiment 3

[0135] See also Figure 3 , Figure 3 : is a schematic diagram of a structure of a device for uploading files disclosed in an embodiment of the present invention. Figure 3 The described device can be applied to a corresponding data processing device, such as a transmission terminal, a transmission device or a transmission server for uploading data, and the server can be a cloud server or a local server. Figure 3 As shown, the device may include:

[0136] The parameter acquisition module 301 is used to acquire the historical upload parameters of the target file.

[0137] In the embodiment of the present invention, the target file can be any type of file, such as a video file, a photo file or a document file, which is not limited by the present invention. Optionally, the historical upload parameter can be a real-time upload parameter during the transmission of the target file. At this time, it is still the upload parameter of the target file in the historical time period, but the time distance between the historical time period and the current time period is smaller. Optionally, the target file can also be a file uploaded by piecewise uploading. The method of the present invention can improve the efficiency of piecewise uploading files.

[0138] Optionally, the historical upload parameter includes the upload speed and / or upload success rate of the target file in at least one upload channel in at least one historical time period. Optionally, the upload speed of the target file may be the file size of the target file uploaded per unit time. When the historical upload parameter includes information of multiple upload channels, it may be the product of the size of the file uploaded per unit time in a single channel and the number of channels.

[0139] Optionally, the upload success rate may be the ratio of the number or size of successfully uploaded data packets to the total number or size of data packets uploaded. Optionally, the upload success rate may be determined by obtaining historical network transmission records of the target file and analyzing information such as network link error records therein.

[0140] The channel determination module 302 is used to determine the number of upload channels for the target file according to the historical upload parameters.

[0141] Optionally, the current number of channels of the target file can be adjusted according to the upload effect of the target file represented by the historical upload parameters to determine the number of upload channels. Optionally, the number of upload channels is used to indicate the number of concurrent channels during the transmission of the target file.

[0142] The file upload module 303 is used to create an upload queue for the target file based on the number of upload channels, and upload the target file through the upload queue.

[0143] Optionally, an upload queue with the same number of concurrent channels as the number of upload channels can be created for the target file according to the number of upload channels, and the target file can be uploaded to the target file location by executing the upload operation of the upload queue. Optionally, if the target file is a file being transmitted, its transmission can be interrupted, and the remaining untransmitted file portion of the target file can be uploaded based on the upload queue.

[0144] It can be seen that the device described in the embodiment of the present invention can determine the number of upload channels for uploading files based on the historical upload parameters of the target files, and implement the upload based on the determined number of upload channels, so that the number of upload channels can be adjusted more flexibly according to the upload parameters, thereby achieving efficient data upload that adapts to network conditions and reducing data upload failures and errors.

[0145] As an optional embodiment, Figure 4 As shown, the channel determination module 302 includes:

[0146] A history determination unit 3021, used to determine the number of historical upload channels of the target file;

[0147] The threshold judgment unit 3022 is used to judge whether the historical upload parameter is greater than a preset first parameter threshold and obtain a first judgment result;

[0148] The quantity determination unit 3023 is used to correct the number of historical upload channels according to the first judgment result to obtain the number of upload channels for the target file.

[0149] Optionally, the number of historical upload channels of the target file may be determined by obtaining upload information of a historical transmission queue of the target file.

[0150] Optionally, the first parameter threshold may be a first upload success rate threshold or a first upload speed threshold, corresponding to specific parameters of historical upload parameters, which may be determined by an operator based on experimental values ​​or empirical values, and adjusted based on actual effects.

[0151] It can be seen that through this optional embodiment, the number of historical upload channels can be corrected to obtain the number of upload channels for the target file based on the judgment result of whether the historical upload parameter is greater than the preset first parameter threshold, so that the number of upload channels can be determined more accurately to achieve efficient data upload that adapts to network conditions.

[0152] As an optional embodiment, the specific manner in which the quantity determining unit 3023 corrects the number of historical upload channels to obtain the number of upload channels of the target file according to the first judgment result includes:

[0153] If the first judgment result is yes, increase the number of historical upload channels to obtain the number of upload channels for the target file;

[0154] If the first judgment result is no, the number of historical upload channels is reduced to obtain the number of upload channels for the target file.

[0155] One of the purposes of this optional embodiment is that when the first judgment result shows that the historical upload parameter is greater than the first parameter threshold, that is, the upload effect of the target file is better, it means that the network environment can withstand more concurrent channels at this time, and the number of historical upload channels is increased to further utilize network resources. When the first judgment result shows that the historical upload parameter is not greater than the first parameter threshold, that is, the upload effect of the target file is poor, it means that the number of concurrent channels is too large, resulting in network congestion, and the number of historical upload channels is reduced to avoid reducing network transmission efficiency.

[0156] Optionally, the specific numerical value of increasing or decreasing the number of historical upload channels can be determined based on the difference between the historical upload parameter and the first parameter threshold. Optionally, the specific numerical value of increasing or decreasing the number of historical upload channels is proportional to the absolute value of the difference between the historical upload parameter and the first parameter threshold.

[0157] It can be seen that through this optional embodiment, the number of historical upload channels can be increased or decreased to obtain the number of upload channels for the target file based on the judgment result of whether the historical upload parameter is greater than the preset first parameter threshold, so that the number of upload channels that adapts to the network situation can be determined more accurately to achieve data upload that maximizes the use of network resources.

[0158] As an optional embodiment, the specific manner in which the quantity determining unit 3023 corrects the number of historical upload channels to obtain the number of upload channels of the target file according to the first judgment result includes:

[0159] Determine the channel parameter interval corresponding to the target file;

[0160] According to the first judgment result, the number of historical upload channels is corrected to obtain the number of upload channels for the target file, wherein the number of upload channels is within the channel parameter range.

[0161] Optionally, according to the first judgment result, the specific method of correcting the number of historical upload channels to obtain the number of upload channels of the target file can refer to the details in the previous optional embodiment.

[0162] Optionally, the channel parameter interval is generally related to the device processing capacity of the upload device where the target file is located and / or the receiving file device of the target transmission, and at least includes a maximum channel parameter and a minimum channel parameter. Optionally, considering the performance difference of the upload device and the difference in the processing capacity of the receiving file device, the minimum channel parameter is generally controlled to 1 channel, or 2 to 3 channels, and the maximum channel parameter is at most twice the number of CPU core processors of the upload device or the receiving file device. Optionally, the channel parameter interval can also be set by the operator according to experimental values ​​or experience values, and adjusted according to the actual operation effect.

[0163] It can be seen that through this optional embodiment, the determined number of upload channels can be controlled to be within the channel parameter range, so that the number of upload channels suitable for the device situation can be determined more accurately, so as to avoid excessive number of channels causing excessively high device processing costs or reduced transmission efficiency, and further achieve more efficient data upload.

[0164] As an optional embodiment, Figure 4 As shown, the device also includes:

[0165] The fragment determination module 304 is used to determine the upload fragment size of the target file according to the historical upload parameters.

[0166] Optionally, the current fragment size of the target file may be adjusted according to the upload effect of the target file represented by the historical upload parameters to determine the upload fragment size. Optionally, the upload fragment size is used to indicate the data volume of each fragment of the target file during transmission.

[0167] Optionally, the upload segment size can be the upload segment size of the target file in any at least one upload channel, or a unified upload segment size in all upload channels. Optionally, when the upload segment size is the upload segment size of the target file in any at least one upload channel, the upload channel corresponding to it corresponds to the upload channel corresponding to the historical upload parameter, so that the segment size for a specific upload channel can be adjusted.

[0168] Correspondingly, the file upload module 303 creates an upload queue for the target file based on the number of upload channels. The specific method of uploading the target file through the upload queue includes:

[0169] Based on the upload segment size and the number of upload channels, an upload queue is created for the target file, and the target file is uploaded through the upload queue.

[0170] Optionally, the number of remaining fragments can be calculated according to the upload fragment size, and the start and end bytes of each fragment can be calculated based on the remaining number of fragments and the upload fragment size to fragment the target file to obtain multiple fragment files, and according to the number of upload channels, an upload queue with a concurrent channel number equal to the number of upload channels is created for the multiple fragment files, and the upload operation of the upload queue is executed to upload the target file to the target file location. Optionally, if the target file is a file being transmitted, its transmission can also be interrupted, and the remaining untransmitted file portion of the target file can be fragmented according to the upload fragment size and uploaded based on the upload queue.

[0171] Specifically, if the size of the target file is less than or equal to the upload segment size, a single channel single segment is used for upload, and if the size of the target file is larger than the upload segment size, an upload queue constructed with the upload segment size and the number of upload channels is obtained.

[0172] It can be seen that through this optional embodiment, the number of upload channels and the size of the upload segments for uploading files can be determined based on the historical upload parameters of the target file, and the segmented upload of files can be implemented based on the determined number of upload channels and the size of the upload segments, thereby achieving more efficient data upload that adapts to network conditions and reducing failures and errors in segmented uploads.

[0173] As an optional embodiment, the specific manner in which the fragment determination module 304 determines the upload fragment size of the target file according to the historical upload parameters includes:

[0174] Determine the historical upload segment size of the target file;

[0175] Determine whether the historical upload parameter is greater than a preset second parameter threshold, and obtain a second determination result;

[0176] According to the second judgment result, the historical upload segment size is corrected to obtain the upload segment size of the target file.

[0177] Optionally, the historical upload segment size of the target file can be determined by obtaining the upload information of the historical transmission queue of the target file. Optionally, the second parameter threshold can be a second upload success rate threshold or a second upload speed threshold, corresponding to the specific parameters of the historical upload parameters, which can be determined by the operator according to experimental values ​​or experience values, and adjusted according to actual effects.

[0178] Optionally, the method of correcting the size of the historical upload fragments can be performed simultaneously with the specific method of correcting the historical upload channels in step 202 (see the technical details in the first embodiment). For example, the fragment size and the number of channels can be increased at the same time to meet better network conditions and increase the upload efficiency, or the upload fragment size and the number of fragments can be reduced at the same time to ensure the upload success rate under poor network conditions. For another example, in order to ensure the efficiency of file transmission, a smoother adjustment of the overall efficiency can be achieved by reducing the number of channels on the one hand and slightly increasing the fragment size on the other hand, or increasing the number of channels on the one hand and reducing the upload fragment size on the other hand to meet different network link conditions and device performance differences.

[0179] It can be seen that through this optional embodiment, the historical upload segment size can be corrected to obtain the upload segment size of the target file based on the judgment result of whether the historical upload parameter is greater than the second parameter threshold, so that the appropriate upload segment size can be determined more accurately to achieve more efficient data upload that adapts to network conditions.

[0180] As an optional embodiment, the specific manner in which the fragment determination module 304 corrects the historical upload fragment size to obtain the upload fragment size of the target file according to the second judgment result includes:

[0181] If the second judgment result is yes, increase the historical upload segment size to obtain the upload segment size of the target file;

[0182] If the second judgment result is no, reduce the historical upload segment size to obtain the upload segment size of the target file.

[0183] One of the purposes of this optional embodiment is that the size of the uploaded segment will also affect the efficiency of file uploading and is also related to the transmission cost. If the uploaded segment size is too small, the amount of valid data in a single request of the upload channel will be too small, wasting resources. If it is too large, it will cause too many resources to be consumed in uploading a single segment, and the server's acceptance, storage and verification time will be longer, and the overall time will be longer. At the same time, if the network link status is not good, it may cause the segment upload to fail and need to be re-uploaded, and the resource consumption will be too large, and the time to provide user feedback will also be longer, affecting the user experience.

[0184] Therefore, in this optional embodiment, when the second judgment result shows that the historical upload parameter is greater than the second parameter threshold, that is, the upload effect of the target file is better, indicating that the number of fragments at this time can achieve a better transmission effect, the size of the historical upload fragments is increased, the number of fragments is reduced, and the transmission cost is reduced. When the second judgment result shows that the historical upload parameter is not greater than the second parameter threshold, that is, the upload effect of the target file is poor, indicating that the number of fragments is too small at this time, resulting in reduced transmission efficiency. The size of the historical upload fragments is reduced, and the number of fragments is increased to improve network transmission efficiency.

[0185] Optionally, the specific value of increasing or decreasing the size of the historical upload segments can be determined based on the difference between the historical upload parameter and the second parameter threshold. Optionally, the specific value of increasing or decreasing the size of the historical upload segments is proportional to the absolute value of the difference between the historical upload parameter and the second parameter threshold.

[0186] It can be seen that through this optional embodiment, the historical upload segment size can be increased or decreased to obtain the upload segment size of the target file based on the judgment result of whether the historical upload parameter is greater than the second parameter threshold, thereby more accurately determining the upload segment size that is lower in cost and more adaptable to network conditions, so as to achieve efficient and low-cost data upload.

[0187] As an optional embodiment, the specific manner in which the fragment determination module 304 corrects the historical upload fragment size to obtain the upload fragment size of the target file according to the second judgment result includes:

[0188] Determine the shard parameter range corresponding to the target file;

[0189] According to the second judgment result, the historical upload segment size is corrected to obtain the upload segment size of the target file, wherein the upload segment size is within the segment parameter range.

[0190] Optionally, based on the second judgment result, the specific method of correcting the historical upload segment size to obtain the upload segment size of the target file can refer to the details in the previous optional embodiment.

[0191] Optionally, the upload fragment size and / or the historical upload fragment size can be a multiple of the preset minimum fragment size to facilitate the cutting calculation. Optionally, the fragment parameter interval includes at least a maximum fragment parameter and a minimum fragment parameter. For example, if the minimum fragment size is set to 512KB, then the maximum fragment parameter can be set to 8192KB, and the minimum number of fragment size corrections each time is 512KB. In this way, even if the current upload is unsuccessful, it can be cut into multiple minimum fragments during the next upload to meet the minimum upload efficiency requirement.

[0192] It can be seen that through this optional embodiment, the determined upload segment size can be controlled to be within the segment parameter range, so that the upload segment size that is convenient for cutting calculation can be determined more accurately, so as to avoid segment size confusion causing obstacles to subsequent cutting calculations or network transmission, and further achieve more efficient data upload.

[0193] Embodiment 4

[0194] See also Figure 4 , Figure 4 Schematic diagram of the structure of an electronic device disclosed in an embodiment of the present invention. Figure 4 As shown, the electronic device may include:

[0195] A memory 401 storing executable program codes;

[0196] a processor 402 coupled to the memory 401;

[0197] The processor 402 calls the executable program code stored in the memory 401 to execute part or all of the steps in the method for uploading a file disclosed in the first and second embodiments of the present invention.

[0198] The specific technical details of implementing the file upload when the electronic device executes the computer program have been discussed in detail in the aforementioned method steps, so they will not be repeated here.

[0199] Embodiment 5

[0200] An embodiment of the present invention discloses a computer storage medium, which stores computer instructions. When the computer instructions are called, they are used to execute part or all of the steps in the method for uploading files disclosed in embodiments 1 and 2 of the present invention.

[0201] Embodiment 6

[0202] An embodiment of the present invention discloses a computer program product, including a computer program / instruction, which, when executed by a processor, implements part or all of the steps in the method for uploading a file disclosed in Embodiments 1 and 2 of the present invention.

[0203] The above describes specific embodiments of the present specification, and other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily have to be performed in the specific order or sequential order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0204] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device, equipment, and non-volatile computer-readable storage medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.

[0205] The apparatus, device, non-volatile computer-readable storage medium and method provided in the embodiments of this specification correspond to each other, and therefore, the apparatus, device, and non-volatile computer storage medium also have similar beneficial technical effects as the corresponding methods. Since the beneficial technical effects of the methods have been described in detail above, the beneficial technical effects of the corresponding apparatus, device, and non-volatile computer storage medium will not be repeated here.

[0206] In the 1990s, improvements to a technology could be clearly distinguished as hardware improvements (for example, improvements to the circuit structure of diodes, transistors, switches, etc.) or software improvements (improvements to the method flow). However, with the development of technology, many improvements to the method flow today can be regarded as direct improvements to the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that an improvement in a method flow cannot be implemented using a hardware entity module. For example, a programmable logic device (PLD) (such as a field programmable gate array (FPGA)) is such an integrated circuit whose logical function is determined by the user's programming of the device. Designers can "integrate" a digital system on a PLD by programming it themselves, without having to ask a chip manufacturer to design and produce a dedicated integrated circuit chip. Moreover, nowadays, instead of manually making integrated circuit chips, this kind of programming is mostly implemented by "logic compiler" software, which is similar to the software compiler used when developing and writing programs, and the original code before compilation must also be written in a specific programming language, which is called hardware description language (HDL). There is not only one HDL, but many kinds, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. The most commonly used ones are VHDL (Very-High-Speed ​​Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also know that it is only necessary to program the method flow slightly in the above-mentioned hardware description languages ​​and program it into the integrated circuit, and then it is easy to obtain the hardware circuit that implements the logic method flow.

[0207] The controller can be implemented in any appropriate manner, for example, the controller can take the form of a microprocessor or processor and a computer-readable medium storing a computer-readable program code (such as software or firmware) that can be executed by the (micro)processor, a logic gate, a switch, an application-specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller. Examples of controllers include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320. The memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art also know that in addition to implementing the controller in a purely computer-readable program code manner, the controller can be implemented in the form of a logic gate, a switch, an application-specific integrated circuit, a programmable logic controller, and an embedded microcontroller by logically programming the method steps. Therefore, this controller can be considered as a hardware component, and the devices included therein for implementing various functions can also be regarded as structures within the hardware component. Or even, the devices for implementing various functions can be regarded as both software modules for implementing the method and structures within the hardware component.

[0208] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.

[0209] For the convenience of description, the above device is described in various units according to their functions. Of course, when implementing this specification, the functions of each unit can be implemented in the same or multiple software and / or hardware.

[0210] Those skilled in the art will appreciate that the embodiments of this specification may be provided as methods, systems, or computer program products. Therefore, the embodiments of this specification may be in the form of complete hardware embodiments, complete software embodiments, or embodiments in combination with software and hardware. Moreover, the embodiments of this specification may be in the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.

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

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

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

[0214] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0215] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0216] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0217] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity 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, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0218] This specification may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. This specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.

[0219] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0220] Finally, it should be noted that the method, device, equipment, storage medium and program product for uploading files disclosed in the embodiments of the present invention are only preferred embodiments of the present invention, and are only used to illustrate the technical solutions of the present invention, rather than to limit them. Although the present invention has been described in detail with reference to the aforementioned embodiments, it should be understood by those skilled in the art that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features thereof may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for uploading a file, characterized in that: The method comprises: Acquire historical upload parameters of the target file, wherein the historical upload parameters include an upload speed and an upload success rate of the target file in at least one upload channel in at least one historical time period; Determining the number of upload channels for the target file according to the historical upload parameters; Based on the number of upload channels, creating an upload queue for the target file, and uploading the target file through the upload queue; Wherein, determining the number of upload channels for the target file according to the historical upload parameters includes: Determine the number of historical upload channels of the target file; Determine whether the historical upload parameter is greater than a preset first parameter threshold, and obtain a first determination result; According to the first judgment result, correct the number of historical upload channels to obtain the number of upload channels for the target file; The step of correcting the number of historical upload channels to obtain the number of upload channels for the target file according to the first judgment result includes: If the first judgment result is yes, increase the number of historical upload channels to obtain the number of upload channels for the target file; If the first judgment result is no, reducing the number of historical upload channels to obtain the number of upload channels for the target file; And, according to the first judgment result, correcting the number of historical upload channels to obtain the number of upload channels of the target file includes: Determine a channel parameter interval corresponding to the target file; According to the first judgment result, the historical upload channel number is corrected to obtain the upload channel number of the target file; the upload channel number is within the channel parameter range.

2. The method for uploading files according to claim 1, characterized in that: After obtaining the historical upload parameters of the target file, the method further includes: Determine the upload fragment size of the target file according to the historical upload parameters; And, creating an upload queue for the target file based on the number of upload channels, and uploading the target file through the upload queue, comprises: Based on the upload segment size and the number of upload channels, an upload queue is created for the target file, and the target file is uploaded through the upload queue.

3. The method for uploading files according to claim 2, characterized in that: The upload segment size is the upload segment size of the target file in at least one upload channel, or a unified upload segment size in all upload channels.

4. The method for uploading files according to claim 3, characterized in that: The step of determining the upload segment size of the target file according to the historical upload parameters includes: Determine the historical upload fragment size of the target file; Determine whether the historical upload parameter is greater than a preset second parameter threshold, and obtain a second determination result; According to the second judgment result, the historical upload segment size is corrected to obtain the upload segment size of the target file.

5. A device for uploading files, characterized in that: The device comprises: A parameter acquisition module, used to acquire historical upload parameters of a target file, wherein the historical upload parameters include an upload speed and an upload success rate of the target file in at least one upload channel in at least one historical time period; A channel determination module, used to determine the number of upload channels for the target file according to the historical upload parameters; A file uploading module, used to create an upload queue for the target file based on the number of upload channels, and upload the target file through the upload queue; Wherein, the channel determination module includes: A history determination unit, used to determine the number of historical upload channels of the target file; A threshold judgment unit, used to judge whether the historical upload parameter is greater than a preset first parameter threshold, and obtain a first judgment result; a quantity determination unit, configured to modify the number of the historical upload channels according to the first judgment result to obtain the number of the upload channels for the target file; The specific manner in which the quantity determination unit corrects the number of historical upload channels according to the first judgment result to obtain the number of upload channels for the target file includes: If the first judgment result is yes, increase the number of historical upload channels to obtain the number of upload channels for the target file; If the first judgment result is no, reducing the number of historical upload channels to obtain the number of upload channels for the target file; And, the specific manner in which the quantity determination unit corrects the number of historical upload channels according to the first judgment result to obtain the number of upload channels for the target file includes: Determine a channel parameter interval corresponding to the target file; According to the first judgment result, the historical upload channel number is corrected to obtain the upload channel number of the target file; the upload channel number is within the channel parameter range.

6. An electronic device, characterized in that: The electronic device comprises: A memory storing executable program code; a processor coupled to the memory; The processor calls the executable program code stored in the memory to execute the method for uploading a file as described in any one of claims 1 to 4.

7. A computer storage medium, characterized in that: The computer storage medium stores computer instructions, and when the computer instructions are called, they are used to execute the method for uploading files as described in any one of claims 1-4.

8. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instruction is executed by a processor, the method for uploading a file as described in any one of claims 1 to 4 is implemented.

Citation Information

Patent Citations

  • File transmission method and device based on distribution type system framework

    CN103179171A

  • Data transmission method, data transmission system, equipment and storage medium

    CN112152759A

  • File uploading method, device, equipment and storage medium

    CN112583904A

  • Data transmission method and system between nodes in content distribution network and node equipment

    CN113301096A