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

By receiving and splicing fragmented files in fragmented order through parallel threads, it solves the problem of low file fragmentation transmission efficiency in traditional technology and achieves efficient file reconstruction and transmission. It is suitable for large file transmission and the financial industry with high security requirements.

CN118573671AActive Publication Date: 2024-08-30CHINA CONSTRUCTION BANK +1
View PDF 3 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

The traditional file fragmentation transmission efficiency is low, resulting in network congestion and storage resource waste. Especially in the financial industry with large file transmission and high security requirements, traditional technology sequentially transmits fragmented files, which has efficiency problems.

Method used

The fragmented file information sent by the target device is received through multiple parallel threads. Each fragmented file information includes a fragmented file in the target file and its fragmentation order in the target file, and is spliced ​​according to the fragmentation order. Realize the reconstruction and transmission of target files.

Benefits of technology

It improves the transmission efficiency of fragmented files and file synthesis efficiency, avoids network congestion and waste of storage resources, and meets the financial industry's demand for high-security transmission.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118573671A
    Figure CN118573671A
Patent Text Reader

Abstract

The invention 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 steps of receiving multiple pieces of fragment file information sent by target equipment through multiple parallel threads, wherein each piece of fragment file information comprises one fragment file in a target file and a fragment sequence of the fragment file in the target file; and according to the fragmentation sequence of the fragmented files in the target file, splicing the plurality of fragmented files in the plurality of pieces of fragmented file information to obtain the target file. Compared with the prior art that the fragmented files are sequentially sent, the method has the advantages that the information of the fragmented files sent by the target equipment is received through the parallel threads, the transmission efficiency of the fragmented files is improved, the files are spliced according to the fragmentation sequence, and the synthesis efficiency of the files is improved.
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 segmentation management method, device, computer equipment, storage medium and product. Background Art

[0002] With the growth of data volume, large file transmission and storage have become important challenges. When processing large files, traditional file storage methods are prone to network congestion and storage resource waste due to the large size of the files and low transmission efficiency. For example, in the financial field, the remote operation and maintenance of equipment in banks and other financial institutions requires the device to upload local running files for remote problem analysis, but local running files are often large, and due to industry characteristics, the files need to be encrypted with high security requirements before transmission. Therefore, large files need to be divided into multiple fragmented files for encrypted transmission.

[0003] In the conventional technology, the fragmented data is usually transmitted in sequence according to the order of the fragmented files, which results in the problem of low file transmission efficiency. Summary of the invention

[0004] Based on this, it is necessary to provide a file segmentation management method, device, computer equipment, storage medium and product that can improve file transfer efficiency in response to the above technical problems.

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

[0006] Receiving multiple slice file information sent by the target device through multiple parallel threads, each slice file information includes: a slice file in the target file and the slice order of the slice file in the target file;

[0007] According to the fragmentation order of the fragment files in the target file, multiple fragment files in the multiple fragment file information are spliced ​​to obtain the target file.

[0008] In one embodiment, before splicing the multiple fragment files in the multiple fragment file information according to the fragment order of the fragment files in the target file to obtain the target file, the method further includes:

[0009] 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;

[0010] Acquire the multiple slice files corresponding to the target file identifier, and the slice order of each slice file in the target file;

[0011] After the multiple fragment files in the multiple fragment file information are spliced ​​according to the fragment order of the fragment files in the target file to obtain the target file, the method further includes:

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

[0013] In one embodiment, after receiving multiple shard file information sent by the target device through multiple parallel threads, the method further includes:

[0014] If the segment file information is verified, the segment file information is stored and a timeout period of the segment file information is set;

[0015] If an upload success message sent by the target device is received, the timeout period of the segment 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 segment files in the target file are uploaded successfully.

[0017] In one embodiment, after storing the fragment file information and setting the timeout duration of the fragment file information, the method further includes:

[0018] When the storage duration of any of the multiple slice file information is greater than the timeout duration, the multiple slice file information is deleted, and / or a retransmission message is sent to the target device, wherein the retransmission message is used to notify the target device to retransmit the multiple slice file information.

[0019] In one embodiment, after storing the fragment file information and setting the timeout duration of the fragment file information, the method further includes:

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

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

[0022] In one embodiment, each of the shard file information further includes: an MD5 value corresponding to the shard file; the shard file information verification is passed, including:

[0023] Calculate the MD5 value of the fragment file;

[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 verification has passed.

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

[0026] A first receiving module is used to receive multiple slice file information sent by a target device through multiple parallel threads, each of which includes: a slice file in the target file and a slice order of the slice file in the target file;

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

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

[0029] A second receiving module, configured to receive 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;

[0030] An acquisition module, used for acquiring 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 used to send the target file to the user terminal.

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

[0033] A storage module, used for storing the slice file information and setting a timeout period for the slice file information when the slice file information is verified.

[0034] A first deletion module, configured to delete the timeout period of the segment 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 segment files in the target file are uploaded successfully.

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

[0037] The second deletion module is used to delete the multiple fragment file information when the storage duration of any fragment file information among the multiple fragment file information is greater than the timeout duration, and / or send a retransmission message to the target device, wherein the retransmission message is used to notify the target device to retransmit the multiple fragment file information.

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

[0039] A third deleting module, configured to delete the plurality of fragment file information and / or send a retransmission message to the target device if an upload failure message sent by the target device is received;

[0040] The retransmission message is used to notify the target device to retransmit the information of the multiple segment files, and the upload failure message is used to indicate that at least one segment file in the target file fails to be uploaded.

[0041] In one embodiment, the storage module includes:

[0042] A calculation unit, used to calculate the MD5 value of the fragment file;

[0043] The determination unit is used to determine that the verification of the slice file information is passed when the calculated MD5 value is consistent with the MD5 value corresponding to the slice file carried in each slice file information.

[0044] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0045] Receiving multiple slice file information sent by the target device through multiple parallel threads, each slice file information includes: a slice file in the target file and the slice order of the slice file in the target file;

[0046] According to the fragmentation order of the fragment files in the target file, multiple fragment files in the multiple fragment file information are spliced ​​to obtain the target file.

[0047] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:

[0048] Receiving multiple slice file information sent by the target device through multiple parallel threads, each slice file information includes: a slice file in the target file and the slice order of the slice file in the target file;

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

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

[0051] Receiving multiple slice file information sent by the target device through multiple parallel threads, each slice file information includes: a slice file in the target file and the slice order of the slice file in the target file;

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

[0053] The above-mentioned file slicing management method, device, computer equipment, storage medium and product receive multiple slicing file information sent by the target device through multiple parallel threads, each slicing file information includes: a slicing file in the target file and the slicing order of the slicing file in the target file; according to the slicing order of the slicing file in the target file, multiple slicing files in the multiple slicing file information are spliced ​​to obtain the target file. Compared with the prior art of sending slicing files sequentially, the multiple slicing file information sent by the target device through multiple parallel threads is received, which improves the transmission efficiency of the slicing files, and splices multiple files according to the slicing order, thereby improving the synthesis efficiency of the files. BRIEF DESCRIPTION OF THE DRAWINGS

[0054] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0055] FIG1 is an application environment diagram of a file segmentation management method in one embodiment;

[0056] FIG2 is a schematic diagram of a flow chart of a file segment management method in one embodiment;

[0057] FIG3 is a schematic diagram of a flow chart of a file segment management method in another embodiment;

[0058] FIG4 is a schematic diagram of a flow chart of a file segment management method in another embodiment;

[0059] FIG5 is a schematic diagram of a flow chart of a file segment management method in another embodiment;

[0060] FIG6 is a schematic diagram of a flow chart of a file segment management method in another embodiment;

[0061] FIG7 is a schematic diagram of a flow chart of a file segment management method in another embodiment;

[0062] FIG8 is a schematic diagram of a flow chart of a file segment management method in another embodiment;

[0063] FIG9 is a schematic diagram of a flow chart of a file segment management method in another embodiment;

[0064] FIG10 is a structural block diagram of a file segment management device in one embodiment;

[0065] FIG. 11 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

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

[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 used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations. The acquisition, storage, use, and processing of data in the technical solution of this application are in compliance with relevant provisions of national laws and regulations.

[0068] The file slicing management method provided in the embodiment of the present application can be applied in the application environment shown in FIG. 1. The target device 102 communicates with the server 104 through a network. The data storage system can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104, or it can be placed on the cloud or other network servers. The server 104 receives multiple slicing file information sent by the target device 102 through multiple parallel threads. The target device 102 can be a terminal or a server. For example, the target device 102 can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, Internet of Things devices and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car devices, projection devices, etc. The portable wearable device can be a smart watch, a smart bracelet, a head-mounted device, 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 an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud computing services.

[0069] In one embodiment, as shown in FIG. 2 , a file sharding management method is provided, which is described by taking the method applied to the server in FIG. 1 as an example, including:

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

[0071] In an embodiment of the present application, the target device divides the target file into multiple slice files, the lengths of each slice file can be the same or different, and the lengths of each slice file can be set according to preset requirements. Optionally, the target device can generate corresponding identification information for each slice file, thereby generating slice file information according to each slice file and the identification information corresponding to each slice file and the slice order. Further, the target device sends the multiple slice file information to the server simultaneously through multiple parallel threads through a preset protocol, wherein the slice order in the multiple slice file information is carried in the header parameter of the preset protocol and sent to the server by the target file.

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

[0073] S202, according to the fragmentation order of the fragmentation files in the target file, multiple fragmentation files in the multiple fragmentation file information are spliced ​​to obtain the target file.

[0074] In an embodiment of the present application, after receiving multiple shard file information, the server sorts the multiple shard files in the multiple shard file information according to the shard order of the shard files in the target file. Further, according to the sorting queue of each shard file, the server splices the multiple shard files in the multiple shard file information to obtain the target file.

[0075] Optionally, when receiving multiple fragment files, the server may splice multiple fragment files in the multiple fragment file information to obtain the target file; or, when receiving multiple fragment files, the server may store the multiple fragment files, and when there is a need to obtain the target file, splice the multiple fragment files in the multiple fragment file information to obtain the target file.

[0076] In the above-mentioned file slicing management method, multiple slicing file information sent by the target device is received through multiple parallel threads, and each slicing file information includes: a slicing file in the target file and the slicing order of the slicing file in the target file; according to the slicing order of the slicing file in the target file, multiple slicing files in the multiple slicing file information are spliced ​​to obtain the target file. Compared with the prior art of sending slicing files sequentially, the multiple slicing file information sent by the target device is received through multiple parallel threads, which improves the transmission efficiency of the slicing files, and splicing multiple files according to the slicing order improves the synthesis efficiency of the files.

[0077] In one embodiment, as shown in FIG3 , before splicing the multiple fragment files in the multiple fragment file information according to the fragment order of the fragment files in the target file to obtain the target file, the file fragment management method further includes:

[0078] S203: Receive a file acquisition request sent by a user terminal, where the file acquisition request is used to request a target file and includes a target file identifier.

[0079] In an embodiment of the present application, after receiving multiple shard file information sent by the target device through multiple parallel threads, the server first stores the multiple shard file information. Furthermore, the user terminal generates a file acquisition request according to its own needs, and sends the file acquisition request to the server through the server's preset download interface. After receiving the file acquisition request sent by the user terminal, the server parses the file acquisition request to obtain the target file identifier.

[0080] Optionally, after receiving a message that the target file is stored in the server, the target terminal can generate a file acquisition request according to its own needs and send it to the server to obtain the target file; alternatively, the target terminal can generate a file acquisition request according to its own needs and send it to the server. If the target file is not stored in the server, the acquisition of the target file fails. If the target file is stored in the server, the server responds to the file acquisition request and sends the target file to the user terminal.

[0081] S204, obtaining a plurality of slice files corresponding to the target file identifier and the slice order of each slice file in the target file.

[0082] In the embodiment of the present application, the fragment file information also includes a target file identifier, and according to the target file identifier included in the file acquisition request, multiple fragment file information including the target file identifier is determined in a preset storage location, thereby obtaining multiple fragment files corresponding to the target file identifier and the fragment order of each fragment file in the target file. Therefore, according to the fragment order of the fragment files in the target file, multiple fragment files in the multiple fragment file information are spliced ​​to obtain the target file.

[0083] As shown in FIG4 , 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 to obtain the target file, the file fragment management method further includes:

[0084] S205: Send the target file to the user terminal.

[0085] In an embodiment of the present application, after the multiple fragment files in the multiple fragment file information are spliced ​​to obtain the target file, the target file is sent to the user terminal through a preset download interface.

[0086] Optionally, the service may 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 segmented files are spliced ​​into a target file only after receiving a file acquisition request sent by a user terminal, rather than immediately splicing multiple segmented files into a target file after receiving multiple segments. This concentrates the resources in the server on receiving segmented files, further improving the transmission efficiency of segmented files.

[0088] In one embodiment, as shown in FIG5 , after receiving multiple shard file information sent by the target device through multiple parallel threads, the file shard management method further includes:

[0089] S206: When the segment file information verification passes, the segment file information is stored and a timeout period of the segment file information is set.

[0090] In the embodiment of the present application, the shard file information may also include verification information of the shard file, and the shard information is verified according to the verification information. When the shard file information is verified, the shard file is stored in a preset storage location. Optionally, the preset storage location may be a preset database, such as a mongo database, a fastDFS file system, etc. A timeout period is set for the shard file, and the timeout periods of each file may be the same or different. For example, the timeout period of the shard file may be set to 1 day.

[0091] Optionally, the shard file information may also include a first key, and a second key is pre-stored in the server. The verification result of the shard file is determined by judging whether there is a corresponding relationship between the first key and the second key. If so, the verification passes; if not, the verification fails.

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

[0093] In the embodiment of the present application, after the target device determines that all the segmented files have been uploaded successfully, it sends an upload success message to the server. After receiving the upload success message, the server deletes the timeout period of the segmented file information, so that the storage time of the segmented file information in the server becomes permanent storage, and opens a download interface for the target file. Optionally, after the server opens the download interface for the target file, it can send a downloadable prompt message to the user terminal.

[0094] Optionally, as shown in FIG6 , after storing the fragment file information and setting the timeout period of the fragment file information, the file fragment management method further includes:

[0095] S208, if an upload failure message is received from the target device, delete multiple segment file information, and / or send a retransmission message to the target device; wherein the retransmission message is used to notify the target device to retransmit multiple segment file information, and the upload failure message is used to indicate that at least one segment file in the target file has failed to be uploaded.

[0096] In an embodiment of the present application, after the target device determines that at least one segment file in the indication file has failed to be uploaded, it sends an upload failure message to the server. After receiving the upload failure message, the server deletes the multiple segment file information corresponding to the target file to avoid invalid storage. At the same time, the server can send a retransmission message to the target device, so that the target device resends the multiple segment file information to the server.

[0097] As another optional implementation, after the target device determines that at least one segment file in the indication file has failed to upload, it sends an upload failure message to the server. After receiving the upload failure message, the server deletes multiple segment files of the target file to avoid invalid storage. Alternatively, the server can send a retransmission message to the target device, so that the target device resends multiple segment file information to the server.

[0098] In this embodiment, when the segment file information verification is passed, the segment file information is stored, which improves the security of segment file transmission and storage. If an upload failure message is received from the target device, multiple segment file information is deleted to avoid invalid storage.

[0099] In one embodiment, as shown in FIG. 7 , after storing the fragment file information and setting the timeout period of the fragment file information, the file fragment management method further includes:

[0100] S209, when the storage duration of any of the multiple slice file information is greater than the timeout duration, delete the multiple slice file information, and / or send a retransmission message to the target device, the retransmission message is used to notify the target device to retransmit the multiple slice file information.

[0101] In an embodiment of the present application, the time difference between the current moment and the storage moment of the shard file information is calculated, and the time difference is the storage duration of the shard file information. If the storage duration is greater than the timeout duration, the storage of the shard file information times out, and all shard file information of the target file corresponding to the shard file is deleted. Alternatively, the server can send a retransmission message to the target device, so that the target device resends multiple shard file information to the server.

[0102] As another optional implementation, the time difference between the current moment and the storage moment of the shard file information is calculated, and the time difference is the storage duration of the shard file information. If the storage duration is greater than the timeout duration, the storage of the shard file information times out, and all shard file information of the target file corresponding to the shard file is deleted, and the server can send a retransmission message to the target device, so that the target device resends multiple shard file information to the server.

[0103] In this embodiment, when the storage of any fragment file information times out, multiple fragment file information is deleted, and / or a retransmission message is sent to the target device, thereby avoiding invalid storage and improving the effective utilization of storage resources.

[0104] In one embodiment, an implementation of the above S206 is provided, where each shard file information also includes: an MD5 value corresponding to the shard file, as shown in FIG8 , and the above “shard file information verification passed” includes:

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

[0106] In the embodiment of the present application, the process of calculating the MD5 value of the fragment file may include:

[0107] (1) Padding and length identification: fill the slice file to a multiple of 512 bits and record the length of the original slice file;

[0108] (2) Initialization vector: Use four 32-bit registers (A, B, C, D) as the initial vector to store intermediate calculation results;

[0109] (3) Four-round loop operation: The input message is divided into several 512-bit data blocks. Each data block undergoes four rounds of loop operation to update the value in the register.

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

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

[0112] S302: 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 verification is passed.

[0113] In an embodiment of the present application, each shard file information also includes an MD5 value corresponding to the shard file. If the calculated MD5 value is consistent with the MD5 value corresponding to the shard file carried in the shard file information, it is determined that the shard file information verification has passed; if the calculated MD5 value is inconsistent with the MD5 value corresponding to the shard file carried in the shard file information, it is determined that the shard file verification has failed.

[0114] In this embodiment, using MD5 values ​​to verify the slice files can ensure data integrity and the source security of the slice files. The method of using MD5 values ​​to verify the slice files is simple and not prone to errors, which further improves the transmission efficiency of the slice files.

[0115] Based on all the above embodiments, a file segment management method is also provided, as shown in FIG9 , the method includes:

[0116] S1, receiving multiple slice file information sent by a target device through multiple parallel threads, each slice file information includes: a slice file in the target file and the slice order of the slice file in the target file.

[0117] S2, calculating the MD5 value of the slice file; 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 verification has passed.

[0118] S3 stores the shard file information and sets the timeout period for the shard file information.

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

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

[0121] S6, deleting multiple fragment file information, and / or sending a retransmission message to the target device; wherein the retransmission message is used to notify the target device to retransmit multiple fragment file information, and the upload failure message is used to indicate that at least one fragment file in the target file has failed to be uploaded.

[0122] S7, when the storage duration of any fragment file information among the multiple fragment file information is greater than the timeout duration, delete the multiple fragment file information, and / or send a retransmission message to the target device, the retransmission message is used to notify the target device to retransmit the multiple fragment file information.

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

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

[0125] S10, according to the fragmentation order of the fragmentation files in the target file, multiple fragmentation files in the multiple fragmentation file information are spliced ​​to obtain the target file.

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

[0127] In the above-mentioned file slicing management method, multiple slicing file information sent by the target device is received through multiple parallel threads, and each slicing file information includes: a slicing file in the target file and the slicing order of the slicing file in the target file; according to the slicing order of the slicing file in the target file, multiple slicing files in the multiple slicing file information are spliced ​​to obtain the target file. Compared with the prior art of sending slicing files sequentially, the multiple slicing file information sent by the target device is received through multiple parallel threads, which improves the transmission efficiency of the slicing files, and splicing multiple files according to the slicing order improves the synthesis efficiency of the files.

[0128] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages 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 to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

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

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

[0131] The first receiving module 10 is used to receive multiple slice file information sent by the target device through multiple parallel threads, and each slice file information includes: a slice file in the target file and the slice order of the slice file in the target file.

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

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

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

[0135] An acquisition module, used to acquire a plurality of fragment files corresponding to the target file identifier, and the fragment order of each fragment file in the target file;

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

[0137] In one embodiment, the file fragment management device further includes: a storage module and a first deletion module, wherein:

[0138] The storage module is used to store the shard file information and set the timeout period of the shard file information when the shard file information verification passes;

[0139] A first deletion module is used to delete the timeout period of the fragment file information if a successful upload message sent by the target device is received, and open a download interface for the target file;

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

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

[0142] The retransmission message is used to notify the target device to retransmit information of multiple segment files, and the upload failure message is used to indicate that at least one segment file in the target file has failed to be uploaded.

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

[0144] A calculation unit, used to calculate the MD5 value of the fragment file;

[0145] The determination unit is used to determine that the verification of the slice file information is passed when the calculated MD5 value is consistent with the MD5 value corresponding to the slice file carried in each slice file information.

[0146] Each module in the above-mentioned file slicing management device can be implemented in whole or in part by software, hardware or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module above.

[0147] In an exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be shown in FIG11. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected via a system bus, and the communication interface is connected to the system bus via the input / output interface. The processor of the computer device is used 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 the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store file slicing management data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a file slicing management method is implemented.

[0148] Those skilled in the art will understand that the structure shown in FIG. 11 is merely a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.

[0149] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:

[0150] Receiving multiple slice file information sent by the target device through multiple parallel threads, each slice file information includes: a slice file in the target file and a slice order of the slice file in the target file;

[0151] According to the fragmentation order of the fragment files in the target file, multiple fragment files in the multiple fragment file information are spliced ​​to obtain the target file.

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

[0153] Receiving a file acquisition request sent by a user terminal, the file acquisition request is used to request a target file, and the file acquisition request includes a target file identifier;

[0154] Obtain multiple fragment files corresponding to the target file identifier, and the fragment order of each fragment file in the target file;

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

[0156] Send the target file to the user terminal.

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

[0158] If the shard file information is verified, the shard file information is stored and a timeout period is set for the shard file information;

[0159] If a successful upload message is received from the target device, the timeout period of the segment file information is deleted, and a download interface for the target file is opened;

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

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

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

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

[0164] If an upload failure message is received from the target device, the information of the plurality of fragment files is deleted, and / or a retransmission message is sent to the target device;

[0165] The retransmission message is used to notify the target device to retransmit information of multiple segment files, and the upload failure message is used to indicate that at least one segment file in the target file has failed to be uploaded.

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

[0167] Calculate the MD5 value of the fragment file;

[0168] 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 verification has passed.

[0169] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:

[0170] Receiving multiple slice file information sent by the target device through multiple parallel threads, each slice file information includes: a slice file in the target file and a slice order of the slice file in the target file;

[0171] According to the fragmentation order of the fragment files in the target file, multiple fragment files in the multiple fragment file information are spliced ​​to obtain the target file.

[0172] In one embodiment, when the computer program is executed by the processor, the following steps are further implemented: receiving a file acquisition request sent by a user terminal, the file acquisition request is used to request a target file, and the file acquisition request includes a target file identifier;

[0173] Obtain multiple fragment files corresponding to the target file identifier, and the fragment order of each fragment file in the target file;

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

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

[0176] In one embodiment, when the computer program is executed by the processor, the following steps are further implemented: if the slice file information verification passes, the slice file information is stored, and a timeout period of the slice file information is set;

[0177] If a successful upload message is received from the target device, the timeout period of the segment 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 segment files in the target file are uploaded successfully.

[0179] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: when the storage duration of any slice file information among multiple slice file information is greater than the timeout duration, the multiple slice file information is deleted, and / or a retransmission message is sent to the target device, and the retransmission message is used to notify the target device to retransmit the multiple slice file information.

[0180] In one embodiment, when the computer program is executed by the processor, the following steps are further implemented: if an upload failure message sent by the target device is received, deleting information of multiple segment files, and / or sending a retransmission message to the target device;

[0181] The retransmission message is used to notify the target device to retransmit information of multiple segment files, and the upload failure message is used to indicate that at least one segment file in the target file has failed to be uploaded.

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

[0183] 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 verification has passed.

[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 multiple slice file information sent by the target device through multiple parallel threads, each slice file information includes: a slice file in the target file and a slice order of the slice file in the target file;

[0186] According to the fragmentation order of the fragment files in the target file, multiple fragment files in the multiple fragment file information are spliced ​​to obtain the target file.

[0187] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

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

[0189] Obtain multiple fragment files corresponding to the target file identifier, and the fragment order of each fragment file in the target file;

[0190] After splicing the multiple fragment files in the multiple fragment file information according to the fragment order of the fragment files in the target file to obtain the target file, the method further includes:

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

[0192] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0193] If the shard file information is verified, the shard file information is stored and a timeout period is set for the shard file information;

[0194] If a successful upload message is received from the target device, the timeout period of the segment 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 the segment files in the target file are uploaded successfully.

[0196] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

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

[0198] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0199] If an upload failure message is received from the target device, the information of the plurality of fragment files is deleted, and / or a retransmission message is sent to the target device;

[0200] The retransmission message is used to notify the target device to retransmit information of multiple segment files, and the upload failure message is used to indicate that at least one segment file in the target file has failed to be uploaded.

[0201] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0202] Calculate the MD5 value of the fragment file;

[0203] 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 verification has passed.

[0204] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the 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. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.

[0205] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0206] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be construed as limiting the scope of the present application. It should be noted that, for a person of ordinary skill in the art, several modifications and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A file fragmentation management method, It is characterized in that The method comprises: Receiving multiple slice file information sent by the target device through multiple parallel threads, each slice file information includes: a slice file in the target file and the slice order of the slice file in the target file; According to the fragmentation order of the fragment files in the target file, multiple fragment files in the multiple fragment file information are spliced ​​to obtain the target file.

2. The method according to claim 1, It is characterized in that Before 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 includes: 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; Acquire the multiple slice files corresponding to the target file identifier, and the slice order of each slice file in the target file; After the multiple fragment files in the multiple fragment file information are spliced ​​according to the fragment order of the fragment files in the target file to obtain the target file, the method further includes: The target file is sent to the user terminal.

3. The method according to claim 1, It is characterized in that After receiving the multiple shard file information sent by the target device through the multiple parallel threads, the method further includes: If the segment file information is verified, the segment file information is stored and a timeout period of the segment file information is set; If an upload success message sent by the target device is received, the timeout period of the segment file information is deleted, and a download interface for the target file is opened; The upload success message is used to indicate that all segment files in the target file are uploaded successfully.

4. The method according to claim 3, It is characterized in that After storing the fragment file information and setting the timeout duration of the fragment file information, the method further includes: When the storage duration of any of the multiple slice file information is greater than the timeout duration, the multiple slice file information is deleted, and / or a retransmission message is sent to the target device, wherein the retransmission message is used to notify the target device to retransmit the multiple slice file information.

5. The method according to claim 3, It is characterized in that After storing the fragment file information and setting the timeout duration of the fragment file information, the method further includes: If an upload failure message sent by the target device is received, deleting the plurality of segment file information, and / or sending a retransmission message to the target device; The retransmission message is used to notify the target device to retransmit the information of the multiple segment files, and the upload failure message is used to indicate that at least one segment file in the target file fails to be uploaded.

6. The method according to any one of claims 3 to 5, It is characterized in that Each of the shard file information also includes: the MD5 value corresponding to the shard file; the shard file information verification is passed, including: Calculate the MD5 value of the fragment file; 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 verification has passed.

7. A file fragmentation management device, It is characterized in that The device comprises: A first receiving module is used to receive multiple slice file information sent by a target device through multiple parallel threads, each of which includes: a slice file in the target file and a slice order of the slice file in the target file; The splicing module is used to splice the multiple fragment files in the multiple fragment file information according to the fragment order of the fragment files in the target file to obtain the target file.

8. The device according to claim 7, It is characterized in that The device also includes: A second receiving module, configured to receive 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; An acquisition module, used for acquiring the plurality of slice files corresponding to the target file identifier, and the slice order of each slice file in the target file; A sending module is used to send the target file to the user terminal.

9. The device according to claim 7, It is characterized in that The device also includes: A storage module, used for storing the slice file information and setting a timeout period for the slice file information when the slice file information is verified. A first deletion module, configured to delete the timeout period of the segment 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 segment files in the target file are uploaded successfully.

10. The device according to claim 9, It is characterized in that The device also includes: The second deletion module is used to delete the multiple fragment file information when the storage duration of any fragment file information among the multiple fragment file information is greater than the timeout duration, and / or send a retransmission message to the target device, wherein the retransmission message is used to notify the target device to retransmit the multiple fragment file information.

11. The device according to claim 9, It is characterized in that The device also includes: A third deleting module, configured to delete the plurality of fragment 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 notify the target device to retransmit the information of the multiple segment files, and the upload failure message is used to indicate that at least one segment file in the target file fails to be uploaded.

12. The device according to any one of claims 9 to 11, It is characterized in that The storage module comprises: A calculation unit, used to calculate the MD5 value of the fragment file; The determination unit is used to determine that the verification of the slice file information is passed when the calculated MD5 value is consistent with the MD5 value corresponding to the slice file carried in each slice file information.

13. A computer device comprising a memory and a processor, wherein the memory stores a computer program. It is characterized in that When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

14. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

15. A computer program product comprising a computer program, It is characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

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

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

    CN116827672A