CN111435946A - Method, device, terminal equipment and system for downloading resources - Google Patents

Method, device, terminal equipment and system for downloading resources Download PDF

Info

Publication number
CN111435946A
CN111435946A CN201910036747.5A CN201910036747A CN111435946A CN 111435946 A CN111435946 A CN 111435946A CN 201910036747 A CN201910036747 A CN 201910036747A CN 111435946 A CN111435946 A CN 111435946A
Authority
CN
China
Prior art keywords
node
resource
nodes
task
terminal device
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
CN201910036747.5A
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.)
Alibaba Group Holding Ltd
Original Assignee
Alibaba Group Holding 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 Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN201910036747.5A priority Critical patent/CN111435946A/en
Publication of CN111435946A publication Critical patent/CN111435946A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/104Peer-to-peer [P2P] networks
    • H04L67/1074Peer-to-peer [P2P] networks for supporting data block transmission mechanisms
    • 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/10Protocols in which an application is distributed across nodes in the network
    • H04L67/104Peer-to-peer [P2P] networks
    • H04L67/1074Peer-to-peer [P2P] networks for supporting data block transmission mechanisms
    • H04L67/1078Resource delivery mechanisms

Landscapes

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

Abstract

The invention discloses a method, a device, terminal equipment and a system for downloading resources, wherein the method comprises the following steps: acquiring a node list to be confirmed; screening out available nodes from the node list, and distributing a task of downloading the resources; wherein the available nodes include nodes marked as having the resource.

Description

Method, device, terminal equipment and system for downloading resources
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a method for downloading a resource, an apparatus for downloading a resource, a terminal device, a resource distribution system, and a computer-readable storage medium.
Background
A Peer-to-Peer computer network (Peer-to-Peer, P2P) is a distributed application network that distributes tasks among terminal devices, each terminal device in the P2P network may be referred to as a node, and in the P2P network, resources may be uploaded and downloaded from node to node.
In the existing resource downloading mode, a downloading node needing to download resources requests a server to obtain a node list, the downloading node allocates a task to each node in the node list in sequence, if the node has data of the resources, the data is returned to the downloading node, if the node does not have the data of the resources, information of response failure is returned to the downloading node, the downloading node reallocates the task to other nodes in the node list, in the downloading mode, a large number of nodes need to be screened to find out nodes capable of executing corresponding tasks, each task is exclusive and cannot be allocated to a plurality of nodes at the same time, if the response time of the node allocated with the downloading task is too long, a data hole phenomenon occurs, and further the downloading speed is slow, which directly affects the user viewing experience due to the fact that a playing card is stopped for downloading video resources, therefore, it is desirable to provide a method for downloading resources that can improve the downloading speed.
Disclosure of Invention
An object of the embodiments of the present invention is to provide a new technical solution for downloading resources.
According to a first aspect of the present invention, there is provided a method of downloading a resource, comprising:
acquiring a node list to be confirmed;
screening out available nodes from the node list, and distributing a task of downloading the resources;
wherein the available nodes include nodes marked as having the resource.
Optionally, the method further comprises:
detecting whether a node in the node list has the resource;
acquiring a detection result returned by the detected node;
and marking the detected node as the available node when the detection result indicates that the detection is successful.
Optionally, the method further comprises:
and setting a time window for forbidding the detection for the detected node when the detection result indicates that the detection fails.
Optionally, the step of detecting whether a node in the node list has the resource includes:
and sending a detection request to the nodes in the node list, wherein the detection request carries the resource identifier of the resource and the expected download point.
Optionally, the method further comprises:
under the condition that the detection result shows detection failure, acquiring the accumulated times of continuous detection failure of the detected node;
and deleting the detected node in the node list under the condition that the accumulated times exceed the set times.
Optionally, the step of screening out available nodes from the node list and allocating a task of downloading the resource includes:
responding to a set trigger event, and detecting whether the task is completed;
and under the condition of incompletion, distributing the task of downloading the resource for the available node.
Optionally, the triggering event includes any one or both of a new available node appearing in the node list and a node to which the task has been assigned completing the assigned task.
Optionally, the method further comprises:
responding to the inquiry of whether the resource exists or not initiated by other nodes of the network, and comparing the local current download point of the resource with the expected download point of the other nodes for the resource;
in the event that the desired download point leads the current download point, adding the other node to the node list and marking the other node as the available node.
Optionally, the method further comprises:
returning probe results representing the resources to the other nodes if the current download point leads the desired download point;
in the event that the desired download point leads the current download point, returning a probe result to the other node indicating that the resource is not present.
Optionally, the step of obtaining the list of nodes to be confirmed includes:
and responding to the task trigger of downloading the resource, and acquiring a node list to be confirmed from a server.
Optionally, the task is a peer-to-peer task based on a P2P network.
Optionally, the resource is a live video resource; the task of allocating the download of the resource comprises:
dividing the current fragment of the video live broadcast resource into a plurality of task blocks;
and allocating the task for downloading the resources by taking the task block as a unit.
Optionally, the method further comprises:
after the current fragment of the video live broadcast resource is obtained, traversing nodes in the node list, and screening out nodes meeting detection conditions;
detecting whether the nodes meeting the detection condition have the current fragments or not;
acquiring a detection result returned by the detected node;
and marking the detected node as the available node when the detection result indicates that the detection is successful.
Optionally, the method further comprises:
after the current fragment of the video live broadcast resource is obtained, resetting available nodes in the node list to be nodes with unknown states, then executing the step of traversing the nodes in the node list and screening out the nodes meeting detection conditions; and the nodes meeting the detection conditions are nodes of which the states are unknown and which are not in the time window of prohibiting detection.
According to the second aspect of the present invention, there is also provided an apparatus for downloading a resource, including:
the node list acquisition module is used for acquiring a node list to be confirmed;
the task allocation module is used for screening out available nodes from the node list and allocating tasks for downloading the resources;
wherein the available nodes include nodes marked as having the resource.
According to the third aspect of the present invention, there is also provided a terminal device, which includes the apparatus for downloading resources in the second aspect of the present invention; or, a memory for storing executable instructions and a processor; the processor is adapted to perform the method of downloading resources according to the first aspect of the invention under control of the instructions.
According to a fourth aspect of the present invention, there is further provided a resource distribution system, including a server and a plurality of terminal devices according to the third aspect of the present invention, where the plurality of terminal devices form a resource distribution network, and each terminal device is a node on the resource distribution network; and each terminal device responds to the own downloading task to acquire a node list from the server, wherein each node in the node list is a node on the resource distribution network.
According to a fifth aspect of the present invention, there is also provided a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the method of downloading a resource according to any one of the first aspects of the present invention.
The method, the device, the terminal equipment and the system have the advantages that after the node list to be confirmed is obtained, the available nodes are screened out from the node list, and the task of downloading the resources is distributed within the range of the available nodes. For the method of the embodiment of the application, the available nodes screened from the node list include the nodes marked as having the resources, that is, the available nodes are the nodes marked as having the resources with high probability, so that the downloading task is distributed in the range of the available nodes, the success rate of distributing the downloading task is greatly improved, the task is prevented from being preempted by the nodes without the resources, the data holes are reduced, and the downloading speed is improved.
Other features of the present invention and advantages thereof will become apparent from the following detailed description of exemplary embodiments thereof, which proceeds with reference to the accompanying drawings.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description, serve to explain the principles of the invention.
FIG. 1 is a schematic block diagram showing a hardware configuration of a resource distribution system that can be used to implement an embodiment of the invention;
fig. 2 is a schematic diagram of a hardware structure of a terminal device according to an embodiment of the present invention;
FIG. 3 is a flowchart illustrating a method for downloading resources according to an embodiment of the present invention;
FIG. 4 is a flow diagram of a method of downloading a resource according to another embodiment of the present invention;
FIG. 5 is a flow chart of a method of downloading a resource according to a third embodiment of the present invention;
FIG. 6 is a flow chart of a method of downloading a resource according to a fourth embodiment of the present invention;
FIG. 7 is a flow diagram of a method of downloading a resource according to one example of the invention;
fig. 8 is a functional block diagram of an apparatus for downloading a resource according to an embodiment of the present invention.
Fig. 9 is a schematic diagram of a hardware configuration of a terminal device according to an embodiment of the present invention;
fig. 10 is a schematic diagram of a hardware configuration of a terminal device according to another embodiment of the present invention.
Detailed Description
Various exemplary embodiments of the present invention will now be described in detail with reference to the accompanying drawings. It should be noted that: the relative arrangement of the components and steps, the numerical expressions and numerical values set forth in these embodiments do not limit the scope of the present invention unless specifically stated otherwise.
The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the invention, its application, or uses.
Techniques, methods, and apparatus known to those of ordinary skill in the relevant art may not be discussed in detail but are intended to be part of the specification where appropriate.
In all examples shown and discussed herein, any particular value should be construed as merely illustrative, and not limiting. Thus, other examples of the exemplary embodiments may have different values.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, further discussion thereof is not required in subsequent figures.
< hardware configuration >
Fig. 1 is a schematic structural diagram of a resource distribution system 100 according to an embodiment of the present invention.
According to fig. 1, the resource distribution system 100 of the present embodiment includes a server 1000 and a plurality of terminal devices 2000, and fig. 1 shows 4 terminal devices 2000, which are a terminal device 2000A, a terminal device 2000B, a terminal device 2000C, and a terminal device 2000D, respectively.
In this embodiment, the terminal devices 2000 form a resource distribution network, each terminal device 2000 is a node in the resource distribution network, and each terminal device 2000 can obtain a node list from the server 1000 in response to its own download task, where each node in the node list is a node on the resource distribution network.
In this embodiment, the number of the terminal devices 2000 of the resource distribution system 100 may be determined according to an actual scene, and is not limited herein.
The server 1000 provides a service point for processes, databases, and communications facilities. The server 1000 may be a unitary server or a distributed server across multiple computers or computer data centers. The server may be of various types, such as, but not limited to, a web server, a news server, a mail server, a message server, an advertisement server, a file server, an application server, an interaction server, a database server, or a proxy server. In some embodiments, each server may include hardware, software, or embedded logic components or a combination of two or more such components for performing the appropriate functions supported or implemented by the server. For example, a server, such as a blade server, a cloud server, etc., or may be a server group consisting of a plurality of servers, which may include one or more of the above types of servers, etc.
In one embodiment, the server 1000 may be as shown in fig. 1, including a processor 1100, a memory 1200, an interface device 1300, a communication device 1400, a display device 1500, an input device 1600.
In this embodiment, the server 1000 may further include a speaker, a microphone, and the like, which are not limited herein.
The processor 1100 may be a dedicated server processor, or may be a desktop processor, a mobile processor, etc. that meets performance requirements, without limitation, the memory 1200 may include, for example, ROM (read only memory), RAM (random access memory), a non-volatile memory such as a hard disk, etc., the interface device 1300 may include, for example, various bus interfaces such as a serial bus interface (including a USB interface), a parallel bus interface, etc., the communication device 1400 may enable wired or wireless communication, the display device 1500 may be, for example, a liquid crystal display, L ED display touch screen, etc., the input device 1600 may include, for example, a touch screen, a keyboard, etc.
Although a plurality of devices of the server 1000 are illustrated in fig. 1, the present invention may only relate to some of the devices, for example, the server 1000 only relates to the memory 1200, the communication device 1400 and the processor 1100.
The terminal device 2000 may be any electronic device having a function of connecting the server 1000 and other terminal devices 2000 via the network 3000, such as a mobile phone, a PC, a laptop, a tablet computer, a palmtop computer, a wearable device, and the like, which is not limited herein.
In one embodiment, the terminal device 2000 may be as shown in fig. 2, including a processor 2100, a memory 2200, an interface device 2300, a communication device 2400, a display device 2500, an input device 2600, a speaker 2700, a microphone 2800, and the like.
The processor 2100 may be a central processing unit CPU, a microprocessor MCU, or the like. The memory 2200 includes, for example, a ROM (read only memory), a RAM (random access memory), a nonvolatile memory such as a hard disk, and the like. The interface device 2300 includes, for example, a USB interface, a headphone interface, and the like. The communication device 2400 is capable of wired or wireless communication, and the display device 2500 is, for example, a liquid crystal display, a touch panel, or the like. The input device 2600 may include, for example, a touch screen, a keyboard, a somatosensory input, and the like. A user can input/output voice information through the speaker 2700 and the microphone 2800.
Although a plurality of apparatuses of the terminal device 2000 are illustrated in fig. 2, the present invention may only relate to some of the apparatuses, for example, the terminal device 2000 only relates to the communication apparatus 2400, the memory 2200, and the processor 2100.
In this embodiment, the memory 2200 of the terminal device 2000 is configured to store instructions for controlling the processor 2100 to operate at least to perform a method of downloading resources according to any of the embodiments of the present invention. The skilled person can design the instructions according to the disclosed solution. How the instructions control the operation of the processor is well known in the art and will not be described in detail herein.
The communication network 3000 may be a wireless communication network or a wired communication network, and may be a local area network or a wide area network. In the resource distribution system 100 shown in fig. 1, the server 1000 and the plurality of terminal apparatuses 2000, and the plurality of terminal apparatuses 2000 can communicate with each other through the network 3000. The server 1000 may be the same as or different from the plurality of terminal devices 2000 and the network 3000 on which the plurality of terminal devices 2000 communicate with each other.
< method examples >
Fig. 3 is a flowchart illustrating a method for downloading a resource according to an embodiment of the present invention, where the method is implemented by any terminal device 2000 in the resource distribution system 100, and the method for downloading a resource according to the embodiment may include the following steps:
in step S3100, any of the terminal devices 2000 acquires a node list to be confirmed.
The node list at least includes other terminal devices 2000 forming the resource distribution network with the terminal device 2000, where each terminal device 2000 is a node on the resource distribution network. For example, referring to fig. 1, the terminal device 2000A is a main body for executing the method for downloading the resource according to the present embodiment, that is, any terminal device 2000 in step S3100 is the terminal device 2000A, and here, the terminal device 2000B, the terminal device 2000C, and the terminal device 2000D may all be nodes in the node list.
In an example, the acquiring, by the terminal device 2000, the node list to be confirmed in step S3100 may further include: terminal device 2000 acquires the list of nodes to be confirmed from server 1000 in response to a task trigger to download resources.
In this example, for example, the user may perform a task triggering operation of downloading the resource in the terminal device 2000, and the terminal device 2000 acquires the node list to be confirmed from the server 1000 in response to the task triggering operation of downloading the resource performed by the user. The task triggering operation for downloading the resource performed by the user may be, for example, a user performing a click operation on an application interface of the terminal device 2000 to click a link or an icon corresponding to the resource.
The task trigger for downloading the resource at least carries resource information, where the resource information may include, for example, a resource identifier of the resource and an expected download point of the resource, where the resource identifier is used to distinguish different resources, and the expected download point may be a current starting download point.
In step S3200, the terminal device 2000 screens out available nodes in the node list and allocates a task of downloading resources.
In this embodiment, the available nodes include nodes marked as having the resource.
In this embodiment, the available node is a node marked as "available" by the terminal device 2000 because of the high probability of having the resource. For example, the terminal device 2000 may determine whether to mark the corresponding node in the node list as an available node according to the user flag, the detection result of the node in the node list, the detection result detected by another node, and the like.
In this embodiment, the terminal device may detect a marking event of a node in the corresponding node list after acquiring the node list to be confirmed, and mark the corresponding node as an available node when detecting the marking event. For example, the marker event includes at least one of: receiving a marking operation input by a user for a certain node in the node list; the detection result of actively detecting a certain node in the node list is that the resource is available; and the detection result detected by a certain node in the node list is that the resource is not available.
In this embodiment, the terminal device 2000 may mark the available node in any mark form, for example, a symbol may be added before or after the name of the node to indicate that the node is an available node, and the symbol is, for example and without limitation, an "x" sign or a "#" sign, as long as the node can distinguish the available node from a node whose state is unknown according to an appointment, which is not limited herein.
In this embodiment, for an available node to which a task of downloading a resource is allocated, the task of downloading the resource may also be understood as a task of sharing the resource to be downloaded.
In this embodiment, the resource distribution network may be a P2P network, and the task may be a peer-to-peer task based on a P2P network, where a peer-to-peer task is referred to as a P2P task.
In this embodiment, in step S3200, the terminal device 2000 screens out an available node in the node list, and the step of allocating the task of downloading the resource may further include:
in step S3210, the terminal device 2000 detects whether the task is completed in response to the set trigger event.
In step S3210, the terminal device 2000 may set at least one trigger event, where the at least one trigger event may include any one or both of a new available node appearing in the node list and a node to which a task has been assigned completing an assigned task.
In step S3210, when the terminal device 2000 successfully receives the corresponding resource data returned by the node to which the task has been allocated, it may confirm that the node to which the task has been allocated completes the task.
According to the step S3210, when any trigger event occurs, the terminal device 2000 may detect whether the task is completed in response to the trigger event.
Referring to fig. 1, still taking the terminal device 2000A as the main body for executing the method for downloading resources in this embodiment, the terminal device 2000B, the terminal device 2000C, and the terminal device 2000D may all be taken as nodes in a node list, and may be configured to locally establish a plurality of P2P tasks of downloading resources, for example, include 4P 2P tasks, where the screened available nodes may include the terminal device 2000B and the terminal device 2000C, at this time, the P2P tasks of any two downloading resources may be respectively allocated to the terminal device 2000B and the terminal device 2000C, and when at least one of the terminal device 2000B and the terminal device 2000C completes the P2P task of the allocated downloading resources, whether the tasks are completed or not is detected; it may be that when a new available node appears in the node list, for example, when the terminal device 2000D becomes a new available node, it detects whether the task is completed.
In step S3220, the terminal device 2000 allocates a task of downloading the resource to the available node in the event of incompletion.
For example, when it is obtained in step S3210 that a new available node appears in the node list as the terminal device 2000D, it may be detected whether the task is completed, and when it is detected that the task is not completed, one of the P2P tasks of the remaining 2 download resources may be arbitrarily selected and allocated to the terminal device 2000D in step S3220.
For another example, when the terminal device 2000B that has acquired the P2P task of allocating the download resource in step S3210 has completed the P2P task of the allocated download resource, it may detect whether the task has completed, and when it is detected that the task has not completed, in step S3220, one of the P2P tasks of the remaining 2 download resources may be arbitrarily selected and allocated to the terminal device 2000B.
In this example, when a new available node appears in the node list or a node to which a task has been allocated completes an allocated task, it is detected whether the task is completed, and when the task is not completed, the task for downloading resources is allocated to the available node, so as to ensure that the current uncompleted task can be allocated as soon as possible, and improve the rate of downloading resources.
According to the method provided by the embodiment of the invention, after the node list to be confirmed is obtained, the available nodes are screened out from the node list, and the task of downloading the resource is distributed in the range of the available nodes.
In an embodiment, as shown in fig. 4, the method for downloading resources of the present invention may further include the following steps:
in step S4100, the terminal device 2000 detects whether or not a node in the node list has a resource.
In this embodiment, before sending the task of downloading the resource to the node in the node list, the terminal device 2000 will first detect whether the node has the resource, and decide whether to allocate the task of downloading the resource to the node according to a detection result returned by the detected node.
In this embodiment, the step S4100 of the terminal device 2000 detecting whether the node in the node list has resources may further include: terminal device 2000 sends a probe request to a node in the node list.
The probe request carries a resource identifier of the resource and an expected download point, wherein the resource identifier is used for distinguishing different resources, and the expected download point can be a current starting download point.
Still taking the terminal device 2000A as the main body for executing the method for downloading resources in this embodiment, the terminal device 2000B, the terminal device 2000C, and the terminal device 2000D may all be taken as nodes in the node list as an example, and the terminal device 2000A may sequentially send probe requests to the terminal device 2000B, the terminal device 2000C, and the terminal device 2000D in the node list at different times; it may be that terminal device 2000A simultaneously transmits probe requests to terminal device 2000B, terminal device 2000C, and terminal device 2000D in the node list.
In step S4200, the terminal device 2000 obtains the probe result returned by the probed node.
For example, continuing with the example of step S4100, after sending the probe request to the terminal device 2000B in the node list according to step S4100, the terminal device 2000B may search whether the resource exists locally according to the resource identifier carried in the probe request, further obtain a current download point locally corresponding to the resource when the resource is found locally, compare the current download point with the expected download point, and return a probe result indicating that the resource exists to the terminal device 2000A when the current download point is ahead of the expected download point, that is, the probe result returned by the terminal device 2000B indicates that the probe is successful.
For another example, continuing with the example of step S4100, after sending the probe request to the terminal device 2000C in the node list according to step S4100, the terminal device 2000C may search whether the resource exists locally according to the resource identifier carried in the probe request, further obtain a current download point locally corresponding to the resource when the resource is found locally, compare the current download point with the expected download point, and return a probe result indicating that the resource does not exist to the terminal device 2000A when the expected download point is ahead of the current download point, that is, the probe result returned by the terminal device 2000C indicates that the probe failure.
In step S4300, the terminal device 2000 marks the detected node as an available node when the detection result indicates that the detection is successful.
Continuing with the example of step S4200 described above, when terminal device 2000A obtains the probe result indicating that there is a resource returned by terminal device 2000B according to step S4200, terminal device 2000A marks terminal device 2000B as an available node according to step S4300.
According to the method of this embodiment, before allocating a download task, the terminal device 2000 may actively detect whether a node in the node list has a resource to be downloaded, so as to mark the detected node as an available node according to a detection result of successful detection.
In an embodiment, as shown in fig. 4, the method for downloading resources of the present invention may further include the following steps:
in step S4400, the terminal device 2000 sets a time window for prohibiting probing for the probed node when the probing result indicates that probing fails.
In the present embodiment, in the case where the probing-prohibited time window is set for the probed node, the terminal device 2000 will not actively probe the node again according to the above step S4100 within the probing-prohibited time window.
In one example, the time window for prohibiting probing may be a preset fixed value, and in this example, the fixed value may be set for all probed nodes that failed probing.
The fixed numerical value can be set according to the number of nodes in the node list, and the larger the number of nodes is, the larger the time window for prohibiting detection can be, and the smaller the number of nodes is, the smaller the time window for prohibiting detection can be.
In one example, for a video live resource, the time window for prohibiting probing may be set to be during a set number of slicing (TS) tasks, for example, the time window for prohibiting probing may be set to be during three TS tasks, i.e., the node is masked during three TS tasks, and no active probing is performed.
In an example, the terminal device 2000 may also set a respective corresponding probing prohibiting time window for each probed node that fails to probe, and the probing prohibiting time windows of the probed nodes that fail to probe may be the same or different.
In an example, the terminal device 2000 may obtain a current download point of the detected node carried in the detection result, compare the current download point with an expected download point, and set a time window for prohibiting detection of the detected node corresponding to the detection failure according to the comparison result. For example, the farther the distance between the current download point and the desired download point, the larger the time window for prohibiting detection may be, and the closer the distance between the current download point and the desired download point, the smaller the time window for prohibiting detection may be.
According to the method of the embodiment, the time window for prohibiting detection is set for the detected node with detection failure, so that the node is not detected any more in the time window for prohibiting detection, thereby not only avoiding frequent retries, but also adapting to dynamic changes of download points in different network environments.
In an embodiment, as shown in fig. 4, the method for downloading resources of the present invention may further include the following steps:
in step S4500, the terminal device 2000 acquires the accumulated number of times of continuous probing failures of the probed node when the probing result indicates a probing failure.
According to this step S4500, if the detected node is successfully detected once, the accumulated number of times is cleared, and counting is restarted, even if consecutive detection fails, that is, consecutive detection fails.
Continuing with the example of step S4200, the terminal device 2000C obtained according to step S4200 returns a probe result indicating that there is no resource to the terminal device 2000A, that is, the probe result of the terminal device 2000A for the terminal device 2000C indicates a probe failure, according to step S4500, the terminal device 2000A obtains the accumulated number of consecutive probe failures of the terminal device 2000C by itself, for example, the accumulated number of consecutive probe failures of the terminal device 2000C obtained by the terminal device 2000A according to step S4500 is 4.
In step S4600, the terminal apparatus 2000 deletes the probed node in the node list when the cumulative count exceeds the set count.
The set number may be a parameter set according to network performance, for example, the set number may be 3, or the set number may be other values, which is not limited herein.
Continuing with the example of step S4500, terminal device 2000A obtains, according to step S4500, that the cumulative number of times that terminal device 2000C has failed to be continuously detected is 4 times, compares, according to step S4500, the cumulative number (4 times) with the set number (3 times), and if it is known that the cumulative number is greater than the set number, terminal device 2000C is deleted from the node list.
According to the method of the embodiment, when the detection of the detected node fails, the cumulative number of times that the detected node fails to be continuously detected is compared with the set number of times, so that the detected node is deleted from the node list when the cumulative number of times exceeds the set number of times, thereby filtering out the nodes which are basically impossible to have the required resources in the node list, avoiding the detection of the nodes again, and further improving the efficiency of acquiring the available nodes in the node list.
In an embodiment, as shown in fig. 5, the method for downloading resources of the present invention may further include the following steps:
in step S5100, the terminal device 2000 compares the current download point of the resource with the expected download point of the resource by the other node in response to the query initiated by the other node in the network where the resource exists, and determines whether the query has the probe of the resource.
Other nodes of the network may be included in the node list, or may not be included in the node list, which is not limited herein.
The query initiated by the other node of the network where the terminal device 2000 has the resource may be performed by sending a probe request, which may also be understood as that the other node of the network where the terminal device 2000 has the resource by sending a probe request, where the probe request may carry a resource flag of the resource and an expected download point of the resource by the other node, where the resource flag is used to distinguish different resources, and the expected download point is an expected current starting download point of the resource.
Still taking the terminal device 2000A as an example of the main body for executing the method for downloading the resource in this embodiment, the terminal device 2000E (not shown in fig. 1) sends a probe request to the terminal device 2000A, where the probe request carries a resource flag of the resource required by the terminal device 2000E and an expected download point of the required resource, and when the terminal device 2000A finds that the resource flag locally exists, the terminal device 2000A obtains a current download point of the resource locally, and then compares the current download point with the expected download point to obtain a comparison result.
In step S5200, the terminal device 2000 adds another node to the node list and marks the other node as an available node when the desired download point is ahead of the current download point.
In this embodiment, the terminal device 2000 may determine whether other nodes are located in the node list first when the expected download point is ahead of the current download point, add the other nodes to the node list when the other nodes are not located in the node list, and mark the other nodes as available nodes; in the case where the other node is already in the node list, performing this step S5200 is equivalent to directly marking the other node as an available node.
Still taking the terminal device 2000A and the terminal device 2000E in the above step S5100 as an example, if the terminal device 2000A leads the desired download point to the current download point according to the comparison result obtained in the step S5100, the terminal device 2000A may add the terminal device 2000E to the node list according to the step S5200 and mark the terminal device 2000E as an available node, where, if the terminal device 2000E is already located in the node list, executing the step S5200 is equivalent to directly marking the terminal device 2000E as an available node.
According to the method of this embodiment, any terminal device 2000 can respond to the probe request sent by another terminal device 2000 whether or not there is a resource, and in the case that the expected download point of the resource by another terminal device 2000 is ahead of the current download point of the local resource, the terminal device 2000 initiating the probe request, or the node initiating the probe request, is marked as an available node, so that the detected terminal device 2000 can directly allocate the task of downloading the resource to the node initiating the probe request without actively detecting the node initiating the probe request in reverse, thereby improving the screening efficiency of the node and the efficiency of downloading the resource.
In addition, according to the method of this embodiment, when the expected download point of the terminal device 2000 for the resource is ahead of the current download point for the resource locally, the node that initiates the probe request is marked as an available node to implement multiplexing of the node, so that the connection originally used for the unidirectional task request can support the bidirectional task request, and the utilization rate of the connection is improved.
In an embodiment, as shown in fig. 5, the method for downloading resources of the present invention may further include the following steps:
in step S5300, the terminal apparatus 2000 returns a probe result indicating that there is a resource to the other node in a case where the current download point leads the desired download point.
Still taking the terminal device 2000A and the terminal device 2000E in the above step S5100 as an example, according to the comparison result obtained in step S5100, if the current download point is ahead of the expected download point, the terminal device 2000A returns the probe result indicating that there is a resource to the terminal device 2000E according to the step S5300, and at this time, the terminal device 2000E marks the terminal device 2000A as an available node.
In step S5400, the terminal device 2000 returns a probe result indicating that there is no resource to the other node in the case where the desired download point is ahead of the current download point.
Also taking the terminal device 2000A and the terminal device 2000E in the above step S5100 as an example, the comparison result obtained in step S5100 is that the expected download point leads the current download point, and the probe result indicating that there is no resource is returned to the terminal device 2000E in accordance with step S5400.
In an embodiment, the required resource is a live video resource, and as shown in fig. 6, the task of allocating the download resource in step S3200 may further include the following steps:
in step S6100, the terminal device 2000 divides the current segment of the live video resource into a plurality of task blocks.
For example, the live video broadcasting mode based on the HTTP Streaming media transport Protocol (H L S) is H L S live video broadcasting, for example, the live video broadcasting mode based on the Real Time Messaging Protocol (RTMP) is RTMP live video broadcasting, and for example, the live video broadcasting mode based on the Real Time Streaming Protocol (RTSP) is RTSP live video broadcasting.
Taking the example that the live video is live H L S, the live H L S mode is that live H L S resources are stored as continuous media files with short time, one media file can be called as a TS (transport stream) slice, and the terminal device 2000 continuously downloads and plays the continuous TS slice to realize the live video, a node list to be confirmed for downloading the live H L S resources is obtained according to the step S3100, available nodes are screened out from the node list according to the step S3200, the current TS slice of the live H L S resources is divided into a plurality of task blocks according to the step S6100, namely the current TS slice is divided into a plurality of continuous data segments, and each data segment corresponds to one task block.
In one example, the current segment may be divided into a plurality of task blocks according to a set resource block value, where the resource block value indicates the amount of data of each divided task block. For example, the size of the current TS slice is 1024K, the set resource block value may be 64K, and at this time, the current TS slice is correspondingly divided by using 64K as a division point, so as to obtain 16 task blocks.
In step S6200, the terminal device 2000 allocates the task of downloading the resource in units of task blocks.
Still taking the example that the live video broadcast is H L S live broadcast, the current TS slice is divided into a plurality of task blocks through step S6100, and the task of downloading the resource is allocated to the screened available node by taking the task block as a unit according to step S6200, that is, when the task of downloading the resource is allocated, one task block is completely allocated to one available node.
According to the method of the embodiment, after the current fragment of the video live broadcast resource is divided into the plurality of task blocks, the task for downloading the video live broadcast resource is distributed by taking the task blocks as units, so that the efficiency for downloading the video live broadcast resource can be further improved.
In one embodiment, the method for downloading resources of the present invention may further include the following steps:
in step S7100, after obtaining the current segment of the live video resource, the terminal device 2000 traverses the nodes in the node list to screen out the nodes that satisfy the detection condition.
In one example, the detection condition may include: the node is not marked as an available node.
In one example, the detection condition may include: the node is not within the time window in which probing is disabled.
In one example, the detection condition may include: nodes are not marked as available nodes and nodes are not within a time window of forbidden probing.
In step S7200, the terminal device 2000 detects whether a node satisfying the detection condition has a current fragment.
In this embodiment, the terminal device 2000 may send a probe request to a node that meets a probe condition to probe whether the current fragment exists, where the probe request may carry a resource identifier of a resource, a sequence number of the current fragment, and an initial download point (i.e., an expected download point) of the current fragment, and the node that meets the probe condition searches whether the current fragment that locally has the resource exists according to the resource identifier and the sequence number of the current fragment, and returns a probe result that does not have the resource if the current fragment that does not have the resource does not exist; and under the condition of the current fragment with the resource, comparing the positions of the download points according to the expected download point and the local download point, and returning a detection result according to the comparison result.
In step S7300, the terminal device 2000 obtains the probe result returned by the probed node.
In this embodiment, when the node satisfying the detection condition has the current fragment, the returned detection result is detection success, and when the node satisfying the detection condition does not have the current fragment, the returned detection result is detection failure.
In step S7400, the terminal device 2000 marks the detected node as an available node if the detection result indicates that the detection is successful.
According to the method of the embodiment, the nodes meeting the detection condition can be accurately screened out by traversing each node in the node list.
According to the method of the embodiment, each time one node meeting the detection condition is screened out, the thread executing the detection operation can start to detect whether the node meeting the detection condition has the current fragment, and under the condition that the node meeting the detection condition has the current fragment, the node meeting the detection condition is marked as an available node, so that the speed of screening out the available node from the node list is increased, the speed of responding to the downloading task is increased, and the rate of downloading resources is increased.
According to the method of this embodiment, after obtaining the current fragment of the required resource, the terminal device 2000 performs, for the current fragment, the screening of whether the detection condition is satisfied according to step S7100, and the screening is ended after completing one traversal until the next fragment is started, and then restarts the traversal according to step S7100 to reduce the data processing amount.
In one embodiment, the method for downloading resources of the present invention may further include the following steps:
after acquiring the current fragment of the live video resource, the terminal device 2000 resets the available nodes in the node list to nodes with unknown states, and then performs a step of traversing the nodes in the node list to screen out the nodes meeting the detection conditions; and the nodes meeting the detection conditions are nodes of which the states are unknown and which are not in the time window of prohibiting detection.
According to the method of the embodiment, after the current fragment of the video live broadcast resource is obtained, the available nodes in the node list are reset to be the nodes with unknown states, namely the available nodes are removed as the identifiers of the available nodes, then the nodes in the node list are traversed, and the nodes meeting the detection conditions are screened out.
< example >
Fig. 7 shows a method for downloading a resource correspondingly for a main body of a terminal device 2000A, where live video is live H L S, and the method for downloading a resource in this embodiment is executed, where in this example, the method for downloading a resource correspondingly may include the following steps:
in step S8110, the terminal device 2000A responds to the task trigger for downloading the live video resource to acquire the live video resource to be downloaded.
In step S8120, the terminal device 2000A obtains the list of nodes to be confirmed for downloading the live video resource from the server 1000, and divides the current segment of the live video resource into a plurality of task blocks.
The node list may include at least terminal device 2000B, terminal device 2000C, and terminal device 2000D.
In step S8131, the terminal device 2000A sequentially traverses the nodes in the node list.
According to the step S8131, when the current fragmentation is started, the available nodes in the node list are first reset to be nodes with unknown states, that is, the "available" identifiers of the available nodes are removed, and then the nodes in the node list are sequentially traversed according to the step S8131 to determine whether the traversed nodes are unavailable nodes.
In step S8132, the terminal device 2000A determines whether the traversed node is an unavailable node, if so, performs step S8140, otherwise, continues to perform step S8131.
In step S8132, the nodes in the node list may be available nodes or unavailable nodes, and the available nodes are nodes with "available" flags.
In this example, the terminal device 2000A may mark other nodes initiating probing (other nodes have the resource and the expected download points of the other nodes are ahead of the local download point of the terminal device 2000A) directly as available nodes when probed by the other nodes for which step S8140 will not be performed anymore, but instead the traversal of the next node is started according to step S8131.
In step S8140, when the traversed node is an unavailable node, the terminal device 2000A further determines whether the unavailable node is within the corresponding time window for prohibiting detection, if so, then step S8131 is executed, otherwise, step 8150 is executed.
In step S8150, the terminal device 2000A, when the unavailable node is not within the corresponding time window for prohibiting probing, lists the unavailable node in the probing set.
In step S8210, the terminal device 2000A determines whether there is an undetected node in the sounding set, if so, step S8220 is executed, otherwise, step S8210 is continuously executed.
In step S8220, when there is an unexplored node in the probing set, the terminal device 2000A sends a probing request to the probed node in the probing set.
The probe request at least carries a resource mark of the resource, an expected download point and a sequence number of the current fragment.
In step S8230, the terminal device 2000A obtains the probe result returned by the probed node, and determines whether the probe result indicates that the probe is successful, if so, step S8240 is executed, otherwise, step S8250 is executed.
In step S8240, the terminal device 2000A marks the probed node as an available node when the probing result indicates that the probing is successful.
In step S8250, when the probing result indicates a probing failure, the terminal device 2000A compares whether the cumulative number of consecutive probing failures of the probed node exceeds the set number, if so, performs step S8260, otherwise, performs step S8270.
In step S8260, when the cumulative number of times of failure of successive probing of the probed node exceeds the set number of times, the terminal device 2000A deletes the probed node in the node list.
In step S8270, the terminal device 2000A sets a time window for prohibiting probing for the probed node in a case where the accumulated number of times that the probed node failed to be probed continuously does not exceed the set number of times.
In step S8310, the terminal device 2000A allocates the task of downloading the resource to the available node in units of task blocks.
According to this step S8130, as long as there are unoccupied available nodes in the node list, that is, available nodes to which no task is allocated, the terminal device 2000A may allocate the remaining task blocks within the range of these unoccupied available nodes until the task is completed.
In step S8320, the terminal device 2000A determines whether a new available node appears in the node list or whether the node to which the task has been assigned completes the assigned task, if so, step S8330 is executed, and if not, step S8320 is continuously executed.
In step S8330, the terminal device 2000A detects whether the task is completed when a new available node appears in the node list or when the node to which the task has been assigned completes the assigned task, if so, the task is ended, and if not, the step S8310 is continuously executed.
Fig. 7 illustrates the processing flow of detection and task allocation for the current slice, and each new slice will execute detection and task allocation according to the flow illustrated in fig. 7.
FIG. 7 shows three threads, the first thread is to traverse the nodes in the node list to filter out the nodes that satisfy the probing condition and to put the nodes that satisfy the probing condition into the probing set; the second thread initiates active detection to the nodes in the detection set and correspondingly marks the nodes according to the detection result; the third thread is to distribute the download task within the range of available nodes in the node list until the task ends. For example, when a first thread puts a node meeting a detection condition into a detection set, the second thread may be notified to actively detect the node, and after the second thread marks a node as an available node through active detection, the third thread may be notified to detect whether a task has been completed, and if not, a download task may be allocated to the new available node.
The example can effectively improve the speed of responding to the downloading task by the parallel execution of the three threads, which is particularly beneficial for downloading the live video resource.
In addition, the example may further include a fourth thread, where the fourth thread is processing of a probe request sent by the other node when the terminal device 2000A is probed by the other node, for example, when the other node has resources required by the terminal device 2000A and an expected download point of the other node is ahead of its local download point, directly marking the other node as an available node, and returning a probe result of a probe failure to the other node, and the like. The fourth thread can also be processed in parallel with the three threads to reduce the number of nodes meeting the detection condition, thereby further improving the response speed of responding to the downloading task.
< apparatus embodiment >
Fig. 8 is a schematic block diagram of an apparatus 8000 for downloading resources according to an embodiment of the present invention.
As shown in fig. 8, the apparatus 8000 for downloading resources according to this embodiment may include a node list obtaining module 8100 and a task allocating module 8200.
The node list obtaining module 8100 is configured to obtain a node list to be confirmed.
The task allocation module 8200 is used for screening out available nodes in the node list and allocating tasks for downloading resources.
The available nodes include nodes marked as having resources.
In one embodiment, the means for downloading resources 8000 may further include a node probing module (not shown).
The node detection module is used for detecting whether the nodes in the node list have resources; acquiring a detection result returned by the detected node; and in the case that the detection result indicates that the detection is successful, marking the detected node as an available node.
In one embodiment, the node probing module is further configured to set a time window for the probed node to prohibit probing if the probing result indicates a probing failure.
In one embodiment, the node probing module is further configured to send a probe request to a node in the node list.
The probe request carries a resource identifier of the resource and a desired download point.
In one embodiment, the node detection module is further configured to, when the detection result indicates a detection failure, obtain a cumulative number of times that the detected node has failed to be detected continuously; and deleting the detected node in the node list when the accumulated number of times exceeds the set number of times.
In one embodiment, the task allocation module 8200 is further configured to detect whether a task is completed in response to a set trigger event; in the event of incompletion, the available nodes are assigned the task of downloading the resource.
In one embodiment, the triggering event includes either or both of the appearance of a new available node in the node list and the completion of the assigned task by the node to which the task has been assigned.
In one embodiment, the node detection module is further configured to compare a current download point of the local resource with an expected download point of the other node for the resource, in response to a detection of whether there is a resource in an inquiry initiated by the other node of the network; in the event that the desired download point leads the current download point, the other nodes are added to the list of nodes and marked as available nodes.
In one embodiment, the node probing module is further configured to return a probing result indicating that there is a resource to the other node if the current download point leads the desired download point; in case the expected download point leads the current download point, probe results indicating no resources are returned to the other nodes.
In one embodiment, the node list obtaining module 8100 is further configured to obtain the node list to be confirmed from the server in response to a task trigger for downloading the resource.
In one embodiment, the tasks are peer-to-peer tasks based on a P2P network.
In one embodiment, the resource is a live video resource, and the task allocation module 8200 is further configured to divide a current segment of the live video resource into a plurality of task blocks; and allocating the tasks of downloading resources by taking the task blocks as units.
In one embodiment, the node detection module is further configured to traverse nodes in the node list after obtaining the current segment of the video live broadcast resource, and screen out nodes that meet detection conditions; detecting whether nodes meeting detection conditions have current fragments or not; acquiring a detection result returned by the detected node; and in the case that the detection result indicates that the detection is successful, marking the detected node as an available node.
In one embodiment, the apparatus for downloading resources further comprises a reset module (not shown).
The reset module 8400 is configured to reset an available node in the node list to a node with an unknown state after obtaining the current segment of the live video resource, and then perform traversal of the nodes in the node list by the node detection module to screen out a node that meets the detection condition; and the nodes meeting the detection condition are nodes of which the states are unknown and which are not in the time window for prohibiting detection.
< terminal device embodiment >
In this embodiment, a terminal device 2000 is also provided, for example, the terminal device 2000A, the terminal device 2000B, the terminal device 2000C, and the terminal device 2000D in fig. 1, as shown in fig. 9, may include a resource downloading apparatus 8000 according to any embodiment of the present invention, configured to implement the method for downloading a resource according to any embodiment of the present invention.
In another embodiment, as shown in fig. 10, terminal device 2000 may include a memory 2200 and a processor 2100.
The memory 2200 is used for storing instructions for controlling the processor 2100 to operate to perform the method of downloading resources of any embodiment of the present invention. The skilled person can design the instructions according to the disclosed solution. How the instructions control the operation of the processor is well known in the art and will not be described in detail herein.
< computer-readable storage Medium >
In this embodiment, there is also provided a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements a method of downloading a resource according to any of the embodiments of the invention.
The present invention may be a system, method and/or computer program product. The computer program product may include a computer-readable storage medium having computer-readable program instructions embodied therewith for causing a processor to implement various aspects of the present invention.
The computer readable storage medium may be a tangible device that can hold and store the instructions for use by the instruction execution device. The computer readable storage medium may be, for example, but not limited to, an electronic memory device, a magnetic memory device, an optical memory device, an electromagnetic memory device, a semiconductor memory device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a Static Random Access Memory (SRAM), a portable compact disc read-only memory (CD-ROM), a Digital Versatile Disc (DVD), a memory stick, a floppy disk, a mechanical coding device, such as punch cards or in-groove projection structures having instructions stored thereon, and any suitable combination of the foregoing. Computer-readable storage media as used herein is not to be construed as transitory signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through a waveguide or other transmission medium (e.g., optical pulses through a fiber optic cable), or electrical signals transmitted through electrical wires.
The computer-readable program instructions described herein may be downloaded from a computer-readable storage medium to a respective computing/processing device, or to an external computer or external storage device via a network, such as the internet, a local area network, a wide area network, and/or a wireless network. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers and/or edge servers. The network adapter card or network interface in each computing/processing device receives computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in a computer-readable storage medium in the respective computing/processing device.
Computer program instructions for carrying out operations of the present invention may be assembler instructions, Instruction Set Architecture (ISA) instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source or object code written in any combination of one or more programming languages, including AN object oriented programming language such as Smalltalk, C + +, or the like, as well as conventional procedural programming languages, such as the "C" language or similar programming languages.
Aspects of the present invention are described herein with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer-readable program instructions.
These computer-readable program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks. These computer-readable program instructions may also be stored in a computer-readable storage medium that can direct a computer, programmable data processing apparatus, and/or other devices to function in a particular manner, such that the computer-readable medium storing the instructions comprises an article of manufacture including instructions which implement the function/act specified in the flowchart and/or block diagram block or blocks.
The computer readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other devices to cause a series of operational steps to be performed on the computer, other programmable apparatus or other devices to produce a computer implemented process such that the instructions which execute on the computer, other programmable apparatus or other devices implement the functions/acts specified in the flowchart and/or block diagram block or blocks.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of instructions, which comprises one or more executable instructions for implementing the specified logical function(s). In some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions. It is well known to those skilled in the art that implementation by hardware, by software, and by a combination of software and hardware are equivalent.
Having described embodiments of the present invention, the foregoing description is intended to be exemplary, not exhaustive, and not limited to the embodiments disclosed. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen in order to best explain the principles of the embodiments, the practical application, or improvements made to the technology in the marketplace, or to enable others of ordinary skill in the art to understand the embodiments disclosed herein. The scope of the invention is defined by the appended claims.

Claims (18)

1. A method of downloading a resource, comprising:
acquiring a node list to be confirmed;
screening out available nodes from the node list, and distributing a task of downloading the resources;
wherein the available nodes include nodes marked as having the resource.
2. The method of claim 1, wherein the method further comprises:
detecting whether a node in the node list has the resource;
acquiring a detection result returned by the detected node;
and marking the detected node as the available node when the detection result indicates that the detection is successful.
3. The method of claim 2, wherein the method further comprises:
and setting a time window for forbidding the detection for the detected node when the detection result indicates that the detection fails.
4. The method of claim 2, wherein said probing whether a node in the node list has the resource comprises:
and sending a detection request to the nodes in the node list, wherein the detection request carries the resource identifier of the resource and the expected download point.
5. The method of claim 2, wherein the method further comprises:
under the condition that the detection result shows detection failure, acquiring the accumulated times of continuous detection failure of the detected node;
and deleting the detected node in the node list under the condition that the accumulated times exceed the set times.
6. The method of claim 1, wherein said step of screening said list of nodes for available nodes and assigning a task to download said resource comprises:
responding to a set trigger event, and detecting whether the task is completed;
and under the condition of incompletion, distributing the task of downloading the resource for the available node.
7. The method of claim 6, wherein the triggering event comprises either or both of a new available node appearing in the node list and a node to which the task has been assigned completing the assigned task.
8. The method of claim 1, wherein the method further comprises:
responding to the inquiry of whether the resource exists or not initiated by other nodes of the network, and comparing the local current download point of the resource with the expected download point of the other nodes for the resource;
in the event that the desired download point leads the current download point, adding the other node to the node list and marking the other node as the available node.
9. The method of claim 8, wherein the method further comprises:
returning probe results representing the resources to the other nodes if the current download point leads the desired download point;
in the event that the desired download point leads the current download point, returning a probe result to the other node indicating that the resource is not present.
10. The method of claim 1, wherein the step of obtaining a list of nodes to be validated comprises:
and responding to the task trigger of downloading the resource, and acquiring a node list to be confirmed from a server.
11. The method according to any one of claims 1 to 10, wherein the task is a peer-to-peer task based on a P2P network.
12. The method of any of claims 1-10, wherein the resource is a live video resource; the task of allocating the download of the resource comprises:
dividing the current fragment of the video live broadcast resource into a plurality of task blocks;
and allocating the task for downloading the resources by taking the task block as a unit.
13. The method of claim 12, wherein the method further comprises:
after the current fragment of the video live broadcast resource is obtained, traversing nodes in the node list, and screening out nodes meeting detection conditions;
detecting whether the nodes meeting the detection condition have the current fragments or not;
acquiring a detection result returned by the detected node;
and marking the detected node as the available node when the detection result indicates that the detection is successful.
14. The method of claim 13, wherein the method further comprises:
after the current fragment of the video live broadcast resource is obtained, resetting available nodes in the node list to be nodes with unknown states, then executing the step of traversing the nodes in the node list and screening out the nodes meeting detection conditions; and the nodes meeting the detection conditions are nodes of which the states are unknown and which are not in the time window of prohibiting detection.
15. An apparatus for downloading resources, comprising:
the node list acquisition module is used for acquiring a node list to be confirmed;
the task allocation module is used for screening out available nodes from the node list and allocating tasks for downloading the resources;
wherein the available nodes include nodes marked as having the resource.
16. A terminal device comprising the apparatus of claim 15; or, a memory for storing executable instructions and a processor; the processor is configured to perform the method of downloading a resource according to any of claims 1-14 under control of the instructions.
17. A resource distribution system comprising a server and a plurality of terminal devices according to claim 16, the plurality of terminal devices forming a resource distribution network, each of the terminal devices being a node on the resource distribution network; and each terminal device responds to the own downloading task to acquire a node list from the server, wherein each node in the node list is a node on the resource distribution network.
18. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the method of downloading a resource according to any one of claims 1 to 14.
CN201910036747.5A 2019-01-15 2019-01-15 Method, device, terminal equipment and system for downloading resources Pending CN111435946A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910036747.5A CN111435946A (en) 2019-01-15 2019-01-15 Method, device, terminal equipment and system for downloading resources

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910036747.5A CN111435946A (en) 2019-01-15 2019-01-15 Method, device, terminal equipment and system for downloading resources

Publications (1)

Publication Number Publication Date
CN111435946A true CN111435946A (en) 2020-07-21

Family

ID=71581011

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910036747.5A Pending CN111435946A (en) 2019-01-15 2019-01-15 Method, device, terminal equipment and system for downloading resources

Country Status (1)

Country Link
CN (1) CN111435946A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112749012A (en) * 2021-01-15 2021-05-04 北京智芯微电子科技有限公司 Data processing method, device and system of terminal equipment and storage medium

Citations (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101741750A (en) * 2010-01-15 2010-06-16 中国科学院计算技术研究所 Resource downloading method in P2P (peer-to peer) and system thereof
CN101771931A (en) * 2008-12-26 2010-07-07 中国移动通信集团公司 P2P (peer 2 peer) resource downloading method and identification device
CN101854310A (en) * 2009-03-31 2010-10-06 工业和信息化部电信传输研究所 P2P controlling unit and method for achieving the same
CN101924777A (en) * 2009-06-17 2010-12-22 中国移动通信集团公司 Method, system and equipment for searching active nodes in P2P streaming media system
CN102075561A (en) * 2010-11-29 2011-05-25 成都市华为赛门铁克科技有限公司 Method, device and system for downloading network resources
CN102316135A (en) * 2010-07-02 2012-01-11 深圳市快播科技有限公司 Network on-demand method and system
CN102510395A (en) * 2011-10-21 2012-06-20 合一网络技术(北京)有限公司 Flash video scheduling method based on peer to server peer (P2SP)
CN102546728A (en) * 2010-12-27 2012-07-04 北大方正集团有限公司 Peer-to-peer network resource downloading method
CN102833293A (en) * 2011-06-17 2012-12-19 腾讯科技(深圳)有限公司 Method for downloading resources in peer to server and peer (P2SP) network, and client
CN103023928A (en) * 2013-01-11 2013-04-03 乐视网信息技术(北京)股份有限公司 P2P (peer-to-peer) node matching system and method
CN103327121A (en) * 2013-07-10 2013-09-25 亿览在线网络技术(北京)有限公司 P2P (Peer-to-Peer Network) network resource transmission method and device for same
CN104869162A (en) * 2015-05-20 2015-08-26 广东欧珀移动通信有限公司 Method of resource downloading and apparatus thereof
CN105827694A (en) * 2016-03-11 2016-08-03 腾讯科技(深圳)有限公司 Obtaining method and apparatus for network resources
CN106817266A (en) * 2015-12-01 2017-06-09 北京慧点科技有限公司 A kind of peer network resources method for down loading
CN106899639A (en) * 2015-12-21 2017-06-27 北京奇虎科技有限公司 The acquisition methods of data resource, index server and communication system
CN107343045A (en) * 2017-07-04 2017-11-10 北京百度网讯科技有限公司 Cloud computing system and cloud computing method and device for controlling server

Patent Citations (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101771931A (en) * 2008-12-26 2010-07-07 中国移动通信集团公司 P2P (peer 2 peer) resource downloading method and identification device
CN101854310A (en) * 2009-03-31 2010-10-06 工业和信息化部电信传输研究所 P2P controlling unit and method for achieving the same
CN101924777A (en) * 2009-06-17 2010-12-22 中国移动通信集团公司 Method, system and equipment for searching active nodes in P2P streaming media system
CN101741750A (en) * 2010-01-15 2010-06-16 中国科学院计算技术研究所 Resource downloading method in P2P (peer-to peer) and system thereof
CN102316135A (en) * 2010-07-02 2012-01-11 深圳市快播科技有限公司 Network on-demand method and system
CN102075561A (en) * 2010-11-29 2011-05-25 成都市华为赛门铁克科技有限公司 Method, device and system for downloading network resources
CN102546728A (en) * 2010-12-27 2012-07-04 北大方正集团有限公司 Peer-to-peer network resource downloading method
CN102833293A (en) * 2011-06-17 2012-12-19 腾讯科技(深圳)有限公司 Method for downloading resources in peer to server and peer (P2SP) network, and client
CN102510395A (en) * 2011-10-21 2012-06-20 合一网络技术(北京)有限公司 Flash video scheduling method based on peer to server peer (P2SP)
CN103023928A (en) * 2013-01-11 2013-04-03 乐视网信息技术(北京)股份有限公司 P2P (peer-to-peer) node matching system and method
CN103327121A (en) * 2013-07-10 2013-09-25 亿览在线网络技术(北京)有限公司 P2P (Peer-to-Peer Network) network resource transmission method and device for same
CN104869162A (en) * 2015-05-20 2015-08-26 广东欧珀移动通信有限公司 Method of resource downloading and apparatus thereof
CN106817266A (en) * 2015-12-01 2017-06-09 北京慧点科技有限公司 A kind of peer network resources method for down loading
CN106899639A (en) * 2015-12-21 2017-06-27 北京奇虎科技有限公司 The acquisition methods of data resource, index server and communication system
CN105827694A (en) * 2016-03-11 2016-08-03 腾讯科技(深圳)有限公司 Obtaining method and apparatus for network resources
CN107343045A (en) * 2017-07-04 2017-11-10 北京百度网讯科技有限公司 Cloud computing system and cloud computing method and device for controlling server

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112749012A (en) * 2021-01-15 2021-05-04 北京智芯微电子科技有限公司 Data processing method, device and system of terminal equipment and storage medium
CN112749012B (en) * 2021-01-15 2024-05-28 北京智芯微电子科技有限公司 Data processing method, device and system of terminal equipment and storage medium

Similar Documents

Publication Publication Date Title
CN105787077B (en) Data synchronization method and device
CN108696581B (en) Distributed information caching method and device, computer equipment and storage medium
CN109684036B (en) Container cluster management method, storage medium, electronic device and system
CN109842694B (en) Method for synchronizing MAC addresses, network equipment and computer readable storage medium
CN109388626B (en) Method and apparatus for assigning numbers to services
CN106712981B (en) Node change notification method and device
CN111478781B (en) Message broadcasting method and device
CN112540773B (en) Cloud game installation method and device, electronic equipment and storage medium
CN113014681A (en) Network card binding method and device of multi-network card server, electronic equipment and storage medium
CN112954088A (en) Equipment address allocation method and equipment of CAN network and electronic equipment
CN109144843B (en) Method and device for deploying test environment
CN111290871A (en) Method and device for acquiring crash information of application program
CN111694639A (en) Method and device for updating address of process container and electronic equipment
CN110933152A (en) Preheating method, device and system and electronic equipment
US10601954B2 (en) Sandboxing requests for web services
CN111435946A (en) Method, device, terminal equipment and system for downloading resources
CN106599323A (en) Method and apparatus for realizing distributed pipeline in distributed file system
CN115996179A (en) Service node testing method and device, readable medium and electronic equipment
CN110798358B (en) Distributed service identification method and device, computer readable medium and electronic equipment
CN112069137A (en) Method and device for generating information, electronic equipment and computer readable storage medium
CN109347994B (en) Internet protocol IP address obtaining method and device, storage medium and electronic equipment
CN110955460A (en) Service process starting method and device, electronic equipment and storage medium
CN113360348B (en) Abnormal request processing method and device, electronic equipment and storage medium
CN111147226A (en) Data storage method, device and storage medium
CN111428453B (en) Processing method, device and system in annotation synchronization process

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20200721

RJ01 Rejection of invention patent application after publication