CN115022303A - File downloading method, device, equipment and medium - Google Patents

File downloading method, device, equipment and medium Download PDF

Info

Publication number
CN115022303A
CN115022303A CN202210535299.5A CN202210535299A CN115022303A CN 115022303 A CN115022303 A CN 115022303A CN 202210535299 A CN202210535299 A CN 202210535299A CN 115022303 A CN115022303 A CN 115022303A
Authority
CN
China
Prior art keywords
target
target file
file
downloading
information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210535299.5A
Other languages
Chinese (zh)
Inventor
邓洋洋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhengcaiyun Co ltd
Original Assignee
Zhengcaiyun Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhengcaiyun Co ltd filed Critical Zhengcaiyun Co ltd
Priority to CN202210535299.5A priority Critical patent/CN115022303A/en
Publication of CN115022303A publication Critical patent/CN115022303A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/18File system types
    • G06F16/182Distributed file systems
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application discloses a file downloading method, device, equipment and medium, and relates to the technical field of information. The method comprises the following steps: generating a target file identifier corresponding to a target file, triggering a corresponding export event, and sending the target file identifier to a front end; monitoring the export event through an asynchronous thread, uploading the target file to a distributed storage system and recording corresponding target downloading information when the export event is monitored; when a polling request which is sent by the front end based on the target file identification and is initiated aiming at the target downloading information is obtained, and the target downloading information is recorded by the current asynchronous thread, the target downloading information is sent to the front end, so that the front end can obtain the target file stored in the distributed storage system based on the target downloading information. By the scheme, the method and the device can meet the increasing service requirements, data requirements and performance requirements when the file is downloaded.

Description

File downloading method, device, equipment and medium
Technical Field
The present invention relates to the field of information technologies, and in particular, to a method, an apparatus, a device, and a medium for downloading a file.
Background
At present, in the process of exporting downloaded files during business processing, a synchronous exporting downloading method is generally adopted by each large enterprise. However, as business continues to evolve and grow. On one hand, the data are directly and synchronously acquired by checking the database, so that the problems of long waiting time, IO (Input/Output) overtime setting, database link overtime and the like undoubtedly occur; on the other hand, on the aspect of application service, processing a large amount of data simultaneously can cause the problem of IO (input/output) blocking on one hand, and on the other hand, loading a large amount of data into a memory after querying is facilitated, so that a memory overflow scene can easily occur in a JVM (Java Virtual Machine), and a risk of blocking or even down of business application can be caused when the situation is serious; moreover, the display layer may wait too long when the amount of the exported downloaded data is too much, and at this time, the user may repeat the operation, causing the stress and tension of each application and resource again; moreover, when the data size is large, timeout, errors and the like may occur in the front-end request connection, and the above problems may bring great trouble to the user experience. In summary, the problem of how to satisfy the increasing business requirements, data requirements and performance requirements when downloading files needs to be further solved.
Disclosure of Invention
In view of this, the present invention provides a file downloading method, apparatus, device and medium, which can meet increasing business requirements, data requirements and performance requirements. The specific scheme is as follows:
in a first aspect, the present application discloses a file downloading method, including:
generating a target file identifier corresponding to a target file, triggering a corresponding export event, and sending the target file identifier to a front end;
monitoring the export event through an asynchronous thread, uploading the target file to a distributed storage system and recording corresponding target downloading information when the export event is monitored;
when a polling request which is sent by the front end based on the target file identification and is initiated aiming at the target downloading information is obtained, and the target downloading information is recorded by the current asynchronous thread, the target downloading information is sent to the front end, so that the front end can obtain the target file stored in the distributed storage system based on the target downloading information.
Optionally, before generating the target file identifier corresponding to the target file, triggering a corresponding export event, and sending the target file identifier to the front end, the method further includes:
and acquiring a downloading request aiming at the target file through a preset file downloading interface at the front end.
Optionally, the generating a target file identifier corresponding to the target file, triggering a corresponding export event, and sending the target file identifier to the front end includes:
and generating a target file identifier corresponding to the target file based on a preset algorithm, triggering a corresponding export event, and sending the target file identifier to the front end.
Optionally, the monitoring the export event through an asynchronous thread, and uploading the target file to a distributed storage system and recording corresponding target download information when the export event is monitored includes:
monitoring the export event through an asynchronous thread, and acquiring target related data corresponding to the target file from a data layer when the export event is monitored;
processing the target related data to obtain the target file;
and uploading the target file to a distributed storage system and recording corresponding target downloading information.
Optionally, the uploading the target file to a distributed storage system and recording corresponding target download information includes:
uploading the target file to a distributed storage system, recording corresponding target downloading information, and setting an effective period for the target downloading information based on preset effective duration.
Optionally, the monitoring the export event through an asynchronous thread, and after the monitoring the export event, uploading the target file to a distributed storage system and recording corresponding target download information, further includes:
correspondingly storing the target file identification and the target downloading information into a mapping table through the asynchronous thread;
correspondingly, when the polling request initiated for the target download information and sent by the front end based on the target file identifier is obtained and the target download information is recorded by the current asynchronous thread, the target download information is sent to the front end, so that the front end obtains the target file stored in the distributed storage system based on the target download information, including:
when a polling request which is sent by the front end based on the target file identifier and is initiated aiming at the target downloading information is obtained, and the target downloading information is stored into the mapping table by the current asynchronous thread, the target downloading information corresponding to the target file identifier is searched from the mapping table and is sent to the front end, so that the front end can obtain the target file stored in the distributed storage system based on the target downloading information.
Optionally, the correspondingly storing the target file identifier and the target download information into a mapping table through the asynchronous thread includes:
and correspondingly storing the target file identification and the target downloading information comprising the downloading address and the target file name of the target file into a mapping table at a remote dictionary server side through the asynchronous thread.
In a second aspect, the present application discloses a file downloading apparatus, comprising:
the file identifier sending module is used for generating a target file identifier corresponding to a target file, triggering a corresponding export event and sending the target file identifier to the front end;
the download information recording module is used for monitoring the export event through an asynchronous thread, uploading the target file to a distributed storage system when the export event is monitored, and recording corresponding target download information;
and the target file acquisition module is used for sending the target download information to the front end when a polling request which is sent by the front end based on the target file identifier and is initiated aiming at the target download information and the target download information is recorded by the current asynchronous thread is acquired, so that the front end can acquire the target file stored in the distributed storage system based on the target download information.
In a third aspect, the present application discloses an electronic device, comprising:
a memory for storing a computer program;
a processor for executing said computer program to implement the steps of said file downloading as disclosed in the foregoing.
In a fourth aspect, the present application discloses a computer readable storage medium for storing a computer program; wherein the computer program when executed by a processor implements the file download steps disclosed in the foregoing disclosure.
When the file downloading is carried out, a target file identification corresponding to a target file is generated firstly, a corresponding export event is triggered, the target file identification is sent to a front end, the export event is monitored through an asynchronous thread, the target file is uploaded to a distributed storage system and corresponding target downloading information is recorded when the export event is monitored, when a polling request sent by the front end based on the target file identification and aiming at the target downloading information is acquired, and the asynchronous thread records the target downloading information at present, the target downloading information is sent to the front end, so that the front end acquires the target file stored in the distributed storage system based on the target downloading information. Therefore, when the file is downloaded, the corresponding target file identifier is generated and the export event is triggered, the export event is monitored through the asynchronous thread monitoring system, and the target downloading information is acquired, so that the target file is acquired based on the target file identifier in the front section in a polling mode. Therefore, when the file is downloaded, the file is uploaded and the target downloading information is acquired through an asynchronous thread, so that the problems of long waiting time, IO overtime in setting, database link overtime and the like caused by directly and synchronously acquiring data through database checking are avoided; on the other hand, on the aspect of application service, the asynchronous thread processing avoids the problem of thread blocking caused by file downloading in a synchronous mode, and simultaneously avoids the problems of blocking and downtime caused by simultaneously processing mass data; furthermore, in the aspect of a display layer, a target file identifier corresponding to a target file is generated firstly, the target file identifier is displayed on a front-end application, and meanwhile, an asynchronous thread is used for obtaining file downloading information, so that the problems of too long waiting time and repeated operation of a user when the amount of downloaded data is too much is led out are solved, and the user experience is improved. In conclusion, the method and the device can meet increasing business requirements, data requirements and performance requirements when the file is downloaded.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a flowchart of a file downloading method provided in the present application;
fig. 2 is a schematic flowchart of a file downloading method provided in the present application;
FIG. 3 is a flowchart of a specific file downloading method provided in the present application;
fig. 4 is a flowchart illustrating a specific file downloading method provided in the present application;
FIG. 5 is a schematic structural diagram of a file downloading device according to the present application;
fig. 6 is a block diagram of an electronic device provided in the present application.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
With the continuous development and growth of enterprise business. On one hand, the data are directly and synchronously acquired by checking the database, so that the problems of long waiting time, IO (Input/Output) overtime setting, database link overtime and the like undoubtedly occur; on the other hand, on the aspect of application service, processing a large amount of data simultaneously can cause the problem of IO (input/output) blocking on one hand, and on the other hand, loading a large amount of data into a memory after querying is facilitated, so that a memory overflow scene can easily occur in a JVM (Java Virtual Machine), and a risk of blocking or even down of business application can be caused when the situation is serious; moreover, the display layer may wait too long when the amount of the exported downloaded data is too much, and at this time, the user may repeat the operation, causing the stress and tension of each application and resource again; moreover, when the data size is large, timeout, errors and the like may occur in the front-end request connection, and the above problems can bring great trouble to the user experience. Therefore, the file downloading method provided by the application can meet the increasing service requirements, data requirements and performance requirements.
The embodiment of the invention discloses a file downloading method, which is described with reference to fig. 1 and comprises the following steps:
step S11: and generating a target file identifier corresponding to the target file, triggering a corresponding export event, and sending the target file identifier to the front end.
In this embodiment, the download request for the target file is obtained through a preset file download interface at the front end. That is, when a user needs to download a target file, the user selects the required file through a preset file download interface on the front-end application display layer, and when the application layer obtains a download request initiated by the user, the application layer generates a target file identifier, namely a file key, corresponding to the target file based on a preset rule and a preset algorithm, triggers a corresponding export event, and sends the target file identifier to the front end. According to the technical scheme, after the application layer acquires the downloading request acquired through the preset file downloading interface, the corresponding export event is triggered, so that the export event can be monitored by the asynchronous thread, and the asynchronous thread starts to upload the file, record the file downloading information and the like; and generating and returning the unique target file identifier information of the target file to the front end, so that the target file identifier information can be displayed at the front end of the application, thereby avoiding the problem of repeated operation of a user caused by too long waiting time when a synchronous mode is used for downloading the file, further causing the stress and tension of each application and resource, and remarkably improving the user experience.
Step S12: and monitoring the export event through an asynchronous thread, uploading the target file to a distributed storage system and recording corresponding target downloading information when the export event is monitored.
In this embodiment, the monitoring the export event through an asynchronous thread, and uploading the target file to a distributed storage system and recording corresponding target download information when the export event is monitored includes: monitoring the export event through an asynchronous thread, and acquiring target related data corresponding to the target file from a data layer when the export event is monitored; processing the target related data to obtain the target file; and uploading the Object file to an oss (Object Storage Service) distributed Storage system and recording corresponding Object download information. After the asynchronous thread monitors the export event, target related data corresponding to the target file is obtained from a data layer, after the target related data is subjected to operations such as filtering, general selection, processing and packaging, the data is sequentially written into a local temporary file in a streaming mode according to a preset template or a file format to obtain the target file, the target file is uploaded to a distributed storage system, and target download information corresponding to the target file is recorded, wherein the target download information includes but is not limited to a file name and a file download address, so that the target file can be downloaded through the target download information later.
Further, the target file is uploaded to a distributed storage system, corresponding target downloading information is recorded, and an effective period is set for the target downloading information based on preset effective duration. It can be understood that a corresponding validity period is set for the target download information based on a preset validity duration, so that the target download information is valid information within the preset validity duration, thereby ensuring the security of the target file. According to the technical scheme, after monitoring the export event corresponding to the target file, the asynchronous thread starts to process and write the target file, and records the target file downloading information corresponding to the target file, so that the target file can be downloaded subsequently through the target file downloading information.
Step S13: when a polling request which is sent by the front end based on the target file identification and is initiated aiming at the target downloading information is obtained, and the target downloading information is recorded by the current asynchronous thread, the target downloading information is sent to the front end, so that the front end can obtain the target file stored in the distributed storage system based on the target downloading information.
Specifically, after the front end returns the target file identifier and issues an export event corresponding to the target file, the asynchronous thread performs related operations, and meanwhile, the front end sends a polling request for the target file download information based on the target file identifier, and sends the target download information to the front end until the asynchronous thread performs related operations and finishes writing of the target file and recording of the target download information, so that the front end obtains the target download file stored in the distributed storage system based on the target download information. It should be noted that the interval time of the polling request can be set as required, when the interval time of the polling request is fixed, the number of times of polling depends on the size of the data volume of the target file required by the user, and when the data volume of the target file is larger, the number of times of polling is larger; and conversely, when the data volume of the target file is smaller, the polling times are less, and the time required for polling depends on the time for the asynchronous thread to finish the corresponding operation. In the embodiment, the file downloading mode is as shown in fig. 2, and according to the technical scheme, the front end acquires the target file downloading information in a polling mode, and converts traditional synchronous downloading into asynchronous downloading, so that a series of problems caused by large data volume in synchronous downloading are avoided.
It can be seen that, in the embodiment, when downloading a file, a corresponding target file identifier is generated first and an export event is triggered, and the asynchronous thread monitoring system monitors the export event and obtains target download information, so that the target file is obtained in the previous segment in a polling manner based on the target file identifier. Therefore, when the file is downloaded, the file is uploaded and the target downloading information is acquired through an asynchronous thread, so that the problems of long waiting time, IO overtime in setting, database link overtime and the like caused by directly and synchronously acquiring data through database checking are avoided; on the other hand, on the aspect of application service, the asynchronous thread processing avoids the problem of thread blocking caused by file downloading in a synchronous mode, and simultaneously avoids the problems of blocking and downtime caused by simultaneously processing mass data; furthermore, in the aspect of a display layer, a target file identifier corresponding to a target file is generated firstly, the target file identifier is displayed on a front-end application, and meanwhile, an asynchronous thread is used for obtaining file downloading information, so that the problems of too long waiting time and repeated operation of a user when the amount of downloaded data is too much is led out are solved, and the user experience is improved. In conclusion, the method and the device can meet increasing business requirements, data requirements and performance requirements when the file is downloaded.
Referring to fig. 3, the embodiment of the present invention discloses a specific file downloading method, and compared with the previous embodiment, the embodiment further describes and optimizes the technical solution.
Step S21: and generating a target file identifier corresponding to the target file, triggering a corresponding export event, and sending the target file identifier to the front end.
Step S22: and monitoring the export event through an asynchronous thread, uploading the target file to a distributed storage system and recording corresponding target downloading information when the export event is monitored.
Step S23: and correspondingly storing the target file identification and the target downloading information into a mapping table through the asynchronous thread.
Specifically, the target file identifier and the target download information including the download address and the target file name of the target file are correspondingly stored in a mapping table at a Remote Dictionary Server (i.e., a Remote Dictionary Server) through the asynchronous thread. That is, the target file identifier and the target download information are stored in a remote dictionary server in a mapping manner, so that the subsequent front end acquires the target download information in a polling manner through the target file identifier. By the technical scheme, the mapping table formed by the target file identifier and the target downloading information is stored in the remote dictionary server, so that the target file downloading information can be conveniently acquired by the follow-up front end through the file identifier, and the target file is downloaded through the target file downloading information.
Step S24: when a polling request which is sent by the front end based on the target file identifier and is initiated aiming at the target downloading information is obtained, and the target downloading information is stored in the mapping table by the current asynchronous thread, the target downloading information corresponding to the target file identifier is searched from the mapping table and is sent to the front end, so that the front end can obtain the target file stored in the distributed storage system based on the target downloading information.
Specifically, after the front end returns the target file identifier and issues the export event corresponding to the target file, the asynchronous thread performs the relevant operation, and a mapping table formed by the target file identification and the target downloading information is stored in the remote dictionary server, meanwhile, the front end sends a polling request aiming at the target file downloading information based on the target file identification until the asynchronous thread finishes relevant operations and finishes the writing of the target file and the recording of the target downloading information and stores a mapping table formed by the target file identification and the target downloading information in a remote dictionary server, and then polls the target downloading information based on the target file identification, and the front end polling is provided with a time-out mechanism and sends the target download information to the front end, so that the front end obtains the target download file stored in the distributed storage system based on the target download information. Further, the file downloading flow chart of the embodiment is shown in fig. 4, and the embodiment significantly reduces the cost of file downloading and system maintenance and improves the efficiency of file downloading by componentizing the presentation layer and standardizing the application layer; when massive processing is carried out, paging leading-out downloading and fragment processing can be enhanced, so that the consistency and the expandability of the xutong are stronger; meanwhile, the module business is separated, the coupling among systems is further reduced through abstraction, the project construction and development efficiency is obviously improved, and a standardized file downloading solution is provided for companies, so that the technical implementation and the system management are facilitated.
As can be seen, in this embodiment, the target file identifier and the target file download information are mapped and stored in the remote dictionary server, so that the target file download information is directly obtained from the remote dictionary server through the target file identifier during polling, and the front end downloads the target file through the target file download information.
Referring to fig. 5, an embodiment of the present application discloses a file downloading apparatus, including:
the file identifier sending module 11 is configured to generate a target file identifier corresponding to a target file, trigger a corresponding export event, and send the target file identifier to a front end;
the download information recording module 12 is configured to monitor the export event through an asynchronous thread, and when the export event is monitored, upload the target file to a distributed storage system and record corresponding target download information;
and an object file obtaining module 13, configured to, when a polling request initiated for the object download information and sent by the front end based on the object file identifier is obtained and the current asynchronous thread has recorded the object download information, send the object download information to the front end, so that the front end obtains the object file stored in the distributed storage system based on the object download information.
It can be seen that, in the embodiment, when downloading a file, a corresponding target file identifier is generated first and an export event is triggered, and the asynchronous thread monitoring system monitors the export event and obtains target download information, so that the target file is obtained in the previous segment in a polling manner based on the target file identifier. Therefore, when the file is downloaded, the file is uploaded and the target downloading information is acquired through an asynchronous thread, so that the problems of long waiting time, IO overtime in setting, database link overtime and the like caused by directly and synchronously acquiring data through database checking are avoided; on the other hand, on the aspect of application service, the asynchronous thread processing avoids the problem of thread blocking caused by file downloading in a synchronous mode, and simultaneously avoids the problems of blocking and downtime caused by simultaneously processing mass data; furthermore, in the aspect of a display layer, a target file identifier corresponding to a target file is generated firstly, the target file identifier is displayed on a front-end application, and meanwhile, an asynchronous thread is used for obtaining file downloading information, so that the problems of too long waiting time and repeated operation of a user when the amount of downloaded data is too much is led out are solved, and the user experience is improved. In conclusion, the method and the device can meet increasing business requirements, data requirements and performance requirements when the file is downloaded.
In some embodiments, the file downloading apparatus further includes:
and the request acquisition module is used for acquiring a downloading request aiming at the target file through a preset file downloading interface at the front end.
In some specific embodiments, the file identifier sending module 11 is specifically configured to: and generating a target file identifier corresponding to the target file based on a preset algorithm, triggering a corresponding export event, and sending the target file identifier to the front end.
In some specific embodiments, the download information recording module 12 specifically includes:
the data acquisition unit is used for monitoring the export event through an asynchronous thread, and acquiring target related data corresponding to the target file from a data layer when the export event is monitored;
the file processing unit is used for processing the target related data to obtain the target file;
and the information recording unit is used for uploading the target file to a distributed storage system and recording corresponding target downloading information.
In some embodiments, the download information recording module 12 is specifically configured to: uploading the target file to a distributed storage system, recording corresponding target downloading information, and setting an effective period for the target downloading information based on preset effective duration.
In some embodiments, the file downloading apparatus further includes:
a mapping table storage module, configured to correspondingly store the target file identifier and the target download information in a mapping table through the asynchronous thread;
correspondingly, the target file obtaining module 13 is specifically configured to: when a polling request which is sent by the front end based on the target file identifier and is initiated aiming at the target downloading information is obtained, and the target downloading information is stored into the mapping table by the current asynchronous thread, the target downloading information corresponding to the target file identifier is searched from the mapping table and is sent to the front end, so that the front end can obtain the target file stored in the distributed storage system based on the target downloading information.
In some specific embodiments, the mapping table saving module is specifically configured to: and correspondingly storing the target file identification and the target downloading information comprising the downloading address and the target file name of the target file into a mapping table at a remote dictionary server side through the asynchronous thread.
Fig. 6 illustrates an electronic device 20 according to an embodiment of the present disclosure. The electronic device 20 may further include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input output interface 25, and a communication bus 26. Wherein, the memory 22 is used for storing a computer program, and the computer program is loaded and executed by the processor 21 to implement the relevant steps in the file downloading method disclosed in any of the foregoing embodiments. In addition, the electronic device 20 in the present embodiment may be specifically an electronic computer.
In this embodiment, the power supply 23 is used to provide voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and an external device, and a communication protocol followed by the communication interface is any communication protocol applicable to the technical solution of the present application, and is not specifically limited herein; the input/output interface 25 is configured to obtain external input data or output data to the outside, and a specific interface type thereof may be selected according to specific application requirements, which is not specifically limited herein.
In addition, the memory 22 is used as a carrier for resource storage, and may be a read-only memory, a random access memory, a magnetic disk or an optical disk, etc., and the resources stored thereon may include an operating system 221, a computer program 222, etc., and the storage manner may be a transient storage manner or a permanent storage manner.
The operating system 221 is used for managing and controlling each hardware device on the electronic device 20, and the computer program 222 may be Windows Server, Netware, Unix, Linux, or the like. The computer program 222 may further include a computer program that can be used to perform other specific tasks in addition to the computer program that can be used to perform the file download method by the electronic device 20 disclosed in any of the foregoing embodiments.
Further, the present application also discloses a computer-readable storage medium for storing a computer program; wherein the computer program when executed by a processor implements the file download method disclosed above. For the specific steps of the method, reference may be made to corresponding contents disclosed in the foregoing embodiments, and details are not repeated here.
Finally, it should also be noted that, in this document, relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, 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 identical elements in a process, method, article, or apparatus that comprises the element.
The above detailed description is provided for a file downloading method, device, apparatus and medium, and specific examples are applied herein to explain the principles and embodiments of the present invention, and the descriptions of the above embodiments are only used to help understanding the method and the core idea of the present invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (10)

1. A method for downloading a file, comprising:
generating a target file identifier corresponding to a target file, triggering a corresponding export event, and sending the target file identifier to a front end;
monitoring the export event through an asynchronous thread, uploading the target file to a distributed storage system and recording corresponding target downloading information when the export event is monitored;
when a polling request which is sent by the front end based on the target file identification and is initiated aiming at the target downloading information is obtained, and the target downloading information is recorded by the current asynchronous thread, the target downloading information is sent to the front end, so that the front end can obtain the target file stored in the distributed storage system based on the target downloading information.
2. The file downloading method according to claim 1, wherein before generating the target file identifier corresponding to the target file, triggering the corresponding export event, and sending the target file identifier to the front end, the method further comprises:
and acquiring a downloading request aiming at the target file through a preset file downloading interface at the front end.
3. The file downloading method according to claim 1, wherein the generating of the target file identifier corresponding to the target file, the triggering of the corresponding export event, and the sending of the target file identifier to the front end comprise:
and generating a target file identifier corresponding to the target file based on a preset algorithm, triggering a corresponding export event, and sending the target file identifier to the front end.
4. The method of claim 1, wherein the monitoring the export event through an asynchronous thread, and uploading the target file to a distributed storage system and recording corresponding target download information when the export event is monitored comprises:
monitoring the export event through an asynchronous thread, and acquiring target related data corresponding to the target file from a data layer when the export event is monitored;
processing the target related data to obtain the target file;
and uploading the target file to a distributed storage system and recording corresponding target downloading information.
5. The file downloading method according to claim 4, wherein the uploading the target file to a distributed storage system and recording corresponding target downloading information comprises:
and uploading the target file to a distributed storage system to record corresponding target downloading information, and setting an effective period for the target downloading information based on preset effective duration.
6. The file downloading method according to any one of claims 1 to 5, wherein the monitoring the export event through the asynchronous thread, and after uploading the target file to a distributed storage system and recording corresponding target downloading information when the export event is monitored, further comprises:
correspondingly storing the target file identification and the target downloading information into a mapping table through the asynchronous thread;
correspondingly, when the polling request initiated for the target download information and sent by the front end based on the target file identifier is obtained and the target download information is recorded by the current asynchronous thread, the target download information is sent to the front end, so that the front end obtains the target file stored in the distributed storage system based on the target download information, including:
when a polling request which is sent by the front end based on the target file identifier and is initiated aiming at the target downloading information is obtained, and the target downloading information is stored into the mapping table by the current asynchronous thread, the target downloading information corresponding to the target file identifier is searched from the mapping table and is sent to the front end, so that the front end can obtain the target file stored in the distributed storage system based on the target downloading information.
7. The method of claim 6, wherein the saving the target file identifier and the target download information by the asynchronous thread to a mapping table correspondingly comprises:
and correspondingly storing the target file identification and the target downloading information comprising the downloading address and the target file name of the target file into a mapping table at a remote dictionary server side through the asynchronous thread.
8. A file downloading apparatus, comprising:
the file identifier sending module is used for generating a target file identifier corresponding to a target file, triggering a corresponding export event and sending the target file identifier to the front end;
the download information recording module is used for monitoring the export event through an asynchronous thread, uploading the target file to a distributed storage system when the export event is monitored, and recording corresponding target download information;
and the target file acquisition module is used for sending the target download information to the front end when a polling request which is sent by the front end based on the target file identifier and is initiated aiming at the target download information and the target download information is recorded by the current asynchronous thread is acquired, so that the front end can acquire the target file stored in the distributed storage system based on the target download information.
9. An electronic device, comprising:
a memory for storing a computer program;
a processor for executing the computer program to carry out the steps of file downloading according to any one of claims 1 to 7.
10. A computer-readable storage medium for storing a computer program; wherein the computer program when executed by a processor performs the steps of file downloading as claimed in any one of claims 1 to 7.
CN202210535299.5A 2022-05-17 2022-05-17 File downloading method, device, equipment and medium Pending CN115022303A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210535299.5A CN115022303A (en) 2022-05-17 2022-05-17 File downloading method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210535299.5A CN115022303A (en) 2022-05-17 2022-05-17 File downloading method, device, equipment and medium

Publications (1)

Publication Number Publication Date
CN115022303A true CN115022303A (en) 2022-09-06

Family

ID=83069350

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210535299.5A Pending CN115022303A (en) 2022-05-17 2022-05-17 File downloading method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN115022303A (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150249694A1 (en) * 2013-12-06 2015-09-03 Media Gobbler, Inc. Managing downloads of large data sets
CN106412137A (en) * 2016-12-20 2017-02-15 北京并行科技股份有限公司 File downloading system and file downloading method
CN112100134A (en) * 2020-08-25 2020-12-18 深圳市星砺达科技有限公司 Method and device for exporting large file, storage medium and computer equipment
CN112256417A (en) * 2020-10-23 2021-01-22 上海豹云网络信息服务有限公司 Data request processing method and device and computer readable storage medium
CN113132489A (en) * 2021-04-22 2021-07-16 中国工商银行股份有限公司 Method, device, computing equipment and medium for downloading file
CN113656357A (en) * 2021-09-01 2021-11-16 京东科技信息技术有限公司 File management method, device, system and storage medium
WO2021238796A1 (en) * 2020-05-26 2021-12-02 苏宁易购集团股份有限公司 Asynchronous processing method, apparatus, and system for download tasks, and storage medium
CN113806305A (en) * 2020-09-30 2021-12-17 北京沃东天骏信息技术有限公司 Data export method and device, computer readable storage medium and electronic equipment
CN114036213A (en) * 2020-08-26 2022-02-11 北京市天元网络技术股份有限公司 Data asynchronous export sharing method and device

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150249694A1 (en) * 2013-12-06 2015-09-03 Media Gobbler, Inc. Managing downloads of large data sets
CN106412137A (en) * 2016-12-20 2017-02-15 北京并行科技股份有限公司 File downloading system and file downloading method
WO2021238796A1 (en) * 2020-05-26 2021-12-02 苏宁易购集团股份有限公司 Asynchronous processing method, apparatus, and system for download tasks, and storage medium
CN112100134A (en) * 2020-08-25 2020-12-18 深圳市星砺达科技有限公司 Method and device for exporting large file, storage medium and computer equipment
CN114036213A (en) * 2020-08-26 2022-02-11 北京市天元网络技术股份有限公司 Data asynchronous export sharing method and device
CN113806305A (en) * 2020-09-30 2021-12-17 北京沃东天骏信息技术有限公司 Data export method and device, computer readable storage medium and electronic equipment
CN112256417A (en) * 2020-10-23 2021-01-22 上海豹云网络信息服务有限公司 Data request processing method and device and computer readable storage medium
CN113132489A (en) * 2021-04-22 2021-07-16 中国工商银行股份有限公司 Method, device, computing equipment and medium for downloading file
CN113656357A (en) * 2021-09-01 2021-11-16 京东科技信息技术有限公司 File management method, device, system and storage medium

Similar Documents

Publication Publication Date Title
US9164950B2 (en) Use tag clouds to visualize components related to an event
CN103023857B (en) A kind of method and system of information resources remote deployment
CN104820701A (en) Method and system for recording and synchronizing data
WO2003067454A1 (en) Configuration management method and system
US8001150B2 (en) Device management method using nodes having additional attribute and device management client thereof
CN102130959A (en) System and method for scheduling cloud storage resource
WO2019051948A1 (en) Method, apparatus, server, and storage medium for processing monitoring data
CN115328742B (en) Container information monitoring method and device, storage medium and electronic equipment
CN110855746A (en) Middleware management method, electronic device and storage medium
CN113656357A (en) File management method, device, system and storage medium
CN107193563B (en) Method for managing server stateless firmware version
CN114168297A (en) Method, device, equipment and medium for scheduling collection tasks
CN112148553A (en) Equipment monitoring method, device, system and computer readable storage medium
CN115022303A (en) File downloading method, device, equipment and medium
CN115048187A (en) Operator-based pvc file importing method, device and storage medium
CN100382506C (en) Method for verifying network-unit server in network management system
CN113835625B (en) Data storage method, device, equipment and storage medium based on sub-path
CN115629784A (en) Method, system, equipment and computer readable storage medium for updating machine file
CN114817134A (en) Snapshot task monitoring method, device, equipment and medium
CN115469807A (en) Disk function configuration method, device, equipment and storage medium
CN113472744A (en) Data interaction method, device, equipment and medium under different storage protocols
US20120150898A1 (en) Dynamic Collection Of System Support Files In A Data Processing Environment
US7107423B2 (en) Methods and apparatus for data retrieval
CN108111612B (en) Online registration method and device for book self-service equipment
CN114661256A (en) Data acquisition method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination