A file uploading method, device, apparatus and storage medium

By differentiating deduplication methods based on file size, the problem of network redundancy and disk waste caused by duplicate file uploads is solved, thus improving efficiency and security.

CN116614491BActive Publication Date: 2026-02-06CETC CYBERSPACE SECURITY TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202310494690.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-05-05
Publication Date
2026-02-06
Estimated Expiration
2043-05-05

AI Technical Summary

Technical Problem

In existing technologies, file uploads suffer from network transmission redundancy and disk space waste due to repeated uploads, especially on clients with weak computing power such as browsers, where strong verification calculations take a long time, resulting in excessively long waiting times.

Method used

Files are categorized into large and small files based on their size, and different deduplication methods are used: small files undergo strong verification directly, while large files undergo weak verification followed by strong verification. After files are uploaded, the server performs strong verification and generates file fingerprints for tamper-proof verification.

Benefits of technology

It improves the efficiency of file deduplication verification, reduces waiting time, avoids duplicate uploads, saves disk space, and enhances the security of data transmission.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116614491B_ABST
    Figure CN116614491B_ABST
Patent Text Reader

Abstract

The application discloses a file uploading method and device, equipment and storage medium, and relates to the technical field of computers. The method comprises the following steps: determining a deduplication checking mode corresponding to a to-be-uploaded file according to a file type corresponding to the to-be-uploaded file; the file type comprises a large file and a small file; the deduplication checking mode comprises strong checking and / or weak checking; a check value corresponding to the to-be-uploaded file is calculated according to the deduplication checking mode, and the check value is sent to a server for judgment; and according to a judgment result of the server, a corresponding uploading mode is selected, and the to-be-uploaded file is uploaded to the server. Different deduplication checking modes are used for different file sizes, the deduplication checking efficiency is improved by using the deduplication checking mode suitable for the file size, finally, the to-be-uploaded file is uploaded to the server according to the judgment result of the server, and the file uploading efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the computer technical field, in particular to a file uploading method, device, equipment and storage medium. BACKGROUND

[0002] In file transmission storage, the same file is often uploaded multiple times, resulting in redundant network transmission and disk redundancy, so it is necessary to perform deduplication verification on the uploaded file to reduce repeated transmission of the same file and save disk space.

[0003] The principle of file deduplication is mainly to compare the check values calculated based on the file content, and equal is considered as the same file. The usual deduplication verification scheme includes strong verification and weak verification; among them, the weak verification only judges whether the file is likely to be repeated, that is, a part of the file is sampled before the file is uploaded, and the check value of the sampled part is uploaded to the server for weak verification to search whether there is a possibility of the same file; the strong verification is used to judge whether the file really exists duplication, that is, the full-text check value of the file is calculated and the result is uploaded to the server, and the server searches the full-text check value of the existing file to judge whether there is the same file. The strong verification has high accuracy, but for the browser and other weak client with weak computing ability, the full-text check value calculation is prone to lag and long waiting time. SUMMARY

[0004] Therefore, the purpose of the present application is to provide a file uploading method, device, equipment and medium, which can improve the efficiency of file deduplication verification. The specific scheme is as follows:

[0005] In a first aspect, the present application discloses a file uploading method, comprising:

[0006] According to the file type corresponding to the to-be-uploaded file, determine the deduplication verification mode corresponding to the to-be-uploaded file; the file type includes large files and small files; the deduplication verification mode includes strong verification and / or weak verification;

[0007] According to the deduplication verification mode, calculate the check value corresponding to the to-be-uploaded file, and send the check value to the server for judgment;

[0008] According to the judgment result of the server, select the corresponding uploading mode, and upload the to-be-uploaded file to the server.

[0009] Optionally, according to the file type corresponding to the to-be-uploaded file, determining the deduplication verification mode corresponding to the to-be-uploaded file comprises:

[0010] According to the local computing capacity, determine the file size threshold, and according to the file size threshold, determine the file type of the to-be-uploaded file;

[0011] obtaining a mapping relationship between a pre-constructed file type and a deduplication verification mode; the mapping relationship includes a first mapping relationship between a small file and a strong verification, and a second mapping relationship between a large file and a weak verification followed by a strong verification;

[0012] determining a deduplication verification mode corresponding to the uploaded file according to the mapping relationship.

[0013] Optionally, before the calculating the check value corresponding to the to-be-uploaded file according to the deduplication verification mode and sending the check value to the server for judgment, the method further includes:

[0014] generating a fingerprint corresponding to the to-be-uploaded file;

[0015] Correspondingly, the selecting a corresponding uploading mode according to the judgment result of the server and uploading the to-be-uploaded file to the server includes:

[0016] selecting a corresponding uploading mode according to the judgment result of the server, uploading the to-be-uploaded file and the fingerprint to the server, so that the server performs anti-tampering verification according to the fingerprint.

[0017] Optionally, the generating the fingerprint corresponding to the to-be-uploaded file includes:

[0018] grouping the to-be-uploaded file according to a preset segmentation rule to obtain a plurality of sub-files;

[0019] generating the fingerprint of the to-be-uploaded file by calculating the fingerprint of each sub-file in parallel based on target parameter information corresponding to the to-be-uploaded file; the target parameter information includes file size, file format, segmentation rule adopted by the file, and grouping hash value.

[0020] Optionally, the calculating the check value corresponding to the to-be-uploaded file according to the deduplication verification mode and sending the check value to the server for judgment includes:

[0021] if the to-be-uploaded file is a large file, calculating a first check value corresponding to the to-be-uploaded file according to file size information and format information corresponding to the to-be-uploaded file, and sending the first check value to the server for judgment;

[0022] if the judgment result of the server is that the file exists, taking the hash value of the first group of sub-files of the to-be-uploaded file as a second check value, and sending the first check value to the server for judgment;

[0023] If the server judgment result is that the file exists, a third check value corresponding to the to-be-uploaded file is calculated in a strong check mode, and the third check value is sent to the server for judgment.

[0024] Optionally, the uploading the to-be-uploaded file to the server according to the judgment result of the server includes:

[0025] If the server judgment result is that the file does not exist, the to-be-stored file is uploaded to the server;

[0026] If the server judgment result is that the file exists, the to-be-stored file is secondly uploaded to the server.

[0027] Optionally, after the uploading the to-be-uploaded file to the server, the method further includes:

[0028] The server performs a deduplication operation on the to-be-uploaded file in the strong check mode.

[0029] In a second aspect, the present application discloses a file uploading device, including:

[0030] A check mode determination module is configured to determine a deduplication check mode corresponding to a to-be-uploaded file according to a file type corresponding to the to-be-uploaded file; the file type includes a large file and a small file; and the deduplication check mode includes a strong check and / or a weak check.

[0031] A check value calculation module is configured to calculate a check value corresponding to the to-be-uploaded file according to the deduplication check mode, and send the check value to a server for judgment.

[0032] An uploading module is configured to select a corresponding uploading mode according to a judgment result of the server, and upload the to-be-uploaded file to the server.

[0033] In a third aspect, the present application discloses an electronic device, including:

[0034] A memory is configured to save a computer program.

[0035] A processor is configured to execute the computer program to implement the aforementioned file uploading method.

[0036] In a fourth aspect, the present application discloses a computer readable storage medium configured to store a computer program; when the computer program is executed by a processor, the aforementioned file uploading method is implemented.

[0037] In the application, according to the file type corresponding to the to-be-uploaded file, the deduplication verification mode corresponding to the to-be-uploaded file is determined; the file type includes large files and small files; the deduplication verification mode includes strong verification and / or weak verification; the verification value corresponding to the to-be-uploaded file is calculated according to the deduplication verification mode, and the verification value is sent to the server for judgment; according to the judgment result of the server, the corresponding uploading mode is selected, and the to-be-uploaded file is uploaded to the server. It can be seen that different deduplication verification modes are performed for different file sizes, the deduplication verification efficiency is improved by using the deduplication verification mode suitable for the file size, the invalid waiting time is avoided, and finally the to-be-uploaded file is uploaded to the server according to the judgment result of the server, thereby improving the file uploading efficiency. BRIEF DESCRIPTION OF DRAWINGS

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

[0039] Figure 1 A file uploading method flowchart is provided for the present application;

[0040] Figure 2 A specific file uploading method flowchart is provided for the present application;

[0041] Figure 3 A specific small file deduplication verification method flowchart is provided for the present application;

[0042] Figure 4 A specific large file deduplication verification method flowchart is provided for the present application;

[0043] Figure 5 A file uploading device structure schematic diagram is provided for the present application;

[0044] Figure 6 An electronic equipment structure diagram is provided for the present application. DETAILED DESCRIPTION

[0045] In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the following will clearly and completely describe the technical solutions in the embodiments of the present application with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part but not all of the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art without creative work fall within the protection scope of the present application.

[0046] In the prior art, a common deduplication verification scheme includes strong verification and weak verification. The weak verification only judges whether a file is possibly duplicated, and is performed before the file is uploaded. A part of the file is sampled, a verification value of the sampled part is calculated and uploaded to a server for weak verification, and it is determined whether there is a possibility of existence of the same file. The strong verification is used to determine whether the file is really duplicated, and is performed by calculating a full-text verification value of the file and uploading the result to the server. The server retrieves the full-text verification value of the existing file to determine whether there is the same file. The strong verification has high accuracy, but for a client such as a browser with weak computing capability, the full-text verification value calculation is prone to lag and long waiting time. To overcome the above technical problems, the present application provides a file uploading method which can improve the efficiency of file deduplication verification.

[0047] The embodiments of the present application disclose a file uploading method, referring to Figure 1 The method can include the following steps:

[0048] Step S11: determining a deduplication verification mode corresponding to the to-be-uploaded file according to a file type corresponding to the to-be-uploaded file; the file type includes a large file and a small file; the deduplication verification mode includes strong verification and / or weak verification.

[0049] In the embodiments, first, a file type is determined according to a file type corresponding to a to-be-uploaded file, the file type includes a large file and a small file, that is, the type of the file is determined according to the size of the file, and then a deduplication verification mode corresponding to the file is determined according to the file type, wherein the deduplication verification mode includes strong verification and / or weak verification.

[0050] In this embodiment, the determining of the deduplication verification mode corresponding to the to-be-uploaded file according to the file type corresponding to the to-be-uploaded file can include: determining a file size threshold according to a local computing capability, and determining the file type of the to-be-uploaded file according to the file size threshold; obtaining a mapping relationship between a file type and a deduplication verification mode that is constructed in advance; the mapping relationship includes a first mapping relationship between a small file and strong verification, and a second mapping relationship between a large file and weak verification first and then strong verification; and determining the deduplication verification mode corresponding to the to-be-uploaded file according to the mapping relationship. That is, the file type is determined based on the local computing capability. The time consumption of the client for calculating a check value for a file of different size is different. In order to minimize the waiting time for deduplication verification before file uploading, the client sets a suitable file size threshold according to the computing capability of the client to distinguish between a large file and a small file. Different deduplication verification modes are used for files of different sizes, thereby improving the experience of file uploading.

[0051] Specifically, for a small file, a strong verification mode can be directly used, and for a large file, weak verification can be performed first, and then it is determined whether to perform strong verification according to the verification result. Weak verification is to calculate a check value based on part of the information of the file, and then upload the check value to the server for weak verification to search for the possibility of existence of the same file. Strong verification is to calculate a check value of the whole text of the file and upload the result to the server, and the server searches for the check value of the whole text of the existing file to determine whether there is the same file.

[0052] Step S12: calculating a check value corresponding to the to-be-uploaded file according to the deduplication verification mode, and sending the check value to the server for judgment.

[0053] In this embodiment, after the deduplication verification mode is determined, a check value of the to-be-uploaded file is calculated according to the determined deduplication verification mode. The check value can be a hash value, and then the hash value is sent to the server for judgment.

[0054] Step S13: selecting a corresponding uploading mode according to the judgment result of the server, and uploading the to-be-uploaded file to the server.

[0055] In this embodiment, the client selects a corresponding uploading mode according to the judgment result of the server, and uploads the to-be-uploaded file to the server. That is, whether the to-be-uploaded file exists is determined according to the verification of the server, and a corresponding uploading mode is selected.

[0056] In the embodiment, the uploading the to-be-uploaded file to the server according to the corresponding uploading mode selected according to the judgment result of the server can include: if the judgment result of the server is that the file does not exist, uploading the to-be-stored file to the server; and if the judgment result of the server is that the file exists, performing the file second-uploading operation on the to-be-stored file. That is, if the same file does not exist, the conventional file uploading operation is performed, and if the same file exists, the file second-uploading operation is performed, so as to achieve the purpose of file second-uploading and saving disk space.

[0057] In the embodiment, after the to-be-uploaded file is uploaded to the server, the server can further perform a deduplication operation on the to-be-uploaded file by using a strong verification mode. It can be understood that, for a client such as a browser with weak computing capability, calculating the hash value of a large file can cause the browser to be stuck and the waiting time to be long. The embodiment supports that the client with very weak computing capability such as the browser can not perform the deduplication before uploading, and the file is deduplicated by the server after being uploaded by using the strong verification mode, so as to reduce the sticking and waiting time of the browser, enhance the user experience, and achieve the purpose of saving space by deduplicating files. Moreover, the deduplication is performed once after the file is uploaded, so as to avoid the waste of disk space caused by uploading the same file simultaneously.

[0058] As can be seen from the above, in the embodiment, the deduplication verification mode corresponding to the to-be-uploaded file is determined according to the file type of the to-be-uploaded file; the file type includes a large file and a small file; the deduplication verification mode includes strong verification and / or weak verification; a verification value corresponding to the to-be-uploaded file is calculated according to the deduplication verification mode, and the verification value is sent to the server for judgment; and the to-be-uploaded file is uploaded to the server according to the corresponding uploading mode selected according to the judgment result of the server. It can be seen that different deduplication verification modes are performed for different file sizes, the deduplication verification is performed by using the deduplication verification mode adapted to the file size, the efficiency of the deduplication verification is improved, invalid waiting time is avoided, and finally the to-be-uploaded file is uploaded to the server according to the corresponding uploading mode determined according to the judgment result of the server, so as to improve the file uploading efficiency.

[0059] The embodiment of the application discloses a specific file uploading method, as shown in Figure 2 The method can include the following steps:

[0060] Step S21: determining the deduplication verification mode corresponding to the to-be-uploaded file according to the file type of the to-be-uploaded file; the file type includes a large file and a small file; and the deduplication verification mode includes strong verification and / or weak verification.

[0061] Step S22: generating a fingerprint corresponding to the to-be-uploaded file.

[0062] In this embodiment, the fingerprint corresponding to the to-be-uploaded file is generated before the to-be-uploaded file is uploaded, and the fingerprint is used for tamper-proofing verification.

[0063] In this embodiment, the generation of the fingerprint corresponding to the to-be-uploaded file can include: grouping the to-be-uploaded file according to a preset segmentation rule to obtain a plurality of sub-files; and obtaining the fingerprint of the to-be-uploaded file by parallel computing the fingerprint corresponding to each sub-file based on target parameter information corresponding to the to-be-uploaded file; the target parameter information includes file size, file format, segmentation rule adopted by the file, and grouping hash value. Specifically, the file can be segmented into five groups according to a length ratio of 1:2:2:2:1, and the remainder is added to the last group. For a file with a size less than 256 bytes, only one group is divided, that is, only the first group. Then, the file size, format, and hash of each group of the file are used to form the fingerprint of the file. When the size and format, segmentation rule, and hash of each group of two files are consistent, the two files are determined to be the same. Moreover, the file fingerprint is calculated in parallel, thereby improving the fingerprint calculation efficiency.

[0064] Step S23: Calculate the verification value corresponding to the to-be-uploaded file according to the deduplication verification mode, and send the verification value to the server for judgment.

[0065] If the to-be-uploaded file is a small file, the process of calculating the verification value corresponding to the to-be-uploaded file according to the deduplication verification mode and sending the verification value to the server for judgment is as shown in FIG. 2. 1. The hash value of the small file is calculated quickly, and no weak verification is performed. The hash values of all groups of the file are calculated in parallel, and the complete file fingerprint is obtained. Then, the file fingerprint is reported to the server for strong verification. 2. If there is a same file, the file is secondarily uploaded. 3. If there is no same file, the client starts to upload the file, and reports the file fingerprint to the server after the file is uploaded. 4. The server first compares the file group fingerprint information uploaded and the file group fingerprint calculated in parallel. If they are consistent, the file is uploaded and deduplicated; otherwise, the process is ended. Figure 3

[0066] Step S24: According to the judgment result of the server, select a corresponding uploading mode, and upload the to-be-uploaded file and the fingerprint to the server, so that the server performs tamper-proofing verification according to the fingerprint.

[0067] ​In the prior art, the sample hash value and the full-text hash value calculated before the last carrying of the file upload are carried, the server trusts the client to calculate the result, no file fingerprint checking is performed, and the calculation result is stored in the file fingerprint library as the file fingerprint for subsequent file deduplication checking. In the embodiment, after the file is uploaded successfully, the server efficiently calculates the file fingerprint according to the fingerprint calculation rule of the client, and compares the file fingerprint with the file fingerprint transmitted by the client to the server in the initial stage of uploading, to prevent the file from being tampered with without being found in the data transmission process, and to improve the security in the data transmission process. Thus, the problem of the prior art that the anti-tampering checking scheme is usually missing after the file is uploaded is avoided. In the embodiment, the anti-tampering checking is performed to achieve the purpose of second transmission of the same file and saving of disk space under the premise of ensuring data security.

[0068] The specific process of steps S21 and S23 can refer to the corresponding content disclosed in the foregoing embodiments, which will not be described here.

[0069] As can be seen, in the embodiment, the fingerprint corresponding to the to-be-uploaded file is generated, the checking value corresponding to the to-be-uploaded file is calculated according to the deduplication checking mode, and the checking value is sent to the server for judgment. According to the judgment result of the server, a corresponding uploading mode is selected, and the to-be-uploaded file and the fingerprint are uploaded to the server, so that the server performs anti-tampering checking according to the fingerprint. That is, before the file is uploaded, the file is grouped according to the grouping rule. According to the time consumption of different sizes of files in calculating the hash, different checking modes are used for pre-uploading deduplication. After the file is uploaded, post-uploading deduplication is performed to avoid the waste of disk space caused by the simultaneous uploading of the same file. And after the uploading is completed, the file is subjected to an anti-tampering check.

[0070] On the basis of the foregoing embodiment, the embodiment further discloses a file deduplication checking method for large files, that is, the foregoing step of calculating the checking value corresponding to the to-be-uploaded file according to the deduplication checking mode and sending the checking value to the server for judgment, comprising the following steps.

[0071] Step S31: If the to-be-uploaded file is a large file, a first checking value corresponding to the to-be-uploaded file is calculated according to file size information and format information corresponding to the to-be-uploaded file, and the first checking value is sent to the server for judgment.

[0072] Step S32: If the server judgment result is that the file exists, the hash value of the first group of subfiles of the to-be-uploaded file is taken as a second checking value, and the first checking value is sent to the server for judgment.

[0073] Step S33: If the server determines that the file exists, a third check value corresponding to the file to be uploaded is calculated in a strong check mode, and the third check value is sent to the server for determination.

[0074] For example Figure 4 As shown in the figure, it can be understood that, due to the very sparse size distribution of large files and the long calculation time of the hash value, the client reads the size and format of the file first, uploads the first check value to the server for weak check deduplication, quickly judges the possibility of duplication, and reduces the waiting time of the file when it is not duplicated. If the weak check response has the possibility of the same file, the hash value of the first group of the file is calculated, the completeness of the file fingerprint is supplemented, and then the weak check is performed again based on the second check value. If there is still a possibility of duplication in the response, the probability of duplication of the file is greatly improved, the hash values of the remaining groups of the file are calculated in parallel, the complete third check value is obtained, and the third check value is reported to the server for tamper-proof strong check. After the check passes, the file is deduplicated. If the weak check response does not have the possibility of the same file, the file is uploaded, and the hash values of the remaining groups of the file are calculated. After the file is completely uploaded, the complete group fingerprint of the file is reported to the server for tamper-proof strong check. After the check passes, the file is deduplicated after uploading. If the strong check response already exists, the client responds to the file second transmission. Thus, the weak check supports different check modes from low to high collision rate, and appropriate mode can be selected for files of different sizes to reduce the waiting time of deduplication check.

[0075] Correspondingly, the embodiment of the application further discloses a file uploading device, as shown in Figure 5 The device comprises:

[0076] A check mode determination module 11 is configured to determine a deduplication check mode corresponding to the file to be uploaded according to a file type corresponding to the file to be uploaded. The file type comprises a large file and a small file. The deduplication check mode comprises strong check and / or weak check.

[0077] A check value calculation module 12 is configured to calculate a check value corresponding to the file to be uploaded in the deduplication check mode, and send the check value to the server for determination.

[0078] An uploading module 13 is configured to select a corresponding uploading mode according to the determination result of the server, and upload the file to be uploaded to the server.

[0079] It can be seen that, according to the file type corresponding to the to-be-uploaded file, the de-duplication verification mode corresponding to the to-be-uploaded file is determined; the file type includes a large file and a small file; the de-duplication verification mode includes strong verification and / or weak verification; a verification value corresponding to the to-be-uploaded file is calculated according to the de-duplication verification mode, and the verification value is sent to a server for judgment; and according to a judgment result of the server, a corresponding uploading mode is selected, and the to-be-uploaded file is uploaded to the server. It can be seen that, different de-duplication verification modes are performed according to different file sizes, the de-duplication verification mode suitable for the file size is used for verification, the efficiency of de-duplication verification is improved, invalid waiting time is avoided, finally, the to-be-uploaded file is uploaded to the server according to the judgment result of the server, and the file uploading efficiency is improved.

[0080] In some embodiments, the verification mode determination module 11 can specifically include:

[0081] A file type determination unit is configured to determine a file size threshold according to local computing capability, and determine a file type of a to-be-uploaded file according to the file size threshold.

[0082] A mapping relationship acquisition unit is configured to acquire a pre-constructed mapping relationship between file types and de-duplication verification modes; the mapping relationship includes a first mapping relationship between a small file and strong verification, and a second mapping relationship between a large file and weak verification followed by strong verification.

[0083] A de-duplication verification mode determination unit is configured to determine a de-duplication verification mode corresponding to the to-be-uploaded file according to the mapping relationship.

[0084] In some embodiments, the file uploading apparatus can specifically include:

[0085] A fingerprint generation unit is configured to generate a fingerprint corresponding to the to-be-uploaded file.

[0086] Correspondingly, the uploading module 13 includes:

[0087] A fingerprint uploading unit is configured to select a corresponding uploading mode according to a judgment result of the server, and upload the to-be-uploaded file and the fingerprint to the server, so that the server performs anti-tampering verification according to the fingerprint.

[0088] In some embodiments, the fingerprint generation unit can specifically include:

[0089] A grouping unit is configured to group the to-be-uploaded file according to a preset segmentation rule, to obtain a plurality of sub-files.

[0090] The to-be-uploaded file fingerprint generation unit is configured to generate a fingerprint of the to-be-uploaded file by calculating a fingerprint of each sub-file in parallel based on target parameter information corresponding to the to-be-uploaded file, wherein the target parameter information includes file size, file format, a splitting rule adopted by the file, and a group hash value.

[0091] In some embodiments, the check value calculation module 12 can specifically include:

[0092] The first check unit is configured to, if the to-be-uploaded file is a large file, calculate a first check value corresponding to the to-be-uploaded file according to file size information and format information corresponding to the to-be-uploaded file, and send the first check value to the server for judgment.

[0093] The second check unit is configured to, if the server judgment result is that the file exists, take a hash value of a first group of sub-files of the to-be-uploaded file as a second check value, and send the first check value to the server for judgment.

[0094] The third check unit is configured to, if the server judgment result is that the file exists, calculate a third check value corresponding to the to-be-uploaded file according to a strong check mode, and send the third check value to the server for judgment.

[0095] In some embodiments, the upload module 13 can specifically include:

[0096] The first upload unit is configured to, if the server judgment result is that the file does not exist, upload the to-be-stored file to the server.

[0097] The second upload unit is configured to, if the server judgment result is that the file exists, secondarily upload the to-be-stored file to the server.

[0098] In some embodiments, the file uploading apparatus can specifically include:

[0099] The deduplication unit is configured to perform a deduplication operation on the to-be-uploaded file by the server using a strong check mode.

[0100] Further, the embodiments of the present application also disclose an electronic device, as shown in Figure 6 The content in the figure cannot be considered as any limitation on the use range of the present application.

[0101] Figure 6A structural schematic diagram of an electronic device 20 is provided in the embodiments of the present application. The electronic device 20 can specifically include at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25 and a communication bus 26. The memory 22 is configured to store a computer program, the computer program is loaded and executed by the processor 21 to implement the related steps in the file uploading method disclosed in any of the foregoing embodiments.

[0102] In the embodiments, the power supply 23 is configured to provide working voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and external devices, and the communication protocol followed by the communication interface 24 can be any communication protocol applicable to the technical solution of the present application, which is not limited specifically herein; the input / output interface 25 is configured to obtain external input data or output data to the outside, and the specific interface type can be selected according to the specific application needs, which is not limited specifically herein.

[0103] In addition, the memory 22 as a carrier for resource storage can be a read-only memory, a random access memory, a magnetic disk or an optical disk, etc., and the resources stored thereon include an operating system 221, a computer program 222 and data 223 including the file to be uploaded, etc., and the storage mode can be temporary storage or permanent storage.

[0104] The operating system 221 is configured to manage and control each hardware device on the electronic device 20 and the computer program 222, so as to implement the operation and processing of the processor 21 on the mass data 223 in the memory 22, and the operating system 221 can be Windows Server, Netware, Unix, Linux, etc. The computer program 222 can further include computer programs for completing other specific work in addition to the computer programs for completing the file uploading method executed by the electronic device 20 disclosed in any of the foregoing embodiments.

[0105] Further, the embodiments of the present application further disclose a computer storage medium, the computer storage medium stores computer executable instructions, and the computer executable instructions are loaded and executed by the processor to implement the file uploading method steps disclosed in any of the foregoing embodiments.

[0106] The embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts of each embodiment can be referred to each other. For the device disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple, and the related parts can be referred to the method part.

[0107] The steps of a method or algorithm described in connection with the embodiments disclosed herein can be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module can reside in RAM, flash memory, ROM, electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art. The storage medium can be coupled to the processor such that the processor can read information from, and write information to, the storage medium. In the alternative, the storage medium can be integral to the processor. The processor and the storage medium can reside in an ASIC.

[0108] Finally, it should be noted that the terms "first" and "second", etc. are used herein solely to distinguish one entity or action from another entity or action, without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises", "comprising", or any other variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element preceded by "comprises... a" does not, without more constraints, foreclose the existence of additional identical elements in the process, method, article, or apparatus that comprises the recited element.

[0109] The above provides a detailed description of the file uploading method, device, equipment and medium provided by the present application. The principles and implementation modes of the present application are described by applying specific examples. The above description of the embodiments is only used to help understand the method of the present application and its core idea. Meanwhile, for those skilled in the art, according to the idea of the present application, the specific implementation mode and application range will be changed. In summary, the content of the specification should not be understood as a limitation of the present application.

Claims

1. A file uploading method characterized by, The method comprises the following steps: determining a deduplication verification mode corresponding to the to-be-uploaded file according to a file type corresponding to the to-be-uploaded file; the file type comprises a large file and a small file; the deduplication verification mode comprises strong verification and / or weak verification; calculating a verification value corresponding to the to-be-uploaded file according to the deduplication verification mode, and sending the verification value to a server for judgment; the verification value is generated based on a fingerprint of the to-be-uploaded file; selecting a corresponding uploading mode according to a judgment result of the server, and uploading the to-be-uploaded file to the server; wherein, before the step of calculating the verification value corresponding to the to-be-uploaded file according to the deduplication verification mode, and sending the verification value to the server for judgment, the method further comprises the following steps: generating a fingerprint corresponding to the to-be-uploaded file; correspondingly, the step of selecting a corresponding uploading mode according to a judgment result of the server, and uploading the to-be-uploaded file to the server, comprises the following steps: selecting a corresponding uploading mode according to a judgment result of the server, and uploading the to-be-uploaded file and the fingerprint to the server, so that the server performs anti-tampering verification according to the fingerprint; wherein, the step of generating a fingerprint corresponding to the to-be-uploaded file comprises the following steps: grouping the to-be-uploaded file according to a preset grouping rule to obtain a plurality of sub-files; generating the fingerprint of the to-be-uploaded file by calculating the fingerprint of each sub-file in parallel based on target parameter information corresponding to the to-be-uploaded file; the target parameter information comprises file size, file format, file segmentation rule and grouping hash value.

2. The file uploading method of claim 1, wherein, The step of determining a deduplication verification mode corresponding to the to-be-uploaded file according to a file type corresponding to the to-be-uploaded file comprises the following steps: determining a file size threshold according to local computing capacity, and determining a file type of the to-be-uploaded file according to the file size threshold; obtaining a mapping relationship between a file type and a deduplication verification mode; the mapping relationship comprises a first mapping relationship between a small file and strong verification, and a second mapping relationship between a large file and weak verification followed by strong verification; determining the deduplication verification mode corresponding to the to-be-uploaded file according to the mapping relationship.

3. The file uploading method of claim 1, wherein, The step of calculating the verification value corresponding to the to-be-uploaded file according to the deduplication verification mode, and sending the verification value to the server for judgment, comprises the following steps: if the to-be-uploaded file is a large file, calculating a first verification value corresponding to the to-be-uploaded file according to file size information and format information corresponding to the to-be-uploaded file, and sending the first verification value to the server for judgment; if the judgment result of the server is that the file exists, taking a hash value of a first group of sub-files of the to-be-uploaded file as a second verification value, and sending the second verification value to the server for judgment; if the judgment result of the server is that the file exists, calculating a third verification value corresponding to the to-be-uploaded file according to a strong verification mode, and sending the third verification value to the server for judgment.

4. The file uploading method of claim 1, wherein, The step of selecting a corresponding uploading mode according to a judgment result of the server, and uploading the to-be-uploaded file to the server, comprises the following steps: If the server determines that the file does not exist, the server is uploaded to the file to be uploaded; If the server determines that the file exists, the server is uploaded to the file to be uploaded.

5. The file uploading method according to any one of claims 1 to 4, characterized by, After uploading the file to be uploaded to the server, the method further comprises: The server uses a strong check method to perform a deduplication operation on the file to be uploaded.

6. A file uploading apparatus characterized by comprising: Comprise: A check method determination module is configured to determine a deduplication check method corresponding to the file to be uploaded according to a file type corresponding to the file to be uploaded; the file type comprises a large file and a small file; the deduplication check method comprises a strong check and / or a weak check; A check value calculation module is configured to calculate a check value corresponding to the file to be uploaded according to the deduplication check method, and send the check value to the server for judgment; The check value is generated based on a fingerprint of the file to be uploaded; An upload module is configured to select a corresponding upload method according to a judgment result of the server, and upload the file to be uploaded to the server; The file upload device comprises: A fingerprint generation unit is configured to generate a fingerprint corresponding to the file to be uploaded before calculating a check value corresponding to the file to be uploaded according to the deduplication check method, and sending the check value to the server for judgment; Correspondingly, the upload module comprises: A fingerprint upload unit is configured to upload the file to be uploaded and the fingerprint to the server according to a judgment result of the server, so that the server performs anti-tampering check according to the fingerprint; The fingerprint generation unit comprises: A grouping unit is configured to group the file to be uploaded according to a preset segmentation rule to obtain a plurality of subfiles; A file to be uploaded fingerprint generation unit is configured to obtain a fingerprint of the file to be uploaded by calculating a fingerprint corresponding to each subfile in parallel based on target parameter information corresponding to the file to be uploaded; the target parameter information comprises file size, file format, segmentation rule adopted by the file, and grouping hash value.

7. An electronic device, comprising: Comprise: A memory is configured to save a computer program; A processor is configured to execute the computer program to implement the file upload method of any one of claims 1 to 5.

8. A computer-readable storage medium, characterized in that, For storing computer programs; wherein the computer programs are executed by the processor to implement the file upload method of any one of claims 1 to 5.

Citation Information

Patent Citations

  • File uploading method and system

    CN103108033A

  • File transmission method and device for virtualization management system

    CN107181588A

  • File uploading method and terminal equipment

    CN114168536A