[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

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

File downloading method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN115344534A
CN115344534A CN202110527898.8A CN202110527898A CN115344534A CN 115344534 A CN115344534 A CN 115344534A CN 202110527898 A CN202110527898 A CN 202110527898A CN 115344534 A CN115344534 A CN 115344534A
Authority
CN
China
Prior art keywords
node
target
candidate
file
communication information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110527898.8A
Other languages
Chinese (zh)
Inventor
张辉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202110527898.8A priority Critical patent/CN115344534A/en
Publication of CN115344534A publication Critical patent/CN115344534A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/13File access structures, e.g. distributed indices
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/18File system types
    • G06F16/182Distributed file systems
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]

Landscapes

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

Abstract

The application relates to a file downloading method, a file downloading device, computer equipment and a storage medium. The method comprises the following steps: acquiring a file downloading request carrying a target application identifier of a target application and a file identifier to be downloaded; acquiring a candidate node information set corresponding to a file identifier to be downloaded; acquiring a node communication information set of each candidate node corresponding to the candidate node information set, wherein the node communication information set comprises node communication information of at least two dimensions, and the node communication information of at least two dimensions is obtained by communicating with the corresponding candidate node; fusing node communication information in the same node communication information set based on target attention information corresponding to the target application identifier to obtain target downloading priority parameters corresponding to each candidate node; and determining a target node from each candidate node based on the target downloading priority parameter, and acquiring a target file corresponding to the file identifier to be downloaded from the target node. The method can improve the file downloading quality.

Description

File downloading method and device, computer equipment and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a file downloading method and apparatus, a computer device, and a storage medium.
Background
With the development of internet technology and intelligent terminals, terminals such as mobile phones and tablet computers have become indispensable articles for daily life and work of people. People can download and install various application programs through the terminal to work, live and entertain. During the use of an application, situations may arise where a file needs to be downloaded from a node.
In the conventional technology, when downloading a file, a terminal randomly determines a target node from available nodes, and downloads the file from the target node. However, the downloading mode of the randomly determined node cannot guarantee to obtain a reliable target node, so that the file downloading quality cannot be guaranteed.
Disclosure of Invention
In view of the foregoing, it is desirable to provide a file downloading method, apparatus, computer device and storage medium capable of improving the file downloading quality.
A method of file download, the method comprising:
acquiring a file downloading request, wherein the file downloading request carries a target application identifier of a target application and a file identifier to be downloaded;
acquiring a candidate node information set corresponding to a file identifier to be downloaded;
acquiring a node communication information set of each candidate node corresponding to the candidate node information set, wherein the node communication information set comprises node communication information of at least two dimensions, and the node communication information of at least two dimensions is obtained by communicating with the corresponding candidate node;
fusing node communication information in the same node communication information set based on target attention information corresponding to the target application identifier to obtain target downloading priority parameters corresponding to each candidate node;
and determining a target node from each candidate node based on the target downloading priority parameter, and acquiring a target file corresponding to the file identifier to be downloaded from the target node.
In one embodiment, the method further comprises:
when the target file is not acquired within the preset downloading time, acquiring resource node information corresponding to the identifier of the file to be downloaded;
and acquiring the target file from the resource node corresponding to the resource node information.
A file download apparatus, the apparatus comprising:
the request acquisition module is used for acquiring a file downloading request, and the file downloading request carries a target application identifier of a target application and a file identifier to be downloaded;
the node information acquisition module is used for acquiring a candidate node information set corresponding to the file identifier to be downloaded;
the communication information acquisition module is used for acquiring a node communication information set of each candidate node corresponding to the candidate node information set, wherein the node communication information set comprises at least two-dimensional node communication information, and the at least two-dimensional node communication information is obtained by communicating with the corresponding candidate node;
the download priority parameter determination module is used for fusing node communication information in the same node communication information set based on target attention information corresponding to the target application identifier to obtain target download priority parameters corresponding to the candidate nodes;
and the file downloading module is used for determining a target node from each candidate node based on the target downloading priority parameter and acquiring a target file corresponding to the file identifier to be downloaded from the target node.
A computer device comprising a memory and a processor, the memory storing a computer program, the processor implementing the following steps when executing the computer program:
acquiring a file downloading request, wherein the file downloading request carries a target application identifier of a target application and a file identifier to be downloaded;
acquiring a candidate node information set corresponding to a file identifier to be downloaded;
acquiring a node communication information set of each candidate node corresponding to the candidate node information set, wherein the node communication information set comprises node communication information of at least two dimensions, and the node communication information of at least two dimensions is obtained by communicating with the corresponding candidate node;
fusing node communication information in the same node communication information set based on target attention information corresponding to the target application identifier to obtain target downloading priority parameters corresponding to each candidate node;
and determining a target node from each candidate node based on the target downloading priority parameter, and acquiring a target file corresponding to the file identifier to be downloaded from the target node.
A computer-readable storage medium, on which a computer program is stored which, when executed by a processor, carries out the steps of:
acquiring a file downloading request, wherein the file downloading request carries a target application identifier of a target application and a file identifier to be downloaded;
acquiring a candidate node information set corresponding to a file identifier to be downloaded;
acquiring a node communication information set of each candidate node corresponding to the candidate node information set, wherein the node communication information set comprises node communication information of at least two dimensions, and the node communication information of at least two dimensions is obtained by communicating with the corresponding candidate node;
fusing node communication information in the same node communication information set based on target attention information corresponding to the target application identifier to obtain target downloading priority parameters corresponding to each candidate node;
and determining a target node from each candidate node based on the target downloading priority parameter, and acquiring a target file corresponding to the file identifier to be downloaded from the target node.
According to the file downloading method, the file downloading device, the computer equipment and the storage medium, the file downloading request is obtained, the file downloading request carries the target application identification and the file identification to be downloaded, the candidate node information set corresponding to the file identification to be downloaded is obtained, the node communication information set of each candidate node corresponding to the candidate node information set is obtained, the node communication information set comprises node communication information of at least two dimensions, the node communication information of at least two dimensions is obtained by communicating with the corresponding candidate node, the node communication information in the same node communication information set is fused on the basis of the target attention information corresponding to the target application identification, the target downloading priority parameter corresponding to each candidate node is obtained, the target node is determined from each candidate node on the basis of the target downloading priority parameter, and the target file corresponding to the file identification to be downloaded is obtained from the target node. Therefore, when the file is downloaded, the target node which is matched with the target application and is reliable can be determined from the candidate nodes based on the target attention information corresponding to the target application identification and the node communication information of the candidate nodes, and the file downloading from the target node can effectively guarantee the file downloading quality.
Drawings
FIG. 1 is a diagram of an application environment of a file download method in one embodiment;
FIG. 2 is a flowchart illustrating a file download method according to an embodiment;
FIG. 3A is a diagram illustrating an exemplary scenario of a file download method;
FIG. 3B is a diagram illustrating an application scenario of a file downloading method in another embodiment;
FIG. 4 is a flowchart illustrating a file downloading method according to another embodiment;
FIG. 5 is a flowchart illustrating a file download method according to another embodiment;
FIG. 6A is a timing diagram of file downloading in one embodiment;
FIG. 6B is a schematic flow chart of a distributed download in one embodiment;
FIG. 7 is a block diagram showing the configuration of a file downloading apparatus according to an embodiment;
FIG. 8 is a block diagram showing the construction of a file downloading apparatus according to another embodiment;
FIG. 9 is a diagram showing an internal structure of a computer device in one embodiment;
FIG. 10 is a diagram showing an internal structure of a computer device according to an embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
The blockchain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism and an encryption algorithm. A block chain (Blockchain), which is essentially a decentralized database, is a string of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, which is used for verifying the validity (anti-counterfeiting) of the information and generating a next block. The blockchain may include a blockchain underlying platform, a platform product service layer, and an application service layer.
The block chain underlying platform can comprise processing modules such as user management, basic service, intelligent contract and operation monitoring. The user management module is responsible for identity information management of all blockchain participants, and comprises the steps of maintaining public and private key generation (account management), key management, user real identity and blockchain address corresponding relation maintenance (authority management) and the like, and under the authorized condition, supervising and auditing the transaction condition of some real identities, and providing rule configuration (wind control audit) of risk control; the basic service module is deployed on all block chain node point devices and used for verifying the effectiveness of the service request, recording the effective request after consensus is completed on storage, for a new service request, the basic service firstly performs interface adaptation analysis and authentication processing (interface adaptation), then encrypts service information (consensus management) through a consensus algorithm, transmits the encrypted service information to a shared account (network communication) completely and consistently, and performs recording and storage; the intelligent contract module is responsible for registering and issuing contracts, triggering the contracts and executing the contracts, developers can define contract logics through a certain programming language, issue the contract logics to a block chain (contract registration), call keys or other event triggering and executing according to the logics of contract clauses, complete the contract logics and simultaneously provide the function of canceling contract upgrading logout; the operation monitoring module is mainly responsible for deployment, configuration modification, contract setting, cloud adaptation in the product release process and visual output of real-time states in product operation, such as: alarm, monitoring network conditions, monitoring node equipment health status, and the like.
The platform product service layer provides basic capability and an implementation framework of typical application, and developers can complete block chain implementation of business logic based on the basic capability and the characteristics of the superposed business. The application service layer provides the application service based on the block chain scheme to the business participants for use.
It is to be understood that the object file in the present application may be stored on a blockchain. In the application, the node communication information set and the historical communication information set can also be sent to the block chain for storage.
The Cloud technology (Cloud technology) is based on the general names of network technology, information technology, integration technology, management platform technology, application technology and the like applied in a Cloud computing business model, can form a resource pool, can be used as required, and is flexible and convenient. Cloud computing technology will become an important support. Background services of technical network systems require a large amount of computing and storage resources, such as video websites, picture-like websites and more portal websites. With the high development and application of the internet industry, each article may have an own identification mark and needs to be transmitted to a background system for logic processing, data of different levels can be processed separately, and various industry data need strong system background support and can be realized only through cloud computing.
A distributed cloud storage system (hereinafter, referred to as a storage system) refers to a storage system that integrates a large number of storage devices (storage devices are also referred to as storage nodes) of different types in a network through application software or application interfaces to cooperatively work by using functions such as cluster application, grid technology, and a distributed storage file system, and provides a data storage function and a service access function to the outside.
At present, a storage method of a storage system is as follows: logical volumes are created, and when a logical volume is created, physical storage space, which may be the disk composition of a certain storage device or several storage devices, is allocated to each logical volume. The client stores data on a certain logical volume, that is, the data is stored on a file system, the file system divides the data into a plurality of parts, each part is an object, the object not only contains the data but also contains additional information such as data identification (ID, ID entry), the file system writes each object into a physical storage space of the logical volume, and the file system records storage location information of each object, so that when the client requests to access the data, the file system can allow the client to access the data according to the storage location information of each object.
The process of allocating physical storage space for the logical volume by the storage system specifically includes: physical storage space is divided in advance into stripes according to a group of capacity measures of objects stored in a logical volume (the measures often have a large margin with respect to the capacity of the actual objects to be stored) and Redundant Array of Independent Disks (RAID), and one logical volume can be understood as one stripe, thereby allocating physical storage space to the logical volume.
The file downloading method provided by the application can be applied to the application environment shown in fig. 1. The computer device 102 may be a server or a terminal. The candidate node 106 may be a server or a terminal. The computer device 102, the query server 104, and the candidate node 106 may be directly or indirectly connected via wired or wireless communication, which is not limited herein. The server may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing basic cloud computing services such as cloud service, a cloud database, cloud computing, a cloud function, cloud storage, network service, cloud communication, middleware service, domain name service, security service, CDN, and a big data and artificial intelligence platform. The terminal may be, but is not limited to, a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, a router, and the like.
The computer equipment acquires a file downloading request, wherein the file downloading request carries a target application identifier of a target application and a file identifier to be downloaded. The computer equipment can acquire a candidate node information set corresponding to the file identifier to be downloaded from the query server according to the file downloading request. The computer equipment acquires a node communication information set of each candidate node corresponding to the candidate node information set, wherein the node communication information set comprises node communication information of at least two dimensions, and the node communication information of the at least two dimensions is obtained by communicating with the corresponding candidate node. The computer equipment fuses node communication information in the same node communication information set based on target attention information corresponding to the target application identifier to obtain target downloading priority parameters corresponding to all candidate nodes, determines target nodes from all candidate nodes based on the target downloading priority parameters, and further obtains target files corresponding to the file identifier to be downloaded from the target nodes.
In one embodiment, as shown in fig. 2, a file downloading method is provided, which is described by taking the method as an example applied to the computer device in fig. 1, and includes the following steps:
step S202, a file downloading request is obtained, and the file downloading request carries a target application identifier of a target application and a file identifier to be downloaded.
Wherein the file download request is for requesting to download a file. The target application refers to an application program that triggers a file download request. The target application identifier refers to an application identifier corresponding to the target application. The application identifier is an identifier for uniquely identifying the application program, and may specifically include a character string of at least one character of letters, numbers, and symbols. The file identifier to be downloaded refers to a file identifier corresponding to the target file to be downloaded. The file identifier is an identifier for uniquely identifying a file, and may specifically include a character string of at least one character of letters, numbers and symbols. The target file can be data displayed in at least one of text, picture, audio and video, and the target file is data which can be transmitted on a network.
In particular, a computer device may obtain a file download request that is generated locally. The computer equipment runs the target application, can receive the trigger operation of the user acting on the target application related interface to generate a file downloading request, and the file downloading request carries the target application identifier of the target application and the identifier of the file to be downloaded. The computer device may download the target file from the corresponding node according to the file download request. For example, when a user wants to watch a movie offline through an audio-visual application program on a computer device, the user may trigger a download control on a playing page corresponding to a target movie (target file) in the audio-visual application program, and the computer device generates a file download request carrying a target application identifier of the audio-visual application program and a file identifier to be downloaded corresponding to the target movie based on the trigger operation. When a user wants to watch live broadcasting online through a live broadcasting application program on computer equipment, the user can trigger a watching control in a playing page corresponding to a target live broadcasting room (target file) in the live broadcasting application program, and the computer equipment generates a file downloading request carrying a target application identifier of the live broadcasting application program and a file identifier to be downloaded corresponding to the target live broadcasting room based on the triggering operation. It is understood that the computer device may also obtain a file download request sent by other terminals and servers. For example, the terminal obtains a file download request generated locally, and sends the file download request to the computer device, so that the computer device downloads the corresponding target file according to the file download request.
In one embodiment, the computer device may perform a security check on the file download request prior to responding to the file download request. When the file downloading request fails the safety check, the file downloading request is not responded; and when the file downloading request passes the safety check, responding the file downloading request and executing the subsequent steps. The security check on the file download request may specifically be to query whether a target application identifier of the target application is recorded in a white list. The white list records the application identification of the trusted application program.
And step S204, acquiring a candidate node information set corresponding to the file identifier to be downloaded.
The candidate node information set comprises node information corresponding to a plurality of candidate nodes. The candidate node is a node storing a target file corresponding to the file identifier to be downloaded. The node may be a server or a terminal device. The node information may include node identifiers, node addresses, and other information corresponding to the candidate nodes. The computer device may communicate with the corresponding candidate node based on the node information. It will be appreciated that the same file may be stored on multiple nodes, and different nodes may store different files.
Specifically, the computer device needs to download the target file from the node storing the target file, and therefore, the computer device needs to know which nodes store the target file first. The computer device may obtain the candidate node information set corresponding to the identifier of the file to be downloaded from the query server. The query server records file data stored by each node, and the computer device can send a node query request to the query server so that the query server returns a candidate node information set consisting of node information of each candidate node storing the target file according to the node query request.
In one embodiment, the candidate node may be a resource node in a CDN (Content Delivery Network) or a fog node. The resource node refers to a common data cache server in the CDN, and may also be referred to as a CDN server. A fog node refers to an edge device in the CDN, e.g., a router, an edge server, etc. Compared with the traditional resource node, the fog node is usually closer to the user and has a large amount of idle, high-quality and low-cost bandwidth. When the candidate node is the fog node, the computer equipment can acquire the target file from the fog node more quickly, and the bandwidth pressure of the resource node can be effectively relieved by downloading the target file from the fog node.
In one embodiment, once the computer device obtains the candidate node information set, the computer device may establish communication with each candidate node corresponding to the candidate node information set. Accordingly, after the computer device finishes downloading the target file, the computer device can immediately disconnect the communication with each candidate node. In this way, waste of resources of the computer device can be avoided. The computer device may also continue to maintain communication with each candidate node for a period of time after downloading the target file, and if the computer device does not receive a new file downloading request or a new target file to be downloaded is not stored on the candidate node within the period of time, the computer device disconnects communication with each candidate node again. Therefore, the time for processing the subsequent file downloading request can be reduced, and the efficiency is improved.
Step S206, a node communication information set of each candidate node corresponding to the candidate node information set is obtained, the node communication information set comprises node communication information of at least two dimensions, and the node communication information of at least two dimensions is obtained by communicating with the corresponding candidate node.
The node communication information set comprises at least two dimensions of node communication information, and the node communication information of different dimensions can reflect the node performance of the candidate node from different perspectives. The computer equipment can finally select the candidate node with better comprehensive node performance as a reliable target node for file downloading. The node communication information is obtained by the computer equipment and the candidate node. The node communication information may be obtained by the computer device and the candidate node based on historical communication, may also be obtained by the computer device and the candidate node based on current communication, or may also be obtained by the computer device and the candidate node based on the combination of historical communication and current communication. One candidate node corresponds to one set of node traffic. The node communication information of at least two dimensions may include node delay information, node packet loss information, node download success information, node concurrency information, and the like. The node delay information is determined based on a heartbeat request and a corresponding heartbeat reply for establishing a communication connection, for example, the computer device sends the heartbeat request to the candidate node, receives a response message replied by the candidate node, and obtains the node delay information based on a time difference between the heartbeat request and the response message. The node packet loss information is obtained based on the data packet receiving amount counted by the computer device and the data sending amount obtained from the candidate node. The node download success information is obtained based on historical download success rates of files downloaded from candidate nodes. The node concurrency information is derived based on the number of computer devices to which the candidate node can be simultaneously connected.
Specifically, the computer device may obtain a node communication information set of each candidate node corresponding to the candidate node information set. At any time, the computer device can record and store the generated node communication information in the communication process with the candidate node, and store the node communication information and the corresponding node identifier of the candidate node in an associated manner. If the candidate node and the computer device have communicated in the historical time, the computer device may obtain a corresponding historical communication information set as a node communication information set of the candidate node based on the node identifier of the candidate node, or may generate a node communication information set corresponding to the candidate node based on the current communication information and the historical communication information set of the computer device and the candidate node. If the candidate node and the computer device have not communicated in the historical time, the computer device may determine the node communication information set corresponding to the candidate node to be empty, or may generate the node communication information set corresponding to the candidate node based on the current communication information of the computer device and the candidate node. That is, the computer device may determine the target node directly from the historically communicated candidate nodes, or may determine the target node from the respective candidate nodes after communicating with the respective candidate nodes for a period of time.
And S208, fusing the node communication information in the same node communication information set based on the target attention information corresponding to the target application identifier to obtain target downloading priority parameters corresponding to the candidate nodes.
The target attention information refers to attention information corresponding to a target application identifier, that is, attention information corresponding to a target application. The attention information is used to determine node communication information that is of greater interest to the application. The attention information comprises attention weights corresponding to the node communication information of all dimensions. The sum of all attention weights in the attention information may be 1. It can be understood that the higher the attention weight corresponding to the node communication information of a certain dimension is, the more the application program is concerned about the node performance reflected by the node communication information of the dimension. For example, the live application focuses more on the live delay, and when watching the live broadcast, the user usually wants to keep as synchronized as possible with the main broadcast, or the delay is as small as possible, so in the attention information corresponding to the live application, the attention weight corresponding to the node delay information may be set to be higher than the attention weight corresponding to the other node communication information. The target download priority parameter is data for determining a target download priority corresponding to the candidate node. The target download priority parameter may specifically be presented in the form of a score. It will be appreciated that a higher target download priority for a candidate node indicates that the candidate node is a better match and more reliable target application.
Specifically, attention information corresponding to each of the plurality of application programs may be preset, and the attention information and the corresponding application identifier may be stored in an associated manner. When determining the target download priority parameters corresponding to the candidate nodes, the computer device may obtain target attention information corresponding to the target application identifiers, and fuse node communication information in the same node communication information set based on the target attention information corresponding to the target application identifiers, thereby obtaining the target download priority parameters corresponding to the candidate nodes. In this way, the target download priority parameter obtained based on the target attention information fusion node communication information can relatively accurately reflect the reliability of each candidate node for downloading the target file required by the target application, so that the most reliable target node matched with the target application can be determined from the plurality of candidate nodes based on the target download priority parameter corresponding to each candidate node. It can be understood that, if the target attention information corresponding to the target application identifier is not queried, the computer device may obtain default attention information as the target attention information corresponding to the target application identifier. For example, the computer device stores attention information and default attention information corresponding to the application programs a, B, and C, respectively, and if the target application identifier carried in the file download request is the application identifier corresponding to the application program D, the computer device may acquire the default attention information as the attention information corresponding to the application program D. In the default attention information, attention weights corresponding to node communication information of each dimension may be the same. For example, the node communication information set includes node communication information of two dimensions, and the attention weight corresponding to the node communication information of each dimension is 50%.
Step S210, determining a target node from each candidate node based on the target download priority parameter, and acquiring a target file corresponding to the file identifier to be downloaded from the target node.
The target node is at least one candidate node with higher target downloading priority.
Specifically, after obtaining the target download priority parameter, the computer device may determine a target download priority corresponding to each candidate node based on the target download priority parameter, determine a target node from each candidate node based on the target download priority, and further obtain a target file corresponding to the identifier of the file to be downloaded from the target node.
In one embodiment, determining the target node from the candidate nodes based on the target download priority parameter comprises:
determining a target downloading priority corresponding to each candidate node based on the target downloading priority parameter; and taking the candidate node with the highest target downloading priority as the target node.
In particular, the target node may be a candidate node. The computer device may determine the target download priority corresponding to each candidate node based on the target download priority parameter, for example, when the larger the target download priority parameter is, the worse the node performance is, the computer device may sort the target download priority parameters in a descending order, determine the target download priority corresponding to each candidate node based on the sorting result, and set the target download priority of the candidate node corresponding to the target download priority parameter that is sorted the earlier the target download priority parameter is, the higher the target download priority of the candidate node corresponding to the target download priority parameter that is sorted the earlier the target download priority parameter is. The computer device may take the candidate node with the highest target download priority as the target node, and download the complete target file from the target node.
Of course, the target node may be a plurality of candidate nodes. To increase the download speed, the computer device may employ a distributed download. The computer device may segment the target file into a plurality of sub-segments, determine target nodes corresponding to the sub-segments from the candidate nodes based on the target download priority parameter, and further obtain the corresponding sub-segments from the target nodes. For example, the computer device segments the target file into sub-segment 1, sub-segment 2, and sub-segment 3, the computer device uses three candidate nodes with the highest target download priority as target nodes corresponding to sub-segment 1, sub-segment 2, and sub-segment 3, respectively, and obtains sub-segment 1, sub-segment 2, and sub-segment 3 from the three target nodes, respectively. The downloading process of the sub-segment may be parallel processing, for example, downloading sub-segment 1, sub-segment 2, and sub-segment 3 simultaneously. The computer device may also determine a target node corresponding to the first sub-segment from each candidate node based on the target download priority parameter, update the corresponding node communication information set based on current communication information generated by current communication between the computer device and each candidate node in the process of downloading the first sub-segment, obtain, by the computer device, an update download priority parameter corresponding to each candidate node based on the updated node communication information set, determine, from each candidate node, a target node corresponding to the next sub-segment based on the update download priority parameter, and so on, that the computer device always downloads the corresponding sub-segment from the current most reliable candidate node.
In one embodiment, each application is integrated with a respective special processing module having corresponding attention information stored thereon. After a user triggers a file downloading request on a target application program, a special processing module on the target application program can acquire a file downloading request carrying a target application identifier of the target application and a file identifier to be downloaded, acquire a candidate node information set corresponding to the file identifier to be downloaded, acquire a node communication information set of each candidate node corresponding to the candidate node information set, fuse node communication information in the same node communication information set based on locally stored target attention information to obtain a target downloading priority parameter corresponding to each candidate node, determine a target node from each candidate node based on determining the target node, and acquire a target file corresponding to the file identifier to be downloaded from the target node.
Referring to fig. 3A, the special processing module may be a Software Development Kit (PCDN SDK) responsible for data downloading for a specific service application and based on a Content distribution Network. Various business apps, such as live apps, video apps, and audio apps, are installed on the computer device. And an audio and video player/download component and a PCDN SDK are integrated in each service app. The audio and video player/download component is a file download request channel of the service app, and the PCDN SDK is used for downloading a target file and interacting with the audio and video player/download component. CDN downloading refers to downloading a target file through a CDN server. The fog node downloading refers to downloading the target file through the fog node.
The PCDN SDK may be responsible only for downloading the target file from the fog node, for example, when the user triggers a file download request on the service app, the audio/video player/download component of the service app may obtain the file download request and send the file download request to the PCDN SDK to request downloading of the target file from the fog node. The PCDN SDK inquires available fog nodes in which target files are stored, evaluates each fog node based on target attention information and a node communication information set corresponding to each fog node to obtain a target downloading priority parameter corresponding to each fog node, and downloads the target files to the most reliable fog nodes based on the target downloading priority parameters. And the target file downloaded by the PCDN SDK is thrown to an audio and video player/download component, and the target file is displayed on the service app through the audio and video player/download component. If the target file downloaded from the fog node is overtime, the PCDN SDK can inform the service app of failure in downloading the file from the fog node, so that the service app can download the target file to the CDN server in turn.
The PCDN SDK may also be responsible for downloading the target file from the CDN server. For example, when the PCDN SDK receives a file download request, the PCDN SDK preferentially queries available fog nodes storing the target file, and determines the most reliable fog node from the available fog nodes to download the target file. If the target file downloaded from the fog node is overtime, the PCDN SDK can further inquire the CDN server storing the target file, and the target file is downloaded from the CDN server.
In one embodiment, to reduce the storage pressure of the computer device, the application programs may share a unified processing module, and the unified processing module executes the steps of downloading the file without the application programs themselves downloading the file. For example, each application shares a PCDN SDK. The unified processing module stores attention information corresponding to a plurality of application programs respectively.
In the file downloading method, a file downloading request is obtained, the file downloading request carries a target application identifier of a target application and a file identifier to be downloaded, a candidate node information set corresponding to the file identifier to be downloaded is obtained, a node communication information set of each candidate node corresponding to the candidate node information set is obtained, the node communication information set comprises node communication information of at least two dimensions, the node communication information of at least two dimensions is obtained by communicating with the corresponding candidate node, node communication information in the same node communication information set is fused based on target attention information corresponding to the target application identifier, a target downloading priority parameter corresponding to each candidate node is obtained, the target node is determined from each candidate node based on the target downloading priority parameter, and a target file corresponding to the file identifier to be downloaded is obtained from the target node. Therefore, when the file is downloaded, the target node which is matched with the target application and is reliable can be determined from the candidate nodes based on the target attention information corresponding to the target application identification and the node communication information of the candidate nodes, and the file downloading from the target node can effectively guarantee the file downloading quality.
In one embodiment, the file downloading method of the present application may be executed by a unified processing module. The file downloading request acquisition method comprises the following steps: and the unified processing module receives a file downloading request sent by the target application through a preset interface. After the target file corresponding to the file identifier to be downloaded is obtained from the target node, the method further comprises the following steps: and the unified processing module sends the target file to the target application through a preset interface.
The preset interface is a calling interface of the unified processing module and is used for data interaction between the unified processing module and the target application.
Specifically, each application may share a unified processing module, and the unified processing module on the computer device performs each step of file downloading. After a user triggers and generates a file downloading request on a target application, the target application calls a preset interface and sends the file downloading request to a unified processing module, and the file downloading request carries a target application identifier of the target application and a file identifier to be downloaded. The unified processing module acquires a candidate node information set corresponding to a file identifier to be downloaded according to the file downloading request, acquires a node communication information set of each candidate node corresponding to the candidate node information set, and fuses node communication information in the same node communication information set based on target attention information corresponding to a target application identifier to obtain a target downloading priority parameter corresponding to each candidate node. And the unified processing module determines a target node from each candidate node based on the target download priority parameter, and acquires a target file corresponding to the file identifier to be downloaded from the target node. After the target file is obtained, the unified processing module can send the target file to the target application through the preset interface, and then the target application can display the target file.
Referring to fig. 3B, the unified processing module may be a software development kit PCDN SDK responsible for data download for multiple service applications and based on a content distribution network. Various service apps are installed on the computer device, and each service app can share one PCDN SDK. When a user triggers a file downloading request on the service app, an audio and video player/downloading component of the service app can acquire the file downloading request and send the file downloading request to the PCDN SDK through a preset interface so as to request to download a target file from a fog node. The PCDN SDK inquires available fog nodes in which target files are stored, evaluates each fog node based on target attention information corresponding to the service app and node communication information sets corresponding to each fog node to obtain target downloading priority parameters corresponding to each fog node, and downloads the target files to the most reliable fog nodes based on the target downloading priority parameters. And the target file downloaded by the PCDN SDK is sent to an audio and video player/download component of the service app through a preset interface, and the target file is displayed on the service app through the audio and video player/download component.
It is to be understood that the PCDN SDK may also be responsible for CDN downloads in addition to being specifically responsible for the foggy node downloads.
In this embodiment, the unified processing module executes the file downloading request, so that the storage pressure of the computer device can be reduced.
In one embodiment, the obtaining of the candidate node information set corresponding to the identifier of the file to be downloaded includes:
generating a node query request based on the current position information and the file identifier to be downloaded; sending a node query request to a query server so that the query server acquires an initial node information set, screening the initial node information set based on current position information to obtain a candidate node information set, wherein a target file is stored in an initial node corresponding to the initial node information set; and receiving a candidate node information set returned by the query server.
The current location information refers to the location information of the current geographical location of the computer device. The node query request is used for querying a candidate node storing the target file. The query server is a server for querying a node storing a desired file. The initial nodes refer to all nodes storing the target files, and comprise resource nodes and fog nodes.
In particular, the candidate node may be a node specifically referred to as a fog node. After obtaining the file downloading request, the computer device may generate a node query request based on the current location information of the computer device and the identifier of the file to be downloaded in the file downloading request, and send the node query request to the query server. After receiving the node query request, the query server may obtain an initial node information set according to the node query request, where the initial nodes corresponding to the initial node information set all store the target file. Furthermore, as the fog node is closer to the computer device, downloading the target file from the fog node can be faster and reduce the bandwidth pressure of the resource server, so that the query server can further screen the initial node information set based on the current position information to obtain a candidate node information set, and at this time, the candidate node corresponding to the candidate node information set is the fog node. The query server may specifically use an initial node whose position distance from the current position information is within a preset threshold as a candidate node, and generate a candidate node information set based on node information corresponding to the candidate node. After obtaining the candidate node information set, the query server may return the candidate node information set to the computer device.
In one embodiment, obtaining a node communication information set of each candidate node corresponding to the candidate node information set includes:
and when the candidate node is a node which has established communication connection historically, acquiring a corresponding historical communication information set as a corresponding node communication information set according to the node identification in the candidate node information set.
Wherein the historical communication information set is generated based on data generated by the computer device and the candidate nodes in the historical communication process.
Specifically, the candidate nodes corresponding to the candidate node information set may include old nodes that have established communication connections with the computer device in history, or may include new nodes that have never established communication connections with the computer device. In order to evaluate the candidate node, the computer device may store node communication information generated during communication with the candidate node locally, and store the node communication information corresponding to the candidate node in association with the node identifier corresponding to the candidate node. Then, when the candidate node is a node that has established communication connection historically, the computer device may obtain, according to the node identifier in the candidate node information set, a corresponding historical communication information set as a corresponding node communication information set. And the computer equipment carries out node evaluation according to the historical communication information set and determines a target node from each candidate node.
In one embodiment, when each candidate node corresponding to the candidate node information set includes both a new node and an old node, the node communication information set corresponding to the new node may be empty. After determining each candidate node, the computer device may determine the target node only from the old nodes having the historical communication information sets, because the node communication information set corresponding to the new node is empty. In this embodiment, the computer device considers that the old node is more reliable than the new node, and further selects a more reliable node among the old nodes as the target node.
In one embodiment, when each candidate node corresponding to the candidate node information set includes both a new node and an old node, after determining each candidate node, the computer device may obtain a historical communication information set corresponding to the old node as a node communication information set corresponding to the old node, and fuse node communication information in the same node communication information set based on the target attention information to obtain a target download priority parameter corresponding to the old node. In addition, the computer device may obtain the default download priority parameter as a target download priority parameter corresponding to the new node. Wherein, the default download priority parameter is used for characterizing the node performance of the general node and represents the average level. The default download priority parameter may be manually set, or may be obtained based on big data analysis, for example, by averaging target download priority parameters obtained by historical calculation to obtain the default download priority parameter. In this embodiment, the computer device defaults that the new node is a node with medium performance, and selects a more reliable node from the new node and the old node as a target node.
In one embodiment, to relieve the storage pressure of the computer device, the computer device may flush the set of historical communications. For example, the computer device may limit a maximum amount of stored data for the historical communications for each dimension of the set of historical communications, and delete an oldest historical communication to reduce the current amount of stored data when the current amount of stored data for a dimension of the historical communications exceeds the maximum amount of stored data. The computer device may also limit the storage of communication data resulting from a preset number of historical communications in the set of historical communication information that are closest to the current time.
In this embodiment, the historical communication information set corresponding to the candidate node is obtained as the corresponding node communication information set, so that the historical communication data can be fully utilized, and the candidate node can be more accurately evaluated.
In one embodiment, obtaining a node communication information set of each candidate node corresponding to the candidate node information set includes:
respectively sending heartbeat requests to each candidate node, and receiving response messages returned by each candidate node based on the heartbeat requests, wherein the heartbeat requests are used for establishing communication with the corresponding candidate nodes and requesting the candidate nodes to return historical data packet sending quantity, the response messages comprise the historical data packet sending quantity, and the historical data packet sending quantity refers to the quantity of data packets sent by the corresponding candidate nodes; obtaining node communication information of a first dimension corresponding to each candidate node based on heartbeat request and response messages corresponding to the same candidate node; acquiring historical data packet receiving quantity corresponding to each candidate node, wherein the historical data packet receiving quantity refers to the quantity of data packets received from the corresponding candidate node; obtaining second-dimension node communication information corresponding to each candidate node based on the historical data packet sending amount and the historical data packet receiving amount corresponding to the same candidate node; and generating a corresponding node communication information set based on the node communication information of the first dimension and the node communication information of the second dimension corresponding to the same candidate node to obtain the node communication information set corresponding to each candidate node.
Wherein the heartbeat request is a request by the computer device to establish communication with the candidate node. The response message is a heartbeat reply which is sent to the computer equipment after the candidate node receives the heartbeat request. Once the computer device obtains the node information of the node, the computer device may send a heartbeat request to the node based on the node information to establish a communication connection with the node. The communication connection between the computer device and the candidate node may be activated and maintained by a timed heartbeat request, so that the computer device may periodically send a heartbeat request to the candidate node, which may also periodically send a heartbeat request to the computer device. The timed time interval may be set according to actual needs, for example, a heartbeat request is sent every 3s, and a heartbeat request is sent every 5 s.
The historical data packet transmission amount refers to the number of data packets transmitted to the computer device by the candidate node when the computer device downloads the file from the candidate node at the historical time. The heartbeat request may be used to request the candidate node to return historical packet traffic, in addition to establishing a communication connection with the candidate node. After receiving the heartbeat request, the candidate nodes carry the sending quantity of the historical data packets in a response message returned to the computer equipment. The historical packet reception amount refers to the number of packets received by the computer device from the candidate node at the time of downloading the file from the candidate node at the historical time.
Specifically, after the candidate node information set is obtained, the computer device may establish a communication connection with each candidate node based on the heartbeat request. The computer device may evaluate the candidate nodes based directly on historical communication data, without regard to data generated by the current communication, to determine the target node therefrom. Certainly, in order to improve the accuracy of node evaluation and select a node which is more reliable currently, the computer device may also establish communication connection with each candidate node first, and generate a node communication information set based on data generated by current communication after communication for a preset communication time, or generate a node communication information set based on data generated by current communication and historical communication data. Wherein the preset communication time can be set as required, for example, 30s.
The node communication information set comprises node delay information which is calculated by sending and receiving heartbeat packets. The node communication information of the first dimension is node delay information. The computer device may generate node latency information based on heartbeat request and response messages corresponding to the same candidate node. The computer device may calculate a time difference between a transmission time of the heartbeat request and a reception time of the response message as the network delay, and count an average value of the network delays for a plurality of times as the node delay information. For example, the computer device counts the network delay of the last 20 times, and calculates the average value as the node delay information. The change of the network delay reflects the change of the network congestion degree to a certain extent.
The communication link between the computer device and the node is based on the UDP (User Datagram Protocol), which is a transport layer Protocol that provides transaction-oriented simple unreliable information transfer service. Because the UDP protocol is an unreliable protocol, data packets sent by a node to a computer device may be lost. Therefore, the node packet loss information can also be used as an important index for measuring the node performance.
The node communication information set comprises node packet loss information, and the node communication information of the second dimension is the node packet loss information. The computer device may generate the node packet loss information based on the historical packet transmission amount and the historical packet reception amount corresponding to the same candidate node. The computer device may calculate a packet loss rate based on the historical data packet transmission amount obtained through heartbeat reply and the historical data packet reception amount counted by itself, and count an average value of the packet loss rates for a plurality of times as node packet loss information. For example, the computer device counts the packet loss rate of the last 20 times, and calculates an average value as the node packet loss information.
It is understood that the node communication information set may also include node communication information of other dimensions, for example, node download success information.
In one embodiment, the computer device may segment the target file into a plurality of sub-segments. The computer device may randomly determine one candidate node as a target node from among the plurality of candidate nodes to download the first sub-segment, then the computer device calculates a target download priority parameter corresponding to each candidate node based on communication data generated in a process of downloading the first sub-segment, determines a new target node from among the candidate nodes based on the target download priority parameter, and downloads the remaining sub-segments from the new target node. In one embodiment, if a packet loss occurs, the computer device may send a packet reissue request to the same node to request the node to reissue a corresponding packet to the computer device. The computer device may also send a packet reissue request to another node to request the node to reissue the corresponding packet to the computer device, for example, request the CDN server to reissue the corresponding packet, and request the node with the next download priority to reissue the corresponding packet. The data packet reissue request carries a data packet identifier corresponding to a data packet to be reissued. It is understood that the packet transmission amount and the packet reception amount generated by the packet complementary transmission request are not included in the statistical category of the historical packet transmission amount and the historical packet reception amount.
In the embodiment, the node communication information set is generated based on the data generated by the current communication, so that the accuracy and timeliness of node evaluation can be effectively guaranteed. The computer equipment actively acquires real-time node communication information such as network delay, packet loss rate and the like through the heartbeat request, the node communication information can reflect the busy degree of the candidate node, the candidate node is evaluated based on the node communication information, and the current more reliable node can be selected as the target node, so that the speed of acquiring the target file from the target node can be increased.
In one embodiment, obtaining node communication information of a second dimension corresponding to each candidate node based on a historical data packet sending amount and a historical data packet receiving amount corresponding to the same candidate node includes:
adjusting the sending quantity of the historical data packets corresponding to the current candidate node based on a first preset adjusting value to obtain the receiving quantity of the target data packets; adjusting the historical data packet receiving amount corresponding to the current candidate node based on a second preset adjusting value to obtain the target data packet sending amount, wherein the first preset adjusting value is smaller than the second preset adjusting value, and the second preset adjusting value is a positive number; obtaining a packet loss rate of the data packet corresponding to the current candidate node based on the target data packet receiving amount and the target data packet sending amount; and obtaining node communication information of a second dimension corresponding to the current candidate node based on the packet loss rate.
Specifically, the computer device may calculate a packet loss rate corresponding to the candidate node based on the historical packet transmission amount and the historical packet reception amount corresponding to the same candidate node. The computer device can directly use the ratio of the historical data packet receiving amount to the historical data packet sending amount as the data packet receiving rate, obtain the data packet loss rate based on the data packet receiving rate, and further obtain the second-dimension node communication information corresponding to the current candidate node based on the data packet loss rate. However, the above packet reception rate calculation method cannot cope with an abnormal situation in which the transmission amount of the history packet is 0. To avoid this problem, the computer device may calculate the packet reception rate based on the new packet reception rate calculation method. When calculating the node communication information of the second dimension corresponding to the current candidate node, the computer device may adjust the sending amount of the historical data packet corresponding to the current candidate node based on the first preset adjustment value to obtain the receiving amount of the target data packet, adjust the receiving amount of the historical data packet corresponding to the current candidate node based on the second preset adjustment value to obtain the sending amount of the target data packet, obtain the receiving rate of the data packet based on the ratio of the receiving amount of the target data packet to the sending amount of the target data packet, obtain the packet loss rate corresponding to the current candidate node based on the receiving rate of the data packet, and obtain the node communication information of the second dimension corresponding to the current candidate node based on the packet loss rate corresponding to the current candidate node. The first preset adjusting value is smaller than the second preset adjusting value, so that the receiving rate of the data packet can be guaranteed to be smaller than 1, meanwhile, the receiving rate of the data packet can be guaranteed to be larger than 0 by the second preset adjusting value being a positive number, the data packet receiving rate calculating method is suitable for any historical data packet sending quantity and historical data packet receiving quantity, and abnormal conditions of the historical data packet sending quantity being 0 can be handled.
In one embodiment of the method of manufacturing the optical fiber, can pass through
Figure BDA0003066646530000201
And calculating a packet loss rate, loss represents the packet loss rate, recv represents the historical data packet receiving amount, send represents the historical data packet sending amount, recv +1 represents the target data packet receiving amount, and send +2 represents the target data packet sending amount.
In this embodiment, the sending amount of the historical data packets is adjusted by the first preset adjustment value to obtain the sending amount of the target data packets, the receiving amount of the historical data packets is adjusted by the second preset adjustment value to obtain the receiving amount of the target data packets, and the node communication information of the second dimension is obtained based on the sending amount of the target data packets and the receiving amount of the target data packets, so that the reliability and the effectiveness of the node communication information of the second dimension can be guaranteed.
In one embodiment, fusing node communication information in the same node communication information set based on target attention information corresponding to a target application identifier to obtain target download priority parameters corresponding to each candidate node, including:
carrying out normalization processing on the node communication information of each dimension in the same node communication information set to obtain node communication scores corresponding to each candidate node in each dimension; based on the target attention information, fusing the communication scores of all nodes corresponding to the same candidate node to obtain a target communication score corresponding to each candidate node; and obtaining a target downloading priority parameter corresponding to each candidate node based on the target communication score corresponding to each candidate node.
The normalization processing is used for mapping node communication information of the same dimension among different candidate nodes into the same numerical value range so as to perform data fusion and data comparison in the following process.
Specifically, the computer device may perform normalization processing on the node communication information of each dimension in the same node communication information set to obtain a node communication score corresponding to each candidate node in each dimension. Specifically, the normalization processing may be performed by a conventional method, for example, the candidate nodes include a candidate node 1, a candidate node 2, and a candidate node 3, where the node communication information of the first dimension corresponding to the candidate node 1 is a, the node communication information of the second dimension corresponding to the candidate node 2 is B, and the node communication information of the second dimension corresponding to the candidate node 3 is C, and then, the node communication score of the first dimension corresponding to the candidate node 1 may be a/(a + B + C). The normalization processing can also be carried out through a preset table, the preset table records the incidence relation between the node communication information and the node communication scores, and the node communication scores corresponding to the node communication information can be obtained through table lookup.
After obtaining the node communication scores corresponding to the candidate nodes in the dimensions, the computer device may fuse the node communication scores corresponding to the same candidate node based on the target attention information, that is, perform weighted summation on the node communication scores corresponding to the same candidate node based on the target attention information, to obtain the target communication scores corresponding to the candidate nodes. And finally, the computer equipment takes the target communication scores corresponding to the candidate nodes as target downloading priority parameters corresponding to the candidate nodes to obtain the target downloading priority parameters respectively corresponding to the candidate nodes.
In the embodiment, the node communication information of each dimension in the same node communication information set is subjected to normalization processing and then fused to obtain the target communication score, so that the reliability and effectiveness of the target communication score can be effectively guaranteed, and the target node can be conveniently determined from each candidate node based on the target download priority parameter.
In one embodiment, normalizing the node communication information of each dimension in the same node communication information set to obtain a node communication score corresponding to each candidate node in each dimension respectively includes:
acquiring incidence relation information corresponding to each dimension respectively, wherein the incidence relation information represents the incidence relation between the node communication information and the node communication scores, the incidence relation information comprises a plurality of sequentially arranged intervals corresponding to the node communication information of the same dimension, each interval has corresponding communication score reference information respectively, and the communication score reference information is in a monotonous change trend according to the arrangement sequence of the intervals; acquiring current node communication information corresponding to a current dimension of a current candidate node, and acquiring an interval range corresponding to each interval from incidence relation information corresponding to the current dimension; decomposing the current node communication information according to the interval range corresponding to each interval to obtain current communication sub-information corresponding to each interval; and obtaining the node communication score corresponding to the current candidate node in the current dimension based on the current communication sub-information and the communication score reference information corresponding to the same interval.
The incidence relation information is used for representing incidence relation between the node communication information and the node communication scores, and the computer equipment can determine the node communication scores corresponding to the node communication information based on the incidence relation information. The incidence relation information comprises a plurality of sections which are arranged in sequence and correspond to the node communication information with the same dimensionality, each section is provided with corresponding communication score reference information, and the communication score reference information is in a monotonous change trend according to the arrangement sequence of the sections. One interval corresponds to a local node communication information range, for example, 0 to 10 is one interval, and 10 to 20 is another interval. The interval ranges between different intervals may include overlapping data, the interval ranges between different intervals may not overlap, and the spans of the interval ranges between different intervals may be the same or different. And the communication score reference information corresponding to one interval is used for calculating the reference communication score corresponding to the node communication information falling into the interval. The communication score reference information may be a formula or specific data. The monotone changing trend may be monotone increasing or monotone decreasing. The monotonous change trend may be a uniform change or an accelerated change, for example, an exponential change. Different dimensions correspond to different association relation information. The association information may be presented in the form of a table. The current communication sub-information refers to node communication sub-information of which the current node communication information falls in a certain interval.
Specifically, the computer device may obtain association relationship information corresponding to each dimension, and determine node communication scores corresponding to the candidate nodes in each dimension based on the association relationship information. Taking calculating the node communication score corresponding to the current dimension of the current candidate node as an example, the computer device may obtain the current node communication information corresponding to the current dimension of the current candidate node, obtain the interval range corresponding to each interval from the association relationship information corresponding to the current dimension, and decompose the current node communication information according to the interval range corresponding to each interval to obtain the current communication sub-information corresponding to each interval. For example, if the association information corresponding to the current dimension includes the intervals 1 (0 to 10), 2 (10 to 30), and 3 (30 to 60), and the current node communication information is 40, the current communication sub information corresponding to the interval 1 obtained by decomposing the current node communication information is 10 (10 to 0= 10), the current communication sub information corresponding to the interval 2 is 20 (30 to 10= 20), and the current communication sub information corresponding to the interval 3 is 10 (40 to 30= 10). Furthermore, the computer device may obtain a node communication score corresponding to the current candidate node in the current dimension based on the current communication sub-information and the communication score reference information corresponding to the same interval. For example, if the communication score reference information corresponding to the interval 1 is 2, the communication score reference information corresponding to the interval 2 (10-30) is 4, the communication score reference information corresponding to the interval 3 (30-60) is 8, and the current node communication information is 40, the node communication score corresponding to the current node communication information is 98 (10 + 2+20 + 4+10 + 8= 98). Similarly, the computer device may obtain node communication scores of the current candidate node in other dimensions, and the computer device may obtain node communication scores of the other candidate nodes in each dimension.
In one embodiment, the association information of the node communication information (node delay information) of the first dimension is shown in table 1.
TABLE 1
Figure BDA0003066646530000231
The reason why the interval of RTT (Round-Trip Time) is set to 50-100-200-500: according to general network knowledge, in general, RTT <50ms is a case where the network condition is excellent; RTT <100 belongs to the network normal case; RTT <200 is a somewhat slow, but acceptable situation (there may be 100-200 RTT at late peak, and there may be a large delay in the network of fog nodes). The larger the RTT is, the higher the network delay is, that is, the more busy the network is, the larger the corresponding score is at this time. At this time, the scores corresponding to the intervals may not be designed according to a linear scale, because under the condition that the RTT is reasonable (RTT < 200), the corresponding scores should not differ too much, and the RTT normally fluctuates by 30-50ms, and when the RTT is extremely large, it indicates that an abnormal phenomenon occurs in the network, and at this time, the scores should be able to sufficiently represent the abnormal phenomenon. Therefore, an exponential growth scoring model (1- >3- >9- >27- > 81) was designed. RTT <200 is a case where the network status is still acceptable, and therefore, the three interval scores of 0< = RTT <50, 50< = RTT <100, and 100< = RTT <200 are not different by much (1- >3- > 9). Meanwhile, in the two intervals of 200< = RTT <500 and 500< = RTT, the score should be relatively large (27- > 81) so as to be obviously distinguished from the previous three intervals.
For example, if the network delay RTT is 20ms, the delay score (i.e., the node communication score in the first dimension) is 20 × 1=20. Assuming a network delay RTT of 70ms, the delay score is 50 × 1+ (70-50) × 3=110. If the network delay RTT is 250ms, the delay score is 50 × 1+ (100-50) × 3+ (200-100) × 9+ (250-200) × 27=2450.
In one embodiment, the association relationship information of the node communication information (node packet loss information) of the second dimension is shown in table 2.
TABLE 2
Figure BDA0003066646530000241
The interval of the packet loss rate loss 10000 is set as the reason of 40-80-100-200: according to general network knowledge, loss 10000 & lt 200 (that is, the packet loss rate is within 2%) generally represents normal network conditions, and a value higher than 200 represents relatively abnormal network conditions. And according to the on-line service packet loss feedback, table 2 can better describe the packet loss rate distribution, so that the packet loss rate loss interval can be set to be 40-80-100-200. At this time, the scores corresponding to the intervals may not be designed according to a linear scale, because the packet loss rate belongs to a normal network within 2%, the corresponding scores are not very different (5- >10- >15- > 20), when the packet loss is higher than 2%, the network performance is relatively poor, and at this time, the score is increased to 80 sharply, so that the network performance is clearly distinguished from the previous four intervals.
For example, if the packet loss rate loss 1000 is 50, the corresponding packet loss score (i.e., the corresponding node communication score in the second dimension) is 40 × 5+ (50-40) × 10=300. If the packet loss rate is 90, the corresponding packet loss score is 40 × 5+ (80-40) × 10+ (90-80) × 15=750. If the packet loss rate is 350, the packet loss score is 40 × 5+ (80-40) × 10+ (100-80) × 15+ (200-100) × 20+ (350-200) × 80=14900.
It is understood that the interval settings and score settings in tables 1 and 2 may be varied according to actual needs.
In the embodiment, the node communication information is normalized based on the incidence relation information, and the node communication score obtained by normalization processing can be effectively ensured to accurately and reliably reflect the node performance.
In one embodiment, the method further comprises:
obtaining key dimensions respectively corresponding to a plurality of candidate applications; generating attention information corresponding to the current candidate application based on a key dimension corresponding to the current candidate application, wherein in the attention information corresponding to the current candidate application, the attention degree corresponding to the key dimension is higher than that corresponding to other dimensions; and associating the attention information and the application identification corresponding to the same candidate application.
The key dimension refers to a dimension having a key role, that is, a dimension in which an application is more focused, more looked heavy, and more focused. Attention strength refers to attention weight.
Specifically, the computer device may obtain key dimensions corresponding to multiple candidate applications, and generate corresponding attention information based on the key dimensions corresponding to the same candidate application. Different candidate applications correspond to different attention information. Taking the current candidate application as an example, the computer device may generate attention information corresponding to the current candidate application based on a key dimension corresponding to the current candidate application, and in the attention information corresponding to the current candidate application, the attention degree corresponding to the key dimension is higher than the attention degrees corresponding to other dimensions, so as to highlight the importance of the key dimension, and then when calculating the target communication score, more node communication information corresponding to the key dimension may be fused based on the attention degrees corresponding to the key dimension. Therefore, when the node communication information corresponding to the key dimensionality of the candidate node is poor in expression, the target communication score obtained by final fusion is also poor in expression, the target communication score can accurately reflect that the candidate node is not suitable for downloading a target file required by the target application, and therefore the candidate node cannot be used as the target node by the computer equipment. Similarly, the computer device may obtain attention information corresponding to each candidate application. The computer device may then associate the attention information and the application identification corresponding to the same candidate application, storing each application identification and the corresponding attention information locally.
It can be understood that when the attention information is generated, as long as it is ensured that the attention degree corresponding to the key dimension is higher than the attention degrees corresponding to other dimensions, the specific data of the attention degree corresponding to each dimension can be set as required or calculated through a custom formula.
In one embodiment, the key dimensions corresponding to the candidate applications may be manually set. The developer can input the key dimensions respectively corresponding to the candidate applications on the related configuration interface. The computer device may receive an input operation of a user, and determine key dimensions corresponding to the candidate applications according to the input operation. The user can also configure the key dimensions respectively corresponding to each candidate application through the configuration file, so that the computer device can acquire the configuration file and determine the key dimensions respectively corresponding to each candidate application according to the configuration file.
In this embodiment, the attention information corresponding to the candidate application is generated based on the key dimension corresponding to the candidate application, and the attention degree corresponding to the key dimension is higher than the attention degrees corresponding to other dimensions in the attention information, so that when data fusion is performed based on the attention information, the node communication score corresponding to the key dimension can be focused more, and therefore a more reliable target node matched with the application can be accurately selected based on the target communication score obtained by fusion.
In an embodiment, as shown in fig. 4, acquiring a target file corresponding to a file identifier to be downloaded from a target node includes:
step S402, downloading a first sub-segment corresponding to the target file from the target node, wherein the first sub-segment is a first-ordered sub-segment in a sub-segment sequence obtained by segmenting the target file.
The sub-fragment sequence is a sequence formed by a plurality of sub-fragments obtained by segmenting the target file. The individual sub-segments may be arranged in chronological order. For example, a plurality of video clips obtained by segmenting the target video are arranged from early to late according to the time sequence to obtain a video clip sequence. The first sub-segment refers to the first-ordered sub-segment in the sub-segment sequence, that is, the sub-segment that is downloaded most preferentially.
In particular, the computer device may download an entire target file from one target node at a time. The computer device may also download the sub-segments of the target file from different target nodes in batch, and combine the downloaded sub-segments into the target file, that is, download the target file in a distributed downloading manner. When performing distributed downloading, in order to further improve the quality of file downloading, the computer device may update the node communication information set based on communication data generated in real time by downloading the current sub-segment, further re-evaluate each candidate node in combination with the communication data generated in real time, and select the current most reliable candidate node from each candidate node as a target node to download the next sub-segment. In this way, the computer device may always download individual sub-segments of the target file with the most reliable nodes analyzed based on the latest data statistics.
Step S404, in the downloading process of the current sub-segment, updating the node communication information set corresponding to each candidate node based on the current communication information generated by the current communication with each candidate node.
And step S406, based on the target attention information, fusing the node communication information in the updated node communication information set corresponding to the same candidate node to obtain an updated downloading priority parameter corresponding to each candidate node.
Step S408, determining an updating node corresponding to the next sub-segment of the current sub-segment from each candidate node based on the updating downloading priority parameter, obtaining the next sub-segment from the updating node, taking the next sub-segment as a new current sub-segment, and returning to the step of updating the node communication information set corresponding to each candidate node based on the current communication information generated by the current communication with each candidate node in the downloading process of the current sub-segment until the sub-segments in the sub-segment sequence are downloaded completely.
Wherein, the updated download priority parameter refers to the updated target download priority parameter. The update node is a target node corresponding to a next sub-segment of the current sub-segment.
Specifically, during the downloading of the current sub-segment, the computer device may update the node communication information set corresponding to each candidate node based on current communication information generated by current communication with each candidate node. For example, during the downloading process of the current sub-segment, the computer device sends a new heartbeat request to each candidate node, and receives a corresponding response message. The computer device may update the node latency information in the node communication information set based on the new heartbeat request and response messages. If the target node corresponding to the current sub-segment is the node a, the computer device may update the node packet loss information of the node a in the downloading process of the current sub-segment. In this way, before downloading the next sub-segment of the current sub-segment, the computer device may fuse the node communication information in the updated node communication information set corresponding to the same candidate node based on the target attention information, to obtain the updated downloading priority parameter corresponding to each candidate node. And the computer equipment determines an updating node corresponding to the next sub-segment of the current sub-segment from all the candidate nodes based on the updating downloading priority parameter, and acquires the next sub-segment from the updating node. Similarly, the computer device may take the next sub-segment as a new current sub-segment, and return to the step of updating the node communication information sets corresponding to the candidate nodes based on the current communication information generated by the current communication with the candidate nodes in the downloading process of the current sub-segment until the sub-segments in the sub-segment sequence are all downloaded. That is, each time a sub-segment is downloaded, the computer device re-evaluates each candidate node in combination with the newly generated current communication information and the original node communication information, and determines the target node corresponding to the next sub-segment from the candidate nodes until all sub-segments in the sequence of sub-segments are downloaded.
For example, the sequence of sub-segments of the target file includes sub-segment 1, sub-segment 2, and sub-segment 3, and the candidate nodes include candidate nodes 1-5. Before downloading the sub-segment 1, the computer device determines that the candidate node 1 is the target node corresponding to the sub-segment 1 based on the node communication information sets of the respective candidate nodes, and the computer device downloads the sub-segment 1 from the candidate node 1. During the downloading of sub-segment 1, the computer device remains in communication with the respective candidate node at all times. In downloading the subfragment 1, the computer device may update the node communication information set corresponding to each candidate node based on current communication information generated by current communication with each candidate node. Before downloading the subfragment 2, the computer device determines that the candidate node 2 is the target node corresponding to the subfragment 2 based on the updated node communication information set corresponding to each candidate node, and the computer device downloads the subfragment 2 from the candidate node 2. During the downloading of a sub-segment 2, the computer device remains in communication with the respective candidate node at all times. During downloading of the sub-segment 2, the computer device may further update the set of node communication information corresponding to each candidate node based on current communication information generated by current communication with each candidate node. Before downloading the sub-segment 3, the computer device determines that the candidate node 2 is the target node corresponding to the sub-segment 3 based on the latest node communication information set corresponding to each candidate node, and the computer device downloads the sub-segment 3 from the candidate node 2.
In this embodiment, the sub-segments corresponding to the target file are always downloaded by the most reliable node analyzed based on the latest data statistics, so that the downloading speed of the target file can be increased, and the downloading quality of the target file can be improved.
In an embodiment, as shown in fig. 5, determining a target node from each candidate node based on a target download priority parameter, and acquiring a target file corresponding to a file identifier to be downloaded from the target node includes:
step S502, the target file is segmented to obtain a plurality of sub-segments corresponding to the target file.
Step S504, determining target nodes corresponding to the sub-segments from the candidate nodes based on the target download priority parameters.
Step S506, acquiring corresponding sub-segments from each target node in parallel.
Specifically, when performing distributed downloading, the computer device may adopt a parallel downloading manner to further increase the speed of file downloading. The computer device may segment the target file, segmenting a large target file into a plurality of small sub-segments. And then, the computer equipment determines target nodes corresponding to the sub-segments from the candidate nodes based on the target downloading priority parameters, and acquires the corresponding sub-segments from the target nodes in parallel.
In one embodiment, the computer device may uniformly slice files of different sizes based on a preset data amount. For example, the predetermined amount of data is 128KB, when file 1 corresponds to a file size of 512KB, the computer device may segment file 1 into 4 sub-segments (4 × 128kb=512kb), and when file 2 corresponds to a file size of 256KB, the computer device may segment file 1 into 2 sub-segments (2 × 128kb=256kb).
In an embodiment, the computer device may set the respective split data volumes corresponding to different file formats, and then, after obtaining the file download request, the computer device may determine a target file format corresponding to the target file based on the identifier of the file to be downloaded, and split the target file based on the split data volume corresponding to the target file format. For example, a file in a video format may set a larger amount of sliced data, and a file in an audio format may set a smaller amount of sliced data. Because the file in the video format is usually large, the number of the sub-segments can be effectively limited by setting a large data amount of the segments, and the computer equipment is prevented from downloading data from excessive target nodes.
In one embodiment, the computer device may set a maximum concurrency number for controlling the number of sub-segments that the computer device may concurrently download in parallel. For example, if the maximum number of concurrencies is 4, the computer device may download 4 sub-segments to 4 fog nodes simultaneously at most in parallel. Therefore, the stability of file downloading can be effectively controlled through the maximum concurrency number, and the influence on the file downloading speed caused by the fact that a single fog node receives too many slice downloading requests is avoided.
In this embodiment, the speed of file downloading can be increased by multi-line parallel downloading of data, and the speed and success rate of file downloading can be further increased by downloading data from a target node with higher reliability, thereby improving the quality of file downloading.
In one embodiment, the method further comprises:
when the target file is not acquired within the preset downloading time, acquiring resource node information corresponding to the identifier of the file to be downloaded; and acquiring the target file from the resource node corresponding to the resource node information.
The resource node refers to a CDN server. The preset download time refers to the time limit of downloading the file from the candidate node by the computer device.
Specifically, the computer device is time-limited to acquire the target file from the fog node, and if the computer device does not acquire the target file from the fog node within the preset downloading time, it may be determined that the computer device fails to acquire the target file from the fog node, and the computer device may turn to acquire the target file from the CDN server. When the target file is not acquired within the preset downloading time, the computer device may acquire resource node information corresponding to the identifier of the file to be downloaded from the query server, and acquire the target file from the resource node corresponding to the resource node information. If the computer device has already acquired part of the file data of the target file from the fog node, the computer device may acquire the remaining file data of the target file from the resource node. In one embodiment, different preset download times may be set for different size target files. For example, when the target file is small, a small preset download time is set, and when the target file is large, a large preset download time is set.
In the embodiment, when the target file is not acquired from the target node, the target file can be acquired from the resource node, so that the flexibility of file downloading is guaranteed.
In a specific embodiment, as shown in fig. 6A, the file downloading method includes the following steps:
1. target application sends file download request to PCDN SDK
The audio and video player/download component of the target application can acquire a file download request generated by user triggering, and the audio and video player/download component can send the file download request to the PCDN SDK, wherein the file download request carries a target application identifier of the target application and a file identifier to be downloaded.
2. PCDN SDK sends fog node query request to query server
After receiving the fog node query request, the query server can query the fog nodes storing the target files corresponding to the identifiers of the files to be downloaded according to the fog node query request, and generate a candidate fog node information set based on the queried node information of the fog nodes.
3. The query server returns a candidate fog node information set to the PCDN SDK
4. Communication establishment between PCDN SDK and candidate fog nodes corresponding to candidate fog node information sets
4-1, sending a heartbeat request to each candidate fog node at regular time by the PCDN SDK, and sending a heartbeat reply (namely a response message) to the PCDN SDK by the candidate fog node after receiving the heartbeat request.
4-2, each candidate fog node sends a heartbeat request to the PCDN SDK at regular time, and the PCDN SDK receives the heartbeat request and sends a heartbeat reply (namely a response message) to the candidate fog node.
5. PCDN SDK carries out fog node evaluation, and determines target fog nodes from all candidate fog nodes
The PCDN SDK can obtain node communication information sets corresponding to the candidate fog nodes respectively, fusion is carried out on the node communication information in the same node communication information set on the basis of target attention information corresponding to the target application identification, target downloading priority parameters corresponding to the candidate fog nodes are obtained, and the target fog nodes are determined from the candidate fog nodes on the basis of the target downloading priority parameters. The node communication information set corresponding to the candidate fog node can comprise at least one of communication data generated by historical communication and communication data generated by current communication. The node communication information set comprises data such as node time delay information, node packet loss information, node downloading success information and the like. The PCDN SDK can evaluate all available fog nodes based on information such as network delay and packet loss rate, and then delivers the target file to the most reliable fog nodes for downloading.
For example, the node communication information set includes node delay information and node packet loss information. The PCDN SDK calculates a delay score through table 1 based on the node delay information, and calculates a packet loss score (transmission score) through table 2 based on the node packet loss information. Target communication score = (a delay score) + ((1-a) × transmission score), a ∈ [0,1.0]. The smaller the target communication score of the fog node is, the more excellent the fog node is, the better the comprehensive performance of the fog node on network delay and packet loss is, otherwise, the more busy the fog node is.
6. PCDN SDK downloads target file to target fog node
The PCDN SDK can determine a target fog node from all the candidate fog nodes based on the target download priority parameter, and download a complete target file to the target fog node.
The PCDN SDK can divide the target file to obtain a plurality of sub-segments, target fog nodes corresponding to the sub-segments are determined from the candidate fog nodes based on the target downloading priority parameter, and the corresponding sub-segments are downloaded to the target fog nodes in parallel.
The PCDN SDK can segment the target file to obtain a sub-segment sequence. The PCDN SDK can determine a target fog node corresponding to the first sub-segment from the candidate fog nodes based on the target download priority parameter, and download the first sub-segment from the target fog node corresponding to the first sub-segment. Since the PCDN SDK maintains communication connection with each candidate foggy node during the downloading of the first sub-segment, new communication data is generated, and the PCDN SDK can update the node communication information set based on the new communication data. Then, when downloading the next sub-segment, the PCDN SDK may re-evaluate each candidate fog node based on the new node communication information set, determine a target fog node corresponding to the next sub-segment from each candidate fog node, download the next sub-segment from the target fog node corresponding to the next sub-segment, and so on until all sub-segments in the sub-segment sequence are downloaded completely. Referring to fig. 6b, the pcdn SDK and each candidate foggy node continue to heartbeat-interact to maintain the communication connection. And the PCDN SDK evaluates all available fog nodes based on node communication information such as network delay, packet loss rate and the like, and then delivers the current sub-segment to the most reliable fog node for downloading. The PCDN SDK can request the fog node to download the sub-segment data, the fog node sends the sub-segment data through the data packet, and the PCDN SDK can continuously receive all the data packets until the current sub-segment is downloaded. In the downloading process of the current sub-segment, the PCDN SDK stores newly generated node communication information, carries out the fog node evaluation again, selects the current most reliable fog node to start the data downloading of the next sub-segment until all the sub-segments in the sub-segment sequence are downloaded completely, and the PCDN SDK obtains a target file.
7. PCDN SDK sends target file to target application
If the downloading fails due to the downloading timeout, the target file can be requested to be downloaded from the CDN server.
In the embodiment, the bandwidth of the fog node can be fully utilized by selecting the fog node to download the file, and the stability of file downloading is ensured. By evaluating each fog node, selecting the fog node with the best node performance as a target fog node, and downloading the file from the target fog node, the file downloading speed can be increased, the downloading failure condition can be reduced, the retransmission repeat bandwidth can be reduced, the charging bandwidth can be reduced, and the cost can be further saved.
It should be understood that although the steps in the flowcharts of fig. 2, 4 and 5 are shown in sequence as indicated by the arrows, the steps are not necessarily performed in sequence as indicated by the arrows. The steps are not limited to being performed in the exact order illustrated and, unless explicitly stated herein, may be performed in other orders. Moreover, at least some of the steps in fig. 2, 4, and 5 may include multiple steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, which are not necessarily performed in sequence, but may be performed alternately or alternately with other steps or at least some of the other steps or stages.
In one embodiment, as shown in fig. 7, there is provided a file downloading apparatus, which may be a part of a computer device using a software module or a hardware module, or a combination of the two, and specifically includes: a request obtaining module 702, a node information obtaining module 704, a communication information obtaining module 706, a download priority parameter determining module 708, and a file downloading module 710, wherein:
a request obtaining module 702, configured to obtain a file downloading request, where the file downloading request carries a target application identifier of a target application and an identifier of a file to be downloaded;
a node information obtaining module 704, configured to obtain a candidate node information set corresponding to a file identifier to be downloaded;
a communication information obtaining module 706, configured to obtain a node communication information set of each candidate node corresponding to the candidate node information set, where the node communication information set includes node communication information of at least two dimensions, and the node communication information of at least two dimensions is obtained by communicating with the corresponding candidate node;
a download priority parameter determination module 708, configured to fuse node communication information in the same node communication information set based on target attention information corresponding to the target application identifier, to obtain a target download priority parameter corresponding to each candidate node;
the file downloading module 710 is configured to determine a target node from the candidate nodes based on the target downloading priority parameter, and obtain a target file corresponding to the identifier of the file to be downloaded from the target node.
In an embodiment, the file downloading device further includes a unified processing module, and the unified processing module may be configured to execute operations corresponding to the request obtaining module, the node information obtaining module, the communication information obtaining module, the download priority parameter determining module, and the file downloading module. The unified processing module is used for receiving a file downloading request sent by the target application through a preset interface, and the unified processing module is used for sending the target file to the target application through the preset interface.
In an embodiment, the node information obtaining module is further configured to generate a node query request based on the current location information and the identifier of the file to be downloaded, send the node query request to the query server, so that the query server obtains an initial node information set, screen the initial node information set based on the current location information to obtain a candidate node information set, where an initial node corresponding to the initial node information set stores a target file, and receive the candidate node information set returned by the query server.
In one embodiment, the communication information obtaining module is further configured to, when the candidate node is a node that has established communication connection historically, obtain, according to the node identifier in the candidate node information set, a corresponding historical communication information set as a corresponding node communication information set.
In an embodiment, the communication information obtaining module is further configured to send heartbeat requests to the candidate nodes, respectively, and receive response messages returned by the candidate nodes based on the heartbeat requests, where the heartbeat requests are used to establish communication with the corresponding candidate nodes and to request the candidate nodes to return historical data packet transmission amounts, where the response messages include historical data packet transmission amounts, where the historical data packet transmission amounts refer to the number of data packets sent by the corresponding candidate nodes, and obtain, based on the heartbeat requests and the response messages corresponding to the same candidate node, node communication information of a first dimension corresponding to each candidate node, and obtain historical data packet reception amounts corresponding to the candidate nodes, where the historical data packet reception amounts refer to the number of data packets received from the corresponding candidate nodes, and obtain, based on the historical data packet transmission amounts and the historical data packet reception amounts corresponding to the same candidate node, node communication information of a second dimension corresponding to each candidate node, and generate corresponding node communication information sets based on the node communication information of the first dimension and the node communication information of the second dimension corresponding to the same candidate node, and obtain node communication information sets corresponding to which correspond to each candidate node.
In an embodiment, the communication information obtaining module is further configured to adjust a historical data packet sending amount corresponding to the current candidate node based on a first preset adjustment value to obtain a target data packet receiving amount, adjust the historical data packet receiving amount corresponding to the current candidate node based on a second preset adjustment value to obtain the target data packet sending amount, where the first preset adjustment value is smaller than the second preset adjustment value, the second preset adjustment value is a positive number, obtain a data packet loss rate corresponding to the current candidate node based on the target data packet receiving amount and the target data packet sending amount, and obtain second-dimensional node communication information corresponding to the current candidate node based on the data packet loss rate.
In an embodiment, the download priority parameter determining module is further configured to perform normalization processing on the node communication information of each dimension in the same node communication information set to obtain node communication scores corresponding to each candidate node in each dimension, perform fusion on the node communication scores corresponding to the same candidate node based on the target attention information to obtain a target communication score corresponding to each candidate node, and obtain a target download priority parameter corresponding to each candidate node based on the target communication score corresponding to each candidate node.
In an embodiment, the download priority parameter determining module is further configured to obtain association relationship information corresponding to each dimension, where the association relationship information represents an association relationship between node communication information and node communication scores, the association relationship information includes multiple sequentially arranged intervals corresponding to the node communication information of the same dimension, each interval has corresponding communication score reference information, the communication score reference information is in a monotone change trend according to an arrangement sequence of the intervals, current node communication information corresponding to a current candidate node in the current dimension is obtained, an interval range corresponding to each interval is obtained from the association relationship information corresponding to the current dimension, the current node communication information is decomposed according to the interval range corresponding to each interval, current communication sub-information corresponding to each interval is obtained, and a node communication score corresponding to the current candidate node in the current dimension is obtained based on the current communication sub-information corresponding to the same interval and the communication score reference information.
In one embodiment, as shown in fig. 8, the file downloading apparatus further includes:
the attention information generating module 701 is configured to obtain key dimensions corresponding to multiple candidate applications, generate attention information corresponding to a current candidate application based on the key dimensions corresponding to the current candidate application, where in the attention information corresponding to the current candidate application, the attention degree corresponding to the key dimension is higher than the attention degree corresponding to other dimensions, and associate the attention information corresponding to the same candidate application with an application identifier.
In an embodiment, the file downloading module is further configured to determine a target downloading priority corresponding to each candidate node based on the target downloading priority parameter, and take the candidate node with the highest target downloading priority as the target node.
In an embodiment, the file downloading module is further configured to download a first sub-segment corresponding to the target file from the target node, where the first sub-segment is a first-ranked sub-segment in a sub-segment sequence obtained by splitting the target file, update a node communication information set corresponding to each candidate node based on current communication information generated by current communication with each candidate node in a downloading process of the current sub-segment, fuse node communication information in an updated node communication information set corresponding to the same candidate node based on the target attention information to obtain an updated downloading priority parameter corresponding to each candidate node, determine an updated node corresponding to a next sub-segment of the current sub-segment from each candidate node based on the updated downloading priority parameter, obtain the next sub-segment from the updated node, use the next sub-segment as a new current sub-segment, return to a downloading process of the current sub-segment, and update a node communication information set corresponding to each candidate node based on current communication information generated by current communication with each candidate node until all sub-segments in the sub-segment sequence are downloaded.
In an embodiment, the file downloading module is further configured to segment the target file to obtain a plurality of sub-segments corresponding to the target file, determine target nodes respectively corresponding to each sub-segment from each candidate node based on the target downloading priority parameter, and obtain corresponding sub-segments from each target node in parallel.
In an embodiment, the file downloading module is further configured to, when the target file is not acquired within the preset downloading time, acquire resource node information corresponding to the identifier of the file to be downloaded, and acquire the target file from a resource node corresponding to the resource node information.
According to the file downloading device, a file downloading request is obtained, the file downloading request carries a target application identifier of a target application and a file identifier to be downloaded, a candidate node information set corresponding to the file identifier to be downloaded is obtained, a node communication information set of each candidate node corresponding to the candidate node information set is obtained, the node communication information set comprises node communication information of at least two dimensions, the node communication information of at least two dimensions is obtained by communicating with the corresponding candidate node, node communication information in the same node communication information set is fused on the basis of target attention information corresponding to the target application identifier, a target downloading priority parameter corresponding to each candidate node is obtained, the target node is determined from each candidate node on the basis of the target downloading priority parameter, and a target file corresponding to the file identifier to be downloaded is obtained from the target node. Therefore, when the file is downloaded, the target node which is matched with the target application and is reliable can be determined from the candidate nodes based on the target attention information corresponding to the target application identification and the node communication information of the candidate nodes, and the file downloading from the target node can effectively guarantee the file downloading quality.
For the specific limitations of the file downloading device, reference may be made to the above limitations on the file downloading method, which will not be described herein again. The modules in the file downloading device can be wholly or partially realized by software, hardware and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a server, and the internal structure thereof may be as shown in fig. 9. The computer device includes a processor, a memory, and a network interface connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The database of the computer device is used for storing data such as node communication information sets, historical communication information sets, attention information corresponding to each candidate application and the like. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a file download method.
In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as shown in fig. 10. The computer device includes a processor, a memory, a communication interface, a display screen, and an input device connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile 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 operation of an operating system and computer programs in the non-volatile storage medium. The communication interface of the computer device is used for carrying out wired or wireless communication with an external terminal, and the wireless communication can be realized through WIFI, an operator network, NFC (near field communication) or other technologies. The computer program is executed by a processor to implement a file download method. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, a key, a track ball or a touch pad arranged on the shell of the computer equipment, an external keyboard, a touch pad or a mouse and the like.
It will be appreciated by those skilled in the art that the configurations shown in fig. 9 and 10 are block diagrams of only some of the configurations relevant to the present application, and do not constitute a limitation on the computing devices to which the present application may be applied, and that a particular computing device may include more or fewer components than shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer device is further provided, which includes a memory and a processor, the memory stores a computer program, and the processor implements the steps of the above method embodiments when executing the computer program.
In an embodiment, a computer-readable storage medium is provided, in which a computer program is stored which, when being executed by a processor, carries out the steps of the above-mentioned method embodiments.
In one embodiment, a computer program product or computer program is provided that includes computer instructions stored in a computer-readable storage medium. The computer instructions are read by a processor of a computer device from a computer-readable storage medium, and the computer instructions are executed by the processor to cause the computer device to perform the steps in the above-mentioned method embodiments.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database or other medium used in the embodiments provided herein can include at least one of non-volatile and volatile memory. Non-volatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical storage, or the like. Volatile Memory can include Random Access Memory (RAM) or external cache Memory. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM), for example.
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, and these are all within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (15)

1. A method for downloading a file, the method comprising:
acquiring a file downloading request, wherein the file downloading request carries a target application identifier of a target application and a file identifier to be downloaded;
acquiring a candidate node information set corresponding to the file identifier to be downloaded;
acquiring a node communication information set of each candidate node corresponding to the candidate node information set, wherein the node communication information set comprises node communication information of at least two dimensions, and the node communication information of at least two dimensions is obtained by communicating with the corresponding candidate node;
fusing node communication information in the same node communication information set based on target attention information corresponding to the target application identifier to obtain target downloading priority parameters corresponding to each candidate node;
and determining a target node from each candidate node based on the target downloading priority parameter, and acquiring a target file corresponding to the file identifier to be downloaded from the target node.
2. The method of claim 1, wherein the method is performed by a unified processing module, and wherein obtaining the file download request comprises:
the unified processing module receives the file downloading request sent by the target application through a preset interface;
after the target file corresponding to the file identifier to be downloaded is obtained from the target node, the method further includes:
and the unified processing module sends the target file to the target application through the preset interface.
3. The method according to claim 1, wherein said obtaining a candidate node information set corresponding to the identifier of the file to be downloaded includes:
generating a node query request based on the current position information and the file identifier to be downloaded;
sending the node query request to a query server so that the query server acquires an initial node information set, screening the initial node information set based on the current position information to obtain a candidate node information set, wherein the target file is stored in an initial node corresponding to the initial node information set;
and receiving the candidate node information set returned by the query server.
4. The method according to claim 1, wherein the obtaining the node communication information set of each candidate node corresponding to the candidate node information set comprises:
and when the candidate node is a node which has historically established communication connection, acquiring a corresponding historical communication information set as a corresponding node communication information set according to the node identification in the candidate node information set.
5. The method according to claim 1, wherein the obtaining the node communication information set of each candidate node corresponding to the candidate node information set comprises:
respectively sending heartbeat requests to each candidate node, and receiving response messages returned by each candidate node based on the heartbeat requests, wherein the heartbeat requests are used for establishing communication with the corresponding candidate node and requesting the candidate node to return historical data packet sending quantity, the response messages comprise the historical data packet sending quantity, and the historical data packet sending quantity refers to the quantity of data packets sent by the corresponding candidate node;
obtaining node communication information of a first dimension corresponding to each candidate node based on heartbeat requests and response messages corresponding to the same candidate node;
acquiring historical data packet receiving quantity corresponding to each candidate node, wherein the historical data packet receiving quantity refers to the quantity of data packets received from the corresponding candidate node;
obtaining second-dimension node communication information corresponding to each candidate node based on the historical data packet sending amount and the historical data packet receiving amount corresponding to the same candidate node;
and generating a corresponding node communication information set based on the node communication information of the first dimension and the node communication information of the second dimension corresponding to the same candidate node to obtain the node communication information set corresponding to each candidate node.
6. The method according to claim 5, wherein obtaining the second-dimension node communication information corresponding to each candidate node based on the historical data packet transmission amount and the historical data packet reception amount corresponding to the same candidate node comprises:
adjusting the sending quantity of the historical data packets corresponding to the current candidate node based on a first preset adjusting value to obtain the receiving quantity of the target data packets;
adjusting the historical data packet receiving amount corresponding to the current candidate node based on a second preset adjusting value to obtain the target data packet sending amount, wherein the first preset adjusting value is smaller than the second preset adjusting value, and the second preset adjusting value is a positive number;
obtaining a packet loss rate corresponding to the current candidate node based on the target packet receiving amount and the target packet transmitting amount;
and obtaining node communication information of a second dimension corresponding to the current candidate node based on the packet loss rate.
7. The method according to claim 1, wherein the fusing node communication information in the same node communication information set based on the target attention information corresponding to the target application identifier to obtain a target download priority parameter corresponding to each candidate node comprises:
normalizing the node communication information of each dimensionality in the same node communication information set to obtain node communication scores corresponding to each candidate node in each dimensionality;
fusing the communication scores of all nodes corresponding to the same candidate node based on the target attention information to obtain the target communication score corresponding to each candidate node;
and obtaining target downloading priority parameters corresponding to the candidate nodes based on the target communication scores corresponding to the candidate nodes.
8. The method according to claim 7, wherein the normalizing the node communication information of each dimension in the same node communication information set to obtain the node communication score corresponding to each candidate node in each dimension comprises:
acquiring incidence relation information corresponding to each dimension, wherein the incidence relation information represents the incidence relation between node communication information and node communication scores, the incidence relation information comprises a plurality of sequentially arranged intervals corresponding to the node communication information of the same dimension, each interval is provided with corresponding communication score reference information, and the communication score reference information is in a monotonous change trend according to the arrangement sequence of the intervals;
acquiring current node communication information corresponding to a current dimension of a current candidate node, and acquiring an interval range corresponding to each interval from incidence relation information corresponding to the current dimension;
decomposing the current node communication information according to the interval range corresponding to each interval to obtain current communication sub-information corresponding to each interval;
and obtaining the node communication score corresponding to the current candidate node in the current dimension based on the current communication sub-information and the communication score reference information corresponding to the same interval.
9. The method of claim 1, further comprising:
obtaining key dimensions respectively corresponding to a plurality of candidate applications;
generating attention information corresponding to a current candidate application based on a key dimension corresponding to the current candidate application, wherein in the attention information corresponding to the current candidate application, the attention degree corresponding to the key dimension is higher than the attention degree corresponding to other dimensions;
and associating the attention information and the application identification corresponding to the same candidate application.
10. The method of claim 1, wherein determining a target node from the candidate nodes based on the target download priority parameter comprises:
determining a target downloading priority corresponding to each candidate node based on the target downloading priority parameter;
and taking the candidate node with the highest target downloading priority as the target node.
11. The method according to any one of claims 1 to 10, wherein the obtaining of the target file corresponding to the identifier of the file to be downloaded from the target node comprises:
downloading a first sub-segment corresponding to the target file from the target node, wherein the first sub-segment is a first-ordered sub-segment in a sub-segment sequence obtained by segmenting the target file;
updating a node communication information set corresponding to each candidate node based on current communication information generated by current communication with each candidate node in the downloading process of the current sub-segment;
fusing node communication information in an updated node communication information set corresponding to the same candidate node based on the target attention information to obtain an updated downloading priority parameter corresponding to each candidate node;
and determining an updating node corresponding to the next sub-segment of the current sub-segment from the candidate nodes based on the updating downloading priority parameter, acquiring the next sub-segment from the updating node, taking the next sub-segment as a new current sub-segment, and returning to the step of updating the node communication information set corresponding to each candidate node based on the current communication information generated by the current communication with each candidate node in the downloading process of the current sub-segment until the sub-segments in the sub-segment sequence are downloaded completely.
12. The method according to any one of claims 1 to 10, wherein the determining a target node from the candidate nodes based on the target download priority parameter, and acquiring a target file corresponding to the identifier of the file to be downloaded from the target node comprises:
segmenting the target file to obtain a plurality of sub-segments corresponding to the target file;
determining target nodes respectively corresponding to the sub-segments from the candidate nodes based on the target downloading priority parameters;
and acquiring corresponding sub-segments from each target node in parallel.
13. A file download apparatus, characterized in that the apparatus comprises:
the request acquisition module is used for acquiring a file downloading request, and the file downloading request carries a target application identifier of a target application and a file identifier to be downloaded;
the node information acquisition module is used for acquiring a candidate node information set corresponding to the file identifier to be downloaded;
a communication information acquisition module, configured to acquire a node communication information set of each candidate node corresponding to the candidate node information set, where the node communication information set includes node communication information of at least two dimensions, and the node communication information of the at least two dimensions is obtained by communicating with the corresponding candidate node;
a download priority parameter determination module, configured to fuse node communication information in the same node communication information set based on target attention information corresponding to the target application identifier, to obtain a target download priority parameter corresponding to each candidate node;
and the file downloading module is used for determining a target node from all candidate nodes based on the target downloading priority parameter and acquiring a target file corresponding to the file identifier to be downloaded from the target node.
14. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor, when executing the computer program, implements the steps of the method of any of claims 1 to 12.
15. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 12.
CN202110527898.8A 2021-05-14 2021-05-14 File downloading method and device, computer equipment and storage medium Pending CN115344534A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110527898.8A CN115344534A (en) 2021-05-14 2021-05-14 File downloading method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110527898.8A CN115344534A (en) 2021-05-14 2021-05-14 File downloading method and device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115344534A true CN115344534A (en) 2022-11-15

Family

ID=83946800

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110527898.8A Pending CN115344534A (en) 2021-05-14 2021-05-14 File downloading method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115344534A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115766681A (en) * 2022-11-28 2023-03-07 迈普通信技术股份有限公司 Program downloading method, device, medium and equipment

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115766681A (en) * 2022-11-28 2023-03-07 迈普通信技术股份有限公司 Program downloading method, device, medium and equipment

Similar Documents

Publication Publication Date Title
US11818049B2 (en) Processing high volume network data
CN108920272B (en) Data processing method, device, computer equipment and storage medium
US10374955B2 (en) Managing network computing components utilizing request routing
EP3751815B1 (en) Multi-source deterministic oracle management
US8510448B2 (en) Service provider registration by a content broker
WO2018133306A1 (en) Dispatching method and device in content delivery network
US9426142B2 (en) Systems and methods for logging into an application on a second domain from a first domain in a multi-tenant database system environment
US7844707B2 (en) Web service multi-key rate limiting method and system
US20160219089A1 (en) Systems and methods for messaging and processing high volume data over networks
WO2016115734A1 (en) Processing high volume network data
CN107786621B (en) User information management method, access processing method, device and system
CN106375471B (en) Edge node determination method and device
CN110599142B (en) Data storage method, device, computer equipment and storage medium
CN114513488B (en) Resource access method, device, computer equipment and storage medium
CN115344534A (en) File downloading method and device, computer equipment and storage medium
CN114731293B (en) Preventing data manipulation and protecting user privacy when determining accurate location event measurements
CN115348251A (en) File downloading method and device, computer equipment and storage medium
CN114386037A (en) Malicious request defense method based on Web front-end page and related equipment
CN109639831B (en) Method and device for distributing transmission resources matched with network service
US20170223136A1 (en) Any Web Page Reporting and Capture
CN117633112A (en) System event processing method, device and storage medium
CN116806038A (en) Decentralizing computer data sharing method and device
CN111294231B (en) Resource management method and system
CN110995890B (en) Domain name request scheduling method and device
CN114666841A (en) Flow-free method and flow-free system for directional flow

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 40075671

Country of ref document: HK

SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination