CN116095064A - File downloading method, computer equipment and storage medium - Google Patents

File downloading method, computer equipment and storage medium Download PDF

Info

Publication number
CN116095064A
CN116095064A CN202211666053.8A CN202211666053A CN116095064A CN 116095064 A CN116095064 A CN 116095064A CN 202211666053 A CN202211666053 A CN 202211666053A CN 116095064 A CN116095064 A CN 116095064A
Authority
CN
China
Prior art keywords
file
identification information
downloading
information
block
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
CN202211666053.8A
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.)
Citic Securities Co ltd
Beijing Lischen Jinzhi Technology Co ltd
Original Assignee
Citic Securities Co ltd
Beijing Lischen Jinzhi Technology 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 Citic Securities Co ltd, Beijing Lischen Jinzhi Technology Co ltd filed Critical Citic Securities Co ltd
Priority to CN202211666053.8A priority Critical patent/CN116095064A/en
Publication of CN116095064A publication Critical patent/CN116095064A/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/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Human Computer Interaction (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The embodiment of the invention discloses a file downloading method, computer equipment and a storage medium, wherein the method comprises the following steps: when the file information of at least one file to be downloaded is larger than a preset threshold in the file downloading process, generating a file dividing instruction according to the first file information corresponding to the first file and the preset threshold and sending the file dividing instruction to the server, wherein the file dividing instruction is used for indicating the server to divide the first file into a plurality of file blocks according to the first file information and the preset threshold, and the first file is any one of at least one file to be downloaded; obtaining response information fed back by the server, wherein the response information comprises indication information of the completion of the division of the first file by the server; and respectively downloading each file block according to the response information so as to finish downloading all files to be downloaded.

Description

File downloading method, computer equipment and storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a file downloading method, a computer device, and a storage medium.
Background
When downloading files through a web page or a client, if tens of thousands of files need to be downloaded at a time, and files exceeding Gb are included in the files (a large number of files or files including more than Gb, hereinafter referred to as large files), downtime will often occur, or a node turned by a network is forcibly turned off due to long-time mass transmission, so that a file downloading method needs to be proposed to solve the above problem.
Disclosure of Invention
Therefore, in order to solve the defects in the prior art, the embodiment of the invention provides a file downloading method, computer equipment and computer equipment.
According to a first aspect, an embodiment of the present invention discloses a file downloading method, which is executed by a client, and includes:
when the file information of at least one file to be downloaded is larger than a preset threshold in the file downloading process, generating a file dividing instruction according to the first file information corresponding to the first file and the preset threshold and sending the file dividing instruction to the server, wherein the file dividing instruction is used for indicating the server to divide the first file into a plurality of file blocks according to the first file information and the preset threshold, and the first file is any one of at least one file to be downloaded;
obtaining response information fed back by the server, wherein the response information comprises indication information of the completion of the division of the first file by the server;
and respectively downloading each file block according to the response information so as to finish downloading all files to be downloaded.
Optionally, the response information further includes identification information corresponding to each file block, and first total identification information, where the identification information is used to characterize an order in which the file blocks are divided, and the first total identification information is used to characterize the identification information of the first file, and the method further includes:
respectively downloading each file block, identification information corresponding to the file block and first total identification information;
obtaining second total identification information of all the file blocks according to the identification information of each file block;
when the second total identification information is consistent with the first total identification information, sequentially combining each file block in the order of the identification information to obtain a first file.
Optionally, when the second total identification information is inconsistent with the first total identification information, the method further comprises: and re-downloading each file block, the identification information corresponding to the file block and the first total identification information.
Optionally, the file dividing instruction further includes identification information and a binding relationship between the identification information and the file blocks, so that the server side binds the file blocks and the identification information corresponding to the file blocks according to the binding relationship between the identification information and the file blocks after dividing the file blocks.
Optionally, downloading each file block according to the response information, which specifically includes:
and respectively downloading a plurality of file blocks by using a plurality of preset service nodes according to the response information until all the file blocks are downloaded.
According to a second aspect, an embodiment of the present invention discloses a file downloading method, which is executed by a server, and the method includes:
acquiring a file division instruction sent by a client, wherein the file division instruction comprises first file information and a preset threshold value;
dividing a first file into a plurality of file blocks according to the first file information and a preset threshold value;
and when the first file is divided, sending response information to the client, wherein the response information is used for indicating an indication message for dividing the first file.
Optionally, the response information further includes identification information corresponding to each file block and first total identification information, where the identification information is used to characterize an order in which the file blocks are divided, and the first total identification information is used to characterize identification information of the first file, so that the subsequent client verifies the first file obtained after the file blocks are combined according to the identification information.
Optionally, when the file division instruction further includes identification information and a binding relationship between the identification information and the file blocks, after dividing the first file into the plurality of file blocks according to the file division instruction, the method further includes:
and binding the file blocks and the identification information corresponding to the file blocks according to the binding relation between the identification information and the file blocks, so that the client combines the file blocks according to the binding relation between the identification information and the file blocks to obtain a first file.
According to a third aspect, an embodiment of the present invention discloses a file downloading device, applied to a client, the device including:
the file dividing instruction is used for indicating the server to divide the first file into a plurality of file blocks according to the first file information and the preset threshold, wherein the first file is any one of the at least one file to be downloaded;
the information acquisition module is used for acquiring response information fed back by the server side, wherein the response information comprises indication information of the completion of the division of the first file by the server side;
and the downloading module is used for respectively downloading each file block according to the response information so as to finish downloading all files to be downloaded.
According to a fourth aspect, an embodiment of the present invention discloses a file downloading method, applied to a server, where the apparatus includes:
the acquisition instruction module is used for acquiring a file division instruction sent by the client, wherein the file division instruction comprises first file information and a preset threshold value;
the file dividing module is used for dividing the first file into a plurality of file blocks according to the first file information and a preset threshold value;
and the information sending module is used for sending response information to the client when the first file is divided, wherein the response information is used for indicating an indication message for indicating that the first file is divided.
According to a fifth aspect, an embodiment of the present invention further discloses a computer device, including: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to cause the at least one processor to perform steps of the file downloading method as in the first aspect or any alternative implementation of the first aspect.
According to a sixth aspect, an embodiment of the present invention also discloses a computer readable storage medium, on which a computer program is stored, which when executed by a processor implements the steps of the file downloading method as in the first aspect or any of the alternative embodiments of the first aspect.
According to a seventh aspect, an embodiment of the present invention further discloses a computer device, including: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to cause the at least one processor to perform steps of a file downloading method as in the second aspect or any alternative embodiment of the second aspect.
According to an eighth aspect, an embodiment of the present invention also discloses a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the file downloading method as in the second aspect or any alternative embodiment of the second aspect.
The technical scheme of the invention has the following advantages:
according to the file downloading method, in the file downloading process, when file information of at least one file to be downloaded is larger than a preset threshold value, the fact that the file to be downloaded is too large at the moment is indicated, and a downtime situation possibly occurs is indicated, and according to the situation, a client generates a file dividing instruction according to a first file, corresponding first file information and the preset threshold value, and sends the file dividing instruction to a server, so that the server can divide the first file into a plurality of file blocks according to the file dividing instruction; further, after the indication message of the completion of the division of the first file fed back by the server is obtained, each file block is downloaded respectively, so that the downloading of the first file is completed. Therefore, the risk of downtime in the process of downloading large files and the risk of forced shutdown by the network transit node under the condition of long time and large transmission quantity are avoided.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings that are needed in the description of the embodiments or the prior art will be briefly described, and it is obvious that the drawings in the description below are some embodiments of the present invention, and other drawings can be obtained according to the drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flowchart showing a specific example of a file downloading method according to an embodiment of the present invention;
FIG. 2 is a schematic diagram showing a specific example of a file download system according to an embodiment of the present invention
FIG. 3 is a schematic diagram showing a specific example of a file downloading method according to an embodiment of the present invention;
FIG. 4 is a flowchart showing a specific example of a file downloading method according to an embodiment of the present invention;
FIG. 5 is a flowchart showing a specific example of a file downloading method according to an embodiment of the present invention;
FIG. 6 is a schematic block diagram of a specific example of a file downloading device in accordance with an embodiment of the present invention;
FIG. 7 is a schematic block diagram of a specific example of a file downloading device in accordance with an embodiment of the present invention;
FIG. 8 is a diagram illustrating a specific example of a computer device in a client according to an embodiment of the present invention;
fig. 9 is a diagram showing a specific example of a computer device in a server according to an embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made apparent and fully in view of the accompanying drawings, in which some, but not all embodiments of the invention are shown. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
In the description of the present invention, it should be noted that the directions or positional relationships indicated by the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc. are based on the directions or positional relationships shown in the drawings, are merely for convenience of describing the present invention and simplifying the description, and do not indicate or imply that the devices or elements referred to must have a specific orientation, be configured and operated in a specific orientation, and thus should not be construed as limiting the present invention. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance.
In the description of the present invention, it should be noted that, unless explicitly specified and limited otherwise, the terms "mounted," "connected," and "connected" are to be construed broadly, and may be either fixedly connected, detachably connected, or integrally connected, for example; can be mechanically or electrically connected; the two components can be directly connected or indirectly connected through an intermediate medium, or can be communicated inside the two components, or can be connected wirelessly or in a wired way. The specific meaning of the above terms in the present invention will be understood in specific cases by those of ordinary skill in the art.
In addition, the technical features of the different embodiments of the present invention described below may be combined with each other as long as they do not collide with each other.
Aiming at the technical problems mentioned in the background art, the embodiment of the application provides a file downloading method, and particularly referring to fig. 1, a flowchart of the file downloading method is provided in the embodiment of the invention. Before describing the implementation steps of the method, a file downloading system to which the method is applicable is first described, as shown in fig. 2, which is a schematic view of an application scenario in a specific embodiment of the present invention. In the file downloading system according to the embodiment of the present invention, the client may be a web page or the like corresponding to the browser in the file downloading process, and the server may be the end storing the file in the file downloading process.
Next, specific execution procedures of each module in the related file download system will be described.
Specifically, referring to fig. 1, the file downloading method is executed by a client, and includes the following steps:
step 101, when file information of at least one file to be downloaded is greater than a preset threshold in the process of downloading the file, generating a file dividing instruction according to first file information corresponding to the first file and the preset threshold, and sending the file dividing instruction to a server.
The file dividing instruction is used for indicating the server to divide the first file into a plurality of file blocks according to the first file information and a preset threshold, wherein the first file is any one of at least one file to be downloaded.
In the file downloading process, when the file information to be downloaded is greater than a preset threshold, a file dividing instruction needs to be generated according to the first file information corresponding to the first file and the preset threshold. In the downloading process of the file, the file information of the corresponding file to be downloaded, that is, when the occupied memory size of the file exceeds a preset threshold, can be defined as a large file.
In general, the definition of a large file may be that an individual file exceeds Gb, or that package download is performed on all files, or that a number of files have sizes exceeding Gb may be referred to as a large file, and of course, in the embodiment of the present invention, the specific numerical value of the preset threshold is not limited, and may be determined by a person skilled in the art according to practical situations.
In addition, another explanation is provided for the preset threshold, in the preset threshold, the client can smoothly download the file to be downloaded, and when the preset threshold is exceeded, the file is downloaded, so that the condition that the background art is crashed or the node is turned off may occur.
Therefore, when the generation and file division instructions are performed, the generation needs to be performed together according to the first file information and the preset threshold value, so that the service end can be ensured to divide the first file into file blocks which are smaller than the preset threshold value when the file division instructions are executed.
Step 102, response information fed back by the server is obtained, wherein the response information comprises indication information that the server finishes dividing the first file.
Step 103, downloading each file block according to the response information, so as to finish downloading all the first files.
Illustratively, after sending the file division instruction to the server side, waiting for response information of the server side, wherein the response information includes indication information that the first file division is completed.
After the response information is acquired, the corresponding divided file blocks are downloaded from the server side, and the first file is divided into a plurality of file blocks, so that the problems of downtime and downloading interruption possibly occurring in the downloading process due to overlarge files are avoided.
On the basis of the above embodiment, the response information further includes identification information corresponding to each file block and first total identification information, where the identification information is used to characterize an order in which the file blocks are divided, and the first total identification information is used to characterize identification information of the first file, and the method further includes:
respectively downloading each file block, identification information corresponding to the file block and first total identification information;
obtaining second total identification information of all the file blocks according to the identification information of each file block;
when the second total identification information is consistent with the first total identification information, sequentially combining each file block in the order of the identification information to obtain a first file.
The response information includes identification information corresponding to each file block and first total identification information, where the identification information is an identity of each file block, and an order of the corresponding file blocks in all file blocks may be determined according to the identification information.
And respectively downloading all the file blocks, corresponding identification information and first identification information, and combining the file blocks according to the identification information after the downloading of all the file blocks is completed, so as to obtain a complete first file.
In this case, the first file is divided and recombined, so as to ensure that the combined first file corresponds to the first file of the server, and avoid errors in the downloading or combining process. The first file which is combined at this time can obtain total identification information, namely second total identification information, according to the identification information of each file block, and if the second total identification information is consistent with the first total identification information, the first file which is obtained by combining the corresponding identification information at this time is identical with the first file of the server.
When the second total identification information is inconsistent with the first total identification information, an error occurs in the downloading process or the combining process, and in this case, in order to further eliminate the possibility of the error, all files need to be downloaded again, and the judgment is continued according to the file blocks after the downloading again.
When an error occurs after the re-downloading, the file dividing instruction can be regenerated and sent to the server, or the file dividing instruction can be directly re-sent, the corresponding file blocks and other information can be re-downloaded after the response information is obtained, and the corresponding file blocks can be directly re-downloaded, so that the downloading of the first file can be completed.
Preferably, in the embodiment of the present invention, the identification information and the first total identification information may both be marked in the form of hash codes, as shown in fig. 3, which is a schematic diagram of marking the file blocks with hash codes, and a specific implementation process may be that the first file is a hash code total value, corresponding to the first total identification information, the hash code total value is divided into N file blocks with a preset threshold value as an interval on the basis of the hash code total value, each file block 512bit, each hash corresponding to the file block has a start value and an end value, and the end value of the last file block corresponds to the start value of the next file block, so that all the file blocks may be combined, and then the hash code total value (final result hash value) may be obtained according to the combined file blocks.
In another optional embodiment, the file dividing instruction further includes identification information and a binding relationship between the identification information and the file blocks, so that the server side binds the file blocks and the corresponding identification information according to the binding relationship between the identification information and the file blocks after dividing the file blocks.
When the file division instruction includes the identification information and the binding relation between the identification information and the file blocks, the server associates the corresponding file blocks with the identification information according to the binding relation in the file division instruction after the first file division is completed, wherein the specific binding relation can be embodied in the form of a table or a similar Map set, and the specific form is not limited.
In the foregoing embodiment, after the server side completes dividing the first file, each file block is downloaded according to the response information, which specifically includes: and respectively downloading a plurality of file blocks by using a plurality of preset service nodes according to the response information until all the file blocks are downloaded.
For example, when downloading the file blocks, in order to increase the downloading speed, a multithreaded polling mode may be adopted for downloading at a plurality of preset service nodes, and in the downloading process, factors such as the sequence among the file blocks are not required to be considered, so long as downloading of all the file blocks is completed.
According to the file downloading method, in the process of downloading files, when file information of at least one file to be downloaded is larger than the preset threshold value, the fact that the file to be downloaded is too large at the moment and possibly has downtime is indicated, and according to the situation, a client generates a file dividing instruction according to a first file, corresponding first file information and the preset threshold value, and sends the file dividing instruction to a server, so that the server can divide the first file into a plurality of file blocks according to the file dividing instruction; further, after the indication message of the completion of the division of the first file fed back by the server is obtained, each file block is downloaded respectively, so that the downloading of the first file is completed. Therefore, the risk of downtime in the process of downloading large files and the risk of forced shutdown by the network transit node under the condition of long time and large transmission quantity are avoided.
Corresponding to the above method embodiment, the embodiment of the present invention further provides a file downloading method, as shown in fig. 4, executed by a server, where the method includes the following steps:
step 401, obtaining a file division instruction sent by a client, where the file division instruction includes first file information and a preset threshold.
Step 402, dividing the first file into a plurality of file blocks according to the first file information and a preset threshold.
Step 403, when the first file division is completed, sending response information to the client, where the response information is used to indicate an indication message that the first file division is completed.
The method includes the steps that after a file dividing instruction sent by a client is obtained, a first file is divided according to first file information in the file dividing instruction and a preset threshold value, and corresponding information is fed back to the client after the division is completed, so that a corresponding file block is downloaded by a subsequent client according to the response information.
In an optional embodiment, the response information further includes identification information corresponding to each file block and first total identification information, where the identification information is used to characterize an order in which the file blocks are divided, and the first total identification information is used to characterize identification information of the first file, so that the subsequent client verifies the first file obtained after the file blocks are combined according to the identification information.
If the response information further includes the identification information of each file block and the first total identification information corresponding to the first file, the description server not only divides the first file according to the file division instruction, but also identifies the divided file blocks, so that the corresponding file blocks can be identified according to the identification after the client downloads, and the problem of confusion of the file blocks is avoided.
In an alternative embodiment, when the file division instruction further includes identification information and a binding relationship between the identification information and the file blocks, after dividing the first file into the plurality of file blocks according to the file division instruction, the method further includes:
and binding the file blocks and the identification information corresponding to the file blocks according to the binding relation between the identification information and the file blocks, so that the client combines the file blocks according to the binding relation between the identification information and the file blocks to obtain a first file.
Illustratively, when the identification information and the binding relation between the identification information and the file blocks are included in the file dividing instruction, the divided file blocks can be bound with the corresponding identification information in the process of dividing the first file.
As shown in fig. 5, a flowchart of one embodiment of the above method is shown, specifically, for a case of batch downloading, an interface is required to be requested from a server, a file directory and a corresponding file of the server of the file to be downloaded are obtained from the server, and a file tree corresponding to the file directory and the corresponding file is generated according to the file directory and the corresponding file; the client can download files in a multithreaded parallel manner according to a file tree in a plug-in mode, the problem that popup window inquiry is frequently received when a large number of files are downloaded can be avoided by adopting the plug-in mode to download the files, particularly, a download interface of an access server can download a plurality of files in parallel, when a large file is encountered, if the size of a file formed by each file block after the downloading is inconsistent with the size of the file corresponding to the server, the local failure is written or the call of the download interface fails, the corresponding files (all the file blocks) are downloaded again until the downloading is completed, and the program is ended.
The downloading interface and the file block division and the corresponding identification information are requested from the server side by the following modes:
Figure BDA0004015120440000121
the process of verifying the second total identification information with the first total identification information may be implemented in the following manner:
Figure BDA0004015120440000131
in this way, when the file dividing instruction is obtained in the process of downloading the file, the first file can be divided into a plurality of file blocks according to the file dividing instruction; after the division is finished, response information is timely fed back to the client, so that after the client obtains an indication message fed back by the server and used for finishing the division of the first file, each file block is downloaded respectively, and the downloading of the first file is finished. Therefore, the risk of downtime in the process of downloading large files and the risk of forced shutdown by the network transit node under the condition of long time and large transmission quantity are avoided.
In the foregoing, several embodiments of the method for downloading files provided in the present application, and the following description describes other embodiments of file downloading provided in the present application, specifically, see the following.
The embodiment of the invention also discloses a file downloading device, as shown in fig. 6, which comprises:
the sending instruction module 601 is configured to generate a file dividing instruction according to first file information corresponding to a first file and a preset threshold when file information of at least one file to be downloaded is greater than the preset threshold in a file downloading process, and send the file dividing instruction to a server, where the file dividing instruction is used to instruct the server to divide the first file into a plurality of file blocks according to the first file information and the preset threshold, and the first file is any one of at least one file to be downloaded;
the information acquisition module 602 acquires response information fed back by the server, wherein the response information comprises indication information of the completion of the division of the first file by the server;
and the downloading module 603 is configured to download each file block according to the response information, so as to complete downloading of all files to be downloaded.
As an optional real-time manner of the present invention, the response information further includes identification information corresponding to each file block, and first total identification information, where the identification information is used to characterize an order in which the file blocks are divided, the first total identification information is used to characterize identification information of the first file, and the apparatus is further configured to:
respectively downloading each file block, identification information corresponding to the file block and first total identification information;
obtaining second total identification information of all the file blocks according to the identification information of each file block;
when the second total identification information is consistent with the first total identification information, sequentially combining each file block in the order of the identification information to obtain a first file.
As an optional real-time manner of the present invention, when the second total identification information is inconsistent with the first total identification information, the apparatus is further configured to: and re-downloading each file block, the identification information corresponding to the file block and the first total identification information.
As an optional real-time mode of the invention, the file dividing instruction also comprises identification information and a binding relation between the identification information and the file blocks, so that the server side can bind the file blocks and the identification information corresponding to the file blocks according to the binding relation between the identification information and the file blocks after dividing the file blocks.
As an optional real-time manner of the present invention, each file block is downloaded according to the response information, specifically for:
and respectively downloading a plurality of file blocks by using a plurality of preset service nodes according to the response information until all the file blocks are downloaded.
The functions executed by each component in the file downloading device provided in the embodiment of the present invention are described in detail in any of the above method embodiments, so that a detailed description is omitted here.
By executing the device, in the process of downloading the files, when the file information of at least one file to be downloaded is larger than a preset threshold value, the situation that the file to be downloaded is too large at the moment and possibly downtime occurs is indicated, and aiming at the situation, the client generates a file dividing instruction according to the first file, the corresponding first file information and the preset threshold value, and sends the file dividing instruction to the server, so that the server can divide the first file into a plurality of file blocks according to the file dividing instruction; further, after the indication message of the completion of the division of the first file fed back by the server is obtained, each file block is downloaded respectively, so that the downloading of the first file is completed. Therefore, the risk of downtime in the process of downloading large files and the risk of forced shutdown by the network transit node under the condition of long time and large transmission quantity are avoided.
The embodiment of the invention discloses a file downloading method, which is applied to a server, as shown in fig. 7, and comprises the following steps:
the acquiring instruction module 701 is configured to acquire a file dividing instruction sent by the client, where the file dividing instruction includes first file information and a preset threshold;
the file dividing module 702 is configured to divide the first file into a plurality of file blocks according to the first file information and a preset threshold;
the sending information module 703 is configured to send response information to the client when the first file is divided, where the response information is used to indicate an indication message that the first file is divided.
As an optional real-time mode of the invention, the response information also comprises identification information corresponding to each file block and first total identification information, wherein the identification information is used for representing the divided sequence of the file blocks, and the first total identification information is used for representing the identification information of the first file so that the subsequent client can verify the first file obtained after the file blocks are combined according to the identification information.
As an optional real-time manner of the present invention, when the file dividing instruction further includes identification information and a binding relationship between the identification information and the file blocks, after dividing the first file into a plurality of file blocks according to the file dividing instruction, the apparatus is further configured to:
and binding the file blocks and the identification information corresponding to the file blocks according to the binding relation between the identification information and the file blocks, so that the client combines the file blocks according to the binding relation between the identification information and the file blocks to obtain a first file.
The functions executed by each component in the file downloading device provided in the embodiment of the present invention are described in detail in any of the above method embodiments, so that a detailed description is omitted here.
By executing the device, when a file dividing instruction is acquired in the process of downloading the file, the first file can be divided into a plurality of file blocks according to the file dividing instruction; after the division is finished, response information is timely fed back to the client, so that after the client obtains an indication message fed back by the server and used for finishing the division of the first file, each file block is downloaded respectively, and the downloading of the first file is finished. Therefore, the risk of downtime in the process of downloading large files and the risk of forced shutdown by the network transit node under the condition of long time and large transmission quantity are avoided.
The embodiment of the present invention further provides a computer device, as shown in fig. 8, where the computing end may include a processor 801 and a memory 802, where the processor 801 and the memory 802 may be connected by a bus or other means, and in fig. 8, the connection is exemplified by a bus.
The processor 801 may be a central processing unit (Central Processing Unit, CPU). The processor 801 may also be a chip such as other general purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), field programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or a combination thereof.
The memory 802, as a non-transitory computer readable storage medium, may be used to store non-transitory software programs, non-transitory computer executable programs, and modules, such as program instructions/modules corresponding to the file downloading method in the embodiments of the present invention. The processor 801 executes various functional applications of the processor and data processing, i.e., implements the file download method in the above-described method embodiments, by running non-transitory software programs, instructions, and modules stored in the memory 802.
Memory 802 may include a storage program area that may store an operating system, at least one application program required for functionality, and a storage data area; the storage data area may store data created by the processor 801, or the like. In addition, memory 802 may include high-speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid state storage device. In some embodiments, memory 802 may optionally include memory located remotely from processor 801, which may be connected to processor 801 via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
One or more modules are stored in the memory 802 that, when executed by the processor 801, perform the file download method of the embodiment shown in fig. 1.
The details of the above computer device may be understood correspondingly with respect to the corresponding relevant descriptions and effects in the embodiment shown in fig. 1, which are not repeated here.
It will be appreciated by those skilled in the art that implementing all or part of the above-described embodiment method may be implemented by a computer program to instruct related hardware, and the program may be stored in a computer readable storage medium, and the program may include the above-described embodiment method when executed. The storage medium may be a magnetic Disk, an optical Disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a Flash Memory (Flash Memory), a Hard Disk (HDD), or a Solid State Drive (SSD); the storage medium may also comprise a combination of memories of the kind described above.
The embodiment of the present invention further provides a computer device, as shown in fig. 9, where the computing end may include a processor 901 and a memory 902, where the processor 901 and the memory 902 may be connected by a bus or other means, and in fig. 9, the connection is exemplified by a bus.
The processor 901 may be a central processing unit (Central Processing Unit, CPU). The processor 901 may also be other general purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), field programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or a combination thereof.
The memory 902 is used as a non-transitory computer readable storage medium for storing non-transitory software programs, non-transitory computer executable programs, and modules, such as program instructions/modules corresponding to the file downloading method in the embodiment of the present invention. The processor 901 executes various functional applications of the processor and data processing, i.e., implements the file download method in the above-described method embodiments, by running non-transitory software programs, instructions, and modules stored in the memory 902.
The memory 902 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, at least one application program required for a function; the storage data area may store data created by the processor 901, and the like. In addition, the memory 902 may include high-speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid state storage device. In some embodiments, memory 902 optionally includes memory remotely located relative to processor 901, which may be connected to processor 901 via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
One or more modules are stored in the memory 902 that, when executed by the processor 901, perform the file download method in the embodiment shown in fig. 3.
The details of the above computer device may be understood correspondingly with respect to the relevant descriptions and effects corresponding to the embodiment shown in fig. 3, which are not repeated herein.
It will be appreciated by those skilled in the art that implementing all or part of the above-described embodiment method may be implemented by a computer program to instruct related hardware, and the program may be stored in a computer readable storage medium, and the program may include the above-described embodiment method when executed. The storage medium may be a magnetic Disk, an optical Disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a Flash Memory (Flash Memory), a Hard Disk (HDD), or a Solid State Drive (SSD); the storage medium may also comprise a combination of memories of the kind described above.
Although embodiments of the present invention have been described in connection with the accompanying drawings, various modifications and variations may be made by those skilled in the art without departing from the spirit and scope of the invention, and such modifications and variations are within the scope of the invention as defined by the appended claims.

Claims (12)

1. A method of file download, performed by a client, the method comprising:
when file information of at least one file to be downloaded is larger than a preset threshold in the process of downloading the file, generating a file dividing instruction according to first file information corresponding to a first file and the preset threshold, and sending the file dividing instruction to a server, wherein the file dividing instruction is used for indicating the server to divide the first file into a plurality of file blocks according to the first file information and the preset threshold, and the first file is any one of at least one file to be downloaded;
acquiring response information fed back by the server, wherein the response information comprises indication information of the completion of the division of the first file by the server;
and respectively downloading each file block according to the response information so as to finish downloading all the first files.
2. The method of claim 1, wherein the response information further includes identification information corresponding to each file block, the identification information being used to characterize an order in which the file blocks are divided, and first total identification information being used to characterize the identification information of the first file, the method further comprising:
respectively downloading each file block, identification information corresponding to the file block and first total identification information;
obtaining second total identification information of all the file blocks according to the identification information of each file block;
and when the second total identification information is consistent with the first total identification information, sequentially combining each file block in the order of the identification information to obtain the first file.
3. The method of claim 2, wherein when the second total identification information is inconsistent with the first total identification information, the method further comprises: and re-downloading each file block, the identification information corresponding to the file block and the first total identification information.
4. The method of claim 1, wherein the file dividing instruction further includes identification information and a binding relationship between the identification information and the file block, so that the server end binds the file block and the identification information corresponding to the file block according to the binding relationship between the identification information and the file block after dividing the file block.
5. The method according to claim 1, wherein said downloading each of said file blocks according to said response information comprises:
and respectively downloading a plurality of file blocks by using a plurality of preset service nodes according to the response information until all the file blocks are downloaded.
6. A method for downloading a file, the method being performed by a server, the method comprising:
acquiring a file division instruction sent by a client, wherein the file division instruction comprises first file information and a preset threshold value;
dividing the first file into a plurality of file blocks according to the first file information and the preset threshold value;
and when the first file division is completed, sending response information to the client, wherein the response information is used for indicating an indication message for the completion of the first file division.
7. The method of claim 6, wherein the response information further includes identification information corresponding to each file block and first total identification information, the identification information is used for representing an order in which the file blocks are divided, and the first total identification information is used for representing the identification information of the first file, so that the client can verify the first file obtained after the file blocks are combined according to the identification information.
8. The method of claim 6, wherein when the file division instruction further includes identification information and a binding relationship between the identification information and the file blocks, after the dividing the first file into the plurality of file blocks according to the file division instruction, the method further comprises:
and binding the file block and the identification information corresponding to the file block according to the binding relation between the identification information and the file block, so that the client combines the file block according to the binding relation between the identification information and the file block to obtain the first file.
9. A computer device, comprising:
at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to cause the at least one processor to perform the file downloading method as claimed in any of claims 1-5.
10. A computer readable storage medium having stored thereon a computer program, which when executed by a node implements a file downloading method according to any of claims 1-5.
11. A computer device, comprising: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to cause the at least one processor to perform the file downloading method as claimed in any of claims 6-8.
12. A computer readable storage medium having stored thereon a computer program, which when executed by a node implements a file downloading method according to any of claims 6-8.
CN202211666053.8A 2022-12-23 2022-12-23 File downloading method, computer equipment and storage medium Pending CN116095064A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211666053.8A CN116095064A (en) 2022-12-23 2022-12-23 File downloading method, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211666053.8A CN116095064A (en) 2022-12-23 2022-12-23 File downloading method, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116095064A true CN116095064A (en) 2023-05-09

Family

ID=86212955

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211666053.8A Pending CN116095064A (en) 2022-12-23 2022-12-23 File downloading method, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116095064A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117252655A (en) * 2023-11-20 2023-12-19 畅捷通信息技术股份有限公司 Invoice downloading method, invoice downloading device, computing equipment and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117252655A (en) * 2023-11-20 2023-12-19 畅捷通信息技术股份有限公司 Invoice downloading method, invoice downloading device, computing equipment and storage medium

Similar Documents

Publication Publication Date Title
CN104978253B (en) A kind of method and apparatus of file destination verification
CN112165533B (en) Data checking and transmitting method, device, equipment, system and storage medium
DE102015119896A1 (en) Data integrity technologies of multiple network packet operations
CN116095064A (en) File downloading method, computer equipment and storage medium
CN111459835A (en) Service debugging method and device, electronic equipment and computer readable storage medium
CN113687858A (en) Configuration file checking method and device, electronic equipment and storage medium
CN109995548B (en) Device management method and system, data transmission method and system and terminal device
CN116366629A (en) File uploading and acquiring method, computer equipment and storage medium
CN111698281B (en) Resource downloading method and device, electronic equipment and storage medium
EP2445171A1 (en) File transfer protocol client and implementing method thereof
CN112822248A (en) OTA upgrading method, OTA upgrading device, readable medium and electronic equipment
CN111752789B (en) Pressure testing method, computer device and computer readable storage medium
CN107707672B (en) Method, device and equipment for reconstructing code with balanced load
CN111147597A (en) File transmission method, terminal, electronic device and storage medium
CN110597794A (en) Data processing method and device and electronic equipment
CN106326310B (en) Resource encryption updating method for mobile phone client software
CN112764818B (en) Device management method, device, electronic device and readable storage medium
CN115883533A (en) File synchronization method and device, computer equipment and storage medium
CN112104513B (en) Visual software load method, device, equipment and storage medium
CN113315795B (en) Cloud host mirror synchronization method, device and storage medium
CN111193777B (en) File downloading method and device based on breakpoint continuous transmission and storage medium
CN110928713B (en) Database service fault repairing method, related device and storage medium
EP3346671A1 (en) Service processing method and equipment
CN113326242A (en) Data processing method and device, electronic equipment and computer storage medium
CN111858379A (en) Application testing method and device

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