File transmission method, device and equipment
By merging the verification information of multiple files to be transmitted into a single verification file for transmission, the problem of low file transmission efficiency is solved, achieving more efficient file transmission.
Patent Information
- Application Number
- CN202210294180.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-24
- Publication Date
- 2026-01-27
- Estimated Expiration
- 2042-03-24
AI Technical Summary
In existing technologies, as the number of files to be transferred increases, the number of verification files that need to be transferred also increases, leading to longer transfer times and reduced efficiency.
Storing verification information for multiple files to be transmitted in the same verification file, generating and sending the verification file reduces the number of files to be transmitted.
By reducing the number of verification files, file transfer time is shortened, and file transfer efficiency is improved.
Smart Images

Figure CN116208597B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technology, and in particular to a file transfer method, apparatus and device. Background Technology
[0002] File transfer refers to the process of transferring a file from the sending device to the receiving device.
[0003] In related technologies, each file to be transmitted has its corresponding verification file. The verification file stores the verification information for the file to be transmitted. When transmitting files, the sending device needs to send the file to be transmitted, along with its corresponding verification file. Correspondingly, the receiving device needs to receive the file sent by the sending device and its corresponding verification file, and verify the received file based on the verification information stored in the verification file. However, when there are many files to be transmitted, the sending device needs to send multiple files to be transmitted, along with multiple verification files corresponding to those files. Similarly, the receiving device needs to receive multiple files and their corresponding verification files. This file transmission process takes a long time, resulting in low file transmission efficiency. Summary of the Invention
[0004] This application provides a file transfer method, apparatus, and device, which improves file transfer efficiency.
[0005] In a first aspect, this application provides a file transfer method, the method comprising:
[0006] The first device determines N data files to be transmitted and the file names of the N data files, where N is an integer greater than or equal to 1;
[0007] The first device acquires the verification information of each data file, resulting in N verification information entries;
[0008] The first device generates a verification file based on the file names of the N data files and the N verification information;
[0009] The first device sends the N data files and the verification file to the file storage device.
[0010] In one possible implementation, the first device generates a verification file based on the file names of the N data files and the N verification information, including:
[0011] The first device generates N verification records based on the file names of the N data files and the N verification information. Each verification record includes a file name and corresponding verification information.
[0012] The verification file is generated based on the N verification records. The verification file includes the N verification records and includes an end identifier at the end of the verification file.
[0013] In one possible implementation, generating the verification file based on the N verification records includes:
[0014] Determine the order of the N verification records based on the file names of the N data files;
[0015] The verification file is generated according to the stated order and the N verification records; in the verification file, the N verification records are arranged in the stated order, and there is a separator between every two adjacent verification records.
[0016] In one possible implementation, the first device determines the file names of the N data files, including:
[0017] The first device determines the naming part and the sequence number part of the N data files based on the generation time of the N data files. The naming parts of the N data files are the same, and the sequence number parts of the N data files are all different.
[0018] For any given data file, the first device combines the naming part and the sequence number part of the data file to obtain the file name of the data file.
[0019] Secondly, this application provides a file transfer method, the method comprising:
[0020] The second device retrieves the verification file from the file storage device;
[0021] The second device performs integrity verification on the verification file and obtains the verification result;
[0022] When the verification result indicates that the verification file has integrity, the second device obtains the file name of the verification file;
[0023] The second device retrieves N data files corresponding to the verification file from the file storage device based on the file name of the verification file. The verification file is used to verify the N data files, where N is an integer greater than or equal to 1.
[0024] In one possible implementation, the second device performs integrity verification on the verification file to obtain a verification result, including:
[0025] The second device determines whether an end identifier exists at the end of the verification file;
[0026] If so, the second device determines that the verification result indicates that the verification file has integrity;
[0027] If not, the second device determines that the verification result indicates that the verification file lacks integrity.
[0028] In one possible implementation, the second device retrieves N data files corresponding to the verification file from the file storage device based on the file name of the verification file, including:
[0029] The second device obtains the first filename of the verification file;
[0030] The second device identifies the data files in the file storage device whose names are the same as the first file name as the N data files.
[0031] In one possible implementation, the method further includes:
[0032] The second device obtains N verification information entries from the verification file;
[0033] The second device performs verification processing on the corresponding data files using the N verification information.
[0034] Thirdly, this application provides a file transfer device applied to a first device, comprising: a determining module, an acquiring module, a generating module, and a sending module, wherein...
[0035] The determining module is used to determine the N data files to be transmitted and the file names of the N data files, where N is an integer greater than or equal to 1;
[0036] The acquisition module is used to acquire the verification information of each data file, and obtain N verification information.
[0037] The generation module is used to generate a verification file based on the file names of the N data files and the N verification information.
[0038] The sending module is used to send the N data files and the verification file to the file storage device.
[0039] In one possible implementation, the generation module is specifically used for:
[0040] Based on the file names of the N data files and the N verification information, generate N verification records, each verification record including a file name and corresponding verification information;
[0041] The verification file is generated based on the N verification records. The verification file includes the N verification records and includes an end identifier at the end of the verification file.
[0042] In one possible implementation, the generation module is specifically used for:
[0043] Determine the order of the N verification records based on the file names of the N data files;
[0044] The verification file is generated according to the stated order and the N verification records; in the verification file, the N verification records are arranged in the stated order, and there is a separator between every two adjacent verification records.
[0045] In one possible implementation, the determining module is specifically used for:
[0046] Based on the generation time of the N data files, determine the naming part and the sequence number part of the N data files. The naming parts of the N data files are the same, and the sequence number parts of the N data files are all different.
[0047] For any given data file, the first device combines the naming part and the sequence number part of the data file to obtain the file name of the data file.
[0048] Fourthly, this application provides a file transfer device applied to a second device, comprising: a first acquisition module, a verification module, a second acquisition module, and a third acquisition module, wherein...
[0049] The first acquisition module is used to acquire a verification file from a file storage device;
[0050] The verification module is used to perform integrity verification on the verification file and obtain the verification result;
[0051] The second acquisition module is used to acquire the file name of the verification file when the verification result indicates that the verification file has integrity;
[0052] The third acquisition module is used to acquire N data files corresponding to the verification file in the file storage device according to the file name of the verification file. The verification file is used to verify the N data files, where N is an integer greater than or equal to 1.
[0053] In one possible implementation, the verification module is specifically used for:
[0054] Determine whether an end marker exists at the end of the verification file;
[0055] If so, then the verification result indicates that the verification file has integrity;
[0056] If not, then the verification result indicates that the verification file lacks integrity.
[0057] In one possible implementation, the second acquisition module is specifically used for:
[0058] Obtain the first filename of the verification file;
[0059] The data files in the file storage device whose names are the same as the first file name are identified as the N data files.
[0060] In one possible implementation, the file transfer device further includes a verification module, wherein the verification module is used for:
[0061] Obtain N verification information entries from the verification file;
[0062] The corresponding data files are verified using the N verification information.
[0063] Fifthly, this application provides a file transfer device, including: a processor, and a memory communicatively connected to the processor;
[0064] The memory stores computer programs;
[0065] The processor executes the computer program to implement the method as described in any one of the first aspects, or to implement the method as described in any one of the second aspects.
[0066] Sixthly, this application provides a computer-readable storage medium storing a computer program that, when executed by a computer, implements the method as described in any one of the first aspects, or implements the method as described in any one of the second aspects.
[0067] In a seventh aspect, this application provides a computer program product, including a computer program that, when executed by a computer, implements the method as described in any one of the first aspects, or implements the method as described in any one of the second aspects.
[0068] The file transfer method, apparatus, and device provided in this application involve a first device determining N data files to be transferred and their filenames, obtaining verification information for each data file to obtain N verification information entries, generating a verification file based on the filenames and verification information entries, and then sending the N data files and the verification file to a file storage device. In this process, the verification information for the N data files is stored in the same verification file, reducing the number of files the first device needs to send and improving file transfer efficiency. Attached Figure Description
[0069] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0070] Figure 1 This is a schematic diagram of an application scenario provided by an embodiment of this application;
[0071] Figure 2 This is a diagram showing the correspondence between the file to be transmitted and the verification file in the existing technology;
[0072] Figure 3 A diagram showing the correspondence between the file to be transmitted and the verification file provided in this application embodiment;
[0073] Figure 4 A flowchart illustrating a file transfer method provided in an embodiment of this application;
[0074] Figure 5 A flowchart illustrating another file transfer method provided in an embodiment of this application;
[0075] Figure 6 This is a schematic diagram of the structure of a file transfer device provided in an embodiment of this application;
[0076] Figure 7 This is a schematic diagram of another file transfer device provided in an embodiment of this application;
[0077] Figure 8 This is a schematic diagram of the structure of another file transfer device provided in the embodiments of this application;
[0078] Figure 9 This is a schematic diagram of the structure of a file transfer device provided in an embodiment of this application. Detailed Implementation
[0079] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0080] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0081] To facilitate understanding, let's first combine Figure 1 The application scenarios provided in the embodiments of this application are described. Figure 1 This is a schematic diagram illustrating an application scenario provided by an embodiment of this application. Please refer to [link / reference]. Figure 1 It includes a first device, a storage device, and a second device.
[0082] The first device is a file sending device used to send the file to be transmitted. The first device sends the file to be transmitted to a storage device, and also sends a verification file for the file to be transmitted to the storage device. The storage device can provide temporary storage services for the file to be transmitted and the corresponding verification file. For example, the storage device can be a storage server. The second device is a file receiving device used to receive the file sent by the first device. The second device downloads the file sent by the first device and the corresponding verification file from the storage device, and verifies the received file according to the verification information stored in the verification file. The first and second devices can be terminal devices such as computers.
[0083] In related technologies, each file to be transmitted has a verification file. For example... Figure 2 As shown, Figure 2 This is a diagram illustrating the correspondence between the file to be transmitted and the verification file in existing technology. Please refer to [link / reference]. Figure 2The verification information for file 1 to be transferred is stored in verification file 1, the verification information for file 2 to be transferred is stored in verification file 2, and so on, until the verification information for file N to be transferred is stored in verification file N. Therefore, during file transfer, the number of verification files that need to be transferred between the first and second devices is the same as the number of files to be transferred. The large number of files that need to be transferred between the first and second devices results in a long transfer time and low file transfer efficiency.
[0084] To address the aforementioned technical problems, the file transfer method provided in this application stores the verification information of N files to be transferred in the same batch in the same verification file. For example... Figure 3 As shown, Figure 3 This is a diagram showing the correspondence between the file to be transmitted and the verification file provided in an embodiment of this application. Please refer to [link / reference]. Figure 3 The verification information 1 for file 1 to be transferred, the verification information 2 for file 2 to be transferred, ..., the verification information N for file N to be transferred are all stored in the same verification file. This method reduces the number of verification files, thus reducing the number of files that need to be transferred. Therefore, it shortens the file transfer time and improves file transfer efficiency.
[0085] The technical solutions of this application will be described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments.
[0086] Figure 4 This is a flowchart illustrating a file transfer method provided in an embodiment of this application. Please refer to... Figure 4 The method may include:
[0087] S401, The first device determines the N data files to be transmitted and the file names of the N data files.
[0088] The data file is the file that needs to be transferred from the first device to the second device; that is, the data file is the file to be transferred.
[0089] In this embodiment, the first device and the second device pre-agree on a naming rule for the data files. The first device automatically names the data files according to the naming rule and determines the files to be transmitted in each batch based on the names of the data files. For example, the first device can determine the file name of the data file based on its generation time, and can identify N data files generated within the same time period as the same batch of files to be transmitted. Here, N is an integer greater than or equal to 1.
[0090] In one possible implementation, the filename of a data file can consist of a naming part and a sequence number part. The naming part indicates the file type, creation time, etc., of the data file. The sequence number part indicates the creation order of N data files within a certain time period. The filenames of the N data files can be determined as follows: a first device determines the naming part and the sequence number part of the N data files based on their creation times; the naming parts of the N data files are the same, and the sequence numbers are all different; for any given data file, the first device combines the naming part and the sequence number part to obtain the filename of the data file.
[0091] Specifically, the first device can send a data file once per minute. Data files generated within the same minute have the same name part. All data files with the same name part belong to the same batch of data files. The first device can generate the name part of the data files at one-minute intervals. The sequence number part of the data files is arranged in ascending order of natural numbers according to the order in which the data files were generated.
[0092] For example, the naming part of a data file can be data_202102071049. Here, "data" indicates the file type. "20210207" indicates the year, month, and day the data file was generated. "1049" indicates the time the data file was generated. The sequence numbers are arranged in ascending order. If the number of data files generated within the same minute is 10 or less (including 10), the sequence number is a natural number from 0 to 9. If the number of data files generated within the same minute is 100 or less (including 100), the sequence number is a natural number from 00 to 99. Similarly, if the number of data files generated within the same minute is 1000 or less (including 1000), the sequence number is a natural number from 000 to 999. The naming part and the sequence number are connected by an underscore to form the file name of the data file. Assuming the number of data files generated at the current moment is greater than 10 and less than or equal to 100, the file names of the data files can be from data_202102071049_00.tar.gz to data_202102071049_99.tar.gz.
[0093] S402. The first device obtains the verification information of each data file and gets N verification information.
[0094] It should be understood that during file transfer, after the receiving device receives the data file and its corresponding verification information, it verifies the data file based on the verification information. In other words, the verification information refers to the information used to verify the data file.
[0095] In this embodiment, the first device generates verification information for each data file and sends the verification information to the second device along with the data file. After receiving the data file and the corresponding verification information, the second device verifies the integrity of the received data file based on the verification information.
[0096] In this embodiment, the first device uses a file encryption algorithm to generate verification information for the data file. The file encryption algorithm includes, but is not limited to, MD5 and hash algorithms.
[0097] S403. The first device generates a verification file based on the file names of N data files and N verification information.
[0098] The verification file is a file that stores verification information.
[0099] In this embodiment, the N verification messages of N data files generated in the same batch are stored in the same verification file. That is, one verification file stores N verification messages. The verification file can be generated as follows: the first device generates N verification records based on the file names of the N data files and the N verification messages. Each verification record includes a file name and the corresponding verification message. The verification file is generated based on the N verification records. The verification file includes N verification records, and an end identifier is included at the end of the verification file.
[0100] In one possible implementation, the verification record may include the filename of the data file and the corresponding verification information. The filename and verification information in each verification record are separated by a delimiter. For example, the delimiter can be a space, comma, or pause mark. N verification records for N data files in the same batch are stored in the same verification file. An end identifier is added to the end of the verification file. For example, the end of the verification file can be the last line of the verification file. The end identifier can be "END". That is, "END" can be added to the last line of the verification file to indicate the end of the storage of verification records for this batch.
[0101] One possible implementation is to generate the verification file as follows: determine the order of N verification records based on the filenames of N data files; generate the verification file according to the order and the N verification records; in the verification file, the N verification records are arranged in the order, with a separator between each pair of adjacent verification records. For example, the separator can be a newline character, meaning that each pair of adjacent verification records can be stored in two adjacent lines in the verification file.
[0102] For example, the verification file can store N verification records corresponding to N data files, with one verification record per line. The N verification records are arranged in ascending order according to the file name sequence of the data files.
[0103] In one possible implementation, the filename of the verification file is the same as the naming part of the filename of the batch of data files. For example, the filename of the verification file could be data_202102071049.chk.
[0104] S404. The first device sends N data files and a verification file to the file storage device.
[0105] File storage devices can temporarily store data files and corresponding verification files. For example, a file storage device can be a storage server.
[0106] It should be understood that the first device sends the data file and the corresponding verification file to the file storage device so that the second device can download the data file and verification file from the file storage device.
[0107] In this embodiment, when the first device sends a file to the storage device, it first sends N data files and then sends the corresponding verification file for the N data files to avoid missing data files.
[0108] The file transfer method provided in this application involves a first device determining N data files to be transferred and their file names, obtaining verification information for each data file to obtain N verification information entries, generating a verification file based on the file names and verification information entries, and then sending the N data files and the verification file to a file storage device. In this process, the verification information for the N data files is stored in the same verification file, reducing the number of files the first device needs to send and improving file transfer efficiency.
[0109] Based on any of the above embodiments, the following, in conjunction with Figure 5 The process of the second device retrieving data files from the file storage device is described.
[0110] Figure 5 This is a flowchart illustrating another file transfer method provided in an embodiment of this application. Please refer to... Figure 5 The method may include:
[0111] S501, The second device retrieves the verification file from the file storage device.
[0112] In this embodiment, the first device sends a data file and a verification file to a storage device. The storage device temporarily stores the data file and the verification file. The second device downloads the data file and the verification file from the storage device. Specifically, when downloading files from the storage device, the second device downloads the verification file first and the data file last to ensure the integrity of the downloaded verification file.
[0113] S502. The second device performs integrity verification on the verification file and obtains the verification result.
[0114] Integrity verification refers to checking whether the obtained file is complete.
[0115] In actual file transfer, there may be situations where the verification file is downloaded by the second device before it has been completely stored on the storage device. In this case, the verification file downloaded by the second device will be an incomplete verification file.
[0116] In one possible implementation, the integrity of the verification file can be verified as follows: the second device determines whether there is an end identifier at the end of the verification file; if so, the second device determines that the verification result indicates that the verification file is complete; if not, the second device determines that the verification result indicates that the verification file is not complete.
[0117] Specifically, if the verification file is complete, proceed to step S503. If the verification file is incomplete, the second device retrieves the verification file from the storage device again and verifies its integrity; until the second file is complete, proceed to step S503.
[0118] S503. When the verification result indicates that the verification file is complete, the second device obtains the file name of the verification file.
[0119] S504. The second device retrieves N data files corresponding to the verification file from the file storage device based on the file name of the verification file.
[0120] In this embodiment, the filename of the verification file has the same naming part as the filenames of the corresponding N data files. After obtaining the filename of the verification file, the second device can retrieve the data files with the same naming part as the verification file from the storage device. That is, the second device can retrieve the N data files corresponding to the verification file from the storage device based on the filename of the verification file.
[0121] In actual file transfer, the N data files corresponding to the verification file can be obtained in the following way: the second device obtains the first file name of the verification file; the second device identifies the data files in the file storage device whose names are the same as the first file name as N data files.
[0122] The first file indicates the verification file that should be acquired according to the file generation order. For example, after the second device completes the acquisition of the verification file data_202102071049.chk and the corresponding data file, the verification file that should be acquired according to the file generation order is data_202102071050.chk. At this time, the first file is the verification file data_202102071050.chk, and the first file name is data_202102071050.chk.
[0123] After the second device obtains the first file and its name, it downloads all data files whose names are the same as the first file from the storage device. These data files are the N data files corresponding to the first file.
[0124] S505. The second device performs verification processing on the corresponding data file according to the verification file.
[0125] It should be understood that the verification information in the verification file is used to verify the corresponding data file. The data file can be verified as follows: the second device obtains N verification information entries from the verification file; the second device then uses these N verification information entries to perform verification processing on the corresponding data file.
[0126] For example, the second device can perform verification processing on the data file corresponding to the filename stored in the first line of the verification file using the verification information stored in the first line of the verification file. Similarly, the second device can perform verification processing on the data file corresponding to the filename stored in the nth line of the verification file using the verification information stored in the nth line of the verification file, where 0... <n≤N。
[0127] The file transfer method provided in this application involves a second device retrieving a verification file from a file storage device and performing integrity verification on the verification file to obtain a verification result. When the verification result indicates that the verification file is complete, the second device retrieves the filename of the verification file and, based on the filename, retrieves N data files corresponding to the verification file from the file storage device. The second device then performs verification processing on the corresponding data files according to the verification file. In this process, the verification information of the N data files is stored in the same verification file, reducing the number of files the second device needs to receive and improving file transfer efficiency.
[0128] Figure 6 This is a schematic diagram of a file transfer device provided in an embodiment of this application. Please refer to... Figure 6 The file transfer device 10 can be applied to the first device. The file transfer device 10 includes: a determining module 11, an acquiring module 12, a generating module 13, and a sending module 14, wherein...
[0129] The determining module 11 is used to determine the N data files to be transmitted and the file names of the N data files, where N is an integer greater than or equal to 1;
[0130] The acquisition module 12 is used to acquire the verification information of each data file and obtain N verification information.
[0131] The generation module 13 is used to generate a verification file based on the file names of the N data files and the N verification information;
[0132] The sending module 14 is used to send the N data files and the verification file to the file storage device.
[0133] The file transfer device provided in this application embodiment can execute the technical solution shown in the above method embodiment. Its implementation principle and beneficial effects are similar, and will not be described again here.
[0134] In one possible implementation, the generation module 13 is specifically used for:
[0135] Based on the file names of the N data files and the N verification information, generate N verification records, each verification record including a file name and corresponding verification information;
[0136] The verification file is generated based on the N verification records. The verification file includes the N verification records and includes an end identifier at the end of the verification file.
[0137] In one possible implementation, the generation module 13 is specifically used for:
[0138] Determine the order of the N verification records based on the file names of the N data files;
[0139] The verification file is generated according to the stated order and the N verification records; in the verification file, the N verification records are arranged in the stated order, and there is a separator between every two adjacent verification records.
[0140] In one possible implementation, the determining module 11 is specifically used for:
[0141] Based on the generation time of the N data files, determine the naming part and the sequence number part of the N data files. The naming parts of the N data files are the same, and the sequence number parts of the N data files are all different.
[0142] For any given data file, the first device combines the naming part and the sequence number part of the data file to obtain the file name of the data file.
[0143] The file transfer device provided in this application embodiment can execute the technical solution shown in the above method embodiment. Its implementation principle and beneficial effects are similar, and will not be described again here.
[0144] Figure 7 This is a schematic diagram of another file transfer device provided in an embodiment of this application. Please refer to... Figure 7 The file transfer device 20 can be applied to a second device. The file transfer device 20 includes: a first acquisition module 21, a verification module 22, a second acquisition module 23, and a third acquisition module 24, wherein...
[0145] The first acquisition module 21 is used to acquire a verification file from a file storage device;
[0146] The verification module 22 is used to perform integrity verification on the verification file and obtain the verification result;
[0147] The second acquisition module 23 is used to acquire the file name of the verification file when the verification result indicates that the verification file has integrity;
[0148] The third acquisition module 24 is used to acquire N data files corresponding to the verification file in the file storage device according to the file name of the verification file. The verification file is used to verify the N data files, where N is an integer greater than or equal to 1.
[0149] The file transfer device provided in this application embodiment can execute the technical solution shown in the above method embodiment. Its implementation principle and beneficial effects are similar, and will not be described again here.
[0150] In one possible implementation, the verification module 22 is specifically used for:
[0151] Determine whether an end marker exists at the end of the verification file;
[0152] If so, then the verification result indicates that the verification file has integrity;
[0153] If not, then the verification result indicates that the verification file lacks integrity.
[0154] In one possible implementation, the second acquisition module 23 is specifically used for:
[0155] Obtain the first filename of the verification file;
[0156] The data files in the file storage device whose names are the same as the first file name are identified as the N data files.
[0157] Figure 8 This is a schematic diagram of another file transfer device provided in an embodiment of this application. Figure 7 Based on the illustrated embodiment, the file transfer device 20 further includes a verification module 25, wherein the verification module 25 is used for:
[0158] Obtain N verification information entries from the verification file;
[0159] The corresponding data files are verified using the N verification information.
[0160] The file transfer device provided in this application embodiment can execute the technical solution shown in the above method embodiment. Its implementation principle and beneficial effects are similar, and will not be described again here.
[0161] Figure 9 This is a schematic diagram of a file transfer device provided in an embodiment of this application. The file transfer device can be a first device, or a chip or chip module within a first device. The file transfer device can also be a second device, or a chip or chip module within a second device.
[0162] like Figure 9 As shown, the file transfer device 900 provided in this embodiment includes: a transceiver 901, a memory 902, and a processor 903. The transceiver 901 may include a transmitter and / or a receiver. The transmitter may also be referred to as a transmitter, transmitter, transmitting port, or transmitting interface, etc., and the receiver may also be referred to as a receiver, receiver, receiving port, or receiving interface, etc. Exemplarily, the transceiver 901, memory 902, and processor 903 are interconnected via a bus 904.
[0163] Memory 902 is used to store computer programs;
[0164] The processor 903 is used to execute the computer program stored in the memory to implement the file transfer method executed by the first device or the second device in any of the above method embodiments.
[0165] The receiver in transceiver 901 can be used to perform the receiving function of the file transfer device in the above method embodiment. The transmitter in transceiver 901 can be used to perform the sending function of the file transfer device in the above method embodiment. The processor 903 can be used to perform the processing function of the file transfer device in the above method embodiment.
[0166] The file transfer device provided in this embodiment can be used to execute the file transfer method executed by the first device or the second device in any of the above method embodiments. Its implementation principle and technical effect are similar, and will not be described in detail here.
[0167] This application also provides a computer-readable storage medium storing a computer program. When the computer program is executed by a computer, it implements the file transfer method executed by the first device in any of the above method embodiments, or implements the file transfer method executed by the second device in any of the above method embodiments. The implementation principle and technical effect are similar, and will not be described in detail here.
[0168] This application also provides a chip, including: a memory, a processor, and hardware system resources. The memory stores a computer program, and the processor runs the computer program to implement the file transfer method executed by the first device in any of the above method embodiments, or to implement the file transfer method executed by the second device in any of the above method embodiments. The implementation principle and technical effect are similar, and will not be described in detail here.
[0169] This application also provides a computer program product, including a computer program. When the computer program is executed by a computer, it implements the file transfer method executed by the first device in any of the above method embodiments, or implements the file transfer method executed by the second device in any of the above method embodiments. The implementation principle and technical effect are similar, and will not be described in detail here.
[0170] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be indirect coupling or communication connection through some interfaces, devices, or modules, and may be electrical, mechanical, or other forms.
[0171] The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0172] Furthermore, the functional modules in the various embodiments of this application can be integrated into one processing unit, or each module can exist physically separately, or two or more modules can be integrated into one unit. The unit composed of the above modules can be implemented in hardware or in the form of hardware plus software functional units.
[0173] The integrated modules implemented as software functional modules described above can be stored in a computer-readable storage medium. These software functional modules, stored in a storage medium, include several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute some steps of the methods described in the various embodiments of this application.
[0174] It should be understood that the aforementioned processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. A general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in the application can be directly manifested as being executed by a hardware processor, or executed by a combination of hardware and software modules within the processor.
[0175] The memory may include random access memory (RAM) and may also include non-volatile memory (NVM), such as at least one disk storage device, and may also be a USB flash drive, external hard drive, read-only memory, disk or optical disc, etc.
[0176] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of illustration, the buses shown in the accompanying drawings are not limited to a single bus or a single type of bus.
[0177] The aforementioned storage media can be implemented from any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read-Only Memory (EPROM), Programmable Read-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The storage media can be any available medium accessible to general-purpose or special-purpose computers.
[0178] An exemplary storage medium is coupled to a processor, enabling the processor to read information from and write information to the storage medium. Alternatively, the storage medium can be an integral part of the processor. Both the processor and the storage medium can reside in an application-specific integrated circuit (ASIC). Alternatively, the processor and storage medium can exist as discrete components in an electronic device or host device.
[0179] Those skilled in the art will understand that all or part of the steps of the above-described method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.
[0180] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A file transfer method, characterized in that, include: The first device determines N data files to be transmitted and the file names of the N data files, where N is an integer greater than 1; The first device acquires the verification information of each data file, resulting in N verification information entries; The first device generates a verification file based on the file names of the N data files and the N verification information; The first device sends the N data files and the verification file to the file storage device; The first device generates a verification file based on the file names of the N data files and the N verification information, including: The first device generates N verification records based on the file names of the N data files and the N verification information. Each verification record includes a file name and corresponding verification information. Determine the order of the N verification records based on the file names of the N data files; The verification file is generated according to the stated order and the N verification records; in the verification file, the N verification records are arranged in the stated order, and there is a separator between every two adjacent verification records. The verification file includes the N verification records, and the end of the verification file includes an end identifier.
2. The method according to claim 1, characterized in that, The first device determines the file names of the N data files, including: The first device determines the naming part and the sequence number part of the N data files based on the generation time of the N data files. The naming parts of the N data files are the same, and the sequence number parts of the N data files are all different. For any given data file, the first device combines the naming part and the sequence number part of the data file to obtain the file name of the data file.
3. A file transfer method, characterized in that, include: The second device retrieves the verification file from the file storage device; The second device performs integrity verification on the verification file and obtains the verification result; When the verification result indicates that the verification file has integrity, the second device obtains the file name of the verification file; The second device retrieves N data files corresponding to the verification file from the file storage device based on the file name of the verification file. The verification file is used to verify the N data files, where N is an integer greater than 1. The verification file includes N verification records, each of which includes a file name and corresponding verification information. The N verification records are arranged in order, with a separator between every two adjacent verification records. The end of the verification file includes an end identifier, and the arrangement order is determined based on the file names of the N data files.
4. The method according to claim 3, characterized in that, The second device performs integrity verification on the verification file and obtains the verification result, including: The second device determines whether an end identifier exists at the end of the verification file; If so, the second device determines that the verification result indicates that the verification file has integrity; If not, the second device determines that the verification result indicates that the verification file lacks integrity.
5. The method according to claim 3 or 4, characterized in that, The second device retrieves N data files corresponding to the verification file from the file storage device based on the file name of the verification file, including: The second device obtains the first filename of the verification file; The second device identifies the data files in the file storage device whose names are the same as the first file name as the N data files.
6. The method according to claim 3 or 4, characterized in that, The method further includes: The second device obtains N verification information entries from the verification file; The second device performs verification processing on the corresponding data files using the N verification information.
7. A file transfer device, characterized in that, Applied to a first device, it includes: a determining module, an acquiring module, a generating module, and a sending module, wherein, The determining module is used to determine the N data files to be transmitted and the file names of the N data files, where N is an integer greater than 1; The acquisition module is used to acquire the verification information of each data file, and obtain N verification information. The generation module is used to generate a verification file based on the file names of the N data files and the N verification information. The sending module is used to send the N data files and the verification file to the file storage device; The generation module is specifically used by the first device to generate N verification records based on the file names of the N data files and the N verification information. Each verification record includes a file name and corresponding verification information. Determine the order of the N verification records based on the file names of the N data files; The verification file is generated according to the stated order and the N verification records; in the verification file, the N verification records are arranged in the stated order, and there is a separator between every two adjacent verification records. The verification file includes the N verification records, and the end of the verification file includes an end identifier.
8. A file transfer device, characterized in that, Applied to a second device, it includes: a first acquisition module, a verification module, a second acquisition module, and a third acquisition module, wherein, The first acquisition module is used to acquire a verification file from a file storage device; The verification module is used to perform integrity verification on the verification file and obtain the verification result; The second acquisition module is used to acquire the file name of the verification file when the verification result indicates that the verification file has integrity; The third acquisition module is used to acquire N data files corresponding to the verification file from the file storage device according to the file name of the verification file. The verification file is used to verify the N data files, where N is an integer greater than 1. The verification file includes N verification records, each of which includes a file name and corresponding verification information. The N verification records are arranged in order, with a separator between every two adjacent verification records. The end of the verification file includes an end identifier, and the arrangement order is determined based on the file names of the N data files.
9. A file transfer device, characterized in that, include: A processor, and a memory communicatively connected to the processor; The memory stores computer programs; The processor executes the computer program to implement the method as described in any one of claims 1 to 2, or to implement the method as described in any one of claims 3 to 6.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a computer, implements the method as described in any one of claims 1 to 2, or implements the method as described in any one of claims 3 to 6.
11. A computer program product, characterized in that, It includes a computer program that, when executed by a computer, implements the method as described in any one of claims 1 to 2, or implements the method as described in any one of claims 3 to 6.
Citation Information
Patent Citations
Big data verification method
CN107562564A
XML file configurable verification method, system and device and storage medium
CN112632332A
Integrity checking method and apparatus, terminal device and verification server
WO2021114918A1