A file uploading method, system, client device and server

By dynamically setting the fragment size according to the network environment of the client device, the problem of inconsistent fragment sizes in large file uploads is solved, the upload speed and stability are improved, it is suitable for different file upload scenarios, and the user experience is enhanced.

CN115529307BActive Publication Date: 2024-10-25BEIJING QIYI CENTURY SCI & TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202211014836.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-23
Publication Date
2024-10-25
Estimated Expiration
2042-08-23

AI Technical Summary

Technical Problem

When uploading large files in the existing technology, the fixed-size fragmentation method is difficult to achieve good results in different file upload scenarios, resulting in fragments that are too large or too small, affecting upload speed and stability, and poor compatibility.

Method used

Determine the target upload network speed based on the network conditions of the client device within the preset time period, and dynamically set the target fragment size according to the target upload network speed to adapt to different file upload scenarios. The fragments will be larger when the network speed is faster, and the fragments will be larger when the network speed is slower. Time-sharding is smaller, reducing the number of upload requests and network overhead.

Benefits of technology

It improves the speed and stability of large file segmented uploads, reduces the network overhead of the file upload process, enhances user experience, is suitable for various file upload scenarios, and avoids the problem of too large or too small segment sizes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115529307B_ABST
    Figure CN115529307B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention provides a file upload method, system, client device and server. It includes: sending a target file upload request to a server; receiving a target segment size returned by the server; the target segment size is positively correlated with the target upload network speed; the target upload network speed is determined based on the network status within a preset time period of the client device; according to the target segment size, the target file to be uploaded is segmented and uploaded to the server. Applying the embodiment of the present invention, by determining the target upload network speed based on the network status within a preset time period of the client device, and determining the target segment size based on the target upload network speed, since the target segment size is dynamically set according to the network environment of the client device, in different file upload scenarios, the appropriate segment size that adapts to the current upload scenario can be flexibly set to avoid the segment size being too large or too small, and it has good compatibility and can be applied to different file upload scenarios.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer network technology, and in particular to a file uploading method, system, client device and server. Background Art

[0002] With the development of computer network technology, more and more applications support users to upload self-made content for playback, sharing, etc. For example, many audio and video applications support users to upload self-made videos and audio for playback. Usually, file upload is mostly done by converting the file into a byte stream for uploading. However, for larger files such as audio and video files, if the file is directly converted into a byte stream for uploading, once a network failure occurs, the file upload is interrupted and the upload needs to be restarted.

[0003] At present, for uploading large files, the method of parallel uploading is usually adopted. That is, the file to be uploaded is divided into multiple data blocks and uploaded separately. In this way, the upload speed can be improved and the upload time can be reduced. It can also achieve breakpoint resume and reduce the impact of network disconnection during the upload process.

[0004] In the prior art, files are usually segmented into fixed sizes based on manual experience. However, due to the fixed size of the segments, it is difficult to achieve good results in different file upload scenarios. It is easy for the segments to be too large or too small. If the segments are too large, the upload time of each segment will be too long, which increases the probability of segment upload failure and is not conducive to parallel upload and breakpoint resume. If the segments are too small, the number of requests for the entire file upload will increase, the network request overhead will increase, and it will not be conducive to subsequent file archiving and merging.

[0005] It can be seen that this method of uploading large files in pieces with a fixed size has poor compatibility and cannot be well applied to various file upload scenarios. Summary of the invention

[0006] The purpose of the embodiments of the present invention is to provide a file uploading method, system, client device, server and storage medium to improve the compatibility of file uploading methods. The specific technical solution is as follows:

[0007] In a first aspect of the implementation of the present invention, a file uploading method is first provided, which is applied to a client device, and the method comprises:

[0008] Send the target file upload request to the server;

[0009] Receive the target fragment size returned by the server; wherein the target fragment size is calculated by the server after receiving the target file upload request, and is positively correlated with the target upload network speed; the target upload network speed is determined based on the network status of the client device within a preset time period;

[0010] According to the target fragment size, the target file to be uploaded is divided into slices to obtain slices of each target file;

[0011] Upload each target file slice to the server.

[0012] In an embodiment of the present invention, the target fragment size is obtained based on a preset upload duration and the target upload network speed; wherein the target fragment size is positively correlated with the preset upload duration.

[0013] In an embodiment of the present invention, the preset upload duration is negatively correlated with the preset upload speed.

[0014] In one embodiment of the present invention, the preset upload speed is obtained in advance by the following steps:

[0015] Each file in a preset file set is split into fixed fragment sizes and then uploaded to a server; the preset file set includes files of different sizes;

[0016] Based on the size of each file and the time taken to complete uploading each file, determine an average upload speed of the preset file set as the average upload speed corresponding to the fixed segment size;

[0017] Changing the value of the fixed segment size, returning to the step of uploading each file in the preset file set to the server after segmenting the files according to the fixed segment size, until a preset end condition is reached;

[0018] A statistical value of each of the average upload speeds is determined as a preset upload speed.

[0019] In an embodiment of the present invention, determining the statistical value of each of the average upload speeds as the preset upload speed includes:

[0020] The fastest average upload speed among the average upload speeds is determined as the preset upload speed.

[0021] In an embodiment of the present invention, the preset upload duration is also positively correlated with a preset segment size; wherein the preset segment size is: a fixed segment size corresponding to the preset upload speed.

[0022] In one embodiment of the present invention, the method further comprises:

[0023] After the upload of each target file slice is completed, an archive merge request is sent to the server, so that the server merges the target file slices to obtain a target merged file.

[0024] In one embodiment of the present invention, the target upload network speed is:

[0025] The network speed statistics of the client device within a preset time period; wherein the preset time period is: the statistical value of the file upload completion time within a preset historical time of the client device.

[0026] In an embodiment of the present invention, the target file upload request includes the target upload network speed, and the method further includes:

[0027] Sending a target time period acquisition request to the server;

[0028] Receive a target time period returned by the server; the target time period is: a statistical value of the length of time it takes to complete file uploads by the client device within a preset historical time period stored by the server;

[0029] Determine the average network speed within the target time period as the target upload network speed.

[0030] In a second aspect of the present invention, a file uploading method is provided, which is applied to a server, and the method comprises:

[0031] In response to a target file upload request, a target segment size is calculated; the target segment size is positively correlated with a target upload network speed; the target upload network speed is determined based on a network condition within a preset time period of a client device that sends the target file upload request;

[0032] returning the target slice size to the client device;

[0033] Receive each target file slice uploaded by the client device; wherein each target file slice is obtained by the client device dividing the target file to be uploaded according to the target slice size.

[0034] In an embodiment of the present invention, the target fragment size is obtained based on a preset upload duration and the target upload network speed; wherein the target fragment size is positively correlated with the preset upload duration.

[0035] In an embodiment of the present invention, the preset upload duration is negatively correlated with the preset upload speed.

[0036] In one embodiment of the present invention, the preset upload speed is obtained in advance by the following steps:

[0037] Each file in a preset file set is split into fixed fragment sizes and then uploaded to a server; the preset file set includes files of different sizes;

[0038] Based on the size of each file and the time taken to complete uploading each file, determine an average upload speed of the preset file set as the average upload speed corresponding to the fixed segment size;

[0039] Changing the value of the fixed segment size, returning to the step of uploading each file in the preset file set to the server after segmenting the files according to the fixed segment size, until a preset end condition is reached;

[0040] A statistical value of each of the average upload speeds is determined as a preset upload speed.

[0041] In an embodiment of the present invention, determining the statistical value of each of the average upload speeds as the preset upload speed includes:

[0042] The fastest average upload speed among the average upload speeds is determined as the preset upload speed.

[0043] In an embodiment of the present invention, the preset upload duration is also positively correlated with a preset segment size; wherein the preset segment size is: a fixed segment size corresponding to the preset upload speed.

[0044] In one embodiment of the present invention, the method further comprises:

[0045] In response to an archive merge request, merge the target file slices to obtain a target merged file; the archive merge request is sent by the client device to the server after the target file slices are uploaded;

[0046] The target segment size, the upload completion time of the target file, and the target merged file are stored.

[0047] In an embodiment of the present invention, the target file upload request includes the target upload network speed; the method further includes:

[0048] In response to a target time period acquisition request, a target time period is determined and returned to the client device, so that the client device determines the average network speed within the target time period as the target upload network speed; wherein the target time period is a statistical value of the file upload completion time within a preset historical time period of the client device.

[0049] In a third aspect of the present invention, a file upload system is provided, the system comprising: a client device and a server;

[0050] The client device is used to send a target file upload request to the server; receive the target segment size returned by the server; divide the target file to be uploaded according to the target segment size to obtain target file segments; and upload the target file segments to the server;

[0051] The server is used to calculate the target segment size in response to the target file upload request; the target segment size is positively correlated with the target upload network speed; the target upload network speed is determined based on the network status within a preset time period of the client device; return the target segment size to the client device; receive each target file slice uploaded by the client device.

[0052] In an embodiment of the present invention, the target fragment size is obtained based on a preset upload duration and the target upload network speed; wherein the target fragment size is positively correlated with the preset upload duration.

[0053] In an embodiment of the present invention, the preset upload duration is negatively correlated with the preset upload speed.

[0054] In one embodiment of the present invention, the target fragment size is positively correlated with the preset upload duration, and the preset upload speed is obtained in advance by the following steps:

[0055] Each file in a preset file set is split into fixed fragment sizes and then uploaded to a server; the preset file set includes files of different sizes;

[0056] Based on the size of each file and the time taken to complete uploading each file, determine an average upload speed of the preset file set as the average upload speed corresponding to the fixed segment size;

[0057] Changing the value of the fixed segment size, returning to the step of uploading each file in the preset file set to the server after segmenting the files according to the fixed segment size, until a preset end condition is reached;

[0058] A statistical value of each of the average upload speeds is determined as a preset upload speed.

[0059] In an embodiment of the present invention, determining the statistical value of each of the average upload speeds as the preset upload speed includes:

[0060] The fastest average upload speed among the average upload speeds is determined as the preset upload speed.

[0061] In an embodiment of the present invention, the preset upload duration is also positively correlated with a preset segment size; wherein the preset segment size is: a fixed segment size corresponding to the preset upload speed.

[0062] In one embodiment of the present invention, the client device is further used to send an archive merge request to the server after the upload of each target file slice is completed;

[0063] The server is also used to merge the target file slices in response to the archive merge request to obtain a target merged file; store the target slice size, the upload completion time of the target file and the target merged file.

[0064] In one embodiment of the present invention, the target file upload request includes the target upload network speed;

[0065] The client device is further configured to send a target time period acquisition request to the server; receive the target time period returned by the server; and determine the average network speed within the target time period as the target upload network speed;

[0066] The server is also used to respond to the target time period acquisition request, determine the target time period and return it to the client device; wherein the target time period is a statistical value of the file upload completion time within a preset historical time of the client device.

[0067] In another aspect of the present invention, a client device is provided, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;

[0068] Memory, used to store computer programs;

[0069] The processor is used to implement any of the above-mentioned steps of the file uploading method applied to the client device when executing the program stored in the memory.

[0070] In another aspect of the present invention, a server is provided, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;

[0071] Memory, used to store computer programs;

[0072] The processor is used to implement any of the above-mentioned steps of the file uploading method applied to the server when executing the program stored in the memory.

[0073] In another aspect of the present invention, a computer-readable storage medium is provided, wherein a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, any of the above-mentioned file uploading methods is implemented.

[0074] In another aspect of the present invention, a computer program product comprising instructions is provided, which, when executed on a computer, enables the computer to execute any of the above-mentioned file uploading methods.

[0075] The file upload method provided by the embodiment of the present invention includes sending a target file upload request to a server; receiving a target segment size returned by the server; wherein the target segment size is calculated by the server after receiving the target file upload request, and is positively correlated with a target upload network speed; the target upload network speed is determined based on the network status within a preset time period of the client device; according to the target segment size, the target file to be uploaded is segmented to obtain target file slices; and the target file slices are uploaded to the server. By applying the embodiment of the present invention, the target upload network speed is determined based on the network status within a preset time period of the client device, and the target segment size is determined based on the target upload network speed, and the target file is segmented and uploaded according to the target segment size. Since the target segment size is dynamically set according to the network environment of the client device, the appropriate segment size that adapts to the current upload scenario can be flexibly set in different file upload scenarios, so that when the network environment is good and the network speed is fast, the segment size is larger, the number of upload requests is reduced, and the network overhead of network requests and archive merging is reduced; when the network speed is slow, the segment is smaller, the upload time of each segment is shortened, the probability of segment upload failure is reduced, and it is also more conducive to breakpoint resumption. It can be seen that the application of the embodiment of the present invention can avoid the occurrence of segment sizes that are too large or too small, has good compatibility, and can be applied to different file upload scenarios. BRIEF DESCRIPTION OF THE DRAWINGS

[0076] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art are briefly introduced below.

[0077] Figure 1 A schematic diagram of a process flow of a file uploading method provided in an embodiment of the present invention;

[0078] Figure 2 A schematic diagram of a process for determining a target upload speed in an embodiment of the present invention;

[0079] Figure 3 A schematic diagram of a process for determining a preset segment size and a preset upload speed in an embodiment of the present invention;

[0080] Figure 4 A second flow chart of the file uploading method provided in an embodiment of the present invention;

[0081] Figure 5 A third flow chart of the file uploading method provided in an embodiment of the present invention;

[0082] Figure 6 A structural diagram of a file upload system provided in an embodiment of the present invention;

[0083] Figure 7 A working schematic diagram of a file upload system provided in an embodiment of the present invention;

[0084] Figure 8 An interactive schematic diagram of a file upload system provided in an embodiment of the present invention;

[0085] Fig. 9 A schematic diagram of the structure of a client device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0086] The technical solutions in the embodiments of the present invention will be described below in conjunction with the accompanying drawings in the embodiments of the present invention.

[0087] In order to improve the compatibility of large file uploads, an embodiment of the present invention provides a file upload method, system, client device, server and storage medium. The following first describes the file upload method provided by the present invention by way of example:

[0088] The file uploading method provided by the present invention can be applied to application platforms such as video applications and audio applications that support users to upload files.

[0089] See also Figure 1 , Figure 1 A schematic diagram of a first embodiment of a method for uploading a file to a client device provided in an embodiment of the present invention. The client device may be a computer, a mobile phone, etc., on which an application client is installed. The client device may also be a computer, a mobile phone, etc., on which an application webpage is opened. The present invention does not specifically limit this.

[0090] like Figure 1 As shown, the above method may specifically include the following steps:

[0091] Step S110, sending a target file upload request to the server;

[0092] Step S120, receiving the target fragment size returned by the server;

[0093] The target fragment size is calculated by the server after receiving the target file upload request, and is positively correlated with the target upload network speed; the target upload network speed is determined based on the network status of the client device within a preset time period;

[0094] Step S130: Slice the target file to be uploaded according to the target slice size to obtain slices of each target file;

[0095] Step S140: Upload the target file slices to the server.

[0096] By applying the embodiment of the present invention, the target upload network speed is determined based on the network status within a preset time period of the client device, and the target fragment size is determined based on the target upload network speed, and the target file is segmented and uploaded according to the target fragment size. Since the target fragment size is dynamically set according to the network environment of the client device, the appropriate fragment size that adapts to the current upload scenario can be flexibly set in different file upload scenarios, so that the network environment is better. When the network speed is faster, the slice size is larger, the number of upload requests is reduced, and the network overhead of network requests and archive merging is reduced; when the network speed is slower, the fragment is smaller, the upload time of each fragment is shortened, the probability of fragment upload failure is reduced, and it is also more conducive to breakpoint resumption. It can be seen that the application of the embodiment of the present invention can avoid the occurrence of fragment sizes that are too large or too small, has good compatibility, and can be applied to different file upload scenarios. At the same time, it can improve the speed and stability of large file fragment uploads, reduce the network overhead of the file upload process, and improve the user experience.

[0097] The above steps S110-S140 are exemplarily described below:

[0098] After the client device receives the file upload request input by the user, the steps S110-S140 can be executed. The file upload request can be sent by the user by clicking the "Upload" button, dragging the file to be uploaded to a preset location, etc. The file upload request can include the target file to be uploaded and the description information of the target file, etc. The description information of the target file can include the identifier of the target file, a text description, and the size of the target file, etc. The identifier of the target file can be the title, code, etc. of the target file. The present invention does not make specific limitations on this.

[0099] After receiving the file upload request sent by the user, the client device may send a target file upload request to the server. The target file upload request may include the identifier of the client device. Of course, the target file upload request may also include the identifier of the target file to be uploaded, the size information of the target file, etc.

[0100] After receiving the above target file request, the server can start calculating the target shard size and return it to the above client device.

[0101] As described above, the target fragment size is calculated based on the target upload network speed. In an embodiment of the present invention, the target upload network speed can be determined based on the network status of the client device within a preset time period. Specifically, it is determined based on the network speed of the client device within a preset time period.

[0102] The target upload speed may be determined by the client device or by the server.

[0103] As an implementation method, the client device may determine its current network speed as the target upload network speed, which may be 1.2 Mb / s, 987 Kb / s, etc.

[0104] As another specific implementation, the client device may also determine the network speed statistics within a preset time period. The preset time period may be pre-set according to actual conditions and stored in the client device. For example, it may be 10s, 12s, or 23s, etc. Correspondingly, the target upload network speed may be the statistical value of the network speed of the client device within 10s, 12s, or 23s. The statistical value may be an average value or a median value.

[0105] The above-mentioned preset time period may also be a statistical value of the length of time it takes to complete the file upload within the preset historical time of the client device. As a specific implementation, the above-mentioned client device may store the length of time it takes to complete the file upload each time after uploading the file. Specifically, the above-mentioned client device may store the length of time it takes to complete the upload of each file within the preset historical time. The above-mentioned preset historical time may be set according to actual needs, such as within 7 days, 30 days, and so on. The above-mentioned statistical value may be an average value, a median, and so on. Of course, in order to better reflect the time required for the client device to upload files in most cases, the median of the length of time it takes to complete the file upload within the preset historical time of the client device may be determined as the above-mentioned preset time period. In this way, by determining the network speed statistical value within the preset time period of the client device as the target upload network speed, the target upload network speed may better reflect the possible network speed of the client device during the file upload process.

[0106] For example, if the file upload completion time of the client device in the preset historical time is 30s, 40s, 50s, 60s and 45s respectively, then the average network speed of the client device in the time period [t-45, t] can be determined as the target upload network speed, where t represents the current time.

[0107] As another implementation, the server may store the completion time of each file upload within a preset historical time of each client device. After receiving the target file upload request sent by the client device, the server may determine the statistical value of the completion time of the file upload within the preset historical time of the client device based on the client device identifier included in the target file upload request, and return it to the client device as the preset time period. The client device may calculate the network speed statistics of the client device within the preset time period based on the preset time period information obtained from the server.

[0108] Specifically, Figure 2 As shown, the client device can determine the target upload speed by following the steps below:

[0109] Step S111, sending a target time period acquisition request to the server;

[0110] The above target time period acquisition request includes a client device identifier.

[0111] Step S112, receiving the target time period returned by the server; the target time period is: the statistical value of the file upload completion time of the client device within the preset historical time stored by the server;

[0112] As mentioned above, the above statistical value may be an average value or a median value, etc.

[0113] Step S113: Determine the average network speed within the target time period as the target upload network speed.

[0114] In this way, there is no need to store the file upload completion time of the client device within the preset historical time in the client device, which can reduce the storage space occupied by the client device.

[0115] Of course, the above-mentioned target upload network speed can also be completely determined by the server. For example, the above-mentioned server can obtain the network status of the client device once at a certain interval. For example, the server can obtain the network speed of the client device once at intervals of 1s, 5s, etc. When receiving the target file upload request sent by the client device, the preset time period can be determined based on the statistical value of the file upload completion time of the above-mentioned client device within the preset historical time stored in the server. And based on the obtained network speed of the client device, the network speed statistics of the above-mentioned client device within the preset time period are determined as the target upload network speed.

[0116] Of course, the target upload speed may also be determined by other feasible methods, and the present invention does not specifically limit this.

[0117] After obtaining the target upload speed, the server can calculate the target fragment size based on the target upload speed according to a preset algorithm. The unit of the target fragment size is byte unit, such as Kb, Mb, etc., which can be preset according to actual needs.

[0118] In one embodiment of the present invention, the server can determine the target fragment size based on the product of the target upload network speed and the preset upload time. The preset upload time can be set according to actual needs, such as 0.2s, 0.5s, 1min, etc.

[0119] For example, if the target upload speed is a, in Mb / s or Kb / s, etc., and the preset upload duration is k, in s or min, etc., then k*a can be determined as the target fragment size, in Mb or Kb, etc.

[0120] The upload speed usually affects the upload duration. In one embodiment of the present invention, the preset upload duration may be negatively correlated with the preset upload speed. The preset upload speed may be preset according to actual conditions, such as 600 kb / s, 750 kb / s, 1 mb / s, etc.

[0121] As a specific implementation, the target shard size may be calculated according to the following formula:

[0122]

[0123] In this formula, S represents the target shard size in Kb, Mb, etc., V represents the target upload speed; Vn is the preset upload speed, C is a preset constant greater than 0, and C / Vn is the preset upload duration.

[0124] In one embodiment of the present invention, the preset upload duration may also be the quotient of the preset fragment size and the preset upload speed. That is, the server may also calculate the target fragment size corresponding to the target upload network speed based on the target upload network speed, the preset upload speed and the preset fragment size. The preset upload speed and the preset fragment size may both be preset according to actual conditions.

[0125] Specifically, the target shard size may be calculated according to the following formula.

[0126]

[0127] In this formula, S represents the target segment size, V represents the target upload speed, Vn is the preset upload speed, Sn is the preset segment size, and Sn / Vn is the preset upload duration.

[0128] Of course, in other embodiments of the present invention, the above-mentioned preset algorithm, preset upload speed and preset fragment size can be stored in the client device, and the client device can calculate the target fragment size based on the above-mentioned target upload network speed, preset algorithm, preset upload speed and preset fragment size. However, by using the method in which the server calculates the target fragment size, there is no need for the client device to calculate the target fragment size, which can save the storage space and computing resource overhead of the client device.

[0129] In one embodiment of the present invention, the preset upload speed and the preset segment size can be obtained through experiments. Figure 3As shown, the preset upload speed and the preset fragment size can be determined by the following steps:

[0130] Step S310: Split each file in a preset file set into a fixed fragment size and upload the split file to a server; the preset file set includes files of different sizes;

[0131] Step S320: Based on the size of each file and the time taken to complete uploading each file, determine the average upload speed of the preset file set as the average upload speed corresponding to the fixed segment size;

[0132] Step S330, determine whether the preset end condition is met; if so, execute step S340; if not, change the fixed slice size and return to step S310;

[0133] Step S340: Determine a statistical value of each of the average upload speeds as a preset upload speed.

[0134] Step S350: Determine a fixed fragment size corresponding to the preset upload speed as the preset fragment size.

[0135] The above steps S310-S350 are exemplarily described below:

[0136] The above steps S310-S350 may be executed in the application client or in the web page of the application, which is not specifically limited in the present invention.

[0137] The files in the above-mentioned preset file set may be files of the same type and format, or files of different types and formats, etc. For example, it may include only video files in MPEG format, or only video files in AVI and MPEG formats, or video files in AVI format and audio files in WMA format, etc.

[0138] The fixed segment size may be any preset value, such as 123kb, 246kb, etc. In order to ensure the test efficiency, the fixed segment may be set to be smaller than the smallest file in the preset file set.

[0139] After determining the fixed segment size, each file in the preset file set may be segmented according to the fixed segment size to obtain file slices of each file, and the file slices of each file may be uploaded to the server.

[0140] In step S320, the upload speed of each file can be calculated based on the size of each file and the upload completion time of each file, and then the average upload speed of the preset file set is calculated. The upload speed of each file is the quotient of the file size and the upload completion time of the file.

[0141] In an embodiment of the present invention, the above-mentioned upload completion duration refers to the time required to upload each file slice. It can be the time required to upload all the above-mentioned file slices, or it can refer to a preset duration. For example, the upload completion duration can be preset to 10 minutes. When calculating the upload speed of each file for each file, the size of the file slice that has been uploaded within the preset upload completion duration can be determined. The quotient of the size of the uploaded file slice and the preset upload completion duration is calculated as the upload speed of the file. Then, based on the upload speed of each file, the average upload speed of the preset file set is determined.

[0142] Of course, the sum of the sizes of the uploaded file slices in the entire preset file set may also be counted, and the quotient of the sum of the sizes of the file slices and the upload completion time may be calculated as the average upload speed of the preset file set.

[0143] After executing the above steps S310-S320, it can be determined whether the preset end condition is currently reached. The above preset end condition can be a preset fixed segment size, a preset upload number or a preset upload time, etc.

[0144] For example, a preset value may be added to the current fixed slice size each time as a new fixed slice size. The preset value may be 20 kb, 30 kb, etc., and may be set specifically according to actual test needs. After executing the above steps S310-S320, it may be determined whether the current fixed slice size reaches the preset fixed slice size.

[0145] If the current fixed slice size does not reach the preset fixed slice size, the preset value is added to the current fixed slice size as the new fixed slice size, and the above steps S310-S320 are repeated. If the preset fixed slice size is reached, it is determined that the preset end condition is met, and steps S340-S350 can be executed.

[0146] The above-mentioned preset upload times can be set for the number of tests. Of course, there may be files that fail to be uploaded during the test, and the above-mentioned preset upload times can also be set for the sum of the upload times of all files in the preset file set. For example, the preset file set contains 10 files of different sizes. After each upload of 10 files in the preset file set, the number of tests can be recorded, that is, the number of uploads + 1 can be recorded, and based on the number of uploads, it can be determined whether the preset upload number has been reached. It is also possible to record the sum of the upload times of each file, that is, record the number of uploads + 10, and based on the number of uploads, determine whether the preset upload number has been reached.

[0147] If the preset upload times have not been reached, the fixed segment size value is changed and the above steps S310-S320 are repeated. If the preset upload times have been reached, it can be determined that the preset end condition has been reached.

[0148] The above-mentioned preset upload time can be set according to the actual test needs, such as 1 hour, 3 hours, etc. After executing the above steps S310-S320, it can be determined whether the upload completion time of the preset file set reaches the above-mentioned preset upload time. If the preset upload time is not reached, the value of the fixed segment size is changed, and the above steps S310-S320 are repeated. If the preset upload time is reached, it can be determined that the preset end condition is currently reached. The upload completion time of the above-mentioned preset file set can be the file with the longest upload completion time among the files in the preset file set. It can also be the sum of the upload completion time of each file in the preset file set.

[0149] If the preset end condition is currently reached, steps S340-S350 may be executed to determine the preset upload speed and the preset segment size.

[0150] Specifically, a statistical value of the above average upload speeds can be determined as the preset upload speed. The above statistical value can be an average value, a median, a maximum value, etc., or can be any average speed greater than a preset speed threshold among the average upload speeds, or a statistical value, a median, etc. of the average speeds greater than the preset speed threshold.

[0151] The above-mentioned preset fragment size is a fixed fragment size corresponding to the preset upload speed. Specifically, if the above-mentioned preset upload speed is an average speed among the average speeds, such as the maximum value, the median, or any average speed greater than the preset speed threshold, the fixed fragment size corresponding to the average speed during the test can be used as the preset fragment size. If the above-mentioned preset upload speed is the average value of the average speeds, the fixed fragment size corresponding to the preset upload speed is also the average value of the fixed fragment sizes.

[0152] In one embodiment of the present disclosure, in order to increase the upload speed of the target file segments as much as possible and shorten the upload time of each target file segment, the minimum upload duration obtained in the experiment can be determined as the preset upload duration. As described above, the preset upload duration is negatively correlated with the preset upload speed. Therefore, the fastest average speed among the average upload speeds can be selected as the preset upload speed, such as determining the maximum value among the average speeds as the preset upload speed. And the fixed segment size corresponding to the preset upload speed is used as the preset segment size.

[0153] After the server calculates the target segment size, it returns the target segment size to the client device. After receiving the target segment size returned by the server, the client device can divide the target file to be uploaded according to the target segment size to obtain each target file slice and upload it to the server.

[0154] Each of the above target file slices may include the start and end positions of the target file slice, as well as information such as the identifier of the target file. The position of the target file slice may identify the position of the target file slice in the entire target file. For example, 0-153kb, 154kb-307kb, etc. The identifier of the target file may be the name, encoding, etc. of the target file. Before uploading each of the above target file slices, the client device may also upload the size information of the target file to the server.

[0155] The server can receive and store the target file slices. As an implementation, the target file slices, the start and end positions of the target file slices, and the target file identifiers can be stored in a storage module. The storage module can be in the server or in a cloud storage module, which is not specifically limited in the present invention.

[0156] As described above, the start and end positions of each target file slice can identify the position of the target file slice in the target file. The server can determine whether the upload of each target file slice is complete based on the received target file size information and the start and end positions of the target file slice. For example, the server can determine whether all target file slices have been uploaded by determining whether the start and end positions of each target file slice have reached the target file size each time the target file slice is received. For example, if the file size is 5MB, when the start and end positions of each received target file slice constitute 0-5MB, it can be determined that the upload of each target file slice is complete.

[0157] After the server determines that each target file slice has been uploaded, it can synthesize each target file slice in sequence according to the start and end positions of each target file to obtain a target merged file. In order to save storage space, after obtaining the above target merged file, the server can store the above target merged file and delete the previously stored target file slices and target file slice information.

[0158] At the same time, the server can also store information such as the target segment size of the uploaded target file, the upload completion time, the start and end time of the target file upload, and the corresponding client device identification in the storage module.

[0159] As described above, the server can store each target file slice in the storage module, so when merging each target file slice, the server can first request each target file slice from the storage module, and merge each target file slice returned by the storage module to obtain a target merged file.

[0160] The above method of determining whether the target file slice is uploaded by the server side has a large resource overhead because the server side needs to make a judgment every time it receives the target file slice. Therefore, in one embodiment of the present invention, the client side can send a corresponding request to the server side after each target file slice is uploaded, without the server side having to judge whether each target file slice is uploaded, so as to save server side resource overhead. Specifically, based on Figure 1 ,like Figure 4 As shown, the above method may also include:

[0161] Step S450: After the upload of each target file slice is completed, an archive merge request is sent to the server so that the server merges the target file slices to obtain a target merged file.

[0162] The above archive merge request may include a target file identifier.

[0163] After receiving the above archive merge request, the server can merge the target file slices corresponding to the target file identifier contained in the request in sequence according to the start and end positions of the target file slices to obtain the target merged file.

[0164] In summary, it can be seen that by applying the embodiments of the present invention, the fragment size is dynamically set according to the network environment, so as to avoid the long upload time of each fragment caused by the fragment being too large, which increases the probability of fragment upload failure, and at the same time avoid the excessive number of file upload requests caused by the fragment being too small, which increases the network request overhead. The speed and stability of large file fragment upload can be improved, the network overhead of the file upload process can be reduced, and the user experience can be improved.

[0165] The present invention also provides a file upload method, which is applied to the server. Figure 5 , Figure 5 A flowchart of a file uploading method applied to a server provided in an embodiment of the present invention may specifically include the following steps:

[0166] Step S510: In response to the target file upload request, calculate the target fragment size; the target fragment size is positively correlated with the target upload network speed; the target upload network speed is determined based on the network status of the client device that sends the target file upload request within a preset time period;

[0167] Step S520: Return the target slice size to the client device;

[0168] Step S530, receiving each target file slice uploaded by the client device; wherein each target file slice is obtained by the client device dividing the target file to be uploaded according to the target slice size.

[0169] By applying the embodiment of the present invention, the target upload network speed is determined based on the network status within a preset time period of the client device, and the target segment size is determined based on the target upload network speed, and the target file is segmented and uploaded according to the target segment size. Since the target segment size is dynamically set according to the network environment of the client device, the appropriate segment size that adapts to the current upload scenario can be flexibly set in different file upload scenarios, so that when the network environment is good and the network speed is fast, the segment size is larger, the number of upload requests is reduced, and the network overhead of network requests and archive merging is reduced; when the network speed is slow, the segment is smaller, the upload time of each segment is shortened, the probability of segment upload failure is reduced, and it is also more conducive to breakpoint resumption. It can be seen that the application of the embodiment of the present invention can avoid the occurrence of segment sizes that are too large or too small, has good compatibility, and can be applied to different file upload scenarios.

[0170] In an embodiment of the present invention, the target fragment size is obtained based on a preset upload duration and the target upload network speed; wherein the target fragment size is positively correlated with the preset upload duration.

[0171] In an embodiment of the present invention, the preset upload duration is negatively correlated with the preset upload speed.

[0172] In one embodiment of the present invention, the preset upload speed is obtained in advance by the following steps:

[0173] Each file in a preset file set is split into fixed fragment sizes and then uploaded to a server; the preset file set includes files of different sizes;

[0174] Based on the size of each file and the time taken to complete uploading each file, determine an average upload speed of the preset file set as the average upload speed corresponding to the fixed segment size;

[0175] Changing the value of the fixed segment size, returning to the step of uploading each file in the preset file set to the server after segmenting the files according to the fixed segment size, until a preset end condition is reached;

[0176] A statistical value of each of the average upload speeds is determined as a preset upload speed.

[0177] In an embodiment of the present invention, determining the statistical value of each of the average upload speeds as the preset upload speed includes:

[0178] The fastest average upload speed among the average upload speeds is determined as the preset upload speed.

[0179] In an embodiment of the present invention, the preset upload duration is also positively correlated with a preset segment size; wherein the preset segment size is: a fixed segment size corresponding to the preset upload speed.

[0180] In one embodiment of the present invention, the method further comprises:

[0181] In response to an archive merge request, merge the target file slices to obtain a target merged file; the archive merge request is sent by the client device to the server after the target file slices are uploaded;

[0182] The target segment size, the upload completion time of the target file, and the target merged file are stored.

[0183] In an embodiment of the present invention, the target file upload request includes the target upload network speed; the method further includes:

[0184] In response to a target time period acquisition request, a target time period is determined and returned to the client device, so that the client device determines the average network speed within the target time period as the target upload network speed; wherein the target time period is a statistical value of the file upload completion time within a preset historical time period of the client device.

[0185] The above-mentioned file uploading method applied to the server can refer to the embodiment of the file uploading method applied to the client device, which will not be repeated here.

[0186] In another aspect of the present invention, a file upload system is also provided. Figure 6 As shown, the above system may include: a client device 610 and a server 620 .

[0187] The client device 610 is used to send a target file upload request to the server; receive the target segment size returned by the server; divide the target file to be uploaded into segments according to the target segment size to obtain target file segments; and upload the target file segments to the server;

[0188] The server 620 is used to calculate the target segment size in response to the target file upload request; the target segment size is positively correlated with the target upload network speed; the target upload network speed is determined based on the network status within a preset time period of the client device; return the target segment size to the client device; receive each target file slice uploaded by the client device.

[0189] By applying the embodiment of the present invention, the target upload network speed is determined based on the network status within a preset time period of the client device, and the target segment size is determined based on the target upload network speed, and the target file is segmented and uploaded according to the target segment size. Since the target segment size is dynamically set according to the network environment of the client device, the appropriate segment size that adapts to the current upload scenario can be flexibly set in different file upload scenarios, so that when the network environment is good and the network speed is fast, the segment size is larger, the number of upload requests is reduced, and the network overhead of network requests and archive merging is reduced; when the network speed is slow, the segment is smaller, the upload time of each segment is shortened, the probability of segment upload failure is reduced, and it is also more conducive to breakpoint resumption. It can be seen that the application of the embodiment of the present invention can avoid the occurrence of segment sizes that are too large or too small, has good compatibility, and can be applied to different file upload scenarios.

[0190] In an embodiment of the present invention, the target fragment size is obtained based on a preset upload duration and the target upload network speed; wherein the target fragment size is positively correlated with the preset upload duration.

[0191] In an embodiment of the present invention, the preset upload duration is negatively correlated with the preset upload speed.

[0192] In one embodiment of the present invention, the preset upload speed is obtained in advance by the following steps:

[0193] Each file in a preset file set is split into fixed fragment sizes and then uploaded to a server; the preset file set includes files of different sizes;

[0194] Based on the size of each file and the time taken to complete uploading each file, determine an average upload speed of the preset file set as the average upload speed corresponding to the fixed segment size;

[0195] Changing the value of the fixed segment size, returning to the step of uploading each file in the preset file set to the server after segmenting the files according to the fixed segment size, until a preset end condition is reached;

[0196] A statistical value of each of the average upload speeds is determined as a preset upload speed.

[0197] In an embodiment of the present invention, determining the statistical value of each of the average upload speeds as the preset upload speed includes:

[0198] The fastest average upload speed among the average upload speeds is determined as the preset upload speed.

[0199] In an embodiment of the present invention, the preset upload duration is also positively correlated with a preset segment size; wherein the preset segment size is: a fixed segment size corresponding to the preset upload speed.

[0200] In an embodiment of the present invention, the client device 610 is further configured to send an archive merge request to the server after the upload of each target file slice is completed;

[0201] The server 620 is also used to merge the target file slices in response to the archive merge request to obtain a target merged file; store the target slice size, the upload completion time of the target file and the target merged file.

[0202] In one embodiment of the present invention, the target file upload request includes the target upload network speed;

[0203] The client device 610 is further configured to send a target time period acquisition request to the server; receive the target time period returned by the server; and determine the average network speed within the target time period as the target upload network speed;

[0204] The server 620 is further configured to respond to the target time period acquisition request, determine the target time period and return it to the client device; wherein the target time period is a statistical value of the file upload completion time within a preset historical time of the client device.

[0205] The above system embodiment can refer to the description of the previous method embodiment part, which is only briefly explained here and will not be repeated.

[0206] like Figure 7 As shown, Figure 7 1 is a schematic diagram of a file upload system provided by an embodiment of the present invention. The file upload system may include: a client device, a server, and a storage module. The storage module may be a storage module in the server or a cloud storage module.

[0207] The client device is used for network monitoring, determining the target upload speed, sending it to the server, and performing file segmentation and segmentation upload according to the segment size returned by the server.

[0208] The server is used to calculate the size of the slices, receive and store the file slices uploaded by the client device to the storage module, and archive the files, that is, archive and merge the file slices to obtain the target merged file, and delete the file slices stored in the storage module.

[0209] The storage module is used to store user upload logs (including segment size, file upload start and end time) and store target merged files.

[0210] like Figure 8 As shown, Figure 8 An interactive schematic diagram of the file upload system provided by the present invention may specifically include the following steps:

[0211] Step S801: The client device sends a target time period acquisition request to the server;

[0212] Step S802: The server determines the median of the time it takes to complete the file upload by the client device within a preset historical period as the target time period;

[0213] Step S803: The server returns the target time period to the client device;

[0214] Step S804: The client device determines the average network speed within the target time period as the target upload network speed;

[0215] Step S805: The client device sends the target upload speed to the server;

[0216] Step S806: The server calculates the target fragment size based on the target upload network speed, the preset upload speed and the preset fragment size;

[0217] Step S807: The server returns the target fragment size to the client device;

[0218] Step S808: The client device divides the target file into slices according to the target slice size to obtain slices of each target file;

[0219] Step S809: The client device uploads each target file slice to the server;

[0220] Step S810: The server stores each target file slice in a storage module;

[0221] Step S811: After the upload of each target file slice is completed, the client device sends an archive merge request to the server;

[0222] Step S812: The server requests each target file slice from the storage module;

[0223] Step S813: The storage module sends each target file slice to the server;

[0224] Step S814: The server merges the target file slices to obtain a target merged file;

[0225] Step S815: The server stores the target merged file, the target segment size, and the target file upload completion time in the storage module, and deletes each target file segment stored in the storage module.

[0226] The embodiment of the present invention also provides a client device and a server. The client device can be a computer, a mobile phone, etc.

[0227] like Fig. 9 As shown, the client device includes a processor 901, a communication interface 902, a memory 903 and a communication bus 904, wherein the processor 901, the communication interface 902, and the memory 903 communicate with each other through the communication bus 904.

[0228] Memory 903, used for storing computer programs;

[0229] The processor 901 is used to execute the program stored in the memory 903 to implement the following steps:

[0230] Send the target file upload request to the server;

[0231] Receive the target fragment size returned by the server; wherein the target fragment size is calculated by the server after receiving the target file upload request, and is positively correlated with the target upload network speed; the target upload network speed is determined based on the network status of the client device within a preset time period;

[0232] According to the target fragment size, the target file to be uploaded is divided into slices to obtain slices of each target file;

[0233] Upload each target file slice to the server.

[0234] The server includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus. For the specific structure, please refer to Fig. 9 ,

[0235] Memory, used to store computer programs;

[0236] The processor is used to execute the program stored in the memory, and implements the following steps:

[0237] In response to a target file upload request, a target segment size is calculated; the target segment size is positively correlated with a target upload network speed; the target upload network speed is determined based on a network condition within a preset time period of a client device that sends the target file upload request;

[0238] returning the target slice size to the client device;

[0239] Receive each target file slice uploaded by the client device; wherein each target file slice is obtained by the client device dividing the target file to be uploaded according to the target slice size.

[0240] The communication bus mentioned in the above terminal can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0241] The communication interface is used for communication between the above terminal and other devices.

[0242] The memory may include a random access memory (RAM) or a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.

[0243] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0244] In another embodiment of the present invention, a computer-readable storage medium is provided, in which a computer program is stored. When the computer program is executed by a processor, the file uploading method described in any one of the above embodiments is implemented.

[0245] In another embodiment provided by the present invention, a computer program product including instructions is also provided, which, when executed on a computer, enables the computer to execute any of the file uploading methods described in the above embodiments.

[0246] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk Solid State Disk (SSD)), etc.

[0247] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0248] Each embodiment in this specification is described in a related 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, client device, server, storage medium and program product embodiments, since they are 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.

[0249] The above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.

Claims

1. A file uploading method, characterized in that: Applied to a client device, the method comprises: Send the target file upload request to the server; Receive the target fragment size returned by the server; wherein the target fragment size is calculated by the server after receiving the target file upload request, and is positively correlated with the target upload network speed; the target upload network speed is determined based on the network status of the client device within a preset time period; According to the target fragment size, the target file to be uploaded is divided into slices to obtain slices of each target file; Upload each target file slice to the server; The target fragment size is obtained based on the preset upload duration and the target upload network speed; the preset upload duration is negatively correlated with the preset upload speed; The preset upload speed is obtained in advance by the following steps: Each file in a preset file set is split into fixed fragment sizes and then uploaded to a server; the preset file set includes files of different sizes; Based on the size of each file and the time taken to complete uploading each file, determine an average upload speed of the preset file set as the average upload speed corresponding to the fixed segment size; Changing the value of the fixed segment size, returning to the step of uploading each file in the preset file set to the server after segmenting the files according to the fixed segment size, until a preset end condition is reached; A statistical value of each of the average upload speeds is determined as a preset upload speed.

2. The method according to claim 1, characterized in that The target segment size is positively correlated with the preset upload duration.

3. The method according to claim 1, characterized in that The step of determining the statistical value of each of the average upload speeds as the preset upload speed includes: The fastest average upload speed among the average upload speeds is determined as the preset upload speed.

4. The method according to claim 1, characterized in that: The preset upload duration is also positively correlated with the preset segment size; wherein the preset segment size is: a fixed segment size corresponding to the preset upload speed.

5. The method according to claim 1, characterized in that The method further comprises: After the upload of each target file slice is completed, an archive merge request is sent to the server, so that the server merges the target file slices to obtain a target merged file.

6. The method according to claim 1, characterized in that The target upload speed is: The network speed statistics of the client device within a preset time period; wherein the preset time period is: the statistical value of the file upload completion time within a preset historical time of the client device.

7. The method according to claim 1, characterized in that The target file upload request includes the target upload network speed, and the method further includes: Sending a target time period acquisition request to the server; Receive a target time period returned by the server; the target time period is: a statistical value of the length of time it takes to complete file uploads by the client device within a preset historical time period stored by the server; Determine the average network speed within the target time period as the target upload network speed.

8. A file uploading method, characterized in that: Applied to the server, the method includes: In response to a target file upload request, a target segment size is calculated; the target segment size is positively correlated with a target upload network speed; the target upload network speed is determined based on a network condition within a preset time period of a client device that sends the target file upload request; returning the target slice size to the client device; Receive each target file slice uploaded by the client device; wherein each target file slice is obtained by the client device dividing the target file to be uploaded according to the target slice size; The target fragment size is obtained based on the preset upload duration and the target upload network speed; the preset upload duration is negatively correlated with the preset upload speed; The preset upload speed is obtained in advance by the following steps: Each file in a preset file set is split into fixed fragment sizes and then uploaded to a server; the preset file set includes files of different sizes; Based on the size of each file and the time taken to complete uploading each file, determine an average upload speed of the preset file set as the average upload speed corresponding to the fixed segment size; Changing the value of the fixed segment size, returning to the step of uploading each file in the preset file set to the server after segmenting the files according to the fixed segment size, until a preset end condition is reached; A statistical value of each of the average upload speeds is determined as a preset upload speed.

9. The method according to claim 8, characterized in that The target segment size is positively correlated with the preset upload duration.

10. The method according to claim 8, characterized in that The step of determining the statistical value of each of the average upload speeds as the preset upload speed includes: The fastest average upload speed among the average upload speeds is determined as the preset upload speed.

11. The method according to claim 8, characterized in that The preset upload duration is also positively correlated with the preset segment size; wherein the preset segment size is: a fixed segment size corresponding to the preset upload speed.

12. The method according to claim 8, characterized in that The method further comprises: In response to an archive merge request, merge the target file slices to obtain a target merged file; the archive merge request is sent by the client device to the server after the target file slices are uploaded; The target segment size, the upload completion time of the target file, and the target merged file are stored.

13. The method according to claim 8, characterized in that The target file upload request includes the target upload network speed; the method further includes: In response to a target time period acquisition request, a target time period is determined and returned to the client device, so that the client device determines the average network speed within the target time period as the target upload network speed; wherein the target time period is a statistical value of the file upload completion time within a preset historical time period of the client device.

14. A file upload system, characterized in that: The system comprises: a client device and a server; The client device is used to send a target file upload request to the server; receive the target segment size returned by the server; divide the target file to be uploaded according to the target segment size to obtain target file segments; and upload the target file segments to the server; The server is used to calculate the target slice size in response to the target file upload request; the target slice size is positively correlated with the target upload network speed; the target upload network speed is determined based on the network status of the client device within a preset time period; return the target slice size to the client device; receive each target file slice uploaded by the client device; The target fragment size is obtained based on the preset upload duration and the target upload network speed; the preset upload duration is negatively correlated with the preset upload speed; The preset upload speed is obtained in advance by the following steps: Each file in a preset file set is split into fixed fragment sizes and then uploaded to a server; the preset file set includes files of different sizes; Based on the size of each file and the time taken to complete uploading each file, determine an average upload speed of the preset file set as the average upload speed corresponding to the fixed segment size; Changing the value of the fixed segment size, returning to the step of uploading each file in the preset file set to the server after segmenting the files according to the fixed segment size, until a preset end condition is reached; A statistical value of each of the average upload speeds is determined as a preset upload speed.

15. The system according to claim 14, characterized in that The target segment size is positively correlated with the preset upload duration.

16. The system according to claim 14, characterized in that The step of determining the statistical value of each of the average upload speeds as the preset upload speed includes: The fastest average upload speed among the average upload speeds is determined as the preset upload speed.

17. The system according to claim 14, characterized in that The preset upload duration is also positively correlated with the preset segment size; wherein the preset segment size is: a fixed segment size corresponding to the preset upload speed.

18. The system according to claim 14, characterized in that The client device is also used to send an archive merge request to the server after the upload of each target file slice is completed; The server is also used to merge the target file slices in response to the archive merge request to obtain a target merged file; store the target slice size, the upload completion time of the target file and the target merged file.

19. The system according to claim 14, characterized in that The target file upload request includes the target upload network speed; The client device is further configured to send a target time period acquisition request to the server; receive the target time period returned by the server; and determine the average network speed within the target time period as the target upload network speed; The server is also used to respond to the target time period acquisition request, determine the target time period and return it to the client device; wherein the target time period is a statistical value of the file upload completion time within a preset historical time of the client device.

20. A client device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, for implementing the method steps described in any one of claims 1 to 7 when executing a program stored in a memory.

21. A server, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, for implementing the method steps described in any one of claims 8 to 13 when executing a program stored in a memory.

22. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method steps described in any one of claims 1-7 or 8-13 are implemented.