File fragment management method and device, computer device, storage medium and product

By receiving and sequentially assembling file fragments using parallel threads, combined with MD5 verification and timeout mechanisms, the problem of low efficiency in traditional large file transfer is solved, achieving efficient file transfer and secure storage.

CN118573671BActive Publication Date: 2025-12-19CHINA CONSTRUCTION BANK +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410763130.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-13
Publication Date
2025-12-19
Estimated Expiration
2044-06-13

AI Technical Summary

Technical Problem

Traditional file storage methods are inefficient when handling large files, leading to network congestion and resource waste. This is especially true in remote equipment maintenance in the financial sector, where traditional file fragmentation transfer is inefficient.

Method used

The system receives fragmented file information sent by the target device through multiple parallel threads, and concatenates the fragmented files according to their order in the target file. It also manages the transmission and storage of fragmented files by combining MD5 value verification and timeout mechanisms.

Benefits of technology

It improves the transmission efficiency and file synthesis efficiency of fragmented files, enhances transmission security, and improves the utilization rate of storage resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118573671B_ABST
    Figure CN118573671B_ABST
Patent Text Reader

Abstract

The application relates to the field of data transmission, and particularly discloses a file fragment management method and device, computer equipment, a storage medium and a product. The method comprises the following steps: receiving a plurality of fragment file information sent by a target device through a plurality of parallel threads, each fragment file information comprising a fragment file in a target file and a fragment order of the fragment file in the target file; and splicing a plurality of fragment files in the plurality of fragment file information according to the fragment order of the fragment file in the target file to obtain the target file. Compared with sequentially sending fragment files in the prior art, the transmission efficiency of the fragment files is improved by receiving a plurality of fragment file information sent by a target device through a plurality of parallel threads, and the file synthesis efficiency is improved by splicing a plurality of files according to the fragment order.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of data transmission, and in particular to a file fragment management method and device, computer equipment, storage medium and product. BACKGROUND

[0002] With the growth of data, large file transmission and storage have become an important challenge. The traditional file storage method has low transmission efficiency when processing large files, which can easily cause network congestion and waste of storage resources. For example, in the financial field, the equipment of banks and other financial institutions needs to upload local running files for remote problem analysis, but the local running files are usually large, and the industry requires high security encryption of the files before transmission. Therefore, it is necessary to divide the large files into multiple fragment files for encrypted transmission.

[0003] In the traditional technology, the fragment data is transmitted in sequence according to the order of the fragment files, which has the problem of low file transmission efficiency. SUMMARY

[0004] Therefore, it is necessary to provide a file fragment management method, device, computer equipment, storage medium and product capable of improving file transmission efficiency to solve the above technical problems.

[0005] In a first aspect, the present application provides a data transmission method, comprising:

[0006] receiving a plurality of fragment file information sent by a target device through a plurality of parallel threads, each fragment file information including a fragment file in a target file and a fragment order of the fragment file in the target file;

[0007] splicing a plurality of fragment files in the plurality of fragment file information according to the fragment order of the fragment file in the target file to obtain the target file.

[0008] In one embodiment, before the splicing, the method further comprises:

[0009] receiving a file acquisition request sent by a user terminal, the file acquisition request being used to request the target file, and the file acquisition request including a target file identifier;

[0010] obtaining the plurality of fragment files corresponding to the target file identifier and the fragment order of each fragment file in the target file;

[0011] After the plurality of fragment files in the plurality of fragment file information are spliced according to the fragment order of the fragment files in the target file, the method further comprises:

[0012] The target file is sent to the user terminal.

[0013] In one of the embodiments, after the plurality of fragment file information sent by the target device is received through the plurality of parallel threads, the method further comprises:

[0014] In the case that the fragment file information is verified, the fragment file information is stored, and a timeout duration of the fragment file information is set;

[0015] If the upload success message sent by the target device is received, the timeout duration of the fragment file information is deleted, and a download interface for the target file is opened;

[0016] The upload success message is used to indicate that all the fragment files in the target file are successfully uploaded.

[0017] In one of the embodiments, after the fragment file information is stored, and the timeout duration of the fragment file information is set, the method further comprises:

[0018] When the storage duration of any fragment file information in the plurality of fragment file information is greater than the timeout duration, the plurality of fragment file information is deleted, and / or a retransmission message is sent to the target device, the retransmission message is used to inform the target device to retransmit the plurality of fragment file information.

[0019] In one of the embodiments, after the fragment file information is stored, and the timeout duration of the fragment file information is set, the method further comprises:

[0020] If the upload failure message sent by the target device is received, the plurality of fragment file information is deleted, and / or a retransmission message is sent to the target device;

[0021] The retransmission message is used to inform the target device to retransmit the plurality of fragment file information, and the upload failure message is used to indicate that at least one fragment file in the target file fails to be uploaded.

[0022] In one of the embodiments, each fragment file information further comprises: an MD5 value corresponding to the fragment file; and the fragment file information is verified, comprising:

[0023] The MD5 value of the fragment file is calculated;

[0024] When the calculated MD5 value is consistent with the MD5 value corresponding to the slice file carried in each slice file information, it is determined that the slice file information is verified.

[0025] In a second aspect, the present application further provides a file slice management device, comprising:

[0026] A first receiving module is configured to receive a plurality of slice file information sent by a target device through a plurality of parallel threads, each slice file information comprising a slice file in a target file and a slice order of the slice file in the target file.

[0027] A splicing module is configured to splice a plurality of slice files in the plurality of slice file information according to the slice order of the slice file in the target file, so as to obtain the target file.

[0028] In one embodiment, the device further comprises:

[0029] A second receiving module is configured to receive a file acquisition request sent by a user terminal, the file acquisition request being used to request the target file, and the file acquisition request comprising a target file identifier.

[0030] An obtaining module is configured to obtain the plurality of slice files corresponding to the target file identifier and the slice order of each slice file in the target file.

[0031] A sending module is configured to send the target file to the user terminal.

[0032] In one embodiment, the device further comprises:

[0033] A storage module is configured to store the slice file information and set a timeout duration of the slice file information if the slice file information is verified.

[0034] A first deleting module is configured to delete the timeout duration of the slice file information and open a download interface for the target file if an upload success message sent by the target device is received.

[0035] The upload success message is used to indicate that all slice files in the target file are successfully uploaded.

[0036] In one embodiment, the device further comprises:

[0037] The second deleting module is configured to delete the plurality of piece file information and / or send a retransmission message to the target device when the storage duration of any piece file information in the plurality of piece file information is greater than the timeout duration, wherein the retransmission message is used to instruct the target device to retransmit the plurality of piece file information.

[0038] In one of the embodiments, the apparatus further comprises:

[0039] The third deleting module is configured to delete the plurality of piece file information and / or send a retransmission message to the target device when the upload failure message is received.

[0040] The retransmission message is used to instruct the target device to retransmit the plurality of piece file information, and the upload failure message is used to indicate that the uploading of at least one piece file in the target file fails.

[0041] In one of the embodiments, the storage module comprises:

[0042] The computing unit is configured to calculate the MD5 value of the piece file.

[0043] The determining unit is configured to determine that the piece file information is verified when the calculated MD5 value is consistent with the MD5 value corresponding to the piece file carried in each piece file information.

[0044] In a third aspect, the present application provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the following steps when executing the computer program:

[0045] The plurality of piece file information sent by the target device is received through a plurality of parallel threads, and each piece file information comprises one piece file in a target file and the piece order of the piece file in the target file.

[0046] The plurality of piece files in the plurality of piece file information are spliced according to the piece order of the piece file in the target file to obtain the target file.

[0047] In a fourth aspect, the present application provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the following steps:

[0048] The plurality of piece file information sent by the target device is received through a plurality of parallel threads, and each piece file information comprises one piece file in a target file and the piece order of the piece file in the target file.

[0049] According to the slice order of the slice file in the target file, the multiple slice files in the multiple slice file information are spliced to obtain the target file.

[0050] In a fifth aspect, the present application further provides a computer program product comprising a computer program which, when executed by a processor, implements the following steps:

[0051] The multiple slice file information sent by the target device is received through multiple parallel threads, and each slice file information comprises a slice file in a target file and a slice order of the slice file in the target file.

[0052] According to the slice order of the slice file in the target file, the multiple slice files in the multiple slice file information are spliced to obtain the target file.

[0053] The file slice management method, device, computer device, storage medium and product described above receive multiple slice file information sent by a target device through multiple parallel threads, and each slice file information comprises a slice file in a target file and a slice order of the slice file in the target file. According to the slice order of the slice file in the target file, the multiple slice files in the multiple slice file information are spliced to obtain the target file. Compared with sequentially sending slice files in the prior art, the transmission efficiency of the slice files is improved by receiving multiple slice file information sent by a target device through multiple parallel threads, and the file synthesis efficiency is improved by splicing multiple files according to the slice order. BRIEF DESCRIPTION OF DRAWINGS

[0054] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related art, the drawings needed to be used in the description of the embodiments of the present application or the related art will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other related drawings can also be obtained without creative labor on the basis of these drawings.

[0055] Figure 1 The application environment diagram of the file slice management method in one embodiment;

[0056] Figure 2 The flowchart of the file slice management method in one embodiment;

[0057] Figure 3 The flowchart of the file slice management method in another embodiment;

[0058] Figure 4 The flowchart of the file slice management method in another embodiment;

[0059] Figure 5 Flowchart of file fragment management method in another embodiment;

[0060] Figure 6 Flowchart of file fragment management method in another embodiment;

[0061] Figure 7 Flowchart of file fragment management method in another embodiment;

[0062] Figure 8 Flowchart of file fragment management method in another embodiment;

[0063] Figure 9 Flowchart of file fragment management method in another embodiment;

[0064] Figure 10 Structure block diagram of file fragment management device in an embodiment;

[0065] Figure 11 Internal structure diagram of computer device in an embodiment. DETAILED DESCRIPTION

[0066] In order to make the purpose, technical scheme and advantages of the present application clearer, the present application is further described in detail below in combination with the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and do not limit the present application. It should be noted that in the embodiments of the present application, some software, components, models and other industry existing schemes may be mentioned, which should be considered as exemplary, and the purpose is only to illustrate the feasibility of the technical scheme implementation of the present application, but does not mean that the applicant has or will necessarily use the scheme.

[0067] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the present application are all information and data authorized by the user or authorized by all parties, and the collection, use and processing of related data need to comply with relevant regulations. The acquisition, storage, use, processing and other data in the technical scheme of the present application comply with the relevant regulations of national laws and regulations.

[0068] The file fragment management method provided in the embodiments of the present application can be applied to, for example Figure 1The application environment shown. Among them, the target device 102 communicates with the server 104 through the network. The data storage system can store the data required by the server 104 to process. The data storage system can be integrated on the server 104, or placed on the cloud or other network servers. The server 104 receives multiple file information sent by the target device 102 through multiple parallel threads. Among them, the target device 102 can be a terminal or a server, for example, the target device 102 can be but not limited to various personal computers, notebook computers, smart phones, tablet computers, Internet of Things devices and portable wearable devices, Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car devices, projection devices, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The head-mounted device can be a virtual reality (VR) device, an augmented reality (AR) device, smart glasses, etc. The server 104 can be a standalone physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services.

[0069] In one embodiment, as shown in Figure 2 , a file fragment management method is provided, which is applied to Figure 1 The server is taken as an example for illustration, including:

[0070] S201, receiving multiple file information sent by the target device through multiple parallel threads, each file information including: a file fragment in the target file and the file fragment order in the target file.

[0071] In the embodiment of the present application, the target device divides the target file into multiple file fragments, the length of each file fragment can be the same or different, and the length of each file fragment can be set according to the preset requirement. Optionally, the target device can generate corresponding identification information for each file fragment, so as to generate file information according to each file fragment, the identification information corresponding to each file fragment and the file fragment order. Further, the target device sends multiple file information to the server through multiple parallel threads through a preset protocol, wherein the file fragment order in the multiple file information is carried in the header parameter of the preset protocol and sent to the server by the target device.

[0072] Optionally, the preset protocol can be File Transfer Protocol (FTP) or Hypertext Transfer Protocol (HTTP).

[0073] S202, according to the order of the target file in the file fragments, the plurality of file fragments in the plurality of file fragment information are spliced to obtain the target file.

[0074] In the embodiments of the present application, after the server receives the plurality of file fragment information, the plurality of file fragments in the plurality of file fragment information are sorted according to the order of the target file in the file fragments, and further, the plurality of file fragments in the plurality of file fragment information are spliced according to the sorting queue of each file fragment to obtain the target file.

[0075] Optionally, the server can splice the plurality of file fragments in the plurality of file fragment information to obtain the target file when receiving the plurality of file fragments, or the server can store the plurality of file fragments when receiving the plurality of file fragments, and then splice the plurality of file fragments in the plurality of file fragment information to obtain the target file when there is a demand for obtaining the target file.

[0076] In the above file fragment management method, the plurality of file fragment information sent by the target device is received by a plurality of parallel threads, each file fragment information includes a file fragment in the target file and the order of the file fragment in the target file; the plurality of file fragments in the plurality of file fragment information are spliced according to the order of the file fragment in the target file to obtain the target file. Compared with the sequential sending of file fragments in the prior art, the transmission efficiency of the file fragments is improved by receiving the plurality of file fragment information sent by the target device through a plurality of parallel threads, and the file synthesis efficiency is improved by splicing the plurality of files according to the order.

[0077] In one embodiment, as shown in Figure 3 Before the plurality of file fragments in the plurality of file fragment information are spliced according to the order of the target file in the file fragments to obtain the target file, the above file fragment management method further includes:

[0078] S203, receiving a file acquisition request sent by a user terminal, the file acquisition request being used to request the target file, and the file acquisition request including a target file identifier.

[0079] In the embodiments of the present application, after the plurality of file fragment information sent by the target device is received by the plurality of parallel threads, the server first stores the plurality of file fragment information, and further, the user terminal generates a file acquisition request according to its own demand, and sends the file acquisition request to the server through a preset download interface of the server. After receiving the file acquisition request sent by the user terminal, the server analyzes the file acquisition request to obtain the target file identifier.

[0080] Optionally, after receiving a message that the server stores the target file, the target terminal can generate a file retrieval request according to its own needs and send it to the server to obtain the target file; or, the target terminal can generate a file retrieval request according to its own needs and send it to the server. If the server does not store the target file, the retrieval of the target file will fail. If the server stores the target file, the server will respond to the file retrieval request and send the target file to the user terminal.

[0081] S204, obtain multiple fragment files corresponding to the target file identifier, and the fragment order of each fragment file in the target file.

[0082] In this embodiment, the fragmented file information also includes a target file identifier. Based on the target file identifier included in the file acquisition request, multiple fragmented file information including the target file identifier are determined at a preset storage location, thereby obtaining multiple fragmented files corresponding to the target file identifier, and the fragmentation order of each fragmented file in the target file. Then, based on the fragmentation order of the fragmented files in the target file, the multiple fragmented files in the multiple fragmented file information are concatenated to obtain the target file.

[0083] like Figure 4 As shown, after concatenating multiple fragment files from multiple fragment file information according to the fragmentation order of the fragment files in the target file to obtain the target file, the above file fragmentation management method also includes:

[0084] S205, send the target file to the user terminal.

[0085] In this embodiment of the application, after splicing multiple fragment files from multiple fragment file information to obtain the target file, the target file is sent to the user terminal through a preset download interface.

[0086] Optionally, the service can encrypt the target file according to a preset key and send the encrypted target file to the user terminal. After receiving the encrypted target file, the user terminal decrypts the encrypted target file according to the preset key to obtain the target file.

[0087] In this embodiment, multiple file fragments are concatenated into a target file only after a file retrieval request is received from the user terminal, rather than immediately concatenating multiple file fragments into a target file after receiving multiple fragments. This concentrates the server's resources on receiving file fragments, further improving the transmission efficiency of file fragments.

[0088] In one embodiment, such as Figure 5 As shown, after receiving multiple file fragment information sent by the target device through multiple parallel threads, the above file fragment management method further includes:

[0089] S206, in the case of passing the verification of the file segment information, store the file segment information, and set a timeout duration of the file segment information.

[0090] In the embodiments of the present application, the file segment information can further include verification information of the file segment, and the file segment information is verified according to the verification information. In the case of passing the verification of the file segment information, the file segment is stored in a preset storage location. Optionally, the preset storage location can be a preset database, such as a mongo database, a fastDFS file system, etc. A timeout duration is set for the file segment, and the timeout durations of the respective file segments can be the same or different. For example, the timeout duration of the file segment can be set to 1 day.

[0091] Optionally, the file segment information can further include a first key, and a second key is pre-stored in the server. The verification result of the file segment is determined by judging whether the first key and the second key have a corresponding relationship. If there is a corresponding relationship, the verification passes. If there is no corresponding relationship, the verification fails.

[0092] S207, if the upload success message sent by the target device is received, the timeout duration of the file segment information is deleted, and a download interface for the target file is opened. The upload success message is used to indicate that all the file segments in the target file are successfully uploaded.

[0093] In the embodiments of the present application, after the target device determines that all the file segments are successfully uploaded, the upload success message is sent to the server. After the server receives the upload success message, the timeout duration of the file segment information is deleted, the storage time of the file segment information in the server becomes permanent storage, and the download interface for the target file is opened. Optionally, after the server opens the download interface for the target file, a downloadable prompt message can be sent to the user terminal.

[0094] Optionally, as shown in Figure 6 After the file segment information is stored and the timeout duration of the file segment information is set, the above file segment management method further includes:

[0095] S208, if the upload failure message sent by the target device is received, the multiple file segment information is deleted, and / or a retransmission message is sent to the target device. The retransmission message is used to inform the target device to retransmit the multiple file segment information. The upload failure message is used to indicate that at least one file segment in the target file fails to be uploaded.

[0096] In the embodiment of the present application, after the target device determines that the uploading of at least one of the split files in the indication file fails, the target device sends an uploading failure message to the server. After receiving the uploading failure message, the server deletes the split file information of the target file, thereby avoiding invalid storage. Meanwhile, the server can send a retransmission message to the target device, so that the target device re-sends the split file information to the server.

[0097] As another optional implementation, after the target device determines that the uploading of at least one of the split files in the indication file fails, the target device sends an uploading failure message to the server. After receiving the uploading failure message, the server deletes the split file information of the target file, thereby avoiding invalid storage. Alternatively, the server can send a retransmission message to the target device, so that the target device re-sends the split file information to the server.

[0098] In the embodiment, if the split file information is verified, the split file information is stored, thereby improving the security of split file transmission and storage. If the uploading failure message sent by the target device is received, the split file information is deleted, thereby avoiding invalid storage.

[0099] In one embodiment, as shown in FIG. 2, the split file information is stored, and after the timeout duration of the split file information is set, the file split management method further includes: Figure 7

[0100] S209, when the storage duration of any split file information in the plurality of split file information is greater than the timeout duration, the plurality of split file information is deleted, and / or a retransmission message is sent to the target device. The retransmission message is used to inform the target device to retransmit the plurality of split file information.

[0101] In the embodiment of the present application, the time difference between the current time and the storage time of the split file information is calculated. The time difference is the storage duration of the split file information. If the storage duration is greater than the timeout duration, the split file information is stored for too long, and all split file information corresponding to the target file of the split file is deleted. Alternatively, the server can send a retransmission message to the target device, so that the target device re-sends the plurality of split file information to the server.

[0102] As another optional implementation, the time difference between the current time and the storage time of the split file information is calculated. The time difference is the storage duration of the split file information. If the storage duration is greater than the timeout duration, the split file information is stored for too long, and all split file information corresponding to the target file of the split file is deleted. Meanwhile, the server can send a retransmission message to the target device, so that the target device re-sends the plurality of split file information to the server.

[0103] ​In the embodiment, the plurality of piece file information is deleted and / or the retransmission message is sent to the target device in the case that any piece file information is stored for a timeout, so that invalid storage is avoided and the effective utilization of storage resources is improved.

[0104] In one embodiment, an implementation of S206 is provided, and each piece file information further comprises an MD5 value corresponding to the piece file. Figure 8 As shown in the figure, the "piece file information verification passed" comprises:

[0105] S301, calculating an MD5 value of the piece file.

[0106] In the embodiment, the process of calculating the MD5 value of the piece file can comprise:

[0107] (1) padding and length identification: padding the piece file to a multiple of 512 bits, and recording the length of the original piece file;

[0108] (2) initialization vector: using four 32-bit registers (A, B, C, D) as the initial vector for storing the intermediate calculation results;

[0109] (3) four-round loop operation: dividing the input message into several data blocks of 512 bits, and updating the values in the registers through four-round loop operation for each data block;

[0110] (4) updating the registers: updating the values of the registers A, B, C, D according to the results of the four-round loop operation;

[0111] (5) generating the hash value: connecting the final register values in the order of A, B, C, D to obtain a 128-bit MD5 hash value, which is the MD5 value of the piece file.

[0112] S302, when the calculated MD5 value is consistent with the MD5 value corresponding to the piece file carried in each piece file information, it is determined that the piece file information verification passed.

[0113] In the embodiment, the MD5 value corresponding to the piece file is further included in each piece file information. If the calculated MD5 value is consistent with the MD5 value corresponding to the piece file carried in the piece file information, it is determined that the piece file information verification passed. If the calculated MD5 value is inconsistent with the MD5 value corresponding to the piece file carried in the piece file information, it is determined that the piece file verification failed.

[0114] In the embodiment, the piece file is verified using the MD5 value, which can ensure the integrity of the data and the safety of the source of the piece file. The method of verifying the piece file using the MD5 value is simple and less prone to errors, and further improves the transmission efficiency of the piece file.

[0115] In view of the above, the present application also provides a file fragment management method, as shown in the following table: Figure 9

[0116] S1, receiving a plurality of fragment file information sent by a target device through a plurality of parallel threads, each of the fragment file information including a fragment file in a target file and a fragment order of the fragment file in the target file.

[0117] S2, calculating an MD5 value of the fragment file, and determining that the fragment file information is verified when the calculated MD5 value is consistent with the MD5 value corresponding to the fragment file carried in each of the fragment file information.

[0118] S3, storing the fragment file information and setting a timeout duration of the fragment file information.

[0119] S4, if an upload success message sent by the target device is received, performing S5; if an upload failure message sent by the target device is received, performing S6.

[0120] S5, deleting the timeout duration of the fragment file information and opening a download interface for the target file, wherein the upload success message is used to indicate that all the fragment files in the target file are uploaded successfully.

[0121] S6, deleting the plurality of fragment file information and / or sending a retransmission message to the target device, wherein the retransmission message is used to inform the target device to retransmit the plurality of fragment file information, and the upload failure message is used to indicate that at least one of the fragment files in the target file fails to be uploaded.

[0122] S7, when the storage duration of any of the plurality of fragment file information is greater than the timeout duration, deleting the plurality of fragment file information and / or sending a retransmission message to the target device, wherein the retransmission message is used to inform the target device to retransmit the plurality of fragment file information.

[0123] S8, receiving a file acquisition request sent by a user terminal, wherein the file acquisition request is used to request the target file, and the file acquisition request includes a target file identifier.

[0124] S9, acquiring a plurality of fragment files corresponding to the target file identifier and a fragment order of each of the fragment files in the target file.

[0125] S10, splicing the plurality of fragment files in the plurality of fragment file information according to the fragment order of the fragment files in the target file to obtain the target file.

[0126] S11, sending the target file to the user terminal.

[0127] ​In the file fragment management method, the multiple fragment file information sent by the target device is received by multiple parallel threads, each of the fragment file information includes one fragment file in the target file and a fragment order of the fragment file in the target file, and the multiple fragment files in the multiple fragment file information are spliced according to the fragment order of the fragment file in the target file to obtain the target file. Compared with the sequential sending of the fragment file in the prior art, the transmission efficiency of the fragment file is improved by receiving the multiple fragment file information sent by the target device by the multiple parallel threads, and the file synthesis efficiency is improved by splicing the multiple files according to the fragment order.

[0128] It should be understood that, although each step in the flowchart involved in each embodiment as described above is displayed in sequence according to the arrow, these steps are not necessarily executed in sequence according to the order of the arrow. Unless otherwise specified herein, the execution of these steps is not strictly limited in sequence, and these steps can be executed in other orders. Moreover, at least part of the steps in the flowchart involved in each embodiment as described above can include multiple steps or multiple stages, which are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily sequential, but can be executed alternately or alternately with at least part of other steps or steps or stages in other steps.

[0129] Based on the same inventive concept, the embodiments of the present application also provide a file fragment management device for implementing the above-mentioned file fragment management method. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme described in the above method, so the specific limitations in one or more file fragment management device embodiments provided below can refer to the limitations of the file fragment management method described above, which will not be repeated here.

[0130] In one embodiment, as shown in Figure 10 a file fragment management device is provided, comprising: a first receiving module 10 and a splicing module 11, wherein:

[0131] The first receiving module 10 is configured to receive multiple fragment file information sent by a target device through multiple parallel threads, each of the fragment file information including one fragment file in the target file and a fragment order of the fragment file in the target file.

[0132] The splicing module 11 is configured to splice multiple fragment files in the multiple fragment file information according to the fragment order of the fragment file in the target file to obtain the target file.

[0133] In one embodiment, the above-mentioned file fragment management device further comprises a second receiving module, an acquisition module and a sending module, wherein:

[0134] The second receiving module is configured to receive a file acquisition request sent by the user terminal, the file acquisition request being used to request a target file, and the file acquisition request comprising a target file identifier;

[0135] The obtaining module is configured to obtain a plurality of fragment files corresponding to the target file identifier and a fragment order of each fragment file in the target file.

[0136] The sending module is configured to send the target file to the user terminal.

[0137] In an embodiment, the file fragment management apparatus further comprises a storage module and a first deletion module, wherein:

[0138] The storage module is configured to, if the fragment file information is verified, store the fragment file information and set a timeout duration of the fragment file information.

[0139] The first deletion module is configured to, if an upload success message sent by the target device is received, delete the timeout duration of the fragment file information and open a download interface for the target file.

[0140] The upload success message is used to indicate that all the fragment files in the target file are successfully uploaded.

[0141] In an embodiment, the file fragment management apparatus further comprises a second deletion module, configured to, if an upload failure message sent by the target device is received, delete the plurality of fragment file information and / or send a retransmission message to the target device.

[0142] The retransmission message is used to instruct the target device to retransmit the plurality of fragment file information, and the upload failure message is used to indicate that at least one fragment file in the target file fails to be uploaded.

[0143] In an embodiment, the storage module comprises a calculation unit and a determination unit, wherein:

[0144] The calculation unit is configured to calculate an MD5 value of the fragment file.

[0145] The determination unit is configured to, if the calculated MD5 value is consistent with an MD5 value corresponding to the fragment file carried in each fragment file information, determine that the fragment file information is verified.

[0146] Each module in the file fragment management apparatus can be realized by software, hardware and a combination thereof in whole or in part. Each module can be embedded in or independent of a processor in a computer device in a hardware form, or can be stored in a memory in a computer device in a software form, so as to be called and executed by a processor to perform operations corresponding to each module.

[0147] In an exemplary embodiment, a computer device, which can be a server, is provided, and an internal structure diagram of the computer device can be as shown in Figure 11 The computer device includes a processor, a memory, an input / output interface (I / O), and a communication interface. The processor, the memory, and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for running the operating system and the computer program in the non-volatile storage medium. The database of the computer device is configured to store file fragment management data. The input / output interface of the computer device is configured to exchange information between the processor and external devices. The communication interface of the computer device is configured to communicate with external terminals through a network connection. The computer program is executed by the processor to implement a file fragment management method.

[0148] Those skilled in the art can understand that Figure 11 The structure shown in the above embodiment is only a block diagram of part of the structure related to the scheme of the present application, and does not constitute a limitation on the computer device to which the scheme of the present application is applied. The specific computer device can include more or fewer components than those shown in the diagram, or combine certain components, or have a different arrangement of components.

[0149] In an embodiment, a computer device is provided, including a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the following steps:

[0150] Receiving, by a plurality of parallel threads, a plurality of fragment file information sent by a target device, each fragment file information including a fragment file in a target file and a fragment order of the fragment file in the target file;

[0151] Splicing a plurality of fragment files in the plurality of fragment file information according to the fragment order of the fragment file in the target file to obtain the target file.

[0152] In an embodiment, the processor executing the computer program further implements the following steps:

[0153] Receiving a file acquisition request sent by a user terminal, the file acquisition request being configured to request a target file, and the file acquisition request including a target file identifier;

[0154] Obtaining a plurality of fragment files corresponding to the target file identifier and a fragment order of each fragment file in the target file;

[0155] After splicing the plurality of fragment files in the plurality of fragment file information according to the fragment order of the fragment files in the target file to obtain the target file, the method further comprises:

[0156] sending the target file to a user terminal.

[0157] In one embodiment, the processor, when executing the computer program, further implements the following steps:

[0158] In the case that the fragment file information is verified, storing the fragment file information and setting a timeout duration of the fragment file information;

[0159] If an upload success message sent by the target device is received, deleting the timeout duration of the fragment file information and opening a download interface for the target file;

[0160] The upload success message is used to indicate that all the fragment files in the target file are uploaded successfully.

[0161] In one embodiment, the processor, when executing the computer program, further implements the following steps:

[0162] When the storage duration of any fragment file information in the plurality of fragment file information is greater than the timeout duration, deleting the plurality of fragment file information, and / or sending a retransmission message to the target device, the retransmission message being used to inform the target device to retransmit the plurality of fragment file information.

[0163] In one embodiment, the processor, when executing the computer program, further implements the following steps:

[0164] If an upload failure message sent by the target device is received, deleting the plurality of fragment file information, and / or sending a retransmission message to the target device;

[0165] The retransmission message is used to inform the target device to retransmit the plurality of fragment file information, and the upload failure message is used to indicate that at least one fragment file in the target file fails to be uploaded.

[0166] In one embodiment, the processor, when executing the computer program, further implements the following steps:

[0167] calculating an MD5 value of the fragment file;

[0168] When the calculated MD5 value is consistent with the MD5 value corresponding to the fragment file carried in each fragment file information, it is determined that the fragment file information is verified.

[0169] In one embodiment, a computer readable storage medium is provided, and the computer readable storage medium stores a computer program, and the computer program, when executed by a processor, implements the following steps:

[0170] receiving, by a plurality of parallel threads, a plurality of piece file information sent by the target device, each piece file information including a piece file in the target file and a piece order of the piece file in the target file;

[0171] splicing the plurality of piece files in the plurality of piece file information according to the piece order of the piece file in the target file to obtain the target file.

[0172] In an embodiment, the computer program, when executed by the processor, further implements the following steps: receiving a file acquisition request sent by the user terminal, the file acquisition request being used to request the target file, and the file acquisition request including the target file identifier;

[0173] obtaining a plurality of piece files corresponding to the target file identifier and a piece order of each piece file in the target file;

[0174] After splicing the plurality of piece files in the plurality of piece file information according to the piece order of the piece file in the target file to obtain the target file, the method further includes:

[0175] sending the target file to the user terminal.

[0176] In an embodiment, the computer program, when executed by the processor, further implements the following steps: in a case where the piece file information is verified, storing the piece file information and setting a timeout duration of the piece file information;

[0177] If the upload success message sent by the target device is received, the timeout duration of the piece file information is deleted, and a download interface for the target file is opened;

[0178] The upload success message is used to indicate that all the piece files in the target file are successfully uploaded.

[0179] In an embodiment, the computer program, when executed by the processor, further implements the following steps: in a case where a storage duration of any piece file information in the plurality of piece file information is greater than the timeout duration, deleting the plurality of piece file information, and / or sending a retransmission message to the target device, the retransmission message being used to inform the target device to retransmit the plurality of piece file information.

[0180] In an embodiment, the computer program, when executed by the processor, further implements the following steps: if the upload failure message sent by the target device is received, deleting the plurality of piece file information, and / or sending a retransmission message to the target device;

[0181] The retransmission message is used to inform the target device to retransmit the plurality of piece file information, and the upload failure message is used to indicate that at least one piece file in the target file fails to be uploaded.

[0182] In one embodiment, the computer program, when executed by the processor, further implements the following steps: calculating the MD5 value of the split file;

[0183] When the calculated MD5 value is consistent with the MD5 value corresponding to the split file carried in each split file information, it is determined that the split file information is verified.

[0184] In one embodiment, a computer program product is provided, comprising a computer program which, when executed by a processor, implements the following steps:

[0185] Receiving a plurality of split file information sent by the target device through a plurality of parallel threads, each split file information including: one split file in the target file and the split order of the split file in the target file;

[0186] According to the split order of the split file in the target file, the plurality of split files in the plurality of split file information are spliced to obtain the target file.

[0187] In one embodiment, the computer program, when executed by the processor, further implements the following steps:

[0188] Receiving a file acquisition request sent by the user terminal, the file acquisition request being used to request the target file, and the file acquisition request including the target file identifier;

[0189] Obtaining a plurality of split files corresponding to the target file identifier and the split order of each split file in the target file;

[0190] According to the split order of the split file in the target file, the plurality of split files in the plurality of split file information are spliced to obtain the target file, and the method further comprises:

[0191] Sending the target file to the user terminal.

[0192] In one embodiment, the computer program, when executed by the processor, further implements the following steps:

[0193] In the case that the split file information is verified, storing the split file information and setting a timeout duration of the split file information;

[0194] If the upload success message sent by the target device is received, the timeout duration of the split file information is deleted, and a download interface for the target file is opened;

[0195] The upload success message is used to indicate that all split files in the target file are successfully uploaded.

[0196] In one embodiment, the computer program, when executed by the processor, further implements the following steps:

[0197] When the storage duration of any of the plurality of split file information is greater than the timeout duration, the plurality of split file information is deleted, and / or a retransmission message is sent to the target device, the retransmission message being used to inform the target device to retransmit the plurality of split file information.

[0198] In one embodiment, the computer program, when executed by the processor, further implements the following steps:

[0199] If the upload failure message sent by the target device is received, the plurality of split file information is deleted, and / or a retransmission message is sent to the target device;

[0200] The retransmission message is used to inform the target device to retransmit the plurality of split file information, and the upload failure message is used to indicate that the upload of at least one split file in the target file fails.

[0201] In one embodiment, the computer program, when executed by the processor, further implements the following steps:

[0202] The MD5 value of the split file is calculated.

[0203] When the calculated MD5 value is consistent with the MD5 value corresponding to the split file carried in each split file information, it is determined that the split file information is verified.

[0204] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer readable storage medium, and when executed, can include the processes of the above-mentioned embodiment methods. Any reference to memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. The non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical storage, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. The volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration but not limitation, the RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The database involved in the embodiments provided in the present application can include at least one of a relational database and a non-relational database. The non-relational database can include a distributed database based on a block chain, etc., without being limited thereto. The processor involved in the embodiments provided in the present application can be a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., without being limited thereto.

[0205] The technical features of the above embodiments can be combined in any manner. To make the description concise, not all possible combinations of the technical features in the above embodiments are described, but as long as the combinations of the technical features do not exist contradictions, they should be considered as the scope of the present application.

[0206] The above-described embodiments are merely illustrative of several embodiments of the present application, and the description is relatively specific and detailed, but should not be understood as a limitation on the scope of the patent. It should be noted that for those skilled in the art, without departing from the concept of the present application, a number of modifications and improvements can be made, which are all within the scope of the present application. Therefore, the scope of protection of the present application should be subject to the appended claims.

Claims

1. A file fragment management method characterized by, The method comprises: receiving a plurality of piece file information sent by a target device through a plurality of parallel threads, each piece file information comprising a piece file in a target file and a piece order of the piece file in the target file; receiving a file acquisition request sent by a user terminal, the file acquisition request being used for requesting the target file, the file acquisition request comprising a target file identifier; obtaining the plurality of piece files corresponding to the target file identifier and the piece order of each piece file in the target file; splicing the plurality of piece files in the plurality of piece file information according to the piece order of each piece file in the target file to obtain the target file; sending the target file to the user terminal.

2. The method of claim 1, wherein, After the plurality of piece file information sent by the target device is received through the plurality of parallel threads, the method further comprises: in a case where the piece file information is verified, storing the piece file information and setting a timeout duration of the piece file information; if an upload success message sent by the target device is received, deleting the timeout duration of the piece file information and opening a download interface for the target file; wherein the upload success message is used for indicating that all the piece files in the target file are successfully uploaded.

3. The method of claim 2, wherein, After the piece file information is stored and the timeout duration of the piece file information is set, the method further comprises: when a storage duration of any piece file information in the plurality of piece file information is greater than the timeout duration, deleting the plurality of piece file information and / or sending a retransmission message to the target device, the retransmission message being used for notifying the target device to retransmit the plurality of piece file information.

4. The method of claim 2, wherein, After the piece file information is stored and the timeout duration of the piece file information is set, the method further comprises: if an upload failure message sent by the target device is received, deleting the plurality of piece file information and / or sending a retransmission message to the target device; wherein the retransmission message is used for notifying the target device to retransmit the plurality of piece file information, and the upload failure message is used for indicating that at least one piece file in the target file fails to be uploaded.

5. The method according to any one of claims 2 to 4, characterized in that, Each piece file information further comprises an MD5 value corresponding to the piece file; and the piece file information is verified, comprising: calculating the MD5 value of the piece file; when the calculated MD5 value is consistent with the MD5 value corresponding to the piece file carried in each piece file information, it is determined that the piece file information is verified.

6. A file fragment management apparatus characterized by comprising: The device comprises: a first receiving module, configured to receive a plurality of piece file information sent by a target device through a plurality of parallel threads, each piece file information comprising a piece file in a target file and a piece order of the piece file in the target file; a second receiving module, configured to receive a file acquisition request sent by a user terminal, the file acquisition request being used for requesting the target file, the file acquisition request comprising a target file identifier; The acquisition module is configured to acquire the plurality of split files corresponding to the target file identifier and the split order of each split file in the target file. The splicing module is configured to splice the plurality of split files in the plurality of split file information according to the split order of the split files in the target file to obtain the target file. The sending module is configured to send the target file to the user terminal.

7. The apparatus of claim 6, wherein, The device further comprises: The storage module is configured to store the split file information if the split file information passes the verification and set a timeout duration of the split file information. The first deletion module is configured to delete the timeout duration of the split file information and open a download interface for the target file if an upload success message sent by the target device is received. The upload success message is used to indicate that all the split files in the target file are successfully uploaded.

8. The apparatus of claim 7, wherein, The device further comprises: The second deletion module is configured to delete the plurality of split file information and / or send a retransmission message to the target device if the storage duration of any split file information in the plurality of split file information is greater than the timeout duration.

9. The apparatus of claim 7, wherein, The third deletion module is configured to delete the plurality of split file information and / or send a retransmission message to the target device if an upload failure message sent by the target device is received. The retransmission message is used to instruct the target device to retransmit the plurality of split file information, and the upload failure message is used to indicate that at least one split file in the target file fails to be uploaded. The storage module comprises:

10. The device of any of claims 7-9, wherein, The computing unit is configured to calculate the MD5 value of the split file. The determination unit is configured to determine that the split file information passes the verification if the calculated MD5 value is consistent with the MD5 value corresponding to the split file carried in each split file information. The processor executes the computer program to implement the steps of the method in any one of claims 1 to 5. 11.A computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the computer device is configured to perform the method according to any one of claims 1-10. The computer program is executed by the processor to implement the steps of the method in any one of claims 1 to 5.

12. A computer readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method in any one of claims 1 to 5.

13. A computer program product comprising a computer program, characterized in that, ​

Citation Information

Patent Citations

  • File downloading method and device, server and storage medium

    CN113411404A

  • File processing method and device, storage medium and computer equipment

    CN113961946A