Detailed Description
In order to make the technical solutions in one or more embodiments of the present disclosure better understood, the technical solutions in one or more embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings in one or more embodiments of the present disclosure, and it is obvious that the described embodiments are only a part of one or more embodiments of the present disclosure, but not all embodiments. All other embodiments that can be derived by one of ordinary skill in the art from the embodiments in one or more of the specification without inventive faculty are intended to fall within the scope of one or more of the specification.
One or more embodiments of the present disclosure provide a method, an apparatus, and a system for downloading a file, where after a file uploading party starts uploading a file and before a file receiving party starts downloading the file, the target file is downloaded only after it is determined that the file to be uploaded has been uploaded and completed by scanning current attribute information of the target file multiple times and combining the current attribute information, so that the target file is downloaded at a first time when the file uploading is completed, and a purpose of executing a file downloading operation in time on the premise of confirming integrity of the uploaded target file is achieved, so that file downloading timeliness and file downloading integrity can be ensured at the same time.
Fig. 1 is a schematic view of an application scenario of a file downloading system according to one or more embodiments of the present specification, as shown in fig. 1, the system includes: the file downloading method includes a file uploading party, a file receiving party and a file scanning device, where the file scanning device may be disposed in the file receiving party or may be a device independent of the file receiving party, the file uploading party may be a server for uploading a file to a specified storage path, and the file receiving party may be a server for downloading a file from a specified storage path, in fig. 1, taking the file scanning device as an example independent of the file receiving party, where a specific process of file downloading is as follows:
(1) the file uploading direction designates a storage path to upload a target file aiming at a file to be uploaded, wherein a certain uploading time is needed from the time when the file to be uploaded starts to be uploaded to the time when the file to be uploaded is uploaded, during the uploading of the file to be uploaded, attribute information of the uploaded target file is continuously updated along with the change of the uploading time until the uploading of the file to be uploaded is completed, the attribute information of the target file is kept unchanged, at the moment, the size of the target file is the same as that of the file to be uploaded, and the content of the file contained in the target file is the same as that of the file to be uploaded;
(2) the file scanning device detects whether a target file uploaded by a file to be uploaded by a file uploading policy exists under a specified storage path;
after the target file is detected to exist in the designated storage path, current attribute information of the target file is acquired according to a preset time interval, wherein the preset time interval can be determined based on file uploading characteristics of the file to be uploaded, and the current attribute information can be at least one of file size or file modification time;
judging whether the file to be uploaded is uploaded or not according to the acquired current attribute information of the target file, wherein the current attribute information of the target file is obtained by scanning the target file for multiple times at a certain scanning time interval, the attribute information of the target file is continuously changed during the file uploading period, the latest attribute information scanned this time can be compared with the attribute information of the file scanned last time, and whether the file to be uploaded is uploaded or not is judged according to whether the file attribute information is changed or not;
after the file to be uploaded is determined to be completely uploaded, a file receiving party is triggered to download the target file, wherein after the file to be uploaded is completely uploaded by the file uploading party, the attribute information of the target file under the designated storage path is kept unchanged, the size of the target file is the same as that of the file to be uploaded, the content of the target file is the same as that of the file to be uploaded, the completeness of file downloading can be guaranteed, the target file is triggered to be downloaded at the first time when the file is determined to be completely uploaded, and the timeliness of file downloading can be guaranteed;
(3) after determining that the file is uploaded, a file receiver downloads a target file from a designated storage path, wherein the file receiver automatically downloads the target file after determining that the file is uploaded according to the current attribute information of the scanned target file according to the condition that the file attribute information scanning process is executed by the file receiver; in view of the fact that the file attribute information scanning process is executed by an independent file scanning device independent of a file receiver, the file scanning device needs to mark the uploading completion of a scanned target file after determining that the file is uploaded according to the current attribute information of the target file, or send downloading indication information to the file receiver, and the file receiver automatically downloads the target file after detecting the uploading completion mark or receiving the downloading indication information.
Fig. 2 is a first flowchart of a file downloading method provided in one or more embodiments of the present disclosure, where the method in fig. 2 can be executed by the file scanning apparatus in fig. 1, as shown in fig. 2, and the method at least includes the following steps:
s201, detecting whether a target file uploaded by a file uploading policy to a file to be uploaded exists under a specified storage path;
when the file uploading party needs to transmit a certain file to the file receiving party, the file uploading party uploads the file to the designated storage path, and then the file receiving party downloads the file from the designated storage path; for example, for the application scenario that a third-party payment mechanism and a bank perform related payment services, after payment is completed, multiple parties need to perform fund accounting, a file to be uploaded is fund clearing information, the third-party payment mechanism uploads the fund clearing information needing bank checking to a specified storage path, and the bank mechanism downloads the fund clearing information from the specified storage path and checks the fund clearing information;
the file to be uploaded has a certain file size, so that certain uploading time is required from the time when the file to be uploaded starts to be uploaded to the time when the file to be uploaded is uploaded, during the uploading of the file to be uploaded, attribute information of the uploaded target file is continuously updated along with the change of the uploading time, and after the target file is detected, the file uploading party is instructed to start uploading the file;
if yes, executing S202, and acquiring the current attribute information of the target file according to a preset time interval;
specifically, after detecting that a target file exists in a specified storage path, performing multiple timing scans on the target file at a certain scanning time interval to obtain current attribute information of the target file, wherein the current attribute information may be the latest file size of the target file or the latest modification time of the target file;
s203, judging whether the file to be uploaded is uploaded completely according to the current attribute information of the target file;
after the file to be uploaded is uploaded by the file uploading party, the attribute information of the target file is kept unchanged, namely the attribute information obtained by the current scanning is the same as the attribute information obtained by the last scanning, the file size of the target file is the same as the file size of the file to be uploaded, and the file content contained in the target file is the same as the file content contained in the file to be uploaded, so that whether the file to be uploaded is finished or not can be determined by combining the attribute information of the target file obtained by scanning according to the preset time interval;
if yes, executing S204 to trigger the file receiver to download the target file; after the file is uploaded by the file uploading party (namely after the target file uploaded by the file to be uploaded exists under the appointed storage path is detected for the first time) and before the file is downloaded by the file receiving party (namely before the file is determined to be uploaded completely), whether the file uploading party uploads the file completely is judged by regularly scanning attribute information of the target file, after the file to be uploaded is determined to be completely uploaded by the file uploading party, the file receiving party downloads the target file uploaded by the file uploading party to be uploaded from the appointed storage path, the completeness of file downloading can be guaranteed, the target file is triggered and downloaded at the first time when the file is determined to be uploaded completely, and the timeliness of file downloading can be guaranteed.
In one or more embodiments of the present disclosure, after a file uploading party starts uploading a file and before a file receiving party starts downloading the file, the target file is downloaded after the file is uploaded is determined by scanning current attribute information of the target file for multiple times and combining the current attribute information, so that the target file is downloaded after the file is uploaded, and the purpose of timely executing a file downloading operation on the premise of confirming the integrity of the uploaded target file is achieved, thereby simultaneously ensuring file downloading timeliness and file downloading integrity.
In the process of determining whether the file is uploaded completely, multiple scans are required to obtain current attribute information of the target file, after obtaining the current attribute information each time through scanning, whether the file is uploaded completely is determined based on the current attribute information of the target file, after determining that the file is uploaded completely, scanning is stopped, and after determining that the file is not uploaded completely, timing scanning is continued, based on which, as shown in fig. 3, the above S203 determines whether the file to be uploaded is uploaded completely according to the current attribute information of the target file, and specifically includes:
s2031, judging whether the current attribute information of the target file meets the preset scanning termination condition, wherein the attribute information can be the file size, the file modification time, the file size and the file modification time, or the attribute information of other files which are continuously changed in the uploading process; correspondingly, the preset scanning termination condition may be that the attribute information remains unchanged, that is, when it is determined that the attribute information obtained by the current scanning and the attribute information obtained by the last scanning remain unchanged, it is determined that the current attribute information of the target file meets the preset scanning termination condition;
if so, determining that the file to be uploaded is uploaded completely, specifically, after determining that the current attribute information of the target file meets the preset scanning termination condition, indicating that the file uploading party completes the file uploading operation, wherein the file size of the target file is the same as that of the file to be uploaded, the file content contained in the target file is the same as that contained in the file to be uploaded, and the integrity of the target file can be ensured;
otherwise, the step of S202 obtaining the current attribute information of the target file according to the preset time interval is continuously executed, specifically, after it is determined that the current attribute information of the target file does not satisfy the preset scanning termination condition, it indicates that the file uploading party is still in the uploading file, the integrity of the target file cannot be guaranteed, and it is necessary to continuously wait for the file uploading party to finish uploading.
Wherein, the current attribute information may include: the file size and/or the file modification time can be used for judging whether the file is uploaded or not according to the file size of the target file, judging whether the file is uploaded or not according to the file modification time of the target file, and judging whether the file is uploaded or not according to two parameters of the file size and the file modification time of the target file; specifically, whether the file size of the target file is kept unchanged and/or whether the file modification time of the target file is kept unchanged is judged; whether the file is uploaded is determined by judging whether the file size of the target file is kept unchanged, judging whether the file modification time of the target file is kept unchanged, or judging whether the file size of the target file is kept unchanged and the file modification time is kept unchanged;
further, the execution subject may be a file receiver or a separate file scanning apparatus independent of the file receiver, considering that the attribute information of the target file is scanned at regular time intervals and whether the file is uploaded is determined based on the attribute information. In order to minimize the process of adjusting the document receiver, and considering that there may be a plurality of document receivers, the document scanning device may be disposed in a device independent of the document receiver;
for the case that the file scanning apparatus is independent of the file receiver, the file receiver may be triggered to download the file in time by marking the file name, taking the attribute information as the file modification time as an example, and based on this, as shown in fig. 4, the implementation process of the file downloading method specifically includes:
in step S202, the obtaining of the current attribute information of the target file according to the preset time interval specifically includes:
s2021, the file scanning device obtains the file modification time of the target file according to the first time interval, namely the modification time of the scanning time of the target file;
correspondingly, the step S2031 of determining whether the current attribute information of the target file meets the preset scanning termination condition specifically includes:
s20311, the file scanning device judges whether the file modification time of the target file is kept unchanged;
if yes, executing S20312, setting the file name of the target file to be in a preset format, and determining that the current attribute information of the target file meets the preset scanning termination condition, namely determining that the file to be uploaded is uploaded completely.
The method for triggering the file receiver to start downloading the file after determining that the file uploading party finishes uploading the file may be a method of marking a file name, or may be a method of sending a download prompt message, and for a case of marking the file name after determining that the file is uploaded completely, the file receiver also needs to scan the file name of the target file at regular time, so as to download the target file in time after detecting that the file name becomes a preset format, based on this, for the file receiver, after detecting that the file uploading party exists in a specified storage path for the target file to be uploaded, the method further includes:
s205, the file receiver acquires the file name of the target file according to a second time interval, wherein the second time interval can be the same as or different from the first time interval;
s206, the file receiver judges whether the file name of the target file conforms to a preset format; if not, continuing to execute the step S205, and if so, downloading the target file;
correspondingly, the step S204 of triggering the file receiver to download the target file specifically includes:
if the file receiver detects that the file name of the target file conforms to the preset format, executing S2041, and downloading the target file by the file receiver; specifically, after the file scanning device sets the file name of the target file to the preset format, the file receiving party detects that the file name conforms to the preset format.
Considering that, in the process of determining whether a file is uploaded according to current attribute information of a target file each time, it is necessary to compare the file attribute information scanned this time with the attribute information scanned last time, therefore, for a case where the target file is scanned for the first time, it is necessary to record the file attribute information of the target file, and for a case where the target file is not scanned for the first time, it is described that the file attribute information scanned last time of the target file is recorded, and at this time, the recorded file attribute information is updated to the file attribute information scanned this time, based on this, as shown in fig. 5, after it is detected that a file uploading party exists under a specified storage path and treats the target file uploaded by the uploaded file, the method further includes:
s207, judging whether the attribute information recorded aiming at the target file exists or not, wherein the judgment result is that the attribute information does not exist aiming at the condition that the target file is scanned for the first time, and the judgment result is that the attribute information does not exist aiming at the condition that the target file is scanned for the first time;
if the file does not exist, executing S208, acquiring and recording the attribute information of the target file, taking the attribute information as the attribute information recorded for the target file for the first time, and continuing to execute the step of S202 for acquiring the current attribute information of the target file according to the preset time interval, at this time, the file uploading party starts to upload the file to be uploaded to the specified storage path.
Correspondingly, for the situation that the target file is not scanned for the first time, the description is given to the file attribute information scanned for the last time of the target file, at this time, the recorded file attribute information is updated to the file attribute information scanned for this time, and based on this, after it is determined that the file to be uploaded is not uploaded, the method further includes:
s209, updating the attribute information recorded for the target file according to the obtained current attribute information, and continuing to execute the step of obtaining the current attribute information of the target file at the preset time interval in S202, specifically, updating the recorded file attribute information for the target file to the latest file attribute information scanned this time, so as to use the updated file attribute information recorded for the target file as a reference for subsequently determining whether the current attribute information meets a preset scanning termination condition.
Correspondingly, for the process of determining whether the file is uploaded based on the file attribute information, the step S203 of determining whether the file to be uploaded is uploaded according to the current attribute information of the target file specifically includes:
judging whether the current attribute information is consistent with the attribute information recorded for the target file or not according to the current attribute information acquired each time;
if the file to be uploaded is consistent with the file to be uploaded, the file to be uploaded is determined to be completely uploaded; and if the file to be uploaded is inconsistent, determining that the file to be uploaded is not completely uploaded.
In a specific embodiment, the time for a file uploading party to start uploading a file is 10:34 minutes, and the specified storage path is ABC/pay/20181108/alipay _ ABC _ pay.txt, for the prior art, since it is not possible to accurately predict when the file is uploaded in advance, in order to ensure the completeness of file downloading, it is agreed that 11:30 starts downloading the file by delaying the predetermined file downloading time, but actually, the 10:44 file is uploaded completely, which may cause the problem of poor file downloading timeliness; in order to ensure timeliness of file downloading, a mode of appointing file downloading time in advance is adopted to appoint 11:46 to start downloading files, but the file uploading progress is possibly influenced due to some reason, and actually 10:50 files are uploaded and finished, so that the problem that the file downloading integrity cannot be ensured is caused;
in order to simultaneously consider both file downloading timeliness and file downloading integrity, in one or more embodiments of the present specification, a file downloading process specifically includes:
acquiring current attribute information of a target file according to a preset time interval after detecting that a file uploading policy exists under a specified storage path and the target file is uploaded by a file to be uploaded; judging whether the current attribute information changes or not according to the current attribute information acquired each time, and determining that the file is uploaded completely after determining that the current attribute information of the target file does not change;
the method for scanning attribute information of a target file by a file scanning device in a multi-time fixed-time mode takes a first preset time interval of 5 minutes as an example, and specifically includes the following steps:
if the time point of scanning the file for the first time is 2018-11-0910: 30, the file uploading party does not start to upload the file at the moment, so that the target file does not exist in the specified storage path;
if the time point of scanning the file for the second time is 2018-11-0910: 35, the file uploading party starts to upload the file, so that the target file exists in the specified storage path, the current attribute information of the target file is obtained, the file size is 3000KB, the last modification time of the file is 2018-11-0910: 34:10, and the attribute information of the target file is recorded;
if the time point of scanning the file for the third time is 2018-11-0910: 40, then a target file exists in the specified storage path, and the current attribute information of the target file is obtained, the file size is 4100KB, the last modification time of the file is 2018-11-0910: 39:57, and the current attribute information is inconsistent with the attribute information (the file size is 3000KB, the last modification time of the file is 2018-11-0910: 34:10) recorded in the last scanning, indicating that the file is still in the uploading process, and updating the attribute information recorded aiming at the target file into the current attribute information (the file size is 4100KB, and the last modification time of the file is 2018-11-0910: 39: 57);
if the time point of scanning the file for the fourth time is 2018-11-0910: 45, then a target file exists in the specified storage path, and the current attribute information of the target file is obtained, the file size is 4200KB, the last modification time of the file is 2018-11-0910: 44:29, the current attribute information is inconsistent with the attribute information recorded in the last scanning (the file size is 4100KB, the last modification time of the file is 2018-11-0910: 39:57), and the attribute information recorded aiming at the target file is updated to the current attribute information (the file size is 4200KB, and the last modification time of the file is 2018-11-0910: 44: 29);
if the time point of scanning the file for the fifth time is 2018-11-0910: 50, then the target file exists in the specified storage path, and the current attribute information of the target file is obtained, the file size is 4200KB, the last modification time of the file is 2018-11-0910: 44:29, and the current attribute information is consistent with the attribute information (the file size is 4200KB, and the last modification time of the file is 2018-11-0910: 44:29) recorded in the last scanning, so that the file is completely uploaded;
the file name of the target file is set to a preset format, for example, the name of the target file is renamed to ABC/pay/20181108/Alitray _ ABC _ pay _2018api edition.
It should be noted that, in order to further improve the timeliness of file downloading, the first preset time interval may be shortened, or the first preset time interval may be determined by referring to a plurality of associated factors that affect the file uploading speed, so as to ensure that the current attribute information of the target file meets the preset termination scanning condition within the shortest time after the file uploading party completes the file uploading.
In the process of regularly scanning the file name of the target file for multiple times by the file receiver, the scanning time interval is a second preset time interval, and the second preset time interval may be smaller than or equal to the first preset time interval, specifically:
if the time point of scanning the file is 2018-11-0910: 33, the file uploading party does not start to upload the file at the moment, so that no processing is performed;
if the time point of scanning the file is 2018-11-0910: 40, the target file exists in the specified storage path, but the file name of the target file is in a non-specified format (the specified format is a symbol of [ year + agilayinsture ]), no processing is performed, wherein 10:33 to 10:40 can be scanned for multiple times;
if the time point of scanning the file is 2018-11-0910: 51, the target file exists in the specified storage path, and the file name of the target file is in the specified format (the specified format is a [ year + agilayessence ]), downloading the target file, wherein 10:40 to 10:51 can be scanned for multiple times.
Further, in order to improve the scanning accuracy of the file attribute information, a scanning time interval of the file attribute information needs to be preset, and based on this, before the step S202 of acquiring the current attribute information of the target file according to the preset time interval, the method further includes:
determining file uploading characteristics of a file to be uploaded, wherein the file uploading characteristics comprise: at least one of file uploading time, file uploading bandwidth and file size;
and determining a preset time interval used for scanning attribute information of a target file uploaded by the file to be uploaded according to the determined file uploading characteristics of the file to be uploaded.
When the preset time interval of the attribute information of the regularly scanned target file is determined, a plurality of associated factors influencing the uploading speed of the file are referred, so that the scanning accuracy of the attribute information of the file can be improved, and the timeliness of file downloading is further improved; specifically, taking file uploading characteristics including file uploading time, file uploading bandwidth and file size as examples, the preset time interval calculation formula is as follows: r ═ b1x+b2y+b3z, whereinR represents a predetermined time interval, b1Weight coefficient representing the time taken for uploading a file, b2Weight coefficient representing file upload bandwidth, b3The method comprises the steps of representing a weight coefficient of a file size, x representing a first numerical value obtained by converting a specific value of file uploading time, y representing a second numerical value obtained by converting a specific value of file uploading bandwidth, and z representing a third numerical value obtained by converting a specific value of the file size, wherein in a preset time interval calculation formula, the specific numerical values of the relevant factors need to be uniformly converted according to a preset rule due to different units of the relevant factors, and then the converted numerical values are substituted into the formula to obtain a preset time interval.
In a specific embodiment, as shown in fig. 6, a schematic diagram of multi-end interaction in a file downloading method is provided, which specifically includes:
s601, uploading a target file aiming at the file to be uploaded under a storage path appointed by a file uploading direction, wherein certain uploading time is needed from the time when the file to be uploaded starts to the time when the file to be uploaded is uploaded, and the file size and the file modification time of the uploaded target file are continuously updated along with the change of the uploading time during the uploading period of the file to be uploaded;
s602, the file scanning device detects whether a target file uploaded by a file to be uploaded according to a file uploading policy exists under a specified storage path;
if the target file does not exist, S603, determining that the file uploading party does not start to upload the file;
if the target file exists, executing S604, and the file scanning device determining whether the attribute information recorded for the target file exists, wherein the determination result is non-existent for the case that the target file is scanned for the first time, and the determination result is existent for the case that the attribute information of the target file is not scanned for the first time;
if the attribute information is not recorded, the scanning is the first scanning of the attribute information of the target file, S605 is executed, and the attribute information of the target file is obtained and recorded;
if the attribute information is recorded, it indicates that the scanning is not the first scanning of the attribute information of the target file, and S606 is executed to obtain the current attribute information of the target file according to a first preset time interval, where the attribute information includes: the method comprises the steps of obtaining file size and/or file modification time, wherein the file modification time represents the latest written time information of a target file under a specified storage path; and the number of the first and second groups,
executing S607, determining whether the current attribute information of the target file meets a preset scanning termination condition, specifically, determining whether the attribute information of the target file remains unchanged, that is, comparing whether the latest attribute information of the target file is consistent with the attribute information recorded for the target file;
if not, indicating that the file is currently being uploaded, executing S608, updating the attribute information recorded for the target file according to the obtained current attribute information, and continuing executing the S606;
if yes, indicating that the file is uploaded, executing S609, and setting the file name of the target file to be in a preset format, for example, adding a certain specific field in the file name of the target file;
s610, the file receiver acquires the file name of the target file according to a second preset time interval;
s611, the file receiving party determines whether the file name of the target file is in a preset format, for example, whether a specific field exists in the file name of the target file;
if not, the step S610 is continuously executed; if yes, go to step S612 to download the target file.
In a file downloading method in one or more embodiments of the present specification, after a target file uploaded for a file to be uploaded is detected to exist in an assigned storage path, current attribute information of the target file is acquired according to a preset time interval; judging whether the file to be uploaded is uploaded completely according to the current attribute information; and if so, triggering the file receiver to download the target file. After the file uploading party starts to upload the file and before the file receiving party starts to download the file, the target file is downloaded after the file to be uploaded is uploaded and determined by combining the current attribute information through scanning the current attribute information of the target file for multiple times, so that the target file is downloaded by triggering the first time when the file is uploaded, the purpose of timely executing file downloading operation on the premise of confirming the integrity of the uploaded target file is achieved, and the file downloading timeliness and the file downloading integrity can be simultaneously ensured.
Corresponding to the file downloading methods described in fig. 2 to fig. 6, based on the same technical concept, one or more embodiments of the present specification further provide a file downloading apparatus, and fig. 7 is a schematic diagram of module compositions of the file downloading apparatus provided in one or more embodiments of the present specification, where the apparatus is configured to execute the file downloading methods described in fig. 2 to fig. 6, and as shown in fig. 7, the apparatus includes:
the file detection module 701 is configured to detect whether a target file to be uploaded by a file uploading policy exists under an appointed storage path;
an attribute information obtaining module 702, configured to, if the detection result indicates that the target file exists, obtain current attribute information of the target file according to a preset time interval;
an attribute information determining module 703, configured to determine whether the file to be uploaded is uploaded completely according to the current attribute information of the target file;
the file downloading module 704 is configured to trigger the file receiving party to download the target file if the determination result is yes.
In one or more embodiments of the present disclosure, after a file uploading party starts uploading a file and before a file receiving party starts downloading the file, the target file is downloaded after the file is uploaded is determined by scanning current attribute information of the target file for multiple times and combining the current attribute information, so that the target file is downloaded after the file is uploaded, and the purpose of timely executing a file downloading operation on the premise of confirming the integrity of the uploaded target file is achieved, thereby simultaneously ensuring file downloading timeliness and file downloading integrity.
Optionally, the attribute information determining module 703 is specifically configured to:
judging whether the current attribute information of the target file meets a preset scanning termination condition or not;
if so, determining that the file to be uploaded is uploaded, otherwise, continuing to execute the step of acquiring the current attribute information of the target file according to a preset time interval.
Optionally, the current attribute information includes: file size and/or file modification time; the attribute information determining module 703 is further specifically configured to:
judging whether the file size of the target file is kept unchanged and/or judging whether the file modification time of the target file is kept unchanged;
if the judgment result is yes, determining that the current attribute information of the target file meets a preset scanning termination condition, and setting the file name of the target file to be in a preset format.
Optionally, the file downloading module 704 is specifically configured to:
and if the file receiver detects that the file name of the target file conforms to a preset format, the file receiver downloads the target file.
Optionally, the apparatus further includes an attribute information recording module, configured to:
after determining that the target file exists, judging whether attribute information recorded aiming at the target file exists or not;
if the attribute information does not exist, acquiring and recording the attribute information of the target file, and taking the attribute information as the attribute information recorded for the target file for the first time.
Optionally, the apparatus further includes an attribute information updating module, configured to:
and after the file to be uploaded is determined not to be uploaded completely, updating the attribute information recorded aiming at the target file.
Optionally, the attribute information determining module 703 is further specifically configured to:
judging whether the current attribute information is consistent with the attribute information recorded for the target file or not according to the current attribute information acquired each time;
if the file to be uploaded is consistent with the file to be uploaded, the file to be uploaded is determined to be completely uploaded;
and if the file to be uploaded is inconsistent, determining that the file to be uploaded is not completely uploaded.
Optionally, the apparatus further comprises a time interval determination module configured to:
determining file uploading characteristics of a file to be uploaded, wherein the file uploading characteristics comprise: at least one of file uploading time, file uploading bandwidth and file size;
and determining a preset time interval used for scanning attribute information of a target file uploaded by the file to be uploaded according to the file uploading characteristics of the file to be uploaded.
In a file downloading device in one or more embodiments of the present specification, after detecting that a target file uploaded for a file to be uploaded exists in an assigned storage path, current attribute information of the target file is acquired according to a preset time interval; judging whether the file to be uploaded is uploaded completely according to the current attribute information; and if so, triggering the file receiver to download the target file. After the file uploading party starts to upload the file and before the file receiving party starts to download the file, the target file is downloaded after the file to be uploaded is uploaded and determined by combining the current attribute information through scanning the current attribute information of the target file for multiple times, so that the target file is downloaded by triggering the first time when the file is uploaded, the purpose of timely executing file downloading operation on the premise of confirming the integrity of the uploaded target file is achieved, and the file downloading timeliness and the file downloading integrity can be simultaneously ensured.
It should be noted that the embodiment of the file downloading apparatus in this specification and the embodiment of the file downloading method in this specification are based on the same inventive concept, and therefore, for specific implementation of this embodiment, reference may be made to the implementation of the corresponding file downloading method, and repeated details are not described again.
Corresponding to the file downloading methods described in fig. 2 to fig. 6, based on the same technical concept, one or more embodiments of the present specification further provide a file downloading system, and fig. 8 is a schematic structural composition diagram of the file downloading system provided in one or more embodiments of the present specification, as shown in fig. 8, the system includes: a file uploader 10, a file receiver 20, and a file scanning apparatus 30;
the file uploading party 10 is configured to upload a target file for a file to be uploaded to a specified storage path;
the file scanning device 30 is configured to detect whether a target file uploaded by the file uploading party 10 for the file to be uploaded exists under the specified storage path; if yes, acquiring the current attribute information of the target file according to a preset time interval; judging whether the file to be uploaded is uploaded completely according to the current attribute information of the target file, wherein after the file to be uploaded is uploaded completely by a file uploading party, the attribute information of the target file under a designated storage path is kept unchanged, the file size of the target file is the same as that of the file to be uploaded, the file content contained in the target file is the same as that contained in the file to be uploaded, the completeness of file downloading can be guaranteed, and the target file is triggered to be downloaded at the first time when the file uploading is determined to be completed, so that the timeliness of file downloading can be guaranteed;
the file receiving party 20 is configured to download the target file after it is determined that the file to be uploaded is completely uploaded, where, in case that the file attribute information scanning process is executed by the file receiving party, the file receiving party automatically downloads the target file after it is determined that the file is completely uploaded according to the current attribute information of the scanned target file; in view of the fact that the file attribute information scanning process is executed by an independent file scanning device independent of a file receiver, the file scanning device needs to mark the uploading completion of a scanned target file after determining that the file is uploaded according to the current attribute information of the target file, or send downloading indication information to the file receiver, and the file receiver automatically downloads the target file after detecting the uploading completion mark or receiving the downloading indication information.
In one or more embodiments of the present disclosure, after a file uploading party starts uploading a file and before a file receiving party starts downloading the file, the target file is downloaded after the file is uploaded is determined by scanning current attribute information of the target file for multiple times and combining the current attribute information, so that the target file is downloaded after the file is uploaded, and the purpose of timely executing a file downloading operation on the premise of confirming the integrity of the uploaded target file is achieved, thereby simultaneously ensuring file downloading timeliness and file downloading integrity.
The document scanning device 30 may be disposed in the document receiver 20; alternatively, the terminal where the document scanning device 30 is located may be independent from the document receiver 20;
in a case that the file scanning apparatus 30 is independent of the file receiving party 20, the file scanning apparatus 30 is further configured to set a file name of the target file to a preset format after determining that the file to be uploaded is uploaded;
the file receiving party 20 is specifically configured to determine that the file to be uploaded is completely uploaded after detecting that the file name of the target file conforms to the preset format, and download the target file.
In a file downloading system in one or more embodiments of the present specification, after detecting that a target file uploaded for a file to be uploaded exists in an assigned storage path, current attribute information of the target file is acquired according to a preset time interval; judging whether the file to be uploaded is uploaded completely according to the current attribute information; and if so, triggering the file receiver to download the target file. After the file uploading party starts to upload the file and before the file receiving party starts to download the file, the target file is downloaded after the file to be uploaded is uploaded and determined by combining the current attribute information through scanning the current attribute information of the target file for multiple times, so that the target file is downloaded by triggering the first time when the file is uploaded, the purpose of timely executing file downloading operation on the premise of confirming the integrity of the uploaded target file is achieved, and the file downloading timeliness and the file downloading integrity can be simultaneously ensured.
Further, corresponding to the methods shown in fig. 2 to fig. 6, based on the same technical concept, one or more embodiments of the present specification further provide a file downloading apparatus for performing the file downloading method, as shown in fig. 9.
File download devices may vary widely in configuration or performance and may include one or more processors 901 and memory 902, where the memory 902 may store one or more stored applications or data. Memory 902 may be, among other things, transient storage or persistent storage. The application program stored in memory 902 may include one or more modules (not shown), each of which may include a series of computer-executable instructions for a file download device. Still further, the processor 901 may be configured to communicate with the memory 902 to execute a series of computer-executable instructions in the memory 902 on a file download device. The file download apparatus may also comprise one or more power supplies 903, one or more wired or wireless network interfaces 904, one or more input-output interfaces 905, one or more keyboards 906, etc.
In one particular embodiment, the file download apparatus comprises a memory, and one or more programs, wherein the one or more programs are stored in the memory, and the one or more programs may comprise one or more modules, and each module may comprise a series of computer-executable instructions for the file download apparatus, and the one or more programs configured for execution by the one or more processors comprise computer-executable instructions for:
detecting whether a target file uploaded by a file to be uploaded by a file uploading policy exists under a specified storage path;
if yes, acquiring the current attribute information of the target file according to a preset time interval;
judging whether the file to be uploaded is uploaded completely according to the current attribute information of the target file;
and if so, triggering a file receiver to download the target file.
In one or more embodiments of the present disclosure, after a file uploading party starts uploading a file and before a file receiving party starts downloading the file, the target file is downloaded after the file is uploaded is determined by scanning current attribute information of the target file for multiple times and combining the current attribute information, so that the target file is downloaded after the file is uploaded, and the purpose of timely executing a file downloading operation on the premise of confirming the integrity of the uploaded target file is achieved, thereby simultaneously ensuring file downloading timeliness and file downloading integrity.
Optionally, when executed, the determining, according to the current attribute information of the target file, whether the file to be uploaded is uploaded completely includes:
judging whether the current attribute information of the target file meets a preset scanning termination condition or not;
if so, determining that the file to be uploaded is uploaded, otherwise, continuing to execute the step of acquiring the current attribute information of the target file according to a preset time interval.
Optionally, the current attribute information comprises, when executed, computer-executable instructions for: file size and/or file modification time;
the determining whether the current attribute information of the target file meets a preset scanning termination condition includes:
judging whether the file size of the target file is kept unchanged and/or judging whether the file modification time of the target file is kept unchanged;
if the judgment result is yes, determining that the current attribute information of the target file meets a preset scanning termination condition, and setting the file name of the target file to be in a preset format.
Optionally, when executed, the computer-executable instructions trigger the file receiver to download the target file, including:
and if the file receiver detects that the file name of the target file conforms to a preset format, the file receiver downloads the target file.
Optionally, when executed, the computer-executable instructions, after detecting whether there is a target file to be uploaded by the file uploading policy to the file to be uploaded under the specified storage path, further include:
after determining that the target file exists, judging whether attribute information recorded aiming at the target file exists or not;
if the attribute information does not exist, acquiring and recording the attribute information of the target file, and taking the attribute information as the attribute information recorded for the target file for the first time.
Optionally, when executed, the computer-executable instructions, after determining whether the file to be uploaded is uploaded completely, further include:
and after the file to be uploaded is determined not to be uploaded completely, updating the attribute information recorded aiming at the target file.
Optionally, when executed, the determining, according to the current attribute information of the target file, whether the file to be uploaded is uploaded completely includes:
judging whether the current attribute information is consistent with the attribute information recorded for the target file or not according to the current attribute information acquired each time;
if the file to be uploaded is consistent with the file to be uploaded, the file to be uploaded is determined to be completely uploaded;
and if the file to be uploaded is inconsistent, determining that the file to be uploaded is not completely uploaded.
Optionally, the computer executable instructions, when executed, further include, before acquiring the current attribute information of the target file at preset time intervals:
determining file uploading characteristics of a file to be uploaded, wherein the file uploading characteristics comprise: at least one of file uploading time, file uploading bandwidth and file size;
and determining a preset time interval used for scanning attribute information of a target file uploaded by the file to be uploaded according to the file uploading characteristics of the file to be uploaded.
In the file downloading device in one or more embodiments of the present specification, after detecting that a target file uploaded for a file to be uploaded exists in an assigned storage path, current attribute information of the target file is acquired according to a preset time interval; judging whether the file to be uploaded is uploaded completely according to the current attribute information; and if so, triggering the file receiver to download the target file. After the file uploading party starts to upload the file and before the file receiving party starts to download the file, the target file is downloaded after the file to be uploaded is uploaded and determined by combining the current attribute information through scanning the current attribute information of the target file for multiple times, so that the target file is downloaded by triggering the first time when the file is uploaded, the purpose of timely executing file downloading operation on the premise of confirming the integrity of the uploaded target file is achieved, and the file downloading timeliness and the file downloading integrity can be simultaneously ensured.
It should be noted that the embodiment of the file downloading device in this specification and the embodiment of the file downloading method in this specification are based on the same inventive concept, and therefore, for specific implementation of this embodiment, reference may be made to implementation of the corresponding file downloading method, and repeated details are not described again.
Further, based on the same technical concept, corresponding to the methods shown in fig. 2 to fig. 6, one or more embodiments of the present specification further provide a storage medium for storing computer-executable instructions, where in a specific embodiment, the storage medium may be a usb disk, an optical disk, a hard disk, and the like, and the storage medium stores computer-executable instructions that, when executed by a processor, implement the following processes:
detecting whether a target file uploaded by a file to be uploaded by a file uploading policy exists under a specified storage path;
if yes, acquiring the current attribute information of the target file according to a preset time interval;
judging whether the file to be uploaded is uploaded completely according to the current attribute information of the target file;
and if so, triggering a file receiver to download the target file.
In one or more embodiments of the present disclosure, after a file uploading party starts uploading a file and before a file receiving party starts downloading the file, the target file is downloaded after the file is uploaded is determined by scanning current attribute information of the target file for multiple times and combining the current attribute information, so that the target file is downloaded after the file is uploaded, and the purpose of timely executing a file downloading operation on the premise of confirming the integrity of the uploaded target file is achieved, thereby simultaneously ensuring file downloading timeliness and file downloading integrity.
Optionally, when executed by a processor, the determining, according to the current attribute information of the target file, whether the file to be uploaded is uploaded completely includes:
judging whether the current attribute information of the target file meets a preset scanning termination condition or not;
if so, determining that the file to be uploaded is uploaded, otherwise, continuing to execute the step of acquiring the current attribute information of the target file according to a preset time interval.
Optionally, the storage medium stores computer-executable instructions that, when executed by the processor, cause the current attribute information to include: file size and/or file modification time;
the determining whether the current attribute information of the target file meets a preset scanning termination condition includes:
judging whether the file size of the target file is kept unchanged and/or judging whether the file modification time of the target file is kept unchanged;
if the judgment result is yes, determining that the current attribute information of the target file meets a preset scanning termination condition, and setting the file name of the target file to be in a preset format.
Optionally, the storage medium stores computer-executable instructions that, when executed by the processor, trigger the file recipient to download the target file, including:
and if the file receiver detects that the file name of the target file conforms to a preset format, the file receiver downloads the target file.
Optionally, the computer-executable instructions stored in the storage medium, when executed by the processor, further include, after detecting whether there is a target file to be uploaded by the file uploading party with respect to the file to be uploaded under the specified storage path, that:
after determining that the target file exists, judging whether attribute information recorded aiming at the target file exists or not;
if the attribute information does not exist, acquiring and recording the attribute information of the target file, and taking the attribute information as the attribute information recorded for the target file for the first time.
Optionally, when executed by a processor, the computer-executable instructions stored in the storage medium further include, after determining whether the file to be uploaded is uploaded completely, that:
and after the file to be uploaded is determined not to be uploaded completely, updating the attribute information recorded aiming at the target file.
Optionally, when executed by a processor, the determining, according to the current attribute information of the target file, whether the file to be uploaded is uploaded completely includes:
judging whether the current attribute information is consistent with the attribute information recorded for the target file or not according to the current attribute information acquired each time;
if the file to be uploaded is consistent with the file to be uploaded, the file to be uploaded is determined to be completely uploaded;
and if the file to be uploaded is inconsistent, determining that the file to be uploaded is not completely uploaded.
Optionally, the storage medium stores computer-executable instructions, which when executed by the processor, further include, before acquiring the current attribute information of the target file at a preset time interval:
determining file uploading characteristics of a file to be uploaded, wherein the file uploading characteristics comprise: at least one of file uploading time, file uploading bandwidth and file size;
and determining a preset time interval used for scanning attribute information of a target file uploaded by the file to be uploaded according to the file uploading characteristics of the file to be uploaded.
When executed by a processor, computer-executable instructions stored in a storage medium in one or more embodiments of the present specification obtain current attribute information of a target file at a preset time interval after detecting that the target file uploaded for a file to be uploaded exists in a specified storage path; judging whether the file to be uploaded is uploaded completely according to the current attribute information; and if so, triggering the file receiver to download the target file. After the file uploading party starts to upload the file and before the file receiving party starts to download the file, the target file is downloaded after the file to be uploaded is uploaded and determined by combining the current attribute information through scanning the current attribute information of the target file for multiple times, so that the target file is downloaded by triggering the first time when the file is uploaded, the purpose of timely executing file downloading operation on the premise of confirming the integrity of the uploaded target file is achieved, and the file downloading timeliness and the file downloading integrity can be simultaneously ensured.
It should be noted that the embodiment of the storage medium in this specification and the embodiment of the file downloading method in this specification are based on the same inventive concept, and therefore, for specific implementation of this embodiment, reference may be made to implementation of the corresponding file downloading method, and repeated details are not described again.
In the 90 s of the 20 th century, improvements in a technology could clearly distinguish between improvements in hardware (e.g., improvements in circuit structures such as diodes, transistors, switches, etc.) and improvements in software (improvements in process flow). However, as technology advances, many of today's process flow improvements have been seen as direct improvements in hardware circuit architecture. Designers almost always obtain the corresponding hardware circuit structure by programming an improved method flow into the hardware circuit. Thus, it cannot be said that an improvement in the process flow cannot be realized by hardware physical modules. For example, a Programmable Logic Device (PLD), such as a Field Programmable Gate Array (FPGA), is an integrated circuit whose Logic functions are determined by programming the Device by a user. A digital system is "integrated" on a PLD by the designer's own programming without requiring the chip manufacturer to design and fabricate application-specific integrated circuit chips. Furthermore, nowadays, instead of manually making an Integrated Circuit chip, such Programming is often implemented by "logic compiler" software, which is similar to a software compiler used in program development and writing, but the original code before compiling is also written by a specific Programming Language, which is called Hardware Description Language (HDL), and HDL is not only one but many, such as abel (advanced Boolean Expression Language), ahdl (alternate Language Description Language), traffic, pl (core unified Programming Language), Cal, jhdware Description Language, langua, mylar, pams, hardlanguage (Hardware Description Language), vhlanguage, Language, HDL, software Language (Hardware Description Language), and vhjjjjjjjjjjjjjjjg Language, which are currently used in most fields. It will also be apparent to those skilled in the art that hardware circuitry that implements the logical method flows can be readily obtained by merely slightly programming the method flows into an integrated circuit using the hardware description languages described above.
The controller may be implemented in any suitable manner, for example, the controller may take the form of, for example, a microprocessor or processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro) processor, logic gates, switches, an Application Specific Integrated Circuit (ASIC), a programmable logic controller, and an embedded microcontroller, examples of which include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320, the memory controller may also be implemented as part of the control logic for the memory. Those skilled in the art will also appreciate that, in addition to implementing the controller as pure computer readable program code, the same functionality can be implemented by logically programming method steps such that the controller is in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, embedded microcontrollers and the like. Such a controller may thus be considered a hardware component, and the means included therein for performing the various functions may also be considered as a structure within the hardware component. Or even means for performing the functions may be regarded as being both a software module for performing the method and a structure within a hardware component.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. One typical implementation device is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
For convenience of description, the above devices are described as being divided into various units by function, and are described separately. Of course, the functionality of the various elements may be implemented in the same one or more software and/or hardware implementations of one or more of the present descriptions.
As will be appreciated by one skilled in the art, one or more embodiments of the present description may be provided as a method, system, or computer program product. Accordingly, one or more of the present description may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, one or more of the present description may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied in the medium.
One or more of the present specification has been described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to one or more embodiments of the specification. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation 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 may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
As will be appreciated by one skilled in the art, one or more embodiments of the present description may be provided as a method, system, or computer program product. Accordingly, one or more of the present description may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, one or more of the present description may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied in the medium.
One or more of the present specification can be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. One or more of the present specification can also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The above description is merely illustrative of one or more embodiments of the present disclosure and is not intended to limit one or more embodiments of the present disclosure. Various modifications and alterations to one or more of the present descriptions will be apparent to those skilled in the art. Any modification, equivalent replacement, improvement or the like made within the spirit and principle of one or more of the present specification should be included in the scope of one or more claims of the present specification.