CN114338626A - Streaming media playing system, method, device, equipment and readable storage medium - Google Patents

Streaming media playing system, method, device, equipment and readable storage medium Download PDF

Info

Publication number
CN114338626A
CN114338626A CN202111388937.7A CN202111388937A CN114338626A CN 114338626 A CN114338626 A CN 114338626A CN 202111388937 A CN202111388937 A CN 202111388937A CN 114338626 A CN114338626 A CN 114338626A
Authority
CN
China
Prior art keywords
server
node
streaming media
servers
player
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111388937.7A
Other languages
Chinese (zh)
Inventor
连陈琳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wangsu Science and Technology Co Ltd
Original Assignee
Wangsu Science and Technology 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 Wangsu Science and Technology Co Ltd filed Critical Wangsu Science and Technology Co Ltd
Priority to CN202111388937.7A priority Critical patent/CN114338626A/en
Publication of CN114338626A publication Critical patent/CN114338626A/en
Pending legal-status Critical Current

Links

Images

Abstract

The application discloses a streaming media playing system, a streaming media playing method, a streaming media playing device, streaming media playing equipment and a readable storage medium, wherein the streaming media playing system comprises at least two P2P servers, at least two P2P nodes and a player. Each P2P server is used to manage different stream media resources, one P2P node and part of P2P servers establish network connection. During the process of playing the streaming media, the player determines a target P2P server from at least two P2P servers and requests a neighbor node from the target P2P server. And then, establishing network connection with the neighbor node, and acquiring and playing the target streaming media resource from the neighbor node. By adopting the scheme, each P2P server only manages part of streaming media resources and part of P2P nodes and only serves part of players, even if part of P2P servers are abnormal, only part of players are affected, collective faults are not easy to occur, the reliability is high, and the anti-interference capability is strong.

Description

Streaming media playing system, method, device, equipment and readable storage medium
Technical Field
The present application relates to the field of streaming media playing technologies, and in particular, to a streaming media playing system, method, apparatus, device, and readable storage medium.
Background
With the rapid development of internet technology, more and more users watch streaming media through the internet. Streaming media is media data that can be played while being downloaded. Meanwhile, Peer-to-Peer (P2P) is also widely used in streaming media playing as a popular networking technology.
In the process of playing the streaming media based on P2P, the player requests the P2P server to allocate a P2P node, i.e., a neighbor node. And after the player establishes network connection with the neighbor node, acquiring and playing the streaming media. In order to prevent the P2P server from being abnormal and unable to provide service, the primary and secondary P2P servers are usually set, and when the primary P2P server is abnormal, the secondary P2P server provides service. The abnormality includes network jitter, power failure of the machine room, and the like.
In the P2P networking, all data are concentrated on the primary P2P server, and meanwhile, the standby P2P server has the same data. When the primary and standby P2P servers are abnormal, all players cannot watch the streaming media. Obviously, the streaming media playing system based on the P2P networking mode has poor stability and weak interference resistance.
Disclosure of Invention
The embodiment of the application provides a streaming media playing system, a streaming media playing method, a streaming media playing device, streaming media playing equipment and a readable storage medium, wherein each P2P server in a plurality of P2P servers only manages part of streaming media resources, and not all the streaming media resources are managed in a centralized manner by a main P2P server, even if part of the P2P servers are abnormal, only part of the players are affected, and the system, the method, the device and the equipment are not easy to have a centralized fault, and are high in reliability and strong in anti-interference capability.
In a first aspect, an embodiment of the present application provides a streaming media playing system, including:
at least two P2P servers, at least two P2P nodes, and a player, wherein:
different P2P servers of the at least two P2P servers are used for managing different streaming media resources;
each P2P node of the at least two P2P nodes establishing a network connection with a subset of P2P servers of the at least two P2P servers;
the player is used for determining a target P2P server from the at least two P2P servers, sending a node acquisition request to the target P2P server to request a neighbor node, acquiring a target streaming media resource from the neighbor node after establishing network connection with the neighbor node, and playing the target streaming media resource
In a second aspect, an embodiment of the present application provides a streaming media playing method, including:
a first P2P server receives a node acquisition request from a player, wherein the node acquisition request carries a target identifier of a target streaming media resource, the first P2P server is determined by the player from at least two P2P servers included in a streaming media playing system, and different P2P servers in the at least two P2P servers manage different streaming media resources;
the first P2P server inquires a corresponding relation table according to the target identification to determine a neighbor node from the P2P nodes managed by the first P2P server, the neighbor node stores the target streaming media resource, and the corresponding relation table stores the corresponding relation between the node identification of the P2P node managed by the first P2P server and the resource identification of the streaming media resource;
the first P2P server sends a node acquisition response to the player, wherein the node acquisition response is used for indicating the neighbor nodes.
In a third aspect, an embodiment of the present application provides a streaming media playing method, including:
a first P2P node receives a connection establishment request from a player, the first P2P node is a neighbor node selected by a first P2P server for the player, the first P2P server is determined by the player from at least two P2P servers included in a streaming media playing system, and different P2P servers of the at least two P2P servers manage different streaming media resources;
the first P2P node establishes network connection with the player;
the first P2P node sends a target streaming media resource to the player based on the network connection.
In a fourth aspect, an embodiment of the present application provides a streaming media playing apparatus, which is integrated on a first P2P server, and the apparatus includes:
a receiving module, configured to receive a node acquisition request from a player, where the node acquisition request carries a target identifier of a target streaming media resource, and the first P2P server is determined by the player from at least two P2P servers included in a streaming media playing system, and different P2P servers of the at least two P2P servers manage different streaming media resources;
a processing module, configured to query a correspondence table according to the target identifier, so as to determine a neighbor node from the P2P node managed by the first P2P server, where the neighbor node stores the target streaming media resource, and the correspondence table stores a correspondence between a node identifier of the P2P node managed by the first P2P server and a resource identifier of the streaming media resource;
a sending module, configured to send a node acquisition response to the player, where the node acquisition response is used to indicate the neighbor node.
In a fifth aspect, an embodiment of the present application provides a streaming media playing apparatus, which is integrated on a first P2P node, and includes:
a receiving module, configured to receive a connection establishment request from a player, where the first P2P node is a neighbor node selected by a first P2P server for the player, the first P2P server is determined by the player from at least two P2P servers included in a streaming media playing system, and different P2P servers of the at least two P2P servers manage different streaming media resources;
the processing module is used for establishing network connection with the player;
a sending module, configured to send a target streaming media resource to the player based on the network connection.
In a sixth aspect, an embodiment of the present application provides an electronic device, including: a processor, a memory and a computer program stored on the memory and executable on the processor, the processor executing the computer program to cause the electronic device to implement the method as described above in the second aspect or in various possible implementations of the second aspect.
In a seventh aspect, an embodiment of the present application provides an electronic device, including: a processor, a memory and a computer program stored on the memory and executable on the processor, the processor executing the computer program to cause the electronic device to implement the method according to the third aspect or the various possible implementations of the third aspect.
In an eighth aspect, embodiments of the present application provide a computer-readable storage medium, in which computer instructions are stored, and when executed by a processor, the computer instructions are used to implement the method according to the second aspect or various possible implementation manners of the second aspect.
In a ninth aspect, embodiments of the present application provide a computer-readable storage medium, in which computer instructions are stored, and when executed by a processor, the computer instructions are used to implement the method according to the third aspect or various possible implementation manners of the third aspect.
In a tenth aspect, embodiments of the present application provide a computer program product including a computer program, which when executed by a processor implements the method according to the second aspect or various possible implementations of the second aspect.
In an eleventh aspect, embodiments of the present application provide a computer program product including a computer program, which when executed by a processor, implements the method according to the third aspect or various possible implementations of the third aspect.
The streaming media playing system comprises at least two P2P servers, at least two P2P nodes and a player. Wherein, each P2P server is deployed in different regions or different rooms for managing different streaming media resources, and one P2P node and part of P2P servers establish network connection. During the process of playing the streaming media, the player determines a target P2P server from at least two P2P servers and requests a neighbor node from the target P2P server. And then, establishing network connection with the neighbor node, and acquiring and playing the target streaming media resource from the neighbor node. By adopting the scheme, each P2P server only manages part of streaming media resources and part of P2P nodes and only serves part of players, even if part of P2P servers are abnormal, only part of players are affected, collective faults are not easy to occur, the reliability is high, the anti-interference capability is strong, and the defects that the connection of punching holes is unsuccessful and the service performance is greatly reduced due to the simultaneous abnormality of the main cluster and the standby cluster are avoided. Moreover, because each P2P server manages only a portion of the streaming media resource, the load pressure on each P2P server is less. In addition, when the number of players is greatly increased, the method can be expanded in a mode of adding the P2P server, the position of the added P2P server does not need to be specified, the expansion speed is high, and thermal expansion can be achieved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic structural diagram of a conventional streaming media playing system;
fig. 2 is a schematic architecture diagram of a streaming media playing system provided in an embodiment of the present application;
fig. 3 is a flowchart of a streaming media playing method provided by an embodiment of the present application;
fig. 4 is a schematic diagram of a streaming media playing apparatus according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
To make the objects, technical solutions and advantages of the present application more clear, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
The existing streaming media playing system generally comprises a P2P server, a P2P node and the like. The P2P server is responsible for recommending neighbor nodes to the player, managing the streaming media resources owned by each P2P node, helping to make hole information interaction, and the like. Wherein, the punching means: after receiving the node acquisition request of the player, the P2P server indicates the neighbor node to the player, and the player and the neighbor node establish network connection. The P2P node is responsible for providing the player with streaming media resources after the hole is made successfully.
The streaming media playing system comprises a main P2P server and a standby P2P server, wherein the main P2P server and the standby P2P server have a large amount of same data, and manage a large amount of streaming media resources simultaneously. Fig. 1 is a schematic structural diagram of a conventional streaming media playing system.
Referring to fig. 1, the primary P2P server includes one or more servers, the primary P2P server is also referred to as a primary cluster, the backup P2P server includes one or more servers, and the backup P2P server is also referred to as a backup cluster.
The P2P node is registered in the primary P2P server. When the user watches the streaming media through the player, a node acquisition request is initiated to the main P2P server to request the neighbor nodes. When the primary P2P server is abnormal, the player requests the neighbor node through the standby P2P server. Only the P2P nodes are shown establishing network connections with the master P2P server.
In the architecture shown in fig. 1, streaming media resources are stored in each P2P node, and all the streaming media resources are managed by the active-standby P2P server. Furthermore, in order to prevent the master cluster from being abnormally jittered, a plurality of backup clusters may be provided. Because the number of clusters (including the main cluster and the standby cluster) is always limited, a situation that the main cluster and the standby cluster are abnormal at the same time may occur, and at this time, almost all players cannot normally watch streaming media. Obviously, the streaming media playing system with centralized data storage has weak anti-interference capability and poor stability.
When the number of players is greatly increased and the capacity of the server needs to be increased, the P2P server must be added to the active/standby cluster at the same time. Moreover, the newly added P2P server must be a P2P server near the main cluster, for example, the newly added P2P server is a server in a machine room near the main cluster. Therefore, the expansibility of the streaming media playing system stored in the data set is poor.
Based on this, embodiments of the present application provide a streaming media playing system, a method, an apparatus, a device, and a readable storage medium, where each P2P server in the streaming media playing system only manages part of streaming media resources, rather than managing all streaming media resources in a centralized manner by the active and standby P2P servers, even if part of the P2P servers are abnormal, only part of players are affected, so that a collective fault is not likely to occur, and the streaming media playing system, the method, the apparatus, the device, and the readable storage medium are high in reliability and strong in anti-interference capability.
Fig. 2 is a schematic architecture diagram of a streaming media playing system provided in an embodiment of the present application. Referring to fig. 2, a streaming media playing system provided in the embodiment of the present application includes: at least two P2P servers 21, at least two P2P nodes 22, and a player 23.
Generally, the streaming media playing scene includes on-demand, live and download, and the streaming media playing system provided by the embodiment of the application can be applied to live, on-demand or download scenes.
The networking mode provided by the embodiment of the application can be called as distributed networking. In the distributed networking, the P2P servers 21 are deployed dispersedly, and can be deployed in different regions, different machine rooms, and the like. Each P2P server manages a portion of the streaming media asset. For example, the streaming media playing system has 8 streaming media resources in total, and the Resource identifier is, for example, a Uniform Resource Locator (URL) or a hash (hash) value calculated based on the URL. There are 4P 2P servers 21, and each P2P server 21 manages 2 streaming media resources. Because each P2P server 21 only manages part of streaming media resources, it is not necessary to manage all streaming media resources as the active/standby cluster in the active/standby architecture, and therefore, the pressure of the P2P server 21 is reduced.
The P2P node 22 may be a set-top box, router, optical modem, or the like, also referred to as a box, which is the device that actually stores the streaming media resource. A P2P node 22 establishes network connection with a part of P2P servers 21 in the streaming media playing system, for example, each P2P node 22 establishes network connection with a P2P server 21, and one P2P server 21 manages 2P 2P nodes 22; for another example, a P2P node 22 establishes network connections with two P2P servers 21, at which time a P2P node 22 can serve the two P2P servers 21. Since each P2P node 22 only connects a portion of the P2P servers 21, the number of P2P nodes 22 managed by the P2P servers 21 is relatively small, further reducing the stress on the P2P servers 21.
After the streaming media playing system is set up, initially, the P2P node 22 randomly selects one or two P2P servers 21 from the P2P servers 21 and establishes network connection. Alternatively, the P2P node 22 selects the P2P servers 21 according to some rule to ensure that not too many P2P nodes are under each P2P server 21. After a P2P node 22 establishes a network connection with the P2P server 21, it records the information of the P2P server 21. When the power failure occurs in the P2P node 22, after the power is restored, the original P2P server is selected according to the recorded information to establish network connection.
The player 23 determines a target P2P server from at least two P2P servers 21 according to a preset rule, and sends a node acquisition request to the target P2P server to request neighbor nodes. After the target P2P server indicates the neighbor node to the player, the player 23 establishes network connection with the neighbor node, and acquires the target streaming media resource from the neighbor node and plays it. For example, in the architecture shown in fig. 2, the IP addresses of the P2P servers from left to right are IP1, IP2, IP3, and IP4 in sequence, the identifiers of the P2P nodes from left to right are node 1-node 8 in sequence, the player 23 requests to play the streaming media resource whose resource identifier is URL1, determines that the IP address of the target P2P server is IP1 according to URL1, sends a neighbor node acquisition request to the P2P server whose IP address is IP1, determines that the neighbor node is node1 in the P2P server whose IP address is IP1, indicates the node1 to the player 23, and after the player 23 establishes network connection with the node1, acquires the streaming media resource indicated by URL1 from the node1 and plays the streaming media resource.
For another example, the player 23 requests to play the streaming media resource with the resource identifier of URL3, and determines that the IP address of the target P2P server is IP3 according to URL3, then sends a neighbor node acquisition request to the P2P server with the IP address of IP3, and the P2P server with the IP address of IP3 determines that the neighbor node is node3, then indicates the node3 to the player 23, and after the player 23 establishes network connection with the node3, acquires the streaming media resource corresponding to URL3 from the node3 and plays the streaming media resource.
In the above embodiment, after the streaming media playing system is built, initially, all the P2P nodes are empty and no streaming media resource is stored. When the player 23 requests to play a streaming media resource indicated by a certain URL, for example, the streaming media resource indicated by the URL1, the URL1 is calculated according to a preset rule, and the IP address of the target P2P server is determined to be IP1 according to the calculation result, then the neighbor node is requested from the P2P server 21 with the IP address of IP 1. The P2P server 21 finds that none of the P2P nodes store the streaming media resource corresponding to the URL1, therefore, the P2P server 21 selects one P2P node 22, for example, the node1 obtains the streaming media resource indicated by the URL1 from the source station and stores the streaming media resource, and meanwhile, the P2P server 21 with the IP address IP1 stores the correspondence between the URL1 and the node 1. Thus, when the player 23 requesting viewing of the streaming media resource corresponding to the URL1 is further requested, the P2P server 21 having the IP address IP1 can indicate the node1 thereto. In the scheme, the same rule is preset on all players, and the same preset rule is used for accessing the P2P server 21, so that node acquisition requests for the same streaming media resource can be guaranteed to be sent to the same P2P server 21, that is, node acquisition requests sent to the same P2P server are all requesting neighbor nodes for the same streaming media resource, and therefore the service quality of the P2P server is guaranteed not to be reduced in a distributed networking mode.
In the above embodiment, a set of rules is preset on all players 23 for determining the target P2P server from at least two P2P servers 21 according to the resource identifier. For example, the preset rules are: the resource identifier is a URL, the remainder is obtained by dividing the last character of the URL by 5, the remainder is 1, the streaming media resource corresponding to the URL is managed by the P2P server 21 with the IP address of IP1, and the remainder is 2, the streaming media resource corresponding to the URL is managed by the P2P server 21 with the IP address of IP 2.
In the streaming media playing system described in the above embodiment, when part of the P2P servers 21 fails, only the failed P2P server needs to be replaced.
The streaming media playing system provided by the embodiment of the application comprises at least two P2P servers, at least two P2P nodes and a player. Wherein, each P2P server is deployed in different regions or different rooms for managing different streaming media resources, and one P2P node and part of P2P servers establish network connection. During the process of playing the streaming media, the player determines a target P2P server from at least two P2P servers and requests a neighbor node from the target P2P server. And then, establishing network connection with the neighbor node, and acquiring and playing the target streaming media resource from the neighbor node. By adopting the scheme, each P2P server only manages part of streaming media resources and part of P2P nodes and only serves part of players, even if part of P2P servers are abnormal, only part of players are affected, collective faults are not easy to occur, the reliability is high, the anti-interference capability is strong, and the defects that the connection of punching holes is unsuccessful and the service performance is greatly reduced due to the simultaneous abnormality of the main cluster and the standby cluster are avoided. Moreover, because each P2P server manages only a portion of the streaming media resource, the load pressure on each P2P server is less. In addition, when the number of players is greatly increased, the method can be expanded in a mode of adding the P2P server, the position of the added P2P server does not need to be specified, the expansion speed is high, and thermal expansion can be achieved.
In the above embodiment, the player knows the IP address of each P2P server 21 in the streaming media playing system. For example, the correspondence between the P2P server and the IP address is set in advance. For another example, referring to fig. 2, the streaming media playing System further includes a Domain Name System (DNS) server 24, and the DNS server 24 establishes network connections with each P2P server 21 of the at least two P2P servers 21, each P2P node 22 of the at least two P2P nodes 22, and the player 23. The DNS server 24 periodically generates an IP list (IP list) in which the IP addresses of the P2P servers 21 of the at least two P2P servers 21 are stored, and sends the IP list (IP list) to the player 23, each P2P node 22 of the at least two P2P nodes 22, and each P2P server 21 of the at least two P2P servers 21. Fig. 2 only illustrates the connection relationship between the DNS server 24 and the P2P server 21 and the player 23, and does not illustrate the connection relationship between the DNS server 24 and the P2P node 22.
For clarity, the IP list at the first time is referred to as a first IP list, the IP list at the second time is referred to as a second IP list, the first time and the second time are two adjacent times, and the first time is earlier than the second time. When the first IP list and the second IP list are different, the situation that the P2P server 21 is removed or newly added by the streaming media playing system is described, which also indicates that the storage location of the streaming media resource in the streaming media playing system is changed. For example, initially, there are 4P 2P servers 21 in the streaming media playing system, the IP addresses are IP1, IP2, IP3 and IP4 in turn, each P2P server in the 4P 2P servers 21 manages 2 streaming media resources, which are URL1 and URL2, URL3 and URL4, URL5 and URL6, URL7 and URL8 in turn. Subsequently, a P2P server 21 with an IP address of IP5 is added, and the URL3 originally managed by the P2P server 21 with an IP address of IP2 and the URL8 managed by the P2P server 21 with an IP address of IP4 are migrated to the added P2P server 21.
From the perspective of the P2P server 21, when the storage location of the streaming media resource in the streaming media playing system changes, after receiving a node acquisition request from the player each time, if the neighbor node cannot be determined, a query request is sent to the P2P server in the second IP list to instruct the P2P server in the second IP list to determine the neighbor node. In addition, the P2P server 21 also monitors the number of its P2P nodes, the number of players currently on line, the number of P2P nodes of the entire streaming media player, and the number of players currently on line, and determines whether to schedule the P2P nodes from other P2P servers 21 based on these monitored data.
From the perspective of the P2P node 22, when the storage location of the streaming media resource in the streaming media playing system changes, if the previously connected P2P server 21 is removed or fails, it needs to switch to another P2P server 21.
By adopting the scheme, the DNS server regularly sends an IP list to the P2P server, the P2P node and the player so that the P2P server searches neighbor nodes and the P2P node determines whether to switch the P2P server and determine a target server by the player, and a low-cost distributed P2P server cluster is built, so that the flexible operation and maintenance of the streaming media playing system and the expansion of the streaming media playing system are realized on the premise of ensuring the service quality.
Fig. 3 is a flowchart of a streaming media playing method provided by an embodiment of the present application. The present embodiment is described from the point of view of player, P2P server, and P2P node interaction. The embodiment comprises the following steps:
301. the first P2P server receives a node acquisition request from the player.
The node acquires a target identifier of a target streaming media resource carried by a request, the first P2P server is determined by the player from at least two P2P servers included in a streaming media playing system, and different P2P servers in the at least two P2P servers manage different streaming media resources.
In this embodiment of the application, the resource identifier of the streaming media resource may be a URL, a hash (hash) value calculated based on the URL, or the like. When a user requests to view a target streaming media resource, a target P2P server, hereinafter referred to as a first P2P server, is determined from P2P servers included in the streaming media playing system. And then, sending a node acquisition request carrying the target identification of the target streaming media resource to the first P2P server to request the neighbor nodes. For example, referring to fig. 2, when the target streaming media resource is the streaming media resource indicated by URL1, the first P2P server is the P2P server with IP1 as the IP address, and the target is identified as URL 1; when the target streaming media resource is the streaming media resource indicated by the URL3, the first P2P server is a P2P server with an IP address of IP3, and the target is identified as URL 3.
302. And the first P2P server queries a corresponding relation table according to the target identification so as to determine neighbor nodes from the P2P nodes managed by the first P2P server.
The target streaming media resource is stored on a neighboring node, and the corresponding relation table stores the corresponding relation between the node identifier of the P2P node managed by the first P2P server and the resource identifier of the streaming media resource.
Illustratively, the first P2P server maintains a correspondence table storing the correspondence between node id and resource id, for example, the correspondence between node1 and URL1, which identifies that the streaming media resource corresponding to URL1 is stored on node 1.
After receiving the node acquisition request carrying the target identifier, the first P2P server queries the corresponding relationship by using the target identifier, and can determine the neighbor node, i.e., the P2P node storing the streaming media resource indicated by the target identifier.
303. The first P2P server sends a node acquisition response to the player, wherein the node acquisition response is used for indicating the neighbor nodes.
Accordingly, the player receives the node acquisition response.
304. The player sends a connection establishment request to the first P2P node.
Accordingly, the first P2P node receives a connection establishment request from the player.
Illustratively, after receiving the node acquisition response, the player determines a neighboring node, which is also referred to as a first P2P node. The player then sends a connection establishment request to the first P2P node.
305. The first P2P node establishes a network connection with the player.
306. The first P2P node sends a target streaming media resource to the player based on the network connection.
307. The player plays the target streaming media resource.
The streaming media playing method provided by the embodiment of the application is suitable for a player comprising at least two P2P servers and at least two P2P nodes. Wherein, each P2P server is used for managing different stream media resources, and a P2P node and a partial P2P server establish network connection. During the process of playing the streaming media, the player determines a target P2P server from at least two P2P servers and requests a neighbor node from the target P2P server. And then, establishing network connection with the neighbor node, and acquiring and playing the target streaming media resource from the neighbor node.
By adopting the scheme, each P2P server only manages part of streaming media resources and part of P2P nodes and only serves part of players, even if part of P2P servers are abnormal, only part of players are affected, collective faults are not easy to occur, the reliability is high, the anti-interference capability is strong, and the defects that the connection of punching holes is unsuccessful and the service performance is greatly reduced due to the simultaneous abnormality of the main cluster and the standby cluster are avoided.
Optionally, in the above embodiment, the first P2P node is a P2P node that establishes a network connection with the first P2P server and is capable of providing the streaming media resource indicated by the target identifier. Before the first P2P node receives the connection establishment request from the player, it also receives a first IP list from the DNS server, the first IP list indicating the IP address of each P2P server of the at least two P2P servers. Thereafter, the first P2P node selects a first P2P server from the first IP list and establishes a network connection.
For example, when initially networking, the first P2P node randomly selects one P2P server from a plurality of P2P servers and establishes network connection, and then records the related information of the first P2P server. The first P2P server records the corresponding relationship between the node identification of the first P2P node and the resource identification of the streaming media resource. For another example, after the first P2P node establishes a network connection with the first P2P server, the connection with the first P2P server is disconnected due to a power failure or the like. When the first P2P is powered on, the first P2P server is determined according to the recorded information and network connection is established with the server.
By adopting the scheme, the first P2P node selects the first P2P server from the first IP list and establishes network connection, so that the first P2P node becomes a P2P node which is managed by the first P2P server, and the first P2P server is convenient to manage the streaming media resources of the first P2P node.
Optionally, based on the networking manner of the streaming media playing system shown in fig. 2 and the streaming media playing method shown in fig. 3, in the embodiment of the present application, a scenario in which a failed P2P server in the streaming media playing system is replaced, the streaming media playing system is extended, or the P2P server is reduced due to a cost problem is also considered, and the scenario is described below.
When a failed P2P server occurs in the streaming media playing system, the failed P2P server is removed. At this time, the P2P node under the failed P2P server needs to switch to other P2P servers, i.e., establish network connection with other P2P servers. The DNS periodically sends IP lists to each P2P node, and each P2P node determines whether to switch to other P2P servers according to the IP lists.
Taking the first P2P node as an example, the first P2P node receives the first IP list from the DNS server at a first time, and receives the second IP list from the DNS server at a second time after establishing a network connection with the first P2P server in the first IP list. The first IP list and the second IP list are IP lists transmitted by the DNS server two times in proximity. The first P2P node determines whether there is a first P2P server in the second IP list, and if the second IP list includes the IP address of the first P2P server as well as the first IP list, it indicates that the first P2P server is not removed, and the first P2P node does not need to switch to another P2P server. If the first P2P server does not exist in the second list, it indicates that the first P2P server has been removed from the streaming media playing system, and at this time, the first P2P node selects the target P2P server from the second IP list and establishes a connection with it.
For example, the first P2P node randomly selects an IP address from the second IP list and establishes a network connection with the P2P server corresponding to the IP address.
As another example, the first P2P node may establish a network connection with the P2P server from the second IP list for the least loaded P2P server.
By adopting the scheme, when the P2P server fails, the P2P node of the failed P2P server is switched to other P2P servers, and the service quality of the streaming media playing system is ensured.
Optionally, in the foregoing embodiment, when the first P2P node determines, according to the first IP list and the second IP list, a failed P2P server in the streaming media playing system and adds a P2P server, the first P2P node takes the added P2P server as a target P2P server and establishes a network connection with the server.
For example, the first P2P node is a P2P node that establishes a network connection with the first P2P server, and after the first P2P server fails, the IP address of the first P2P server does not exist in the second IP list and a P2P server is added. Assuming that the first IP list is represented by IP list1, the second IP list is represented by IP list2, IP list1 comprises IP1-IP4, IP list2 comprises IP2-IP5, the first P2P node establishes network connection with a P2P server corresponding to IP1, and the P2P server fails. The first P2P node determines the intersection of IP list1 and IPlist2, which contains IP2-IP 4. Then, the first P2P node determines the complement of the intersection from IP list2, where the complement includes IP5, and then the first P2P node establishes network connection with the P2P server corresponding to IP 5.
By adopting the scheme, if the P2P server of one P2P node fails, the newly added P2P server in the streaming media playing system is accessed, so that the load of other P2P servers is ensured not to be overlarge, and the purpose of improving the service quality of the streaming media playing system is realized.
Optionally, in the foregoing embodiment, after the first P2P node establishes a network connection with the target P2P server, the first P2P node further sends indication information to the target P2P server to indicate that the target P2P server establishes a corresponding relationship, where the corresponding relationship is a corresponding relationship between a node identifier of the first P2P node and a resource identifier of a streaming media resource carried by the first P2P node.
Continuing with the above example, if the first P2P node determines that the P2P server corresponding to the IP5 is the target P2P server, it actively reports the resource identifier of its streaming media resource to the P2P server corresponding to the IP5, and the P2P server corresponding to the IP5 establishes the correspondence between the first P2P node and the resource identifier. Thereafter, the P2P server corresponding to IP5 owns the information owned by the failed first P2P server, thereby replacing the failed first P2P server. Assuming that the first P2P node bears the streaming media resource corresponding to the URL1, when the player requests to play the streaming media resource corresponding to the URL1, the player sends a node acquisition request to the P2P server corresponding to the IP5, and the P2P server with the IP address of IP5 performs hole punching, that is, determines a neighbor node having the streaming media resource indicated by the URL1, and indicates the neighbor node to the player. The neighbor node is the first P2P node that is switched to the P2P server corresponding to IP 5.
By adopting the scheme, the target P2P server is used for replacing the fault P2P server, the player can acquire and play the streaming media resource when the P2P server is in fault, and the service quality of the streaming media playing system is improved.
In a scenario of expanding a streaming media playing system, the DNS server adds an IP address of a newly added P2P server to an IP list, and sends the IP list to a P2P server, a P2P node, and a player. When the P2P server in the streaming media playing system is reduced due to cost, the DNS server deletes the IP address of the P2P server to be removed from the IP list.
In the two scenarios, a new P2P node may be added or a P2P node may be switched from one P2P server to another P2P server, and at this time, the network architecture of the streaming media playing system changes. The network architecture changes, also referred to as storage locations of streaming media resources change. For example, the streaming media resource corresponding to the URL1 is originally stored in the node1 and managed by the P2P server corresponding to the IP 1. After the node1 is switched to the P2P server corresponding to the IP3, that is, after the network architecture is changed, the streaming media resource corresponding to the URL1 is managed by the P2P server corresponding to the IP 3.
The P2P node can determine whether the change of the network architecture occurs by comparing the first IP list with the second IP list, and switch the P2P server. For example, if the IP1 exists in the first IP list, the node1 originally establishes network connection with the P2P server corresponding to the IP1, and if the IP1 does not exist in the second IP list, the P2P node determines the intersection of the first IP list and the second IP list, determines the complement of the intersection from the second IP list, and if the complement is empty, randomly selects an IP address from the second IP list, and establishes network connection with the P2P server corresponding to the IP address. If the complementary set is not empty, an IP address is selected from the complementary set and the P2P server corresponding to the IP address establishes network connection.
For the P2P server, information interaction can be performed between P2P servers in the streaming media playing system, the first P2P server determines a first total amount and a second total amount of the first P2P server, the first total amount is used for indicating the total amount of P2P nodes which establish network connection with the first P2P server, and the second total amount is used for indicating the total amount of players which are provided with services and are online by the first P2P server. Thereafter, the first P2P server sends the first total amount and the second total amount to other P2P servers in the streaming media playing system. In this way, the first P2P server can know the total number of P2P nodes under each P2P server and the number of players online under each P2P server.
For example, after a player establishes a network connection with a first P2P node managed by a first P2P server, in the process of acquiring and playing a streaming media resource from a first P2P node, an online status is reported to the first P2P server, so that the first P2P server can determine how many players are currently playing the streaming media resource, and the streaming media resource is a resource carried by the P2P node managed by the first P2P server.
By adopting the scheme, the number of the nodes, the number of the online players and the like are communicated among the P2P servers through information interaction, so that the P2P server is convenient to master the conditions of other P2P servers, the scheduling, load balancing and the like of the P2P node are facilitated, and the service quality of the streaming media playing system is improved.
Optionally, in the above embodiment, each P2P server further determines whether to schedule the P2P node according to the first total amount and the second total amount of the server itself and the first total amount and the second total amount of the other P2P servers. In the determination process, taking the first P2P server as an example, the first P2P server determines a first parameter and a second parameter, and determines whether to schedule the P2P node according to the first parameter and the second parameter. The first parameter is used for indicating the number of players corresponding to each P2P node on average by the streaming media playing system, and the second parameter is used for indicating the number of players corresponding to each P2P node on average by the first P2P server.
For example, the streaming media playing system comprises 4P 2P servers, which are respectively represented as an IP1 server, an IP2 server, an IP3 server and an IP4 server, the P2P nodes of each P2P server are respectively node _ num1, node _ num2, node _ num3 and node _ num4, and the number of players currently served and online by each P2P server is respectively player _ num1, player _ num2, player _ num3 and player _ num 4. Taking the first P2P server as an IP1 server as an example, the first parameter is Σ player _ num/Σ node _ num. Wherein, player _ num is player _ num1+ player _ num2+ player _ num3+ player _ num4, and node _ num is node _ num1+ node _ num2+ node _ num3+ node _ num 4. The second parameter is player _ num1/node _ num 1.
After the first P2P server determines the first parameter and the second parameter, it determines whether to schedule the P2P node according to the first parameter and the second parameter. For example, when the ratio of the second parameter to the first parameter exceeds a preset ratio, it indicates that the number of players served by the first P2P server is relatively large, but the number of P2P nodes under the first P2P server is relatively small. At this time, the first P2P server determines a scheduling P2P node, i.e., a target P2P node from P2P nodes of other P2P servers, and establishes a network connection with the target P2P node. By scheduling the P2P nodes such that the number of players served by the first P2P server is proportional to the number of P2P nodes, the streaming media playing quality can be guaranteed. When the ratio of the second parameter to the first parameter does not exceed the preset ratio, the P2P node does not need to be scheduled. Wherein, the preset ratio can be configured.
For another example, when the second parameter is greater than the first parameter and the difference is greater than the preset difference, it indicates that the number of players served by the first P2P server is larger, but the number of P2P nodes under the first P2P server is smaller. At this point the P2P node needs to be scheduled. When the second parameter is smaller than the first parameter, or even if the second parameter is larger than the first parameter, the difference is smaller than or equal to a preset difference, the P2P node does not need to be scheduled. The preset difference value can be configured.
By adopting the scheme, the purpose of improving the streaming media playing quality is realized by ensuring that the number of the players served by the first P2P server is in direct proportion to the number of the P2P nodes.
Optionally, in the foregoing embodiment, when the first P2P server determines that the P2P node needs to be scheduled, a second P2P server is determined from P2P servers of the at least two P2P servers except for the first P2P server, a third parameter of the second P2P server is smaller than the first parameter, and the third parameter is used to indicate the number of players corresponding to each P2P node on average by the second P2P server.
Continuing with the above example of the streaming media playing system including 4P 2P servers, assume that the second parameter of the first P2P server (IP address is IP1) is player _ num1/node _ num1, and the third parameter of the P2P server having IP address is IP3 is player _ num3/node _ num 3. Assuming that the difference between the second parameter and the first parameter, i.e. player _ num1/node _ num 1-sigma player _ num/sigma node _ num > delta1, the difference between the first parameter and the third parameter is sigma player _ num/sigma node _ num-player _ num3/node _ num3 > delta2, and the delta1 and delta2 are preset differences, which may be the same or different. In this case, the first P2P server determines the P2P server with the IP address of IP3 to be the second P2P server.
Thereafter, the first P2P server sends a scheduling request to the second P2P server. After receiving the scheduling request, the second P2P server determines a P2P node from the P2P nodes connected to itself, and takes the P2P node as a target P2P node. The second P2P server sends a scheduling response to the first P2P server indicating the target P2P node.
In the process of determining the target P2P node by the second P2P server, a P2P node can be randomly determined from P2P nodes connected with the second P2P server. Or the second P2P server sorts the P2P nodes connected with the second P2P server according to the access sequence, and takes the last accessed P2P node as the target P2P node. For example, the second P2P server manages 3P 2P nodes, which are node1, node2, and node3, respectively, node1 is accessed first, then node2 is accessed later, and node3 is accessed last, then the second P2P server disconnects the network connection with node3, and sends the identifier of node3 to the first P2P server in a scheduling response, so that the first P2P server and node3 establish the network connection, and finally the first P2P server manages streaming media resources carried by node3 and node 3.
By adopting the scheme, the first P2P server interacts with other P2P servers to determine the target P2P node, and the purpose of accurately scheduling the P2P node is realized.
Optionally, in the foregoing embodiment, when the first P2P server queries the corresponding relationship table according to the target identifier to determine a neighboring node from the P2P node managed by the first P2P server, it is first determined whether the network architecture of the streaming media playing system changes according to the first IP list and the second IP list. When the first IP address list and the second IP address list are different, the change of the network architecture of the streaming media playing system is shown. At this time, the first P2P server queries the correspondence table according to the target identifier to determine neighboring nodes from the P2P nodes connected to the first P2P server. Wherein, the change of the network architecture of the streaming media playing system means that: due to the fact that the P2P server is added and moved out of the P2P server, the P2P node is switched to other P2P servers, and further the streaming media resources managed by each P2P server are changed.
By adopting the scheme, the first P2P server monitors whether the network architecture of the streaming media playing system changes, and when the network architecture changes, whether the first P2P node exists in the P2P nodes connected with the first P2P server is firstly searched, so that the purpose of quickly determining the first P2P node is realized.
Optionally, in the foregoing embodiment, when a network architecture of the streaming media playing system changes, it may be that after receiving a node acquisition request, the first P2P server cannot determine a neighboring node, that is, the neighboring node does not exist in the P2P node connected to the first P2P server. At this time, the first P2P server sends an inquiry request carrying the target identifier to a third P2P server to request the third P2P server to determine a neighbor node from the P2P nodes connected to the third P2P server, where the third P2P server is a P2P server corresponding to any IP address in the second IP list. And after receiving the query request, the third P2P server determines whether a neighbor node exists in the P2P nodes connected with the third P2P server, and sends a query response to the first P2P server. Accordingly, the first P2P server receives a query response from the third P2P server indicating whether the third P2P server determined a neighboring node.
By adopting the scheme, when the network architecture of the streaming media playing system changes and no neighbor node exists in the P2P node connected with the first P2P server, the first P2P server determines the neighbor node through other P2P servers in the second IP list, so that the phenomenon that the streaming media cannot be played in the playing process is avoided, and the purpose of improving the streaming media playing quality is realized.
Optionally, in the foregoing embodiment, after the first P2P server receives the query response from the third P2P server, if the query response indicates that the third P2P server does not determine the neighbor node, the first P2P server sends the query request carrying the target identifier to other P2P servers in the second IP list.
For example, the second IP list may contain a plurality of IP addresses, and different IP addresses correspond to different P2P servers. If the third P2P server has not determined a neighboring node, the first P2P server continues to send a query request carrying the target identifier to another P2P server on the second list to determine a neighboring node.
By adopting the scheme, the purpose of determining the neighbor nodes as much as possible is realized by sequentially sending the query requests to the P2P servers corresponding to the IP addresses in the second IP address list.
Optionally, in the foregoing embodiment, when the number of times that the first P2P server sends the query request is greater than or equal to a preset number of times, the first P2P server sends a prompt message to the player to prompt that the player has no neighbor node.
For example, assuming that the preset number of times is 4, after the first P2P server sends the query request for the 4 th time, if the query response still indicates that the third P2P server has not determined the neighbor node, that is, none of the 4P 2P servers in the second IP list manages the streaming media resource indicated by the target identifier. In order to avoid not responding to the player for a long time and avoiding the player being in a waiting state for a long time, the first P2P server sends a prompt message to the player to prompt the player to have no neighbor node and cannot acquire the streaming media resource.
By adopting the scheme, the purpose of improving the user experience is realized by timely prompting the player.
Optionally, in the foregoing embodiment, after the first P2P server receives the query response from the third P2P server, if the query response indicates that the third P2P server determines the neighboring node, the first P2P server caches the node identifier of the neighboring node determined by the third P2P server.
Illustratively, if there is a third P2P server in the second IP list, the P2P server manages the streaming media resource indicated by the target identifier, that is, there is a P2P node in the P2P nodes connected to the third P2P server to store the streaming media resource indicated by the target identifier. In this case, the first P2P server records information for the third P2P server and the related P2P nodes. For example, the IP address of the third P2P server is IP3, there are 3P 2P nodes below the P2P server, which are node1, node2 and node3, respectively, and the streaming media resource corresponding to the target identifier is stored on node 3. Then, the first P2P server, upon receiving the query response, caches the correspondence of IP3, node3 and target identification in an additional list. When the subsequent player sends a node acquisition request carrying the target identifier, the first P2P server queries the information of the local cache, and determines that the streaming media resource indicated by the target identifier is stored on node3, and node3 is a P2P node managed by the P2P server with the IP address of IP 3. Thereafter, the first P2P server directly indicates IP3, node3, etc. to the player, so that the player establishes a network connection with node3 managed by the P2P server having IP address IP 3.
By adopting the scheme, the target identification is cached locally and the relation of P2P nodes of other P2P servers, so that the purpose of quickly determining the neighbor nodes is realized.
Optionally, in the foregoing embodiment, after the first P2P server receives the query response from the third P2P server, if the query response indicates that the third P2P server determines the neighbor node, the P2P node connected to the first P2P server by the first P2P server determines the storage P2P node. Thereafter, the first P2P server instructs the storing P2P node to store the streaming media resource indicated by the target identifier.
Illustratively, after the first P2P server determines the storage neighbor node, the storage neighbor node obtains the streaming media resource from node3 and stores the streaming media resource, or obtains the streaming media resource from the source station and stores the streaming media resource. When the player sends a node acquisition request carrying the target identifier, the first P2P server determines that the storage P2P node is a neighbor node, and indicates the storage P2P node to the player. And then, the player establishes network connection with the storage P2P node, and acquires the streaming media resource from the storage P2P node and plays the streaming media resource.
According to the above, it can be seen that: when the first P2P server receives the node acquisition request from the player, the neighbor nodes may be determined in the following order: and searching a local corresponding relation, searching a list caching other P2P servers, and finally sending a query request carrying a target identifier to a third P2P server.
That is, after receiving the node acquisition request from the player, the first P2P server first queries the corresponding relationship according to the target identifier, and if finding out the neighbor node, returns the neighbor node to the player; if no neighbor node is found, the list of other P2P servers cached locally is queried. If the neighbor node is found, returning to the player. And if the neighbor node is not determined, sending a query request carrying the target identifier to a third P2P server in the second IP list.
By adopting the scheme, when the P2P server is added again by the streaming media playing system, the P2P service before adding and removing is not influenced.
The following are embodiments of the apparatus of the present application that may be used to perform embodiments of the method of the present application. For details which are not disclosed in the embodiments of the apparatus of the present application, reference is made to the embodiments of the method of the present application.
Fig. 4 is a schematic diagram of a streaming media playing apparatus according to an embodiment of the present application. The streaming media playing apparatus 400 includes: a receiving module 41, a processing module 42 and a transmitting module 43.
When the streaming media playing apparatus 400 is integrated on a first P2P server, the receiving module 41 is configured to receive a node acquisition request from a player, where the node acquisition request carries a target identifier of a target streaming media resource, the first P2P server is determined by the player from at least two P2P servers included in a streaming media playing system, and different P2P servers of the at least two P2P servers manage different streaming media resources
A processing module 42, configured to query a correspondence table according to the target identifier, so as to determine a neighbor node from the P2P node managed by the first P2P server, where the neighbor node stores the target streaming media resource, and the correspondence table stores a correspondence between a node identifier of the P2P node managed by the first P2P server and a resource identifier of the streaming media resource;
a sending module 43, configured to send a node acquisition response to the player, where the node acquisition response is used to indicate the neighboring node.
In a possible implementation, the processing module 42 is further configured to determine a first total amount indicating a total amount of P2P nodes establishing network connections with the first P2P server, and a second total amount indicating a total amount of players served and online by the first P2P server;
the sending module 43 is further configured to send the first total amount and the second total amount to other P2P servers of the at least two P2P servers.
In a possible implementation manner, after determining the first total amount and the second total amount, the processing module 42 is further configured to determine a first parameter and a second parameter, and determine whether to schedule the P2P node according to the first parameter and the second parameter, where the first parameter is used to indicate the number of players corresponding to each P2P node on average by the streaming media playing system, and the second parameter is used to indicate the number of players corresponding to each P2P node on average by the first P2P server.
In a possible implementation, after determining whether to schedule the P2P node according to the first parameter and the second parameter, the processing module 42 is further configured to determine, when determining to schedule the P2P node, a second P2P server from the P2P servers of the at least two P2P servers except the first P2P server, where a third parameter of the second P2P server is smaller than the first parameter, and the third parameter is used to indicate the number of players corresponding to each P2P node on average by the second P2P server;
the sending module 43 is further configured to send a scheduling request to the second P2P server;
the receiving module 41 further configured to receive a scheduling response from the second P2P server, the scheduling response indicating a target P2P node that has disconnected from the second P2P server;
the processing module 42 is further configured to establish a network connection with the target P2P node.
In a possible implementation manner, the processing module 42 is configured to determine whether a network architecture of the streaming media playing system changes according to a first IP list and a second IP list, where the first IP list and the second IP list are used to indicate an IP address of each P2P server of the at least two P2P servers at different time instants, and when the network architecture of the streaming media playing system changes, query the correspondence table according to the target identifier to determine a neighbor node from the P2P nodes connected to the first P2P server.
In a possible implementation manner, the sending module 43 is further configured to, when the processing module 42 determines that the neighboring node does not exist in the P2P node connected to the first P2P server, send an inquiry request carrying the target identifier to a third P2P server to request the third P2P server to determine a neighboring node from the P2P node connected to the third P2P server, where the third P2P server is a P2P server corresponding to any IP address in the second IP list;
the receiving module 41 is further configured to receive a query response from the third P2P server, where the query response is used to indicate whether the third P2P server determines a neighbor node.
In a possible implementation manner, the sending module 43, after the receiving module 41 receives the query response from the third P2P server, is further configured to send the query request to other P2P servers in the second IP list except for the third P2P server when the query response indicates that the third P2P server does not determine a neighbor node.
In a possible implementation manner, the sending module 43 is further configured to send a prompt message to the player when the number of times that the first P2P server sends the query request is greater than or equal to a preset number of times, so as to prompt that the player has no neighboring node.
In a possible implementation manner, after the receiving module 41 receives the query response from the third P2P server, the processing module 42 is further configured to cache the node identifiers of the neighboring nodes determined by the third P2P server when the query response indicates that the third P2P server determines the neighboring nodes.
In one possible implementation, the processing module 42, after the receiving module 41 receives the query response from the third P2P server, is further configured to determine a storage P2P node from the P2P nodes connected to the first P2P server; instructing the storage P2P node to store the streaming media resource indicated by the target identifier.
The streaming media playing apparatus provided in this embodiment of the present application may perform the actions of the first P2P server in the foregoing embodiment, and the implementation principle and the technical effect are similar, and are not described herein again.
When the streaming media playing apparatus 400 is integrated on a first P2P node, a receiving module 41 configured to receive a connection establishment request from a player, where the first P2P node is a neighbor node selected by a first P2P server for the player, the first P2P server is determined by the player from at least two P2P servers included in a streaming media playing system, and different P2P servers of the at least two P2P servers manage different streaming media resources;
a processing module 42, configured to establish a network connection with the player;
a sending module 43, configured to send a target streaming media resource to the player based on the network connection.
In a possible implementation manner, before the receiving module 41 receives the connection establishment request from the player, it is further configured to receive a first IP list from the domain name server, where the first IP list is used to indicate an IP address of each P2P server of the at least two P2P servers at a first time;
the processing module 42 is further configured to select the first P2P server from the first IP list, and establish a network connection with the first P2P server.
In a possible implementation manner, the receiving module 41 is further configured to receive, after the processing module 42 establishes the network connection with the first P2P server, a second IP list from the domain name server, where the second IP list is used to indicate an IP address of each P2P server of the at least two P2P servers at a second time, and the first time is earlier than the second time;
the processing module 42 is further configured to select a target P2P server from the second IP list and establish a network connection with the target P2P server when the IP address of the first P2P server does not exist in the second IP list.
In a possible implementation manner, the target P2P server is a P2P server newly added to the streaming media playing system.
In a possible implementation manner, the sending module 43 is further configured to send, after the processing module 42 establishes the network connection with the target P2P server, indication information to the target P2P server to indicate the target P2P server to establish a correspondence relationship between the node identifier of the first P2P node and the resource identifier of the streaming media resource carried by the first P2P node.
The streaming media playing apparatus provided in this embodiment of the present application may perform the action of the first P2P node in the foregoing embodiment, and the implementation principle and the technical effect are similar, and are not described herein again.
Fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present application. As shown in fig. 5, the electronic device 500 is, for example, the first P2P server or the first P2P node, and the electronic device 500 includes:
a processor 51 and a memory 52;
the memory 52 stores computer instructions;
the processor 51 executes the computer instructions stored by the memory 52, so that the processor 51 executes the streaming media playing method implemented by the first P2P server as described above; or cause the processor 51 to execute the streaming media playing method implemented by the first P2P node as described above.
For a specific implementation process of the processor 51, reference may be made to the above method embodiments, which have similar implementation principles and technical effects, and details of this embodiment are not described herein again.
Optionally, the electronic device 50 further comprises a communication component 53. The processor 51, the memory 52, and the communication section 53 may be connected by a bus 54.
Embodiments of the present application further provide a computer-readable storage medium, in which computer instructions are stored, and when executed by a processor, the computer instructions are used to implement the streaming media playing method implemented by the first P2P server or the first P2P node.
Embodiments of the present application further provide a computer program product, which contains a computer program, and when the computer program is executed by a processor, the streaming media playing method implemented by the first P2P server or the first P2P node as described above is implemented.
Other embodiments of the present application will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the application and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the application being indicated by the following claims.
It will be understood that the present application is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the application is limited only by the appended claims.

Claims (21)

1. A streaming media playing system, comprising: at least two P2P servers, at least two P2P nodes, and a player, wherein:
different P2P servers of the at least two P2P servers are used for managing different streaming media resources;
each P2P node of the at least two P2P nodes establishing a network connection with a subset of P2P servers of the at least two P2P servers;
the player is configured to determine a target P2P server from the at least two P2P servers, send a node acquisition request to the target P2P server to request a neighbor node, and acquire and play a target streaming media resource from the neighbor node after establishing a network connection with the neighbor node.
2. The system of claim 1, further comprising:
a domain name system server, establishing a network connection with each P2P server of the at least two P2P servers, each P2P node of the at least two P2P nodes, and the player, for sending an IP list to the player, each P2P node of the at least two P2P nodes, each P2P server of the at least two P2P servers, wherein the IP list stores IP addresses of each P2P server of the at least two P2P servers.
3. A method for playing streaming media, comprising:
a first P2P server receives a node acquisition request from a player, wherein the node acquisition request carries a target identifier of a target streaming media resource, the first P2P server is determined by the player from at least two P2P servers included in a streaming media playing system, and different P2P servers in the at least two P2P servers manage different streaming media resources;
the first P2P server inquires a corresponding relation table according to the target identification to determine a neighbor node from the P2P nodes managed by the first P2P server, the neighbor node stores the target streaming media resource, and the corresponding relation table stores the corresponding relation between the node identification of the P2P node managed by the first P2P server and the resource identification of the streaming media resource;
the first P2P server sends a node acquisition response to the player, wherein the node acquisition response is used for indicating the neighbor nodes.
4. The method of claim 3, further comprising:
the first P2P server determining a first total amount indicating a total amount of P2P nodes establishing network connections with the first P2P server and a second total amount indicating a total amount of players served and online by the first P2P server;
the first P2P server sending the first total amount and the second total amount to other P2P servers of the at least two P2P servers.
5. The method of claim 4, wherein after the first P2P server determines the first total amount and the second total amount, the method further comprises:
the first P2P server determining a first parameter indicating the number of players corresponding to each P2P node on average by the streaming media playing system;
the first P2P server determining a second parameter indicating a number of players to which the first P2P server averages to each P2P node;
the first P2P server determining whether to schedule a P2P node according to the first parameter and the second parameter.
6. The method of claim 5, wherein after the first P2P server determining whether to schedule a P2P node according to the first parameter and the second parameter, further comprising:
when determining to schedule a P2P node, the first P2P server determining a second P2P server from P2P servers of the at least two P2P servers other than the first P2P server, a third parameter of the second P2P server being less than the first parameter, the third parameter indicating a number of players to which the second P2P server averages each P2P node;
the first P2P server sending a scheduling request to the second P2P server;
the first P2P server receiving a scheduling response from the second P2P server indicating a target P2P node that has disconnected from the second P2P server;
the first P2P server establishing a network connection with the target P2P node.
7. The method as claimed in any one of claims 3-6, wherein the querying, by the first P2P server, the correspondence table according to the target identifier to determine the neighbor node from the P2P nodes managed by the first P2P server comprises:
the first P2P server determines whether the network architecture of the streaming media playing system changes according to a first IP list and a second IP list, wherein the first IP list and the second IP list are used for indicating the IP address of each P2P server of the at least two P2P servers at different time instants;
when the network architecture of the streaming media playing system changes, the first P2P server queries the corresponding relationship table according to the target identifier, so as to determine neighbor nodes from the P2P nodes connected to the first P2P server.
8. The method of claim 7, further comprising:
when the neighbor node does not exist in the P2P node connected with the first P2P server, the first P2P server sends an inquiry request carrying the target identifier to a third P2P server to request the third P2P server to determine the neighbor node from the P2P node connected with the third P2P server, where the third P2P server is a P2P server corresponding to any IP address in the second IP list;
the first P2P server receiving a query response from the third P2P server indicating whether the third P2P server determined a neighbor node.
9. The method of claim 8, wherein after the first P2P server receives the query response from the third P2P server, further comprising:
when the query response indicates that the third P2P server has not determined a neighbor node, the first P2P server sends the query request to other P2P servers in the second IP list except the third P2P server.
10. The method of claim 9, further comprising:
when the number of times that the first P2P server sends the query request is greater than or equal to a preset number of times, the first P2P server sends a prompt message to the player to prompt the player that there are no neighbor nodes.
11. The method of claim 8, wherein after the first P2P server receives the query response from the third P2P server, further comprising:
when the query response indicates that the third P2P server determined a neighbor node, the first P2P server caches the node identification of the neighbor node determined by the third P2P server.
12. The method as claimed in claim 8 or 11, wherein after the first P2P server receives the query response from the third P2P server, further comprising:
the first P2P server determining a storing P2P node from among the P2P nodes connected to the first P2P server;
the first P2P server indicating that the storing P2P node stores the streaming media resource indicated by the target identity.
13. A method for playing streaming media, comprising:
a first P2P node receives a connection establishment request from a player, the first P2P node is a neighbor node selected by a first P2P server for the player, the first P2P server is determined by the player from at least two P2P servers included in a streaming media playing system, and different P2P servers of the at least two P2P servers manage different streaming media resources;
the first P2P node establishes network connection with the player;
the first P2P node sends a target streaming media resource to the player based on the network connection.
14. The method of claim 13, wherein before the first P2P node receives the connection establishment request from the player, further comprising:
the first P2P node receiving a first IP list from a domain name server, the first IP list indicating an IP address of each P2P server of the at least two P2P servers at a first time;
the first P2P node selecting the first P2P server from the first IP list;
the first P2P node establishing a network connection with the first P2P server.
15. The method of claim 14, wherein after the first P2P node establishes a network connection with the first P2P server, further comprising:
the first P2P node receiving a second IP list from the domain name server, the second IP list indicating an IP address of each of the at least two P2P servers at a second time, the first time being earlier than the second time;
when the IP address of the first P2P server does not exist in the second IP list, selecting a target P2P server from the second IP list;
the first P2P node establishing a network connection with the target P2P server.
16. The method of claim 15, wherein the target P2P server is a newly added P2P server in the streaming media playing system.
17. The method as claimed in claim 15 or 16, wherein after the first P2P node establishes a network connection with the target P2P server, further comprising:
the first P2P node sending indication information to the target P2P server to indicate the target P2P server to establish correspondence between the node identification of the first P2P node and the resource identification of the streaming media resource carried by the first P2P node.
18. A streaming media playing apparatus, wherein the apparatus is integrated on a first P2P server, the apparatus comprising:
a receiving module, configured to receive a node acquisition request from a player, where the node acquisition request carries a target identifier of a target streaming media resource, and the first P2P server is determined by the player from at least two P2P servers included in a streaming media playing system, and different P2P servers of the at least two P2P servers manage different streaming media resources;
a processing module, configured to query a correspondence table according to the target identifier, so as to determine a neighbor node from the P2P node managed by the first P2P server, where the neighbor node stores the target streaming media resource, and the correspondence table stores a correspondence between a node identifier of the P2P node managed by the first P2P server and a resource identifier of the streaming media resource;
a sending module, configured to send a node acquisition response to the player, where the node acquisition response is used to indicate the neighbor node.
19. An apparatus for streaming media playback, the apparatus being integrated into a first P2P node, the apparatus comprising:
a receiving module, configured to receive a connection establishment request from a player, where the first P2P node is a neighbor node selected by a first P2P server for the player, the first P2P server is determined by the player from at least two P2P servers included in a streaming media playing system, and different P2P servers of the at least two P2P servers manage different streaming media resources;
the processing module is used for establishing network connection with the player;
a sending module, configured to send a target streaming media resource to the player based on the network connection.
20. An electronic device comprising a processor, a memory, and a computer program stored on the memory and executable on the processor, wherein execution of the computer program by the processor causes the electronic device to carry out the method of any one of claims 3 to 17.
21. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of claims 3 to 17.
CN202111388937.7A 2021-11-22 2021-11-22 Streaming media playing system, method, device, equipment and readable storage medium Pending CN114338626A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111388937.7A CN114338626A (en) 2021-11-22 2021-11-22 Streaming media playing system, method, device, equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111388937.7A CN114338626A (en) 2021-11-22 2021-11-22 Streaming media playing system, method, device, equipment and readable storage medium

Publications (1)

Publication Number Publication Date
CN114338626A true CN114338626A (en) 2022-04-12

Family

ID=81047297

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111388937.7A Pending CN114338626A (en) 2021-11-22 2021-11-22 Streaming media playing system, method, device, equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN114338626A (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1933437A (en) * 2005-12-31 2007-03-21 穆源浦 Stream media service system based on controllable P2P technology and realizing method thereof
CN101068186A (en) * 2007-06-05 2007-11-07 华为技术有限公司 Customer end node network topological structure method and stream media distributing system
US20110197238A1 (en) * 2008-10-07 2011-08-11 Zte Plaza, Keji Road South System and method for implementing media interaction of the iptv
CN102195788A (en) * 2011-05-25 2011-09-21 中国联合网络通信集团有限公司 Application layer multicast system and streaming media data processing method
CN103634692A (en) * 2013-12-06 2014-03-12 南京理工大学连云港研究院 CDN (content distribution network) and P2P (peer-to-peer) based hybrid stream media video-on-demand system
US20190068701A1 (en) * 2017-08-31 2019-02-28 Boe Technology Group Co., Ltd. Content Scheduling Method Based on CDN and P2P Network, and Communication Network
CN110719273A (en) * 2019-09-29 2020-01-21 咪咕视讯科技有限公司 Method for determining back source node, server and computer readable storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1933437A (en) * 2005-12-31 2007-03-21 穆源浦 Stream media service system based on controllable P2P technology and realizing method thereof
CN101068186A (en) * 2007-06-05 2007-11-07 华为技术有限公司 Customer end node network topological structure method and stream media distributing system
US20110197238A1 (en) * 2008-10-07 2011-08-11 Zte Plaza, Keji Road South System and method for implementing media interaction of the iptv
CN102195788A (en) * 2011-05-25 2011-09-21 中国联合网络通信集团有限公司 Application layer multicast system and streaming media data processing method
CN103634692A (en) * 2013-12-06 2014-03-12 南京理工大学连云港研究院 CDN (content distribution network) and P2P (peer-to-peer) based hybrid stream media video-on-demand system
US20190068701A1 (en) * 2017-08-31 2019-02-28 Boe Technology Group Co., Ltd. Content Scheduling Method Based on CDN and P2P Network, and Communication Network
CN110719273A (en) * 2019-09-29 2020-01-21 咪咕视讯科技有限公司 Method for determining back source node, server and computer readable storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
周绪俊: "P2P流媒体网络拓扑研究", 《中国优秀硕士学位论文全文数据库(信息科技辑)》, 15 September 2014 (2014-09-15), pages 2 - 3 *

Similar Documents

Publication Publication Date Title
US10033548B2 (en) Method, system, service selection entity, and service management entity for selecting service provision entity
EP3595268B1 (en) Streaming media resource distribution method, system, edge node and central dispatching system
US8112479B2 (en) Method, system and device for establishing a peer to peer connection in a P2P network
US10097451B2 (en) Dynamically optimizing content delivery using manifest chunking
Zhang et al. Unreeling Xunlei Kankan: Understanding hybrid CDN-P2P video-on-demand streaming
US9300534B2 (en) Method for optimally utilizing a peer to peer network
US7640339B1 (en) Method and apparatus for monitoring a node in a distributed system
US20110282945A1 (en) Network aware peer to peer
EP2227016B1 (en) A content buffering, querying method and point-to-point media transmitting system
US9173006B2 (en) Method for live broadcasting in a distributed network and apparatus for the same
KR20100105568A (en) Resilient service quality in a managed multimedia delivery network
JP2004501559A (en) Viewer object proxy
CN103597471A (en) Methods and systems for caching data communications over computer networks
KR100912370B1 (en) System and method for distributing multimedia streaming service request based on wide area network
CN111046065A (en) Extensible high-performance distributed query processing method and device
CN110990448B (en) Distributed query method and device supporting fault tolerance
US20230119540A1 (en) Content delivery system special network device and special local area network connection, content discovery, data transfer, and control methods
CN111800516B (en) Internet of things equipment management method and device based on P2P
CN111010444B (en) System and method for realizing Wowza streaming media engine distributed cluster
CN114338626A (en) Streaming media playing system, method, device, equipment and readable storage medium
US20220182444A1 (en) Peer-managed content distribution network
KR20110063083A (en) Method for constructing publish-subscribe network and supporting communication using hash function
KR101015961B1 (en) Streaming apparatus using virtual server and method thereof
CN105554524B (en) A kind of method and system playing program
CN117420956A (en) Information processing method, device, equipment and computer storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination