CN115118711A - File transmission method and device - Google Patents

File transmission method and device Download PDF

Info

Publication number
CN115118711A
CN115118711A CN202210634688.3A CN202210634688A CN115118711A CN 115118711 A CN115118711 A CN 115118711A CN 202210634688 A CN202210634688 A CN 202210634688A CN 115118711 A CN115118711 A CN 115118711A
Authority
CN
China
Prior art keywords
file
target
source
btn
downloading
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
CN202210634688.3A
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.)
Ant Blockchain Technology Shanghai Co Ltd
Original Assignee
Ant Blockchain Technology Shanghai 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 Ant Blockchain Technology Shanghai Co Ltd filed Critical Ant Blockchain Technology Shanghai Co Ltd
Priority to CN202210634688.3A priority Critical patent/CN115118711A/en
Publication of CN115118711A publication Critical patent/CN115118711A/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]

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The present specification discloses a method and an apparatus for file transmission, where a file source address obtained by a first device includes an address of a device that is downloading a target file and an address of a device that is downloading the target file, so that the obtained file source address has high real-time performance, and the first device can effectively obtain the target file.

Description

File transmission method and device
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a method and an apparatus for file transmission.
Background
At present, when a client needs to transmit a file (upload the file or download the file), a file transmission request is usually sent to a server, and then the file is transmitted through the server.
In order to improve the efficiency of file Transmission by the client, a block chain Transmission Network (BTN) Network is usually adopted to perform file Transmission (file uploading or file downloading), but when a BTN is used to perform large file Transmission, much time is required, and the efficiency is low.
Therefore, how to improve the efficiency of the BTN network for large file transmission is an urgent problem to be solved.
Disclosure of Invention
The present specification provides a method and an apparatus for file transmission to improve the efficiency of file transmission.
The technical scheme adopted by the specification is as follows:
the present specification provides a method for file transmission, which is applied to a first device and includes:
the method comprises the steps that a first device sends a request for obtaining a target file to a second device through a block chain transmission network (BTN);
receiving file source addresses of file sources which can provide the target files and are returned by the second device through the BTN, wherein the file sources comprise: the device currently downloading the target file and/or the device which downloaded the target file;
for each file source, sending a downloading request to the file source through the BTN so as to download at least part of file blocks in the target file divided in advance from the file source;
and receiving the file blocks returned by the file sources to obtain the target file.
Optionally, for each file source, sending, by the BTN, a download request to the file source includes:
determining blocking information of the target file according to file metadata acquired from the second device;
and determining the file blocks downloaded from each file source as target blocks for each file source, and sending a downloading request carrying the block information of the target blocks to the file source through the BTN.
Optionally, for each file source, sending, by the BTN, a download request to the file source includes:
and for each file source, determining the file blocks downloaded from the file source as target blocks according to the progress information of downloading the target file from each file source acquired by the second device through the BTN, and sending a downloading request carrying the block information of the target blocks to the file source through the BTN.
Optionally, the method further comprises:
and sending progress information of downloading the target file by the first device to the second device through the BTN, so that the second device returns the progress information of downloading the target file by the first device to other devices when responding to a request of downloading the target file by other devices.
Optionally, the method further comprises:
receiving a downloading request sent by other equipment;
and judging whether to respond to the downloading request sent by other equipment and return the file data according to preset configuration information.
The present specification provides a file transfer method, which is applied to a second device and includes:
the method comprises the steps that a second device receives a request for acquiring a target file, which is sent by a first device through a block chain transmission network (BTN);
according to the request, determining the address of the equipment which is currently downloading the target file and/or the address of the equipment which downloads the target file as a file source address;
determining the address of the equipment which is currently downloading the target file and/or the address of the equipment which downloads the target file as a file source address;
and returning the file source address to the first device through a block chain transmission network (BTN) so that the first device sends a downloading request to each file source through the BTN aiming at the file source to download at least part of the file blocks in the target file divided in advance from the file source, and obtaining the target file after receiving the file blocks returned by each file source.
Optionally, the method further comprises:
receiving a downloading request sent by the first device through the BTN;
and judging whether to return the file blocks corresponding to the downloading request to the first equipment or not according to preset configuration information.
Optionally, the method further comprises:
and when responding to a request of other equipment for downloading the target file, returning the address of the first equipment as a file source address to the other equipment.
Optionally, the method further comprises:
receiving progress information, sent by the first device, of downloading the target file by the first device through the BTN;
and returning the progress information of downloading the target file by the first equipment to other equipment when responding to a request of downloading the target file by other equipment.
This specification provides a file transfer apparatus, including:
the request sending module is used for sending a request for acquiring the target file to the second equipment through the block chain transmission network BTN;
an obtaining module, configured to receive a file source address of each file source that can provide the target file and is returned by the second device through the BTN, where the file source includes: the device currently downloading the target file and/or the device which downloaded the target file;
the control module is used for sending a downloading request to each file source through the BTN so as to download at least part of file blocks in the target file which are divided in advance from the file source;
and the file receiving module is used for receiving the file blocks returned by the file sources to obtain the target file.
Optionally, the control module is configured to determine blocking information of the target file according to file metadata acquired from the second device; and determining the file blocks downloaded from the file source as target blocks aiming at the file source corresponding to each file source address, and sending a downloading request carrying the block information of the target blocks to the file source through the BTN.
This specification provides a file transfer apparatus, including:
the receiving module is used for receiving a request for acquiring a target file, which is sent by first equipment through a block chain transmission network (BTN);
an address obtaining module, configured to determine, according to the request, an address of a device that is currently downloading the target file and/or an address of a device that downloaded the target file as a file source address;
and the sending module is used for returning the file source address to the first equipment through a block chain transmission network (BTN) so that the first equipment sends a downloading request to each file source through the BTN aiming at the file source so as to download at least part of the file blocks in the target file divided in advance from the file source, and the target file is obtained after the file blocks returned by the file sources are received.
Optionally, the apparatus further comprises: a request response module;
the request response module is used for receiving a downloading request sent by the first device through the BTN; and judging whether to return the file blocks corresponding to the downloading request to the first equipment or not according to preset configuration information.
The present specification provides a computer-readable storage medium storing a computer program which, when executed by a processor, implements the above-described method of file transfer.
The present specification provides an electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the file transfer method when executing the program.
The technical scheme adopted by the specification can achieve the following beneficial effects:
in the file transfer method provided in this specification, a first device sends a request for obtaining a target file to a second device through a block chain transmission network BTN, and receives a file source address of each file source capable of providing the target file, which is returned by the second device through the BTN, where the file source includes: the device currently downloading the target file and/or the device downloading the target file further sends a downloading request to each file source through the BTN so as to download at least part of file blocks in the target file divided in advance from the file source, and receives the file blocks returned by each file source to obtain the target file.
According to the method, the file source address acquired by the first device comprises the address of the device downloading the target file and the address of the device downloading the target file, so that the acquired file source address has high real-time performance, the first device can effectively acquire the target file, and the efficiency of the first device in large file transmission through a BTN (Business to network) network can be improved as the first device concurrently acquires each file block of the target file from a plurality of file sources.
Drawings
The accompanying drawings, which are included to provide a further understanding of the specification and are incorporated in and constitute a part of this specification, illustrate embodiments of the specification and together with the description serve to explain the specification and not to limit the specification in a non-limiting sense. On the attached sheet
In the figure:
FIG. 1 is a schematic flow chart of a method for file transfer provided in the present specification;
fig. 2 is a schematic diagram of a process of downloading a target file by a first device provided in this specification;
FIG. 3 is a schematic flow chart diagram of another method of file transfer provided herein;
FIG. 4 is a schematic diagram of a document transfer apparatus provided herein;
FIG. 5 is a schematic view of another document transfer apparatus provided herein;
fig. 6 is a schematic diagram of an electronic device corresponding to fig. 1 provided in the present specification.
Detailed Description
In order to make the objects, technical solutions and advantages of the present disclosure more clear, the technical solutions of the present disclosure will be clearly and completely described below with reference to the specific embodiments of the present disclosure and the accompanying drawings. It is to be understood that the embodiments described are only a few embodiments of the present disclosure, and not all embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments in the present specification without any creative effort belong to the protection scope of the present specification.
The technical solutions provided by the embodiments of the present description are described in detail below with reference to the accompanying drawings.
Fig. 1 is a schematic flowchart of a file transmission method provided in this specification, including the following steps:
s100: the first device sends a request for acquiring the target file to the second device through the block chain transmission network BTN.
S102: receiving file source addresses of file sources which can provide the target files and are returned by the second device through the BTN, wherein the file sources comprise: a device that is currently downloading the target file, and/or a device that downloaded the target file.
In this specification, the first device may obtain the target file according to actual requirements, where the first device and the second device may refer to devices such as: the target file may be a file that needs to be downloaded by the first device, for example: when a user wants to download a video for viewing on a computer, the file in the MP4 format corresponding to the video is the target file.
Specifically, the first device may send a request for obtaining a target file to the second device through a block chain Transmission Network (BTN) Network, so that the second device obtains a source address of each file after receiving the request for obtaining the target file forwarded by the BTN, and returns the source address of each file to the first device through the BTN, so that the first device may perform file Transmission according to the source address of the file, and in the above, the first device and the second device may be devices set at two nodes in the BTN Network. The file source address mentioned herein may refer to a MAC address of the file source, an IP address of the file source, and the like, and the file source address may be used to identify the file source.
In the above, the BTN network is a dedicated data transmission network, and the network is composed of nodes with higher computational power, higher reliability and higher stability, and is specially used for data transmission of a block chain to ensure security and integrity during data transmission, and since file information of a target file is stored in devices arranged at a plurality of nodes in the BTN network, even if data related to the target file in a device arranged at any one node is tampered, security of file transmission is not affected.
Further, in practical applications, in order to ensure real-time performance of the file source, the second device may update the file source addresses when a device currently downloading the target file appears and a device downloading the target file appears, and send the updated file source addresses to the first device, so that the first device can execute subsequent tasks according to the updated file source addresses.
In this specification, the second device may add the obtained source address of each file to file metadata corresponding to the target file, so that the file metadata of the target file may be returned to the first device, where the file metadata is data used to describe characteristics of the target file, for example: the access right of the target file, the size of the content occupied by the target file, and the like.
After receiving the file metadata of the target file returned by the second device, the first device may analyze the file metadata, thereby obtaining the source address of each file, and data such as the access authority of the target file in the content, the size of the content occupied by the target file, and the like.
In addition, in this specification, after obtaining file metadata returned by the second device, the first device may determine whether a file size of a target file to be obtained exceeds a preset size, and if so, may obtain a source address of each file from the second device. That is, if the target file is too large, the acquisition speed of the target file can be increased by acquiring the file blocks in parallel.
S104: and sending a downloading request to each file source through the BTN so as to download at least part of the file blocks in the target file which are divided in advance from the file source.
S106: and receiving the file blocks returned by each file source to obtain the target file.
After receiving the file source address returned by the second device, the first device may send, to each file source, a download request for downloading, from the file source, a part of the file chunks in the target file divided in advance, through the BTN.
Specifically, after receiving a file source address returned by the second device, the first device may obtain file metadata of the target file, and may further determine blocking information of the target file according to the file metadata. And then determining the file blocks downloaded from the file source as target blocks for each file source, and sending a downloading request carrying block information of the target blocks to the file source through the BTN, wherein the file sources can be a device currently downloading the target file and a device downloading the target file, the second device can add the file source address to the file metadata of the target file and send the file source address to the first device together, or the second device can send the file metadata to the first device separately after receiving the file source address.
There may be many methods for dividing the target file into several file blocks in advance, for example: according to the size information of the target file in the file metadata, the target file is divided into a plurality of blocks, the size information of each block is determined, and then the file blocks downloaded from each file source are determined aiming at each file source.
Further, the file source address includes an address of a device currently downloading the target file, and the device currently downloading the target file only includes a part of file blocks of the target file, so that the first device may determine, for a file source corresponding to each file source address, a file block downloaded from the file source as a target block according to progress information of downloading the target file from each file source acquired by the second device, and send a download request carrying block information of the target block to the file source, where the progress information may be used to indicate a data range of the downloaded target file in the file source, and the progress information may enable the first device to determine which file blocks need to be acquired from different file sources.
For example: assuming that the size of the target file is 10M, if the progress information returned by the file source 1 is 0-10M, it is described that all target files are downloaded in the file source 1, the first device may acquire the file partition of any one target file from the file source 1, and if the progress information returned by the file source 2 is 2-4M, it is described that only the data in the 2M to 4M of the target file is in the file source 2, so that the first device may only determine the file partition of which the data range in the target file is from the 2M to the 4M as the file partition that needs to be acquired from the file source 2.
In the above content, after acquiring the progress information of the download target file of each file source, the second device may add the progress information to the file metadata and return the file metadata to the first device, or may separately send the progress information of the download target file of each file source to the first device.
Further, the first device may receive the file chunks returned by each file source in response to the download request carrying the chunk information of the target chunk, thereby obtaining the target file.
It should be noted that each file source may determine whether to return file data in response to a received download request according to preset configuration information, where the configuration information is determined according to the performance of the device corresponding to the file source and the task volume currently executed by the device, and if the performance of the device corresponding to the file source is better and a greater task volume is not executed, the configuration information of the device may be modified into a transferable file, and otherwise, the device is configured as an untransmittable file.
As can be seen from the above, the download request carrying the chunk information of the target chunk sent by the first device is not necessarily responded, so that, when the download request corresponding to any one target chunk is not responded, the first device may re-determine the file source corresponding to the target chunk, and send the download request carrying the chunk information of the target chunk to the file source until the target file is downloaded completely.
After the first device receives the file data returned by each file source, the progress information of downloading the target file can be sent to the second device, so that the second device adds the address of the first device to the file metadata of the target file, and the first device is used as a file source.
In this way, when the first device receives a download request sent by another device, it may determine whether to respond to the download request sent by the other device and return the file data according to configuration information preset in the first device.
In this specification, after the first device obtains the file chunks returned by each file source, the file chunks may be combined to obtain a complete file, and in addition, after the first device receives all the file chunks, the first device needs to perform integrity check on the received file to ensure that the received file is a complete file.
Specifically, the first device may select a part of the divided file blocks as designated file blocks, determine check information corresponding to each designated file block through a preset encryption Algorithm (e.g., Message-Digest Algorithm, MD5), acquire, for each designated file block, check information of the designated file block stored in each file source from each file source after receiving all the file blocks included in the target file, and compare the acquired check information of the designated file block stored in each file source and the check information of the designated file block determined by the first device to obtain an integrity check result.
In the above, since the first device obtains the file blocks through the BTN network, the first device can effectively determine the integrity of the target file only according to part of the file blocks.
To further explain the above, the following describes the flow of file transmission performed by the first device in detail with reference to fig. 2.
Fig. 2 is a schematic diagram of a process of downloading an object file by a first device provided in this specification.
As can be seen from fig. 2, the first device may send a request for obtaining the target file according to an actual requirement, and forward the request to the second device through the BTN network, so that the second device obtains the file metadata in response to the request for obtaining the target file, and obtains each file source address corresponding to the target file, and further adds each file source address to the file source data, and returns the file source data to the first device through the BTN network.
The first device analyzes the acquired file metadata to obtain file source addresses, divides a target file into a plurality of file sub-blocks according to the file metadata, determines the file sub-blocks required to be acquired from the file source as the target sub-blocks for each file source, further sends a downloading request carrying the sub-block information of the target sub-blocks to the file source, and sends the downloading request to each file source through BTN (Business to Business technology) so that each file source judges whether to return the file sub-blocks corresponding to the sub-block information contained in the downloading request or not according to the configuration information of the file source after receiving the downloading request.
The method comprises the steps that after receiving each file block returned by each file source, the first device can return progress information of downloading a target file to the second device through the BTN, so that the second device can add an address of the first device to file metadata of the target file, furthermore, after receiving the file block, the first device judges whether all the file blocks are received, if yes, part of the file blocks are selected, whether the received target file is a complete target file is judged according to the file blocks, if yes, downloading is finished, and meanwhile, the first device can determine whether the target device serves as the file source to provide file sharing service for other devices according to preset configuration information.
And if judging that all the file blocks are not received, re-determining the file source according to the block information of the file blocks which are not received, and sending a downloading request carrying the block information of the file blocks to a new file source.
As can be seen from the above, the file source address obtained by the first device includes the address of the device that is downloading the target file and also includes the address of the device that downloads the target file, so that the obtained file source address has higher real-time performance, and the first device can effectively obtain the target file.
In practical applications, the above-mentioned method for file transmission may be used not only for downloading a file by a first device, but also for responding to a request sent by another device for obtaining a target file by a second device, and the following describes in detail a method for responding to a request sent by a first device for obtaining a target file, as shown in fig. 3.
Fig. 3 is a schematic flow chart of another file transmission method provided in this specification, including the following steps:
s300: the second device receives a request for acquiring the target file sent by the first device through the block chain transmission network BTN.
S302: and according to the request, determining the address of the equipment which is downloading the target file currently and/or the address of the equipment which downloads the target file as a file source address.
S304: and returning the file source address to the first device through a block chain transmission network (BTN) so that the first device sends a downloading request to each file source through the BTN aiming at the file source to download at least part of the file blocks in the target file divided in advance from the file source, and obtaining the target file after receiving the file blocks returned by each file source.
In this specification, the second device may, after receiving a request for obtaining a target file sent by the first device through the BTN, or after detecting that a current file source address is updated, obtain, according to the request for obtaining the target file, an address of a device that is currently downloading the target file and an address of a device that has downloaded the target file as file source addresses, and return the file source addresses to the first device through the BTN, so that the first device sends, for a file source corresponding to each file source address, a download request to the file source through the BTN, so as to download at least part of file blocks in a target file that are previously obtained from the file source, and obtain the target file after receiving all file blocks returned by each file source.
In the process of acquiring the target file, the first device may also serve as a file source to provide at least part of the file blocks of the target file to the first device, so that the second device may also receive a download request carrying block information of the target block sent by the first device, and determine whether to respond to the download request according to preset configuration information, and return file data.
In this specification, the second device may further receive progress information of downloading the target file, which is sent by the first device through the BTN network, by the first device, and further add the address of the first device to the file metadata of the target file, so that the first device serves as a file source, and responds to a download request carrying the chunk information of the file chunk, which is sent by another device.
The file transmission method and the file transmission device have the advantages that the second device can not only provide the file source address for the first device, but also serve as the file source to return the file data of the target file for the first device, and accordingly file transmission efficiency is improved.
Based on the same idea, the present specification also provides a corresponding file transmission apparatus, as shown in fig. 4 and fig. 5.
Fig. 4 is a schematic diagram of a file transfer apparatus provided in this specification, including:
a request sending module 401, configured to send a request for obtaining a target file to a second device through a block chain transmission network BTN;
an obtaining module 402, configured to receive a file source address of each file source that can provide the target file and is returned by the second device through the BTN, where the file source includes: the device currently downloading the target file, and/or the device which downloaded the target file;
a control module 403, configured to send, for each file source, a download request to the file source through the BTN, so as to download at least part of the file chunks in the target file that are divided in advance from the file source;
a file receiving module 404, configured to receive the file chunks returned by the file sources, to obtain the target file.
Optionally, the control module 403 is specifically configured to determine blocking information of the target file according to file metadata acquired from the second device; and determining the file blocks downloaded from each file source as target blocks for each file source, and sending a downloading request carrying the block information of the target blocks to the file source through the BTN.
Optionally, the control module 403 is specifically configured to, for each file source, determine, according to the progress information of downloading the target file from each file source acquired by the second device through the BTN, a file partition downloaded from the file source as a target partition, and send a download request carrying the partition information of the target partition to the file source through the BTN.
Optionally, the file receiving module 404 is specifically configured to send, to the second device through the BTN, progress information of downloading the target file by the first device, so that when the second device responds to a request of downloading the target file by another device, the progress information of downloading the target file by the first device is returned to the another device.
Optionally, the apparatus further comprises: a response module 405;
the response module 405 is specifically configured to receive a download request sent by another device; and judging whether to respond to the downloading request sent by other equipment and return the file data according to preset configuration information.
Fig. 5 is a schematic diagram of another file transfer apparatus provided in the present specification, including:
a receiving module 501, configured to receive a request for obtaining a target file, where the request is sent by a first device through a block chain transmission network BTN;
an address obtaining module 502, configured to determine, according to the request, an address of a device that is currently downloading the target file and/or an address of a device that has downloaded the target file as a file source address;
a sending module 503, configured to return the file source address to the first device through a block chain transmission network BTN, so that the first device sends a download request to each file source through the BTN, so as to download at least part of the file blocks in the target file that are pre-partitioned from the file source, and obtain the target file after receiving the file blocks returned by each file source.
Optionally, the apparatus further comprises: request response module 504
The request response module 504 is specifically configured to receive, through the BTN, a download request sent by the first device;
and judging whether to return the file blocks corresponding to the downloading request to the first equipment or not according to preset configuration information.
Optionally, the request response module 504 is specifically configured to, when responding to a request of another device to download the target file, return the address of the first device as a file source address to the other device.
Optionally, the request response module 504 is specifically configured to receive, through the BTN, progress information of downloading the target file by the first device, where the progress information is sent by the first device; and returning the progress information of downloading the target file by the first equipment to other equipment when responding to a request of downloading the target file by other equipment.
The present specification also provides a computer-readable storage medium storing a computer program, which can be used to execute a method of file transfer provided in fig. 1.
This specification also provides a schematic block diagram of an electronic device corresponding to that of figure 1, shown in figure 6. As shown in fig. 6, at the hardware level, the electronic device includes a processor, an internal bus, a network interface, a memory, and a non-volatile memory, but may also include hardware required for other services. The processor reads a corresponding computer program from the non-volatile memory into the memory and then runs the computer program to implement the file transfer method of fig. 1. Of course, besides the software implementation, the present specification does not exclude other implementations, such as logic devices or a combination of software and hardware, and the like, that is, the execution subject of the following processing flow is not limited to each logic unit, and may be hardware or logic devices.
In the 90 s of the 20 th century, improvements in a technology could clearly distinguish between improvements in hardware (e.g., improvements in circuit structures such as diodes, transistors, switches, etc.) and improvements in software (improvements in process flow). However, as technology advances, many of today's process flow improvements have been seen as direct improvements in hardware circuit architecture. Designers almost always obtain a corresponding hardware circuit structure by programming an improved method flow into the hardware circuit. Thus, it cannot be said that an improvement in the process flow cannot be realized by hardware physical modules. For example, a Programmable Logic Device (PLD), such as a Field Programmable Gate Array (FPGA), is an integrated circuit whose Logic functions are determined by programming the Device by a user. A digital system is "integrated" on a PLD by the designer's own programming without requiring the chip manufacturer to design and fabricate application-specific integrated circuit chips. Furthermore, nowadays, instead of manually making an Integrated Circuit chip, such Programming is often implemented by "logic compiler" software, which is similar to a software compiler used in program development and writing, but the original code before compiling is also written by a specific Programming Language, which is called Hardware Description Language (HDL), and HDL is not only one but many, such as abel (advanced Boolean Expression Language), ahdl (alternate Hardware Description Language), traffic, pl (core universal Programming Language), HDCal (jhdware Description Language), lang, Lola, HDL, laspam, hardward Description Language (vhr Description Language), vhal (Hardware Description Language), and vhigh-Language, which are currently used in most common. It will also be apparent to those skilled in the art that hardware circuitry that implements the logical method flows can be readily obtained by merely slightly programming the method flows into an integrated circuit using the hardware description languages described above.
The controller may be implemented in any suitable manner, for example, the controller may take the form of, for example, a microprocessor or processor and a computer readable medium that stores computer readable program code (e.g., software or firmware) executable by the (micro) processor, logic gates, switches, an Application Specific Integrated Circuit (ASIC), a programmable logic controller, and embedded microcontrollers, examples of which include, but are not limited to, the following microcontrollers: the ARC625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320, the memory controller may also be implemented as part of the control logic for the memory. Those skilled in the art will also appreciate that, in addition to implementing the controller as pure computer readable program code, the same functionality can be implemented by logically programming method steps such that the controller is in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, embedded microcontrollers and the like. Such a controller may thus be considered a hardware component, and the means included therein for performing the various functions may also be considered as a structure within the hardware component. Or even means for performing the functions may be regarded as being both a software module for performing the method and a structure within a hardware component.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. One typical implementation device is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
For convenience of description, the above devices are described as being divided into various units by function, and are described separately. Of course, the functions of the various elements may be implemented in the same one or more software and/or hardware implementations of the present description.
As will be appreciated by one skilled in the art, embodiments of the present description may be provided as a method, system, or computer program product. Accordingly, the description may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the description may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The description has been presented with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the description. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in the process, method, article, or apparatus that comprises the element.
As will be appreciated by one skilled in the art, embodiments of the present description may be provided as a method, system, or computer program product. Accordingly, the description may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the description may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
This description may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The above description is only an example of the present specification, and is not intended to limit the present specification. Various modifications and alterations to this description will become apparent to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present specification should be included in the scope of the claims of the present specification.

Claims (15)

1. A method for file transmission, which is applied to a first device, comprises the following steps:
the method comprises the steps that a first device sends a request for obtaining a target file to a second device through a block chain transmission network (BTN);
receiving file source addresses of file sources which can provide the target files and are returned by the second device through the BTN, wherein the file sources comprise: the device currently downloading the target file and/or the device which downloaded the target file;
for each file source, sending a downloading request to the file source through the BTN so as to download at least part of file blocks in the target file divided in advance from the file source;
and receiving the file blocks returned by the file sources to obtain the target file.
2. The method of claim 1, sending, for each file source, a download request to the file source through the BTN, comprising:
determining blocking information of the target file according to file metadata acquired from the second device;
and determining the file blocks downloaded from the file source as target blocks for each file source, and sending a downloading request carrying the block information of the target blocks to the file source through the BTN.
3. The method of claim 1 or 2, sending, for each file source, a download request to the file source over the BTN, comprising:
and for each file source, determining the file blocks downloaded from the file source as target blocks according to the progress information of downloading the target file from each file source acquired by the second device through the BTN, and sending a downloading request carrying the block information of the target blocks to the file source through the BTN.
4. The method of claim 3, further comprising:
and sending progress information of downloading the target file by the first device to the second device through the BTN, so that the second device returns the progress information of downloading the target file by the first device to other devices when responding to a request of downloading the target file by other devices.
5. The method of claim 1, further comprising:
receiving a downloading request sent by other equipment;
and judging whether to respond to the downloading requests sent by other equipment and return the file data according to preset configuration information.
6. A method for file transmission, which is applied to a second device, comprises the following steps:
the method comprises the steps that a second device receives a request for acquiring a target file, which is sent by a first device through a block chain transmission network (BTN);
according to the request, determining the address of the equipment which is currently downloading the target file and/or the address of the equipment which downloads the target file as a file source address;
and returning the file source address to the first device through a block chain transmission network (BTN) so that the first device sends a downloading request to each file source through the BTN aiming at the file source to download at least part of the file blocks in the target file divided in advance from the file source, and obtaining the target file after receiving the file blocks returned by each file source.
7. The method of claim 6, further comprising:
receiving a downloading request sent by the first device through the BTN;
and judging whether to return the file blocks corresponding to the downloading request to the first equipment or not according to preset configuration information.
8. The method of claim 6, further comprising:
and when responding to a request of other equipment for downloading the target file, returning the address of the first equipment as a file source address to the other equipment.
9. The method of claim 6, further comprising:
receiving progress information, sent by the first device, of downloading the target file by the first device through the BTN;
and returning the progress information of downloading the target file by the first equipment to other equipment when responding to a request of downloading the target file by other equipment.
10. An apparatus for file transfer, comprising:
the request sending module is used for sending a request for acquiring the target file to the second equipment through the block chain transmission network BTN;
an obtaining module, configured to receive a file source address of each file source that can provide the target file and is returned by the second device through the BTN, where the file source includes: the device currently downloading the target file, and/or the device which downloaded the target file;
the control module is used for sending a downloading request to each file source through the BTN so as to download at least part of file blocks in the target file which are divided in advance from the file source;
and the file receiving module is used for receiving the file blocks returned by the file sources to obtain the target file.
11. The apparatus according to claim 10, wherein the control module is configured to determine blocking information of the target file according to file metadata acquired from the second device; and determining the file blocks downloaded from the file source as target blocks aiming at the file source corresponding to each file source address, and sending a downloading request carrying the block information of the target blocks to the file source through the BTN.
12. An apparatus for file transfer, comprising:
the receiving module is used for receiving a request for acquiring a target file, which is sent by first equipment through a block chain transmission network (BTN);
an address obtaining module, configured to determine, according to the request, an address of a device that is currently downloading the target file and/or an address of a device that downloaded the target file as a file source address;
and the sending module is used for returning the file source address to the first equipment through a block chain transmission network (BTN) so that the first equipment sends a downloading request to each file source through the BTN aiming at the file source to download at least part of the file blocks in the target file which are divided in advance from the file source, and the target file is obtained after the file blocks returned by the file sources are received.
13. The apparatus of claim 12, further comprising: a request response module;
the request response module is used for receiving a downloading request sent by the first device through the BTN; and judging whether to return the file blocks corresponding to the downloading request to the first equipment or not according to preset configuration information.
14. A computer-readable storage medium, storing a computer program which, when executed by a processor, implements the method of any of claims 1 to 9.
15. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the method of any of claims 1 to 9 when executing the program.
CN202210634688.3A 2022-06-06 2022-06-06 File transmission method and device Pending CN115118711A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210634688.3A CN115118711A (en) 2022-06-06 2022-06-06 File transmission method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210634688.3A CN115118711A (en) 2022-06-06 2022-06-06 File transmission method and device

Publications (1)

Publication Number Publication Date
CN115118711A true CN115118711A (en) 2022-09-27

Family

ID=83327288

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210634688.3A Pending CN115118711A (en) 2022-06-06 2022-06-06 File transmission method and device

Country Status (1)

Country Link
CN (1) CN115118711A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109347968A (en) * 2018-11-07 2019-02-15 网宿科技股份有限公司 A kind of method, apparatus and system of data block that downloading resource file
CN110298194A (en) * 2019-06-11 2019-10-01 阿里巴巴集团控股有限公司 Document handling method, device, equipment and storage medium based on block chain
CN112131227A (en) * 2020-09-29 2020-12-25 深圳前海微众银行股份有限公司 Data query method and device based on alliance chain
CN113726873A (en) * 2021-08-27 2021-11-30 平安科技(深圳)有限公司 Block chain-based file processing method, system, device and storage medium
CN114465998A (en) * 2021-12-14 2022-05-10 深圳市优必选科技股份有限公司 Multi-device file transmission method and device, terminal device and readable storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109347968A (en) * 2018-11-07 2019-02-15 网宿科技股份有限公司 A kind of method, apparatus and system of data block that downloading resource file
CN110298194A (en) * 2019-06-11 2019-10-01 阿里巴巴集团控股有限公司 Document handling method, device, equipment and storage medium based on block chain
CN112131227A (en) * 2020-09-29 2020-12-25 深圳前海微众银行股份有限公司 Data query method and device based on alliance chain
CN113726873A (en) * 2021-08-27 2021-11-30 平安科技(深圳)有限公司 Block chain-based file processing method, system, device and storage medium
CN114465998A (en) * 2021-12-14 2022-05-10 深圳市优必选科技股份有限公司 Multi-device file transmission method and device, terminal device and readable storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
周曙东: "《电子商务概论》", 31 August 2008, 东南大学出版社, pages: 59 *

Similar Documents

Publication Publication Date Title
CN113766035B (en) Service acceptance and consensus method and device
CN108712454B (en) File processing method, device and equipment
CN110298194B (en) File processing method, device, equipment and storage medium based on block chain
CN108628688B (en) Message processing method, device and equipment
CN105573734B (en) method and equipment for providing SDK file
CN111385316B (en) Resource refreshing method, access method and device
CN107479868B (en) Interface loading method, device and equipment
CN109284066B (en) Data processing method, device, equipment and system
CN105786539B (en) File downloading method and device
CN111241040B (en) Information acquisition method and device, electronic equipment and computer storage medium
CN111694639B (en) Updating method and device of process container address and electronic equipment
CN111355672A (en) Message forwarding method and device
CN115617799A (en) Data storage method, device, equipment and storage medium
CN116405554A (en) Network communication method and device, storage medium and electronic equipment
CN111078127B (en) Data migration method, system and device
CN115129728A (en) File checking method and device
CN107402749B (en) Method and device for realizing picture loading library
CN115118711A (en) File transmission method and device
CN115174553A (en) File transmission method and device
CN114625410A (en) Request message processing method, device and equipment
CN110968888B (en) Data processing method and device
CN111796864A (en) Data verification method and device
CN110659105A (en) Virtualized resource processing method, device, equipment and storage medium
CN110659372A (en) Picture input and access method, device and equipment
CN108428189B (en) Social resource processing method and device and readable 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