Large file segmentation breakpoint continuous uploading method, device and system
By sharding and concurrently uploading large files to the server on the client, and recording and restoring shard files on the server, the problems of excessive uploading time and waste of resources in the existing technology are solved, and the breakpoint upload and second transfer functions are realized.
Patent Information
- Application Number
- CN202311359792.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-19
- Publication Date
- 2025-04-22
AI Technical Summary
In the prior art, large files are uploaded due to the bandwidth and connectivity of the http service, which leads to excessively large files being unable to be uploaded, the upload time is too long, the user experience is poor, and when the file upload fails, it needs to be uploaded again from scratch, resulting in wasted resources.
By dividing the original file into multiple shard files on the client according to the preset sharding algorithm, and using the prefetch check return information to determine the unuploaded shard files, it is uploaded concurrently to the server. The server receives shard files and records the upload progress. When all shard files are uploaded, the copy files will be transferred to the cloud.
It realizes the interruption of large files, avoids the waste of resources caused by repeated data uploads, reduces the upload time, and saves cloud storage space through the second pass function.
Smart Images

Figure CN119865491A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to a method, device and system for resuming uploading large files in segments. Background Art
[0002] In the platform system, each business function has the demand that users upload large files to the software system for cloud storage on the client side. At present, the existing technology mostly uses the client to call the platform system backend http service interface to transmit large files through network data and store them on the cloud server. Since http service is a short connection, the response time of each network request does not exceed 60 seconds, and the bandwidth capacity of transmitting data load per second is limited, generally 0 to 5MB. The smaller the bandwidth, the lower the data transmission capacity. Therefore, the size of files that can be uploaded by http service is limited, and super large files cannot be uploaded. When the file is larger and the network bandwidth is smaller, the file upload time will be longer, which takes longer time and the user experience is poor. Once an error fails in the file upload process, the user needs to upload again from scratch. If the same file is uploaded multiple times, it will be saved repeatedly, resulting in a waste of resources.
[0003] The existing fragmented upload technology in the prior art is that after the client fragments the file, it calls the network request to upload in the order of the file fragments. The server receives and saves the fragmented files. After all the fragmented files are uploaded, the client calls the merge file interface to merge the fragmented files into the original file and then stores it. Summary of the invention
[0004] In order to better implement the breakpoint-resume uploading of large files in segments, the embodiments of the present application provide a breakpoint-resume uploading method, device and system for large files in segments.
[0005] In a first aspect, an embodiment of the present application provides a method for resuming uploading a large file in segments, which is applied to a client, and the method includes:
[0006] Read the original file, divide the original file into multiple fragment files according to a preset fragmentation algorithm, and mark the serial number of each fragment file;
[0007] The multiple segment files are uploaded to the server concurrently in the following manner:
[0008] According to the information returned by the pre-fetch check, determine the upload status of each shard file that has not been uploaded;
[0009] For each unuploaded segment file, a file upload network request is sent to the server to upload the segment file to the server;
[0010] When any of the segment files is uploaded, receiving data information returned by the server, and determining whether the data information contains cloud storage information;
[0011] If yes, the original file upload is completed;
[0012] If not, update the upload progress of the original file and wait for the upload of the remaining segment files to be completed.
[0013] In an optional implementation of the embodiment of the present application, dividing the original file into fragment files according to a preset fragmentation algorithm includes:
[0014] The data length of the original file and the preset storage space size of the shard file area are read, and the number of shard files is determined based on the following formula 1:
[0015] N=L / S Formula 1;
[0016] Where N is the number of shard files; L is the data length of the original file; S is the size of the preset shard file area storage space;
[0017] According to the number of shard files and the size of the shard file area storage space, the original file is divided into shard files.
[0018] In an optional implementation of the embodiment of the present application, the pre-fetch check return information includes the cloud storage information of the original file, the fragment upload progress information and the information of the preset fragment file area storage space size; the pre-fetch check return information is obtained by the following method:
[0019] Obtaining a unique file identifier of the original file, and determining whether cloud storage information of the original file exists in a file service database;
[0020] If yes, receiving the cloud storage information of the original file returned by the server;
[0021] Otherwise, determining whether the server has an auxiliary information file; the server receives the segment file and generates a corresponding auxiliary information file;
[0022] If yes, receiving the segment upload progress information of the original file returned by the server; the segment upload progress information includes the preset segment file area storage space size, the segment file area serial number and the upload status;
[0023] If not, it is determined that the original file has not started to be uploaded, and the information of the preset segment file area storage space size returned by the server is received.
[0024] In an optional implementation of the embodiment of the present application, determining, according to the pre-fetch check return information, each segment file whose upload status is not uploaded includes:
[0025] According to the fragment upload progress information of the original file, determine whether the upload status of each fragment file is uploaded;
[0026] According to the upload status of each segment file, the upload progress of the original file is updated.
[0027] In a second aspect, an embodiment of the present application provides a method for resuming uploading a large file in segments, which is applied to a server, and the method includes:
[0028] Receive the file upload network request sent by the client and determine whether the fragment file sequence number and data length are valid;
[0029] If yes, create an auxiliary information file to record the progress information of the segment file upload;
[0030] Create a blank file with the original file's unique identifier as the file name, and determine whether the upload status of each segment file is uploaded;
[0031] If not, write the fragment file data into the blank file according to the sequence number to obtain a copy file;
[0032] The auxiliary information file is traversed in a loop, and when the upload status of each segment file is uploaded, the copy file is transferred to the cloud.
[0033] In an optional implementation of the embodiment of the present application, the fragment file sequence number is encoded as an integer starting from zero, and whether the fragment file sequence number and data length are valid is determined in the following manner:
[0034] Determine whether the sequence number of each shard file is less than the number of shard files;
[0035] If yes, the fragment file sequence number is valid;
[0036] If not, the segment file number is invalid and the file upload ends;
[0037] Get the data length of the fragment file and determine whether the fragment file sequence number is the last one;
[0038] If yes, then when the data length of the shard file is less than or equal to the storage space size of the shard file area, the data length of the shard file is valid;
[0039] If not, when the data length of the segment file is equal to the size of the segment file area storage space, the segment file data length is valid.
[0040] In an optional implementation of the embodiment of the present application, transferring the copy file to the cloud includes:
[0041] Calling the file cloud storage interface to upload the copy file to the cloud;
[0042] Receive the cloud storage information returned by the cloud, save the cloud storage information to the file service database, and return the cloud storage information to the client.
[0043] In an optional implementation of the embodiment of the present application, it also includes:
[0044] After the original file is uploaded, the copy file and auxiliary information file are cleaned up and deleted to release the server disk storage space.
[0045] In a third aspect, an embodiment of the present application provides a method for resuming uploading a large file in segments, the method comprising:
[0046] The client reads the original file, divides the original file into multiple fragment files according to a preset fragmentation algorithm, and marks the sequence number of each fragment file;
[0047] According to the information returned by the pre-fetch check, determine the upload status of each shard file that has not been uploaded;
[0048] For each unuploaded segment file, a file upload network request is sent to the server to upload the segment file to the server;
[0049] The server receives the upload network request and determines whether the segment file sequence number and data length are valid;
[0050] If yes, create an auxiliary information file to record the progress information of the segment file upload;
[0051] Create a blank file with the original file's unique identifier as the file name, and determine whether the upload status of each segment file is uploaded;
[0052] If not, write the fragment file data into the blank file according to the sequence number to obtain a copy file;
[0053] The auxiliary information file is traversed in a loop, and when the upload status of each segment file is uploaded, the copy file is transferred to the cloud.
[0054] In a fourth aspect, an embodiment of the present application provides a device for resuming uploading a large file in segments, which is applied to a client, and the device includes:
[0055] A fragmentation module is used to read an original file, divide the original file into multiple fragment files according to a preset fragmentation algorithm, and mark the sequence number of each fragment file;
[0056] The upload module is used to upload the multiple segment files to the server in parallel in the following manner: according to the pre-fetch check return information, determine the segment files whose upload status is not uploaded; for each segment file not uploaded, send a file upload network request to the server to upload the segment file to the server;
[0057] A judgment module, used for receiving data information returned by the server when any of the segment files is uploaded, and judging whether the data information contains cloud storage information;
[0058] A first determination module, configured to determine that the original file upload is complete if the returned data contains cloud storage information;
[0059] The waiting upload module is used to update the upload progress of the original file and wait for the upload of the remaining segment files to be completed if the returned data does not contain cloud storage information.
[0060] In a fifth aspect, an embodiment of the present application provides a device for resuming uploading large files in segments, which is applied to a server, and the device includes:
[0061] The receiving module is used to receive the file upload network request sent by the client and determine whether the fragment file sequence number and data length are valid;
[0062] The first creation module is used to create an auxiliary information file to record the upload progress information of the segment file if the segment file sequence number and data length are valid;
[0063] The second creation module is used to create a blank file with the unique file identifier of the original file as the file name, and determine whether the upload status of each segment file is uploaded;
[0064] A writing module, used for writing the fragment file data into the blank file according to the sequence number to obtain a copy file if the upload status of the fragment file is not uploaded;
[0065] The traversal module is used to traverse the auxiliary information file in a loop, and when the upload status of each segment file is uploaded, the copy file is transferred to the cloud.
[0066] In a sixth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a method for resuming upload of large files in segments as described above.
[0067] In a seventh aspect, an embodiment of the present application provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, a method for resuming uploading large files in segments as described above is implemented.
[0068] In an eighth aspect, an embodiment of the present application provides a computer program product comprising instructions, which, when executed on a computer device, enables the computer device to execute a method for resuming uploading large files in segments as described above.
[0069] In a ninth aspect, an embodiment of the present application provides a chip, the chip including a processor and a communication interface, the communication interface and the processor are coupled, and the processor is used to run a computer program or instruction to implement a method for resuming upload of large files in fragments as described above.
[0070] In a tenth aspect, an embodiment of the present application provides a large file segmented resume uploading system, the system comprising a client, a server and a cloud:
[0071] The client is used to read the original file, divide the original file into multiple fragment files according to a preset fragmentation algorithm, and mark the serial number of each fragment file; determine the upload status of each fragment file that is not uploaded according to the pre-fetch check return information; and for each fragment file that has not been uploaded, send a file upload network request to the server respectively, and upload the fragment file to the server;
[0072] The server is used to receive the upload network request, determine whether the segment file sequence number and data length are valid; if the segment file sequence number and data length are valid, create an auxiliary information file to record the segment file upload progress information; create a blank file with the file unique identifier of the original file as the file name, and determine whether the upload status of each segment file is uploaded; if the upload status of the segment file is not uploaded, write the segment file data into the blank file according to the sequence number to obtain a copy file; and loop through the auxiliary information file, and when the upload status of each segment file is uploaded, transfer the copy file to the cloud;
[0073] The cloud is used to store the copy file.
[0074] The beneficial effects of the above technical solution provided by the embodiment of the present application include at least:
[0075] The embodiment of the present application provides a method for resuming uploading large files in segments according to a preset segmentation algorithm on the client, and determines the unuploaded segment files in combination with the pre-fetch check return information, and initiates a network request for uploading the segment files for each unuploaded segment file, thereby uploading the segment files to the server. The method simplifies the upload operation steps by defining standardized file upload process steps on the client; when performing pre-fetch checks, the unique identifier md5 value of the original file is used to prevent repeated file uploads, save cloud storage space, and achieve the effect of large file uploads in seconds; by uploading the original file in segments, the breakpoint-resume upload function is realized, resource waste caused by repeated data upload is avoided, and the upload time is reduced; the client does not need to trigger the merge file action, which reduces the complexity of the operation process execution call and reduces the number of network interaction requests.
[0076] The embodiment of the present application provides a method for resuming uploading large files in segments, which receives the file upload network request from the client at the server end, writes the segmented files into the created blank file in order, and when the last segmented file is uploaded, transfers the copy file to the cloud, receives and saves the cloud storage information returned by the cloud, and returns the cloud storage information to the client to complete the upload of the original file. The method simplifies the upload operation steps by defining standardized file upload process steps at the server end; by using the original file and the auxiliary information file together, the server end can directly save the segmented files as the original files, avoiding the problem of excessive disk read and write load caused by the client triggering the merger of segmented files to generate original files when the segmented files are saved separately, simplifying the processing process, making the interface easier to use, and making the execution efficiency more efficient.
[0077] Other features and advantages of the present application will be described in the following description, and partly become apparent from the description, or be understood by practicing the present application. The purpose and other advantages of the present application can be realized and obtained by the structures specifically pointed out in the written description, claims, and drawings.
[0078] The technical solution of the present application is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0079] The accompanying drawings are used to provide a further understanding of the present application and constitute a part of the specification. Together with the embodiments of the present application, they are used to explain the present application and do not constitute a limitation of the present application. In the accompanying drawings:
[0080] Figure 1 A schematic diagram of the timing of the interactions between the various terminals during the file cloud storage upload process provided in the embodiment of the present application;
[0081] Figure 2A schematic diagram of the steps of applying the method for resuming uploading a large file in segments provided in an embodiment of the present application to a client;
[0082] Figure 3 A schematic diagram of a process of pre-checking by a client provided in an embodiment of the present application;
[0083] Figure 4 A schematic diagram of information about a fragment response class provided in an embodiment of the present application;
[0084] Figure 5 An information diagram of the file upload interface request parameters provided in the embodiment of the present application;
[0085] Figure 6 A schematic diagram of a process for a client to upload an original file to a server provided in an embodiment of the present application;
[0086] Figure 7 A schematic diagram of the steps of applying the method for resuming uploading large files in segments provided in an embodiment of the present application to a server;
[0087] Figure 8 A schematic diagram of a process for a server to receive an original file and transfer it to the cloud provided in an embodiment of the present application;
[0088] Fig. 9 A schematic diagram of the steps of a method for resuming uploading a large file in segments provided in an embodiment of the present application;
[0089] Fig.10 A schematic diagram of a structure of a device for resuming uploading a large file in segments applied to a client provided in an embodiment of the present application;
[0090] Fig.11 A schematic diagram of a structure of a large file segmented resume uploading device applied to a server provided in an embodiment of the present application;
[0091] Fig.12 A structural diagram of a large file segmented resume uploading system provided in an embodiment of the present application. DETAILED DESCRIPTION
[0092] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0093] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.
[0094] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0095] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.
[0096] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0097] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
[0098] It should be understood that the size of the serial numbers of the steps in the following embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0099] In order to illustrate the technical solution of the present application, a specific embodiment is provided below for illustration.
[0100] The inventors found that in the prior art, when uploading a large file in pieces, the client splits the file into pieces and then calls the network request to upload it in the order of the file pieces. The server receives and saves the piece files. After all the piece files are uploaded, the client calls the merge file interface to merge the piece files into the original file and then stores it. This solution has the following defects:
[0101] (1) Over-reliance on sequential uploading of fragments will result in a failure to significantly reduce the upload time and fail to fully utilize network and system hardware resources;
[0102] (2) Over-reliance on the client to trigger the file merging action increases the complexity of the operation process execution call. One more network interaction request will increase the time for file upload;
[0103] (3) The server receives the fragmented files and saves them separately. When merging files, the original files are recreated. The frequent file operations have a great impact on the performance of the system disk, and the file upload time is also wasted.
[0104] Based on this, the inventor has made this application after further research and development, providing a method, device and system for resuming upload of large files in segments.
[0105] Embodiment 1
[0106] The embodiment of the present application provides a method for resuming uploading a large file in segments, which is implemented based on the md5 summary information of the file data stream, and each file can be uniquely identified by its md5 value. Figure 1 As shown in FIG. 1 , the process of uploading files to cloud storage is completed by the interaction between the user end, the file service, and the cloud storage system (hereinafter referred to as the cloud). Figure 1 The user first initiates a request to the file server, i.e., the server, to check the progress of the file segment upload. The server receives the request and returns a file segment progress response message to the client. Then, the client segments the file according to the segment progress response information and asynchronously uploads N segment data, i.e., initiates N network requests to the server to request the upload of segment data. After the server receives the segment files and all the segment files are uploaded, the entire file is stored in the cloud. Finally, the cloud returns the cloud storage information including the file URL to the server, and the server returns the cloud storage information to the client, i.e., a file result response.
[0107] The following is a detailed introduction to the implementation process of the method for resuming the upload of large files in segments on the client and server:
[0108] In the present application, refer to Figure 2 As shown, the client will perform the following steps:
[0109] S101: Read an original file, divide the original file into multiple fragment files according to a preset fragmentation algorithm, and mark each fragment file with a serial number.
[0110] In the embodiment of the present application, before uploading the original file, the client first performs a pre-fetch check on the original file, and determines whether the original file to be uploaded has been uploaded and saved to the cloud based on the information returned by the pre-fetch check. If the original file has not been saved to the cloud, that is, the original file has never been uploaded or has only been partially uploaded, the original file needs to be uploaded.
[0111] The pre-fetch check return information includes the cloud storage information of the original file, the fragment upload progress information and the information of the preset fragment file area storage space size; the pre-fetch check return information can be obtained in the following way:
[0112] Obtaining a unique file identifier of the original file, and determining whether cloud storage information of the original file exists in a file service database;
[0113] If yes, receiving the cloud storage information of the original file returned by the server;
[0114] Otherwise, determining whether the server has an auxiliary information file; the server receives the segment file and generates a corresponding auxiliary information file;
[0115] If yes, receiving the segment upload progress information of the original file returned by the server; the segment upload progress information includes the preset segment file area storage space size, the segment file area serial number and the upload status;
[0116] If not, it is determined that the original file has not started to be uploaded, and the information of the preset segment file area storage space size returned by the server is received.
[0117] In the embodiment of the present application, the client obtains the md5 summary information of the original file data stream to be uploaded, and calls the pre-fetch check data interface of the server, wherein the md5 summary information can be obtained by calculating the md5 of the original file data stream, and the server returns the original file related information response to the client according to the md5 value of the file unique identifier of the original file. Among them, the pre-fetch check data interface is a standard unified interface defined to implement the file upload service, which is used to standardize the calling process. The main functions of the pre-fetch check data interface include: checking whether the original file has been uploaded, obtaining the file segmentation algorithm information and the upload progress information of each segment data.
[0118] like Figure 3As shown, it is a schematic diagram of the process of pre-fetching check by the client. The client calls the pre-fetching check data interface of the server based on the md5 summary information of the original file data stream, that is, the file unique identifier. The server checks whether the original file has been uploaded and stored in the cloud in the file service database according to the md5 value of the file unique identifier. If so, the cloud storage information of the original file is directly returned to the client. After the client receives the response, the file upload process ends; if not, it determines whether a part of the original file has been uploaded based on whether there is an auxiliary information file (md5+.conf file) on the server. If there is an auxiliary information file, the fragment upload progress information of the original file is returned to the client; if there is no auxiliary information file, it means that the original file has not started to be uploaded, and the information of the preset fragment file area storage space size is returned to the client, and the client enters the fragment processing process based on this information.
[0119] The progress information of the piece upload includes: the storage space occupied by the preset piece file chunkSize and the upload progress of each piece file (the sequence number of this piece, the upload status of this piece (whether the upload has been completed)). The progress information of the piece upload is obtained by reading the auxiliary information file with the original file md5+.conf as the file name in the storage path specified by the server. Figure 4 The figure shows the information diagram of the fragment response class. The byte size of the auxiliary information file is the number of fragments, chunks. By reading the content value stored in the auxiliary information file by byte, you can get the upload status of each fragment. When the storage content value is Byte.MAX_VALUE, it means that the fragment has been uploaded, that is, status = 1. Otherwise, the fragment has not been uploaded, that is, status = 0. The position index value of the byte is the fragment sequence number, that is, the fragment file sequence number no. If the auxiliary information file does not exist, it is considered that the original file has not been uploaded. At this time, list <chunkinfovo>Is empty.
[0120] In the embodiment of the present application, after the pre-fetch check, for the original file that has not yet started to be uploaded, the client reads the data of the original file and divides the original file into multiple fragment files according to a preset fragmentation algorithm.
[0121] In the embodiment of the present application, the dividing the original file into various fragment files according to the preset fragmentation algorithm specifically includes:
[0122] The data length of the original file and the preset storage space size of the shard file area are read, and the number of shard files is determined based on the following formula 1:
[0123] N=L / S Formula 1;
[0124] Where N is the number of shard files; L is the data length of the original file; S is the size of the preset shard file area storage space;
[0125] According to the number of shard files and the size of the shard file area storage space, the original file is divided into shard files.
[0126] In the embodiment of the present application, the file storage space size L bytes, i.e., the data length of the original file, and the preset shard file area storage space size S bytes are read, and the number of shards N is obtained according to the above formula 1, wherein if N is a non-integer, it needs to be rounded up. Each shard is marked with a shard file serial number, and the shard file serial number is encoded as an integer starting from zero. Starting from the file starting position 0, the N shard file data is read in segments according to the length of S bytes. The shard file serial number is i, then the starting position of the i-shard file data is i×S bytes, and the i-shard file data range is data in the range of i×S bytes to (i+1)×S bytes.
[0127] S102: Uploading the multiple segment files to the server concurrently in the following manner:
[0128] According to the information returned by the pre-fetch check, determine the upload status of each shard file that has not been uploaded;
[0129] For each unuploaded segment file, a file upload network request is sent to the server to upload the segment file to the server.
[0130] In an embodiment of the present application, for original files that have not yet started to be uploaded, each segment needs to be uploaded to the server; for original files that have been partially uploaded, the segment upload progress information of the original file returned by the server during the pre-fetch check can be used to determine the upload status of each segment file that has not been uploaded, and the segment files that have not been uploaded can be uploaded to the server.
[0131] During the file upload process, the client initiates N asynchronous threads, and each thread calls the server file upload interface to send a file upload network request to the client, and uploads each shard file to the server. Among them, the file upload interface is another standard unified interface defined to implement the file upload service, which is used to standardize the calling process. The main functions of the file upload interface include: recording the progress of shard file upload through the file auxiliary information file, creating a blank file to save the original file data, offsetting the file to the index start position of the corresponding shard mapping, and writing the shard file data received by the interface to realize the generation and preservation of the original file on the server.
[0132] In the embodiment of the present application, determining the upload status of each segment file as not uploaded according to the pre-fetch check return information specifically includes:
[0133] According to the fragment upload progress information of the original file, determine whether the upload status of each fragment file is uploaded;
[0134] According to the upload status of each segment file, the upload progress of the original file is updated.
[0135] Taking the upload of the i-th segment file as an example, the upload status status of the i-th segment file is compared according to the return information of the pre-fetch check. When status = 1, it means that the segment file has been uploaded, then the overall progress of the original file upload displayed on the client is updated, and the segment upload is completed; when status = 0, it means that the segment file has not been uploaded, then the file upload interface is called to upload the segment file to the server.
[0136] like Figure 5 As shown, the file upload interface request parameter information includes: segment file data stream data, original file md5 value, segment file sequence number i, segment number N, segment file md5 value, original file name fileName and preset segment file storage space size S.
[0137] S103: When any of the segment files is uploaded, the data information returned by the server is received, and it is determined whether the data information contains cloud storage information. If so, S104 is executed; if not, S105 is executed.
[0138] S104: The original file is uploaded.
[0139] S105: Update the upload progress of the original file and wait for the upload of the remaining segment files to be completed.
[0140] In the embodiment of the present application, when any segment file is uploaded, the data information returned by the server file upload interface is received. There are two situations after the segment file is uploaded. One situation is that the segment file is uploaded, and the returned data information does not contain cloud storage information, that is, the original file is not completely uploaded. At this time, it is only necessary to update the original file upload progress on the client and wait for other segment files to be uploaded. The other situation is that when the segment file is uploaded, the returned data information contains cloud storage information, that is, it contains the original file upload completion information, then the entire original file upload process is successful and ends.
[0141] The overall processing flow of the client uploading the original file to the server is as follows Figure 6 As shown, the original file is sliced into N slices through a preset slicing algorithm, the i-th slice is obtained, and the upload status status of the i-th slice is determined to be 1 according to the pre-fetch check return information. If the status is 1, it means that the upload of the i-th slice has been completed, and the original file upload progress is updated; if the status is 0, it means that the i-th slice is uploaded, and the client calls the file upload interface to send a file upload network request to the server to upload the file. When the i-th slice is uploaded successfully, it is determined whether the data information returned by the file upload interface contains cloud storage file information. If it does, it means that the original file has been fully uploaded, the cloud storage upload information is saved and the original file upload progress is updated. Otherwise, the original file upload progress is directly updated. At this time, the original file upload is not completed, and there is a thread in progress uploading the sliced file, waiting for its upload to be completed.
[0142] During the implementation of this application, the client realizes the function of resuming file uploads by processing files in segments and judging the upload status, ensuring that file data that has been uploaded is no longer uploaded repeatedly, and asynchronously uploading segmented files in parallel with multiple threads, avoiding the disadvantage of segmented files being overly dependent on sequential uploads, thereby improving the utilization rate of network resources and greatly shortening the time consumed in uploading files.
[0143] In the present application, refer to Figure 7 As shown, the server will perform the following steps:
[0144] S201: Receive a file upload network request sent by a client, and determine whether the segment file sequence number and data length are valid. If so, execute S202; if not, execute S203.
[0145] S202: Create an auxiliary information file to record the upload progress information of the segmented files.
[0146] S203: The original file upload stops and an error is reported.
[0147] In the embodiments of the present application, the gateway API is pre-configured so that the file upload interface requests of the same user can be directed to the same IP server, and the program on the server can read and write to a fixed file storage disk path directory.
[0148] During the file upload process on the server side, after the server receives the file upload network request sent by the client, it determines whether the shard file sequence number and data length are valid. Among them, the shard file sequence number is encoded as an integer starting from zero. The following method is used to determine whether the shard file sequence number and data length are valid:
[0149] Determine whether each shard file sequence number is less than the number of shard files;
[0150] If so, the shard file sequence number is valid;
[0151] If not, the shard file sequence number is invalid, and the file upload ends;
[0152] Obtain the data length of the shard file and determine whether the shard file sequence number is the last one;
[0153] If so, when the data length of the shard file is less than or equal to the storage space size of the shard file area, the shard file data length is valid;
[0154] If not, when the data length of the shard file is equal to the storage space size of the shard file area, the shard file data length is valid.
[0155] In the embodiments of the present application, for each shard, determine whether the shard file sequence number is less than the number of shard files, that is, compare the legality of the shard file sequence number i and the number of shard files N. When i < N, it is legal, that is, the shard file sequence number is valid; when i >= N, it is an illegal parameter error, the shard file sequence number is invalid, and the file upload ends.
[0156] According to the sharding result of the original file, except for the last shard file, the data lengths of the first N - 1 shard files should be equal to the preset storage space size S of the shard file area, and the data length of the last shard file should be less than or equal to the preset storage space size S of the shard file area. Therefore, when obtaining the data length dataSize of the shard data, when determining whether the data length of the shard file is valid, first determine whether the shard file sequence number i is the last sequence number. When i + 1 == N, the i-th shard file is the last shard file. At this time, if dataSize <= S, the data length of the shard file is valid, otherwise, it is a parameter error; when i + 1 < N, the i-th shard file is a complete shard file. At this time, if dataSize == S, the data length of the shard file is valid, otherwise, it is a parameter error and does not conform to the protocol shard data length.
[0157] In an embodiment of the present application, when the serial number and data length of the slice file are both valid, the server starts to receive the slice file data and creates an auxiliary information file to record the progress information of the slice file upload. Among them, the auxiliary information file is created with the original file md5+.conf as the file name, and the byte length of the auxiliary information file is N. When the i-th slice file is uploaded, the mark value with the value of Byte.MAX_VALUE will be saved with i as the offset, that is, the i-th content value of the auxiliary information file is set to Byte.MAX_VALUE, which means that the i-th slice file has been uploaded. Therefore, by reading the 1 byte value with i as the offset in the auxiliary information file, it can be determined whether the slice file has been uploaded. When the N bytes of the auxiliary information file are all Byte.MAX_VALUE, it means that all slice files have been uploaded. Otherwise, there are slice files that have not been uploaded, that is, the original file has not been uploaded.
[0158] S204: Create a blank file with the unique file identifier of the original file as the file name, and determine whether the upload status of each segment file is uploaded. If so, execute S205; otherwise, execute S206.
[0159] S205: The segmented file has been uploaded successfully.
[0160] S206: Write the fragment file data into the blank file according to the sequence number to obtain a copy file.
[0161] In the embodiment of the present application, the server creates a blank file with the md5 value of the file unique identifier of the original file as the file name, which is used to receive the uploaded segmented file data. When the i-th segment is not uploaded, the segmented file data is written into the blank file according to the sequence number, that is, the segmented file data is saved into the blank file with S×i as the offset. At the same time, the upload status of the i-th segment is marked as uploaded in the auxiliary information file. If the i-th segment has been uploaded, the above writing process is not performed. When all the data of the original file is written into the blank file, the original file is obtained in the server, which is hereinafter referred to as a copy file.
[0162] S207: Loop through the auxiliary information files, and when the upload status of each segment file is uploaded, transfer the copy file to the cloud.
[0163] In an embodiment of the present application, after the i-th segment file is uploaded, the N-bit byte value of the auxiliary information file is looped through. When there is a byte value that is not Byte.MAX_VALUE, the original file has not been uploaded. The upload of the segment is completed and data is returned to the client. The client updates the upload progress of the original file. When the N-bit byte values are all Byte.MAX_VALUE, that is, the upload status of each segment file is uploaded, it means that the upload is complete. At this time, the copy file is uploaded to the cloud storage.
[0164] In the embodiment of the present application, transferring the copy file to the cloud specifically includes:
[0165] Calling the file cloud storage interface to upload the copy file to the cloud;
[0166] Receive the cloud storage information returned by the cloud, save the cloud storage information to the file service database, and return the cloud storage information to the client.
[0167] In the embodiment of the present application, the server uploads the copy file to the cloud by calling the file cloud storage interface, wherein the file cloud storage interface is an interface for saving files and is part of the processing logic inside the server file upload interface. After transferring to the cloud, the server will receive the cloud storage information returned by the cloud, which includes the file md5 unique identifier, file name, file size, file type and file cloud download URL, save the cloud storage information to the file service database, and at the same time, return the cloud storage information to the client, and the client will update the original file upload progress and complete the upload process.
[0168] In the embodiment of the present application, after the original file is uploaded, the following steps are also included:
[0169] After the original file is uploaded, the copy file and auxiliary information file are cleaned up and deleted to release the server disk storage space.
[0170] In the embodiment of the present application, the copy files and auxiliary information files are cleaned up and deleted, so as to release the server disk storage space, and can prevent the server disk from being full due to the continuous incremental uploading of large files.
[0171] The overall processing flow of the server receiving the original file and transferring it to the cloud is as follows: Figure 8 As shown, after receiving the client's upload network request for the i-th segment file, by comparing the segment file sequence number and the number of segments, it is determined whether the segment file sequence number i is valid. If not, the upload is terminated; if so, it continues to determine whether the i-th segment is the last segment, and determines whether dataSize is valid through the relationship between the segment file data length dataSize and the preset segment file segment storage space size S. If not, the upload is terminated; if valid, the file auxiliary information is read, and by determining whether the byte value is Byte.MAX_VALUE, it is determined whether the i-th segment has been uploaded. If so, it means that the i-th segment has been uploaded; if not, the segment file data is saved with the md5 value as the file name and S×i as the offset, and Byte.MAX_VALUE is saved with md5+.conf as the file name and i as the offset to mark the i-th segment upload completion; after the i-th segment is uploaded, it is determined whether all N segments have been uploaded. If so, a copy file is obtained on the server, the copy file is uploaded to the cloud storage, and the cloud storage information returned by the cloud is saved. At this point, the server completes the process of receiving and transferring files. Further, the server cleans up the copy files and auxiliary information files to release the server disk storage space.
[0172] In the embodiment of the present application, the client, the server and the cloud interact to complete the breakpoint-resume upload process of the large file, refer to Fig. 9 As shown in the figure, the overall execution steps of the file upload process are as follows:
[0173] S301: The client reads an original file, divides the original file into multiple fragment files according to a preset fragmentation algorithm, and marks the sequence number of each fragment file.
[0174] S302: Determine, based on the pre-fetch check return information, each segment file whose upload status is not uploaded.
[0175] S303: For each segment file that has not been uploaded, a file upload network request is sent to the server to upload the segment file to the server.
[0176] S304: The server receives the upload network request and determines whether the segment file sequence number and data length are valid. If so, S305 is executed; if not, S306 is executed.
[0177] S305: Create an auxiliary information file to record the upload progress information of the segmented files.
[0178] S306: The original file upload stops and an error is reported.
[0179] S307: Create a blank file with the unique file identifier of the original file as the file name, and determine whether the upload status of each segment file is uploaded. If so, execute S308; if not, execute S309.
[0180] S308: The segmented file has been uploaded successfully.
[0181] S309: Write the fragment file data into the blank file according to the sequence number to obtain a copy file.
[0182] S310: Loop through the auxiliary information files, and when the upload status of each segment file is uploaded, transfer the copy file to the cloud.
[0183] In the embodiment of the present application, the specific implementation process of the above steps S301 to S303 can refer to the detailed description of the client uploading the segmented files to the server in the above steps S101 to S102; the specific implementation process of the above steps S304 to S310 can refer to the detailed description of the server receiving the segmented files and transferring them to the cloud in the above steps S201 to S207. The repeated parts of the above processes will not be repeated here.
[0184] In the embodiment of the present application, by defining standardized file upload process steps on the client and server, the upload operation steps are simplified. By extracting the md5 value from the file data information to obtain the unique file identifier, the file is prevented from being uploaded repeatedly, cloud storage space is saved, and large files can be uploaded in seconds. Large files are sliced and uploaded in pieces to realize the breakpoint resume upload function, avoid resource waste caused by repeated data upload, and reduce the upload time. The server optimizes the way of merging and restoring the original large file by merging the pieced files, simplifying the processing process and improving execution efficiency.
[0185] In a specific embodiment, in a certain information platform and a certain health enterprise management digital platform, the method of the present application is used to perform large file uploads for various business functions. It has been able to run stably and smoothly since it went online, supports the upload of ultra-large files, and has a fast upload speed. The system hardware resources are fully utilized, the file storage resource space is not wasted, and the user experience is good.
[0186] The embodiment of the present application provides a method for resuming uploading large files in segments according to a preset segmentation algorithm on the client, and determines the unuploaded segment files in combination with the pre-fetch check return information, and initiates a network request for uploading the segment files for each unuploaded segment file, thereby uploading the segment files to the server. The method simplifies the upload operation steps by defining standardized file upload process steps on the client; when performing pre-fetch checks, the unique identifier md5 value of the original file is used to prevent repeated file uploads, save cloud storage space, and achieve the effect of large file uploads in seconds; by uploading the original file in segments, the breakpoint-resume upload function is realized, resource waste caused by repeated data upload is avoided, and the upload time is reduced; the client does not need to trigger the merge file action, which reduces the complexity of the operation process execution call and reduces the number of network interaction requests.
[0187] The embodiment of the present application provides a method for resuming uploading large files in segments, which receives the file upload network request from the client at the server end, writes the segmented files into the created blank file in order, and when the last segmented file is uploaded, transfers the copy file to the cloud, receives and saves the cloud storage information returned by the cloud, and returns the cloud storage information to the client to complete the upload of the original file. The method simplifies the upload operation steps by defining standardized file upload process steps at the server end; by using the original file and the auxiliary information file together, the server end can directly save the segmented files as the original files, avoiding the problem of excessive disk read and write load caused by the client triggering the merger of segmented files to generate original files when the segmented files are saved separately, simplifying the processing process, making the interface easier to use, and making the execution efficiency more efficient.
[0188] Embodiment 2
[0189] Based on the same inventive concept, the present application also provides a device for resuming uploading large files in segments, which is applied to a client. Fig.10 As shown, the device comprises:
[0190] The fragmentation module 101 is used to read the original file, divide the original file into multiple fragment files according to a preset fragmentation algorithm, and mark the sequence number of each fragment file;
[0191] The upload module 102 is used to upload the multiple segment files to the server in parallel in the following manner: according to the pre-fetch check return information, determine the segment files whose upload status is not uploaded; for each segment file not uploaded, send a file upload network request to the server to upload the segment file to the server;
[0192] The judgment module 103 is used to receive the data information returned by the server when any of the segment files is uploaded, and judge whether the data information contains cloud storage information;
[0193] A first determination module 104, configured to determine that the original file upload is complete if the returned data includes cloud storage information;
[0194] The waiting upload module 105 is used to update the upload progress of the original file and wait for the completion of uploading of the remaining segment files if the returned data does not contain cloud storage information.
[0195] Embodiment 3
[0196] Based on the same inventive concept, the present application also provides a large file segment breakpoint resume uploading device, which is applied to the server, referring to Fig.11 As shown, the device comprises:
[0197] Receiving module 201, used to receive a file upload network request sent by a client, and determine whether the fragment file sequence number and data length are valid;
[0198] The first creation module 202 is used to create an auxiliary information file to record the upload progress information of the segment file if the segment file sequence number and data length are valid;
[0199] The second creation module 203 is used to create a blank file with the unique file identifier of the original file as the file name, and determine whether the upload status of each segment file is uploaded;
[0200] The writing module 204 is used to write the segment file data into the blank file according to the sequence number to obtain a copy file if the upload status of the segment file is not uploaded;
[0201] The traversal module 205 is used to traverse the auxiliary information file in a loop, and when the upload status of each segment file is uploaded, the copy file is transferred to the cloud.
[0202] Embodiment 4
[0203] Based on the same inventive concept, the present application embodiment also provides a large file segment breakpoint resume uploading system, referring to Fig.12 As shown, the system includes a client 1, a server 2 and a cloud 3, wherein:
[0204] The client 1 is used to read the original file, divide the original file into multiple fragment files according to a preset fragmentation algorithm, and mark the serial number of each fragment file; determine the upload status of each fragment file that is not uploaded according to the pre-fetch check return information; and for each fragment file that has not been uploaded, send a file upload network request to the server 2 respectively, and upload the fragment file to the server 2;
[0205] The server 2 is used to receive the upload network request, determine whether the segment file sequence number and data length are valid; if the segment file sequence number and data length are valid, create an auxiliary information file to record the segment file upload progress information; create a blank file with the file unique identifier of the original file as the file name, and determine whether the upload status of each segment file is uploaded; if the upload status of the segment file is not uploaded, write the segment file data into the blank file according to the sequence number to obtain a copy file; and loop through the auxiliary information file, and when the upload status of each segment file is uploaded, transfer the copy file to the cloud 3;
[0206] The cloud 3 is used to store the copy file.
[0207] It should be noted that the information interaction, execution process, etc. between the client 1, server 2 and cloud 3 in the above-mentioned system are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.
[0208] Embodiment 5
[0209] Based on the same inventive concept, an embodiment of the present application also provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the method for resuming uploading large files in segments as described in the above-mentioned embodiment 1 is implemented.
[0210] Embodiment 6
[0211] Based on the same inventive concept, an embodiment of the present application also provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, a method for resuming uploading large files in segments as described in the above-mentioned embodiment 1 is implemented.
[0212] Embodiment 7
[0213] Based on the same inventive concept, an embodiment of the present application also provides a computer program product comprising instructions. When the computer program product is run on a computer device, the computer device executes a method for resuming uploading large files in segments as described in the above-mentioned embodiment 1.
[0214] Embodiment 8
[0215] Based on the same inventive concept, an embodiment of the present application also provides a chip, the chip includes a processor and a communication interface, the communication interface and the processor are coupled, and the processor is used to run a computer program or instruction to implement a method for resuming uploading large files in fragments as described in the above embodiment one.
[0216] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) that contain computer-usable program code.
[0217] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0218] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0219] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0220] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.< / chunkinfovo>
Claims
1. A method for resuming uploading large files in segments, characterized in that: Applied to the client, including: Read the original file, divide the original file into multiple fragment files according to a preset fragmentation algorithm, and mark the serial number of each fragment file; The multiple segment files are uploaded to the server concurrently in the following manner: According to the information returned by the pre-fetch check, determine the upload status of each shard file that has not been uploaded; For each unuploaded segment file, a file upload network request is sent to the server to upload the segment file to the server; When any of the segment files is uploaded, receiving data information returned by the server, and determining whether the data information contains cloud storage information; If yes, the original file upload is completed; If not, update the upload progress of the original file and wait for the upload of the remaining segment files to be completed.
2. The method according to claim 1, characterized in that The step of dividing the original file into various fragment files according to a preset fragmentation algorithm includes: The data length of the original file and the preset storage space size of the shard file area are read, and the number of shard files is determined based on the following formula 1: N = L / S Formula 1; Where N is the number of shard files; L is the data length of the original file; S is the size of the preset shard file area storage space; According to the number of shard files and the size of the shard file area storage space, the original file is divided into shard files.
3. The method according to claim 1, characterized in that The pre-fetch check return information includes the cloud storage information of the original file, the fragment upload progress information and the information of the preset fragment file area storage space size; the pre-fetch check return information is obtained by the following method: Obtaining a unique file identifier of the original file, and determining whether cloud storage information of the original file exists in a file service database; If yes, receiving the cloud storage information of the original file returned by the server; Otherwise, determining whether the server has an auxiliary information file; the server receives the segment file and generates a corresponding auxiliary information file; If yes, receiving the segment upload progress information of the original file returned by the server; the segment upload progress information includes the preset segment file area storage space size, the segment file area serial number and the upload status; If not, it is determined that the original file has not started to be uploaded, and the information of the preset segment file area storage space size returned by the server is received.
4. The method according to claim 1, characterized in that The step of determining, based on the pre-fetch check return information, each segment file whose upload status is not uploaded comprises: According to the fragment upload progress information of the original file, determine whether the upload status of each fragment file is uploaded; According to the upload status of each segment file, the upload progress of the original file is updated.
5. A method for resuming uploading large files in segments, characterized in that: Applied to the server, including: Receive the file upload network request sent by the client and determine whether the fragment file sequence number and data length are valid; If yes, create an auxiliary information file to record the progress information of the segment file upload; Create a blank file with the original file's unique identifier as the file name, and determine whether the upload status of each segment file is uploaded; If not, write the fragment file data into the blank file according to the sequence number to obtain a copy file; The auxiliary information file is traversed in a loop, and when the upload status of each segment file is uploaded, the copy file is transferred to the cloud.
6. The method according to claim 5, characterized in that The fragment file sequence number is encoded as an integer starting from zero. The following method is used to determine whether the fragment file sequence number and data length are valid: Determine whether the sequence number of each shard file is less than the number of shard files; If yes, the fragment file sequence number is valid; If not, the segment file number is invalid and the file upload ends; Get the data length of the fragment file and determine whether the fragment file sequence number is the last one; If yes, then when the data length of the shard file is less than or equal to the storage space size of the shard file area, the data length of the shard file is valid; If not, when the data length of the segment file is equal to the size of the segment file area storage space, the segment file data length is valid.
7. The method according to claim 5, characterized in that The transferring the copy file to the cloud includes: Calling the file cloud storage interface to upload the copy file to the cloud; Receive the cloud storage information returned by the cloud, save the cloud storage information to the file service database, and return the cloud storage information to the client.
8. The method according to claim 5, characterized in that Also includes: After the original file is uploaded, the copy file and auxiliary information file are cleaned up and deleted to release the server disk storage space.
9. A method for resuming uploading large files in segments, characterized in that: include: The client reads the original file, divides the original file into multiple fragment files according to a preset fragmentation algorithm, and marks the sequence number of each fragment file; According to the information returned by the pre-fetch check, determine the upload status of each shard file that has not been uploaded; For each unuploaded segment file, a file upload network request is sent to the server to upload the segment file to the server; The server receives the upload network request and determines whether the segment file sequence number and data length are valid; If yes, create an auxiliary information file to record the progress information of the segment file upload; Create a blank file with the original file's unique identifier as the file name, and determine whether the upload status of each segment file is uploaded; If not, write the fragment file data into the blank file according to the sequence number to obtain a copy file; The auxiliary information file is traversed in a loop, and when the upload status of each segment file is uploaded, the copy file is transferred to the cloud.
10. A device for resuming uploading large files in segments, characterized in that: Application client, including: A fragmentation module is used to read an original file, divide the original file into multiple fragment files according to a preset fragmentation algorithm, and mark the sequence number of each fragment file; The upload module is used to upload the multiple segment files to the server in parallel in the following manner: according to the pre-fetch check return information, determine the segment files whose upload status is not uploaded; for each segment file not uploaded, send a file upload network request to the server to upload the segment file to the server; A judgment module, used for receiving data information returned by the server when any of the segment files is uploaded, and judging whether the data information contains cloud storage information; A first determination module, configured to determine that the original file upload is complete if the returned data contains cloud storage information; The waiting upload module is used to update the upload progress of the original file and wait for the upload of the remaining segment files to be completed if the returned data does not contain cloud storage information.
11. A device for resuming uploading large files in segments, characterized in that: Application server, including: The receiving module is used to receive the file upload network request sent by the client and determine whether the fragment file sequence number and data length are valid; The first creation module is used to create an auxiliary information file to record the upload progress information of the segment file if the segment file sequence number and data length are valid; The second creation module is used to create a blank file with the unique file identifier of the original file as the file name, and determine whether the upload status of each segment file is uploaded; A writing module, used for writing the fragment file data into the blank file according to the sequence number to obtain a copy file if the upload status of the fragment file is not uploaded; The traversal module is used to traverse the auxiliary information file in a loop, and when the upload status of each segment file is uploaded, the copy file is transferred to the cloud.
12. A computer-readable storage medium storing instructions, which, when executed on a computer device, causes the computer device to execute the method for resuming large file segment upload as described in any one of claims 1-4 or 5-8.
13. A computer device, characterized in that: It includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the method for resuming uploading large files in segments as described in any one of claims 1-4 or 5-8.
14. A computer program product comprising instructions, which, when executed on a computer device, enables the computer device to execute the method for resuming uploading a large file in segments as described in any one of claims 1-4 or 5-8.
15. A chip, comprising a processor and a communication interface, wherein the communication interface and the processor are coupled, and the processor is used to run a computer program or instruction to implement the method for resuming uploading large files in segments as described in any one of claims 1-4 or 5-8.
16. A system for resuming uploading large files in segments, characterized in that: include: Client, server and cloud; The client is used to read the original file, divide the original file into multiple fragment files according to a preset fragmentation algorithm, and mark the sequence number of each fragment file; determine the upload status of each fragment file as not uploaded according to the pre-fetch check return information; and , for each unuploaded segment file, send a file upload network request to the server to upload the segment file to the server; The server is used to receive the upload network request, determine whether the segment file sequence number and data length are valid; if the segment file sequence number and data length are valid, create an auxiliary information file to record the segment file upload progress information; create a blank file with the file unique identifier of the original file as the file name, and determine whether the upload status of each segment file is uploaded; If the upload status of the segment file is not uploaded, the segment file data is written into the blank file according to the sequence number to obtain a copy file; And, looping through the auxiliary information file, when the upload status of each segment file is uploaded, transferring the copy file to the cloud; The cloud is used to store the copy file.