P2P streaming media system supporting live broadcast on demand and multiple streaming media transmission protocols
By designing a unified P2P streaming media system architecture, supporting multiple streaming media transmission protocols, and building a self-built Tracker server, the problem of single support for live and on-demand by P2P streaming media systems in the existing technology and high SDK docking costs is solved, and efficient, flexible and low-cost P2P streaming media services are achieved.
Patent Information
- Application Number
- CN202411740316.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-29
- Publication Date
- 2025-03-21
AI Technical Summary
The existing P2P streaming media systems lack unified support for live and on-demand broadcasts. Tracker Service integrates ICE and STUN services to increase the cost of SDK docking, and the P2P-SDK needs to support multiple streaming protocols and bit rate adaptation at the same time.
A unified P2P streaming media system architecture is designed, including a content management system, content storage server, program on demand server, program live broadcast server, Tracker server and multiple P2P clients. Through efficient slicing and streaming mechanisms, multiple streaming media transmission protocols are supported, and a self-built Tracker server is built to reduce the cost of SDK docking.
It realizes unified support for live broadcast and on-demand broadcast, reduces system complexity and operation and maintenance costs, improves data transmission efficiency and system scalability, supports multi-platform integration and adaptive playback, and enhances user viewing experience.
Smart Images

Figure CN119676468A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of P2P streaming media, and in particular to a P2P streaming media system supporting live broadcast on demand and multiple streaming media transmission protocols. Background Art
[0002] With the rapid development of the multimedia industry, business scenarios such as live broadcast and on-demand are gradually increasing, and the amount of audio and video network data is constantly increasing. For streaming providers and operators, reducing network bandwidth costs and improving service quality have become urgent issues to be solved. Existing live broadcast and on-demand services will use P2P technology to reduce bandwidth costs and increase speed (network acceleration), and improve playback quality through player bit rate adaptation. The core points of the current P2P streaming system include: 1. SourceService provides unique audio and video slices of on-demand files; 2. VOD Service provides detailed on-demand slice information; 3. LIVEService provides live streaming 4. Tracker Service provides penetration and hole-punching services; 4. P2P-SDK completes the acquisition and sharing of audio and video data and generates local acceleration addresses to connect to the player.
[0003] Although the existing P2P streaming media system has reduced bandwidth costs and increased speed to a certain extent through P2P technology, it still has many shortcomings:
[0004] 1. The existing P2P streaming media system only supports live broadcast and on-demand programs, and does not provide unified system support and unified P2P-SDK adaptation;
[0005] 2. Most Tracker Services integrate ICE and STUN services, which increases the cost of SDK docking
[0006] 3. The P2P-SDK needs to support both live and on-demand programs. The bitrate adaptation effect needs to be achieved for the HLS and DASH protocols, and the local acceleration address needs to support multiple protocols. Summary of the invention
[0007] In order to solve the problems existing in the prior art, the purpose of the present invention is to provide a more efficient, flexible and low-cost P2P streaming media system that supports live broadcast on demand and multiple streaming media transmission protocols. The system aims to reduce bandwidth costs, improve service quality, reduce SDK docking costs, and realize multi-platform integration and adaptive playback solutions through a unified system architecture and an efficient slicing and streaming mechanism.
[0008] The present invention achieves the above-mentioned purpose through the following technical solutions:
[0009] A P2P streaming media system supporting live broadcast on demand and multiple streaming media transmission protocols, including:
[0010] The content management system CMS is used to provide an operation and maintenance configuration interface for programs, allowing live and on-demand programs to be put online and offline. After successful configuration, program information is updated. The client obtains the latest configuration and supported programs by requesting the list service;
[0011] Content storage server Source Server, used to store all on-demand audio and video resource files;
[0012] The program on-demand server VOD Service is connected to the content storage server Source Server and the content management system CMS, and is used to store detailed list information of program on-demand files, including movie names, movie types, and movie slice information;
[0013] The live broadcast server LIVE Service is used to receive live broadcast program sources issued by the content management system CMS, obtain program audio and video slice information from the live broadcast program source, and continuously update and store the latest slice information;
[0014] Tracker server, used to provide hole punching services and NAT type detection between clients;
[0015] Multiple P2P clients, each of which is integrated with a P2P-SDK, the P2P clients communicate through the VOD Service and the LIVE Service to obtain the playback addresses of the VOD and live programs; the P2P clients support multiple files as data sources, encapsulate and stream them through the P2P-SDK, so as to distribute the file contents to other P2P clients; the P2P clients can process multiple block contents at the same time, and realize merging and distribution through the P2P-SDK;
[0016] The list server is used to generate program links accessible to the client, including the content distribution network entry address, film type, P2P sharing flag, and Tracker Service address information.
[0017] According to a P2P streaming media system supporting live broadcast on demand and multiple streaming media transmission protocols provided by the present invention, the program on demand server includes:
[0018] A receiving module is used to receive the on-demand program information sent by the content management system CMS;
[0019] The processing module is used to process the received on-demand program information, obtain detailed program information, and store it in the database;
[0020] The information generation module is used to generate a program link accessible to the client according to the stored program detailed information.
[0021] According to a P2P streaming media system supporting live broadcast on demand and multiple streaming media transmission protocols provided by the present invention, the P2P-SDK supports on-demand video slicing based on the HTTP protocol, including:
[0022] According to the preset block size, calculate the block range of the file to be transferred;
[0023] Assign a unique ID to each data block, and record the start byte and end byte of each block to determine the Range;
[0024] Record the ID, start byte, and end byte information of each data block in one or more index files to quickly locate and reassemble data blocks during transmission and reception;
[0025] Use the Range header field in the HTTP protocol to specify the range of the required data block when the client requests it, so as to download and play the video on demand;
[0026] During the transmission process, if a data block fails to be transmitted, the client can re-request the data block based on the information in the index file to achieve breakpoint resumption and error recovery.
[0027] According to a P2P streaming media system supporting live broadcast on demand and multiple streaming media transmission protocols provided by the present invention, when P2P clients of different platforms are connected to P2P-SDK, penetration between P2P clients is achieved through a Tracker server, including:
[0028] Client A establishes a socket and initiates a penetration request to the Tracker Service via the UDP protocol;
[0029] After receiving the penetration request, the Tracker Service forwards the request to the client B via the TCP protocol;
[0030] After receiving the penetration request forwarded by Tracker Service, Client B establishes a socket and sends a request to Tracker Service to confirm the penetration through UDP protocol;
[0031] After receiving the confirmation request from client B, Tracker Service forwards the confirmation request to client A via TCP protocol;
[0032] After receiving each other's confirmation information, client A and client B start the penetration thread respectively and send test information to each other;
[0033] After confirming that they can correctly receive the test information sent by each other, client A and client B successfully penetrate and communicate directly without the Tracker server.
[0034] According to a P2P streaming media system supporting live broadcast on demand and multiple streaming media transmission protocols provided by the present invention, when P2P clients of different platforms are connected to P2P-SDK, a program list containing multiple program list information is obtained from a list server, wherein each program list information includes at least a playback address of a program;
[0035] The player selects a program from the program list and accesses the corresponding playback address;
[0036] Perform domain name resolution on the playback address to obtain one or more available POP point addresses, where the POP point address refers to the edge node address in the content distribution network;
[0037] The slice data of the selected program is obtained from the POP point address obtained by parsing; if the slice data of the selected program is hit at the POP point, the slice data is directly transmitted to the player for playing;
[0038] If the slice data of the selected program is not found at the POP point, the source is returned to the program live broadcast server LIVE Service, the slice data is obtained from the program live broadcast server LIVE Service, and the obtained slice data is transmitted to the player for playback.
[0039] According to a P2P streaming media system supporting live broadcast on demand and multiple streaming media transmission protocols provided by the present invention, the P2P-SDK supports streaming of on-demand programs in HTTP streaming mode, including:
[0040] Make a request to the list service to obtain detailed information about the program list, including program link, type, and whether P2P sharing is supported;
[0041] According to the information in the program list, for on-demand programs that support P2P sharing, a request is made to the content distribution network CF portal to obtain the slice details of the program;
[0042] According to the obtained slice details, recalculate the Range data range of each slice in the order of slice ID increment;
[0043] According to the calculated Range data range, a GET request is initiated to the edge node POP point of the content distribution network to obtain the audio and video data within the corresponding range;
[0044] In the process of acquiring audio and video data, P2P-SDK determines whether to enable P2P service based on the program's link information. For programs that support P2P sharing, the P2P function is enabled to achieve data sharing and acceleration.
[0045] According to a P2P streaming media system supporting live broadcast on demand and multiple streaming media transmission protocols provided by the present invention, when determining whether to start the P2P service, the system includes:
[0046] Receiving and parsing a program link to identify whether the program is a live program or a VOD program, and determining whether a P2P sharing function is supported; wherein the program link includes a unique identifier and / or type information of the program;
[0047] Requesting a corresponding playback address according to the analysis result; receiving and parsing the playback address, and further confirming whether the P2P service needs to be enabled according to specific parameters or formats in the URL;
[0048] If you are sure that you need to enable the P2P service, configure the P2P-SDK to enable the P2P data sharing function. Otherwise, configure the P2P-SDK to perform data transmission in normal mode.
[0049] According to a P2P streaming media system supporting live broadcast on demand and multiple streaming media transmission protocols provided by the present invention, the calculation formula of the Range data range is:
[0050] ID*SIZE-(ID+1)*SIZE-1
[0051] Among them, ID is the identifier of the current slice, and SIZE is the size of each slice.
[0052] According to a P2P streaming media system supporting live broadcast on demand and multiple streaming media transmission protocols provided by the present invention, the P2P-SDK provides solutions for on-demand rewind and fast forward, specifically including:
[0053] For HTTP on-demand, when the user rewinds or fast-forwards, the player initiates a new HTTP request, which contains the information of the data start node. After receiving the HTTP request, the P2P-SDK searches for the data block ID in the local cache list through a binary search algorithm. If the local cache does not hit, it initiates a request to the server and sends the acquired data to the player; if the local cache hits, it directly locates the specific data block and returns it to the player.
[0054] Among them, no matter obtaining data from the local cache or the server, the stream pulling end will continue to pull the stream according to the latest ID self-increment.
[0055] According to a P2P streaming media system supporting live broadcast on demand and multiple streaming media transmission protocols provided by the present invention, the P2P-SDK provides solutions for on-demand rewind and fast forward, specifically including:
[0056] For HLS and DASH on-demand, when the user rewinds or fast-forwards, the player initiates a new slice request. After receiving the player's request, the P2P-SDK local service also processes it through a binary search algorithm. If the local cache does not hit, it replies to the player with a 302 redirect response, allowing the player to go back to the server to obtain the slice; if the local cache hits, it directly locates the specific data block and returns it to the player.
[0057] It can be seen that compared with the prior art, the system provided by the present invention has the following beneficial effects:
[0058] 1. The present invention provides the construction and implementation of an overall P2P streaming media service, including live broadcast, on-demand services, and a slicing division scheme for resources, which can simultaneously support live broadcast and on-demand services without the need to build and maintain independent systems for the two services, thereby reducing system complexity and operation and maintenance costs.
[0059] 2. The present invention builds its own Tracker server, removes the integration of ICE, STUN and other services, and reduces the SDK docking cost. The Tracker server provides hole-punching services and NAT type detection, which helps to establish direct connections between P2P clients, reduces the dependence of data transmission on the server, and improves data transmission efficiency and system scalability.
[0060] 3. The present invention implements a P2P-SDK Range request slicing solution for HTTP on-demand programs, supporting multiple streaming media protocols and multi-platform integration.
[0061] 4. The present invention provides adaptive solutions such as user rewind and fast forward to enhance the user's viewing experience. At the same time, the content management system CMS provides an intuitive operation and maintenance configuration interface to facilitate the online and offline operation of programs.
[0062] 5. The system of the present invention adopts modular design, and the components are loosely coupled, which is convenient for system expansion and upgrading. At the same time, the introduction of content management system CMS and list server makes the management and distribution of program information more efficient and flexible.
[0063] 6. P2P-SDK supports multi-platform integration, allowing the system to run on different operating systems and devices, increasing the system's popularity and market share.
[0064] The present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0065] Figure 1 It is a principle diagram of an embodiment of a P2P streaming media system supporting live broadcast on demand and multiple streaming media transmission protocols of the present invention.
[0066] Figure 2 The present invention is a schematic diagram of the penetration principle between P2P clients in an embodiment of a P2P streaming media system supporting live broadcast on demand and multiple streaming media transmission protocols.
[0067] Figure 3 The present invention is a schematic diagram of the streaming principle of on-demand programs in HTTP streaming mode in an embodiment of a P2P streaming media system supporting live broadcast on-demand and multiple streaming media transmission protocols. DETAILED DESCRIPTION
[0068] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0069] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0070] See also Figures 1 to 3 The present invention provides a P2P streaming media system supporting live broadcast on demand and multiple streaming media transmission protocols, including:
[0071] Content management system CMS is used to provide an interface for operation and maintenance configuration of programs, allowing the online and offline operations of live and on-demand programs. After successful configuration, program information is updated, and the latest configured and supported programs are obtained through the request list service;
[0072] Content storage server Source Server (S3), used to store all on-demand audio and video resource files;
[0073] The program on-demand server VOD Service is connected to the content storage server Source Server and the content management system CMS, and is used to store detailed list information of program on-demand files, including movie names, movie types, and movie slice information;
[0074] The live broadcast server LIVE Service is used to receive live broadcast program sources issued by the content management system CMS, obtain program audio and video slice information from the live broadcast program source, and continuously update and store the latest slice information;
[0075] Tracker server, used to provide hole punching services and NAT type detection between clients;
[0076] Multiple P2P clients, each of which is integrated with a P2P-SDK, the P2P clients communicate through the VOD Service and the LIVE Service to obtain the playback addresses of the VOD and live programs; the P2P clients support multiple files as data sources, encapsulate and stream them through the P2P-SDK, so as to distribute the file contents to other P2P clients; the P2P clients can process multiple block contents at the same time, and realize merging and distribution through the P2P-SDK;
[0077] The list server is used to generate program links accessible to the client, including the content distribution network entry address, film type, P2P sharing flag, and Tracker Service address information.
[0078] In this embodiment, the program on-demand server VOD Service includes:
[0079] A receiving module is used to receive the on-demand program information sent by the content management system CMS;
[0080] The processing module is used to process the received on-demand program information, obtain detailed program information, and store it in the database;
[0081] The information generation module is used to generate a program link accessible to the client according to the stored program detailed information.
[0082] Specifically, the Source Server stores all on-demand audio and video resource files, and the VOD Service stores detailed list information of program on-demand files. Global POP points can correctly access audio and video resource files.
[0083] CMS sends (puts online) a VOD program to VOD Service. VOD Service obtains detailed program information, including the movie name, movie type, and movie slice information: slice ID set, slice size, and stores it in the MongoDB database.
[0084] HLS on-demand program storage information: movie name, movie type (VOD).
[0085] DASH on-demand program storage information: movie name, movie type (VOD).
[0086] HTTP VOD program storage information: video name, slice size, slice ID set, video type (VOD).
[0087] The list server generates a program link that can be accessed by the client, including: CF entry address, movie type, P2P sharing flag, and Tracker Service address information.
[0088] In this embodiment, the P2P-SDK supports on-demand video slicing based on the HTTP protocol, including:
[0089] According to the preset block size, calculate the block range of the file to be transferred;
[0090] Assign a unique ID to each data block, and record the start byte and end byte of each block to determine the Range;
[0091] Record the ID, start byte, and end byte information of each data block in one or more index files to quickly locate and reassemble data blocks during transmission and reception;
[0092] Use the Range header field in the HTTP protocol to specify the range of the required data block when the client requests it, so as to download and play the video on demand;
[0093] During the transmission process, if a data block fails to be transmitted, the client can re-request the data block based on the information in the index file to achieve breakpoint resumption and error recovery.
[0094] Specifically, the on-demand video slicing scheme of the HTTP protocol includes: the VOD Service calculates the slices and the Range range, implements the slicing of the file according to the specified size, and records the ID, start byte and end byte of each block. Assume that the file size is 3075 bytes and the block size is 1024 bytes, as shown in Table (1).
[0095] ID Start End 0 0 1023 1 1024 2047 2 2048 3072 3 3073 3075
[0096] Table (1): On-demand slices
[0097] In this embodiment, when P2P clients of different platforms are connected to P2P-SDK, penetration between P2P clients is achieved through the Tracker server, including:
[0098] Client A establishes a socket and initiates a penetration request to the Tracker Service via the UDP protocol;
[0099] After receiving the penetration request, the Tracker Service forwards the request to the client B via the TCP protocol;
[0100] After receiving the penetration request forwarded by Tracker Service, Client B establishes a socket and sends a request to Tracker Service to confirm the penetration through UDP protocol;
[0101] After receiving the confirmation request from client B, Tracker Service forwards the confirmation request to client A via TCP protocol;
[0102] After receiving each other's confirmation information, client A and client B start the penetration thread respectively and send test information to each other;
[0103] After confirming that they can correctly receive the test information sent by each other, client A and client B successfully penetrate and communicate directly without the Tracker server.
[0104] Specifically, Figure 2 As shown in the figure, the client penetration hole punching process of Tracker Service is as follows:
[0105] Client-A establishes a socket and sends a request to the Tracker Service via the UDP protocol. The Tracker Service forwards the information to Client-B via the TCP protocol.
[0106] After receiving the Tracker Service information, Client-B establishes a socket and initiates a request to the Tracker Service through the UDP protocol. Client-B starts a penetration thread to send information to Client-A.
[0107] Tracker Service forwards the information to Client-A via TCP protocol.
[0108] Client-A starts a penetration thread to send information to Client-B.
[0109] If both Client-A and Client-B can correctly receive each other's data, the penetration is successful, and then they can analyze each other's data without the server.
[0110] In this embodiment, when P2P clients of different platforms are connected to P2P-SDK, a program list including multiple program list information is obtained from the list server, wherein each program list information includes at least a play address of a program;
[0111] The player selects a program from the program list and accesses the corresponding playback address;
[0112] Perform domain name resolution on the playback address to obtain one or more available POP point addresses, where the POP point address refers to the edge node address in the content distribution network;
[0113] The slice data of the selected program is obtained from the POP point address obtained by parsing; if the slice data of the selected program is hit at the POP point, the slice data is directly transmitted to the player for playing;
[0114] If the slice data of the selected program is not found at the POP point, the source is returned to the program live broadcast server LIVE Service, the slice data is obtained from the program live broadcast server LIVE Service, and the obtained slice data is transmitted to the player for playback.
[0115] In this embodiment, the P2P-SDK supports streaming of on-demand programs in HTTP streaming mode, including:
[0116] Make a request to the list service to obtain detailed information about the program list, including program link, type, and whether P2P sharing is supported;
[0117] According to the information in the program list, for on-demand programs that support P2P sharing, a request is made to the content distribution network CF portal to obtain the slice details of the program;
[0118] According to the obtained slice details, recalculate the Range data range of each slice in the order of slice ID increment;
[0119] According to the calculated Range data range, a GET request is initiated to the edge node POP point of the content distribution network to obtain the audio and video data within the corresponding range;
[0120] In the process of acquiring audio and video data, P2P-SDK determines whether to enable P2P service based on the program's link information. For programs that support P2P sharing, the P2P function is enabled to achieve data sharing and acceleration.
[0121] In this embodiment, when determining whether to enable the P2P service, the following steps are included:
[0122] Receiving and parsing a program link to identify whether the program is a live program or a VOD program, and determining whether a P2P sharing function is supported; wherein the program link includes a unique identifier and / or type information of the program;
[0123] Requesting a corresponding playback address according to the analysis result; receiving and parsing the playback address, and further confirming whether the P2P service needs to be enabled according to specific parameters or formats in the URL;
[0124] If you are sure that you need to enable the P2P service, configure the P2P-SDK to enable the P2P data sharing function. Otherwise, configure the P2P-SDK to perform data transmission in normal mode.
[0125] In this embodiment, the calculation formula of the Range data range is:
[0126] ID*SIZE-(ID+1)*SIZE-1
[0127] Among them, ID is the identifier of the current slice, and SIZE is the size of each slice.
[0128] The P2P-SDK integration of this embodiment includes:
[0129] (1) Use program links to distinguish between live and on-demand, and whether the P2P function is enabled. After obtaining the playback address, the P2P-SDK determines whether to enable the P2P service by parsing the URL. As shown in Table (2), programs 1 and 2 are live programs and support P2P sharing, programs 4 and 5 are on-demand programs that do not support P2P sharing, and program 3 is a on-demand program that supports P2P sharing.
[0130] programme Play address 1 http: / / ocean.gcp.com / TV001 / index.m3u8?ts=192.168.3.124&live=1&p2p=1 2 http: / / ocean.gcp.com / TV001 / index.mpd?ts=192.168.3.124&live=1&p2p=1 3 http: / / ocean.gcp.com / TV001 / movie.mp4?ts=192.168.3.124&live=0&p2p=1 4 http: / / ocean.gcp.com / TV001 / movie.ts?ts=192.168.3.124&live=0&p2p=0 5 http: / / ocean.gcp.com / TV001 / movie.flv?ts=192.168.3.124&live=0&p2p=0
[0131] Table (1): Program Address
[0132] (2) The streaming process of on-demand programs in HTTP streaming mode is as follows Figure 3 As shown in Table (3), it includes: (1) initiating a request to the list service to obtain detailed information of the program list; (2) initiating a request to the CF entry to obtain detailed information of the program slice; (3) the ID is incremented in sequence and the Range data range is recalculated to initiate a GET request to the POP point to obtain audio and video data; (4) the Range calculation formula is: ID*SIZE-(ID+1)*SIZE-1.
[0133]
[0134]
[0135] Table (3): Pull flow
[0136] Local acceleration address and function, for P2P-SDK local services, standard HLS, DASH, HTTP protocols should be supported, and Range request method should be supported, as shown in Table (4):
[0137]
[0138]
[0139] Table (4): HLS, DASH, HTTP protocols
[0140] In this embodiment, the P2P-SDK provides a solution for on-demand rewind and fast forward, specifically including:
[0141] For HTTP on-demand, when the user rewinds or fast-forwards, the player initiates a new HTTP request, which contains the information of the data start node. After receiving the HTTP request, the P2P-SDK searches for the data block ID in the local cache list through a binary search algorithm. If the local cache does not hit, it initiates a request to the server and sends the acquired data to the player; if the local cache hits, it directly locates the specific data block and returns it to the player, and then the next block of data is pushed to the player in succession with an auto-increment ID. In order to avoid repeated streaming, the local cache status can be queried at the beginning.
[0142] Among them, no matter obtaining data from the local cache or the server, the stream pulling end will continue to pull the stream according to the latest ID self-increment.
[0143] For HLS and DASH on-demand, when the user rewinds or fast-forwards, the player initiates a new slice request. After receiving the player's request, the P2P-SDK local service also processes it through a binary search algorithm. If the local cache does not hit, it replies to the player with a 302 redirect response, allowing the player to go back to the server to obtain the slice; if the local cache hits, it directly locates the specific data block and returns it to the player.
[0144] This embodiment also provides a method for implementing streaming media transmission using the above-mentioned P2P streaming media system, including:
[0145] Receive a program playback request from a client;
[0146] Obtain corresponding program information and slice information according to the program play request;
[0147] Use Tracker Service to perform hole punching and NAT type detection between clients;
[0148] Use P2P-SDK to support on-demand and live broadcasting, as well as multiple streaming media transmission protocols and multi-platform integration;
[0149] Based on the client's request, P2P-SDK provides on-demand rewind and fast-forward solutions.
[0150] In summary, the present invention provides the construction and implementation of an overall P2P streaming media service, including live broadcast, on-demand services, and a resource slicing division scheme, which can simultaneously support live broadcast and on-demand services without the need to build and maintain independent systems for the two services, thereby reducing system complexity and operation and maintenance costs.
[0151] Furthermore, the present invention builds its own Tracker server, removes the integration of services such as ICE and STUN, and reduces the SDK docking cost. The Tracker server provides hole punching services and NAT type detection, which helps to establish direct connections between P2P clients, reduces the dependence of data transmission on the server, and improves data transmission efficiency and system scalability.
[0152] Furthermore, the present invention implements a P2P-SDK Range request slicing solution for HTTP on-demand programs, supporting multiple streaming media protocols and multi-platform integration.
[0153] Furthermore, the present invention provides adaptive solutions such as user rewind and fast forward to enhance the user's viewing experience. At the same time, the content management system CMS provides an intuitive operation and maintenance configuration interface to facilitate the online and offline operation of programs.
[0154] Furthermore, the system of the present invention adopts modular design, and the components are loosely coupled, which is convenient for system expansion and upgrading. At the same time, the introduction of content management system CMS and list server makes the management and distribution of program information more efficient and flexible.
[0155] Furthermore, P2P-SDK supports multi-platform integration, enabling the system to run on different operating systems and devices, increasing the system's popularity and market share.
[0156] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0157] The above-mentioned embodiments are only preferred embodiments of the present invention and cannot be used to limit the scope of protection of the present invention. Any non-substantial changes and substitutions made by technicians in this field on the basis of the present invention shall fall within the scope of protection required by the present invention.
Claims
1. A P2P streaming media system supporting live broadcast on demand and multiple streaming media transmission protocols, characterized in that: include: The content management system is used to provide an interface for operation and maintenance configuration of programs, allowing the online and offline operations of live and on-demand programs. After successful configuration, program information is updated. The client obtains the latest configuration and supported programs by requesting the list service; Content storage server, used to store all on-demand audio and video resource files; A program on-demand server, connected to the content storage server and the content management system, for storing detailed list information of program on-demand files, including movie names, movie types, and movie slice information; The live broadcast server is used to receive live broadcast program sources issued by the content management system, obtain program audio and video slice information from the live broadcast program source, and continuously update and store the latest slice information; Tracker server, used to provide hole punching services and NAT type detection between clients; Multiple P2P clients, each of which is integrated with a P2P-SDK, and the P2P clients communicate through the program on-demand server and the program live server to obtain the playback addresses of the on-demand and live programs; The P2P client supports multiple files as data sources, and encapsulates and streams them through the P2P-SDK, so as to distribute the file content to other P2P clients; The P2P client can process multiple block contents simultaneously, and realize merging and distribution through P2P-SDK; The list server is used to generate program links accessible to the client, including the content distribution network entry address, film type, P2P sharing flag and the address information of the Tracker server.
2. The system according to claim 1, characterized in that: The program on demand server comprises: A receiving module, used for receiving on-demand program information sent by the content management system; A processing module is used to process the received on-demand program information, obtain detailed program information, and store it in a database; The information generation module is used to generate a program link accessible to the client according to the stored program detailed information.
3. The system according to claim 1, characterized in that The P2P-SDK supports on-demand video slicing based on the HTTP protocol, including: According to the preset block size, calculate the block range of the file to be transferred; Assign a unique ID to each data block, and record the start byte and end byte of each block to determine the Range; Record the ID, start byte, and end byte information of each data block in one or more index files to quickly locate and reassemble data blocks during transmission and reception; Use the Range header field in the HTTP protocol to specify the range of the required data block when the client requests it, so as to download and play the video on demand; During the transmission process, if a data block fails to be transmitted, the client can re-request the data block based on the information in the index file to achieve breakpoint resumption and error recovery.
4. The system according to claim 1, characterized in that: When P2P clients on different platforms are connected to P2P-SDK, the Tracker server is used to implement penetration between P2P clients, including: Client A establishes a socket and initiates a penetration request to the Tracker server via the UDP protocol; After receiving the penetration request, the Tracker server forwards the request to client B via the TCP protocol; After receiving the penetration request forwarded by the Tracker server, Client B establishes a socket and sends a request to the Tracker server to confirm the penetration through the UDP protocol; After receiving the confirmation request from client B, the Tracker server forwards the confirmation request to client A via the TCP protocol; After receiving each other's confirmation information, client A and client B start the penetration thread respectively and send test information to each other; After confirming that they can correctly receive the test information sent by each other, client A and client B successfully penetrate and communicate directly without the Tracker server.
5. The system according to claim 1, characterized in that: When P2P clients of different platforms are connected to P2P-SDK, a program list containing multiple program list information is obtained from the list server, wherein each program list information includes at least a play address of a program; The player selects a program from the program list and accesses the corresponding playback address; Perform domain name resolution on the playback address to obtain one or more available POP point addresses, where the POP point address refers to the edge node address in the content distribution network; Obtain the slice data of the selected program from the POP point address obtained by parsing; If the slice data of the selected program is hit at the POP point, the slice data is directly transmitted to the player for playback; If the slice data of the selected program is not hit at the POP point, the source is returned to the program live broadcast server, the slice data is obtained from the program live broadcast server, and the obtained slice data is transmitted to the player for playback.
6. The system according to claim 1, characterized in that: The P2P-SDK supports streaming of on-demand programs in HTTP streaming mode, including: Make a request to the list service to obtain detailed information about the program list, including program link, type, and whether P2P sharing is supported; According to the information in the program list, for on-demand programs that support P2P sharing, a request is made to the content distribution network CF portal to obtain the slice details of the program; According to the obtained slice details, recalculate the Range data range of each slice in the order of slice ID increment; According to the calculated Range data range, a GET request is initiated to the edge node POP point of the content distribution network to obtain the audio and video data within the corresponding range; In the process of acquiring audio and video data, P2P-SDK determines whether to enable P2P service based on the program's link information. For programs that support P2P sharing, the P2P function is enabled to achieve data sharing and acceleration.
7. The system according to claim 6, characterized in that: When determining whether to enable P2P service, the following are included: Receiving and parsing a program link to identify whether the program is a live program or a VOD program, and determining whether a P2P sharing function is supported; wherein the program link includes a unique identifier and / or type information of the program; Requesting a corresponding playback address according to the analysis result; receiving and parsing the playback address, and further confirming whether the P2P service needs to be enabled according to specific parameters or formats in the URL; If you are sure that you need to enable the P2P service, configure the P2P-SDK to enable the P2P data sharing function. Otherwise, configure the P2P-SDK to perform data transmission in normal mode.
8. The system according to claim 6, characterized in that: The calculation formula for the Range data range is: ID*SIZE-(ID+1)*SIZE-1 Among them, ID is the identifier of the current slice, and SIZE is the size of each slice.
9. The system according to claim 1, characterized in that: The P2P-SDK provides solutions for on-demand rewind and fast forward, including: For HTTP on-demand, when the user rewinds or fast-forwards, the player initiates a new HTTP request, which contains the information of the data start node. After receiving the HTTP request, the P2P-SDK searches for the data block ID in the local cache list through a binary search algorithm. If the local cache does not hit, it initiates a request to the server and sends the acquired data to the player; if the local cache hits, it directly locates the specific data block and returns it to the player. Among them, no matter obtaining data from the local cache or the server, the stream pulling end will continue to pull the stream according to the latest ID self-increment.
10. The system according to claim 9, characterized in that: The P2P-SDK provides solutions for on-demand rewind and fast forward, including: For HLS and DASH on-demand, when the user rewinds or fast-forwards, the player initiates a new slice request. After receiving the player's request, the P2P-SDK local service also processes it through a binary search algorithm. If the local cache does not hit, it replies to the player with a 302 redirect response, allowing the player to go back to the server to obtain the slice; if the local cache hits, it directly locates the specific data block and returns it to the player.