CN105827694B - Method and device for acquiring network resources - Google Patents

Method and device for acquiring network resources Download PDF

Info

Publication number
CN105827694B
CN105827694B CN201610140370.4A CN201610140370A CN105827694B CN 105827694 B CN105827694 B CN 105827694B CN 201610140370 A CN201610140370 A CN 201610140370A CN 105827694 B CN105827694 B CN 105827694B
Authority
CN
China
Prior art keywords
network
node
client
preset
resource
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.)
Active
Application number
CN201610140370.4A
Other languages
Chinese (zh)
Other versions
CN105827694A (en
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 CN201610140370.4A priority Critical patent/CN105827694B/en
Publication of CN105827694A publication Critical patent/CN105827694A/en
Application granted granted Critical
Publication of CN105827694B publication Critical patent/CN105827694B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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
    • H04L67/1078Resource delivery 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/50Network services
    • H04L67/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
    • H04L67/63Routing a service request depending on the request content or context

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The invention discloses a method and a device for acquiring network resources. The method for acquiring the network resources comprises the following steps: the method comprises the steps that a client detects whether a network node exists in a local area network or not, wherein the network node is a device for storing network resources; when the client detects that the network node exists in the local area network, the client inquires whether the network node stores preset network resources; when the client inquires that the network node stores the preset network resource, the client sends an acquisition request command to the network node, wherein the acquisition request command is used for requesting the network node to send the preset network resource to the client; the client acquires preset network resources. The invention solves the technical problem of poor adaptability to network resource acquisition in the related technology.

Description

Method and device for acquiring network resources
Technical Field
The invention relates to the field of internet, in particular to a method and a device for acquiring network resources.
Background
The P4P technology (active network Provider classification for P2P, abbreviated as P4P) is an upgraded version of Peer-to-Peer (Peer-to-Peer, abbreviated as P2P) technology, and is used for network operators to localize traffic. When acquiring network resources, the P4P technology is not suitable for traffic localization with smaller granularity, such as Wireless Fidelity (WIFI), and the network resources must be acquired in the presence of a network. Such as the downloading of video.
Fig. 1 is a flowchart illustrating a method of video downloading according to the related art. As shown in fig. 1, the video downloading method includes the following steps: step S101, the client initiates a request for downloading the playing, and under the condition that an external network exists, the client initiates a request for downloading the playing, wherein the request for downloading the playing is a request for downloading a video. Step S102, the scheduling background judges whether the playing and downloading request is the request of the partner. Step S103, the scheduling background inquires the download address of the specific video of the partner, and if the scheduling background judges that the play download request is the play download request of the partner, the scheduling background inquires the download address of the specific video under the partner. Step S104, the scheduling background only returns the Content Delivery Network (CDN) download address, and if the scheduling background judges that the playing download request is not the playing download request of the partner, the scheduling background only returns the CDN download address. In step S105, the P4P Tracker server inquires whether the video exists in the P4P node under the partner. In step S106, the P4P Tracker server returns the extranet IP of the P4P node: PORT, if the P4 PTtracker server inquires that the cooperative P4P node has the video, the P4P Tracker server returns the extranet IP of the P4P node: and (4) PORT. In step S107, the P4P Tracker server returns null, and if the P4P Tracker server does not inquire the P4P node under the partner, the P4P Tracker server returns null. And step S108, the scheduling background server returns the uniform resource locator of the P4P node and the uniform resource locator of the content distribution network. In step S109, the client determines whether there is a uniform resource locator of the P4P node. Step S110, requesting the P4P node to download the video, and requesting the P4P node to download the video if the client determines that the uniform resource locator of the P4P node is available. And step S111, requesting the content distribution network node to download the video, and requesting the content distribution network node to download the video if the client judges that the uniform resource locator of the P4P node does not exist, thereby realizing the downloading of the video.
Fig. 2 is a flowchart of a method of video content update according to the related art. As shown in fig. 2, the method for updating video content includes the following steps: in step S201, the P4P Tracker server issues a video content download task, and the P4 pttracker server may issue the video content download task to the P4P node according to the video request list. In step S202, the P4P node downloads the video content, the content distribution network can respond and feed back to the video content downloading task, and in step S203, the P4P Tracker server obtains the node state and the content list, thereby realizing the update of the video content.
The difference of different public WIFI environments is large, some public WIFI environments do not provide external network access capability, and the technical capability of equipment cooperating with the public WIFI is weak. On the other hand, the P4P technology needs strong participation of a background scheduling system, and therefore, network resources must be acquired in the presence of a network, the background scheduling system needs to perform identification scheduling according to a network Protocol (Internet Protocol, abbreviated as IP) outlet of a device, and the technology cost is high and the environmental adaptability is poor when acquiring the network resources.
Aiming at the problem of poor adaptability to network resource acquisition in the related art, no effective solution is provided at present.
Disclosure of Invention
The embodiment of the invention provides a method and a device for acquiring network resources, which are used for at least solving the technical problem of poor adaptability to network resource acquisition in the related technology.
According to an aspect of an embodiment of the present invention, a method for acquiring a network resource is provided. The method for acquiring the network resources comprises the following steps: the method comprises the steps that a client detects whether a network node exists in a local area network or not, wherein the network node is a device for storing network resources; when the client detects that the network node exists in the local area network, the client inquires whether the network node stores preset network resources; when the client inquires that the network node stores the preset network resource, the client sends an acquisition request command to the network node, wherein the acquisition request command is used for requesting the network node to send the preset network resource to the client; and the client acquires the preset network resource.
According to another aspect of the embodiment of the present invention, an apparatus for acquiring a network resource is also provided. The network resource acquisition device comprises: the device comprises a detection unit, a processing unit and a processing unit, wherein the detection unit is used for detecting whether a network node exists in a local area network or not, and the network node is a device for storing network resources; the system comprises a query unit, a processing unit and a processing unit, wherein the query unit is used for querying whether a network node stores preset network resources or not when a client detects that the network node exists in a local area network; the client side is used for inquiring that the network node stores the preset network resources, and sending an acquisition request command to the network node, wherein the acquisition request command is used for requesting the network node to send the preset network resources to the client side; and the acquisition unit is used for acquiring the preset network resources.
In the embodiment of the invention, a client detects whether a network node exists in a local area network, wherein the network node is a device for storing network resources; when the client detects that the network node exists in the local area network, the client inquires whether the network node stores preset network resources; when the client inquires that the network node stores the preset network resource, the client sends an acquisition request command to the network node, wherein the acquisition request command is used for requesting the network node to send the preset network resource to the client; the client acquires the preset network resources, so that the purpose of acquiring the network resources is achieved, the technical effect of improving the adaptability of acquiring the network resources is achieved, and the technical problem of poor adaptability of acquiring the network resources in the related technology is solved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the invention without limiting the invention. In the drawings:
fig. 1 is a flowchart illustrating a method of video downloading according to the related art;
fig. 2 is a flowchart of a method of video content update according to the related art;
fig. 3 is a block diagram of a hardware configuration of a computer terminal of the network resource acquisition method according to an embodiment of the present invention;
fig. 4 is a flowchart of a network resource acquisition method according to a first embodiment of the present invention;
fig. 5 is a flowchart of a method for a client to detect whether a network node exists in a local area network according to a first embodiment of the present invention;
fig. 6 is a flowchart of a method for a client to detect whether a network node exists in a local area network according to a second embodiment of the present invention;
fig. 7 is a flowchart of a method for a client to send a get request command to a network node according to an embodiment of the invention;
fig. 8 is a flowchart illustrating a method for acquiring network resources according to a second embodiment of the present invention;
fig. 9 is a flowchart illustrating a method for acquiring network resources according to a third embodiment of the present invention;
fig. 10 is a flowchart illustrating a method for acquiring network resources according to a fourth embodiment of the present invention;
fig. 11 is a flowchart illustrating a method for acquiring network resources according to a fifth embodiment of the present invention;
fig. 12 is a flowchart illustrating a method for acquiring a network resource according to a sixth embodiment of the present invention;
fig. 13 is a flowchart illustrating a method for acquiring a network resource according to a seventh embodiment of the present invention;
FIG. 14 is a schematic illustration of acquisition of network resources according to an embodiment of the invention;
fig. 15 is a schematic diagram of an acquisition apparatus of network resources according to a first embodiment of the present invention;
fig. 16 is a schematic diagram of an acquisition apparatus of network resources according to a second embodiment of the present invention;
fig. 17 is a schematic diagram of an acquisition apparatus of network resources according to a third embodiment of the present invention;
fig. 18 is a schematic diagram of an acquisition apparatus of network resources according to a fourth embodiment of the present invention;
fig. 19 is a schematic diagram of an acquisition apparatus of network resources according to a fifth embodiment of the present invention; and
fig. 20 is a block diagram of a structure of a computer terminal according to an embodiment of the present invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
In accordance with an embodiment of the present invention, there is provided an embodiment of a method for acquiring network resources, it should be noted that the steps illustrated in the flowchart of the drawings may be performed in a computer system such as a set of computer executable instructions, and that although a logical order is illustrated in the flowchart, in some cases, the steps illustrated or described may be performed in an order different than that herein.
The method provided by the first embodiment of the present application may be executed in a mobile terminal, a computer terminal, or a similar computing device. Taking the example of running on a computer terminal, fig. 3 is a hardware structure block diagram of the computer terminal of the method for acquiring network resources according to the embodiment of the present invention. As shown in fig. 3, the computer terminal 1 may comprise one or more (only one shown in the figure) processors 102 (the processors 102 may comprise, but are not limited to, a processing means such as a microprocessor MCU or a programmable logic device FPGA), a memory 104 for storing data, and a transmission means 106 for communication functions. It will be understood by those skilled in the art that the structure shown in fig. 3 is only an illustration and is not intended to limit the structure of the electronic device. For example, the computer terminal 1 may also include more or fewer components than shown in FIG. 3, or have a different configuration than shown in FIG. 3.
The memory 104 may be used to store software programs and modules of application software, such as program instructions/modules corresponding to the method for acquiring a network resource in the embodiment of the present invention, and the processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, implements the method for acquiring a network resource. The memory 104 may include high speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include memory located remotely from the processor 102, which may be connected to the computer terminal 1 via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission device 106 is used for receiving or transmitting data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider of the computer terminal 1. In one example, the transmission device 106 includes a Network adapter (NIC), which can be connected to other Network devices through a base station so as to communicate with the internet. In one example, the transmission device 106 may be a Radio Frequency (RF) module, which is used for communicating with the internet in a wireless manner.
Under the operating environment, the application provides a method for acquiring network resources as shown in fig. 2. The method can be applied to intelligent terminal equipment, and is executed by a processor in the intelligent terminal equipment, and the intelligent terminal equipment can be an intelligent mobile phone, a tablet personal computer and the like. The intelligent terminal device is provided with at least one application program, and the embodiment of the invention does not limit the types of the application programs, and can be a system application program or a software application program.
Fig. 4 is a flowchart of a network resource acquisition method according to a first embodiment of the present invention. As shown in fig. 4, an alternative scheme of the method for acquiring network resources includes the following steps:
step S402, the client detects whether a network node exists in the local area network.
In the solution provided in the above step S402, in a certain area, a computer communication network is formed by interconnecting a plurality of computers, external devices, databases, and the like, and the computer communication network is a local area network, and an intranet can be formed by a plurality of local area networks, so as to implement file management, application software sharing, printer sharing, scanning for sharing, and the like. The client actively detects whether the network node exists in the local area network, and optionally, the client actively detects whether the network node exists in the local area network in a weak background server or a weak external network environment. The client may be a third-party Application (APP for short) on the smartphone, where the network node is a device for storing network resources, and the network node may broadcast its own presence in the local area network, so that the client detects the network node. The network node can be a workstation, a server, a terminal device and the like, has a unique network address, and can download network resources which the user terminal wants to acquire through the network node.
If the client detects that the network node exists in the local area network, the network resource can be acquired from the network node, and if the network node does not exist in the local area network, the network resource cannot be acquired from the network node. The network resource can be a video resource or a music streaming media resource, the network node stores the video resource or the music streaming media resource, and the video resource or the music streaming media resource can be downloaded from the network node.
Optionally, the network node is a P2P node, and the client may detect whether there is a P2P node in the lan through a Universal plug and Play (UPNP) protocol.
The embodiment of the invention detects whether the network node exists in the local area network or not through the client, solves the limitation of network resource acquisition under the weak background server or weak external network environment, realizes the optimization of user side playing software, and improves the adaptability of network resource acquisition.
Step S404, when the client detects that the network node exists in the local area network, the client queries whether the network node stores preset network resources.
In the solution provided in step S404 of the present application, after the client detects whether a network node exists in the lan, when the client detects that the network node exists in the lan, the client queries whether a preset network resource is stored in the network node, where the preset network resource is a target network resource to be acquired by the client, and may be a video resource, for example, the preset network resource is Tencent video content, and the preset network resource may also be a music streaming media resource. When a plurality of network nodes exist, the client side simultaneously inquires whether the plurality of network nodes store preset network resources.
The client queries whether the network node stores preset network resources or not, and the network node returns the query result to the client. The query result is the result that the network node has the preset network resource or the network node does not have the preset network resource. After the network nodes return the query results to the client, the client may summarize the query results for each network node.
According to the embodiment of the invention, when the client detects that the network node exists in the local area network, the client inquires whether the network node stores the preset network resource or not, so that the preset network resource stored in the network node is determined.
Step S406, when the client queries that the network node stores the preset network resource, the client sends an acquisition request command to the network node.
In the solution provided in the foregoing step S406, after the client queries whether the network node stores the preset network resource, when the client queries that the network node stores the preset network resource, the client sends an acquisition request command to the network node, where the acquisition request command is used to request the network node to send the preset network resource to the client. When the preset network resource is a video resource, the acquisition request command requests the network node to send a preset video to the client, and when the preset network resource is a music streaming media resource, the acquisition request command requests the network node to send a preset audio to the client.
Optionally, the obtaining request command is a command for querying a download address of a preset network resource in the presence of an external network, and if the external network is absent, the obtaining request command is a command for querying specific content of the network resource, so that the adaptability of obtaining the network resource is improved.
Optionally, when the client queries that the network node does not have the preset network resource, the end client sends the acquisition request command to the network node, ends the acquisition of the network resource, and returns a prompt message that the network resource cannot be downloaded, thereby informing the user that the terminal cannot acquire the network resource.
According to the embodiment of the invention, when the client inquires that the network node stores the preset network resource, the client sends the acquisition request command to the network node, so that the purpose of requesting the network node to send the preset network resource to the client is realized.
In step S408, the client acquires a preset network resource.
In the solution provided in step S408 of the present application, after the client sends the request acquiring command to the network node, the network node sends the preset network resource to the client in response to the request acquiring command, thereby implementing the acquisition of the network resource.
According to the embodiment, under public WIFI, for example, in the environment of providing a WIFI network such as a high-speed rail, an airport, a library, a coffee shop and a KTV, after the client sends the acquisition request command to the network node, the network node responds to the acquisition request command and sends the preset network resource to the client, so that the user terminal experiences the preset network resource through the client, and the adaptability of network resource acquisition is improved.
Through the steps S402 to S408, the scheme provided by the present invention can detect whether a network node exists in the local area network through the client, where the network node is a device for storing network resources; when the client detects that the network node exists in the local area network, the client inquires whether the network node stores preset network resources; when the client inquires that the network node stores the preset network resource, the client sends an acquisition request command to the network node, wherein the acquisition request command is used for requesting the network node to send the preset network resource to the client; the client acquires the preset network resources, so that the adaptability to the acquisition of the network resources is improved, and the technical problem of poor adaptability to the acquisition of the network resources in the related technology is solved.
As an alternative implementation manner, fig. 5 is a flowchart of a method for a client to detect whether a network node exists in a local area network according to a first embodiment of the present invention. As shown in fig. 5, the method for the client to detect whether there is a network node in the local area network includes the following steps:
step S502, the client detects whether the identification information of the network node exists in the local area network.
In the solution provided in the foregoing step S502 of the present application, if a network node exists in a local area network, the network node broadcasts information that the network node exists in the local area network, where the information is identification information of the network node, and is used to identify the existence of the network node in the local area network, for example, the identification information is IP information of the network node, and has uniqueness. When the network node is the P2P node, the client actively detects the identification information of the local area network P2P node to determine which network nodes in the local area network are the P2P nodes, thereby improving the adaptability to network resource acquisition.
Step S504, when the client detects that the identification information of the network node exists in the local area network, the network node in the local area network is determined to exist.
In the solution provided in step S504 of the present application, after the client detects whether the identification information of the network node exists in the local area network, when the client detects that the identification information of the network node exists in the local area network, it may be determined that the network node exists in the local area network, where the network node sends the identification information, so that the client detects the identification information in the local area network, and further determines that the network node exists in the local area network, thereby improving the adaptability to network resource acquisition.
Optionally, if the client does not detect that the identification information of the network node exists in the local area network, it is determined that the network node does not exist in the local area network.
The embodiment of the invention detects whether the identification information of the network node exists in the local area network or not through the client, wherein the identification information is information for identifying the existence of the network node in the local area network; when the client detects that the identification information of the network node exists in the local area network, the network node is determined to exist in the local area network, and the network node sends the identification information, so that the aim of detecting the network node in the local area network by the client is fulfilled, and the adaptability of acquiring network resources is improved.
As an alternative implementation manner, fig. 6 is a flowchart of a method for a client to detect whether a network node exists in a local area network according to a second embodiment of the present invention. As shown in fig. 6, the method for the client to detect whether there is a network node in the local area network includes the following steps:
step S602, the client detects whether the identification information of the P2P node exists in the lan through the UPNP protocol.
In the solution provided by the foregoing step S602 in the present application, in the P2P software, each ue may be a node, data transmission is performed through the node, and many cpus are not required, but in order to ensure the quality of data transmission, the P2P software automatically analyzes the hardware resources of each node, so that the computation with larger bandwidth and high speed performance can serve as a super node of the P2P software. The UPNP protocol implements a network architecture for a variety of intelligent devices, wireless devices, and personal computers, etc., that is a worldwide-ubiquitous peer-to-peer network. The client detects whether the identification information of the P2P node exists in the local area network through the UPNP protocol, namely, the client actively discovers the P2P node through the UPNP protocol, wherein the identification information is used for identifying the existence of the P2P node in the local area network, and the adaptability of obtaining network resources is improved.
Step S604, when the client detects that the identification information of the P2P node exists in the lan through the UPNP protocol, it determines that the network node exists in the lan.
In the solution provided in step S604 of the present application, after the client detects whether the identification information of the P2P node exists in the lan through the UPNP protocol, when the client detects that the identification information of the P2P node exists in the lan through the UPNP protocol, it is determined that the P2P node exists in the lan, where the P2P node sends the identification information through the UPNP protocol, that is, the P2P node broadcasts its own existence in the lan through the UPNP protocol, so that the adaptability to network resource acquisition is improved.
Optionally, when the client detects that the identification information of the P2P node does not exist in the local area network through the UPNP protocol, it is determined that the P2P node does not exist in the local area network.
The embodiment of the invention detects whether the identification information of the network node exists in the local area network or not through the UPNP protocol by the client, wherein the identification information is used for identifying the existence of the P2P node in the local area network; when the client detects that the identification information of the network node exists in the local area network through the UPNP protocol, the network node exists in the local area network, the P2P node sends the identification information through the UPNP protocol, the purpose that the client detects whether the network node exists in the local area network is achieved, and the adaptability of obtaining network resources is improved.
As an alternative implementation manner, fig. 7 is a flowchart of a method for a client to send a get request command to a network node according to an embodiment of the present invention. As shown in fig. 7, the method for sending the get request command to the network node by the client includes the following steps:
in step S702, the client sends an acquisition request command to the server.
In the solution provided in step S702 of the present application, when the client accesses the external network through the WIFI network, the client sends an acquisition request command to the server, where the server determines whether the acquisition request command is a command issued under a preset network, and if the server determines that the acquisition request command is a command issued under the preset network, the server queries an acquisition address of the network resource of the P2P node, and optionally, if the server determines that the acquisition request command is not a command issued under the preset network, the server only returns the CDN download address to the client. After the server queries the acquisition address of the network resource of the P2P node, the server queries whether the P2P node stores the preset network resource through the acquisition address, and when the P2P node stores the preset network resource through the acquisition address, the server sends the uniform resource locator of the P2P node. Alternatively, when the P2P node does not store the preset network resource by inquiring the address, the server returns null.
Optionally, the client sends a get request command to a server, where the server includes a scheduling backend and a P2PTracker server. The server judges whether the acquisition request command is a command sent under a preset network, the preset network is a network under a specific partner, and if the scheduling background judges that the acquisition request command is the request command of the partner, the scheduling background inquires an acquisition address of the network resource of the P2P node, that is, the scheduling background inquires a download address of the specific network resource of the partner. And if the scheduling background judges that the acquisition request command is not the request command of the partner, the scheduling background only returns the CDN download address to the client. After the scheduling background queries the download address of the specific network resource of the partner, the P2 pttracker server queries whether the P2P node stores the preset network resource, that is, the P2P Tracker server queries whether the P2P node under the partner has the preset network resource, and when the P2P Tracker server queries that the P2P node stores the preset network resource, the P2P Tracker server sends the uniform resource locator of the P2P node. Alternatively, when the P2P Tracker server queries that the P2P node does not store the preset network resource, the P2P Tracker server returns null.
In step S704, when the client receives the uniform resource locator of the P2P node, the client sends a get request command to the P2P node.
In the solution provided in the foregoing step S704, if the scheduling backend only returns the CDN download address to the client, the scheduling backend returns the uniform resource locator of the CDN to the client, and if the P2P Tracker server queries that the P2P node stores the preset network resource, the P2P Tracker server sends the uniform resource locator of the P2P node to the client.
When the client receives the uniform resource locator of the P2P node, an acquisition request command is sent to the P2P node, wherein the P2P node responds to the acquisition request command and sends the preset network resource to the client, so that the client acquires the preset network resource under the condition of accessing the external network through the WIFI network.
Step S706, when the client does not receive the P2P node, sending an obtaining request command to the CDN network node.
In the solution provided in the foregoing step S706, if the scheduling backend only returns the CDN download address to the client, the scheduling backend returns the uniform resource locator of the CDN to the client, and at this time, the client does not receive the P2P node. When the client does not receive the P2P node, the client sends an acquisition request command to the CDN network node, wherein the CDN network node responds to the acquisition request command and sends the preset network resource to the client, so that the client acquires the preset network resource under the condition of accessing the external network through the WIFI network.
In the embodiment of the invention, under the condition that the client accesses the external network through the WIFI network, the client sends an acquisition request command to the server, the server judges whether the acquisition request command is a command sent under a preset network, if the server judges that the acquisition request command is a command sent under the preset network, the server inquires an acquisition address of the network resource of the P2P node, inquires whether the P2P node stores the preset network resource or not through the acquisition address, and when the P2P node stores the preset network resource through the acquisition address inquiry, the server sends a uniform resource locator of the P2P node; when the client receives the uniform resource locator of the P2P node, an acquisition request command is sent to the P2P node, and the P2P node responds to the acquisition request command and sends preset network resources to the client; when the client does not receive the P2P node, the client sends an acquisition request command to the CDN network node, and the CDN network node responds to the acquisition request command and sends the preset network resources to the client, so that the purpose that the client sends the acquisition request command to the network node is achieved, the purpose that the client acquires the network resources is achieved, and the adaptability of acquiring the network resources is improved.
As an optional implementation manner, after the client sends the obtaining request command to the network node, the client sends update data to the P2P node through the server, where the update data is data used to update the content of the network resource and may be task data for downloading a preset network resource, the P2P node updates the content of the network resource according to the update data to obtain a first updated network resource, and sends the first updated network resource to the server, and the client obtains the preset network resource includes: the client acquires the first updated network resource through the server.
Optionally, after the client sends the acquisition request command to the network node, the client root issues a content download task to the P2P node through the P2P Tracker server according to the video request list or according to the operation control content list, and the P2P node updates the content of the network resource according to the content download task to obtain a first updated network resource. The P2P node downloads the preset network resource, and the CDN network node may respond to the downloaded preset network resource, further feed back the downloaded preset network resource, and send the first updated network resource to the P2P Tracker server.
Optionally, the client obtains the first updated network resource through the P2P Tracker server, where the first updated network resource is a node status and content list of the network node. The P2P Tracker server sends a request signal for requesting the P2P network node to send the node state and content list of the network node, the P2P network node sends the node state and content list of the network node to the P2P Tracker server after responding to the request signal, the P2P Tracker server sends the node state and content list of the network node to the client, and the client is enabled to acquire the node state and content list of the network node.
As an optional implementation manner, in a case that the client cannot access the external network through the WIFI network, after the client sends the acquisition request command to the network node, the P2P node updates the content of the network resource through the hard disk offline to obtain a second updated network resource, and sends the second updated network resource to the server, where the client acquires the preset network resource and includes: and the client acquires the second updated network resource through the server.
Optionally, after the client sends the acquisition request command to the network node, the client may acquire data of the network resource through the hard disk, for example, the data of the network resource is stored in advance through a secure digital card, a magnetic disk, and the like, so that the P2P node may update the content of the network resource offline to obtain a second updated network resource, and the client acquires the second updated network resource through the server, thereby updating the content of the network resource and acquiring the updated network resource when the client cannot access the external network through the WIFI network.
As an optional implementation manner, the number of the network nodes is multiple, and the querying, by the client, whether the network node stores the preset network resource includes: the method comprises the steps that a client sends a query command to a plurality of network nodes, wherein the query command is a command used for querying whether preset network resources are stored in the network nodes or not, the network nodes respectively respond to the query command to obtain a plurality of query results corresponding to the network nodes and respectively send the plurality of query results corresponding to the network nodes to the client, and after the client queries whether the preset network resources are stored in the network nodes or not, the client summarizes the plurality of query results corresponding to the network nodes to obtain a summarized result; the client judges whether a preset query result exists in the summary result, wherein the preset query result is a query result of the network node storing preset network resources, and the client sends the acquisition request command to the network node comprises: and if the client judges that the summary result has the preset query result, sending an acquisition request command to the network node corresponding to the preset query result.
Optionally, the client sends an inquiry command to a plurality of network nodes in the local area network, and inquires whether the network nodes store preset network resources through the inquiry command, and the plurality of network nodes respectively respond to the inquiry command. If the network node stores the preset network resources, the network node feeds back the query result in which the preset network resources are stored, if the network node does not store the preset network resources, the network node feeds back the query result in which the preset network resources are not stored, and the plurality of network nodes respectively return the query results corresponding to the network nodes to the client. After the client queries whether the network nodes store the preset network resources, the client summarizes a plurality of query results corresponding to the network nodes to obtain a summary result, wherein the summary result includes the query results of the network nodes storing the preset network resources and the query results of the network nodes not storing the preset network resources, and the query results of the network nodes storing the preset network resources are the preset query results. The client judges whether the summary result has the preset query result, and if the client judges that the summary result has the preset query result, the client sends an acquisition request command to the network node corresponding to the preset query result, so that the purpose of acquiring the network resources is achieved, and the adaptability of acquiring the network resources is improved.
As an optional implementation manner, after the client queries whether the network node stores the preset network resource, when the client queries that the network node does not store the preset network resource, the client outputs a prompt message that the preset network resource cannot be acquired, and prompts that the user terminal cannot experience the preset network resource, thereby ending the acquisition of the network resource.
The technical means of the invention will be described below with reference to preferred embodiments.
Fig. 8 is a flowchart illustrating a method for acquiring network resources according to a second embodiment of the present invention. As shown in fig. 8, the method for acquiring network resources includes the following steps:
step S801, a scheduling background inquires a download address of the network resource.
The client detects whether a P2P node exists in the same local area network or not through a UPNP protocol, the P2P node broadcasts the existence of the P2P node in the local area network through the UPNP protocol, and therefore the client detects the P2P node in the local area network through the UPNP protocol detection, wherein the client can be an APP application on a smart phone. After the client initiates a request for playing and downloading the network resource, the scheduling background inquires the downloading address of the network resource.
Step S802, the client inquires network resources.
And under the condition that the client cannot access the external network through the WIFI network, the client directly inquires network resources from the network node, and optionally, the client inquires video content from the network node.
Step S803, schedule the background concurrent query.
And scheduling the background to perform concurrent query, executing step S804 if the play and download request of the network resource is the request command of the P2P partner, and executing step S805 if the play and download request is not the request command of the P2P partner.
Step S804, scheduling background inquiry P2P node address inquiry.
When the request for downloading the network resource is a request command from the P2P partner, the scheduling background queries the address query of the P2P node, that is, the scheduling background queries the download address of the specific video of the P2P partner. Optionally, the P2P Tracker server determines whether there is a preset network resource in the P2P node, if there is no preset network resource in the P2P node, the P2 pttracker server returns null to the scheduling background, and if there is a preset network resource in the P2P node, the P2P Tracker server returns the extranet IP of the P2P node: and (4) PORT. If the client receives the uniform resource locator of the P2P node, the client sends an acquisition command of preset network resources to the P2P node.
Step S805, the scheduling background queries the content distribution network address.
When the request for playing and downloading the network resource is not the request command of the P2P partner, the CDN network address is inquired and returned to the client.
The scheduling background may return the uniform resource locator of the CDN, and if the client does not receive the uniform resource locator of the P2P node, the client requests the CDN to download the preset network resource.
Optionally, when the client accesses the external network through the WIFI network, the content of the network resource stored in the network node is updated through the P2P Tracker server, for example, the content of the video stored in the network node is updated through the P2P Tracker server, so that the adaptability to network resource acquisition is improved.
Optionally, when the client accesses the external network through the WIFI network, the P2P node may perform online reporting of the node state and the content of the network resource to the P2P Tracker server.
Optionally, the network resource in the embodiment of the present invention may be a music streaming media, and the method for acquiring a network resource is also applicable to acquiring a music resource, which is not described herein again.
The client side detects whether a P2P node exists in the same local area network through a UPNP protocol, interacts with a scheduling background under the condition that public WIFI has external network access capability, inquires a download address of a P2P node and a download address of a CDN in the local area network, broadcasts the existence of the P2P node in the local area network through the UPNP protocol, responds to a play download request of the client side for network resources, achieves the acquisition of the network resources by the client side, can enable the P2P node to dynamically update the content of the network resources under the condition that the client side accesses the external network through the WIFI network, reports the state of the node and the content of the network resources to a P2P Tracker server on line, and improves the adaptability of the acquisition of the network resources.
Fig. 9 is a flowchart illustrating a method for acquiring network resources according to a third embodiment of the present invention. As shown in fig. 9, the method for acquiring network resources includes the following steps:
in step S901, the P2P node broadcasts the existence of the P2P node.
The P2P node broadcasts the presence of the P2P node, alternatively, the P2P node broadcasts the presence of the P2P node via UPNP protocol within the lan, and may broadcast the presence of the network node within the lan by sending identification information indicating its presence within the lan, which may be the IP address of the P2P node.
In step S902, the client detects the P2P node.
After the P2P node broadcasts the presence of the network node, the client actively detects the presence of the P2P node within the lan, and optionally the client actively detects the identification information of the P2P node within the lan via the UPNP protocol. When the client actively detects the identification information of the P2P node in the local area network through the UPNP protocol, the client is determined to detect the P2P node in the local area network, and the client can also record the detection state, so that the method is used in the process of acquiring network resources by the subsequent client.
According to the embodiment of the invention, the existence of the network node is broadcasted through the P2P node, and then the client detects the P2P node, so that the client actively discovers the network node in the local area network, the network resource is acquired, and the adaptability of acquiring the network resource is improved.
Fig. 10 is a flowchart illustrating a method for acquiring network resources according to a fourth embodiment of the present invention. As shown in fig. 10, the method for acquiring network resources includes the following steps:
step S1001, querying whether the P2P node has a preset network resource.
After the client detects that there is a P2P node in the lan, the client sends a query command to the P2P node, and the client queries whether there are preset network resources in the P2P node, for example, whether there are preset videos in the P2P node. If the client detects a plurality of P2P nodes in the LAN, the client sends a query command to the plurality of P2P nodes and queries whether preset network resources exist in the plurality of P2P nodes.
Step S1002, returning the query result.
After the client queries the P2P node that the preset network resources exist, the P2P node returns the query result in response to the query command. If the client detects a plurality of P2P nodes in the LAN, the P2P nodes respectively respond to the query command to obtain a plurality of query results corresponding to the P2P nodes, and respectively send the plurality of query results corresponding to the P2P nodes to the client, that is, the query results of a single node are returned to the client.
And step S1003, summarizing the query result.
And the client summarizes a plurality of query results corresponding to the P2P nodes to obtain a summary result.
Step S1004, when there is a preset network resource, initiates an acquisition request command.
The client side judges whether a preset query result exists in the summary result, the preset query result is that the P2P node stores the query result of the preset network resource, and if the client side judges that the summary result includes the preset query result, the client side sends an acquisition request command to the P2P node corresponding to the preset query result.
Step S1005, when there is no preset network resource, ending and returning the information that cannot be acquired.
After the client determines whether there is a preset query result in the summarized results, if the client determines that there is no preset query result in the summarized results, the client ends the process of acquiring the preset network resource and returns information that the preset network resource of the P2P node cannot be acquired, that is, returns information that the preset network resource of the P2P node cannot be acquired.
Whether the client accesses the external network through the WIFI network or not, the client inquires whether the P2P node has the preset network resource or not, the P2P node then returns the inquiry result, when the client judges that the P2P node has the preset network resource, the client initiates an acquisition request command, and when the client judges that the preset network resource does not exist, the client ends and returns the information which cannot be acquired, so that the downloading acceleration of the network resource can be realized, and the adaptability to the acquisition of the network resource is improved.
Fig. 11 is a flowchart illustrating a method for acquiring network resources according to a fifth embodiment of the present invention. As shown in fig. 11, the method for acquiring network resources includes the following steps:
in step S1101, the client initiates a play download request.
And under the condition that the client accesses the external network through the WIFI network, the client initiates a play downloading request to the scheduling background.
Step S1102, the scheduling backend determines whether the play downloading request is a play request of the partner.
After the client initiates the play downloading request, the scheduling background determines whether the play downloading request is a play request of a partner, if the scheduling background determines that the play downloading request is a play request of a partner, step S1103 is executed, and if the scheduling background determines that the play downloading request is not a play request of a partner, step S1104 is executed.
Step S1103, the scheduling background queries a download address of the preset network resource.
And if the scheduling background judges that the playing and downloading request is the playing request of the partner, the scheduling background inquires the downloading address of the source of the partner. The preset network resource of the partner may be a specific video of the P2P node under the preset network.
And step S1104, the scheduling background only returns the content distribution network download address.
And if the scheduling background judges that the playing and downloading request is not the playing request of the partner, the scheduling background only returns the content distribution network downloading address to the client.
In step S1105, the P2P Tracker server queries whether a preset network resource exists in the P2P node of the partner.
After the scheduling background queries the download address of the preset network resource, the P2P Tracker server queries whether the P2P node under the partner has the preset network resource, if the P2P Tracker server queries that the P2P node under the partner has the preset network resource, step S1106 is executed, and if the P2P Tracker server queries that the P2P node under the partner does not have the preset network resource, step S1107 is executed.
In step S1106, the P2P Tracker server returns the extranet IP of the P2P node: and (4) PORT.
If the P2P Tracker server inquires that the P2P node under the partner has the preset network resource, the P2 PTtracker server returns the extranet IP of the P2P node: PORT to the scheduling background.
In step S1107, the P2P Tracker server returns null.
If the P2P Tracker server inquires that the P2P node under the partner does not have the preset network resource, the P2 PTtracker server returns null to the scheduling background.
Step S1108, the scheduling backend returns the uniform resource locator of the P2P node and the uniform resource locator of the content distribution network.
The scheduling background returns the uniform resource locator of the P2P node and the uniform resource locator of the content distribution network according to the query condition, that is, if the scheduling background determines that the play download request is not the play request of the partner, the scheduling background only returns the content distribution network download address to the client, the scheduling background can return the uniform resource locator of the content distribution network to the client, if the scheduling background determines that the play download request is the play request of the partner, and the P2P Tracker server queries that the P2P node under the partner has the preset network resource, and the P2P Tracker server returns the extranet IP of the P2P node: PORT, the scheduling backend then returns the uniform resource locator of the P2P node to the client.
In step S1109, the client determines whether there is a uniform resource locator of the P2P node.
The client determines whether there is a uniform resource locator of the P2P node, if the client determines that there is a uniform resource locator of the P2P node, step S1110 is performed, and if the client determines that there is no uniform resource locator of the P2P node, step S1111 is performed.
In step S1110, the client requests the P2P node to download the preset network resource.
If the client determines that the uniform resource locator of the P2P node exists, the client requests the P2P node to download the preset network resource, so that the preset network resource is obtained.
In step S1111, the client requests the content distribution network node to download the preset network resource.
And if the client judges that the uniform resource locator of the P2P node does not exist, the client requests the content distribution network node to download the preset network resource, so that the preset network resource is obtained.
Optionally, the preset network resource in the embodiment of the present invention may be a video resource, such as an Tencent video, or a music resource.
The embodiment of the invention initiates a play downloading request through a client, a scheduling background judges whether the play downloading request is the play request of a partner, if the scheduling background judges that the play downloading request is the play request of the partner, the scheduling background inquires the downloading address of the preset network resource of the partner, if the scheduling background judges that the play downloading request is not the play request of the partner, the scheduling background only returns the content distribution network downloading address, a P2P Tracker server inquires whether the preset network resource exists in a P2P node under the partner, if the P2P Tracker server inquires that the preset network resource exists in a P2P node under the partner, the P2P Tracker server returns the external network IP of the P2P node: PORT, if the P2P Tracker server inquires that no preset network resource exists in the P2P node under the partner, the P2P Tracker server returns null, the scheduling background returns the uniform resource locator of the P2P node and the uniform resource locator of the content distribution network, the client judges whether the uniform resource locator of the P2P node exists, if the client judges that the uniform resource locator of the P2P node exists, the client requests the P2P node to download the preset network resource, if the client judges that the uniform resource locator of the P2P node does not exist, the client requests the content distribution network node to download the preset network resource, the network resource is acquired under the condition that the client accesses the external network through the WIFI network, and the network resource acquisition adaptability is improved.
Fig. 12 is a flowchart illustrating a method for acquiring a network resource according to a sixth embodiment of the present invention. As shown in fig. 12, the method for acquiring network resources includes the following steps:
step S1201, a content download task of the preset network resource is issued.
Under the condition that the client accesses the external network through the WIFI network, the P2P Tracker server issues a content downloading task of preset network resources to the P2P node, and optionally, the P2P Tracker server issues the content downloading task to the P2P node according to a video request missing list or an operation control content list.
In step S1202, the P2P node downloads the content of the preset network resource.
After the P2P Tracker server issues the video content download task to the P2P node, the P2P node downloads the content of the preset network resource, and the content distribution network can respond and feed back the download task of the preset network resource.
In step S1203, a node status and a content list are acquired.
The P2P Tracker server obtains the node state and the content list, and the client and the P2P Tracker server make a request and a response of the node state and the content list, so that the content of the preset network resource is updated.
According to the embodiment of the invention, the client side issues the content downloading task of the preset network resource, the P2P node downloads the content of the preset network resource, and the client side acquires the node state and the content list, so that the network resource is updated.
Fig. 13 is a flowchart illustrating a method for acquiring a network resource according to a seventh embodiment of the present invention. As shown in fig. 13, in the case that the client cannot access the external network through the WIFI network, the P2P node may update the network resources offline from the hard disk. After the client sends the acquisition request command to the network node, the data of the network resource can be acquired first through the hard disk, for example, the data of the network resource is stored first through a secure digital card, a magnetic disk and the like, so that the content of the network resource can be updated by the P2P node offline to obtain the updated network resource, and the client acquires the updated network resource through the server, so that the content of the network resource can be updated and the updated network resource can be acquired under the condition that the client cannot access the external network through the WIFI network.
Fig. 14 is a schematic diagram of acquisition of network resources according to an embodiment of the present invention. As shown in fig. 14, the user terminal enables the client to successfully link the WIFI by operating the WIFI linking function of the south china high-speed rail APP. Dozens of films such as movies, TV dramas, synthesis art, animation can be recommended to video recommendation H5 page on the Guannan high-speed railway APP, and the user terminal clicks a single film on a single H5 page, so that the Guannan high-speed railway APP is pulled up to download the films, and the cache page of the video corresponding to the Guannan high-speed railway APP is pulled up to obtain the films. Under the condition that the client side is not successfully linked with WIFI, the video can be updated through a hard disk offline updating method, and then the Guannan high-speed rail APP can acquire the video, so that the video downloading speed of a user can be further improved under the condition that the environment has the access capability of an external network, downloading and on-demand playing of the video can be realized under the condition that the environment does not have the access capability of the external network, the adaptability of acquiring network resources is improved, and the experience of watching the video by the user terminal is improved.
It should be noted that, for simplicity of description, the above-mentioned method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present invention is not limited by the order of acts, as some steps may occur in other orders or concurrently in accordance with the invention. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required by the invention.
Through the above description of the embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but the former is a better implementation mode in many cases. Based on such understanding, the technical solutions of the present invention may be substantially embodied in the form of a software product, which is stored in a storage medium, such as a Read-Only Memory (ROM)/Random Access Memory (RAM), a magnetic disk, and an optical disk, and includes several instructions for enabling a terminal device (which may be a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present invention.
According to the embodiment of the invention, the invention also provides a device for implementing the network resource acquisition method. Fig. 15 is a schematic diagram of an apparatus for acquiring network resources according to a first embodiment of the present invention. As shown in fig. 15, the network resource acquiring device includes: the device comprises a detection unit 10, an inquiry unit 20, a sending unit 30 and an acquisition unit 40.
In the network resource acquiring apparatus in this embodiment, the detecting unit 10 may be configured to execute step S402 in the embodiment of the present invention, the querying unit 20 may be configured to execute step S404 in the embodiment of the present invention, the sending unit 30 may be configured to execute step S406 in the embodiment of the present invention, and the acquiring unit 40 is configured to execute step S408 in the embodiment of the present invention.
A detecting unit 10, configured to detect whether a network node exists in a local area network, where the network node is a device for storing network resources.
The query unit 20 is configured to query whether a network node stores a preset network resource when it is detected that the network node exists in the local area network.
The sending unit 30 is configured to send an acquisition request command to the network node when it is found that the network node stores the preset network resource, where the acquisition request command is used to request the network node to send the preset network resource to the client.
The obtaining unit 40 is configured to obtain a preset network resource.
Fig. 16 is a schematic diagram of an apparatus for acquiring network resources according to a second embodiment of the present invention. As shown in fig. 16, the network resource acquiring device includes: the device comprises a detection unit 10, an inquiry unit 20, a sending unit 30 and an acquisition unit 40, wherein the detection unit 10 comprises: a first detection module 11 and a first determination module 12.
The detecting unit 10, the querying unit 20, the sending unit 30 and the obtaining unit 40 in this embodiment have the same functions as the network resource obtaining apparatus in the first embodiment of the present invention, and are not described herein again.
The first detecting module 11 is configured to detect whether identification information of a network node exists in the local area network, where the identification information is information for identifying that the network node exists in the local area network.
A first determining module 12, configured to determine that a network node exists in the local area network when it is detected that identification information of the network node exists in the local area network, where the network node sends the identification information.
As an alternative embodiment, the network node is a P2P node. Fig. 17 is a schematic diagram of an apparatus for acquiring network resources according to a third embodiment of the present invention. As shown in fig. 17, the apparatus for acquiring network resources includes: the device comprises a detection unit 10, an inquiry unit 20, a sending unit 30 and an acquisition unit 40, wherein the detection unit 12 comprises: a second detection module 13 and a second determination module 14.
The detecting unit 10, the querying unit 20, the sending unit 30 and the obtaining unit 40 in this embodiment have the same functions as the network resource obtaining apparatus in the first embodiment of the present invention, and are not described herein again.
And a second detecting module 13, configured to detect, by using the UPNP protocol, whether the identification information of the network node exists in the local area network, where the identification information is information for identifying that the P2P node exists in the local area network.
A second determining module 14, configured to determine that a network node exists in the local area network when the existence of the identification information of the network node in the local area network is detected through the UPNP protocol, where the P2P node sends the identification information through the UPNP protocol.
Fig. 18 is a schematic diagram of an apparatus for acquiring a network resource according to a fourth embodiment of the present invention. As shown in fig. 18, the network resource acquiring device includes: the device comprises a detection unit 10, an inquiry unit 20, a sending unit 30 and an acquisition unit 40, wherein the detection unit 10 comprises a second detection module 13 and a second determination module 14, and the sending unit 30 comprises: a first transmission module 31, a second transmission module 32 and a third transmission module 33.
The detecting unit 10, the querying unit 20, the sending unit 30, the obtaining unit 40, the second detecting module 13, and the second determining module 14 in this embodiment have the same functions as those in the third embodiment of the present invention, and are not described herein again.
The first sending module 31 is configured to send an acquisition request command to the server when accessing the external network through the WIFI network, where the server determines whether the acquisition request command is a command sent under a preset network, and if the server determines that the acquisition request command is a command sent under the preset network, the server queries an acquisition address of the network resource of the P2P node, and queries whether the P2P node stores the preset network resource by using the acquisition address, and when it is queried that the P2P node stores the preset network resource by using the acquisition address, the server sends a uniform resource locator of the P2P node;
a second sending module 32, configured to send a get request command to the P2P node when the client receives the uniform resource locator of the P2P node, where the P2P node responds to the get request command and sends a preset network resource to the client; and
a third sending module 33, configured to send an obtaining request command to the CDN network node when the client does not receive the P2P node, where the CDN network node responds to the obtaining request command and sends a preset network resource to the client.
As an alternative embodiment, the sending unit 30 is further configured to send, by the server, update data to the P2P node after the client sends the obtaining request command to the network node, where the update data is data for updating the content of the network resource, the P2P node updates the content of the network resource according to the update data to obtain the first updated network resource, and sends the first updated network resource to the server, and the obtaining unit 40 is configured to obtain the first updated network resource by the server.
As an alternative embodiment, fig. 19 is a schematic diagram of an apparatus for acquiring a network resource according to a fifth embodiment of the present invention. As shown in fig. 19, the network resource acquiring device includes: the device comprises a detection unit 10, an inquiry unit 20, a sending unit 30 and an acquisition unit 40, wherein the detection unit 10 comprises a second detection module 13 and a second determination module 14, and the sending unit 30 comprises: a first transmission module 31, a second transmission module 32 and a third transmission module 33. The network resource acquisition means further comprises an updating unit 50.
The detecting unit 10, the querying unit 20, the sending unit 30, the obtaining unit 40, the second detecting module 13, the second determining module 14, the first sending module 31, the second sending module 32, and the third sending module 33 in this embodiment have the same functions as those in the fourth embodiment of the present invention, and are not described herein again.
The updating unit 50 is configured to, after sending the acquisition request command to the network node, enable the P2P node to perform offline updating through the hard disk to update the content of the network resource to obtain a second updated network resource, and send the second updated network resource to the server in a case where the client cannot access the external network through the WIFI network, and the acquiring unit 40 is configured to acquire the second updated network resource through the server.
The embodiment of the invention detects whether a network node exists in a local area network through a detection unit 10, wherein the network node is a device for storing network resources, when a client detects that the network node exists in the local area network, a query unit 20 queries whether the network node stores preset network resources, and when the client queries that the network node stores the preset network resources, the client sends an acquisition request command to the network node through a sending unit 30, wherein the acquisition request command is used for requesting the network node to send the preset network resources to the client, and the acquisition unit 40 acquires the preset network resources, so that the adaptability of network resource acquisition is improved.
The embodiment of the invention also provides a storage medium. Optionally, in this embodiment, the storage medium may be configured to store a program code executed by the network resource obtaining method according to the above embodiment.
Optionally, in this embodiment, the storage medium may be located in at least one network device of a plurality of network devices of a computer network.
Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps:
the method comprises the steps that a client detects whether a network node exists in a local area network or not, wherein the network node is a device for storing network resources;
when the client detects that the network node exists in the local area network, the client inquires whether the network node stores preset network resources;
when the client inquires that the network node stores the preset network resource, the client sends an acquisition request command to the network node, wherein the acquisition request command is used for requesting the network node to send the preset network resource to the client;
the client acquires preset network resources.
Optionally, the storage medium is further arranged to store program code for performing the steps of: acquiring the use frequency of any application function; sequencing the use frequency of each application function; and respectively displaying the function icon of each application function on a corresponding display track according to the sequencing result of the use frequency, wherein the function icon of the application function with the highest use frequency is displayed on the display track closest to the first icon.
Optionally, the storage medium is further arranged to store program code for performing the steps of: the method comprises the steps that a client detects whether identification information of a network node exists in a local area network or not, wherein the identification information is used for identifying the existence of the network node in the local area network; and when the client detects that the identification information of the network node exists in the local area network, determining that the network node exists in the local area network, wherein the network node sends the identification information.
Optionally, the storage medium is further arranged to store program code for performing the steps of: the network node is a P2P node, and the client detects whether the identification information of the network node exists in the local area network or not through a UPNP protocol, wherein the identification information is information for identifying the existence of the P2P node in the local area network; when the client detects that the identification information of the network node exists in the local area network through the UPNP protocol, the existence of the network node in the local area network is determined, wherein the P2P node sends the identification information through the UPNP protocol.
Optionally, the storage medium is further arranged to store program code for performing the steps of: the method comprises the steps that under the condition that a client accesses an external network through a WIFI network, the client sends an acquisition request command to a background server, wherein the background server judges whether the acquisition request command is a command sent under a preset network or not, if the background server judges that the acquisition request command is the command sent under the preset network, the background server inquires an acquisition address of a network resource of a P2P node and inquires whether the P2P node stores the preset network resource or not through the acquisition address, and when the P2P node stores the preset network resource through the acquisition address inquiry, the background server sends a uniform resource locator of the P2P node; when the client receives the uniform resource locator of the P2P node, sending an acquisition request command to the P2P node, wherein the P2P node responds to the acquisition request command and sends a preset network resource to the client; and when the client does not receive the P2P node, sending an acquisition request command to the CDN network node, wherein the CDN network node responds to the acquisition request command and sends preset network resources to the client.
Optionally, the storage medium is further arranged to store program code for performing the steps of: after the client sends the acquisition request command to the network node, the client sends update data to the P2P node through the background server, wherein the update data is used for updating the content of the network resource, the P2P node updates the content of the network resource according to the update data to obtain a first updated network resource, and sends the first updated network resource to the background server, and the client acquires the first updated network resource through the background server.
Optionally, the storage medium is further arranged to store program code for performing the steps of: under the condition that the client cannot access the external network through the WIFI network, after the client sends an acquisition request command to the network node, the P2P node updates the content of the network resource through the hard disk in an off-line mode to obtain a second updated network resource, sends the second updated network resource to the background server, and the client acquires the second updated network resource through the background server.
The storage medium is further configured to store program code for performing the steps of: the method comprises the steps that a plurality of network nodes are provided, a client sends query commands to the plurality of network nodes, wherein the query commands are commands used for querying whether preset network resources are stored in the network nodes or not, the plurality of network nodes respectively respond to the query commands to obtain a plurality of query results corresponding to the network nodes and respectively send the plurality of query results corresponding to the network nodes to the client, and after the client queries whether the preset network resources are stored in the network nodes or not, the client summarizes the plurality of query results corresponding to the network nodes to obtain a summary result; and the client judges whether a preset query result exists in the summarized result, wherein the preset query result is the query result of the preset network resources stored in the network node, and if the client judges that the preset query result exists in the summarized result, the client sends an acquisition request command to the network node corresponding to the preset query result.
The storage medium is further configured to store program code for performing the steps of: after the client queries whether the network node stores the preset network resources, when the client queries that the network node does not store the preset network resources, the client outputs prompt information that the preset network resources cannot be acquired.
Optionally, in this embodiment, the storage medium may include, but is not limited to: various media capable of storing program codes, such as a U disk, a read only memory ROM, a random access memory RAM, a removable hard disk, a magnetic disk, or an optical disk.
The embodiment of the invention also provides a computer terminal, which can be any computer terminal device in a computer terminal group. Optionally, in this embodiment, the computer terminal may also be replaced with a terminal device such as a mobile terminal.
Optionally, in this embodiment, the computer terminal may be located in at least one network device of a plurality of network devices of a computer network.
Alternatively, fig. 20 is a block diagram of a structure of a computer terminal according to an embodiment of the present invention. As shown in fig. 20, the computer terminal a may include: one or more processors 201 (only one shown), a memory 203, and a transmission device 205.
The memory 203 may be configured to store software programs and modules, such as program instructions/modules corresponding to the method and apparatus in the embodiments of the present invention, and the processor 201 executes various functional applications and data processing by running the software programs and modules stored in the memory 203, that is, implements the above-mentioned method for acquiring network resources. The memory 203 may include high speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 203 may further include memory located remotely from the processor 201, which may be connected to the computer terminal a through a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission device 205 is used for receiving or transmitting data via a network. Examples of the network may include a wired network and a wireless network. In one example, the transmitting device 205 includes a network adapter NIC that is connectable to a router via a network cable to communicate with the internet or a local area network. In one example, the transmission device 205 is a radio frequency RF module, which is used to communicate with the Internet in a wireless manner.
Specifically, the memory 203 is used for storing preset action conditions, information of preset authorized users, and application programs.
The processor 201 may call the information and application stored in the memory 203 via the transmission device to perform the following steps:
optionally, the processor 201 may further execute program code for:
the method comprises the steps that a client detects whether a network node exists in a local area network or not, wherein the network node is a device for storing network resources;
when the client detects that the network node exists in the local area network, the client inquires whether the network node stores preset network resources;
when the client inquires that the network node stores the preset network resource, the client sends an acquisition request command to the network node, wherein the acquisition request command is used for requesting the network node to send the preset network resource to the client;
the client acquires preset network resources.
Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments, and this embodiment is not described herein again.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
The integrated unit in the above embodiments, if implemented in the form of a software functional unit and sold or used as a separate product, may be stored in the above computer-readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing one or more computer devices (which may be personal computers, servers, network devices, etc.) to execute all or part of the steps of the method according to the embodiments of the present invention.
In the above embodiments of the present invention, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the several embodiments provided in the present application, it should be understood that the disclosed client may be implemented in other manners. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one type of division of logical functions, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, units or modules, and may be in an electrical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The foregoing is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present invention, and these modifications and decorations should also be regarded as the protection scope of the present invention.

Claims (16)

1. A method for acquiring network resources is characterized by comprising the following steps:
the method comprises the steps that a client detects whether a network node exists in a local area network, wherein the network node is a device for storing network resources, and the network node is a P2P node;
when the client detects that the network node exists in the local area network, the client inquires whether the network node stores preset network resources;
when the client inquires that the network node stores the preset network resource, the client sends an acquisition request command to the network node, wherein the acquisition request command is used for requesting the network node to send the preset network resource to the client, the acquisition request command is a command for inquiring a download address of the preset network resource under the condition that the client accesses an external network through a WIFI network, and the acquisition request command is a command for inquiring specific content of the preset network resource under the condition that the client cannot access the external network through the WIFI network; wherein, when the client accesses an external network through the WIFI network, the client sending the acquisition request command to the network node includes: when the client receives the uniform resource locator of the P2P node, sending the get request command to the P2P node, wherein the P2P node responds to the get request command and sends the preset network resource to the client; when the client does not receive the uniform resource locator of the P2P node, sending the acquisition request command to a CDN network node, wherein the CDN network node responds to the acquisition request command and sends the preset network resource to the client; and
and the client acquires the preset network resource.
2. The method of claim 1, wherein the client detecting whether the network node exists in the local area network comprises:
the client detects whether identification information of the network node exists in the local area network or not, wherein the identification information is information for identifying the existence of the network node in the local area network; and
when the client detects that the identification information of the network node exists in the local area network, the existence of the network node in the local area network is determined, wherein the network node sends the identification information.
3. The method of claim 1, wherein the client detecting whether the network node exists in the local area network comprises:
the client detects whether the identification information of the P2P node exists in the local area network through a UPNP protocol, wherein the identification information is used for identifying the existence of the P2P node in the local area network; and
when the client detects that the identification information of the P2P node exists in the local area network through the UPNP protocol, the P2P node exists in the local area network, wherein the P2P node sends the identification information through the UPNP protocol.
4. The method of claim 3, wherein in the case that the client accesses an extranet through the WIFI network, the client sending the get request command to the network node further comprises:
the client sends the acquisition request command to a server, wherein the server judges whether the acquisition request command is a command sent under a preset network, if the server judges that the acquisition request command is the command sent under the preset network, the server inquires an acquisition address of the network resource of the P2P node and inquires whether the P2P node stores the preset network resource through the acquisition address, and when the P2P node stores the preset network resource through the acquisition address inquiry, the server sends a uniform resource locator of the P2P node.
5. The method of claim 4,
after the client sends the get request command to the network node, the method further comprises: the client sends update data to the P2P node through the server, wherein the update data is used for updating the content of the network resource, the P2P node updates the content of the network resource according to the update data to obtain a first updated network resource, and sends the first updated network resource to the server,
the client acquiring the preset network resource comprises: and the client acquires the first updated network resource through the server.
6. The method of claim 4, wherein in the event that the client is unable to access an external network through the WIFI network,
after the client sends the get request command to the network node, the method further comprises: the P2P node updates the content of the network resource by hard disk off-line to obtain a second updated network resource, and sends the second updated network resource to the server,
the client acquiring the preset network resource comprises: and the client acquires the second updated network resource through the server.
7. The method of claim 1, wherein the network node is a plurality of nodes,
the client querying whether the network node stores the preset network resource comprises: the client sends a query command to a plurality of network nodes, wherein the query command is a command for querying whether the network nodes store the preset network resources, the network nodes respectively respond to the query command to obtain a plurality of query results corresponding to the network nodes and respectively send the plurality of query results corresponding to the network nodes to the client,
after the client queries whether the network node stores the preset network resource, the method further includes:
the client summarizes a plurality of query results corresponding to the network nodes to obtain a summary result;
the client judges whether a preset query result exists in the summary result, wherein the preset query result is the query result of the preset network resource stored in the network node,
wherein the sending, by the client, the acquisition request command to the network node comprises: and if the client judges that the summary result contains the preset query result, sending the acquisition request command to a network node corresponding to the preset query result.
8. The method according to claim 1, wherein after the client queries whether the network node stores the preset network resource, the method further comprises: when the client inquires that the network node does not store the preset network resource, the client outputs prompt information that the preset network resource cannot be acquired.
9. An apparatus for acquiring network resources, comprising:
the device comprises a detection unit, a processing unit and a processing unit, wherein the detection unit is used for detecting whether a network node exists in a local area network, the network node is a device for storing network resources, and the network node is a P2P node;
the query unit is used for querying whether preset network resources are stored in the network node or not when the network node is detected to exist in the local area network;
a sending unit, configured to send an acquisition request command to the network node when it is queried that the network node stores the preset network resource, where the acquisition request command is used to request the network node to send the preset network resource to a client, where the acquisition request command is a command to query a download address of the preset network resource when the client accesses an external network through a WIFI network, and the acquisition request command is a command to query specific content of the preset network resource when the client cannot access the external network through the WIFI network; and
an obtaining unit, configured to obtain the preset network resource;
wherein the transmitting unit includes: a second sending module, configured to send the acquire request command to the P2P node when the client accesses an external network through the WIFI network and when the client receives a uniform resource locator of the P2P node, where the P2P node responds to the acquire request command and sends the preset network resource to the client; and a third sending module, configured to send the obtaining request command to a CDN network node when the client does not receive the uniform resource locator of the P2P node, where the CDN network node responds to the obtaining request command and sends the preset network resource to the client.
10. The apparatus of claim 9, wherein the detection unit comprises:
the first detection module is used for detecting whether identification information of the network node exists in the local area network or not, wherein the identification information is information used for identifying the existence of the network node in the local area network; and
a first determining module, configured to determine that the network node exists in the local area network when it is detected that the identification information of the network node exists in the local area network, where the network node sends the identification information.
11. The apparatus of claim 9, wherein the detection unit comprises:
a second detecting module, configured to detect, by using a UPNP protocol, whether identification information of the P2P node exists in the local area network, where the identification information is information for identifying that the P2P node exists in the local area network; and
a second determining module, configured to determine that the P2P node exists in the local area network when it is detected that the identification information of the P2P node exists in the local area network through the UPNP protocol, where the P2P node sends the identification information through the UPNP protocol.
12. The apparatus of claim 11, wherein the sending unit further comprises:
a first sending module, configured to send the acquire request command to a server when accessing an external network through the WIFI network, where the server determines whether the acquire request command is a command issued under a preset network, and if the server determines that the acquire request command is a command issued under the preset network, the server queries an acquire address of the network resource of the P2P node, and queries whether the P2P node stores the preset network resource through the acquire address, and when querying that the P2P node stores the preset network resource through the acquire address, the server sends a uniform resource locator of the P2P node.
13. The apparatus of claim 12,
the sending unit is further configured to send, by the server, update data to the P2P node after the client sends the acquisition request command to the network node, where the update data is data for updating content of the network resource, the P2P node updates the content of the network resource according to the update data to obtain a first updated network resource, and sends the first updated network resource to the server, and the acquiring unit is configured to acquire the first updated network resource by the server.
14. The apparatus of claim 12,
the device further comprises an updating unit, configured to, after the obtaining request command is sent to the network node, enable the P2P node to update the content of the network resource by using a hard disk offline to obtain a second updated network resource, and send the second updated network resource to the server, in a case where the client cannot access an external network through the WIFI network,
the obtaining unit is configured to obtain the second updated network resource through the server.
15. A computer-readable storage medium comprising a stored program, wherein the program when executed performs the method of any of claims 1 to 8.
16. An electronic device comprising a memory and a processor, characterized in that the memory has stored therein a computer program, the processor being arranged to execute the method of any of claims 1 to 8 by means of the computer program.
CN201610140370.4A 2016-03-11 2016-03-11 Method and device for acquiring network resources Active CN105827694B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610140370.4A CN105827694B (en) 2016-03-11 2016-03-11 Method and device for acquiring network resources

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610140370.4A CN105827694B (en) 2016-03-11 2016-03-11 Method and device for acquiring network resources

Publications (2)

Publication Number Publication Date
CN105827694A CN105827694A (en) 2016-08-03
CN105827694B true CN105827694B (en) 2020-06-16

Family

ID=56987841

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610140370.4A Active CN105827694B (en) 2016-03-11 2016-03-11 Method and device for acquiring network resources

Country Status (1)

Country Link
CN (1) CN105827694B (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108650553A (en) * 2018-03-28 2018-10-12 苏州科可瑞尔航空技术有限公司 Vehicle entertainment order method, device, computer equipment and storage medium
CN110895583B (en) * 2018-09-12 2023-05-30 阿里巴巴集团控股有限公司 Method, device and system for acquiring data resources
CN111435946A (en) * 2019-01-15 2020-07-21 阿里巴巴集团控股有限公司 Method, device, terminal equipment and system for downloading resources
CN111628878A (en) * 2019-02-27 2020-09-04 北京奇虎科技有限公司 Fault positioning method, device and system based on multi-stage network nodes
CN110113654A (en) * 2019-04-10 2019-08-09 深圳市宏辉智通科技有限公司 A kind of P4P technical application method based on local area network
CN110677489B (en) * 2019-09-30 2022-07-12 北京奇艺世纪科技有限公司 Media resource processing method, device, system and storage medium
CN113746884B (en) * 2020-05-29 2022-11-08 北京金山云网络技术有限公司 Multimedia resource transmission method, device and system
CN111901408B (en) * 2020-07-24 2021-08-24 腾讯科技(深圳)有限公司 Content recommendation method and device in offline state and computer program product

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102185920A (en) * 2011-05-10 2011-09-14 奇智软件(北京)有限公司 Network-based downloading method and system, and terminal
CN102694831A (en) * 2011-03-25 2012-09-26 中国电信股份有限公司 Data compensation method of streaming media of mobile terminal and data compensation system thereof, and content distribution network

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101030873A (en) * 2007-02-15 2007-09-05 深圳市迅雷网络技术有限公司 Method and system for downloading data
US9467202B2 (en) * 2012-05-10 2016-10-11 Lg Electronics Inc. Method and apparatus for downloading content using NFC
CN104869162A (en) * 2015-05-20 2015-08-26 广东欧珀移动通信有限公司 Method of resource downloading and apparatus thereof

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102694831A (en) * 2011-03-25 2012-09-26 中国电信股份有限公司 Data compensation method of streaming media of mobile terminal and data compensation system thereof, and content distribution network
CN102185920A (en) * 2011-05-10 2011-09-14 奇智软件(北京)有限公司 Network-based downloading method and system, and terminal

Also Published As

Publication number Publication date
CN105827694A (en) 2016-08-03

Similar Documents

Publication Publication Date Title
CN105827694B (en) Method and device for acquiring network resources
JP6941679B2 (en) Network slice selection method, user equipment, and network equipment
CN103069755B (en) Use the method and system that the instant message of multiple client instance transmits
CN103716391A (en) Implementation method for content caching and router
US20150055509A1 (en) Communications device utilizing a central discovery mechanism, and respective method
CN110381131B (en) Method for realizing MEC node identification, mobile terminal, server and storage medium
JP6580132B2 (en) Method and apparatus for providing information associated with media content
CN103944994A (en) Distributed resource obtaining method and device
CN105743958A (en) Terminal-to-terminal communication method and device
CN101252590B (en) Apparatus, system and method for distributing stream medium content
CN113890895A (en) Message pushing method and device, storage medium and electronic device
CN103109511A (en) Partial object distribution in content delivery network
CN111263338A (en) Network distribution method of Bluetooth Mesh network and related network distribution equipment and system
US10715377B2 (en) Domain name services servers management to share data efficiently
CN102404616A (en) Method and system for pushing data cloud based on digital television network
CN104580084A (en) Method, terminals and system for sharing multimedia file
CN102970391A (en) Domain name query processing method, server and system
CN109347904B (en) Method and system for establishing communication link
CN111262779A (en) Method, device, server and system for acquiring data in instant messaging
CN114338383B (en) Simplified configuration method and system for video equipment
CN113285920B (en) Service access method, device, equipment and storage medium
CN110677489B (en) Media resource processing method, device, system and storage medium
CN115004657B (en) Addressing method, addressing system and addressing device
CN114051155A (en) Video stream acquisition method, server and storage medium
CN102761625A (en) Method and system for registering domain name for video monitoring terminal

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant