File transmission method and device, electronic equipment and storage medium
By using ICE connection, QUIC and HTTP protocols in the CDN system to establish transmission connections between devices at the same level, distributed file distribution is realized, which solves the problems of high download traffic costs and network congestion in the CDN distribution system, and improves transmission efficiency and user experience.
Patent Information
- Application Number
- CN202510854782.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-25
- Publication Date
- 2025-07-22
AI Technical Summary
In the existing CDN distribution system, there are problems such as high traffic costs and network congestion when downloading files, which affects the user experience.
By establishing a transmission connection between the first processing device and the second processing device of the same entity in the network, file transmission is performed using ICE connection, QUIC and HTTP protocols, dependence on centralized storage devices is reduced, and distributed file distribution is realized.
Reduces download traffic costs, reduces bandwidth congestion, and improves file transfer efficiency and user experience.
Smart Images

Figure CN120358233A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and particularly to a file transmission method, apparatus, electronic device, and storage medium. Background Art
[0002] A Content Delivery Network (CDN) distributes files in a centralized manner. The CDN distribution system distributes files from a file storage center to target devices. The file storage center usually can use a commercial file storage center. Using a commercial file storage center usually provides a paid download service. Therefore, users of traditional CDN distribution systems need to pay traffic fees for each file copy download. At the same time, network congestion is likely to occur when the download load is too large, affecting the user experience.
[0003] Therefore, how to reduce the download traffic cost and improve the download speed is an urgent problem to be solved. Summary of the Invention
[0004] Embodiments of the present disclosure provide a file transmission method, apparatus, electronic device, and storage medium.
[0005] According to a first aspect of the embodiments of the present disclosure, a file transmission method is provided. The method is executed by a scheduling device, and the file transmission method includes:
[0006] Receiving file request information sent by a first processing device, where the file request information is used to indicate a first file requested by the first processing device;
[0007] In response to the file save list recording a second processing device storing the first file, sending interaction instructions to the first processing device and the second processing device respectively to establish a transmission connection between the first processing device and the second processing device, where the transmission connection is used for the first processing device to obtain the first file from the second processing device, and the first processing device and the second processing device are peer entities in the network.
[0008] In some embodiments, the step of, in response to the file save list recording a second processing device storing the first file, sending interaction instructions to the first processing device and the second processing device respectively, includes:
[0009] In response to the file save list recording N second processing devices storing the first file, based on the device status information respectively corresponding to the N second processing devices, determining a second processing device to establish a transmission connection with the first processing device from the N second processing devices, where N is an integer greater than or equal to 2;
[0010] Send interaction instructions to the first processing device and a second processing device determined from the N second processing devices respectively.
[0011] In some embodiments, the first file is indicated by the hash value of the first file.
[0012] In some embodiments, the sending interaction instructions to the first processing device and the second processing device respectively includes:
[0013] Send a first interaction instruction for establishing the transmission connection to the first processing device, where the first interaction instruction is at least used to indicate the first file received by the first processing device from the second processing device;
[0014] Send a second interaction instruction for establishing the transmission connection to the second processing device, where the second interaction instruction is at least used to indicate the first file sent by the second processing device to the second processing device.
[0015] In some embodiments, the transmission connection includes:
[0016] An Interactive Connectivity Establishment (ICE) connection between the first processing device and the second processing device;
[0017] A Quick UDP Internet Connections (QUIC) network connection between the first processing device and the second processing device established based on the ICE connection;
[0018] A Hypertext Transfer Protocol (HTTP) connection between the first processing device and the second processing device established based on the QUIC.
[0019] In some embodiments, the method further includes:
[0020] In response to the second processing device storing the first file not being recorded in the file save list, send a scheduling instruction to instruct the first processing device to obtain the first file from the storage device associated with the scheduling device.
[0021] In some embodiments, the method further includes at least one of the following:
[0022] Receive the first update information sent by the first processing device, and update the file storage list based on the first update information, where the first update information is used to indicate a second file stored by the first processing device;
[0023] Receive the second update information sent by the second processing device, and update the file storage list based on the second update information, where the second update information is used to indicate a third file stored by the second processing device;
[0024] Receive a fourth file sent by the service system, store the fourth file in the storage device associated with the scheduling device, and update the file storage list to record the storage location of the fourth file in the storage device.
[0025] According to a second aspect of the embodiments of the present disclosure, there is provided a file transmission method, which is executed by a first processing device. The file transmission method includes:
[0026] Send file request information to the scheduling device, where the file request information is used to indicate a first file requested by the first processing device;
[0027] Receive an interaction instruction sent by the scheduling device, where the interaction instruction is sent by the scheduling device in response to the file storage list recording a second processing device storing the first file; the first processing device and the second processing device are peer entities in the network;
[0028] Based on the interaction instruction, establish a transmission connection between the first processing device and the second processing device;
[0029] Obtain the first file from the second processing device through the transmission connection.
[0030] In some embodiments, in response to the file storage list recording N second processing devices storing the first file, the second processing device that establishes a transmission with the first processing device is determined by the scheduling device from the N second processing devices based on the device status information respectively corresponding to the N second processing devices, where N is an integer greater than or equal to 2.
[0031] In some embodiments, the first file is indicated by the hash value of the first file.
[0032] In some embodiments, the receiving the interaction instruction sent by the scheduling device includes:
[0033] Receive a first interaction instruction for establishing the transmission connection sent by the scheduling device, where the first interaction instruction is at least used to indicate the first file received by the first processing device from the second processing device.
[0034] In some embodiments, establishing the transmission connection between the first processing device and the second processing device includes:
[0035] Establishing an ICE connection between the first processing device and the second processing device;
[0036] Based on the ICE connection, establishing a Quick UDP Internet Connection (QUIC) between the first processing device and the second processing device;
[0037] Based on the QUIC, establishing a Hypertext Transfer Protocol (HTTP) connection between the first processing device and the second processing device.
[0038] In some embodiments, the method further includes:
[0039] Receiving a scheduling instruction, and obtaining the first file from the storage device associated with the scheduling device based on the scheduling instruction, where the scheduling instruction is sent by the second processing device storing the first file and determined by the scheduling device that the file save list does not record.
[0040] In some embodiments, the method further includes:
[0041] Sending first update information to the scheduling device, where the first update information is used to indicate the second file stored in the first processing device; the first update information is used for the scheduling device to update the file save list.
[0042] According to a third aspect of the embodiments of the present disclosure, there is provided a file transmission method, which is executed by a second processing device, and the method includes:
[0043] Receiving an interaction instruction sent by a scheduling device, where the interaction instruction is sent by the scheduling device in response to receiving file request information sent by a first processing device, and the file save list records the second processing device storing the first file; where the file request information is used to indicate the first file requested by the first processing device; the first processing device and the second processing device are peer entities in the network;
[0044] Based on the interaction instruction, establishing a transmission connection between the first processing device and the second processing device;
[0045] Sending the first file to the first processing device through the transmission connection.
[0046] In some embodiments, the first file is indicated by the hash value of the first file.
[0047] In some embodiments, receiving the interaction instruction sent by the scheduling device includes:
[0048] Receiving a second interaction instruction sent by the scheduling device for establishing the transmission connection, where the second interaction instruction is at least used to indicate a first file sent by the second processing device to the second processing device.
[0049] In some embodiments, establishing the transmission connection between the first processing device and the second processing device includes:
[0050] Establishing an ICE connection between the first processing device and the second processing device;
[0051] Based on the ICE connection, establishing a Quick User Space Protocol Internet Connection (QUIC) between the first processing device and the second processing device;
[0052] Based on the QUIC, establishing a Hypertext Transfer Protocol (HTTP) connection between the first processing device and the second processing device.
[0053] In some embodiments, the method further includes:
[0054] Sending second update information to the scheduling device, where the second update information is used to indicate a third file stored by the second processing device; the second update information is used for the scheduling device to update the file storage list.
[0055] According to the fourth aspect of the embodiments of the present disclosure, a file transmission device is provided, and the device includes:
[0056] A transceiver module, configured to receive file request information sent by a first processing device, where the file request information is used to indicate a first file requested by the first processing device;
[0057] The transceiver module is further configured to, in response to the file storage list recording a second processing device storing the first file, send interaction instructions to the first processing device and the second processing device respectively to establish a transmission connection between the first processing device and the second processing device, where the transmission connection is used for the first processing device to obtain the first file from the second processing device, and the first processing device and the second processing device are peer entities in the network.
[0058] In some embodiments, the device further includes:
[0059] A processing module, configured to, in response to the file storage list recording N second processing devices for storing the first file, determine, based on the device status information respectively corresponding to the N second processing devices, a second processing device that establishes a transmission connection with the first processing device, where N is an integer greater than or equal to 2;
[0060] The transceiver module is further configured to send interaction instructions to the first processing device and a second processing device determined from the N second processing devices respectively.
[0061] In some embodiments, the first file is indicated by a hash value of the first file.
[0062] In some embodiments, the transceiver module is further configured to:
[0063] Send a first interaction instruction for establishing the transmission connection to the first processing device, where the first interaction instruction is at least used to indicate the first file received by the first processing device from the second processing device;
[0064] Send a second interaction instruction for establishing the transmission connection to the second processing device, where the second interaction instruction is at least used to indicate the first file sent by the second processing device to the second processing device.
[0065] In some embodiments, the transmission connection includes:
[0066] An ICE connection between the first processing device and the second processing device;
[0067] A Quick User Space Protocol Internet connection (QUIC) between the first processing device and the second processing device established based on the ICE connection;
[0068] A Hypertext Transfer Protocol connection between the first processing device and the second processing device established based on the QUIC.
[0069] In some embodiments, the transceiver module is further configured to, in response to the file storage list not recording a second processing device for storing the first file, send a scheduling instruction to instruct the first processing device to obtain the first file from a storage device associated with the scheduling device.
[0070] In some embodiments, the transceiver module is further configured to receive first update information sent by the first processing device. The device includes a processing module, and the processing module is configured to update the file storage list based on the first update information. The first update information is used to indicate a second file stored by the first processing device; and / or
[0071] The transceiver module is further configured to receive second update information sent by the second processing device, the processing module is configured to update the file storage list based on the second update information, and the second update information is used to indicate a third file stored in the second processing device; and / or
[0072] The transceiver module is further configured to receive a fourth file sent by the service system and store the fourth file in the storage device associated with the scheduling device, and the device processing module is configured to update the file storage list to record the storage location of the fourth file in the storage device.
[0073] According to a fifth aspect of the embodiments of the present disclosure, there is provided a file transmission device, the device includes:
[0074] A transceiver module, configured to send file request information to a scheduling device, where the file request information is used to indicate a first file requested by a first processing device;
[0075] The transceiver module is further configured to receive an interaction instruction sent by the scheduling device, where the interaction instruction is sent by the scheduling device in response to the fact that the file storage list records a second processing device storing the first file; the first processing device and the second processing device are peer entities in the network;
[0076] A processing module, configured to establish a transmission connection between the first processing device and the second processing device based on the interaction instruction;
[0077] The transceiver module is further configured to obtain the first file from the second processing device through the transmission connection.
[0078] In some embodiments, in response to the file storage list recording N second processing devices storing the first file, the second processing device establishing a transmission with the first processing device is determined by the scheduling device from the N second processing devices based on device status information respectively stored in the N second processing devices, where N is an integer greater than or equal to 2.
[0079] In some embodiments, the first file is indicated by a hash value of the first file.
[0080] In some embodiments, the transceiver module is specifically configured to:
[0081] Receive a first interaction instruction for establishing the transmission connection sent by the scheduling device, where the first interaction instruction is at least used to indicate the first file received by the first processing device from the second processing device.
[0082] In some embodiments, the processing module is specifically configured to:
[0083] Establish an ICE connection between the first processing device and the second processing device;
[0084] Based on the ICE connection, establish a Quick User Space Protocol Internet Connection (QUIC) between the first processing device and the second processing device;
[0085] Based on the QUIC, establish a Hypertext Transfer Protocol connection between the first processing device and the second processing device.
[0086] In some embodiments, the transceiver module is further configured to:
[0087] Receive a scheduling instruction, and obtain the first file from the storage device associated with the scheduling device based on the scheduling instruction, where the scheduling instruction is sent by the scheduling device when determining that the file storage list does not record the second processing device storing the first file.
[0088] In some embodiments, the transceiver module is further configured to:
[0089] Send first update information to the scheduling device, where the first update information is used to indicate the second file stored in the first processing device; the first update information is used for the scheduling device to update the file storage list.
[0090] According to a sixth aspect of the embodiments of the present disclosure, there is provided a file transfer device, the device includes:
[0091] A transceiver module, configured to receive an interaction instruction sent by a scheduling device, where the interaction instruction is sent by the scheduling device in response to receiving file request information sent by a first processing device, and the file storage list records the second processing device storing the first file; where the file request information is used to indicate the first file requested by the first processing device; the first processing device and the second processing device are peer entities in the network;
[0092] A processing module, configured to establish a transmission connection between the first processing device and the second processing device based on the interaction instruction;
[0093] The transceiver module is further configured to send the first file to the first processing device through the transmission connection.
[0094] In some embodiments, the first file is indicated by the hash value of the first file.
[0095] In some embodiments, the transceiver module is further configured to:
[0096] Receive a second interaction instruction sent by the scheduling device for establishing the transmission connection, where the second interaction instruction is at least used to indicate a first file sent by the second processing device to the second processing device.
[0097] In some embodiments, the processing module is specifically configured to:
[0098] Establish an ICE connection between the first processing device and the second processing device;
[0099] Based on the ICE connection, establish a Quick User Space Protocol Internet Connection (QUIC) between the first processing device and the second processing device;
[0100] Based on the QUIC, establish a Hypertext Transfer Protocol connection between the first processing device and the second processing device.
[0101] In some embodiments, the transceiver module is further configured to:
[0102] Send second update information to the scheduling device, where the second update information is used to indicate a third file stored by the second processing device; the second update information is used for the scheduling device to update the file save list.
[0103] According to a seventh aspect of the embodiments of the present disclosure, there is provided a file transfer system, including:
[0104] A scheduling device for implementing the file transfer method described in the first aspect;
[0105] A first processing device for implementing the file transfer method described in the second aspect;
[0106] A second processing device for implementing the file transfer method described in the third aspect.
[0107] According to an eighth aspect of the embodiments of the present disclosure, there is provided an electronic device, where the electronic device includes:
[0108] One or more processors;
[0109] Wherein, the processor is used to call instructions to cause the electronic device to execute the file transfer method described in the first aspect, the second aspect, or the third aspect.
[0110] According to a ninth aspect of the embodiments of the present disclosure, there is provided a storage medium, where the storage medium stores instructions, and when the instructions run on an electronic device, the electronic device is caused to execute the file transfer method described in the first aspect, the second aspect, or the third aspect.
[0111] Embodiments of the present disclosure provide a file transfer method, apparatus, electronic device, and storage medium. The file transfer method includes: receiving file request information sent by a first processing device, where the file request information is used to indicate a first file requested by the first processing device; in response to the file save list recording a second processing device storing the first file, sending interaction instructions to the first processing device and the second processing device respectively to establish a transfer connection between the first processing device and the second processing device, where the transfer connection is used for the first processing device to obtain the first file from the second processing device, and where the first processing device and the second processing device are peer entities in the network. In this way, when the first processing device requests the first file, if the scheduling device determines that a second processing device other than the storage device has the first file, a transfer connection can be established between the first processing device and the second processing device to transfer the first file. Through the file transfer between the first processing device and the second processing device, each device in the file transfer system can be used for file distribution, thereby realizing distributed file distribution and transmission, saving the traffic cost caused by repeated CDN distribution for the same file, reducing the bandwidth congestion caused by centralized file distribution, and improving the transmission efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0112] Figure 1 FIG. 1 is one of the schematic diagrams of the composition structure of a file transfer system according to an embodiment; Figure 2 FIG. 2 is one of the schematic diagrams of the flowchart of a file transfer method according to an embodiment; Figure 3 FIG. 3 is another schematic diagram of the flowchart of a file transfer method according to an embodiment; Figure 4 FIG. 4 is yet another schematic diagram of the flowchart of a file transfer method according to an embodiment; Figure 5 FIG. 5 is one of the schematic diagrams of the composition structure of a file transfer system according to another embodiment; Figure 6 FIG. 6 is one of the schematic diagrams of the flowchart of a file transfer method according to another embodiment; Figure 7 FIG. 7 is one of the schematic diagrams of the structure of a file transfer apparatus according to an embodiment; Figure 8 FIG. 8 is another schematic diagram of the structure of a file transfer apparatus according to an embodiment; Figure 9 FIG. 9 is yet another schematic diagram of the structure of a file transfer apparatus according to an embodiment; Figure 10It is a schematic structural diagram of an electronic device shown according to an embodiment. Detailed implementation manners
[0113] To make the technical solutions and beneficial effects of the present invention more obvious and understandable, the following will be described in detail by listing specific embodiments. Among them, the drawings are not necessarily drawn to scale, and local features can be enlarged or reduced to more clearly show the details of the local features; unless otherwise defined, the technical and scientific terms used herein have the same meanings as those in the technical field to which this application belongs.
[0114] The embodiments of the present disclosure are not exhaustive, but only illustrate some embodiments and do not specifically limit the protection scope of the present disclosure. Without conflict, each step in an embodiment can be implemented as an independent embodiment, and the steps can be combined arbitrarily. For example, the solution after removing some steps in an embodiment can also be implemented as an independent embodiment, and the order of the steps in an embodiment can be arbitrarily exchanged. In addition, the optional implementation manners in an embodiment can be combined arbitrarily; furthermore, the embodiments can be combined arbitrarily. For example, some or all of the steps of different embodiments can be combined arbitrarily, and an embodiment can be arbitrarily combined with the optional implementation manners of other embodiments.
[0115] In each embodiment of the present disclosure, unless otherwise specified and there is no logical conflict, the terms and / or descriptions between the embodiments are consistent and can be referenced to each other. The technical features in different embodiments can be combined to form new embodiments according to their internal logical relationships.
[0116] The terms used in the embodiments of the present disclosure are only for the purpose of describing specific embodiments and are not intended as a limitation of the present disclosure.
[0117] In the embodiments of the present disclosure, unless otherwise specified, elements expressed in the singular form, such as "a", "an", "the", "above-mentioned", "said", "aforementioned", "this", etc., can mean "one and only one", or can also mean "one or more", "at least one", etc. For example, in the case of using articles such as "a", "an", "the" in English in the translation, the noun after the article can be understood as a singular expression form or a plural expression form.
[0118] In the embodiments of the present disclosure, "a plurality of" means two or more.
[0119] In some embodiments, terms such as "at least one (at least one of, at least one item, at least one)", "one or more", "a plurality of", "multiple", etc. may be used interchangeably.
[0120] In some embodiments, notations such as "at least one of A and B", "A and / or B", "A in one case, B in another case", "A in one situation, B in another situation", etc. may, depending on the circumstances, include the following technical solutions: In some embodiments, A is performed (A is performed independently of B); in some embodiments, B is performed (B is performed independently of A); in some embodiments, either A or B is selected for execution (A and B are selectively executed); in some embodiments, both A and B are performed (both A and B are executed). The same applies when there are more branches such as A, B, C, etc.
[0121] In some embodiments, notations such as "A or B" may, depending on the circumstances, include the following technical solutions: In some embodiments, A is performed (A is performed independently of B); in some embodiments, B is performed (B is performed independently of A); in some embodiments, either A or B is selected for execution (A and B are selectively executed). The same applies when there are more branches such as A, B, C, etc.
[0122] The prefix words such as "first", "second", etc. in the embodiments of the present disclosure are only used to distinguish different described objects and do not impose restrictions on the position, order, priority, value, or content of the described objects. For the statements of the described objects, refer to the description in the claims or the context of the embodiments. There should be no redundant restrictions due to the use of prefix words. For example, if the described object is "field", the ordinal numbers before "field" in "first field" and "second field" do not limit the position or order between the "fields", and "first" and "second" do not limit whether the "fields" they modify are in the same message, nor do they limit the order of "first field" and "second field". Another example, if the described object is "level", the ordinal numbers before "level" in "first level" and "second level" do not limit the priority between the "levels". Another example, the value of the described object is not restricted by the ordinal number and can be one or more. Taking "first device" as an example, the value of "device" can be one or more. In addition, the objects modified by different prefix words can be the same or different. For example, if the described object is "device", "first device" and "second device" can be the same device or different devices, and their types can be the same or different; another example, if the described object is "information", "first information" and "second information" can be the same information or different information, and their contents can be the same or different.
[0123] In some embodiments, "including A", "comprising A", "used to indicate A", "carrying A" can be interpreted as directly carrying A or as indirectly indicating A.
[0124] In some embodiments, terms such as "……", "determining……", "in the case of……", "when……", "while……", "if……", "if……" can be replaced with each other.
[0125] In some embodiments, terms such as "greater than", "greater than or equal to", "not less than", "more than", "more than or equal to", "not less than", "higher than", "higher than or equal to", "not lower than", "above", etc. can be replaced with each other, and terms such as "less than", "less than or equal to", "not greater than", "less than", "less than or equal to", "not more than", "lower than", "lower than or equal to", "not higher than", "below", etc. can be replaced with each other.
[0126] In some embodiments, a device, etc. can be interpreted as physical or virtual, and its name is not limited to the name recorded in the embodiment. Terms such as "device", "equipment", "device", "circuit", "network element", "node", "function", "unit", "section", "system", "network", "chip", "chip system", "entity", "subject", etc. can be replaced with each other.
[0127] In addition, each element, each row, or each column in the table of the embodiments of the present disclosure can be implemented as an independent embodiment, and any combination of any element, any row, or any column can also be implemented as an independent embodiment.
[0128] Exemplarily, the schematic diagram of the composition structure of the file transfer system is as Figure 1 shown. The file transfer system may include: a service system, a scheduling device, a storage device, and a processing device (such as a first processing device and a second processing device). The service system can be used to send service instructions to the scheduling device and the processing device. The processing device (such as the first processing device) can request a file from the scheduling device based on the service instructions.
[0129] In a possible implementation, the service system, the scheduling device, the storage device, and / or the processing device can be implemented by hardware such as a computer, a server, etc. The service system, the scheduling device, the storage device, and / or the processing device can also be implemented by software. The service system, the scheduling device, the storage device, and / or the processing device can also be implemented by a combination of hardware and software.
[0130] In the related art, a scheduling device can obtain a file from a storage device and send it to a first processing device. For example, the scheduling device can issue a CDN address for the first processing device to download the file. Since each processing device needs to download the file from the storage device, a large amount of download traffic costs will be generated.
[0131] Embodiment 1
[0132] In view of this, an embodiment of the present disclosure provides a file transmission method, which is applied to a scheduling device, as Figure 2 shown, the file transmission method includes:
[0133] Step 201: Receive file request information sent by a first processing device, where the file request information is used to indicate a first file requested by the first processing device;
[0134] Step 202: In response to the file save list recording a second processing device storing the first file, send interaction instructions to the first processing device and the second processing device respectively to establish a transmission connection between the first processing device and the second processing device, where the transmission connection is used for the first processing device to obtain the first file from the second processing device, and the first processing device and the second processing device are peer entities in the network.
[0135] Here, the file transmission method can be executed by a scheduling device in a file transmission system. For example, the file transmission method can be executed by a processor of the scheduling device, etc.
[0136] The file may include data information for processing by the first processing device and / or the second processing device. For example, video files, audio files, etc. The information content included in the file is not limited here.
[0137] Here, peer entities can be network devices or software modules that perform the same functions, follow the same protocol rules, and can directly perform logical communication at a specific network layer (such as a certain layer of the TCP / IP model).
[0138] The first processing device and the second processing device can be peer entities in the file transmission system. For example, the first processing device and the second processing device can both be edge devices in the CDN. For another example, the first processing device and the second processing device can both be terminal devices in the CDN, such as Network Video Recorder (NVR) devices, digital signage players, etc.
[0139] In a possible implementation, the second processing device is different from the storage device associated with the scheduling device. The storage device associated with the scheduling device can be a device dedicated to storing files, such as a storage center, etc.
[0140] The first processing device may send file request information to the scheduling device to request the first file. After receiving the file request information, the scheduling device determines the first file required by the first processing device based on the file request information.
[0141] In a possible implementation, the first processing device may determine the first file that itself needs to process based on the service instruction of the service system. For example, a video file to be played.
[0142] The scheduling device may store a file storage list, and the file storage list may record files and the location information of each file. The location information is used to indicate at least one of the following: the device storing the file, the path where the file is stored in the storage device. The devices recorded in the file storage list may be identified by the corresponding identifiers (IDs) of the devices. Each file in the file storage list may be identified by a file identifier. Each file has a corresponding file identifier. The file identifier is used to uniquely indicate the corresponding file.
[0143] In a possible implementation, the scheduling device may set a file identifier for each file.
[0144] In some embodiments, the first file is indicated by the hash value of the first file.
[0145] Here, the file identifier of the first file may be the hash value of the first file. Each file may be uniquely indicated by the hash value of the file itself. A hash algorithm (such as SHA-256, MD5) may be used for each file to generate a unique hash value for the file content. Each file corresponds to a unique hash value.
[0146] If the scheduling device determines according to the file storage list that the second processing device stores the first file, then the scheduling device may send an interaction instruction to the first processing device and the second processing device, for establishing a connection between the first processing device and the second processing device.
[0147] In a possible implementation, the first file may be cached in the second processing device when the second processing device processes the first file. For example, the first file may be the video file cached by the second processing device when playing the video file.
[0148] In a possible implementation, the scheduling device sending the interaction instruction to the first processing device and the second processing device respectively may include one of the following: the scheduling device directly sends the interaction instruction to the first processing device and the second processing device respectively; the scheduling device indirectly sends the interaction instruction to the first processing device and the second processing device respectively.
[0149] The scheduling device can determine the sending method of the interaction instruction based on the network conditions of the scheduling device, the first processing device, and the second processing device. Exemplarily, the scheduling device can send interaction instructions to the first processing device and the second processing device respectively through a network management system, such as Data Management Service (DMS). Here, the interaction instructions sent to the first processing device and the second processing device can be the same or different.
[0150] The first processing device and the second processing device can establish a transmission connection between the first processing device and the second processing device based on the interaction instruction. The first processing device can obtain the first file from the second processing device through the transmission connection.
[0151] Here, the type of the transmission connection can be determined based on the network environment where the first processing device and the second processing device are located. For example, the scheduling device can determine the type of transmission connection to be used based on the IP address situation, network card status, whether there is a Network Address Translation (NAT) Session Traversal Utilities for NAT (STUN) address, and whether there is a Traversal Using Relays around NAT (TURN) address of the first processing device and the second processing device.
[0152] In a possible implementation, a transmission connection can be established based on the network type priority.
[0153] For example, the candidate types for the first processing device and the second processing device to establish a transmission connection include a local connection, a STUN mapped address (P2P direct connection) connection, and a TURN mapped address (forwarding) connection. Among them, the priority of the local connection is higher than that of the STUN mapped address connection, and the priority of the STUN mapped address connection is higher than that of the TURN mapped address connection.
[0154] After a connection is established between the first processing device and the second processing device, the second processing device can send the first file to the first processing device, and the first processing device can receive the first file from the second processing device.
[0155] Here, when the first processing device and the second processing device are edge devices, the storage device associated with the scheduling device can be the storage center in the CDN system. When the first processing device and the second processing device are terminal devices, the storage device associated with the scheduling device can include the storage center in the CDN system and / or the edge device in the CDN system.
[0156] In a possible implementation, there may be multiple first files requested by the first processing device. The scheduling device may determine the first files that the second processing device has and the first files that the second processing device does not have based on the file storage list. For the first files that the second processing device does not have, the scheduling device may distribute them from the storage device to the first processing device. For the first files that the second processing device has, the scheduling device may establish a transmission connection, and the second processing device may send them to the first processing device.
[0157] In this way, when the first processing device requests a first file, if the scheduling device determines that a second processing device outside the storage device has the first file, a transmission connection may be established between the first processing device and the second processing device for the transmission of the first file. Through the file transmission between the first processing device and the second processing device, each device in the file transmission system can be used for file distribution, thereby realizing distributed file distribution and transmission, saving the traffic cost caused by repeated CDN distribution for the same file, reducing the bandwidth congestion caused by centralized file distribution, and improving the transmission efficiency.
[0158] If the file storage list records that there are multiple second processing devices storing the first file, then the following method can be adopted for processing.
[0159] In some embodiments, step 202 may include:
[0160] In response to the file storage list recording N second processing devices storing the first file, based on the device status information respectively corresponding to the N second processing devices, determine a second processing device to establish a transmission connection with the first processing device from the N second processing devices, where N is an integer greater than or equal to 2;
[0161] Send interaction instructions to the first processing device and a second processing device determined from the N second processing devices respectively.
[0162] If multiple second processing devices store the first file, then the scheduling device may select a second processing device from them based on the device status information of each second processing device for transmitting the first file to the first processing device.
[0163] In a possible implementation, the device status information may include at least one of the following: the location information of the device, the load information of the device.
[0164] In a possible implementation, the location information of the device may include at least one of the following: geographical location information, network location information.
[0165] Specifically, the scheduling device can select a second processing device with the closest geographical location to the first processing device from N second processing devices for transmitting the first file. For example, the Redis Geospatial (Redis GEO) technology can be used to select the optimal second processing device from multiple second processing devices for transmitting the first file. Redis GEO can provide geospatial data storage and query functions. The scheduling device can perform operations such as geographical range query and distance measurement based on geographical location information. It is suitable for implementing LBS (Location-Based Service) functions. By determining the second processing device based on geographical location information, a second processing device with a relatively short physical distance can be selected, thereby reducing the transmission distance and improving the transmission efficiency of the first file.
[0166] The scheduling device can also select a second processing device with a relatively high transmission efficiency for transmitting the first file based on the network location information of the second processing device. For example, a second processing device with fewer intermediate network nodes between it and the first processing device can be selected for transmitting the first file.
[0167] The scheduling device can also select a second processing device with a relatively high transmission efficiency for transmitting the first file based on the load information of the second processing device. For example, a second processing device with a relatively small load can be selected for transmitting the first file, thereby reducing the situation where the first file cannot be transmitted in a timely manner due to the large load of the second processing device.
[0168] In this way, by determining the second processing device through device status information, a second processing device with a relatively short physical distance, a relatively short network distance, and / or a relatively small load can be selected, so as to use a second processing device with a relatively high transmission distance or transmission efficiency to transmit the first file, improve the transmission speed of the first file, and enhance the user experience.
[0169] After determining the second processing device, the scheduling module can send an interaction instruction to establish a transmission connection between the first processing device and the second processing device.
[0170] In some embodiments, step 202 may include:
[0171] Sending a first interaction instruction for establishing the transmission connection to the first processing device, where the first interaction instruction is at least used to instruct the first processing device to receive the first file from the second processing device;
[0172] Sending a second interaction instruction for establishing the transmission connection to the second processing device, where the second interaction instruction is at least used to instruct the second processing device to send the first file to the second processing device.
[0173] In a possible implementation, the scheduling device sending interaction instructions to the first processing device and the second processing device respectively may include one of the following: the scheduling device directly sends interaction instructions to the first processing device and the second processing device respectively; the scheduling device indirectly sends interaction instructions to the first processing device and the second processing device respectively.
[0174] In a possible implementation, the scheduling device may send a first interaction instruction and a second interaction instruction to the first processing device and the second processing device respectively through a network management system.
[0175] The interaction instruction may be used to indicate at least one of the following: the type of the established transmission connection; the role of the first processing device in the transmission connection; the role of the second processing device in the transmission connection; indicating the network identifier of the second processing device to the first processing device; indicating the network identifier of the first processing device to the second processing device. Here, the role in the transmission connection may include a server, a client, etc.
[0176] In a possible implementation, the scheduling device may send an indication to instruct a network device (such as a gateway) to establish a transmission connection between the first processing device and the second processing device.
[0177] The first interaction instruction may indicate the second processing device by indicating the device identifier of the second processing device to the first processing device. Similarly, the second interaction instruction may indicate the first processing device by indicating the device identifier of the first processing device to the second processing device.
[0178] The first interaction instruction and the second interaction instruction may indicate a first file transmitted between the first processing device and the second processing device. Here, the file identifier (such as a hash value) of the first file may be used to indicate the first file.
[0179] In a possible implementation, there may be multiple first files indicated by the first interaction instruction and the second interaction instruction.
[0180] In a possible implementation, the first interaction instruction and the second interaction instruction may include protocol instructions for the established transmission connection. Such as the initial protocol instructions for establishing the transmission connection.
[0181] Exemplarily, taking the established transmission connection as an ICE connection as an example. The scheduling device selects the optimal second processing device from multiple second processing devices (such as the second processing device closest in location). The scheduling device can initiate a "quicice-gen-credentials" instruction (i.e., ICE credentials, ICE Gen Credentials) to the second processing device through the DMS system, and at the same time, initiate a "quicice-gen-credentials" request to the first processing device. The first processing device can act as a client (CLIENT) in the ICE connection, and the second processing device acts as a server (SERVER). The scheduling device can send a "quicice-proxy-client" instruction to the first processing device: including the ICE credential information generated by the server side and the file list (the first file) that the client needs to receive from the server side; the scheduling device can send a "quicice-proxy-server" instruction to the second processing device: including the ICE credential information generated by the client side and the file list (the first file) that the server side needs to send.
[0182] In this way, through the first interaction instruction and the second interaction instruction, the first processing device and the second processing device can establish a transmission connection and can determine the first file transmitted between the first processing device and the second processing device, improving the information volume carried by the instruction and the interaction efficiency.
[0183] In some embodiments, the transmission connection includes:
[0184] The ICE connection between the first processing device and the second processing device;
[0185] The Quick User Space Protocol Internet connection QUIC between the first processing device and the second processing device established based on the ICE connection;
[0186] The Hypertext Transfer Protocol HTTP connection between the first processing device and the second processing device established based on the QUIC.
[0187] Here, the first processing device and the second processing device can transmit the first file through one of the ICE connection, QUIC, and HTTP connection, or can combine the above connection methods to transmit the first file on the combined connection.
[0188] Exemplarily, the first processing device and the second processing device may first establish an ICE connection. During the process of establishing the ICE connection, the first processing device and the second processing device may first perform connectivity checks. The first processing device and the second processing device test candidate address combinations, detect whether these combinations can be reached by sending STUN binding requests, score and sort them, and preferentially test the expected faster / more reliable paths. After determining the path, the first processing device and the second processing device may perform candidate pair preference and connection confirmation. After successfully establishing the connection, ICE will select the optimal candidate address pair, called the nominated pair. Once the detection is successful and confirmed, communication can be carried out on this path. After the ICE connection is established, the first processing device and the second processing device may establish a QUIC network transmission protocol on top of the ICE connection, so as to achieve stable two-way encrypted data transmission. After the QUIC connection is established, the device acting as the server (the second device) will establish an HTTP server on the QUIC connection, and the device acting as the client (the first device) will establish an HTTP client on the QUIC connection. According to the file list (the list of the first file) in the interaction instruction previously issued by the scheduling device, subsequent file distributed distribution and transmission can be carried out.
[0189] In some embodiments, the method further includes:
[0190] In response to the second processing device storing the first file not being recorded in the file save list, send a scheduling instruction to instruct the first processing device to obtain the first file from the storage device associated with the scheduling device.
[0191] If the scheduling device does not find the second processing device storing the first file according to the file save list. Then the scheduling device may not perform distributed distribution and transmission. The scheduling device may issue a scheduling instruction to instruct the first processing device to obtain the first file from the storage device. The first processing device may obtain the first file from the storage device based on the scheduling instruction. For example, the scheduling device may issue a CDN address for the first processing device to download the file.
[0192] In a possible implementation, the first file in the storage device may be sent by the business system to the scheduling device and then by the scheduling device to the storage device. For example, the business system may carry the first file when sending business instructions to the scheduling device and / or the processing device.
[0193] When distributed distribution and transmission are not possible, the scheduling device performs file distribution to ensure the normal progress of business processing. In this way, by combining distributed file distribution and centralized file distribution, the flexibility of file distribution can be improved to adapt to different file distribution scenarios.
[0194] In some embodiments, the method further includes at least one of the following:
[0195] Receiving first update information sent by the first processing device, and updating the file storage list based on the first update information, where the first update information is used to indicate a second file stored by the first processing device;
[0196] Receiving second update information sent by the second processing device, and updating the file storage list based on the second update information, where the second update information is used to indicate a third file stored by the second processing device;
[0197] Receiving a fourth file sent by the business system, storing the fourth file in the storage device associated with the scheduling device, and updating the file storage list to record the storage location of the fourth file in the storage device.
[0198] Here, the second file, the third file, and the fourth file are only used to distinguish files in different locations and / or different processing flows, and are not used to limit whether the files are the same.
[0199] The method for sending update information adopted by the processing device may include at least one of the following:
[0200] Periodically sending update information to the scheduling device;
[0201] Sending update information to the scheduling device based on event triggering.
[0202] For example, the processing device may send update information to the scheduling device every day. The processing device may also send update information to the scheduling device when the files cached by itself are updated (such as newly added or deleted).
[0203] The processing device may also send update information during a predetermined time period and when the workload of the processing device is lower than a predetermined load.
[0204] When the business system issues a business instruction, such as sending a scheduling instruction to a scheduling device, it sends a fourth file to the scheduling device. After receiving the fourth file, the scheduling system can determine the file identifier of the fourth file, store the fourth file in a storage device, and record the storage location of the fourth file in a file save list. When initially scheduling the fourth file, the scheduling device can distribute the fourth file from the storage device in a central file distribution manner. When the processing device stores the fourth file during the process of processing the fourth file, the scheduling device can send the fourth file from the processing device in a distributed file distribution manner.
[0205] Here, the second file can be a file stored (such as cached) in the first processing device, such as a video file, a music file, etc. stored in the first processing device. The second file can be a file processed by the first processing device, such as a played video file. The first update information is used to update the file save list to the scheduling device, so as to update the second file stored in the first processing device in the file save list. The first update information can include the file identifier of the second file, the identifier of the first processing device, etc. The scheduling device can, based on the second file stored in the first processing device in the file save list, send it through the first processing device when other devices request the second file. The specific implementation manner is as the way the scheduling device schedules the first file as described above, and will not be elaborated here.
[0206] The third file can be a file stored (such as cached) in the second processing device, such as a video file, a music file, etc. stored in the second processing device. The third file can be a file processed by the second processing device, such as a played video file. The second update information is used to update the file save list to the scheduling device, so as to update the third file stored in the second processing device in the file save list. The second update information can include the file identifier of the third file, the identifier of the second processing device, etc. The scheduling device can, based on the third file stored in the second processing device in the file save list, send it through the second processing device when other devices request the third file. The specific implementation manner is as the way the scheduling device schedules the first file as described above, and will not be elaborated here.
[0207] By updating the file save list, the scheduling device can accurately determine the files stored in the processing device and the storage device, so as to implement distributed file distribution and / or centralized file distribution, improve the accuracy of the scheduling device in scheduling, and reduce the situation of file distribution errors.
[0208] Embodiment 2
[0209] An embodiment of the present disclosure provides a file transmission method, which is applied to a first processing device, such as Figure 3 As shown, the file transmission method includes:
[0210] Step 301: Send file request information to a scheduling device, where the file request information is used to indicate a first file requested by the first processing device;
[0211] Step 302: Receive an interaction instruction sent by the scheduling device, where the interaction instruction is sent by the scheduling device in response to a second processing device storing the first file being recorded in a file save list; the first processing device and the second processing device are peer entities in a network;
[0212] Step 303: Based on the interaction instruction, establish a transmission connection between the first processing device and the second processing device;
[0213] Step 304: Obtain the first file from the second processing device through the transmission connection.
[0214] Here, the file transfer method can be executed by a first processing device in a file transfer system. For example, the file transfer method can be executed by a processor of the first processing device, etc.
[0215] The file can include data information for processing by the first processing device and / or the second processing device. For example, video files, audio files, etc. The information content included in the file is not limited here.
[0216] Here, peer entities can be network devices or software modules that perform the same functions, follow the same protocol rules, and can directly communicate logically at a specific network layer (such as a certain layer of the TCP / IP model).
[0217] The first processing device and the second processing device can be peer entities in a file transfer system. For example, the first processing device and the second processing device can both be edge devices in a CDN. For another example, the first processing device and the second processing device can both be terminal devices in a CDN such as: Network Video Recorder (NVR) devices, digital signage players, etc.
[0218] In a possible implementation, the second processing device is different from the storage device associated with the scheduling device. The storage device associated with the scheduling device can be a device dedicated to storing files, such as a storage center, etc.
[0219] The first processing device can send file request information to the scheduling device to request a first file. After receiving the file request information, the scheduling device determines the first file required by the first processing device based on the file request information.
[0220] In a possible implementation, the first processing device can determine the first file that itself needs to process based on a service instruction of a service system. Such as a video file to be played.
[0221] The scheduling device may store a file saving list, and the file saving list may record files and location information of each file. The location information is used to indicate at least one of the following: the device storing the file, the path where the file is stored in the storage device. The devices recorded in the file saving list may be identified by the corresponding identifiers (IDs) of the devices. Each file in the file saving list may be identified by a file identifier. Each file has a corresponding file identifier. The file identifier is used to uniquely indicate the corresponding file.
[0222] In a possible implementation, the scheduling device may set a file identifier for each file.
[0223] In some embodiments, the first file is indicated by the hash value of the first file.
[0224] Here, the file identifier of the first file may be the hash value of the first file. Each file may be uniquely indicated by the hash value of the file itself. A hash algorithm (such as SHA-256, MD5) may be used for each file to generate a unique hash value for the file content. Each file corresponds to a unique hash value.
[0225] If the scheduling device determines according to the file saving list that the second processing device stores the first file, then the scheduling device may send interaction instructions to the first processing device and the second processing device for establishing a connection between the first processing device and the second processing device.
[0226] In a possible implementation, the first file may be cached in the second processing device by the second processing device when processing the first file. For example, the first file may be the video file cached by the second processing device when playing the video file.
[0227] In a possible implementation, the scheduling device sending interaction instructions to the first processing device and the second processing device respectively may include one of the following: the scheduling device directly sends interaction instructions to the first processing device and the second processing device respectively; the scheduling device indirectly sends interaction instructions to the first processing device and the second processing device respectively.
[0228] The scheduling device may determine the sending mode of the interaction instructions based on the network conditions of the scheduling device, the first processing device, and the second processing device. Exemplarily, the scheduling device may send interaction instructions to the first processing device and the second processing device respectively through a network management system, such as Data Management Service (DMS). Here, the interaction instructions sent to the first processing device and the second processing device may be the same or different.
[0229] The first processing device and the second processing device can establish a transmission connection between the first processing device and the second processing device based on an interaction instruction. The first processing device can obtain a first file from the second processing device through the transmission connection.
[0230] Here, the type of the transmission connection can be determined based on the network environment where the first processing device and the second processing device are located. For example, the scheduling device can determine the type of transmission connection to be used based on the IP address situation, network card status, whether there is a Network Address Translation (NAT) Session Traversal Utilities for NAT (STUN) address, and whether there is a Traversal Using Relays around NAT (TURN) address of the first processing device and the second processing device.
[0231] In a possible implementation, the transmission connection can be established based on the network type priority.
[0232] For example, the candidate types for the first processing device and the second processing device to establish a transmission connection include a local connection, a STUN mapped address (P2P direct connection) connection, and a TURN mapped address (forwarding) connection. Among them, the priority of the local connection is higher than that of the STUN mapped address connection, and the priority of the STUN mapped address connection is higher than that of the TURN mapped address connection.
[0233] After establishing a connection between the first processing device and the second processing device, the second processing device can send the first file to the first processing device, and the first processing device can receive the first file from the second processing device.
[0234] Here, when the first processing device and the second processing device are edge devices, the storage device associated with the scheduling device can be a storage center in the CDN system. When the first processing device and the second processing device are terminal devices, the storage device associated with the scheduling device can include a storage center in the CDN system and / or an edge device in the CDN system.
[0235] In a possible implementation, the number of the first files requested by the first processing device can be multiple. The scheduling device can determine the first files available in the second processing device and the first files not available in the second processing device based on the file save list. For the first files not available in the second processing device, the scheduling device can distribute them to the first processing device from the storage device. For the first files available in the second processing device, the scheduling device can establish a transmission connection for the second processing device to send to the first processing device.
[0236] Thus, when the first processing device requests the first file, if the scheduling device determines that a second processing device outside the storage device has the first file, a transmission connection can be established between the first processing device and the second processing device for the transmission of the first file. Through the file transmission between the first processing device and the second processing device, each device in the file transmission system can be used for file distribution, thereby realizing distributed file distribution and transmission, saving the traffic cost caused by repeated CDN distribution for the same file, reducing the bandwidth congestion caused by centralized file distribution, and improving the transmission efficiency.
[0237] If there are multiple second processing devices recorded in the file save list that store the first file, then the following method can be adopted for processing.
[0238] In some embodiments, in response to the file save list recording N second processing devices that store the first file, the second processing device that establishes a transmission with the first processing device is determined by the scheduling device from the N second processing devices based on the device status information corresponding to each of the N second processing devices, where N is an integer greater than or equal to 2.
[0239] If multiple second processing devices store the first file, then the scheduling device can select one second processing device from them based on the device status information of each second processing device for transmitting the first file to the first processing device.
[0240] In a possible implementation, the device status information may include at least one of the following: the location information of the device, the load information of the device.
[0241] In a possible implementation, the location information of the device may include at least one of the following: geographical location information, network location information.
[0242] Specifically, the scheduling device can select a second processing device that is geographically closest to the first processing device from the N second processing devices for transmitting the first file. For example, the Redis GEO technology can be used to select the optimal second processing device from multiple second processing devices for transmitting the first file. Redis GEO can provide functions of geospatial data storage and query. The scheduling device can perform operations such as geospatial range query and distance measurement based on the geographical location information. It is suitable for implementing the LBS (Location-Based Service) function. By determining the second processing device through the geographical location information, a second processing device with a relatively short physical distance can be selected, thereby reducing the transmission distance and improving the transmission efficiency of the first file.
[0243] The scheduling device may also select a second processing device with a higher transmission efficiency based on the network location information of the second processing device for transmitting the first file. For example, a second processing device with fewer intermediate network nodes between the first processing device and the second processing device may be selected for transmitting the first file.
[0244] The scheduling device may also select a second processing device with a higher transmission efficiency based on the load information of the second processing device for transmitting the first file. For example, a second processing device with a smaller load may be selected for transmitting the first file, so as to reduce the situation where the first file cannot be transmitted in time due to the large load of the second processing device.
[0245] In this way, by determining the second processing device through the device status information, a second processing device with a relatively short physical distance, a relatively short network distance, and / or a relatively small load can be selected, so as to use a second processing device with a higher transmission distance or transmission efficiency to transmit the first file, improve the transmission speed of the first file, and enhance the user experience.
[0246] After determining the second processing device, the scheduling module may send an interaction instruction to establish a transmission connection between the first processing device and the second processing device.
[0247] In some embodiments, step 302 may include:
[0248] Receiving a first interaction instruction for establishing the transmission connection sent by the scheduling device, where the first interaction instruction is at least used to instruct the first processing device to receive a first file from the second processing device.
[0249] In a possible implementation manner, the scheduling device sending interaction instructions to the first processing device and the second processing device respectively may include one of the following: the scheduling device directly sends interaction instructions to the first processing device and the second processing device respectively; the scheduling device indirectly sends interaction instructions to the first processing device and the second processing device respectively.
[0250] In a possible implementation manner, the scheduling device may send a first interaction instruction and a second interaction instruction to the first processing device and the second processing device respectively through a network management system.
[0251] The interaction instruction may be used to indicate at least one of the following: the type of the established transmission connection; the role of the first processing device in the transmission connection; the role of the second processing device in the transmission connection; indicating the network identifier of the second processing device to the first processing device; indicating the network identifier of the first processing device to the second processing device. Here, the role in the transmission connection may include a server, a client, etc.
[0252] In a possible implementation, the scheduling device may send an indication to instruct a network device (such as a gateway) to establish a transmission connection between a first processing device and a second processing device.
[0253] The first interaction instruction may indicate the second processing device by indicating the device identifier of the second processing device to the first processing device. Similarly, the second interaction instruction may indicate the first processing device by indicating the device identifier of the first processing device to the second processing device.
[0254] The first interaction instruction and the second interaction instruction may indicate a first file transmitted between the first processing device and the second processing device. Here, the file identifier (such as a hash value) of the first file may be used to indicate the first file.
[0255] In a possible implementation, there may be multiple first files indicated by the first interaction instruction and the second interaction instruction.
[0256] In a possible implementation, the first interaction instruction and the second interaction instruction may include protocol instructions for the established transmission connection. Such as the initial protocol instructions for establishing the transmission connection.
[0257] Exemplarily, taking the established transmission connection as an ICE connection as an example. The scheduling device selects the optimal second processing device (such as the second processing device closest in location) from multiple second processing devices. The scheduling device may initiate a "quicice-gen-credentials" instruction (i.e., ICE credentials, ICE Gen Credentials) to the second processing device through the DMS system. At the same time, it initiates a "quicice-gen-credentials" request to the first processing device. The first processing device may act as a client (CLIENT) in the ICE connection, and the second processing device acts as a server (SERVER). The scheduling device may send a "quicice-proxy-client" instruction to the first processing device: including the ICE credential information generated by the server side and the file list (the first file) that the client needs to receive from the server side; the scheduling device may send a "quicice-proxy-server" instruction to the second processing device: including the ICE credential information generated by the client side and the file list (the first file) that the server side needs to send.
[0258] In this way, through the first interaction instruction and the second interaction instruction, the first processing device and the second processing device can establish a transmission connection and can determine the first file transmitted between the first processing device and the second processing device, improving the information carried by the instruction and the interaction efficiency.
[0259] In some embodiments, establishing the transmission connection between the first processing device and the second processing device includes:
[0260] Establishing an ICE connection between the first processing device and the second processing device;
[0261] Based on the ICE connection, establishing a Quick UDP Internet Connection (QUIC) between the first processing device and the second processing device;
[0262] Based on the QUIC, establishing a Hypertext Transfer Protocol (HTTP) connection between the first processing device and the second processing device.
[0263] Here, the first processing device and the second processing device can transfer the first file through one of the ICE connection, QUIC, and HTTP connection, or can combine the above connection methods to transfer the first file on the combined connection.
[0264] Exemplarily, the first processing device and the second processing device can first establish an ICE link. During the process of establishing the ICE link, the first processing device and the second processing device can first perform connectivity checks. The first processing device and the second processing device test candidate address combinations, and detect whether these combinations can be reached by sending STUN binding requests, and will score and sort them, preferentially testing the expected faster / more reliable paths. After determining the path, the first processing device and the second processing device can perform candidate pair optimization and connection confirmation. After successfully establishing the connection, ICE will select the optimal candidate address pair, called the nominated pair. Once the detection is successful and confirmed, the communication can be carried out on this path. After the ICE connection is established, the first processing device and the second processing device can set up the QUIC network transmission protocol on the ICE connection to achieve stable two-way encrypted data transmission. After the QUIC connection is established, the device acting as the server (the second device) will set up an HTTP server on the QUIC connection, and the device acting as the client (the first device) will set up an HTTP client on the QUIC connection. According to the file list (the list of the first file) in the interaction instruction sent by the previous scheduling device, subsequent file distributed distribution and transmission can be carried out.
[0265] In some embodiments, the method further includes:
[0266] Receive a scheduling instruction, and obtain the first file from the storage device associated with the scheduling device based on the scheduling instruction, where the scheduling instruction is sent by the scheduling device after determining that the second processing device storing the first file is not recorded in the file storage list.
[0267] If the scheduling device does not find the second processing device storing the first file according to the file storage list, then the scheduling device may not perform distributed distribution transmission. The scheduling device may issue a scheduling instruction to instruct the first processing device to obtain the first file from the storage device. The first processing device may obtain the first file from the storage device based on the scheduling instruction. For example, the scheduling device may issue a CDN address for the first processing device to download the file.
[0268] In a possible implementation, the first file in the storage device may be sent by the business system to the scheduling device and then sent by the scheduling device to the storage device. For example, the business system may carry the first file when sending business instructions to the scheduling device and / or the processing device.
[0269] When distributed distribution transmission cannot be performed, the scheduling device performs file distribution to improve the normal progress of business processing. In this way, by combining distributed file distribution and centralized file distribution, the flexibility of file distribution can be improved to adapt to different file distribution scenarios.
[0270] In some embodiments, the method further includes:
[0271] Sending first update information to the scheduling device, where the first update information is used to indicate the second file stored by the first processing device; the first update information is used for the scheduling device to update the file storage list.
[0272] The method for the first processing device to send update information may include at least one of the following:
[0273] Periodically sending update information to the scheduling device;
[0274] Sending update information to the scheduling device based on event triggering.
[0275] For example, the first processing device may send update information to the scheduling device every day. The first processing device may also send update information to the scheduling device when the files cached by itself are updated (such as added or deleted).
[0276] The first processing device may also send update information during a predetermined time period and when the workload of the processing device is lower than a predetermined load.
[0277] Here, the second file can be a file stored (such as cached) in the first processing device, such as a video file, a music file, etc. stored in the first processing device. The second file can be a file processed by the first processing device, such as a played video file. The first update information is used to update the file storage list to the scheduling device, so as to update the second file stored in the first processing device in the file storage list. The first update information can include the file identifier of the second file, the identifier of the first processing device, etc. The scheduling device can, based on the second file stored in the first processing device in the file storage list, send it through the first processing device when other devices request the second file. The specific implementation manner is as the way the scheduling device schedules the first file as described above, which will not be elaborated here.
[0278] By updating the file storage list, the scheduling device can accurately determine the files stored in the processing device and the storage device, so as to achieve distributed file distribution and / or centralized file distribution, improve the accuracy of the scheduling device in scheduling, and reduce the situation of file distribution errors.
[0279] Embodiment 3
[0280] An embodiment of the present disclosure provides a file transmission method, which is applied to a second processing device, such as Figure 4 As shown, the file transmission method includes:
[0281] Step 401: Receive an interaction instruction sent by a scheduling device, where the interaction instruction is sent by the scheduling device in response to receiving file request information sent by a first processing device, and the file storage list records that it is sent by a second processing device storing a first file; where the file request information is used to indicate a first file requested by the first processing device; the first processing device and the second processing device are peer entities in the network;
[0282] Step 402: Based on the interaction instruction, establish a transmission connection between the first processing device and the second processing device;
[0283] Step 403: Send the first file to the first processing device through the transmission connection.
[0284] Here, the file transmission method can be executed by a second processing device in a file transmission system. For example, the file transmission method can be executed by a processor of the second processing device, etc.
[0285] The file can include data information for processing by the first processing device and / or the second processing device. For example, a video file, an audio file, etc. The information content included in the file is not limited here.
[0286] Here, peer entities can be network devices or software modules that perform the same functions, follow the same protocol rules, and can directly communicate logically at a specific network layer (such as a certain layer of the TCP / IP model).
[0287] The first processing device and the second processing device can be peer entities in a file transfer system. For example, both the first processing device and the second processing device can be edge devices in a CDN. For another example, both the first processing device and the second processing device can be terminal devices in a CDN such as Network Video Recorder (NVR) devices, digital signage players, etc.
[0288] In a possible implementation, the second processing device is different from the storage device associated with the scheduling device. The storage device associated with the scheduling device can be a device dedicated to storing files, such as a storage center, etc.
[0289] The first processing device can send file request information to the scheduling device to request the first file. After receiving the file request information, the scheduling device determines the first file required by the first processing device based on the file request information.
[0290] In a possible implementation, the first processing device can determine the first file to be processed based on the service instruction of the service system. Such as a video file to be played.
[0291] The scheduling device can store a file storage list, and the file storage list can record files and the location information of each file. The location information is used to indicate at least one of the following: the device storing the file, the path where the file is stored in the storage device. The devices recorded in the file storage list can be identified by the corresponding identifiers (IDs) of the devices. Each file in the file storage list can be identified by a file identifier. Each file has a corresponding file identifier. The file identifier is used to uniquely indicate the corresponding file.
[0292] In a possible implementation, the scheduling device can set a file identifier for each file.
[0293] In some embodiments, the first file is indicated by the hash value of the first file.
[0294] Here, the file identifier of the first file can be the hash value of the first file. Each file can be uniquely indicated by the hash value of the file itself. The hash algorithm (such as SHA-256, MD5) can be used to generate a unique hash value for the file content for each file. Each file corresponds to a unique hash value.
[0295] If the scheduling device determines that the second processing device stores the first file according to the file storage list, then the scheduling device may send an interaction instruction to the first processing device and the second processing device for establishing a connection between the first processing device and the second processing device.
[0296] In a possible implementation manner, the first file may be cached in the second processing device when the second processing device processes the first file. For example, the first file may be the video file cached by the second processing device when playing the video file.
[0297] In a possible implementation manner, the scheduling device sending the interaction instruction to the first processing device and the second processing device respectively may include one of the following: the scheduling device directly sends the interaction instruction to the first processing device and the second processing device respectively; the scheduling device indirectly sends the interaction instruction to the first processing device and the second processing device respectively.
[0298] The scheduling device may determine the sending manner of the interaction instruction based on the network conditions of the scheduling device, the first processing device, and the second processing device. Exemplarily, the scheduling device may send the interaction instruction to the first processing device and the second processing device respectively through a network management system, such as Data Management Service (DMS). Here, the interaction instruction sent to the first processing device and the interaction instruction sent to the second processing device may be the same or different.
[0299] The first processing device and the second processing device may establish a transmission connection between the first processing device and the second processing device based on the interaction instruction. The first processing device may obtain the first file from the second processing device through the transmission connection.
[0300] Here, the type of the transmission connection may be determined based on the network environment where the first processing device and the second processing device are located. For example, the scheduling device may determine the type of the transmission connection to be adopted based on the IP address situation of the first processing device and the second processing device, the network card status, whether there is a Network Address Translation (NAT) Session Traversal Utilities for NAT (STUN) address, and whether there is a Traversal Using Relays around NAT (TURN) address.
[0301] In a possible implementation manner, the transmission connection may be established based on the network type priority.
[0302] For example, the candidate types for the first processing device and the second processing device to establish a transmission connection include a local connection, a STUN mapped address (P2P direct connection) connection, and a TURN mapped address (relay) connection. Among them, the priority of the local connection is higher than that of the STUN mapped address connection, and the priority of the STUN mapped address connection is higher than that of the TURN mapped address connection.
[0303] After a connection is established between the first processing device and the second processing device, the second processing device can send a first file to the first processing device, and the first processing device can receive the first file from the second processing device.
[0304] Here, when the first processing device and the second processing device are edge devices, the storage device associated with the scheduling device can be the storage center in the CDN system. When the first processing device and the second processing device are terminal devices, the storage device associated with the scheduling device can include the storage center in the CDN system and / or the edge device in the CDN system.
[0305] In a possible implementation, the first files requested by the first processing device can be multiple. The scheduling device can determine the first files available in the second processing device and the first files not available in the second processing device based on the file storage list. For the first files not available in the second processing device, the scheduling device can distribute them from the storage device to the first processing device. For the first files available in the second processing device, the scheduling device can establish a transmission connection for the second processing device to send to the first processing device.
[0306] In this way, when the first processing device requests a first file, if the scheduling device determines that the second processing device outside the storage device has the first file, a transmission connection can be established between the first processing device and the second processing device for the transmission of the first file. Through the file transmission between the first processing device and the second processing device, each device in the file transmission system can be used for file distribution, thereby realizing distributed file distribution transmission, saving the traffic cost caused by repeated CDN distribution for the same file, reducing the bandwidth congestion caused by centralized file distribution, and improving the transmission efficiency.
[0307] If there are multiple second processing devices recorded in the file storage list that store the first file, the following method can be adopted for processing.
[0308] In some embodiments, in response to the file saving list recording N second processing devices that store the first file, based on the device status information respectively corresponding to the N second processing devices, the scheduling device determines a second processing device that establishes a transmission connection with the first processing device from the N second processing devices, where N is an integer greater than or equal to 2; and sends interaction instructions to the first processing device and a second processing device determined from the N second processing devices respectively.
[0309] If multiple second processing devices store the first file, then the scheduling device can select a second processing device from them based on the device status information of each second processing device for transmitting the first file to the first processing device.
[0310] In a possible implementation, the device status information may include at least one of the following: the location information of the device, the load information of the device.
[0311] In a possible implementation, the location information of the device may include at least one of the following: geographical location information, network location information.
[0312] Specifically, the scheduling device can select a second processing device with the closest geographical location to the first processing device from the N second processing devices for transmitting the first file. For example, the Redis GEO technology can be used to select the optimal second processing device from multiple second processing devices for transmitting the first file. Redis GEO can provide functions of storing and querying geospatial data. The scheduling device can perform operations such as geographical range query and distance measurement based on the geographical location information. It is suitable for implementing the LBS (Location-Based Service) function. By determining the second processing device through the geographical location information, a second processing device with a relatively short physical distance can be selected, thereby reducing the transmission distance and improving the transmission efficiency of the first file.
[0313] The scheduling device can also select a second processing device with a relatively high transmission efficiency for transmitting the first file based on the network location information of the second processing device. For example, a second processing device with fewer intermediate network nodes between it and the first processing device can be selected for transmitting the first file.
[0314] The scheduling device can also select a second processing device with a relatively high transmission efficiency for transmitting the first file based on the load information of the second processing device. For example, a second processing device with a relatively small load can be selected for transmitting the first file, thereby reducing the situation where the first file cannot be transmitted in time due to the large load of the second processing device.
[0315] In this way, by determining the second processing device based on the device status information, a second processing device with a relatively short physical distance, a relatively short network distance, and / or a relatively small load can be selected, so as to use the second processing device with a relatively high transmission distance or transmission efficiency to transmit the first file, improve the transmission speed of the first file, and enhance the user experience.
[0316] After determining the second processing device, the scheduling module may send an interaction instruction to establish a transmission connection between the first processing device and the second processing device.
[0317] In some embodiments, step 401 may include:
[0318] Receiving a second interaction instruction sent by the scheduling device for establishing the transmission connection, where the second interaction instruction is at least used to instruct the second processing device to send the first file to the second processing device.
[0319] In a possible implementation manner, the scheduling device sending interaction instructions to the first processing device and the second processing device respectively may include one of the following: the scheduling device directly sends interaction instructions to the first processing device and the second processing device respectively; the scheduling device indirectly sends interaction instructions to the first processing device and the second processing device respectively.
[0320] In a possible implementation manner, the scheduling device may send a first interaction instruction and a second interaction instruction to the first processing device and the second processing device respectively through a network management system.
[0321] The interaction instruction may be used to instruct at least one of the following: the type of the established transmission connection; the role of the first processing device in the transmission connection; the role of the second processing device in the transmission connection; indicating the network identifier of the second processing device to the first processing device; indicating the network identifier of the first processing device to the second processing device. Here, the role in the transmission connection may include a server, a client, etc.
[0322] In a possible implementation manner, the scheduling device may send an indication to instruct a network device (such as a gateway, etc.) to establish a transmission connection between the first processing device and the second processing device.
[0323] The first interaction instruction may indicate the second processing device by indicating the device identifier of the second processing device to the first processing device. Similarly, the second interaction instruction may indicate the first processing device by indicating the device identifier of the first processing device to the second processing device.
[0324] The first interaction instruction and the second interaction instruction may indicate the first file transmitted between the first processing device and the second processing device. Here, the file identifier (such as a hash value) of the first file may be used to indicate the first file.
[0325] In a possible implementation, there may be multiple first files indicated by the first interaction instruction and the second interaction instruction.
[0326] In a possible implementation, the first interaction instruction and the second interaction instruction may include protocol instructions for establishing a transmission connection. Such as the initial protocol instruction for establishing a transmission connection.
[0327] Exemplarily, taking the established transmission connection as an ICE connection as an example. The scheduling device selects the optimal second processing device from multiple second processing devices (such as the second processing device closest in location). The scheduling device can initiate a "quicice - gen - credentials" instruction (i.e., ICE credentials, ICE Gen Credentials) to the second processing device through the DMS system. At the same time, it initiates a "quicice - gen - credentials" request to the first processing device. The first processing device can act as a client (CLIENT) in the ICE connection, and the second processing device acts as a server (SERVER). The scheduling device can send a "quicice - proxy - client" instruction to the first processing device: containing the ICE credential information generated by the server side and the file list (first file) that the client needs to receive from the server side; the scheduling device can send a "quicice - proxy - server" instruction to the second processing device: containing the ICE credential information generated by the client side and the file list (first file) that the server side needs to send.
[0328] In this way, through the first interaction instruction and the second interaction instruction, the first processing device and the second processing device can establish a transmission connection and can determine the first files transmitted between the first processing device and the second processing device, improving the information volume carried by the instructions and the interaction efficiency.
[0329] In some embodiments, step 402 may include:
[0330] Establish an ICE connection between the first processing device and the second processing device;
[0331] Based on the ICE connection, establish a Quick User - Space Protocol Internet Connection (QUIC) between the first processing device and the second processing device;
[0332] Based on the QUIC, establish a Hyper - Text Transfer Protocol (HTTP) connection between the first processing device and the second processing device.
[0333] Here, the first processing device and the second processing device can transfer the first file through one of the ICE connection, QUIC, and HTTP connection, or can combine the above connection methods to transfer the first file on the combined connection.
[0334] Exemplarily, the first processing device and the second processing device can first establish an ICE link. During the process of establishing the ICE link, the first processing device and the second processing device can first perform connectivity checks. The first processing device and the second processing device test candidate address combinations, detect whether these combinations can be reached by sending STUN binding requests, score and sort them, and preferentially test the expected faster / more reliable paths. After determining the path, the first processing device and the second processing device can perform candidate pair optimization and connection confirmation. After successfully establishing the connection, ICE will select the optimal candidate address pair, called the nominated pair. Once the detection is successful and confirmed, communication can be carried out on this path. After the ICE connection is established, the first processing device and the second processing device can set up the QUIC network transport protocol on the ICE connection to achieve stable two-way encrypted data transmission. After the QUIC connection is established, the device acting as the server (the second device) will set up an HTTP server on the QUIC connection, and the device acting as the client (the first device) will set up an HTTP client on the QUIC connection. According to the file list (the list of the first file) in the interaction instruction sent by the previous scheduling device, subsequent file distributed distribution and transmission can be carried out.
[0335] In some embodiments, the method further includes:
[0336] Sending second update information to the scheduling device, where the second update information is used to indicate the third file stored in the second processing device; the second update information is used for the scheduling device to update the file save list.
[0337] The update information sending method adopted by the second processing device can include at least one of the following:
[0338] Periodically sending update information to the scheduling device;
[0339] Sending update information to the scheduling device based on event triggering.
[0340] For example, the second processing device can send update information to the scheduling device every day. The second processing device can also send update information to the scheduling device when the files cached in itself are updated (such as newly added or deleted).
[0341] The second processing device may also send update information during a predetermined time period when the workload of the processing device is lower than a predetermined load.
[0342] The third file may be a file stored (such as cached) in the second processing device, such as a video file, a music file, etc. stored in the second processing device. The third file may be a file processed by the second processing device, such as a played video file. The second update information is used to update the file storage list to the scheduling device to update the third file stored in the second processing device in the file storage list. The second update information may include the file identifier of the third file, the identifier of the second processing device, etc. The scheduling device may, based on the third file stored in the second processing device in the file storage list, send it through the second processing device when other devices request the third file. The specific implementation method is as the method for the scheduling device to schedule the first file described above, which will not be elaborated here.
[0343] By updating the file storage list, the scheduling device can accurately determine the files stored in the processing device and the storage device, so as to implement distributed file distribution and / or centralized file distribution, improve the scheduling accuracy of the scheduling device, and reduce the situation of file distribution errors.
[0344] The following provides multiple specific examples in combination with any of the above embodiments:
[0345] Example 1
[0346] The working schematic diagram of the file distribution system is as Figure 5 described, and the specific working process of the file distribution system includes:
[0347] Step 501: Upload the original file. The business system sends the original file to the scheduling device, and the scheduling system may store the original file in the storage device or send it to the processing device when needed. The scheduling device records the storage location of each file (such as the storage device or the processing device) through the file storage list. The second processing device sends the file list (file hash table) of the cached files to the scheduling device to update the file storage list.
[0348] Step 502: Issue tasks. The business system sends a business instruction to the first processing device.
[0349] Step 503: Request the first file. The first processing device requests the first file from the scheduling device.
[0350] Step 504: Interactive instruction. If the scheduling device determines according to the file storage list that the second processing device caches the first file, it sends an interactive instruction to instruct the first processing device and the second processing device to establish a transmission connection.
[0351] Specifically, the scheduling device can initiate a "quicice-gen-credentials" instruction (i.e., ICE credentials, ICE Gen Credentials) to the second processing device through the DMS system. At the same time, it initiates a "quicice-gen-credentials" request to the first processing device. The first processing device can act as a client (CLIENT) in the ICE connection, and the second processing device acts as a server (SERVER). The scheduling device can send a "quicice-proxy-client" instruction to the first processing device, which includes the ICE credential information generated by the server and the file list (the first file) that the client needs to receive from the server. The scheduling device can send a "quicice-proxy-server" instruction to the second processing device, which includes the ICE credential information generated by the client and the file list (the first file) that the server needs to send.
[0352] The first processing device and the second processing device can transmit the first file over the established transport connection and enter the HTTP connection. The established peer-to-peer HTTP is: [HTTP REQUEST TO XXX.X.X.X:XXXXX] A <= P2P=> B [HTTPSERVER XXX.X.X.X:XXXXX]. The string composed of "X" is the network address.
[0353] Step 505: Respond to the P2P (peer-to-peer transmission) network result.
[0354] Example 2
[0355] A decentralized distributed file transfer method, as Figure 6 shown, includes:
[0356] Step 601: The business system sends an instruction to play the target file to the first processing device and the scheduling device. For example, it instructs the first processing device (nvr-A) to play advertisement 1.
[0357] Step 602: If the device id storing the target file (i.e., the first file) cannot be retrieved in the scheduling device, centralized file distribution is adopted.
[0358] The scheduling device downloads the target file from the storage device and sends it to the first processing device; (for example, the scheduling device downloads the target file advertisement 1 from the storage device and sends it to the first processing device).
[0359] Specifically, the business system receives a user request and uploads a new file (such as a video or music) to the scheduling device. The scheduling device calculates the hash value of the new file and stores it in the hash table (in the file save list). The scheduling device stores the file in the standard storage device and records the correspondence between the file path and the hash value in the storage device (in the file save list).
[0360] Furthermore, if the file in the file list does not exist in the hash table cache, the scheduling device directly sends the CDN address, and the edge device uses the CDN address to download the file. The edge device synchronizes the file information cached locally to the file hash table of the scheduling device at 2:00 am every day. Temporary changes (addition or deletion) to the local files of the processing device are immediately reported to the file hash table of the scheduling device.
[0361] Step 603: If the device ID storing the target file can be retrieved in the scheduling device, distributed file distribution is adopted.
[0362] The scheduling device determines the device ID corresponding to the target file according to the file save list; selects the device storing the target file and closest to the first processing device as the second processing device; among them, there may be multiple devices storing the same file.
[0363] Step 604: The scheduling device sends interaction instructions to the first processing device (receiving device) and the second processing device respectively, so that the first processing device and the second processing device can obtain each other's addresses and establish a communication connection; among them, the number of candidate nodes and the specific type of communication connection to be established are determined by the network environment of the device. For example, whether there is a local IPv6 address, whether there are multiple network cards, whether there is a local IPv4 address, whether there is a STUN mapping address, whether there is a TURN mapping address, and the selection priority is: local > STUN mapping address (P2P direct connection) > TURN mapping address (relay);
[0364] Specifically, the business system issues tasks (such as video playback tasks and music playback tasks) to the first processing device (here, the node can be understood as terminal devices such as NVR devices and digital signage players). The first processing device requests the file list required in the task from the scheduling device. The scheduling device retrieves the hash table cache to find out whether the files in the file list exist in the hash table cache (using Redis GEO technology).
[0365] If the files in the file list exist in the hash table cache, the Redis GEO technology is used to schedule the device to select the optimal second processing device (such as the second processing device with the closest location) from multiple second processing devices. The scheduling device can initiate the "quicice-gen-credentials" instruction (i.e., ICE credentials, ICE Gen Credentials) to the second processing device through the DMS system. At the same time, a "quicice-gen-credentials" request is sent to the first processing device. The first processing device can act as a client (CLIENT) in the ICE connection, and the second processing device acts as a server (SERVER). The scheduling device can send the "quicice-proxy-client" instruction to the first processing device, which includes the ICE credential information generated by the server side and the file list (the first file) that the client needs to receive from the server side. The scheduling device can send the "quicice-proxy-server" instruction to the second processing device, which includes the ICE credential information generated by the client side and the file list (the first file) that the server side needs to send.
[0366] Step 605: Establish a file transfer connection between the first processing device (receiving device) and the second processing device. This includes establishing an ice connection (the bottom layer P2P), establishing a quic connection (responsible for establishing a reliable streaming transmission and encryption on udp), and establishing an http connection (for file download services), which are stacked up.
[0367] Specifically, the first processing device and the second processing device can first establish an ICE connection. During the process of establishing the ICE connection, the first processing device and the second processing device can first perform connectivity checks. The first processing device and the second processing device test candidate address combinations, detect whether these combinations can be connected by sending STUN binding requests, score and sort them, and preferentially test the paths that are expected to be faster / more reliable. After determining the path, the first processing device and the second processing device can perform candidate pair optimization and connection confirmation. After successfully establishing the connection, ICE will select the optimal candidate address pair, called the nominated pair. Once the detection is successful and confirmed, communication can be carried out on this path. After the ICE connection is established, the first processing device and the second processing device can set up the QUIC network transport protocol on top of the ICE connection to achieve stable two-way encrypted data transmission. After the QUIC connection is established, the device acting as the server (the second device) will set up an HTTP server on the QUIC connection, and the device acting as the client (the first device) will set up an HTTP client on the QUIC connection. According to the file list (the list of the first file) in the interaction instruction sent by the previous scheduling device, subsequent file distributed distribution and transmission can be carried out.
[0368] An embodiment of the present disclosure further provides a file transmission system, including: a scheduling device, a first processing device, and a second processing device.
[0369] The specific implementation manners of the scheduling device, the first processing device, and the second processing device are as described in any of the above embodiments, and will not be repeated here.
[0370] An embodiment of the present disclosure further provides a file transmission device, as Figure 7 shown. The file transmission device 10 includes:
[0371] A transceiver module 11, configured to receive file request information sent by the first processing device, where the file request information is used to indicate a first file requested by the first processing device;
[0372] The transceiver module is further configured to, in response to the file save list recording a second processing device storing the first file, send interaction instructions to the first processing device and the second processing device respectively to establish a transmission connection between the first processing device and the second processing device, where the transmission connection is used for the first processing device to obtain the first file from the second processing device, and the first processing device and the second processing device are peer entities in the network.
[0373] In some embodiments, the apparatus further comprises:
[0374] A processing module 12, configured to, in response to the file save list recording N second processing devices storing the first file, determine, based on the device status information respectively corresponding to the N second processing devices, a second processing device that establishes a transmission connection with the first processing device from the N second processing devices, where N is an integer greater than or equal to 2;
[0375] The transceiver module is further configured to send interaction instructions to the first processing device and a second processing device determined from the N second processing devices respectively.
[0376] In some embodiments, the first file is indicated by the hash value of the first file.
[0377] In some embodiments, the transceiver module is further configured to:
[0378] Send a first interaction instruction for establishing the transmission connection to the first processing device, where the first interaction instruction is at least used to indicate the first file received by the first processing device from the second processing device;
[0379] Send a second interaction instruction for establishing the transmission connection to the second processing device, where the second interaction instruction is at least used to indicate the first file sent by the second processing device to the second processing device.
[0380] In some embodiments, the transmission connection includes:
[0381] An ICE connection between the first processing device and the second processing device;
[0382] A Quick User Space Protocol Internet connection (QUIC) between the first processing device and the second processing device established based on the ICE connection;
[0383] A Hypertext Transfer Protocol connection between the first processing device and the second processing device established based on the QUIC.
[0384] In some embodiments, the transceiver module is further configured to, in response to the file save list not recording a second processing device storing the first file, send a scheduling instruction to instruct the first processing device to obtain the first file from the storage device associated with the scheduling device.
[0385] In some embodiments, the transceiver module is further configured to receive first update information sent by the first processing device, the device includes a processing module, and the processing module is configured to update the file storage list based on the first update information, where the first update information is used to indicate a second file stored in the first processing device; and / or
[0386] The transceiver module is further configured to receive second update information sent by the second processing device, and the processing module is configured to update the file storage list based on the second update information, where the second update information is used to indicate a third file stored in the second processing device; and / or
[0387] The transceiver module is further configured to receive a fourth file sent by the service system and store the fourth file in the storage device associated with the scheduling device, and the device processing module is configured to update the file storage list to record the storage location of the fourth file in the storage device.
[0388] Embodiments of the present disclosure further provide a file transfer device, as Figure 8 shown, the file transfer device 20 includes:
[0389] A transceiver module 21, configured to send file request information to a scheduling device, where the file request information is used to indicate a first file requested by the first processing device;
[0390] The transceiver module is further configured to receive an interaction instruction sent by the scheduling device, where the interaction instruction is sent by the scheduling device in response to a second processing device storing the first file recorded in the file storage list; the first processing device and the second processing device are peer entities in the network;
[0391] A processing module 22, configured to establish a transmission connection between the first processing device and the second processing device based on the interaction instruction;
[0392] The transceiver module is further configured to obtain the first file from the second processing device through the transmission connection.
[0393] In some embodiments, in response to the file storage list recording N second processing devices storing the first file, the second processing device that establishes a transmission with the first processing device is determined by the scheduling device from the N second processing devices based on device status information respectively stored in the N second processing devices, where N is an integer greater than or equal to 2.
[0394] In some embodiments, the first file is indicated by a hash value of the first file.
[0395] In some embodiments, the transceiver module is specifically configured to:
[0396] Receive a first interaction instruction for establishing the transmission connection sent by the scheduling device, where the first interaction instruction is at least used to indicate a first file received by the first processing device from the second processing device.
[0397] In some embodiments, the processing module is specifically configured to:
[0398] Establish an ICE connection between the first processing device and the second processing device;
[0399] Based on the ICE connection, establish a Quick UDP Internet Connections (QUIC) between the first processing device and the second processing device;
[0400] Based on the QUIC, establish a Hypertext Transfer Protocol connection between the first processing device and the second processing device.
[0401] In some embodiments, the transceiver module is further configured to:
[0402] Receive a scheduling instruction, and obtain the first file from a storage device associated with the scheduling device based on the scheduling instruction, where the scheduling instruction is sent by the scheduling device when it determines that the file storage list does not record the second processing device storing the first file.
[0403] In some embodiments, the transceiver module is further configured to:
[0404] Send first update information to the scheduling device, where the first update information is used to indicate a second file stored by the first processing device; the first update information is used for the scheduling device to update the file storage list.
[0405] Embodiments of the present disclosure further provide a file transmission device, as Figure 9 shown, the file transmission device 30 includes:
[0406] The transceiver module 31 is configured to receive an interaction instruction sent by a scheduling device, where the interaction instruction is sent by the scheduling device in response to receiving file request information sent by a first processing device, and the file storage list records the second processing device storing the first file; where the file request information is used to indicate a first file requested by the first processing device; the first processing device and the second processing device are peer entities in the network;
[0407] The processing module 32 is configured to establish a transmission connection between the first processing device and the second processing device based on the interaction instruction;
[0408] The transceiver module is further configured to send the first file to the first processing device through the transmission connection.
[0409] In some embodiments, the first file is indicated by the hash value of the first file.
[0410] In some embodiments, the transceiver module is further configured to:
[0411] Receive a second interaction instruction sent by the scheduling device for establishing the transmission connection, where the second interaction instruction is at least used to indicate the first file sent by the second processing device to the second processing device.
[0412] In some embodiments, the processing module is specifically configured to:
[0413] Establish an ICE connection between the first processing device and the second processing device;
[0414] Based on the ICE connection, establish a Quick User Space Protocol Internet Connection (QUIC) between the first processing device and the second processing device;
[0415] Based on the QUIC, establish a Hypertext Transfer Protocol connection between the first processing device and the second processing device.
[0416] In some embodiments, the transceiver module is further configured to:
[0417] Send second update information to the scheduling device, where the second update information is used to indicate a third file stored by the second processing device; the second update information is used for the scheduling device to update the file storage list.
[0418] It should be understood that the division of each unit or module in the above device is only a division of logical functions. In actual implementation, it can be fully or partially integrated into a physical entity, or physically separated. In addition, the units or modules in the device can be implemented in the form of a processor calling software. For example, the device includes a processor, the processor is connected to a memory, and instructions are stored in the memory. The processor calls the instructions stored in the memory to implement any of the above methods or the functions of each unit or module of the above device. The processor is, for example, a general-purpose processor, such as a central processing unit (CPU) or a microprocessor, and the memory is a memory inside or outside the device. Alternatively, the units or modules in the device can be implemented in the form of hardware circuits, and the functions of some or all of the units or modules can be implemented through the design of the hardware circuits. The above hardware circuits can be understood as one or more processors. For example, in one implementation, the above hardware circuit is an application-specific integrated circuit (ASIC), and the functions of some or all of the above units or modules are implemented through the design of the logical relationship between the components in the circuit. Again, in another implementation, the above hardware circuit can be implemented through a programmable logic device (PLD). Taking a field programmable gate array (FPGA) as an example, it can include a large number of logic gate circuits, and the connection relationship between the logic gate circuits is configured through a configuration file, so as to implement the functions of some or all of the above units or modules. All units or modules of the above device can be all implemented in the form of a processor calling software, or all implemented in the form of hardware circuits, or some implemented in the form of a processor calling software, and the remaining part implemented in the form of hardware circuits.
[0419] In the embodiments of the present disclosure, a processor is a circuit with data processing capabilities. In one implementation, the processor can be a circuit with instruction reading and running capabilities, such as a central processing unit (CPU), a microprocessor, a graphics processing unit (GPU) (which can be understood as a type of microprocessor), or a digital signal processor (DSP), etc.; in another implementation, the processor can achieve certain functions through the logical relationship of hardware circuits, and the logical relationship of the above hardware circuits is fixed or can be reconfigured. For example, the processor is a hardware circuit implemented by an application-specific integrated circuit (ASIC) or a programmable logic device (PLD), such as an FPGA. In a reconfigurable hardware circuit, the process of the processor loading a configuration document to implement the configuration of the hardware circuit can be understood as the process of the processor loading instructions to implement the functions of some or all of the above units or modules. In addition, it can also be a hardware circuit designed for artificial intelligence, which can be understood as a type of ASIC, such as a neural network processing unit (NPU), a tensor processing unit (TPU), a deep learning processing unit (DPU), etc.
[0420] Figure 10 FIG. 4 is a schematic structural diagram of an electronic device 9100 provided by an embodiment of the present disclosure. The electronic device 9100 can be a computer device, a terminal, or a chip, a chip system, or a processor, etc. that supports the implementation of any of the above methods. The electronic device 9100 can be used to implement the file transfer method described in the above method embodiments, and specific reference can be made to the descriptions in the above method embodiments.
[0421] As Figure 10 shown in FIG. 4, the electronic device 9100 includes one or more processors 9101. The processor 9101 can be a general-purpose processor or a special-purpose processor, etc. The processor 9101 is used to call instructions to enable the electronic device 9100 to execute any of the above file transfer methods.
[0422] In some embodiments, the electronic device 9100 further includes one or more memories 9102 for storing instructions. Optionally, all or part of the memories 9102 can also be outside the electronic device 9100.
[0423] In some embodiments, the electronic device 9100 further includes one or more transceivers 9103. When the electronic device 9100 includes one or more transceivers 9103, steps such as sending, receiving, and / or obtaining in the above method are executed by the transceiver 9103, and other steps are executed by the processor 9101.
[0424] In some embodiments, steps such as obtaining in the above method may also be executed by the processor 9101, such as obtaining information from the memory 9102 and the like.
[0425] In some embodiments, the transceiver may include a receiver and a transmitter, and the receiver and the transmitter may be separate or integrated together. Optionally, terms such as transceiver, transceiver unit, transceiver machine, transceiver circuit, etc. may be replaced with each other, terms such as transmitter, transmitter unit, transmitter machine, transmitter circuit, etc. may be replaced with each other, and terms such as receiver, receiver unit, receiver machine, receiver circuit, etc. may be replaced with each other.
[0426] Optionally, the electronic device 9100 further includes one or more interface circuits 9104. The interface circuit 9104 is connected to the memory 9102. The interface circuit 9104 can be used to receive signals from the memory 9102 or other devices, and can be used to send signals to the memory 9102 or other devices. For example, the interface circuit 9104 can read the instructions stored in the memory 9102 and send the instructions to the processor 9101.
[0427] The electronic device 9100 described in the above embodiments can be a network device or a terminal, but the scope of the electronic device 9100 described in the present disclosure is not limited thereto, and the structure of the electronic device 9100 can be Figure 10 unrestricted. The electronic device can be an independent device or can be a part of a larger device. For example, the electronic device can be: (1) an independent integrated circuit IC, or chip, or chip system or subsystem; (2) a set of one or more ICs. Optionally, the above IC set may also include a storage component for storing data and programs; (3) an ASIC, such as a modem; (4) a module that can be embedded in other devices; (5) a receiver, a terminal device, a smart terminal device, a cellular phone, a wireless device, a handheld device, a mobile unit, a vehicle-mounted device, a network device, a cloud device, an artificial intelligence device, etc.; (6) others, etc.
[0428] Those of ordinary skill in the art will understand that all or part of the steps of implementing the above method embodiments can be completed by hardware related to program commands. The aforementioned program can be stored in a storage medium, and the storage medium includes: various media that can store program codes such as removable storage devices, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical discs.
[0429] Alternatively, if the above integrated units of the present application are implemented in the form of software function modules and sold or used as independent products, they can also be stored in a computer-readable storage medium. Based on such an understanding, the technical solutions of the embodiments of the present application, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several commands for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the methods described in the various embodiments of the present application. And the aforementioned storage medium includes: various media that can store program codes such as removable storage devices, ROM, RAM, magnetic disks, or optical discs.
[0430] It should be understood that the above embodiments are all exemplary and do not cover all possible implementation manners. Without departing from the scope of the present disclosure, various deformations and changes can be made on the basis of the above embodiments. Similarly, the various technical features of the above embodiments can also be arbitrarily combined to form additional embodiments of the present invention that may not be clearly described. Therefore, the above embodiments only represent several implementation manners of the present invention and do not limit the protection scope of the present invention patent.
Claims
1. A file transfer method, characterized in that, The method is executed by a scheduling device, and the file transfer method includes: Receiving file request information sent by a first processing device, where the file request information is used to indicate a first file requested by the first processing device; In response to the file storage list recording a second processing device storing the first file, sending interaction instructions to the first processing device and the second processing device respectively to establish a transmission connection between the first processing device and the second processing device, where the transmission connection is used for the first processing device to obtain the first file from the second processing device, and the first processing device and the second processing device are peer entities in the network.
2. The file transfer method according to claim 1, characterized in that, The step of, in response to the file storage list recording a second processing device storing the first file, sending interaction instructions to the first processing device and the second processing device respectively includes: In response to the file storage list recording N second processing devices storing the first file, determining, based on the device status information respectively corresponding to the N second processing devices, a second processing device to establish a transmission connection with the first processing device from the N second processing devices, where N is an integer greater than or equal to 2; Sending interaction instructions to the first processing device and a second processing device determined from the N second processing devices respectively.
3. The file transfer method according to claim 1, wherein The step of sending interaction instructions to the first processing device and the second processing device respectively includes: Sending a first interaction instruction for establishing the transmission connection to the first processing device, where the first interaction instruction is at least used to indicate the first file received by the first processing device from the second processing device; Sending a second interaction instruction for establishing the transmission connection to the second processing device, where the second interaction instruction is at least used to indicate the first file sent by the second processing device to the first processing device.
4. The file transfer method according to claim 1, characterized in that, The transmission connection includes: An ICE connection between the first processing device and the second processing device; A Quick UDP Internet Connections (QUIC) between the first processing device and the second processing device established based on the ICE connection; A Hypertext Transfer Protocol (HTTP) connection between the first processing device and the second processing device established based on the QUIC.
5. The file transfer method according to any one of claims 1 to 4, characterized in that The method further includes: In response to the file storage list not recording a second processing device storing the first file, sending a scheduling instruction to instruct the first processing device to obtain the first file from the storage device associated with the scheduling device.
6. The file transfer method according to any one of claims 1 to 4, characterized in that The method further includes at least one of the following: Receiving first update information sent by the first processing device and updating the file storage list based on the first update information, where the first update information is used to indicate a second file stored by the first processing device; Receiving second update information sent by the second processing device and updating the file storage list based on the second update information, where the second update information is used to indicate a third file stored by the second processing device; Receive the fourth file sent by the service system, store the fourth file in the storage device associated with the scheduling device, and update the file save list to record the storage location of the fourth file in the storage device.
7. A file transfer method, characterized in that, The method is executed by a first processing device, and the file transfer method includes: Send file request information to the scheduling device, where the file request information is used to indicate the first file requested by the first processing device; Receive an interaction instruction sent by the scheduling device, where the interaction instruction is sent by the scheduling device in response to the file save list recording a second processing device storing the first file; the first processing device and the second processing device are peer entities in the network; Based on the interaction instruction, establish a transmission connection between the first processing device and the second processing device; Obtain the first file from the second processing device through the transmission connection.
8. The file transfer method according to claim 7, wherein The method further includes: Send first update information to the scheduling device, where the first update information is used to indicate the second file stored by the first processing device; the first update information is used for the scheduling device to update the file save list.
9. A file transfer method, characterized in that, The method is executed by a second processing device, and the method includes: Receive an interaction instruction sent by the scheduling device, where the interaction instruction is sent by the scheduling device in response to receiving file request information sent by a first processing device, and the file save list records a second processing device storing the first file; where the file request information is used to indicate the first file requested by the first processing device; the first processing device and the second processing device are peer entities in the network; Based on the interaction instruction, establish a transmission connection between the first processing device and the second processing device; Send the first file to the first processing device through the transmission connection.
10. The file transfer method according to claim 9, characterized in that, The method further includes: Send second update information to the scheduling device, where the second update information is used to indicate the third file stored by the second processing device; the second update information is used for the scheduling device to update the file save list.
11. A file transfer device, characterized in that, The device includes: A transceiver module, configured to receive file request information sent by a first processing device, where the file request information is used to indicate the first file requested by the first processing device; The transceiver module is further configured to, in response to the file save list recording a second processing device storing the first file, send interaction instructions to the first processing device and the second processing device respectively to establish a transmission connection between the first processing device and the second processing device, where the transmission connection is used for the first processing device to obtain the first file from the second processing device, where the second processing device is different from the storage device associated with the scheduling device.
12. A file transfer device, characterized in that, The device includes: A transceiver module, configured to send file request information to the scheduling device, where the file request information is used to indicate the first file requested by the first processing device; The transceiver module is further configured to receive an interaction instruction sent by a scheduling device, where the interaction instruction is sent by the scheduling device in response to a second processing device storing the first file recorded in a file save list; the first processing device and the second processing device are peer entities in the network; A processing module, configured to establish a transmission connection between the first processing device and the second processing device based on the interaction instruction; The transceiver module is further configured to obtain the first file from the second processing device through the transmission connection.
13. A file transfer device, characterized in that, The apparatus includes: A transceiver module, configured to receive an interaction instruction sent by a scheduling device, where the interaction instruction is sent by the scheduling device in response to receiving file request information sent by a first processing device, and a second processing device storing the first file is recorded in a file save list; where the file request information is used to indicate the first file requested by the first processing device; the first processing device and the second processing device are peer entities in the network; A processing module, configured to establish a transmission connection between the first processing device and the second processing device based on the interaction instruction; The transceiver module is further configured to send the first file to the first processing device through the transmission connection.
14. A file transfer system, characterized in that, The file transmission system includes: A scheduling device, configured to implement the file transmission method according to any one of claims 1 to 6; A first processing device, configured to implement the file transmission method according to claim 7 or 8; A second processing device, configured to implement the file transmission method according to claim 9 or 10.
15. An electronic device, characterized in that, The electronic device includes: One or more processors; Wherein, the processor is configured to call an instruction to cause the electronic device to execute the file transmission method according to any one of claims 1 to 10.
16. A storage medium, characterized in that, The storage medium stores an instruction, which, when running on an electronic device, causes the electronic device to execute the file transmission method according to any one of claims 1 to 10.
Citation Information
Patent Citations
Media content sharing system, routing management system and Social media platform method
CN108319629A
Real-time streaming media data transmission method, device and system and storage medium
CN115473876A
System and methods of streaming media files from a dispersed peer network to maintain quality of service
US20030204613A1
Method and system for distributing file
US20070198636A1