Data download method, device, and computer device
The method optimizes data download in CDNs by selecting and slicing data based on fog node protocols, improving efficiency and reducing costs through protocol-compatible data retrieval.
Patent Information
- Application Number
- JP2023526436
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Priority Date
- 2021-05-17
- Filing Date
- 2022-04-08
- Publication Date
- 2024-11-11
- Estimated Expiration
- 2042-04-08
AI Technical Summary
The challenge of managing data downloads in a content distribution network (CDN) is exacerbated by the use of edge devices with different communication protocols, leading to inefficiencies and increased bandwidth costs due to the need for compatible data download methods.
A data download method that involves inquiring fog node information, determining a target fog node based on communication protocol type, performing slicing processing on the data, and transmitting slice requests to optimize data retrieval from multiple fog nodes with varying protocols.
This approach enhances data download efficiency and reduces bandwidth costs by utilizing fog nodes with compatible protocols, ensuring high-quality content delivery while optimizing resource utilization.
Smart Images

Figure 0007580600000001 
Figure 0007580600000002 
Figure 0007580600000003
Abstract
Description
[Technical field]
[0001] The present application relates to the field of computer technology, and in particular to a data download method, device, computer device, and storage medium.
[0002] This application claims priority to a Chinese patent application filed with the China Patent Office on May 17, 2021, bearing application number 2021105316392 and entitled "Data Downloading Method, Apparatus, Computer Equipment, and Storage Medium", the entire contents of which are incorporated herein by reference. [Background technology]
[0003] Benefiting from the wide application of various video media platforms, more and more users choose to watch multimedia through multimedia platforms. When a user watches multimedia, the multimedia platform can download corresponding multimedia resources from a content distribution network, and play multimedia according to the downloaded and acquired multimedia data.
[0004] However, with the expansion of the network scale, in order to ensure the download speed of multimedia data from the content delivery network, a large number of cache servers are required to maintain sufficient network bandwidth, which significantly increases the bandwidth cost. At present, the data download burden is mainly shared by edge devices in the content delivery network to reduce the bandwidth burden of the content delivery network. However, different edge devices may adopt different communication protocols, which requires different communication protocol types and compatible data download methods. Summary of the Invention [Problem to be solved by the invention]
[0005] The embodiments of the present application provide a data downloading method, an apparatus, a computer device, a storage medium, and a computer program product.
[0006] 1. A method for downloading data, comprising the steps of: When obtaining a data download request for target data, inquiring fog node information of at least one fog node corresponding to the target data, where the fog node information includes at least a communication protocol type of the fog node; determining a target fog node from among the at least one fog node based on the fog node information; performing a slice process on the target data to be downloaded according to a communication protocol type of the target fog node, and obtaining slice information of the slice data to be downloaded; sending a slice download request to a target fog node corresponding to the slice data to be downloaded according to slice information of the slice data to be downloaded; and obtaining target data by combining the slice data returned by each target fog node in response to the corresponding slice download request.
[0007] 1. A data download device, comprising: a target node determination module used for: inquiring fog node information of at least one fog node corresponding to target data when obtaining a data download request for the target data, the fog node information including at least a communication protocol type of the fog node; and determining a target fog node among the at least one fog node based on the fog node information; A slice module is used for performing slice processing on the target data to be downloaded according to a communication protocol type of the target fog node, and obtaining slice information of the slice data to be downloaded; The method includes a request sending module used for: sending a slice download request to a target fog node corresponding to the slice data to be downloaded based on slice information of the slice data to be downloaded; and obtaining target data by combining the slice data returned by each target fog node in response to the corresponding slice download request.
[0008] A computer device comprising a memory and a processor, the memory storing a computer program, the processor executing the computer program, When obtaining a data download request for target data, inquiring fog node information of at least one fog node corresponding to the target data, where the fog node information includes at least a communication protocol type of the fog node; determining a target fog node from among the at least one fog node based on the fog node information; performing a slice process on the target data to be downloaded according to a communication protocol type of the target fog node, and obtaining slice information of the slice data to be downloaded; sending a slice download request to a target fog node corresponding to the slice data to be downloaded according to slice information of the slice data to be downloaded; and obtaining target data by combining the slice data returned by each target fog node in response to the corresponding slice download request.
[0009] A computer-readable storage medium having a computer program stored thereon, the computer program, when executed by a processor, When obtaining a data download request for target data, inquiring fog node information of at least one fog node corresponding to the target data, where the fog node information includes at least a communication protocol type of the fog node; determining a target fog node from among the at least one fog node based on the fog node information; performing a slice process on the target data to be downloaded according to a communication protocol type of the target fog node, and obtaining slice information of the slice data to be downloaded; sending a slice download request to a target fog node corresponding to the slice data to be downloaded according to slice information of the slice data to be downloaded; and obtaining target data by combining the slice data returned by each target fog node in response to the corresponding slice download request.
[0010] A computer program product or a computer program, the computer program product or the computer program including computer instructions, the computer instructions being stored in a computer-readable storage medium, a processor of a computer device reading the computer instructions from the computer-readable storage medium, the processor executing the computer instructions to cause the computer device to perform the following steps when obtaining a data download request for target data: inquiring fog node information of at least one fog node corresponding to the target data, the fog node information including at least a communication protocol type of the fog node; determining a target fog node from the at least one fog node based on the fog node information; performing slicing on the target data to be downloaded based on the communication protocol type of the target fog node to obtain slice information of the slice data to be downloaded; sending a slice download request to a target fog node corresponding to the slice data to be downloaded based on the slice information of the slice data to be downloaded; and combining and obtaining the target data based on the slice data returned by each target fog node in response to the corresponding slice download request. [Brief description of the drawings]
[0011] [Figure 1] FIG. 2 is an application environment diagram of the data download method in one embodiment. [Diagram 2] 1 is a flow chart of a method for downloading data in one embodiment. [Diagram 3] FIG. 1 is a schematic diagram of downloading target data based on PCDN SDK in one embodiment; [Figure 4] FIG. 2 is an architecture diagram of data download in one embodiment. [Diagram 5] FIG. 2 is a schematic diagram of slice data download in one embodiment. [Figure 6]FIG. 1 is an interaction diagram of data download in one embodiment. [Figure 7] 4 is a flow chart of data download in one specific embodiment. [Figure 8] 4 is a flow chart of data download in one specific embodiment. [Figure 9] FIG. 2 is a structural block diagram of a data download device in one embodiment. [Figure 10] FIG. 2 is a structural block diagram of a data download device in one embodiment. [Figure 11] 1 is a diagram showing the internal structure of a computer device according to one embodiment. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0012] FIG. 1 is an application environment diagram describing a data download method in an embodiment. As shown in FIG. 1, the data download method is applied to a data download system 100. The data download system 100 includes a computer device 102 and a fog node 104. When the computer device 102 obtains a data download request for target data, the computer device 102 can select a target fog node from the fog nodes 104, and perform slicing processing on the target data to obtain slice information. The computer device 102 sends the slice information corresponding to the target fog node to download slice data from the target fog node, thereby achieving the purpose of obtaining the target data. Here, the computer device 102 can be, but is not limited to, various personal computers, notebook computers, smartphones, tablet computers, servers, and portable wearable devices, and the fog node 104 can be an edge device in a content distribution network, where the edge device can be a router, a user terminal, etc.
[0013] As can be easily understood, a cache server may be further included in the content delivery network, which may be an independent physical server, or a server cluster or a distributed system composed of multiple physical servers, and may further be a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, and big data and artificial intelligence platforms.
[0014] In the related art, when a user uses a Content Delivery Network (CDN) to download data, he or she needs to use his or her terminal or server as an edge device to access the CDN, and the edge device has a certain available bandwidth, so that many edge devices with certain network bandwidth resources are connected in the CDN. At the same time, the edge devices have downloaded some data from the CDN, so each edge device may have some data in the CDN cache server. Therefore, the edge devices in the CDN cache data information and have available bandwidth, so that the edge devices can be used as resource providers for data downloading to share the burden of data downloading of the cache server in the CDN.
[0015] The technical means provided by this application further relates to the technical field of cloud, specifically to cloud storage technology in cloud technology. Cloud storage is a new concept that has developed from the concept of cloud computing, and a distributed cloud storage system (hereinafter referred to as storage system) refers to a storage system that uses functions such as cluster application, grid technology, and distributed storage file system to gather and cooperate with many different types of storage devices (storage devices are also called storage nodes) in a network through application software or application interface, and jointly provides data storage and business access functions to the outside.
[0016] In addition, the technical means provided by the present application further relates to block chain technology, for example, slice data to be downloaded can be stored in block chain. Block chain is a new application mode of computer technology, such as distributed data storage, peer-to-peer transmission, consensus mechanism, and encryption algorithm. Block chain is essentially a decentralized database, a series of data blocks related to each other using cryptographic methods, each data block contains information of a batch of network transactions, and is used to verify the validity of the information (anti-counterfeiting) and generate the next block. Block chain may include a block chain bottom layer platform, a platform product service layer, and an application service layer.
[0017] In one embodiment, a data downloading method is provided, as shown in Fig. 2. The method is taken as an example to be applied to the computer device 102 in Fig. 1, where the computer device may be a server or a terminal. For a better understanding of the present application, the following takes the computer device as an example to be a terminal, and the data downloading method includes the following steps S202 to S210.
[0018] S202: When obtaining a data download request for the target data, inquire about fog node information of at least one fog node corresponding to the target data, where the fog node information at least includes a communication protocol type of the fog node.
[0019] Here, the fog node refers to an edge device in a CDN, and the edge device refers to a device located in a CDN edge network. In one specific embodiment, the edge device may specifically be a router in a CDN, a user terminal, etc. In general, the fog node is closer to a user and has more idle, high-quality, and low-cost bandwidth than the cache server located in the CDN. Here, the cache server refers to a server in a content delivery network where data to be downloaded is cached.
[0020] The fog node information refers to information related to a fog node, and the fog node information may include the fog node's equipment type, available resource information, and adopted communication protocol type, etc. Here, the equipment type refers to information reflecting the type of the fog node, for example, the fog node's equipment type may be a router, a user terminal, etc. The available resource information refers to information reflecting the available computer resources in the fog node, and for example, the available resource information may specifically include available bandwidth information, available memory information, etc.
[0021] The communication protocol type refers to the type of communication protocol adopted by the fog node, and the communication protocol type may specifically include a reliable two-way communication protocol type, a connectionless communication protocol type, etc. The reliable two-way communication protocol type refers to a communication protocol type that can perform reliable transmission, under which the integrity of transmitted data can be ensured and there is no need to deal with the problem of packet loss. The connectionless communication protocol type refers to a connectionless transmission layer protocol type, which can provide transaction-oriented simple and unreliable data transfer.
[0022] Specifically, when a data download request for the target data is obtained, the terminal can inquire from the content delivery network which fog node stores the target data, and obtain the fog node information of the fog node where the target data is stored. In one embodiment, the content delivery network further includes a query server used for storing the fog node information of each fog node. When a data download request is received, the terminal can inquire from the query server which fog node stores the target data, and obtain the fog node information of the fog node where the target data is stored. Here, the query server refers to a server that records data downloaded by a fog node that accesses a CDN. When a fog node downloads data from a pre-configured cache server, the query server can record a data identifier of the data downloaded by the fog node, so that when the terminal receives a data download request for the target data, the terminal can inquire from the query server which fog node has already downloaded the target data based on the data identifier of the target data. Here, the cache server refers to a server where the complete target data is cached.
[0023] In one embodiment, the step of inquiring fog node information of at least one fog node corresponding to the target data when a data download request for the target data is obtained includes the steps of determining a fog node set corresponding to the target data based on a data identifier of the target data when a data download request for the target data is obtained, and obtaining available resource information of each fog node in the fog node set, establishing a transparent connection between each fog node in the fog node set, and determining a communication protocol type of each fog node in the fog node set based on the transparent connection.
[0024] Specifically, when a data download request for the target data is obtained, the terminal determines a data identifier of the target data, and queries the fog nodes that have already downloaded the target data from the query server according to the data identifier, to obtain a fog node set. Available resource information corresponding to each fog node may be further stored in the query server, so that when the fog node set is obtained, the terminal can further obtain available resource information corresponding to each fog node in the fog node set.
[0025] Furthermore, the terminal can issue a transparent connection request to each fog node in the fog node set, and have the fog node return a transparent request feedback to the terminal based on the transparent connection request. Thus, the terminal can establish a transparent connection with the fog node based on the transparent request feedback, i.e., establish a communication connection. When a transparent connection is established between the terminal and the fog node, the terminal can send a protocol detection request to the fog node based on the established transparent connection, and detect a communication protocol type adopted by the fog node through the protocol detection request.
[0026] In one embodiment thereof, the terminal can issue a transparent connection request to the fog node based on the Session Traversal Utilities for NAT (STUN) protocol.
[0027] In one embodiment, the fog node can return a protocol detection request feedback to the terminal based on the protocol detection request, and return a communication protocol type to be adopted through the protocol detection request feedback. Here, the communication protocol type returned by the fog node can include a reliable two-way communication protocol type, a connectionless communication protocol type, and an unknown protocol type. Here, the reliable two-way communication protocol can be specifically a Cable protocol, and the connectionless communication protocol can be specifically a UDP protocol. The Cable protocol is a transmission protocol that adds a reliable module based on the UDP protocol, belongs to the reliable UDP protocol, and has the following characteristics: 1. The interface of the Cable and the UDP protocol are completely the same, i.e., the usage method is completely the same; 2. Cable is a reliable protocol and does not need to actively handle packet loss; 3. Cable belongs to a reliable two-way protocol, i.e., to ensure reliable transmission, both communication parties need to use the Cable protocol; and 4. The Cable protocol is compatible with the UDP protocol. The UDP protocol (User Datagram Protocol) refers to a connectionless transmission layer protocol in the OSI (Open System Interconnection) reference model, which can provide a simple, unreliable, transaction-oriented information transfer service.
[0028] In one embodiment, when a fog node indicates that it supports the UDP protocol, it can send a protocol type of the UDP protocol to the terminal, for example, a fog node in which an unupdated program in the CDN is installed can send a protocol type of the UDP protocol to the terminal. When a fog node indicates that it supports the Cable protocol, it can send a protocol type of the Cable protocol to the terminal, for example, a fog node in which an already updated program in the CDN is installed can send a protocol type of the Cable protocol to the terminal. When a fog node cannot temporarily indicate the protocol it supports, it can return an unknown protocol type to the terminal. For different communication protocol types, the terminal can use different strategies in target fog node selection and data slicing, thereby ensuring compatibility and quality of transmission.
[0029] In the above embodiment, by detecting the communication protocol type after establishing a transparent connection with a fog node in a fog node set, not only can the addition of a private protocol used for protocol type detection in the STUN standard protocol be avoided and the purity of the protocol be improved, but also, because the detection of the communication protocol type belongs to the work of the transmission layer, by detecting the communication protocol type after establishing a transparent connection with a fog node in a fog node set, the detection that should be performed by the transmission layer can be reduced by other layers in the OSI model.
[0030] S204: Determine a target fog node from among at least one fog node based on the fog node information.
[0031] Specifically, when the fog node information is acquired, the terminal can select a target fog node from the fog node set according to the fog node information. In one embodiment, the fog node information may include a communication protocol type and available resource information, and the terminal can determine a target fog node from at least one fog node according to the communication protocol type and available resource information.
[0032] S206: According to the communication protocol type of the target fog node, perform slicing processing on the target data to be downloaded, and obtain slice information of the slice data to be downloaded.
[0033] Here, the slice data corresponds to a part of data in the target data, and the slice information refers to information used to identify the corresponding data part of the target data of the slice data. The slice information may specifically include a data identifier and a data range of the target data, so that the fog node can determine the data to be transmitted to the terminal according to the data identifier and the data range.
[0034] Specifically, compared with fog nodes with connectionless or unknown communication protocols, fog nodes with reliable two-way communication protocols have better and more reliable performance. Therefore, in order to ensure download speed and download reliability, fog nodes using reliable two-way communication protocols can be fully utilized to download larger slice data to them. For example, a terminal can download slice data with a slice size of 256K from a target fog node using a reliable two-way communication protocol, and download slice data with a slice size of 128K from a target fog node using a connectionless communication protocol type.
[0035] In one embodiment, the step of performing slice processing on the target data to be downloaded and obtaining slice information of the slice data to be downloaded based on the communication protocol type of the target fog node includes a step in which the terminal determines a slice size of the slice data to be downloaded based on the communication protocol type of the target fog node, and performs slice processing on the target data to be downloaded based on the slice size determined thereby, and obtains slice information of the slice data to be downloaded.
[0036] Specifically, a slice size corresponding to each of different communication protocol types can be preset, for example, a slice size corresponding to a target fog node using a reliable two-way communication protocol is 256K, and a slice size corresponding to a target fog node using a connectionless communication protocol type is 128K. The terminal then determines the slice size corresponding to the communication protocol type as the slice size of the slice data to be downloaded, and performs slice processing on the target data to be downloaded based on the slice size, to obtain slice information of the slice data to be downloaded. For example, when the communication protocol type corresponding to the target node is a reliable two-way communication protocol type, the slice size can be determined to be 256K, and the terminal then determines the slice size of the slice data to be downloaded as 256K, and performs slice processing on the target data according to the slice size, to obtain slice information of the slice data to be downloaded. Similarly, when the communication protocol type corresponding to the target node is a connectionless communication protocol type, the slice size can be determined to be 128K.
[0037] In the above embodiment, the slice information can be determined by simply determining the communication protocol type corresponding to the target fog node, thereby improving the efficiency of determining the slice information. S208: According to the slice information of the slice data to be downloaded, send a slice download request to the target fog node corresponding to the slice data to be downloaded.
[0038] Specifically, when the slice information of the slice data is determined, the terminal can send the slice information to a corresponding target fog node, and allow the target fog node to return the slice data to the terminal according to the slice information, thereby realizing the download of the slice data. In one embodiment, the content distribution network includes a fog node and a cache server, and when the terminal receives a data download request for the target data, the terminal can preferentially retrieve the target data to be downloaded from the fog node, and when the target data downloaded from the fog node is not complete, download the remaining resources from the cache server. Here, the fog node and the cache server can be the same node in the CDN, or the fog node and the cache server can be different from the same node in the CDN. This embodiment is not limited here.
[0039] It should be noted that steps S204 to S208 may be performed alternately or sequentially.
[0040] In one embodiment, when steps S204 to S208 are alternately performed, the fog node information further includes available resource information of the fog node and the number of simultaneous downloads of a single node. The step of determining a target fog node from at least one fog node based on the fog node information includes a step of selecting a current target fog node from at least one fog node based on a communication protocol type, available resource information, and the number of simultaneous downloads of a single node, the step of performing slice processing on the target data to be downloaded based on the communication protocol type of the target fog node and obtaining slice information of the slice data to be downloaded includes a step of determining a target slice size used for performing slice processing based on the communication protocol type of the current target fog node, and a step of performing slice processing on the target data to be downloaded based on the target slice size and obtaining slice information of the slice data to be currently downloaded, and the step of sending a slice download request to a target fog node corresponding to the slice data to be downloaded based on the slice information of the slice data to be downloaded includes a step of sending a slice download request to a current target fog node based on the slice information of the slice data to be currently downloaded, and downloading the slice data to be currently downloaded. The data download method further includes a step of updating fog node information of the current target fog node, proceeding to a process of slice data download based on the next target fog node, and continuing to execute back to the step of selecting the current target fog node from at least one fog node based on the communication protocol type, available resource information, and the number of simultaneous downloads of a single node, until the download of all the slice data to be downloaded corresponding to the target file is completed.
[0041] Specifically, the fog node information may include the communication protocol type of the fog node, the available resource information, and the number of simultaneous downloads of a single node, and the terminal can select one best target fog node from the fog node set according to the communication protocol type, the available resource information, and the number of simultaneous downloads of a single node, and set the currently selected best target fog node as the current target fog node. The terminal can determine the communication protocol type of the current target fog node, and determine a target slice size used for slicing according to the communication protocol type, and determine slice information of the slice data currently to be downloaded according to the determined target slice size and the data range in the target data that has already been sliced.
[0042] For example, when the communication protocol of the current target fog node is a reliable two-way communication protocol type, the terminal can determine that the target slice size is 256K, so that when the target data has never been sliced, the terminal can set the data range in the slice information of the slice data to be downloaded to 0K to 256K. As can be easily understood, when the data range in the slice information of the slice data to be downloaded to 0K to 256K, it can be considered that the data in the range of 0K to 256K in the target data has already been sliced. That is, the data range in the target data that has already been sliced can be updated to 0K to 256K, so that when the slice information of the slice data to be downloaded next is determined, 256K can be used as a starting point for division. When the communication protocol type of the current target fog node is a connectionless transmission type, the terminal can determine that the target slice size is 128K, so that when the target data has never been sliced, the terminal can set the data range in the slice information of the slice data to be downloaded to 0K to 128K.
[0043] Furthermore, when the terminal acquires and obtains slice information of the slice data currently to be downloaded, the terminal generates a slice download request based on the slice information of the slice data currently to be downloaded, and sends the slice download request to the current target fog node, so as to cause the current target fog node to return the slice data to be downloaded to the terminal based on the received slice download request.
[0044] When the current fog node transmits slice data according to the slice information received, it needs to occupy a certain available resource, for example, a certain available bandwidth, so it needs to perform an update process on the fog node information of the current target fog node. The terminal determines the next target fog node, and proceeds to the process of downloading slice data according to the next target fog node, and continues to execute back to the step of selecting the current target fog node from at least one fog node according to the communication protocol type, the available resource information, and the number of simultaneous downloads of a single node, until the download of all the slice data to be downloaded corresponding to the target file is completed.
[0045] In one embodiment, when steps S204 to S208 are executed in sequence, the step of determining a target fog node from at least one fog node based on the fog node information includes a step of determining at least one target fog node from the fog nodes based on the fog node information, the step of performing slice processing on the target data to be downloaded based on the communication protocol type of the target fog node and acquiring slice information of the slice data to be downloaded includes a step of performing slice processing on the target data to be downloaded based on the communication protocol type corresponding to each of the target fog nodes and acquiring slice information of at least one slice data to be downloaded, and the step of sending a slice download request to the target fog node corresponding to each of the slice data to be downloaded based on the slice information of the slice data to be downloaded includes a step of sending a slice download request to the target fog node corresponding to each of the slice data to be downloaded based on the slice information of each slice data to be downloaded.
[0046] Specifically, the terminal can determine a target node quantity of the target fog nodes to be selected according to the data size of the target data, and select fog nodes with a target node quantity whose communication protocol type is a reliable two-way communication protocol type and whose available resources are greater than a preset resource threshold from the fog node set, and take the selected fog nodes as the target fog nodes. It can be easily understood that when the communication protocol type in the fog node set is a reliable two-way communication protocol type and the quantity of fog nodes whose available resources are greater than a preset resource threshold is smaller than the target node quantity, the terminal can further select the remaining quantity of fog nodes whose communication protocol type is a connectionless communication protocol type and whose available resources are greater than a preset resource threshold from the fog node set. For example, when the data size of the target data is 1024K, and the slice size corresponding to the set reliable two-way communication protocol is 256K, and the slice size corresponding to the connectionless communication protocol type is 128K, it can be determined that the target slice size used for performing slice processing may be 256K or 128K, and in order to distribute the slice information to each target fog node as evenly as possible and increase the download rate of the slice data, the computer equipment can divide 1024K by 128K to obtain a target node quantity of 8, so that the terminal can select 8 target fog nodes from the fog node set based on the communication protocol type and available resource information.When the fog node set includes six fog nodes adopting a reliable two-way communication protocol type and having available resources greater than a preset resource threshold, and five fog nodes adopting a connectionless communication protocol type and having available resources greater than a preset resource threshold, the terminal can take the six fog nodes adopting a reliable two-way communication protocol type and having available resources greater than a preset resource threshold as target fog nodes, and select two fog nodes from the five fog nodes adopting a connectionless communication protocol type and having available resources greater than a preset resource threshold, and also select the two selected fog nodes as target fog nodes. Furthermore, the terminal traverses each selected target fog node, determines a communication protocol type corresponding to each target fog node, and determines a target slice size corresponding to each target fog node according to the communication protocol type corresponding to each target fog node, and performs slicing on the target data according to the target slice size corresponding to each target fog node, to obtain slice information of at least one slice data to be downloaded. Here, the slice to be downloaded after slicing can constitute a complete target data. For example, when the current traversed target fog node adopts a reliable two-way communication protocol type, the terminal can determine that the target slice size used for slicing is 256K, and obtain the slice information corresponding to the current traversed target fog node according to the data range in the target data that has been sliced, and when the current traversed target fog node adopts a connectionless communication protocol type, the terminal can determine that the target slice size used for slicing is 128K, and obtain the slice information corresponding to the current traversed target fog node according to the data range in the target data that has been sliced.As can be easily understood, when the currently traversed target fog node and the corresponding slice information are determined, the terminal can further update the data range in the target data that has already been sliced, and determine the slice information corresponding to the next traversed target fog node according to the data range in the updated target data that has already been sliced. When the traversal is completed, the slice information corresponding to each target fog node can be obtained, i.e., the slice data to be downloaded corresponding to each target fog node is obtained.
[0047] Furthermore, the terminal transmits each slice information to a corresponding target fog node, and downloads slice data from the corresponding target fog node. As can be easily understood, the number of selected target fog nodes may be greater than the number of slices to be downloaded, and in this case, the terminal can download slice data from some of the target fog nodes.
[0048] In one embodiment, the terminal selects a target fog node from the fog node set, the communication protocol type of which is a reliable two-way communication protocol type and the available resource is greater than a preset resource threshold, and determines a target slice size used for slicing according to the reliable two-way communication protocol type, performs slicing on the target data according to the target slice size, and obtains slice information of at least one slice data to be downloaded. For example, when the target slice size is 256K and the data size of the target data is 1024K, the terminal can divide the target data into four slice data and generate slice information corresponding to each slice data. Furthermore, the terminal distributes the generated slice information to the target fog nodes evenly, downloads the corresponding slice data from the target fog nodes, and obtains the target data.
[0049] S210: Acquire target data by combining according to slice data returned by each target fog node in response to a corresponding slice download request.
[0050] Specifically, the terminal receives the slice data returned by each target fog node in response to the download request, and combines the received slice data to obtain target data. For example, when the target data is a target video, the terminal can combine each slice video to obtain a target video, and play the target video through a multimedia playback application.
[0051] In one embodiment, as shown in FIG. 3, a business application and a Peer Content Delivery Network Software Development Kit (PCDN SDK) may be installed in the terminal. Here, the terminal can obtain target data from the content delivery network based on the PCDN SDK, so that the business application can obtain the target data returned by the PCDN SDK by only issuing a data download request to the PCDN SDK, and the business application itself does not need to download data. Here, the PCDN SDK can download the target data by adopting the above data download method, and the PCDN SDK can preferentially download data from the fog nodes, and then download the remaining data from the cache server. FIG. 3 shows a schematic diagram of downloading target data based on the PCDN SDK in one embodiment.
[0052] In one embodiment, the reliable two-way communication protocol may be specifically a Cable protocol, and the connectionless communication protocol may be specifically a UDP protocol. Referring to FIG. 4, FIG. 4 shows an architecture diagram of data download in one embodiment. The fog node may adopt a connectionless communication protocol or a reliable two-way communication protocol, and the PCDN SDK may adopt a Cable communication protocol. Here, Cable is compatible with the UDP communication protocol. Compatibility with the UDP protocol means that a device that adopts the Cable protocol can transmit data using UDP and can also transmit data using the Cable protocol. When the PCDN SDK receives a data download request sent from a business application, the PCDN SDK can inquire about a fog node set including the target data, and establish a transparent connection with a fog node in the fog node set, and obtain a communication protocol type through the transparent connection. The PCDN SDK selects a target fog node based on the communication protocol type, and performs a slice process on the target data to be downloaded, and obtains slice information of the slice data to be downloaded. The PCDN SDK sends a slice download request carrying slice information to the target fog node according to the communication protocol type of the target fog node, thereby downloading slice data from within the target fog node.
[0053] In the prior art, terminals generally communicate with fog nodes through a connectionless communication protocol, but the transmission solution based on the connectionless communication protocol has the disadvantages of low data download speed and high retransmission bandwidth. The present application introduces a reliable two-way communication protocol under the scene of fog node slice data download, which can increase the download speed and reduce the duplication of data retransmission based on the reliable two-way communication protocol, thereby ensuring the service of a content distribution network with low cost and high quality.
[0054] In the above data download method, by obtaining a data download request for target data, fog node information of at least one fog node corresponding to the target data can be inquired based on the data download request, so that a target fog node with better equipment performance can be selected from the at least one fog node based on the fog node information, and the download rate of the target data can be increased based on the target fog node with better equipment performance. By determining the target fog node, slice processing can be performed on the target data based on the communication protocol type of the target fog node, and slice information that is more consistent with the characteristics of the target fog node can be obtained. In this way, a slice download request can be sent to the corresponding target fog node based on the slice information that is more consistent with the characteristics of the target fog node, so that slice data can be quickly downloaded from the target fog node. By downloading the slice data from the target fog node, the slice data returned by each target fog node can be combined, thereby obtaining the target data. The present application can detect the communication protocol type adopted by a fog node, and schedule and select an appropriate target fog node based on the detected and acquired communication protocol type to download corresponding slice data, so that the present application can be compatible with different communication protocol types and download slice data from target fog nodes that adopt different communication protocol types.
[0055] In one embodiment, the step of selecting a current target fog node from the at least one fog node based on a communication protocol type, available resource information, and the number of simultaneous downloads of a single node includes the step of selecting a fog node from the at least one fog node, the communication protocol type of which is a reliable two-way communication protocol type, the available resources of which meet a preset idle condition, and the number of simultaneous downloads of a single node is smaller than a quantity threshold, and setting the selected fog node as the current target fog node.
[0056] Specifically, when it is necessary to determine a current target fog node among at least one fog node, the terminal can traverse at least one fog node, and select a fog node from the at least one fog node whose communication protocol type is a reliable two-way communication protocol type, whose available resources meet a preset idle condition, and whose single-node concurrent download number is smaller than a quantity threshold, as the current target fog node. For example, one fog node can be selected from the at least one fog node whose communication protocol type is a reliable two-way communication protocol type, whose available resources are the largest, and whose single-node concurrent download number is smaller than a quantity threshold. Here, the single-node concurrent download number refers to the number of slice download requests that a single fog node processes in parallel. In order to avoid all slice download requests flowing to one fog node at the same time, it is necessary to control the number of slice download requests that a single fog node processes in parallel. Here, the number of simultaneous downloads of a single node can be freely set based on needs. For example, the number of simultaneous downloads of a single node may be set to 2, so that when the number of slice download requests processed in parallel by a fog node reaches 2, the fog node will suspend distributing new slice download requests to the fog node, and continue until the number of slice download requests processed in parallel by the fog node becomes smaller than 2.
[0057] In one embodiment, since the performance of a fog node that adopts a reliable two-way communication protocol is higher than that of a fog node that adopts a connectionless communication protocol, and the larger the available resources are, the faster the slice data download rate is, the terminal can select the best fog node from at least one fog node based on the following principles: 1. preferentially select a fog node that supports a reliable two-way communication protocol; 2. preferentially select a fog node with larger available resources; and 3. the number of simultaneous downloads of a single node is smaller than a quantity threshold, and select the best fog node from among at least one fog node as the current target fog node.
[0058] In the above embodiment, by preferentially selecting a fog node from at least one fog node, the communication protocol type of which is a reliable two-way communication protocol type, the available resources of which satisfy the preset idle conditions, and the number of simultaneous downloads of a single node is smaller than a quantity threshold, the download rate of slice data can be increased based on the selected fog node.
[0059] In one embodiment, the step of determining a target slice size to be used for performing slice processing based on the communication protocol type of the current target fog node includes a step of determining a target slice size to be used for performing slice processing based on a first target value when the communication protocol of the current target fog node is a reliable bidirectional communication protocol type, and a step of determining a target slice size to be used for performing slice processing based on a second target value when the communication protocol of the current target fog node is a connectionless communication protocol type, wherein the second target value is different from the first target value.
[0060] Specifically, for each target fog node among the multiple target fog nodes, the terminal determines a target slice size used for performing slice processing according to the communication protocol type of the current target fog node. When the communication protocol type of the current target fog node is a reliable two-way communication protocol type, the terminal determines a target slice size used for performing slice processing according to a first target value, for example, the terminal can determine the target slice size to be 256K, so that the terminal can download slice data with a data size of 256K from the current target fog node. When the communication protocol type of the current target fog node is a connectionless communication protocol type, the terminal determines a target slice size used for performing slice processing according to a second target value, for example, the terminal can determine the target slice size to be 128K, so that the terminal can download slice data with a data size of 128K from the current target fog node.
[0061] Exemplarily, when the communication protocol type of the current target fog node is a reliable two-way communication protocol type, the terminal can determine that the target slice size is 256K, so that the terminal can perform slice processing on the target data to be downloaded based on the determined target slice size, and determine that the data range in the slice information corresponding to the current target fog node is 0K to 256K, and the current target fog node can transmit data of 0K to 256K to the terminal based on the slice information. When the communication protocol type of the next target fog node is a connectionless communication protocol type, the terminal can determine that the target slice size is 128K, and the data range in the slice information corresponding to the next target fog node is 256K to 384K, so that the next target fog node can transmit data of 256K to 384K to the terminal based on the slice information. As can be easily understood, it may eventually occur that the slice size of the data slice that has not been downloaded is less than the first target value or the second target value, and at this time, the terminal determines that the target slice size is the remaining data size that has not been downloaded.
[0062] In the above embodiment, since different fog nodes have different capabilities, if one complete target data is downloaded entirely by one fog node, the probability of data download failure will be greatly increased, so it is necessary to perform slicing on the target data and download different slice data from different fog nodes. In this way, the available resources of the fog node can be fully utilized to ensure the download rate, and the success rate of downloading the entire data can be improved. In addition, downloading larger slice data from a target fog node that adopts a reliable two-way communication protocol type can fully utilize the performance of the target fog node that adopts a reliable two-way communication protocol type, thereby further improving the download rate.
[0063] In one embodiment, the step of sending a slice download request to a target fog node corresponding to each of the slice data to be downloaded based on slice information of each of the slice data to be downloaded includes: generating a slice download request corresponding to each of the slice data to be downloaded based on slice information corresponding to each of the slice data to be downloaded; and sending a slice download request to a target fog node corresponding to each of the slice data to be downloaded in a parallel manner, wherein the number of slice data to be downloaded simultaneously is less than or equal to a predetermined total maximum number of simultaneous downloads.
[0064] Specifically, when the slice information of a plurality of slice data to be downloaded is obtained, the terminal can generate a slice download request corresponding to each slice data to be downloaded according to the slice information. Because the terminal stores the correspondence between the slice data to be downloaded and the target fog node, the terminal can send the generated slice download requests to corresponding target fog nodes in parallel according to the correspondence between the slice data to be downloaded and the target fog node, thereby achieving the purpose of parallel processing of slice download requests.
[0065] Since fog nodes are generally user terminals in a CDN, and the download bandwidth of user terminals is limited, it is necessary to limit the total maximum concurrent number of slice data downloads in order to ensure the download rate of each slice data without affecting the user experience. Here, the total maximum concurrent number refers to the number of slice requests that can be simultaneously processed in parallel in the CDN for the current target data, and the total maximum concurrent number can be freely set according to needs. For example, when the total maximum concurrent number is 8, the number of slice requests that can be simultaneously processed in the CDN for the current target data is at most 8.
[0066] In one embodiment, when steps S204 to S206 are performed in sequence, the terminal generates a slice download request corresponding to each slice information, and divides the generated slice download requests according to the total maximum concurrent number to obtain multiple sets of download requests, for example, when the total maximum concurrent number is 8, every 8 slice download requests can be one set of download requests. Furthermore, the terminal can process each set of download requests in sequence, and when receiving corresponding slice data according to the current set of download requests, send the next set of download requests to the corresponding target fog node, thereby realizing that the quantity of slice data downloaded simultaneously is less than or equal to the total maximum concurrent number.
[0067] In one embodiment, when steps S204 to S206 are executed alternately, refer to FIG. 5. The right side of FIG. 5 is the target download data, and the left side is the fog node information of the fog node. For example, fog node 0 supports the Cable protocol and has an available bandwidth of 100 Mbps, and fog node 2 supports the UDP protocol and has an available bandwidth of 80 Mbps.
[0068] Assuming that the data size of the target data to be downloaded is 1150K, the target slice size may be 256K or 128K. When the number of simultaneous downloads of a single node is 2 and the total maximum number of simultaneous downloads is 8, the terminal can select a fog node whose communication protocol type is a reliable two-way communication protocol type, whose available resources are the largest, and whose number of simultaneous downloads of a single node is less than 2 as the current target fog node based on the selection strategy of the current target fog node, i.e., the terminal selects fog node 0 as the current target fog node. Since there is no slice data download in the current state, i.e., the total maximum number of simultaneous downloads is 0 and is less than 8, the terminal downloads one slice data 1 with a data size of 256K from fog node 0. At this time, the total number of simultaneous downloads is updated from 0 to 1, which is less than the total maximum number of simultaneous downloads. Similarly, fog node 0 is still the best fog node among the at least one fog node, and therefore the terminal can further download slice data 1 from fog node 0. At this time, the number of slice download requests processed in parallel by fog node 0 becomes 2, which reaches the number of simultaneous downloads for a single node, so the terminal temporarily suspends the distribution of slice requests to fog node 0.
[0069] The terminal again selects a fog node from at least one fog node, whose communication protocol type is a reliable two-way communication protocol type, whose available resources meet the preset idle condition, and whose single node's concurrent download number is smaller than the quantity threshold, as the current target fog node, i.e., selects fog node 1 as the current target fog node, and downloads slice data 2 from fog node 1. By repeating in this manner, when the total maximum concurrent number reaches 8, the terminal suspends sending slice download requests to the CDN. As can be easily understood, when the slice data download is completed and the total maximum concurrent number in the CDN is smaller than 8, the terminal continues to send new slice download requests to the CDN. FIG. 5 shows a schematic diagram of slice data download in one embodiment.
[0070] In the above embodiment, the slice download requests can be processed in parallel to greatly increase the download rate of slice data. By setting the overall maximum number of concurrent requests, the download rate of each slice data can be further increased without affecting the user experience.
[0071] In one embodiment, the data download method is performed by a terminal, and the communication protocol type includes a reliable bidirectional communication protocol type and a connectionless communication protocol type. The step of sending a slice download request to a target fog node corresponding to the slice data to be downloaded according to slice information of the slice data to be downloaded includes: when the terminal supports the reliable bidirectional communication protocol type, the terminal sends the slice download request to the target fog node corresponding to the slice data to be downloaded through the reliable bidirectional communication protocol or the connectionless communication protocol; when the terminal supports only the connectionless communication protocol type, the terminal sends the slice download request to the target fog node corresponding to the slice data to be downloaded through the connectionless communication protocol.
[0072] Here, the reliable two-way communication protocol is compatible with the connectionless communication protocol, and being compatible with the connectionless communication protocol means that a device adopting the reliable two-way communication protocol can transmit data by adopting the connectionless communication protocol, and can also transmit data by adopting the reliable two-way communication protocol. Here, the premise for transmitting data using the reliable two-way communication protocol is that the other terminal also supports the reliable two-way communication protocol.
[0073] Specifically, because the reliable bidirectional communication protocol is compatible with the connectionless communication protocol, when the terminal supports the reliable bidirectional communication protocol, the terminal can also send a slice download request to the target fog node through the reliable bidirectional communication protocol, and can also send a slice download request to the target fog node through the connectionless communication protocol. For example, when the target fog node adopts the connectionless communication protocol, the terminal can send a slice download request to the target fog node through the connectionless communication protocol, and receive the slice data returned by the target fog node through the connectionless communication protocol. When the target fog node adopts the reliable bidirectional communication protocol, the terminal can send a slice download request to the target fog node through the reliable bidirectional communication protocol, and receive the slice data returned by the target fog node through the reliable bidirectional communication protocol.
[0074] When a terminal supports only a connectionless communication protocol type, the terminal can only send a slice download request to a target fog node corresponding to the slice data to be downloaded via the connectionless communication protocol, and receive the slice data returned by the target fog node via the connectionless communication protocol.
[0075] In one embodiment, the terminal can send a slice download request to the target fog node through the PCDN SDK. Since different business applications have strict requirements for the size of the installation package of the PCDN SDK, the installation package of the PCDN SDK will become large if the reliable two-way communication protocol is accessed, so it is necessary to check whether to access the reliable two-way communication protocol according to the specific business needs. At the same time, the reliable two-way communication protocol, as a third-party transmission protocol, has unknown risk points. Therefore, in order to ensure the quality and stability of the business, the PCDN SDK needs to have the ability to turn on and off the reliable two-way communication protocol. When the PCDN SDK turns on the reliable two-way communication protocol, the PCDN SDK can send a slice download request to the target fog node through the reliable two-way communication protocol, and when the PCDN SDK turns off the reliable two-way communication protocol, the PCDN SDK sends a slice download request to the target fog node only through the connectionless communication protocol.
[0076] In the above embodiment, since the two-way communication protocol is compatible with the connectionless communication protocol, the terminal can be compatible with edge devices adopting different communication protocol types, which greatly enhances the compatibility of the terminal.
[0077] In one embodiment, the slice data includes at least one resource data packet. The data download method further includes the steps of: determining, for each target fog node among a plurality of target fog nodes, a resource data packet to be downloaded from the current target fog node when the communication protocol type of the current target fog node is the target protocol type; generating a corresponding reply message according to the resource data packet, and sending the reply message to the current target fog node, the reply message being used to instruct the current target fog node to retransmit the resource data packet that the terminal has not received according to the resource data packet that the terminal has already received.
[0078] Specifically, for each target fog node among a plurality of target fog nodes, when the current target fog node receives a slice download request, the current target fog node can determine slice data to be sent to the terminal according to slice information in the slice download request, and divide the slice data into at least one resource data packet, and return the resource data packet to the terminal. For example, when the data size of the slice data to be sent to the terminal is 32K, the current target fog node can divide the slice data into 32 resource data packets, where the size of each resource data packet is 1K, so that the current target fog node will send 32 1K resource data packets to the terminal.
[0079] Furthermore, the terminal determines the communication protocol type adopted by the current target fog node, and when the current target fog node adopts the target protocol type, determines the resource data packets that have been downloaded from the current target fog node at present. For example, when the current target fog node adopts a connectionless communication protocol type, determines the resource data packets that have been downloaded. The terminal generates corresponding answer information according to the resource data packets that have been downloaded from the current target fog node at present, and returns the answer information to the current target fog node, so that the current target fog node determines the resource data packets that have not been successfully transmitted according to the answer information, and retransmits the resource data packets that have not been successfully transmitted to the terminal. For example, in the above example, it can be determined that the current target fog node intends to transmit 32 1K resource data packets to the terminal, but when 30 resource data packets have already been received, it can be determined that two resource data packets are currently missing, so that the terminal transmits an answer message to the target fog node.
[0080] In one embodiment, the target protocol type may be a connectionless transmission protocol type. When the current target fog node adopts the connectionless transmission protocol to send the resource data packet to the terminal, it can be considered that the connectionless transmission protocol belongs to an unreliable transmission protocol, and therefore a packet loss situation may occur. Therefore, the terminal sends a reply message to the current target fog node at regular time, so that the current target fog node retransmits the unsuccessfully transmitted resource data packet according to the application message. When the current target fog node adopts a reliable two-way communication protocol type, that is, when the terminal adopts the reliable two-way communication protocol to send a slice download request to the terminal, and the current target fog node adopts the reliable two-way communication protocol to return the resource data packet to the terminal, it can be considered that the reliable two-way communication protocol belongs to a reliable transmission communication protocol, and therefore a packet loss situation will not occur, and therefore the terminal stops generating the reply message.
[0081] In one embodiment, when the current target fog node transmits the last resource data packet, the current target fog node can be regarded as having already transmitted all slice data, and when the terminal receives all slice data corresponding to the target data within a predetermined time, the target data can be regarded as having been fully downloaded. It should be noted that when a timeout occurs, causing partial slice data to be downloaded, i.e., when the terminal does not receive all slice data within a predetermined time, the terminal may still determine that the download of the target data is completed. At this time, the terminal notifies the target fog node to release all the occupied resources and leave. In the above embodiment, by generating a reply message, the target fog node can retransmit the resource data packet based on the received reply message, thereby increasing the transmission success rate of the resource data packet.
[0082] In one embodiment thereof, the target protocol type includes an unknown protocol type, and the data download method further includes a step of suspending sending a reply message to the current target fog node when the terminal updates the communication protocol type of the current target fog node from an unknown protocol type to a reliable bidirectional communication protocol type based on the resource data packet received by the terminal, and a step of maintaining sending a reply message to the current target fog node when the terminal updates the communication protocol type of the current target fog node from an unknown protocol type to a connectionless communication protocol type based on the resource data packet received by the terminal.
[0083] Specifically, for each target fog node among the multiple target fog nodes, when the current target fog node adopts an unknown protocol type, the terminal can send a reply message to the current target fog node at a fixed time. Here, when the protocol type supported by the target fog node cannot be temporarily determined, it can be considered that the target fog node adopts an unknown protocol type to communicate. When the terminal receives a resource data packet sent by the current target fog node, the terminal can determine whether the current target fog node supports a reliable two-way communication protocol type based on the received resource data packet. When the terminal determines that the current target fog node supports a reliable two-way communication protocol type based on the received resource data packet, the terminal suspends sending a reply message to the current target fog node, and when the terminal determines that the current target fog node does not support a reliable two-way communication protocol type based on the received resource data packet, i.e., when the terminal determines that the current target fog node supports a connectionless communication protocol type or is still an unknown protocol type, the terminal maintains sending a reply message to the current target fog node.
[0084] In the above embodiment, when the communication protocol type of the current target fog node is updated from an unknown protocol type to a reliable two-way communication protocol type, the computer resources consumed in transmitting the reply message can be reduced by pausing the transmission of the reply message to the current target fog node.
[0085] In one embodiment, the target data is a target video, and the data download request is a video download request for the target video issued by a multimedia playback application. The data download method further includes: when the target video is obtained for download, sending the target video to the multimedia playback application; and playing the target video by the multimedia playback application.
[0086] Specifically, a multimedia playback application may be executed on a terminal, and when the multimedia playback application needs to play a target video, the multimedia playback application may generate a video download request based on the video identifier of the target video, and send the video download request to the PCDN SDK. The PCDN SDK determines the fog node where the target video is cached based on the video identifier in the video download request, selects a target fog node from the determined fog nodes, and downloads corresponding slice data from the target fog node. The PCDN SDK integrates the downloaded slice data to obtain the target video, and sends the target video to the multimedia playback application, so that the multimedia playback application plays the target video. Here, the target video includes, but is not limited to, on-demand videos and live videos.
[0087] In the above embodiment, by downloading the target video, the multimedia playback application can play the correspondingly downloaded and acquired target video, thereby enhancing the user experience.
[0088] The present application further provides an application scenario in which the above data downloading method is applied. Specifically, the application of the data downloading method in the application scenario is as follows:
[0089] As shown in FIG. 6, when a target game application needs to play a transition animation of a target game, the target game application can send a data download request for the transition animation to the PCDN SDK, so that the PCDN SDK queries the query server for the fog node set where the transition animation is cached and the available resource information of the fog nodes in the fog node set based on the data download request. The PCDN SDK issues a transparent request to the fog nodes in the fog node set, and establishes a transparent connection with the fog nodes through the transparent request, and issues a protocol detection request to the fog nodes through the transparent connection to detect the communication protocol type adopted by the fog nodes. The PCDN SDK integrates the communication protocol type and the available resource information to select a target fog node from the fog node set, and performs slicing on the target data based on the communication protocol type of the target fog node to obtain a slice download request. The PCDN SDK sends the slice download request to the corresponding target fog node, and makes the target fog node return a resource data packet to the terminal based on the slice information in the slice download request. The terminal sends a reply message to the target fog node according to the received resource data packets, and notifies the target fog node to release the occupied resources and leave when receiving all the resource data packets, i.e., disconnect the transparent connection with the target fog node. The terminal aggregates all the received resource data packets to obtain a transition animation, and returns the transition animation to the target game application, so that the target game application can play the transition animation accordingly. Figure 6 shows an interaction schematic diagram of data download in one embodiment.
[0090] The present application further provides another application scenario, which applies the above data downloading method. Specifically, the application of the data downloading method in the application scenario is as follows:
[0091] When a user needs to watch a live video, the user can launch the live application, which can then send a data download request to the PCDN SDK, which can then retrieve the live data from the fog nodes and send the retrieved live data back to the live application, so that the live application can play the live video correspondingly based on the received live data.
[0092] In a specific embodiment, as shown in FIG. 7, the data downloading method provided in the present application includes the following steps S702 to S718.
[0093] S702: When a data download request for target data is obtained, determine a fog node set corresponding to the target data based on a data identifier of the target data, and obtain available resource information of each fog node in the fog node set.
[0094] S704: Establish a transparent connection between each fog node in the fog node set, and determine a communication protocol type of each fog node in the fog node set based on the transparent connection.
[0095] S706: Among at least one fog node, select a fog node whose communication protocol type is a reliable two-way communication protocol type, whose available resources meet a preset idle condition, and whose number of simultaneous downloads of a single node is smaller than a quantity threshold, as a current target fog node.
[0096] S708: According to the communication protocol type of the target fog node, perform slicing processing on the target data to be downloaded, and obtain slice information of the slice data to be downloaded.
[0097] S710: Determine a target slice size to be used for performing slice processing based on a first target value when the communication protocol of the current target fog node is a reliable bidirectional communication protocol type, and determine a target slice size to be used for performing slice processing based on a second target value when the communication protocol of the current target fog node is a connectionless communication protocol type, where the second target value is different from the first target value.
[0098] S712: Based on the target slice size, slice processing is performed on the target data to be downloaded, and slice information of the slice data currently to be downloaded is obtained.
[0099] S714: According to slice information of the slice data currently being downloaded, send a slice download request to the current target fog node to download the slice data currently being downloaded.
[0100] S716: Update the fog node information of the current target fog node, proceed to the process of downloading slice data based on the next target fog node, and continue to execute back to the step of selecting the current target fog node from at least one fog node based on the communication protocol type, available resource information, and the number of simultaneous downloads of a single node, until the download of all the slice data to be downloaded corresponding to the target file is completed.
[0101] S718: Acquire target data by combining according to the slice data returned by each target fog node in response to the corresponding slice download request.
[0102] In the above data download method, by obtaining a data download request for target data, fog node information of at least one fog node corresponding to the target data can be inquired based on the data download request, so that a target fog node with better equipment performance can be selected from the at least one fog node based on the fog node information, and the download rate of the target data can be increased based on the target fog node with better equipment performance. By determining the target fog node, slice processing can be performed on the target data based on the communication protocol type of the target fog node, and slice information that is more consistent with the characteristics of the target fog node can be obtained. In this way, a slice download request can be sent to the corresponding target fog node based on the slice information that is more consistent with the characteristics of the target fog node, so that slice data can be quickly downloaded from the target fog node. By downloading the slice data from the target fog node, the slice data returned by each target fog node can be combined, thereby obtaining the target data. The present application can detect the communication protocol type adopted by a fog node, and schedule and select an appropriate target fog node based on the detected and acquired communication protocol type to download corresponding slice data, so that the present application can be compatible with different communication protocol types and download slice data from target fog nodes that adopt different communication protocol types.
[0103] In a specific embodiment, as shown in FIG. 8, the data downloading method provided in the present application includes the following steps S802 to S816.
[0104] S802: When obtaining a data download request for the target data, inquire about fog node information of at least one fog node corresponding to the target data, where the fog node information includes at least a communication protocol type of the fog node.
[0105] S804: Determine a target fog node from among at least one fog node based on the fog node information.
[0106] S806: According to the communication protocol type of the target fog node, perform slicing processing on the target data to be downloaded, and obtain slice information of the slice data to be downloaded.
[0107] S808: Based on slice information of each slice data to be downloaded, send slice download requests to target fog nodes corresponding to each slice data to be downloaded in a parallel manner, where the number of slice data downloaded simultaneously is less than or equal to the total maximum concurrent number.
[0108] S810: For each target fog node among a plurality of target fog nodes, determine a resource data packet to be downloaded from the current target fog node when the communication protocol type of the current target fog node is the target protocol type.
[0109] S812: Generate a corresponding reply message based on the resource data packet, and send the reply message to the current target fog node, where the reply message is used to instruct the current target fog node to retransmit the resource data packet that the terminal has not received based on the resource data packet that the terminal has already received.
[0110] S814: When the terminal updates the communication protocol type of the current target fog node from an unknown protocol type to a reliable two-way communication protocol type based on the received resource data packet, it suspends sending a reply message to the current target fog node.
[0111] S816: Acquire target data by combining according to the slice data returned by each target fog node in response to the corresponding slice download request.
[0112] As should be understood, although each step in the flowcharts of FIG. 2 and FIG. 7-8 is shown in order according to the direction of the arrows, these steps are not necessarily performed in the order indicated by the arrows. Unless otherwise clearly described in this specification, the execution of these steps is not limited to a strict order, and these steps may be performed in other orders. And, at least some of the steps in FIG. 2 and FIG. 7-8 may include multiple steps or multiple stages, and these steps or stages are not necessarily performed and completed at the same time, but may be performed at different times. The order of execution of these steps or stages is not necessarily performed sequentially, and they may be performed in order or alternately with other steps, or at least some of the steps or stages in other steps.
[0113] In one embodiment thereof, as shown in Fig. 9, a data downloading device 900 is provided. The device can adopt a software module, or a hardware module, or a combination of both, to be a part of a computer device, and the device specifically includes: a target node determining module 902, a slicing module 904, and a request sending module 906, where: The target node determination module 902 is used for: inquiring fog node information of at least one fog node corresponding to the target data when receiving a data download request for the target data, where the fog node information includes at least a communication protocol type of the fog node; and determining a target fog node from the at least one fog node based on the fog node information.
[0114] The slicing module 904 is used for performing slicing processing on the target data to be downloaded according to the communication protocol type of the target fog node, and obtaining slice information of the slice data to be downloaded.
[0115] The request sending module 906 is used for sending a slice download request to a target fog node corresponding to the slice data to be downloaded based on slice information of the slice data to be downloaded, and for combining and obtaining target data based on the slice data returned by each target fog node in response to the corresponding slice download request.
[0116] In one embodiment thereof, as shown in FIG. 10 , the fog node information further includes available resource information of the fog nodes, and the target node determination module 902 further includes an information determination module 9021 used for determining a fog node set corresponding to the target data based on a data identifier of the target data when a data download request for the target data is obtained, and obtaining the available resource information of each fog node in the fog node set, establishing a transparent connection between each fog node in the fog node set, and determining a communication protocol type of each fog node in the fog node set based on the transparent connection.
[0117] In one of the embodiments, the data download device 900 is further used for determining a slice size of the slice data to be downloaded based on the communication protocol type of the target fog node, and performing slice processing on the target data to be downloaded based on the slice size, and obtaining slice information of the slice data to be downloaded.
[0118] In one of the embodiments, the data download device 900 is further used for selecting a current target fog node from at least one fog node based on the communication protocol type, available resource information, and the number of simultaneous downloads of a single node; determining a target slice size used for performing slice processing based on the communication protocol type of the current target fog node; performing slice processing on the target data to be downloaded based on the target slice size, and obtaining slice information of the slice data to be currently downloaded; and sending a slice download request to the current target fog node based on the slice information of the slice data to be currently downloaded, to download the slice data to be currently downloaded.
[0119] In one embodiment, the data download device 900 is further used to update the fog node information of the current target fog node, proceed to the process of slice data download based on the next target fog node, and continue to execute the step of selecting the current target fog node from at least one fog node based on the communication protocol type, available resource information, and the number of simultaneous downloads of a single node, until the download of all the slice data to be downloaded corresponding to the target file is completed.
[0120] In one embodiment, the target node determination module 902 is further used for selecting a fog node from at least one fog node, the communication protocol type of which is a reliable two-way communication protocol type, the available resources meet a preset idle condition, and the number of concurrent downloads of a single node is less than a quantity threshold, and setting the selected fog node as a current target fog node.
[0121] In one embodiment thereof, the slicing module 904 further includes a slice size determination module 9041 used for determining a target slice size used for performing slicing processing based on a first target value when the communication protocol of the current target fog node is a reliable bidirectional communication protocol type, and for determining a target slice size used for performing slicing processing based on a second target value when the communication protocol of the current target fog node is a connectionless communication protocol type, wherein the second target value is different from the first target value.
[0122] In one of the embodiments, the data download device 900 is further used for determining at least one target fog node from among the fog nodes based on the fog node information, performing slice processing on the target data to be downloaded based on the communication protocol type corresponding to each of the target fog nodes, and obtaining slice information of at least one slice data to be downloaded, and sending a slice download request to the target fog node corresponding to each of the slice data to be downloaded based on the slice information of each slice data to be downloaded.
[0123] In one embodiment, the slice module 904 is further used for generating a slice download request corresponding to each of the slice data to be downloaded based on slice information corresponding to each of the slice data to be downloaded, and sending the slice download request to a target fog node corresponding to each of the slice data to be downloaded in a parallel manner, wherein the number of slice data to be downloaded simultaneously is less than or equal to a preset overall maximum concurrent number.
[0124] In one of the embodiments, the data download device 900 is further used for: when the terminal supports a reliable bidirectional communication protocol type, the terminal sending a slice download request to a target fog node corresponding to the slice data to be downloaded via a reliable bidirectional communication protocol or a connectionless communication protocol; and when the terminal supports only a connectionless communication protocol type, the terminal sending a slice download request to a target fog node corresponding to the slice data to be downloaded via a connectionless communication protocol.
[0125] In one embodiment, the slice data includes at least one resource data packet, and the data download device 900 further includes a reply module 908 used for determining, for each target fog node among a plurality of target fog nodes, a resource data packet to be downloaded from the current target fog node when the communication protocol type of the current target fog node is the target protocol type, and generating a corresponding reply message based on the resource data packet and sending the reply message to the current target fog node, where the reply message is used to instruct the current target fog node to retransmit the resource data packet that the terminal has not received based on the resource data packet already received by the terminal.
[0126] In one embodiment thereof, the target protocol type includes an unknown protocol type, and the reply module 908 is further used for suspending sending a reply message to the current target fog node when the terminal updates the communication protocol type of the current target fog node from the unknown protocol type to a reliable two-way communication protocol type based on the resource data packet received by the terminal.
[0127] In one embodiment thereof, the target protocol type includes an unknown protocol type, and the reply module 908 is further used for maintaining sending a reply message to the current target fog node when the terminal updates the communication protocol type of the current target fog node from the unknown protocol type to a connectionless communication protocol type based on the resource data packet received.
[0128] In one embodiment, the target data is a target video, the data download request is a video download request for the target video issued by a multimedia playback application, and the data download device 900 is further used for sending the target video to the multimedia playback application when the target video is downloaded and obtained, and playing the target video by the multimedia playback application.
[0129] Specific limitations of the data downloading device may refer to the limitations of the data downloading method described above, and will not be described in detail again here. Each module in the data downloading device may be realized in whole or in part by software, hardware, or a combination thereof. Each module may be embedded in or independent from a processor in a computer device in the form of hardware, or may be stored in a memory in a computer device in the form of software, so that the processor calls and executes the operations corresponding to each module.
[0130] In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be shown in FIG. 11. The computer device includes a processor, a memory, a communication interface, a display screen, and an input device connected via a system bus. Here, the processor of the computer device is used to provide calculation and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the execution of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner may be realized by WIFI, an operator network, NFC (near field communication), or other technologies. The data download method is realized when the computer program is executed by the processor. The display screen of the computing device may be a liquid crystal display screen or an electronic ink display screen, and the input device of the computing device may be a touch layer coated on the display screen, or a button, a trackball, or a touch control pad mounted on the casing of the computing device, or even an external keyboard, a touch control pad, a mouse, etc.
[0131] As will be understood by those skilled in the art, the structure shown in FIG. 11 is merely a block diagram of some structures related to the solution of the present application, and does not constitute a limitation on a computer device to which the solution of the present application is applied; a specific computer device may include more or less components than those shown in the drawing, or may combine certain components, or have a different component arrangement.
[0132] In one embodiment thereof, a computer device is further provided, comprising a memory and a processor, a computer program being stored in the memory, and the processor implementing the steps of each of the above method embodiments when executing the computer program.
[0133] In one embodiment thereof, a computer readable storage medium is provided having a computer program stored thereon, the computer program implementing the steps of each of the method embodiments described above when executed by a processor.
[0134] In one embodiment, a computer program product or a computer program is provided, the computer program product or the computer program comprising computer instructions stored in a computer readable storage medium, a processor of a computing device reads the computer instructions from the computer readable storage medium, and the processor executes the computer instructions to cause the computing device to perform the steps of each of the method embodiments described above.
[0135] As can be understood by those skilled in the art, the implementation of all or part of the processes in the methods of the above embodiments may be completed by instructing relevant hardware by a computer program, and the computer program may be stored in a non-volatile computer-readable storage medium, and may include the processes of the above methods when the computer program is executed. Here, any reference to memory, storage, database, or other medium used in the embodiments provided herein may include at least one of non-volatile memory and volatile memory. Non-volatile memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, etc. Volatile memory may include Random Access Memory (RAM) or external cache memory. As a non-limiting explanation, RAM may be of multiple types, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM), etc. [Explanation of symbols]
[0136] 100 Data Download System 102 Computer Equipment 104 Fog Nodes 900 Data download device 902 Target Node Determination Module 904 Slice Module 906 Request Sending Module 908 Answer Module 9021 Information Decision Module 9041 Slice Size Decision Module
Claims
1. 1. A method for downloading data, implemented by a computing device, comprising: When obtaining a data download request for target data, inquiring fog node information of at least one fog node corresponding to the target data, where the fog node information includes at least a communication protocol type of the fog node; determining a target fog node from among the at least one fog node based on the fog node information; performing a slice process on the target data to be downloaded according to a communication protocol type of the target fog node, and obtaining slice information of the slice data to be downloaded; sending a slice download request to a target fog node corresponding to the slice data to be downloaded according to slice information of the slice data to be downloaded; and obtaining target data by combining the slice data returned by each target fog node in response to the corresponding slice download request.
2. The fog node information further includes available resource information of the fog node; The step of inquiring fog node information of at least one fog node corresponding to the target data when a data download request for the target data is obtained includes: When receiving a data download request for target data, determining a fog node set corresponding to the target data according to a data identifier of the target data, and obtaining available resource information of each fog node in the fog node set; establishing a transparent connection between each fog node in the set of fog nodes; and determining a communication protocol type for each fog node in the set of fog nodes based on the transparent connectivity.
3. The step of performing slicing on the target data to be downloaded according to the communication protocol type of the target fog node and obtaining slice information of the slice data to be downloaded includes: determining a slice size of the slice data to be downloaded according to a communication protocol type of the target fog node; The method according to claim 1 , further comprising: performing a slice process on the target data to be downloaded based on the slice size, and obtaining slice information of the slice data to be downloaded.
4. The fog node information further includes available resource information of the fog node and the number of concurrent downloads of a single node; The step of determining a target fog node from among the at least one fog node based on the fog node information includes: Selecting a current target fog node from among the at least one fog node based on the communication protocol type, the available resource information, and the number of concurrent downloads of the single node; The step of performing slicing on the target data to be downloaded according to the communication protocol type of the target fog node and obtaining slice information of the slice data to be downloaded includes: determining a target slice size to be used for performing slicing processing based on a communication protocol type of the current target fog node; According to the target slice size, a slice process is performed on the target data to be downloaded, and slice information of the slice data to be currently downloaded is obtained; and The step of sending a slice download request to a target fog node corresponding to the slice data to be downloaded based on slice information of the slice data to be downloaded includes: The method of claim 1 , further comprising: sending a slice download request to the current target fog node based on slice information of the slice data to be currently downloaded, to download the slice data to be currently downloaded.
5. The method comprises:
5. The method of claim 4, further comprising: updating fog node information of the current target fog node, proceeding to a process of slice data downloading based on a next target fog node, and continuing to execute the step of selecting a current target fog node from the at least one fog node based on the communication protocol type, the available resource information, and the number of simultaneous downloads of the single node, until downloading of all slice data to be downloaded corresponding to the target file is completed.
6. The step of selecting a current target fog node from among the at least one fog node based on the communication protocol type, the available resource information, and the number of simultaneous downloads of the single node includes:
5. The method of claim 4, further comprising: selecting a fog node from the at least one fog node, the communication protocol type of which is a reliable two-way communication protocol type, the available resources of which meet a preset idle condition, and the number of simultaneous downloads of a single node is less than a quantity threshold, and setting the selected fog node as a current target fog node.
7. The step of determining a target slice size used for performing slicing based on a communication protocol type of the current target fog node includes: determining a target slice size used for performing slicing based on a first target value when a communication protocol of the current target fog node is a reliable two-way communication protocol type; 5. The method of claim 4, further comprising: determining a target slice size to be used for slicing based on a second target value when the communication protocol of the current target fog node is a connectionless communication protocol type, the second target value being different from the first target value.
8. The step of determining a target fog node from among the at least one fog node based on the fog node information includes: determining at least one target fog node from among the fog nodes based on the fog node information; The step of performing slicing on the target data to be downloaded according to the communication protocol type of the target fog node and obtaining slice information of the slice data to be downloaded includes: According to a communication protocol type corresponding to each of the target fog nodes, performing a slicing process on the target data to be downloaded to obtain slice information of at least one slice data to be downloaded; and The step of sending a slice download request to a target fog node corresponding to the slice data to be downloaded based on slice information of the slice data to be downloaded includes: The method of claim 1 , further comprising: sending a slice download request to a target fog node corresponding to each of the slice data to be downloaded based on slice information of each of the slice data to be downloaded.
9. The step of transmitting a slice download request to a target fog node corresponding to each of the slice data to be downloaded based on slice information of each of the slice data to be downloaded includes: generating a slice download request corresponding to each of the slice data to be downloaded based on slice information corresponding to each of the slice data to be downloaded; 9. The method of claim 8, further comprising: a step of sending the slice download request to a target fog node corresponding to each of the slice data to be downloaded in a parallel manner, wherein the number of slice data to be downloaded simultaneously is less than or equal to a preset overall maximum number of simultaneous downloads.
10. The method is executed by a terminal, and the communication protocol type includes a reliable two-way communication protocol type and a connectionless communication protocol type. The step of sending a slice download request to a target fog node corresponding to the slice data to be downloaded based on slice information of the slice data to be downloaded includes: When the terminal supports a reliable two-way communication protocol type, the terminal sends a slice download request to a target fog node corresponding to the slice data to be downloaded through a reliable two-way communication protocol or a connectionless communication protocol; The method of claim 1, further comprising: when the terminal supports only a connectionless communication protocol type, the terminal sends a slice download request to a target fog node corresponding to the slice data to be downloaded via a connectionless communication protocol.
11. The slice data includes at least one resource data packet, and the method further comprises: For each target fog node among a plurality of target fog nodes, determining a resource data packet to be downloaded from the current target fog node when a communication protocol type of the current target fog node is a target protocol type; 2. The method of claim 1, further comprising: generating a corresponding reply message based on the resource data packet, and sending the reply message to the current target fog node, wherein the reply message is used to instruct the current target fog node to retransmit a resource data packet that the terminal has not received based on the resource data packet that the terminal has already received.
12. The target protocol type comprises an unknown protocol type, and the method further comprises:
12. The method of claim 11, further comprising: suspending sending a reply message to the current target fog node when the terminal updates a communication protocol type of the current target fog node from an unknown protocol type to a reliable two-way communication protocol type based on a received resource data packet.
13. The target protocol type comprises an unknown protocol type, and the method further comprises:
12. The method of claim 11, further comprising: maintaining a step of sending a reply message to the current target fog node when the terminal updates a communication protocol type of the current target fog node from an unknown protocol type to a connectionless communication protocol type based on the received resource data packet.
14. The target data is a target video, and the data download request is a video download request for the target video issued by a multimedia playback application, and the method includes: When a target video is obtained by downloading, sending the target video to the multimedia playback application; The method according to any one of claims 1 to 13, further comprising the step of: playing the target video by the multimedia playback application.
15. A data downloading apparatus executed by a computing device, the apparatus comprising: a target node determination module used for: inquiring fog node information of at least one fog node corresponding to target data when obtaining a data download request for the target data, the fog node information including at least a communication protocol type of the fog node; and determining a target fog node among the at least one fog node based on the fog node information; A slice module is used for performing slice processing on the target data to be downloaded according to a communication protocol type of the target fog node, and obtaining slice information of the slice data to be downloaded; A data download device comprising: a request sending module used for sending a slice download request to a target fog node corresponding to the slice data to be downloaded based on slice information of the slice data to be downloaded; and combining and obtaining target data based on the slice data returned by each target fog node in response to the corresponding slice download request.
16. 16. The device of claim 15, wherein the fog node information further includes available resource information of fog nodes, and the target node determination module further includes an information determination module used for determining a fog node set corresponding to the target data based on a data identifier of the target data when a data download request for target data is obtained, and obtaining available resource information of each fog node in the fog node set, establishing a transparent connection between each fog node in the fog node set, and determining a communication protocol type of each fog node in the fog node set based on the transparent connection.
17. 16. The apparatus of claim 15, wherein the slice data includes at least one resource data packet, and the data download device further includes a reply module for determining, for each target fog node among a plurality of target fog nodes, a resource data packet to be downloaded from the current target fog node when the communication protocol type of the current target fog node is a target protocol type, generating a corresponding reply message based on the resource data packet, and sending the reply message to the current target fog node, where the reply message is used to instruct the current target fog node to retransmit a resource data packet that the terminal has not received based on the resource data packet already received by the terminal.
18. A computing device comprising a memory and a processor, the memory storing a computer program, the processor implementing the steps of the method according to any one of claims 1 to 14 when executing the computer program.
19. A computer program which, when executed by a processor, implements the steps of the method according to any one of claims 1 to 14.
Citation Information
Patent Citations
Data downloading method and related device
CN111629075A
Information processing device and coordinated distributed storage system
WO2016043120A1
