CN114245233A - 一种基于hls协议播放的认证方法 - Google Patents

一种基于hls协议播放的认证方法 Download PDF

Info

Publication number
CN114245233A
CN114245233A CN202111564580.3A CN202111564580A CN114245233A CN 114245233 A CN114245233 A CN 114245233A CN 202111564580 A CN202111564580 A CN 202111564580A CN 114245233 A CN114245233 A CN 114245233A
Authority
CN
China
Prior art keywords
file
url
streaming media
media server
index file
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.)
Granted
Application number
CN202111564580.3A
Other languages
English (en)
Other versions
CN114245233B (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.)
China Telecom Fufu Information Technology Co Ltd
Original Assignee
China Telecom Fufu Information 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 China Telecom Fufu Information Technology Co Ltd filed Critical China Telecom Fufu Information Technology Co Ltd
Priority to CN202111564580.3A priority Critical patent/CN114245233B/zh
Publication of CN114245233A publication Critical patent/CN114245233A/zh
Application granted granted Critical
Publication of CN114245233B publication Critical patent/CN114245233B/zh
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/80Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
    • H04N21/85Assembly of content; Generation of multimedia applications
    • H04N21/858Linking data to content, e.g. by linking an URL to a video object, by creating a hotspot
    • H04N21/8586Linking data to content, e.g. by linking an URL to a video object, by creating a hotspot by using a URL
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/04Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
    • H04L63/0428Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/235Processing of additional data, e.g. scrambling of additional data or processing content descriptors
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/239Interfacing the upstream path of the transmission network, e.g. prioritizing client content requests
    • H04N21/2393Interfacing the upstream path of the transmission network, e.g. prioritizing client content requests involving handling client requests
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/25Management operations performed by the server for facilitating the content distribution or administrating data related to end-users or client devices, e.g. end-user or client device authentication, learning user preferences for recommending movies
    • H04N21/254Management at additional data server, e.g. shopping server, rights management server
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/435Processing of additional data, e.g. decrypting of additional data, reconstructing software from modules extracted from the transport stream
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/60Network structure or processes for video distribution between server and client or between remote clients; Control signalling between clients, server and network components; Transmission of management data between server and client, e.g. sending from server to client commands for recording incoming content stream; Communication details between server and client 
    • H04N21/63Control signaling related to video distribution between client, server and network components; Network processes for video distribution between server and clients or between remote clients, e.g. transmitting basic layer and enhancement layers over different transmission paths, setting up a peer-to-peer communication via Internet between remote STB's; Communication protocols; Addressing
    • H04N21/643Communication protocols
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/80Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
    • H04N21/83Generation or processing of protective or descriptive data associated with content; Content structuring
    • H04N21/845Structuring of content, e.g. decomposing content into time segments
    • H04N21/8455Structuring of content, e.g. decomposing content into time segments involving pointers to the content, e.g. pointers to the I-frames of the video stream

Landscapes

  • Engineering & Computer Science (AREA)
  • Signal Processing (AREA)
  • Multimedia (AREA)
  • Computer Security & Cryptography (AREA)
  • Databases & Information Systems (AREA)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)

Abstract

本发明涉及一种基于HLS协议播放的认证方法,其包括流媒体服务器、中心管理服务器和客户端,视频或音频上传到所述流媒体服务器上转化成m3u8索引文件和ts文件,包括:m3u8索引文件请求认证过程和ts文件请求认证过程,流媒体服务和加解密服务分别由流媒体服务器和中心管理服务器提供,加解密服务由中心管理服务器提供,有利于降低流媒体服务器的负载,而ts文件请求的ts文件URL由流媒体服务器构造,不必经过中心管理服务器解密,有利于降低整个播放认证系统负载。

Description

一种基于HLS协议播放的认证方法
技术领域
本发明涉及流媒体技术领域,具体涉及了一种基于HLS协议播放的认证方法。
背景技术
在流媒体应用中,个别不法团体或个人为了利益,有可能通过技术手段绕过内容提供商,直接向最终用户提供内容提供商的视频内容。真正的内容提供商得不到任何收益,反而凭空占用服务器带宽,增加服务器负担。针对这一行为,需要一套播放认证系统,判断客户端是否合法,保证音视频的有序、安全播放,以及合法用户、内容提供商的利益不受侵害。
HLS(HTTP Live Streaming)是由Apple公司提出的一种动态码率自适应技术,广泛应用在直播和点播领域。该技术包括m3u8类型的索引文件、ts类型的媒体分片文件。客户端在播放HLS协议媒体时,首先请求m3u8索引文件,通过该文件记录的ts分片列表信息,然后顺序请求ts分片文件,进行音视频播放。相较于RTSP/RTP的实时流媒体协议,HLS协议ts分片的特点,决定了需要频繁发送http请求到服务器来获取m3u8文件和ts文件,大并发应用场景下容易导致负载过大。
发明内容
针对现有技术的不足,本发明提供一种客户端无需任何改动,用户无感知,流媒体服务器仅对必要的请求做认证,降低了服务器资源的占用,有利于大并发环境下稳定提供服务的基于HLS协议播放的认证系统方法。
本发明的一种基于HLS协议播放的认证方法,采用以下技术方案:其包括流媒体服务器、中心管理服务器和客户端,视频或音频上传到所述流媒体服务器上转化成m3u8索引文件和ts文件,在m3u8索引文件的真实URL中设置加密字段形成m3u8索引文件的URL,在ts文件的真实URL中设置一个唯一标识ts文件ID形成ts文件的URL,其中:
S1、m3u8索引文件请求认证方法包括以下步骤:
S1-1、流媒体服务器接收到客户端的m3u8索引文件请求后,提取m3u8索引文件的URL的加密字段;
S1-2、流媒体服务器转发加密字段到中心管理服务器解密;
S1-3、中心管理服务器对加密字段进行解密,获取m3u8索引文件的真实URL,返回给流媒体服务器;
S1-4、流媒体服务器获得m3u8索引文件的真实URL,并返回m3u8索引文件到客户端;
S2、ts文件请求认证方法包括以下步骤:
S2-1、客户端根据m3u8索引文件中的ts文件的URL向流媒体服务器发送ts文件请求;
S2-2、流媒体服务器接收到ts文件请求,提取ts文件ID,并查询历史m3u8索引文件请求认证,获取m3u8索引文件的真实URL;
S2-3、流媒体服务器根据ts文件ID以及m3u8索引文件的真实URL,获取ts文件的真实URL,最终返回ts文件到客户端。
进一步,中心管理服务器定期清理过期的加密字段,如果加密字段被清理,则不允许对该字段进行解密。
进一步,步骤S1-1包括流媒体服务器判断m3u8索引文件的URL是否合规,若不合规则返回错误;若合规,提取m3u8索引文件的URL的加密字段。
进一步,步骤S1-2包括流媒体服务器根据m3u8索引文件的URL查询历史m3u8文件请求是否存在,如果已存在则直接获取m3u8文件的真实URL并返回m3u8文件到客户端,如果不存在则发送流媒体服务器转发加密字段到中心管理服务器解密。
进一步,步骤S1-3包括中心管理服务器查询加密字段是否超过时限,如果超过时限则返回错误;如果未超过时限则进行解密,并返回m3u8文件的真实URL给流媒体服务器。
进一步,步骤S1-4包括流媒体服务器获取m3u8文件的真实URL,将m3u8文件请求和m3u8文件的真实URL保存到历史记录;并返回m3u8文件到客户端。
进一步,步骤S2-2中流媒体服务器接收到ts文件请求,提取ts文件ID的过程,包括判断ts文件请求的URL是否合规,若不合规则返回错误;若合规则提取请求的ts文件ID;
进一步,步骤S2-2中查询历史m3u8索引文件请求,获取m3u8索引文件的真实URL的过程,包括根据ts文件ID查询历史m3u8索引文件请求是否存在,如果不存在则返回错误;如果已存在则获取m3u8文件的真实URL。
进一步,所述ts文件ID为明文或加密字段。
与现有技术相比,本发明的有益效果如下:
1、认证系统采用独特而高效的方式实现,客户端无需任何改动,用户无感知,服务端可以仅对必要的请求做认证,降低了服务器资源的占用,有利于大并发环境下稳定提供服务;
2、流媒体服务和加解密服务分别由流媒体服务器和中心管理服务器提供,加解密服务由中心管理服务器提供,有利于降低流媒体服务器的负载,而ts文件请求的ts文件URL由流媒体服务器构造,不必经过中心管理服务器解密,有利于降低整个播放认证系统负载;
3、在强安全性应用场景下,由于ts文件请求的ts文件URL由流媒体服务器构造,有利于灵活地即时更新文件命名规则,如果安全性还不够,甚至可以对ts文件ID字段进行加密。
附图说明
此处所说明的附图用来提供对本申请的进一步理解,在附图中:
图1为本发明的流程图。
具体实施方式
参见图1所示,实施例的一种基于HLS协议播放的认证方法,采用以下技术方案:其包括流媒体服务器、中心管理服务器和客户端,视频或音频上传到所述流媒体服务器上转化成m3u8索引文件和ts文件,其特征在于:在m3u8索引文件的真实URL中设置加密字段形成m3u8索引文件的URL,在ts文件的真实URL中设置一个唯一标识ts文件ID形成ts文件的URL,其中:
S1、m3u8索引文件请求认证方法包括以下步骤:
S1-1、流媒体服务器接收到客户端的m3u8索引文件请求后,提取m3u8索引文件的URL的加密字段;
S1-2、流媒体服务器转发加密字段到中心管理服务器解密;
S1-3、中心管理服务器对加密字段进行解密,获取m3u8索引文件的真实URL,返回给流媒体服务器;
S1-4、流媒体服务器获得m3u8索引文件的真实URL,并返回m3u8索引文件到客户端;
S2、ts文件请求认证方法包括以下步骤:
S2-1、客户端根据m3u8索引文件中的ts文件的URL向流媒体服务器发送ts文件请求;
S2-2、流媒体服务器接收到ts文件请求,提取ts文件ID,并查询历史m3u8索引文件请求认证,获取m3u8索引文件的真实URL;
S2-3、流媒体服务器根据ts文件ID以及m3u8索引文件的真实URL,获取ts文件的真实URL,最终返回ts文件到客户端。
进一步,中心管理服务器定期清理过期的加密字段,如果加密字段被清理,则不允许对该字段进行解密。
进一步,步骤S1-1包括流媒体服务器判断m3u8索引文件的URL是否合规,若不合规则返回错误;若合规,提取m3u8索引文件的URL的加密字段。
进一步,步骤S1-2包括流媒体服务器根据m3u8索引文件的URL查询历史m3u8文件请求是否存在,如果已存在则直接获取m3u8文件的真实URL并返回m3u8文件到客户端,如果不存在则发送流媒体服务器转发加密字段到中心管理服务器解密。
进一步,步骤S1-3包括中心管理服务器查询加密字段是否超过时限,如果超过时限则返回错误;如果未超过时限则进行解密,并返回m3u8文件的真实URL给流媒体服务器。
进一步,步骤S1-4包括流媒体服务器获取m3u8文件的真实URL,将m3u8文件请求和m3u8文件的真实URL保存到历史记录;并返回m3u8文件到客户端。
进一步,步骤S2-2中流媒体服务器接收到ts文件请求,提取ts文件ID的过程,包括判断ts文件请求的URL是否合规,若不合规则返回错误;若合规则提取请求的ts文件ID;
进一步,步骤S2-2中查询历史m3u8索引文件请求,获取m3u8索引文件的真实URL的过程,包括根据ts文件ID查询历史m3u8索引文件请求是否存在,如果不存在则返回错误;如果已存在则获取m3u8文件的真实URL。
进一步,所述ts文件ID为明文或加密字段。
尽管已经示出和描述了本发明的实施例,对于本领域的普通技术人员而言,可以理解在不脱离本发明的原理和精神的情况下可以对这些实施例进行多种变化、修改、替换和变型,本发明的范围由所附权利要求及其等同物限定。

Claims (9)

1.一种基于HLS协议播放的认证方法,其包括流媒体服务器、中心管理服务器和客户端,视频或音频上传到所述流媒体服务器上转化成m3u8索引文件和ts文件,其特征在于:在m3u8索引文件的真实URL中设置加密字段形成m3u8索引文件的URL,在ts文件的真实URL中设置一个唯一标识ts文件ID形成ts文件的URL,其中:
S1、m3u8索引文件请求认证方法包括以下步骤:
S1-1、流媒体服务器接收到客户端的m3u8索引文件请求后,提取m3u8索引文件的URL的加密字段;
S1-2、流媒体服务器转发加密字段到中心管理服务器解密;
S1-3、中心管理服务器对加密字段进行解密,获取m3u8索引文件的真实URL,返回给流媒体服务器;
S1-4、流媒体服务器获得m3u8索引文件的真实URL,并返回m3u8索引文件到客户端;
S2、ts文件请求认证方法包括以下步骤:
S2-1、客户端根据m3u8索引文件中的ts文件的URL向流媒体服务器发送ts文件请求;
S2-2、流媒体服务器接收到ts文件请求,提取ts文件ID,并查询历史m3u8索引文件请求认证,获取m3u8索引文件的真实URL;
S2-3、流媒体服务器根据ts文件ID以及m3u8索引文件的真实URL,获取ts文件的真实URL,最终返回ts文件到客户端。
2.根据权利要求1所述的一种基于HLS协议播放的认证方法,其特征在于:中心管理服务器定期清理过期的加密字段,如果加密字段被清理,则不允许对该字段进行解密。
3.根据权利要求1所述的一种基于HLS协议播放的认证方法,其特征在于:步骤S1-1包括流媒体服务器判断m3u8索引文件的URL是否合规,若不合规则返回错误;若合规,提取m3u8索引文件的URL的加密字段。
4.根据权利要求1所述的一种基于HLS协议播放的认证方法,其特征在于:步骤S1-2包括流媒体服务器根据m3u8索引文件的URL查询历史m3u8文件请求是否存在,如果已存在则直接获取m3u8文件的真实URL并返回m3u8文件到客户端,如果不存在则发送流媒体服务器转发加密字段到中心管理服务器解密。
5.根据权利要求1所述的一种基于HLS协议播放的认证方法,其特征在于:步骤S1-3包括中心管理服务器查询加密字段是否超过时限,如果超过时限则返回错误;如果未超过时限则进行解密,并返回m3u8文件的真实URL给流媒体服务器。
6.根据权利要求1所述的一种基于HLS协议播放的认证方法,其特征在于:步骤S1-4包括流媒体服务器获取m3u8文件的真实URL,将m3u8文件请求和m3u8文件的真实URL保存到历史记录;并返回m3u8文件到客户端。
7.根据权利要求1所述的一种基于HLS协议播放的认证方法,其特征在于:步骤S2-2中流媒体服务器接收到ts文件请求,提取ts文件ID的过程,包括判断ts文件请求的URL是否合规,若不合规则返回错误;若合规则提取请求的ts文件ID。
8.根据权利要求1所述的一种基于HLS协议播放的认证方法,其特征在于:步骤S2-2中查询历史m3u8索引文件请求,获取m3u8索引文件的真实URL的过程,包括根据ts文件ID查询历史m3u8索引文件请求是否存在,如果不存在则返回错误;如果已存在则获取m3u8文件的真实URL。
9.根据权利要求1所述的一种基于HLS协议播放的认证方法,其特征在于:所述ts文件ID为明文或加密字段。
CN202111564580.3A 2021-12-20 2021-12-20 一种基于hls协议播放的认证方法 Active CN114245233B (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111564580.3A CN114245233B (zh) 2021-12-20 2021-12-20 一种基于hls协议播放的认证方法

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111564580.3A CN114245233B (zh) 2021-12-20 2021-12-20 一种基于hls协议播放的认证方法

Publications (2)

Publication Number Publication Date
CN114245233A true CN114245233A (zh) 2022-03-25
CN114245233B CN114245233B (zh) 2023-04-07

Family

ID=80759520

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111564580.3A Active CN114245233B (zh) 2021-12-20 2021-12-20 一种基于hls协议播放的认证方法

Country Status (1)

Country Link
CN (1) CN114245233B (zh)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102984557A (zh) * 2012-12-06 2013-03-20 深圳市佳创视讯技术股份有限公司 基于drm的流媒体播放系统
CN104320679A (zh) * 2014-10-11 2015-01-28 中兴通讯股份有限公司 一种基于hls协议的用户信息获取方法和服务器
CN107707504A (zh) * 2016-08-08 2018-02-16 中国电信股份有限公司 一种流媒体的播放方法、系统以及服务器和客户端
CN109743586A (zh) * 2018-12-28 2019-05-10 广州华多网络科技有限公司 流媒体直播防盗链方法及系统
CN109874028A (zh) * 2017-12-01 2019-06-11 深圳市雷鸟信息科技有限公司 一种hls流媒体的播放方法、系统及存储介质
US20190268389A1 (en) * 2018-02-28 2019-08-29 Sling Media Pvt. Ltd. Relaying media content via a relay server system without decryption

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102984557A (zh) * 2012-12-06 2013-03-20 深圳市佳创视讯技术股份有限公司 基于drm的流媒体播放系统
CN104320679A (zh) * 2014-10-11 2015-01-28 中兴通讯股份有限公司 一种基于hls协议的用户信息获取方法和服务器
CN107707504A (zh) * 2016-08-08 2018-02-16 中国电信股份有限公司 一种流媒体的播放方法、系统以及服务器和客户端
CN109874028A (zh) * 2017-12-01 2019-06-11 深圳市雷鸟信息科技有限公司 一种hls流媒体的播放方法、系统及存储介质
US20190268389A1 (en) * 2018-02-28 2019-08-29 Sling Media Pvt. Ltd. Relaying media content via a relay server system without decryption
CN109743586A (zh) * 2018-12-28 2019-05-10 广州华多网络科技有限公司 流媒体直播防盗链方法及系统

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
BRANIMIR LAZAREVIĆ: "Recording and Protect HLS Adaptive Data Flow on Devices with the Android Oreo Operating System" *
王莹: "HTML5下的流媒体内容保护系统的设计与实现" *

Also Published As

Publication number Publication date
CN114245233B (zh) 2023-04-07

Similar Documents

Publication Publication Date Title
US9641323B2 (en) Security processing system and method for HTTP live streaming
US8832726B2 (en) Video streaming entitlement determined based on the location of the viewer
US10567816B2 (en) Delivering content
US8555367B2 (en) Method and system for securely streaming content
US8767961B2 (en) Secure live television streaming
EP2829073B1 (en) Controlling access to ip streaming content
US11838413B2 (en) Content recognition systems and methods for encrypted data structures
US20090044241A1 (en) Broadcasting content protection/management system
US9215492B2 (en) Advertisement analysis and error correlation
KR20140121373A (ko) 적응성 스트리밍을 위한 콘텐츠 필터링
CA2646920A1 (en) Peer-to-peer video on demand techniques
KR20110004333A (ko) 스트림에서의 레코딩가능한 콘텐트의 프로세싱
US11159832B2 (en) Automated video content processing
CA2845092A1 (en) Segmented content delivery
KR20110004332A (ko) 스트림에서의 레코딩가능한 콘텐트의 프로세싱
CN114245233B (zh) 一种基于hls协议播放的认证方法
US10440097B1 (en) Profile based streaming
CN112752122A (zh) 智能摄像头的视频加密传输方法及计算机可读存储介质

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
GR01 Patent grant
GR01 Patent grant