CN117041243A - File uploading method and device, electronic equipment and readable medium - Google Patents

File uploading method and device, electronic equipment and readable medium Download PDF

Info

Publication number
CN117041243A
CN117041243A CN202311056318.7A CN202311056318A CN117041243A CN 117041243 A CN117041243 A CN 117041243A CN 202311056318 A CN202311056318 A CN 202311056318A CN 117041243 A CN117041243 A CN 117041243A
Authority
CN
China
Prior art keywords
file
uploading
uploaded
size
transmission parameters
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311056318.7A
Other languages
Chinese (zh)
Inventor
万亭君
谭华
董石磊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Telecom Technology Innovation Center
China Telecom Corp Ltd
Original Assignee
China Telecom Technology Innovation Center
China Telecom Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Telecom Technology Innovation Center, China Telecom Corp Ltd filed Critical China Telecom Technology Innovation Center
Priority to CN202311056318.7A priority Critical patent/CN117041243A/en
Publication of CN117041243A publication Critical patent/CN117041243A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/29Flow control; Congestion control using a combination of thresholds

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The disclosure provides a file uploading method, a device, an electronic device and a readable medium, wherein the file uploading method comprises the following steps: uploading the file to be uploaded according to preset transmission parameters; adjusting transmission parameters according to the transmission result of the uploading process; and uploading the file to be uploaded according to the adjusted transmission parameters. Through the embodiment of the disclosure, the utilization rate of the transmission bandwidth can be improved, and meanwhile, the file transmission efficiency and reliability are also improved.

Description

File uploading method and device, electronic equipment and readable medium
Technical Field
The disclosure relates to the technical field of data storage, and in particular relates to a file uploading method, a device, electronic equipment and a readable medium.
Background
Currently, with the development of IT technology, users often need to upload various files to a server, and typically divide a large file into a plurality of fragments, and upload the fragments to the server one by one.
In the related art, a large file is split into a fixed number of fragments with a fixed size, then the fragments with the fixed number are uploaded to a server in batches, and after all fragments are transmitted, a server is notified to combine the fragments of the file so as to restore the original large file.
However, the existing file uploading scheme can cause waste of bandwidth or network blocking, file transmission is unstable, and user experience is poor.
It should be noted that the information disclosed in the above background section is only for enhancing understanding of the background of the present disclosure and thus may include information that does not constitute prior art known to those of ordinary skill in the art.
Disclosure of Invention
An object of the present disclosure is to provide a file upload method, apparatus, electronic device, and readable medium for overcoming, at least to some extent, the problem of poor reliability of file transfer due to limitations and disadvantages of the related art.
According to a first aspect of an embodiment of the present disclosure, there is provided a file uploading method, including: uploading the file to be uploaded according to preset transmission parameters; adjusting the transmission parameters according to the transmission result of the uploading process; and uploading the file to be uploaded according to the adjusted transmission parameters.
In an exemplary embodiment of the present disclosure, before the uploading process is performed on the file according to the preset transmission parameter, the method further includes:
presetting a fragmentation size threshold value and a preset value of the number of fragments for fragmenting the file to be uploaded;
presetting a size threshold of the file to be uploaded;
presetting an uploading time threshold of the file to be uploaded;
and pre-storing the transmission parameters according to the size threshold of the fragments, the preset value of the number of fragments, the size threshold and the uploading time threshold.
In an exemplary embodiment of the present disclosure, adjusting the transmission parameter according to the transmission result of the upload process includes:
analyzing the size and uploading time of the uploaded file contained in the transmission result;
determining an uploading speed according to the size of the uploaded file and the uploading time;
determining the bandwidth of the uploading process according to the uploading speed;
and adjusting the transmission parameters according to the bandwidth of the uploading process.
In the above embodiment, the first round of transmission is performed: and the total size of the first round of uploading files is K1, the size of each fragment is calculated on the basis of the fixed number N, and whether the size is smaller than the preset maximum value L of each fragment is judged. If the number N is larger than L, the number N is increased in the limit range, and the corresponding file is intercepted from the file to be uploaded. In the uploading process, the uploading starting time Tstart is recorded, when the uploading of the first round of uploading files is completed, the uploading ending time Tend is recorded, the time for uploading the first round of files is T1=Tstart-Tend, the bandwidth which can be used by the uploading task at present is predicted to be V1=K1/T1, and the size of the next round of transmission fragments is corrected by V1. In addition, whether all the current files are uploaded is judged, if so, a combined file request is sent to the server, otherwise, the next round of transmission is continued.
In an exemplary embodiment of the present disclosure, adjusting the transmission parameter according to the transmission result of the upload process includes:
comparing the size relation between the uploading time of the uploaded file and the uploading time threshold;
if the uploading time of the uploaded file is less than or equal to the uploading time threshold value, not adjusting the transmission parameters;
and if the uploading time of the uploaded file is determined to be greater than the uploading time threshold, adjusting the fragment size threshold and/or the preset fragment number value.
In an exemplary embodiment of the present disclosure, uploading a file to be uploaded according to a preset transmission parameter includes:
judging whether the size of the file to be uploaded is smaller than or equal to the size threshold;
if the size of the file to be uploaded is smaller than or equal to the size threshold, uploading the file to be uploaded;
and if the size of the file to be uploaded is larger than the size threshold, carrying out fragmentation processing and uploading processing on the file to be uploaded according to a preset transmission parameter.
In an exemplary embodiment of the present disclosure, if it is determined that the size of the file to be uploaded is greater than the size threshold, performing the slicing processing and the uploading processing on the file to be uploaded according to a preset transmission parameter includes:
if the size of the file to be uploaded is larger than the size threshold, performing fragmentation processing on the file to be uploaded according to the fragmentation size threshold and the preset value of the fragmentation number to obtain the fragmented file to be uploaded;
judging whether the size of the fragmented file is smaller than or equal to the fragmented size threshold;
and if the size of the fragmented file is smaller than or equal to the fragmented size threshold, performing fragmentation processing and uploading processing on the fragmented file.
In an exemplary embodiment of the present disclosure, further comprising:
and if the fact that all the fragments of the file to be uploaded are uploaded is detected, triggering the receiving end of the file to be uploaded to merge all the fragments.
According to a second aspect of the embodiments of the present disclosure, there is provided a file uploading apparatus, including:
the uploading module is used for uploading the file to be uploaded according to preset transmission parameters;
the adjusting module is used for adjusting the transmission parameters according to the transmission result of the uploading process;
and the uploading module is used for uploading the file to be uploaded according to the adjusted transmission parameters.
According to a third aspect of the present disclosure, there is provided an electronic device comprising: a memory; and a processor coupled to the memory, the processor configured to perform the method of any of the above based on instructions stored in the memory.
According to a fourth aspect of the present disclosure, there is provided a computer-readable storage medium having stored thereon a program which, when executed by a processor, implements a file upload method as claimed in any one of the above.
According to the embodiment of the disclosure, the file to be uploaded is uploaded according to the preset transmission parameters, the transmission parameters are adjusted according to the transmission results of the uploading, and the file to be uploaded is uploaded according to the adjusted transmission parameters, so that the utilization rate of the transmission bandwidth is improved, and meanwhile, the file transmission efficiency and reliability are also improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the disclosure and together with the description, serve to explain the principles of the disclosure. It will be apparent to those of ordinary skill in the art that the drawings in the following description are merely examples of the disclosure and that other drawings may be derived from them without undue effort.
FIG. 1 shows a schematic diagram of an exemplary system architecture to which a file upload scheme of an embodiment of the present application may be applied;
FIG. 2 is a flow chart of a method of file upload in an exemplary embodiment of the present disclosure;
FIG. 3 is a flowchart of another file upload method in an exemplary embodiment of the present disclosure;
FIG. 4 is a flowchart of another file upload method in an exemplary embodiment of the present disclosure;
FIG. 5 is a flowchart of another file upload method in an exemplary embodiment of the present disclosure;
FIG. 6 is a flowchart of another file upload method in an exemplary embodiment of the present disclosure;
FIG. 7 is a flowchart of another file upload method in an exemplary embodiment of the present disclosure;
FIG. 8 is a flowchart of another file upload method in an exemplary embodiment of the present disclosure;
FIG. 9 is a block diagram of a file upload scheme in an exemplary embodiment of the present disclosure;
FIG. 10 is a flowchart of another file upload method in an exemplary embodiment of the present disclosure;
FIG. 11 is a flowchart of another file upload method in an exemplary embodiment of the present disclosure;
FIG. 12 is a flowchart of another file upload method in an exemplary embodiment of the present disclosure;
FIG. 13 is a schematic diagram of slicing in a file upload scheme in an exemplary embodiment of the present disclosure;
FIG. 14 is a schematic diagram of adjusting the number of fragments and/or the size of fragments in a file upload scheme in an exemplary embodiment of the present disclosure;
FIG. 15 is a block diagram of a file uploading device in an exemplary embodiment of the present disclosure;
fig. 16 is a block diagram of an electronic device in an exemplary embodiment of the present disclosure.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. However, the exemplary embodiments may be embodied in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of the example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of embodiments of the present disclosure. One skilled in the relevant art will recognize, however, that the aspects of the disclosure may be practiced without one or more of the specific details, or with other methods, components, devices, steps, etc. In other instances, well-known technical solutions have not been shown or described in detail to avoid obscuring aspects of the present disclosure.
Furthermore, the drawings are only schematic illustrations of the present disclosure, in which the same reference numerals denote the same or similar parts, and thus a repetitive description thereof will be omitted. Some of the block diagrams shown in the figures are functional entities and do not necessarily correspond to physically or logically separate entities. These functional entities may be implemented in software or in one or more hardware modules or integrated circuits or in different networks and/or processor devices and/or microcontroller devices.
FIG. 1 shows a schematic diagram of an exemplary system architecture to which the file upload scheme of an embodiment of the present application may be applied.
As shown in fig. 1, the system architecture 100 may include one or more of terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 is used as a medium to provide communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
It should be understood that the number of terminal devices, networks and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation. For example, the server 105 may be a server cluster formed by a plurality of servers.
The user may interact with the server 105 via the network 104 using the terminal devices 101, 102, 103 to receive or send messages or the like. The terminal devices 101, 102, 103 may be various electronic devices with display screens including, but not limited to, smartphones, tablet computers, portable computers, desktop computers, and the like.
In some embodiments, the file uploading method provided by the embodiments of the present application is generally performed by the server 105, and accordingly, the file uploading apparatus is generally disposed in the terminal device 103 (may also be the terminal device 101 or 102). In other embodiments, some terminals may have similar functionality as server devices to perform the method.
The following describes example embodiments of the present disclosure in detail with reference to the accompanying drawings.
Fig. 2 is a flowchart of a file upload method in an exemplary embodiment of the present disclosure.
Referring to fig. 2, the file uploading method may include:
step S202, uploading the file to be uploaded according to preset transmission parameters.
And step S204, adjusting the transmission parameters according to the transmission result of the uploading process.
Step S206, uploading the file to be uploaded according to the adjusted transmission parameters.
According to the embodiment of the disclosure, the file to be uploaded is uploaded according to the preset transmission parameters, the transmission parameters are adjusted according to the transmission results of the uploading, and the file to be uploaded is uploaded according to the adjusted transmission parameters, so that the utilization rate of the transmission bandwidth is improved, and meanwhile, the file transmission efficiency and reliability are also improved.
Next, each step of the file uploading method will be described in detail.
In an exemplary embodiment of the present disclosure, as shown in fig. 3, before the uploading process is performed on the file according to the preset transmission parameters, the method further includes:
step S302, presetting a fragmentation size threshold and a preset value of the number of fragments for fragmenting the file to be uploaded.
Step S304, presetting a size threshold of the file to be uploaded.
Step S306, presetting an uploading time threshold of the file to be uploaded.
Step S308, pre-storing the transmission parameters according to the size threshold of the fragments, the preset value of the number of fragments, the size threshold and the uploading time threshold.
In an exemplary embodiment of the present disclosure, as shown in fig. 4, adjusting the transmission parameter according to the transmission result of the upload process includes:
step S402, analyzing the size and uploading time of the uploaded file contained in the transmission result.
Step S404, determining the uploading speed according to the size of the uploaded file and the uploading time.
And step S406, determining the bandwidth of the uploading process according to the uploading speed.
And step S408, adjusting the transmission parameters according to the bandwidth of the uploading process.
In an exemplary embodiment of the present disclosure, as shown in fig. 5, adjusting the transmission parameter according to the transmission result of the upload process includes:
step S502, comparing the magnitude relation between the uploading time of the uploaded file and the uploading time threshold, if yes, executing step S504, otherwise, executing step S506.
Step S504, if it is determined that the uploading time of the uploaded file is less than or equal to the uploading time threshold, the transmission parameters are not adjusted.
Step S506, if it is determined that the uploading time of the uploaded file is greater than the uploading time threshold, adjusting the slice size threshold and/or the preset slice number value.
In an exemplary embodiment of the present disclosure, as shown in fig. 6, uploading a file to be uploaded according to preset transmission parameters includes:
step S602, determining whether the size of the file to be uploaded is smaller than or equal to the size threshold, if yes, executing step S604, and if not, executing step S606.
Step S604, if it is determined that the size of the file to be uploaded is less than or equal to the size threshold, uploading the file to be uploaded.
Step S606, if it is determined that the size of the file to be uploaded is greater than the size threshold, performing a slicing process on the file to be uploaded according to a preset transmission parameter and performing an uploading process.
In an exemplary embodiment of the present disclosure, as shown in fig. 7, if it is determined that the size of the file to be uploaded is greater than the size threshold, performing the slicing processing and the uploading processing on the file to be uploaded according to the preset transmission parameters includes:
step S702, if it is determined that the size of the file to be uploaded is greater than the size threshold, performing a slicing process on the file to be uploaded according to the slicing size threshold and the preset value of the number of slices, so as to obtain the sliced file to be uploaded.
Step S704, determining whether the size of the slice file is less than or equal to the slice size threshold.
Step S706, if it is determined that the size of the fragmented file is less than or equal to the fragmentation size threshold, performing fragmentation processing on the fragmented file and performing uploading processing.
In an exemplary embodiment of the present disclosure, as shown in fig. 8, the file uploading method further includes:
step S802, if it is detected that all the fragments of the file to be uploaded are uploaded, triggering a receiving end of the file to be uploaded to merge all the fragments.
In an exemplary embodiment of the present disclosure, as shown in fig. 9, the basic architecture of the file upload scheme includes a file acquisition module 902, a file segmentation module 904, a file upload module 906, and a correction calculation module 908, which specifically function as follows:
the file obtaining module 902 is configured to obtain and parse the uploaded file, and if the uploaded file is a file list, process the file according to the selection adding sequence;
the file slicing module 904 is configured to perform slicing processing on an acquired file to be uploaded, where the slicing size is determined by preset or previous round of feedback data;
the file upload module 906 is configured to upload the fragmented file to a server. Judging that all fragments are uploaded completely, if yes, sending a fragment merging request to a server, requesting to merge all fragments into a completion file, otherwise, continuing to transmit the next round;
the correction calculation module 908 is configured to calculate, according to the previous transmission result, the current available bandwidth and the network speed in advance, and dynamically correct the total size of the next transmission segment in combination with the preset completion time. The number of concurrent slices and the size of the slices uploaded by each round are adjusted in a combined mode, and the number and the size of the concurrent slices can be dynamically increased or decreased.
In an exemplary embodiment of the present disclosure, as shown in fig. 10, the file upload scheme may include the steps of:
step S1002, obtaining a user uploading file and setting a related preset value.
Step S1004, performing first round of slice uploading.
Step S1006, according to the transmission result of the previous round, calculating the available bandwidth, dynamically adjusting the concurrent uploading fragment number and the size of each fragment of the next round of file, intercepting the next round of file for uploading until all fragments of the file are uploaded.
Step S1008, notifying the server to merge the fragments, and completing transmission.
In an exemplary embodiment of the present disclosure, as shown in fig. 11, the file upload scheme may include the steps of:
step 1102, presetting a file segmentation threshold according to an actual service, presetting the number of available concurrent uploading fragments, and setting a size threshold of each fragment.
Step S1104, obtain the file that the user needs to upload.
Step S1106, determining whether the file needs to be fragmented according to the threshold, if so, executing step S1108, and if not, executing step S1110.
In step S1108, the total size of the uploaded file is K, the time required for completing the uploading in each round is preset to be T, the first round of transmission is preset, and the total size of the file is k1=k.
In step S1110, the file is directly uploaded without slicing.
In step S1112, the ith group of fragments are uploaded, and Ti for completing the uploading of the ith group of fragments is recorded.
Step S1115, it is determined whether all the fragments of the file are uploaded, if yes, step S1116 is executed, and if no, step S1118 is executed.
Step S1116, the merging of the slices is started.
In step S1118, the current available bandwidth vi=i-th group upload file fragment size Ki ≡i-th group fragment completion time Ti is predicted.
In step S1120, the total size ki+1=vi×t of the i+1 group of uploading fragments is corrected, and the number of concurrently uploading fragments and the size of each fragment are dynamically adjusted.
In an exemplary embodiment of the present disclosure, as shown in fig. 12, the file upload scheme mainly relates to an interaction process between the client 1202 and the server 1204, and specifically includes:
the client 1202 performs the first round of uploading, the server 1204 returns a transmission result, the client 1202 estimates the current service available bandwidth, adjusts the transmission parameters of the next round (the number of concurrent uploading fragments and the size of each fragment), and cuts the transmission fragments of the next round.
The client 1202 performs the second round of uploading, the server 1204 returns a transmission result, the client 1202 estimates the current service available bandwidth, adjusts the transmission parameters of the next round (the number of concurrent uploading fragments and the size of each fragment), and cuts the transmission fragments of the next round.
After multiple rounds of transmission, all fragment transmissions are completed, the client 1202 sends a request for merging fragments, and the server 1204 returns a merging result.
In an exemplary embodiment of the present disclosure, as shown in fig. 13, the i-th round of uploading the fragment size 1302 in the fragmentation process of the file upload scheme is determined by the number of concurrent uploading fragments 1304 and the single fragment size 1306.
In an exemplary embodiment of the present disclosure, the total size of the slices of the file to be transmitted is K, where K is determined by the number of concurrently uploaded slices N and the single slice size M together, k=mxn. One of the basis for adjusting the size of the tiles is: judging whether the single slice size M meets the set single slice size threshold, wherein the threshold can set the limit of the size of the uploading file at the server, and is not suitable to be too large, and is generally 5MB.
In one exemplary embodiment of the present disclosure, increasing the number of concurrency is considered if the calculated single tile size is greater than the tile size threshold, otherwise increasing the single tile size may be considered.
In one exemplary embodiment of the present disclosure, the number of fragments is 2, considering the lowest number is 4, and needs to be reserved for other traffic.
In one exemplary embodiment of the present disclosure, N must be an integer, so 1 or 2 is added or subtracted each time, with a minimum of 1.
In one exemplary embodiment of the present disclosure, the general principle method of integrally adjusting M and N is:
1. the total size of the fragments transmitted in the current round can be determined to be K through the transmission result in the previous round, wherein K is determined by the number N of the concurrently uploaded fragments and the single fragment size M, and K=M×N.
2. Let a single tile size threshold be Limit, where N is preferably set to 2.
3. At this time, the total size K of the slices, the number N of the slices, and the single slice size m=k/N can be obtained.
4. And if the preset single slice size threshold value is Limit, uploading according to the current slice number N and the single slice size M if the single slice size M expected by the round is smaller than Limit, otherwise, increasing the slice number N on the premise that the single slice size cannot be enlarged, wherein the increment is that N is increased by 1 or 2 each time, and the assumption is that N=N+1 at the moment.
5. And (3) repeating the step (3) and the step (4) to calculate until the single fragment size meets Limit and uploading is carried out.
6. In the next round of transmission, N is first adjusted to 2, and the size of M is recalculated.
7. If N and M are increased anyway, both reach the maximum value, and still cannot reach the value of K, the maximum available M and N perform the transmission of the round, and there is a blocking situation, so that the time of the round is longer than the preset transmission time, and the size of the transmission K of the next round is adjusted.
In one exemplary embodiment of the present disclosure, as shown in fig. 15, adjusting the fragment size and the number of fragments includes the steps of:
in step S1502, the number N of concurrent uploading fragments is fixed, and the size of each fragment is adjusted.
Step S1504 determines whether the single segment size satisfies each of the concurrent segment size thresholds, if yes, step S1408 is executed, and if not, step S1406 is executed.
In step S1506, the number of concurrent uploading fragments is dynamically increased or decreased, and the size of each fragment is recalculated according to the number of fragments.
In step S1508, the number of concurrently uploaded fragments is unchanged N, and the sum of all fragment sizes is Ki.
Corresponding to the above method embodiment, the present disclosure further provides a file uploading device, which may be used to execute the above method embodiment.
Fig. 15 is a block diagram of a file uploading device in an exemplary embodiment of the present disclosure.
Referring to fig. 15, the file uploading apparatus 1500 may include:
the uploading module 1502 is configured to upload a file to be uploaded according to a preset transmission parameter.
And the adjusting module 1504 is configured to adjust the transmission parameters according to the transmission result of the uploading process.
The uploading module 1502 is configured to upload the file to be uploaded according to the adjusted transmission parameters.
In an exemplary embodiment of the present disclosure, the file uploading device 1500 is further configured to:
before uploading a file according to preset transmission parameters, presetting a fragmentation size threshold value and a preset value of the number of fragments for fragmenting the file to be uploaded;
presetting a size threshold of the file to be uploaded;
presetting an uploading time threshold of the file to be uploaded;
and pre-storing the transmission parameters according to the size threshold of the fragments, the preset value of the number of fragments, the size threshold and the uploading time threshold.
In one exemplary embodiment of the present disclosure, the adjustment module 1504 is further configured to:
analyzing the size and uploading time of the uploaded file contained in the transmission result;
determining an uploading speed according to the size of the uploaded file and the uploading time;
determining the bandwidth of the uploading process according to the uploading speed;
and adjusting the transmission parameters according to the bandwidth of the uploading process.
In one exemplary embodiment of the present disclosure, the adjustment module 1504 is further configured to:
comparing the size relation between the uploading time of the uploaded file and the uploading time threshold;
if the uploading time of the uploaded file is less than or equal to the uploading time threshold value, not adjusting the transmission parameters;
and if the uploading time of the uploaded file is determined to be greater than the uploading time threshold, adjusting the fragment size threshold and/or the preset fragment number value.
In an exemplary embodiment of the present disclosure, the upload module 1502 is further configured to:
judging whether the size of the file to be uploaded is smaller than or equal to the size threshold;
if the size of the file to be uploaded is smaller than or equal to the size threshold, uploading the file to be uploaded;
and if the size of the file to be uploaded is larger than the size threshold, carrying out fragmentation processing and uploading processing on the file to be uploaded according to a preset transmission parameter.
In an exemplary embodiment of the present disclosure, the upload module 1502 is further configured to:
if the size of the file to be uploaded is larger than the size threshold, performing fragmentation processing on the file to be uploaded according to the fragmentation size threshold and the preset value of the fragmentation number to obtain the fragmented file to be uploaded;
judging whether the size of the fragmented file is smaller than or equal to the fragmented size threshold;
and if the size of the fragmented file is smaller than or equal to the fragmented size threshold, performing fragmentation processing and uploading processing on the fragmented file.
In an exemplary embodiment of the present disclosure, the file uploading device 1500 is further configured to:
and if the fact that all the fragments of the file to be uploaded are uploaded is detected, triggering the receiving end of the file to be uploaded to merge all the fragments.
Since the functions of the apparatus 1500 are described in detail in the corresponding method embodiments, the disclosure is not repeated herein.
It should be noted that although in the above detailed description several modules or units of a device for action execution are mentioned, such a division is not mandatory. Indeed, the features and functionality of two or more modules or units described above may be embodied in one module or unit in accordance with embodiments of the present disclosure. Conversely, the features and functions of one module or unit described above may be further divided into a plurality of modules or units to be embodied.
In an exemplary embodiment of the present disclosure, an electronic device capable of implementing the above method is also provided.
Those skilled in the art will appreciate that the various aspects of the application may be implemented as a system, method, or program product. Accordingly, aspects of the application may be embodied in the following forms, namely: an entirely hardware embodiment, an entirely software embodiment (including firmware, micro-code, etc.) or an embodiment combining hardware and software aspects may be referred to herein as a "circuit," module "or" system.
An electronic device 1600 according to such an embodiment of the application is described below with reference to fig. 16. The electronic device 1600 shown in fig. 16 is merely an example, and should not be construed as limiting the functionality and scope of use of embodiments of the present application.
As shown in fig. 16, the electronic device 1600 is embodied in the form of a general purpose computing device. The components of the electronic device 1600 may include, but are not limited to: the at least one processing unit 1610, the at least one memory unit 1620, and a bus 1630 connecting the different system components (including the memory unit 1620 and the processing unit 1610).
Wherein the storage unit stores program code that is executable by the processing unit 1610 such that the processing unit 1610 performs steps according to various exemplary embodiments of the present application described in the above-described "exemplary methods" section of the present specification. For example, the processing unit 1610 may perform methods as shown in embodiments of the disclosure.
The memory unit 1620 may include readable media in the form of volatile memory units, such as Random Access Memory (RAM) 16201 and/or cache memory 16202, and may further include Read Only Memory (ROM) 16203.
The storage unit 1620 may also include a program/utility 16204 having a set (at least one) of program modules 16205, such program modules 16205 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each or some combination of which may include an implementation of a network environment.
Bus 1630 may be a local bus representing one or more of several types of bus structures including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or using any of a variety of bus architectures.
Electronic device 1600 may also communicate with one or more external devices 1640 (e.g., keyboard, pointing device, bluetooth device, etc.), as well as with one or more devices that enable a user to interact with the electronic device 1600, and/or with any device (e.g., router, modem, etc.) that enables the electronic device 1600 to communicate with one or more other computing devices. Such communication may occur through an input/output (I/O) interface 1650. Also, electronic device 1600 can communicate with one or more networks such as a Local Area Network (LAN), a Wide Area Network (WAN) and/or a public network, such as the Internet, through network adapter 1660. As shown, network adapter 1660 communicates with other modules of electronic device 1600 over bus 1630. It should be appreciated that although not shown, other hardware and/or software modules may be used in connection with electronic device 1600, including, but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, data backup storage systems, and the like.
From the above description of embodiments, those skilled in the art will readily appreciate that the example embodiments described herein may be implemented in software, or may be implemented in software in combination with the necessary hardware. Thus, the technical solution according to the embodiments of the present disclosure may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (may be a CD-ROM, a U-disk, a mobile hard disk, etc.) or on a network, including several instructions to cause a computing device (may be a personal computer, a server, a terminal device, or a network device, etc.) to perform the method according to the embodiments of the present disclosure.
In an exemplary embodiment of the present disclosure, a computer-readable storage medium having stored thereon a program product capable of implementing the method described above in the present specification is also provided. In some possible embodiments, the various aspects of the application may also be implemented in the form of a program product comprising program code for causing a terminal device to carry out the steps according to the various exemplary embodiments of the application as described in the "exemplary methods" section of this specification, when said program product is run on the terminal device.
The program product for implementing the above-described method according to an embodiment of the present application may employ a portable compact disc read-only memory (CD-ROM) and include program code, and may be run on a terminal device such as a personal computer. However, the program product of the present application is not limited thereto, and in this document, a readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium can be, for example, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium would include the following: an electrical connection having one or more wires, a portable disk, a hard disk, random Access Memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The computer readable signal medium may include a data signal propagated in baseband or as part of a carrier wave with readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A readable signal medium may also be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a 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.
Program code for carrying out operations of the present application may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C++ or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device, partly on a remote computing device, or entirely on the remote computing device or server. In the case of remote computing devices, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., connected via the Internet using an Internet service provider).
Furthermore, the above-described drawings are only schematic illustrations of processes included in the method according to the exemplary embodiment of the present application, and are not intended to be limiting. It will be readily appreciated that the processes shown in the above figures do not indicate or limit the temporal order of these processes. In addition, it is also readily understood that these processes may be performed synchronously or asynchronously, for example, among a plurality of modules.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any adaptations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.

Claims (10)

1. A method for uploading a file, comprising:
uploading the file to be uploaded according to preset transmission parameters;
adjusting the transmission parameters according to the transmission result of the uploading process;
and uploading the file to be uploaded according to the adjusted transmission parameters.
2. The method for uploading files according to claim 1, further comprising, before uploading the files according to the preset transmission parameters:
presetting a fragmentation size threshold value and a preset value of the number of fragments for fragmenting the file to be uploaded;
presetting a size threshold of the file to be uploaded;
presetting an uploading time threshold of the file to be uploaded;
and pre-storing the transmission parameters according to the size threshold of the fragments, the preset value of the number of fragments, the size threshold and the uploading time threshold.
3. The file uploading method according to claim 2, wherein adjusting the transmission parameters according to the transmission result of the uploading process comprises:
analyzing the size and uploading time of the uploaded file contained in the transmission result;
determining an uploading speed according to the size of the uploaded file and the uploading time;
determining the bandwidth of the uploading process according to the uploading speed;
and adjusting the transmission parameters according to the bandwidth of the uploading process.
4. The file uploading method according to claim 3, wherein adjusting the transmission parameters according to the transmission result of the uploading process comprises:
comparing the size relation between the uploading time of the uploaded file and the uploading time threshold;
if the uploading time of the uploaded file is less than or equal to the uploading time threshold value, not adjusting the transmission parameters;
and if the uploading time of the uploaded file is determined to be greater than the uploading time threshold, adjusting the fragment size threshold and/or the preset fragment number value.
5. The method for uploading files according to claim 2, wherein the uploading of the files to be uploaded according to the preset transmission parameters comprises:
judging whether the size of the file to be uploaded is smaller than or equal to the size threshold;
if the size of the file to be uploaded is smaller than or equal to the size threshold, uploading the file to be uploaded;
and if the size of the file to be uploaded is larger than the size threshold, carrying out fragmentation processing and uploading processing on the file to be uploaded according to a preset transmission parameter.
6. The method for uploading files according to claim 5, wherein if it is determined that the size of the file to be uploaded is greater than the size threshold, performing the fragmentation processing and the uploading processing on the file to be uploaded according to the preset transmission parameters comprises:
if the size of the file to be uploaded is larger than the size threshold, performing fragmentation processing on the file to be uploaded according to the fragmentation size threshold and the preset value of the fragmentation number to obtain the fragmented file to be uploaded;
judging whether the size of the fragmented file is smaller than or equal to the fragmented size threshold;
and if the size of the fragmented file is smaller than or equal to the fragmented size threshold, performing fragmentation processing and uploading processing on the fragmented file.
7. The file uploading method according to any of claims 1-6, further comprising:
and if the fact that all the fragments of the file to be uploaded are uploaded is detected, triggering the receiving end of the file to be uploaded to merge all the fragments.
8. A document uploading apparatus, comprising:
the uploading module is used for uploading the file to be uploaded according to preset transmission parameters;
the adjusting module is used for adjusting the transmission parameters according to the transmission result of the uploading process;
and the uploading module is used for uploading the file to be uploaded according to the adjusted transmission parameters.
9. An electronic device, comprising:
a memory; and
a processor coupled to the memory, the processor configured to perform the file upload method of any of claims 1-7 based on instructions stored in the memory.
10. A computer readable storage medium having stored thereon a program which when executed by a processor implements a file upload method according to any one of claims 1-7.
CN202311056318.7A 2023-08-21 2023-08-21 File uploading method and device, electronic equipment and readable medium Pending CN117041243A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311056318.7A CN117041243A (en) 2023-08-21 2023-08-21 File uploading method and device, electronic equipment and readable medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311056318.7A CN117041243A (en) 2023-08-21 2023-08-21 File uploading method and device, electronic equipment and readable medium

Publications (1)

Publication Number Publication Date
CN117041243A true CN117041243A (en) 2023-11-10

Family

ID=88624317

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311056318.7A Pending CN117041243A (en) 2023-08-21 2023-08-21 File uploading method and device, electronic equipment and readable medium

Country Status (1)

Country Link
CN (1) CN117041243A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117640655A (en) * 2023-12-05 2024-03-01 中移互联网有限公司 Data transmission method and device, electronic equipment and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117640655A (en) * 2023-12-05 2024-03-01 中移互联网有限公司 Data transmission method and device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN107172131B (en) File uploading method and device
CN113453045B (en) Network bandwidth prediction method, system, device and storage medium
CN110247816B (en) Index monitoring method and device
CN117041243A (en) File uploading method and device, electronic equipment and readable medium
CN113645150B (en) Transmission rate control method, apparatus, electronic device, and readable storage medium
CN114221954A (en) File transmission method and device, electronic equipment and storage medium
US20230025780A1 (en) Resource determining method and device
CN110324681B (en) Slicing method, device, storage medium and transmission system of multimedia data
US11487629B2 (en) Method, device and computer program product for managing data backup
CN105468706A (en) Page display method and device
CN109743386B (en) Session request sending method and device, electronic equipment and storage medium
CN115987965A (en) File uploading method, device, equipment and storage medium
CN113840313B (en) Network mode control method and device of mobile terminal and computer equipment
CN114189890A (en) Method, device, equipment and storage medium for updating network service quality model
CN112615916A (en) File deployment method and device, electronic equipment and storage medium
CN111901253B (en) Flow control method, flow control device, flow control medium and electronic equipment for storage system
CN112153094A (en) Data transmission control method and device between electronic devices
CN111176679A (en) Application program updating method and device
CN115484004B (en) Error message retry method and device, electronic equipment and storage medium
CN113315809B (en) High-speed data transmission delay tolerance method and system for medical equipment
CN113676397B (en) Spatial position data processing method and device, storage medium and electronic equipment
WO2023077871A1 (en) Indication method, reference signal sending method, communication node, and storage medium
CN114466006B (en) Touch screen information sending and responding method and device
CN116931918A (en) Interface generation method, device, storage medium and electronic equipment
CN106060158B (en) Method and device for judging state of target equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination