CN109743586B - Method and system for preventing stealing link of live broadcast of streaming media - Google Patents

Method and system for preventing stealing link of live broadcast of streaming media Download PDF

Info

Publication number
CN109743586B
CN109743586B CN201811618392.2A CN201811618392A CN109743586B CN 109743586 B CN109743586 B CN 109743586B CN 201811618392 A CN201811618392 A CN 201811618392A CN 109743586 B CN109743586 B CN 109743586B
Authority
CN
China
Prior art keywords
index file
acquisition request
fragment
address
request
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201811618392.2A
Other languages
Chinese (zh)
Other versions
CN109743586A (en
Inventor
陈宇辉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangzhou Cubesili Information Technology Co Ltd
Original Assignee
Guangzhou Cubesili 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 Guangzhou Cubesili Information Technology Co Ltd filed Critical Guangzhou Cubesili Information Technology Co Ltd
Priority to CN201811618392.2A priority Critical patent/CN109743586B/en
Publication of CN109743586A publication Critical patent/CN109743586A/en
Application granted granted Critical
Publication of CN109743586B publication Critical patent/CN109743586B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Information Transfer Between Computers (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention provides a method and a system for preventing a live broadcast of streaming media from stealing a link, wherein the method comprises the following steps: receiving a streaming media playing request sent by a client; when the stream media playing request is confirmed to be legal, generating a stream media playing chain grounding address containing a global unique mark according to the stream media playing request; sending the streaming media playing chain grounding address to a client; receiving an index file link acquisition request containing a streaming media playing link address sent by a client, and generating a fragment index file link address according to a global unique mark when the index file link acquisition request is confirmed to be legal according to the global unique mark; sending the link address of the fragment index file to the client; receiving a fragment content acquisition request containing a fragment index file link address sent by a client; and when the fragment content acquisition request is confirmed to be legal according to the global unique mark, returning the fragment content corresponding to the fragment content acquisition request to the client. Thus, HLS anti-theft chains can be implemented simply and efficiently at a small cost.

Description

Method and system for preventing stealing link of live broadcast of streaming media
Technical Field
The invention relates to the technical field of streaming media, in particular to a live broadcast anti-stealing link method and a live broadcast anti-stealing link system for streaming media.
Background
In a standard HLS (HTTP Live Streaming, Apple dynamic rate adaptive technology) Live broadcast scene, after acquiring an m3u8 play link, a client sends the m3u8 play link to a player for playing. The player periodically and repeatedly requests the same m3u8 link to refresh the playlist via HTTP protocol, so the traditional URL token + timestamp verification is not applicable to HLS hotlink.
The existing HLS anti-theft chain scheme is as follows:
1. using EXT-X-KEY tag in HLS standard: the key acquisition process of the scheme is complex, ts needs to be encrypted and decrypted, and the requirement on the performance of the playing end is high.
2. By encrypting the m3u8 list: this solution requires client customization and is not compatible with standard players.
Disclosure of Invention
The invention provides a live broadcast anti-theft chain method and system for streaming media, which aim to simply and efficiently realize an HLS anti-theft chain with low cost on the premise of meeting HLS standards.
The present invention provides the following scheme:
a live broadcast anti-stealing link method for streaming media is applied to a server side, and comprises the following steps: receiving a streaming media playing request sent by a client; when the stream media playing request is confirmed to be legal, generating a stream media playing chain grounding address containing a global unique mark according to the stream media playing request; sending the streaming media playing chain grounding address to the client; receiving an index file link acquisition request containing the streaming media playing link address sent by the client, and generating a fragment index file link address according to the global unique mark when the index file link acquisition request is confirmed to be legal according to the global unique mark; sending the fragment index file link address to the client; receiving a fragment content acquisition request containing the fragment index file link address sent by the client; and when the fragment content acquisition request is confirmed to be legal according to the global unique mark, returning the fragment content corresponding to the fragment content acquisition request to the client.
In one embodiment, the streaming media play chain address further includes a timestamp and an encryption string; the method comprises the steps of receiving an index file link acquisition request which is sent by a client and contains the streaming media playing link address, and generating a fragment index file link address according to a global unique mark when the index file link acquisition request is confirmed to be legal according to the global unique mark; sending the fragment index file link address to the client, including: receiving an index file link acquisition request which is sent by the client and contains the global unique mark, the timestamp and the encryption string; when the encryption string is confirmed to be correct, judging whether the global unique mark exists or not; if yes, judging whether the ip address of the index file link acquisition request is consistent with the ip address of the corresponding cache or not when the fact that the global unique mark cache is not expired is confirmed; when the ip address of the index file link acquisition request is consistent with the ip address of the corresponding cache, generating a fragment index file link address according to the global unique mark, and sending the fragment index file link address to the client; if not, judging whether the timestamp is expired; and when the timestamp is not expired, generating a fragment index file link address according to the global unique mark, and sending the fragment index file link address to the client.
In an embodiment, the method further comprises: when the encryption string is confirmed to be incorrect, rejecting an index file link acquisition request of the client; when the timestamp is expired, rejecting an index file link acquisition request of the client; when the ip address of the index file link acquisition request is inconsistent with the ip address of the corresponding cache, judging whether a request head Referer and a request head User-Agent of the index file link acquisition request are consistent with a request head Referer and a request head User-Agent of the corresponding cache of the index file link acquisition request; if so, generating a fragment index file link address according to the global unique mark, and sending the fragment index file link address to the client; and if not, rejecting the index file link acquisition request of the client.
In an embodiment, before generating the fragmented index file link address according to the globally unique identifier, the method further includes: refreshing the expiration time corresponding to the index file link acquisition request according to the timestamp; the expiration time is used for judging whether the timestamp is expired.
In an embodiment, the method further comprises: and caching the global unique mark, the ip address of the index file link acquisition request, the request head Referer of the index file link acquisition request and the request head User-Agent when the encryption string is confirmed to be correct.
In an embodiment, when it is determined that the fragmented content acquisition request is legal according to the global unique identifier, returning the fragmented content corresponding to the fragmented content acquisition request to the client, includes: judging whether the encryption string in the fragment content acquisition request is correct or not; if yes, respectively judging whether the ip address, the request head Referer and the request head User-Agent in the fragment content acquisition request are consistent with the ip address, the request head Referer and the request head User-Agent corresponding to the fragment content acquisition request in the cache; and if the ip address in the fragment content acquisition request is consistent with the ip address corresponding to the fragment content acquisition request in the cache, or the request header Referer in the fragment content acquisition request is consistent with the request header Referer corresponding to the fragment content acquisition request in the cache, and the request header User-Agent in the fragment content acquisition request is consistent with the request header User-Agent corresponding to the fragment content acquisition request in the cache, returning the fragment content corresponding to the fragment content acquisition request to the client when the fragment content sequence number requested in the fragment content acquisition request is confirmed to be greater than the fragment content sequence number corresponding to the cached fragment content acquisition request.
In an embodiment, the method further comprises: and updating the cached fragment content serial number corresponding to the fragment content acquisition request when the fragment content serial number requested in the fragment content acquisition request is confirmed to be larger than the cached fragment content serial number corresponding to the fragment content acquisition request.
A live broadcast anti-stealing link method for streaming media is applied to a client, and comprises the following steps: responding to the streaming media playing operation of a user, and sending a streaming media playing request to a server; receiving a streaming media playing chain address which contains a global unique mark and is sent by the server; sending an index file link acquisition request to the server side according to the streaming media play link address containing the global unique mark; receiving a fragment index file link address containing the global unique mark sent by the server; sending a fragment content acquisition request to the server side according to the fragment index file link address; and receiving the fragment content sent by the server.
A live-broadcast anti-theft chain system of streaming media is applied to a server side and comprises: the streaming media playing chain address generating module is used for receiving a streaming media playing request sent by a client; when the stream media playing request is confirmed to be legal, generating a stream media playing chain grounding address containing a global unique mark according to the stream media playing request; sending the streaming media playing chain grounding address to the client; the fragment index file link address generation module is used for receiving an index file link acquisition request which is sent by the client and contains the streaming media playing link address, and generating a fragment index file link address according to the global unique mark when the index file link acquisition request is confirmed to be legal according to the global unique mark; sending the fragment index file link address to the client; a fragmented content acquisition request receiving module, configured to receive a fragmented content acquisition request that includes the fragmented index file link address and is sent by the client; and the fragment content sending module is used for returning the fragment content corresponding to the fragment content acquisition request to the client when the fragment content acquisition request is confirmed to be legal according to the global unique mark.
A live-broadcast anti-theft chain system for streaming media is applied to a client, and comprises: the user operation response module is used for responding to the streaming media playing operation of the user and sending a streaming media playing request to the server; the streaming media playing chain grounding address receiving module is used for receiving the streaming media playing chain grounding address which contains the global unique mark and is sent by the server; an index file link acquisition request sending module, configured to send an index file link acquisition request to the server according to the streaming media play link address containing the globally unique identifier; the fragment index file link address receiving module is used for receiving the fragment index file link address containing the globally unique mark sent by the server; a fragment content acquisition request sending module, configured to send a fragment content acquisition request to the server according to the fragment index file link address; and the fragment content receiving module is used for receiving the fragment content sent by the server side.
In the method for preventing stealing link of live streaming media provided by the above embodiment, when receiving a streaming media playing request sent by a client, a service server at a server side judges the validity of the streaming media playing request. And when the streaming media playing request is legal, generating a streaming media playing link address containing a globally unique mark, and uniquely marking each process of the streaming media playing request response. And simultaneously, transmitting the streaming media playing chain address containing the globally unique mark to the client. When the client receives the streaming media playing link address, an index file link acquisition request is sent to a media server of the server according to the address, and when the media server confirms the legality of the request according to the global unique mark, the fragment index file link address containing the global unique mark is fed back to the client. Therefore, the client can repeatedly request the corresponding fragment content from the media server according to the fragment index file link address containing the globally unique mark, and accordingly the fragment content is played. In the method for preventing the theft chain of the streaming media live broadcast, the server side confirms the legality of each request process of the client side through the global unique mark in the process that the client side requests the server side for the fragment content of the streaming media broadcast, and the theft chain of the streaming media can be realized without encrypting the fragment content file, so that the HLS theft chain can be realized simply and efficiently with low cost on the premise of meeting the HLS standard.
Additional aspects and advantages of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention.
Drawings
The foregoing and/or additional aspects and advantages of the present invention will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings of which:
fig. 1 is a logic flow diagram of an embodiment of a live streaming process provided by the present invention;
fig. 2 is a flowchart of a method in an embodiment of a live streaming anti-stealing link method according to the present invention;
FIG. 3 is a flowchart of a method of step S200 according to an embodiment of the present invention;
FIG. 4 is a flowchart of a method of step S400 provided by the present invention;
FIG. 5 is a flowchart of a method in another embodiment of a live streaming anti-stealing link method according to the present invention;
FIG. 6 is a flow diagram of a method in one embodiment of a media server processing an m3u8 request;
FIG. 7 is a flow chart of a method in one embodiment of a media server processing a ts request in accordance with the present invention;
fig. 8 is a schematic structural diagram of an embodiment of a live streaming anti-stealing link apparatus according to the present invention;
fig. 9 is a schematic structural diagram of another embodiment of a live streaming anti-stealing link apparatus according to the present invention.
Detailed Description
Reference will now be made in detail to embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the drawings are illustrative only and should not be construed as limiting the invention.
It will be understood by those skilled in the art that, unless otherwise specified, the singular forms "a", "an", "the" and "the" may include the plural forms as well, and the "first" and "second" used herein are only used to distinguish one technical feature from another and are not intended to limit the order, number, etc. of the technical features. It will be further understood that the terms "comprises" and/or "comprising," when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It will be understood by those skilled in the art that, unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. It will be further understood that terms, such as those defined in commonly used dictionaries, should be interpreted as having a meaning that is consistent with their meaning in the context of the prior art and will not be interpreted in an idealized or overly formal sense unless expressly so defined herein.
URL token: and the encryption string is calculated according to the information such as the expiration time in the URL (uniform resource locator) and the key.
uuid: a string for a globally unique tag.
Referer: request header in HTTP protocol.
User-Agent: request header in HTTP protocol.
The invention provides a live streaming anti-theft link method, which can identify most of anti-theft link requests, has the advantages of simplicity, high efficiency and good universality compared with the traditional streaming anti-theft link scheme, and achieves the HLS anti-theft link purpose with lower cost. The system of the streaming media live broadcasting method and the corresponding streaming media live broadcasting process of the invention are explained first in the following:
the streaming media live broadcast system mainly comprises a user terminal and a server terminal. The user terminal comprises a client, and the server comprises a service server and a media server. The specific logic of the streaming media live broadcast process is shown in fig. 1. Specifically, the client sends a request for obtaining the HLS link to a service server of the server, and the service server responds to the request of the client and feeds back an HLS address to the client. After receiving the HLS address, the client sends an HLS m3u8 request to the media server on the server side. And the media server returns the corresponding HLS TS link address to the client. And the client sends an HLS TS request to the media server according to the HLS TS link again, so that the media server feeds back a TS file to the client for the client to play the streaming media content.
And the general server side carries out validity authentication on the request of the client side through the ip address. When the client requests an index file (such as an m3u8 file) of the streaming media file from the server through the URL, the media server compares the ip of the client with the ip in the encryption information of the service server, and determines whether the ip of the client is the same as the ip of the encryption information of the service server. If the two are different, the URL is stolen. Otherwise, the user of the client is the authorized user. However, the ip address of the client is easily stolen by imitation, which causes leakage of live broadcast resources or illegal abuse of the live broadcast resources.
The invention provides a live broadcast anti-stealing link method for streaming media, which is applied to a server side. In an embodiment, as shown in fig. 2, the live streaming anti-stealing link method includes the following steps:
s100, receiving a streaming media playing request sent by a client; when the stream media playing request is confirmed to be legal, generating a stream media playing chain grounding address containing a global unique mark according to the stream media playing request; and sending the streaming media playing chain grounding address to the client.
In this embodiment, the service server receives a streaming media playing request sent by a client. Specifically, the streaming media playing request is a request for acquiring an HLS playing link. And when the service server receives a streaming media playing request of the client, verifying the legality of the request. And if the streaming media playing request is legal, generating a streaming media playing chain grounding address according to the streaming media playing request. The streaming media playing link address comprises a globally unique mark, an expiration timestamp expiretime, a URL token and the like. The global unique mark is used for uniquely marking the streaming media playing request sent by the client in the system. Further, the service server feeds back the streaming media playing link address to the client.
S200, receiving an index file link acquisition request containing the streaming media playing link address sent by the client, and generating a fragment index file link address according to the global unique mark when the index file link acquisition request is confirmed to be legal according to the global unique mark; and sending the link address of the fragment index file to the client.
In this embodiment, after receiving a streaming media play link address issued by a service server, a client sends an index file link acquisition request of the streaming media play to a media server at a server according to the streaming media play link address. The index file link acquisition request comprises a streaming media play link address, so that the media server can resolve the corresponding index file link according to the address. Wherein the index file may be an m3u8 file. Specifically, after the media server reads the global unique mark in the index file link acquisition request sent by the client, the global unique mark is matched with a corresponding mark in the service server encryption information. And if the global unique mark is consistent with the corresponding mark in the encrypted information of the service server, confirming that the index file link acquisition request sent by the client is legal. Otherwise, the index file link acquisition request is considered to be illegal. Further, if the index file link acquisition request is legal, a fragment index file link address is generated according to the global unique mark. Wherein, the link address of the fragment index file contains the global unique mark. And further sending the link address of the fragment index file to the client.
In an embodiment, the streaming media play chain address further includes a timestamp and an encryption string. At this time, as shown in fig. 3, step S200 includes:
s210, receiving an index file link acquisition request which is sent by the client and contains the global unique mark, the timestamp and the encryption string.
S220, when the encryption string is confirmed to be correct, whether the globally unique mark exists is judged.
S230, if yes, judging whether the ip address of the index file link acquisition request is consistent with the ip address of the corresponding cache when the fact that the global unique mark cache is not expired is confirmed; and when the ip address of the index file link acquisition request is consistent with the ip address of the corresponding cache, generating a fragment index file link address according to the global unique mark, and sending the fragment index file link address to the client.
S240, if not, judging whether the timestamp is overdue or not; and when the timestamp is not expired, generating a fragment index file link address according to the global unique mark, and sending the fragment index file link address to the client.
In this embodiment, the index file link obtaining request sent by the client includes a globally unique flag, a timestamp, and an encryption string. Specifically, the index file link acquisition request includes a streaming media play link address issued by the service server. When the business server generates a streaming media playing link address, a link address is added with a globally unique mark, a timestamp and an encryption string. The media server obtains the global unique mark, the timestamp and the encryption string by analyzing the streaming media play link address in the request. Further, it is first determined whether the encryption string is correct, i.e., consistent with the encryption string used by the system to encrypt the link address. And when the encryption string is confirmed to be correct, judging whether a global unique mark exists. The method for determining that the globally unique mark exists may be to detect whether the request includes corresponding mark information. If not, the link address is directly judged to have no global unique mark. If yes, further judging whether the mark information is a globally unique mark set by the system. If so, the globally unique mark exists. At this time, when the cache of the global unique mark is further confirmed to be not expired, whether the ip address of the index file link acquisition request is consistent with the ip address of the corresponding cache in the system is judged. And when the ip address of the index file link acquisition request is consistent with the ip address of the corresponding cache, generating a fragment index file link address according to the global unique mark, and sending the fragment index file link address to the client. And if not, the global unique mark does not exist. At this time, whether the timestamp is expired is judged. And when the timestamp is not expired, generating a fragment index file link address according to the global unique mark, and sending the fragment index file link address to the client. Meanwhile, when the encryption string is confirmed to be correct, the globally unique mark, the ip address of the index file link acquisition request, the request head Referer of the index file link acquisition request and the request head User-Agent are cached, so that the globally unique mark, the ip address of the index file link acquisition request, the request head Referer of the index file link acquisition request and the request head User-Agent are read out from the system cache for matching identification.
In this embodiment, before generating the fragmented index file link address according to the global unique identifier, the method further includes: refreshing the expiration time corresponding to the index file link acquisition request according to the timestamp; the expiration time is used for judging whether the timestamp is expired. That is, before generating the link address of the fragmented index file each time, the expiration time for determining whether the timestamp is expired needs to be updated, so as to determine whether the timestamp in the subsequent request is expired.
In an implementation manner of this embodiment, the live streaming anti-stealing link method further includes:
when the encryption string is confirmed to be incorrect, rejecting an index file link acquisition request of the client;
when the timestamp is expired, rejecting an index file link acquisition request of the client;
when the ip address of the index file link acquisition request is inconsistent with the ip address of the corresponding cache, judging whether a request head Referer and a request head User-Agent of the index file link acquisition request are consistent with a request head Referer and a request head User-Agent of the corresponding cache of the index file link acquisition request; if so, generating a fragment index file link address according to the global unique mark, and sending the fragment index file link address to the client; and if not, rejecting the index file link acquisition request of the client.
In this embodiment, if the media server determines that the encryption string in the index file link acquisition request sent by the client is incorrect at the beginning, the index file link acquisition request of the client is directly rejected, and the subsequent steps are not determined any more. Or, the media server refuses the index file link acquisition request of the client when confirming that the time stamp in the index file link acquisition request is expired. Or when the ip address of the index file link acquisition request is inconsistent with the ip address of the corresponding cache, further judging whether the request header refer and the request header User-Agent of the index file link acquisition request are consistent with the request header refer and the request header User-Agent cached in the system corresponding to the index file link acquisition request. And if so, generating a fragment index file link address according to the global unique mark, and sending the fragment index file link address to the client. And if not, rejecting the index file link acquisition request of the client.
S300, receiving a fragment content acquisition request containing the fragment index file link address sent by the client.
In this embodiment, after receiving a fragment index file link address issued by a media server, a client sends a request for acquiring fragment content of streaming media to the media server according to the fragment index file link address. After the media server receives the request, the media server can analyze the link address of the fragment index file from the request, and read the corresponding fragment content according to the link address of the fragment index file.
S400, when the fragment content acquisition request is confirmed to be legal according to the global unique mark, the fragment content corresponding to the fragment content acquisition request is returned to the client.
In this embodiment, when receiving a fragment content acquisition request sent by a client, a media server parses a fragment index file link address in the request, and determines whether the address includes flag information. If the global unique mark is included, whether the global unique mark is consistent with the mark information in the encrypted information of the service server is judged. If so, judging that the fragment content acquisition request is legal, reading the fragment content of the corresponding streaming media according to the fragment index file link address in the fragment content acquisition request, and sending the fragment content to the client for playing by the client. If not, directly rejecting the fragment content acquisition request of the client.
In one embodiment, as shown in fig. 4, step S400 includes:
s410, judging whether the encryption string in the fragment content acquisition request is correct.
And S420, if yes, respectively judging whether the ip address, the request header Referer and the request header User-Agent in the fragment content acquisition request are consistent with the ip address, the request header Referer and the request header User-Agent corresponding to the fragment content acquisition request in the cache.
And S430, if the ip address in the fragment content acquisition request is consistent with the ip address corresponding to the fragment content acquisition request in the cache, or the request header Referer in the fragment content acquisition request is consistent with the request header Referer corresponding to the fragment content acquisition request in the cache, and the request header User-Agent in the fragment content acquisition request is consistent with the request header User-Agent corresponding to the fragment content acquisition request in the cache, returning the fragment content corresponding to the fragment content acquisition request to the client when the fragment content sequence number requested in the fragment content acquisition request is confirmed to be greater than the fragment content sequence number corresponding to the cached fragment content acquisition request.
In this embodiment, the fragment content acquisition request of the fragment index file link address sent by the client to the media server includes an encryption string, an ip address, a request header refer, a request header User-Agent, and the like. The media server detects whether the encryption string in the fragment content acquisition request is correct. If the encryption string is correct, further respectively judging whether the ip address, the request header refer and the request header User-Agent in the fragment content acquisition request are consistent with the ip address, the request header refer and the request header User-Agent corresponding to the fragment content acquisition request in the system cache. And if the ip address in the fragmented content acquisition request is consistent with the ip address corresponding to the fragmented content acquisition request in the system cache, or the request header refer in the fragmented content acquisition request is consistent with the request header refer corresponding to the fragmented content acquisition request in the system cache, and the request header User-Agent in the fragmented content acquisition request is consistent with the request header User-Agent corresponding to the fragmented content acquisition request in the system cache, further returning the fragmented content corresponding to the fragmented content acquisition request to the client when the fragmented content sequence number requested in the fragmented content acquisition request is determined to be greater than the fragmented content sequence number corresponding to the cached fragmented content acquisition request. Further, the sequence number of the fragment content corresponding to the cached fragment content acquisition request is updated, so that the subsequent fragment content returned to the client according to the sequence number of the fragment content is updated synchronously.
In the method for preventing stealing link of live streaming media provided by the above embodiment, when receiving a streaming media playing request sent by a client, a service server at a server side judges the validity of the streaming media playing request. And when the streaming media playing request is legal, generating a streaming media playing link address containing a globally unique mark, and uniquely marking each process of the streaming media playing request response. And simultaneously, transmitting the streaming media playing chain address containing the globally unique mark to the client. When the client receives the streaming media playing link address, an index file link acquisition request is sent to a media server of the server according to the address, and when the media server confirms the legality of the request according to the global unique mark, the fragment index file link address containing the global unique mark is fed back to the client. Therefore, the client can repeatedly request the corresponding fragment content from the media server according to the fragment index file link address containing the globally unique mark, and accordingly the fragment content is played. In the method for preventing the theft chain of the streaming media live broadcast, the server side confirms the legality of each request process of the client side through the global unique mark in the process that the client side requests the server side for the fragment content of the streaming media broadcast, and the theft chain of the streaming media can be realized without encrypting the fragment content file, so that the HLS theft chain can be realized simply and efficiently with low cost on the premise of meeting the HLS standard.
The invention also provides a live broadcast anti-stealing link method for the streaming media. The live broadcast anti-stealing link method of the streaming media is applied to the client. In one embodiment, as shown in FIG. 5, the method includes the steps of:
and S10, responding to the streaming media playing operation of the user, and sending a streaming media playing request to the server side.
And S20, receiving the streaming media playing link address containing the globally unique mark sent by the server.
And S30, sending an index file link acquisition request to the server side according to the streaming media play link address containing the global unique mark.
And S40, receiving the fragment index file link address containing the globally unique mark sent by the server.
And S50, sending a fragment content acquisition request to the server according to the fragment index file link address.
And S60, receiving the slicing content sent by the server.
In this embodiment, the method corresponds to the above server-side live streaming anti-stealing link method. The live-broadcast anti-theft-chain method of the streaming media is applied to the client corresponding to the server. Specifically, the client sends a streaming media playing request to the service server of the server in response to the streaming media playing operation. Further, the client receives the streaming media play link address containing the global unique mark sent by the service server, and further sends an index file link acquisition request to the media server of the server according to the streaming media play link address containing the global unique mark. The request includes the streaming media play chain address. And the media server sends the fragment index file link address to the client according to the streaming media play link address in the index file link acquisition request. The client sends the fragment content acquisition request to the media server again according to the link address of the fragment index file sent by the media server, so that the media server sends the corresponding fragment content to the client. And after receiving the fragment content of the streaming media, the client plays the fragment content.
To further illustrate the above-mentioned live streaming anti-stealing link method applied to the server and the client, the following provides an embodiment in a specific scenario:
the specific logic of the streaming media live broadcast flow in this specific scenario is shown in fig. 1:
first, the client requests the HLS play link from the service server. And the service server verifies the legality of the client request. Meanwhile, the service server generates a unique HLS playing link for each request by adding the uuid parameter, appends an expiration timestamp expiretime and a URL token, and generates a link format such as http:// xxx.m3u8uuid ═ xxx & expiretime ═ xxx & token ═ xxx.
Second, the client continuously requests an m3u8 link from the media server using the HTTP protocol. Referring to fig. 6, the following process is included:
firstly, the media server verifies the validity of the m3u8 request:
1. the media server verifies whether the token parameter is correct.
2, the media server verifies whether the uuid is expired; if no uuid cache exists, verifying whether the expiretime parameter is expired; and if the uuid cache exists, verifying whether the cache is expired.
3. The media server checks whether the request ip, the refer and the User-Agent are consistent with the cache, and if the ip is consistent or the refer and the User-Agent are consistent, the media server passes the process.
4. And the media server adds the uuid and the corresponding client ip, refer and User-Agent into the cache, and refreshes the cache expiration time.
And secondly, the media server generates an m3u8 list, ts fragments in the list are sequentially increased, ts fragment links carry uuid in m3u8 and token calculated according to uuid, and the ts link format is http:// xxx.tsuuid.
And thirdly, the client requests ts fragments from the media server according to the ts links in the m3u8 list. Referring to fig. 7, the specific process includes:
1. the media server verifies the legitimacy of the ts request; the media server verifies whether the ts link token parameter is correct; the media server checks whether the request ip, the Referer and the User-Agent are consistent with the cache, and if the ip is consistent or the Referer and the User-Agent are consistent, the media server passes the process; the media server verifies whether the ts sequence number of the request is larger than the sequence number in the uuid cache; the media server updates the ts sequence number in the uuid cache.
2. The media server returns ts-sliced content.
The live-broadcast anti-stealing-link method for the streaming media in the specific implementation scene can realize the anti-stealing-link function of the streaming media without encrypting and decrypting ts on the premise of meeting the HLS standard.
The invention also provides a streaming media live broadcast anti-theft chain system, which is applied to the server side. In one embodiment, as shown in fig. 8, the system includes a streaming media playing link address generating module 10, a segment index file link address generating module 20, a segment content obtaining request receiving module 30, and a segment content transmitting module 40.
The streaming media playing chain address generating module 10 is configured to receive a streaming media playing request sent by a client; when the stream media playing request is confirmed to be legal, generating a stream media playing chain grounding address containing a global unique mark according to the stream media playing request; and sending the streaming media playing chain grounding address to the client. In this embodiment, the service server receives a streaming media playing request sent by a client. Specifically, the streaming media playing request is a request for acquiring an HLS playing link. And when the service server receives a streaming media playing request of the client, verifying the legality of the request. And if the streaming media playing request is legal, generating a streaming media playing chain grounding address according to the streaming media playing request. The streaming media playing link address comprises a globally unique mark, an expiration timestamp expiretime, a URL token and the like. The global unique mark is used for uniquely marking the streaming media playing request sent by the client in the system. Further, the service server feeds back the streaming media playing link address to the client.
The fragment index file link address generation module 20 is configured to receive an index file link acquisition request that is sent by the client and includes the streaming media play link address, and generate a fragment index file link address according to the global unique identifier when the index file link acquisition request is determined to be legal according to the global unique identifier; and sending the link address of the fragment index file to the client. In this embodiment, after receiving a streaming media play link address issued by a service server, a client sends an index file link acquisition request of the streaming media play to a media server at a server according to the streaming media play link address. The index file link acquisition request comprises a streaming media play link address, so that the media server can resolve the corresponding index file link according to the address. Wherein the index file may be an m3u8 file. Specifically, after the media server reads the global unique mark in the index file link acquisition request sent by the client, the global unique mark is matched with a corresponding mark in the service server encryption information. And if the global unique mark is consistent with the corresponding mark in the encrypted information of the service server, confirming that the index file link acquisition request sent by the client is legal. Otherwise, the index file link acquisition request is considered to be illegal. Further, if the index file link acquisition request is legal, a fragment index file link address is generated according to the global unique mark. Wherein, the link address of the fragment index file contains the global unique mark. And further sending the link address of the fragment index file to the client.
The fragmented content acquisition request receiving module 30 is configured to receive a fragmented content acquisition request that includes the fragmented index file link address and is sent by the client. In this embodiment, after receiving a fragment index file link address issued by a media server, a client sends a request for acquiring fragment content of streaming media to the media server according to the fragment index file link address. After the media server receives the request, the media server can analyze the link address of the fragment index file from the request, and read the corresponding fragment content according to the link address of the fragment index file.
The fragmented content sending module 40 is configured to, when it is determined that the fragmented content obtaining request is legal according to the global unique identifier, return fragmented content corresponding to the fragmented content obtaining request to the client. In this embodiment, when receiving a fragment content acquisition request sent by a client, a media server parses a fragment index file link address in the request, and determines whether the address includes flag information. If the global unique mark is included, whether the global unique mark is consistent with the mark information in the encrypted information of the service server is judged. If so, judging that the fragment content acquisition request is legal, reading the fragment content of the corresponding streaming media according to the fragment index file link address in the fragment content acquisition request, and sending the fragment content to the client for playing by the client. If not, directly rejecting the fragment content acquisition request of the client.
The invention also provides a streaming media live broadcast anti-theft chain system which is applied to the client. In one embodiment, as shown in fig. 9, the system includes a user operation response module 11, a streaming media play link address receiving module 22, an index file link acquisition request sending module 33, a fragmented index file link address receiving module 44, a fragmented content acquisition request sending module 55, and a fragmented content receiving module 66.
The user operation response module 11 is configured to send a streaming media play request to the server side in response to a streaming media play operation of a user. The streaming media play link address receiving module 22 is configured to receive the streaming media play link address containing the globally unique identifier sent by the server. The index file link obtaining request sending module 33 is configured to send an index file link obtaining request to the server according to the streaming media play link address containing the globally unique identifier. The fragment index file link address receiving module 44 is configured to receive a fragment index file link address that includes the globally unique identifier and is sent by the server. The fragment content obtaining request sending module 55 is configured to send a fragment content obtaining request to the server according to the fragment index file link address. The fragmented content receiving module 66 is configured to receive fragmented content sent by the server side.
In this embodiment, the client sends a streaming media play request to the service server of the server in response to the streaming media play operation. Further, the client receives the streaming media play link address containing the global unique mark sent by the service server, and further sends an index file link acquisition request to the media server of the server according to the streaming media play link address containing the global unique mark. The request includes the streaming media play chain address. And the media server sends the fragment index file link address to the client according to the streaming media play link address in the index file link acquisition request. The client sends the fragment content acquisition request to the media server again according to the link address of the fragment index file sent by the media server, so that the media server sends the corresponding fragment content to the client. And after receiving the fragment content of the streaming media, the client plays the fragment content.
It should be understood that each functional unit in the embodiments of the present invention may be integrated into one processing module, each unit may exist alone physically, or two or more units may be integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode.
The foregoing is only a partial embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present invention, and these modifications and decorations should also be regarded as the protection scope of the present invention.

Claims (10)

1. A live broadcast anti-stealing-link method for streaming media is applied to a server side, and comprises the following steps:
receiving a streaming media playing request sent by a client; when the stream media playing request is confirmed to be legal, generating a stream media playing chain grounding address containing a global unique mark according to the stream media playing request; sending the streaming media playing chain grounding address to the client;
receiving an index file link acquisition request containing the streaming media playing link address sent by the client, and generating a fragment index file link address according to the global unique mark when the index file link acquisition request is confirmed to be legal according to the global unique mark; sending the fragment index file link address to the client;
receiving a fragment content acquisition request containing the fragment index file link address sent by the client;
and when the fragment content acquisition request is confirmed to be legal according to the global unique mark, returning the fragment content corresponding to the fragment content acquisition request to the client.
2. The method of claim 1, wherein the streaming media playlist address further comprises a timestamp and an encryption string; the method comprises the steps of receiving an index file link acquisition request which is sent by a client and contains the streaming media playing link address, and generating a fragment index file link address according to a global unique mark when the index file link acquisition request is confirmed to be legal according to the global unique mark; sending the fragment index file link address to the client, including:
receiving an index file link acquisition request which is sent by the client and contains the global unique mark, the timestamp and the encryption string;
when the encryption string is confirmed to be correct, judging whether the global unique mark exists or not;
if yes, judging whether the ip address of the index file link acquisition request is consistent with the ip address of the corresponding cache or not when the fact that the global unique mark cache is not expired is confirmed; when the ip address of the index file link acquisition request is consistent with the ip address of the corresponding cache, generating a fragment index file link address according to the global unique mark, and sending the fragment index file link address to the client;
if not, judging whether the timestamp is expired; and when the timestamp is not expired, generating a fragment index file link address according to the global unique mark, and sending the fragment index file link address to the client.
3. The method of claim 2, further comprising:
when the encryption string is confirmed to be incorrect, rejecting an index file link acquisition request of the client;
when the timestamp is expired, rejecting an index file link acquisition request of the client;
when the ip address of the index file link acquisition request is inconsistent with the ip address of the corresponding cache, judging whether a request head Referer and a request head User-Agent of the index file link acquisition request are consistent with a request head Referer and a request head User-Agent of the corresponding cache of the index file link acquisition request; if so, generating a fragment index file link address according to the global unique mark, and sending the fragment index file link address to the client; and if not, rejecting the index file link acquisition request of the client.
4. The method according to claim 2, wherein before generating the fragmented index file link address according to the globally unique identifier, the method further comprises:
refreshing the expiration time corresponding to the index file link acquisition request according to the timestamp; the expiration time is used for judging whether the timestamp is expired.
5. The method of claim 2, further comprising:
and caching the global unique mark, the ip address of the index file link acquisition request, the request head Referer of the index file link acquisition request and the request head User-Agent when the encryption string is confirmed to be correct.
6. The method according to claim 2, wherein when it is determined that the fragmented content acquisition request is legal according to the global unique identifier, returning fragmented content corresponding to the fragmented content acquisition request to the client, includes:
judging whether the encryption string in the fragment content acquisition request is correct or not;
if yes, respectively judging whether the ip address, the request head Referer and the request head User-Agent in the fragment content acquisition request are consistent with the ip address, the request head Referer and the request head User-Agent corresponding to the fragment content acquisition request in the cache;
and if the ip address in the fragment content acquisition request is consistent with the ip address corresponding to the fragment content acquisition request in the cache, or the request header Referer in the fragment content acquisition request is consistent with the request header Referer corresponding to the fragment content acquisition request in the cache, and the request header User-Agent in the fragment content acquisition request is consistent with the request header User-Agent corresponding to the fragment content acquisition request in the cache, returning the fragment content corresponding to the fragment content acquisition request to the client when the fragment content sequence number requested in the fragment content acquisition request is confirmed to be greater than the fragment content sequence number corresponding to the cached fragment content acquisition request.
7. The method of claim 6, further comprising:
and updating the cached fragment content serial number corresponding to the fragment content acquisition request when the fragment content serial number requested in the fragment content acquisition request is confirmed to be larger than the cached fragment content serial number corresponding to the fragment content acquisition request.
8. A live broadcast anti-stealing-link method for streaming media is applied to a client, and comprises the following steps:
responding to the streaming media playing operation of a user, and sending a streaming media playing request to a server;
receiving a streaming media playing chain address which contains a global unique mark and is sent by the server;
sending an index file link acquisition request to the server side according to the streaming media play link address containing the global unique mark;
receiving a fragment index file link address containing the global unique mark sent by the server;
sending a fragment content acquisition request to the server side according to the fragment index file link address;
and receiving the fragment content sent by the server.
9. A live-broadcast anti-theft chain system of streaming media is applied to a server side, and comprises:
the streaming media playing chain address generating module is used for receiving a streaming media playing request sent by a client; when the stream media playing request is confirmed to be legal, generating a stream media playing chain grounding address containing a global unique mark according to the stream media playing request; sending the streaming media playing chain grounding address to the client;
the fragment index file link address generation module is used for receiving an index file link acquisition request which is sent by the client and contains the streaming media playing link address, and generating a fragment index file link address according to the global unique mark when the index file link acquisition request is confirmed to be legal according to the global unique mark; sending the fragment index file link address to the client;
a fragmented content acquisition request receiving module, configured to receive a fragmented content acquisition request that includes the fragmented index file link address and is sent by the client;
and the fragment content sending module is used for returning the fragment content corresponding to the fragment content acquisition request to the client when the fragment content acquisition request is confirmed to be legal according to the global unique mark.
10. A live-broadcast anti-theft chain system for streaming media is applied to a client, and comprises:
the user operation response module is used for responding to the streaming media playing operation of the user and sending a streaming media playing request to the server;
the streaming media playing chain grounding address receiving module is used for receiving the streaming media playing chain grounding address which contains the global unique mark and is sent by the server;
an index file link acquisition request sending module, configured to send an index file link acquisition request to the server according to the streaming media play link address containing the globally unique identifier;
the fragment index file link address receiving module is used for receiving the fragment index file link address containing the globally unique mark sent by the server;
a fragment content acquisition request sending module, configured to send a fragment content acquisition request to the server according to the fragment index file link address;
and the fragment content receiving module is used for receiving the fragment content sent by the server side.
CN201811618392.2A 2018-12-28 2018-12-28 Method and system for preventing stealing link of live broadcast of streaming media Active CN109743586B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811618392.2A CN109743586B (en) 2018-12-28 2018-12-28 Method and system for preventing stealing link of live broadcast of streaming media

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811618392.2A CN109743586B (en) 2018-12-28 2018-12-28 Method and system for preventing stealing link of live broadcast of streaming media

Publications (2)

Publication Number Publication Date
CN109743586A CN109743586A (en) 2019-05-10
CN109743586B true CN109743586B (en) 2021-05-14

Family

ID=66361654

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811618392.2A Active CN109743586B (en) 2018-12-28 2018-12-28 Method and system for preventing stealing link of live broadcast of streaming media

Country Status (1)

Country Link
CN (1) CN109743586B (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110139163B (en) * 2019-05-22 2021-06-22 武汉瓯越网视有限公司 Method and related device for acquiring bullet screen
CN110381334B (en) * 2019-09-02 2021-05-28 湖南快乐阳光互动娱乐传媒有限公司 Anti-stealing-link method, device and system
CN110896505A (en) * 2019-11-29 2020-03-20 天脉聚源(杭州)传媒科技有限公司 Video link anti-theft method, system, device and storage medium
CN112040268B (en) * 2020-08-11 2023-03-24 福建天泉教育科技有限公司 Video playing method and storage medium supporting user-defined DRM
CN114245233B (en) * 2021-12-20 2023-04-07 中电福富信息科技有限公司 Authentication method based on HLS protocol playing
CN114726849B (en) * 2022-06-10 2022-09-23 武汉四通信息服务有限公司 File transmission method, device, server and computer readable storage medium
CN115278345A (en) * 2022-07-28 2022-11-01 中国电信股份有限公司 Video transmitting method, system, device and non-volatile storage medium
CN115802066B (en) * 2022-09-30 2024-03-08 天翼数字生活科技有限公司 Streaming media streaming method and device based on gateway

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107113454A (en) * 2014-10-29 2017-08-29 Dlvr公司 Configuration, which is quoted, is used for the inventory file for the infrastructure services provider that adaptive streaming transmits video
CN107257497A (en) * 2017-06-16 2017-10-17 成都市知用科技有限公司 A kind of net cast method for being capable of cross-platform browser
CN107396205A (en) * 2017-07-25 2017-11-24 观止云(北京)信息技术有限公司 A kind of low delay fluidizes HLS implementation methods
CN108235064A (en) * 2017-12-05 2018-06-29 广州高清视信数码科技股份有限公司 HLS stream media live broadcasting methods and system

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9716903B2 (en) * 2014-07-31 2017-07-25 Diego Cardona Live streaming-TV content, acquisition, transformation, encryption, and distribution system, and method for its use

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107113454A (en) * 2014-10-29 2017-08-29 Dlvr公司 Configuration, which is quoted, is used for the inventory file for the infrastructure services provider that adaptive streaming transmits video
CN107257497A (en) * 2017-06-16 2017-10-17 成都市知用科技有限公司 A kind of net cast method for being capable of cross-platform browser
CN107396205A (en) * 2017-07-25 2017-11-24 观止云(北京)信息技术有限公司 A kind of low delay fluidizes HLS implementation methods
CN108235064A (en) * 2017-12-05 2018-06-29 广州高清视信数码科技股份有限公司 HLS stream media live broadcasting methods and system

Also Published As

Publication number Publication date
CN109743586A (en) 2019-05-10

Similar Documents

Publication Publication Date Title
CN109743586B (en) Method and system for preventing stealing link of live broadcast of streaming media
US10057277B2 (en) System and method for partial URL signing with applications to dynamic adaptive streaming
US11368766B2 (en) System and method for signaling security and database population
EP3055805B1 (en) System and method for signaling and verifying url signatures for both url authentication and url-based content access authorization in adaptive streaming
US9648027B2 (en) Segment authentication for dynamic adaptive streaming
KR101965273B1 (en) Token-based authentication and authorization information signaling and exchange for adaptive streaming
US7937407B2 (en) Access control method, access control system, metadata controlling device, and transmitting apparatus
US7844624B2 (en) Information delivery system, information delivery method, information delivery server, content delivery server and client terminal
JP2007518294A (en) Video file encryption method and digital copyright management method using the same
US7865723B2 (en) Method and apparatus for multicast delivery of program information
CN107786526A (en) Anti-stealing link method, client and server system
US8279342B2 (en) System for receiving and storing broadcast content, and device for reception and storage
CN107222480A (en) A kind of flow media playing method, terminal device and CDN server
CN107294927A (en) Anti-stealing link method, device and system based on the network terminal
CN101883085B (en) Method for generating and acquiring authorized application list information, corresponding device and system
JP2009508431A (en) Inter-entity linking method and apparatus for service protection, and system thereof
US20200364317A1 (en) Method and system for identifying a user terminal in order to receive streaming protected multimedia content
CN113783900B (en) Encryption and multi-stage calibration method for stream media of unmanned aerial vehicle
CN114501069B (en) HLS-based multimedia playing method, system, equipment and storage medium
EP4002857A1 (en) Method and system for customized audio and/or video content delivery
US8495376B2 (en) Apparatus and method for controlling use of broadcasting program using signature in program information
CN117729379A (en) Video playing method and device and electronic equipment

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
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20210115

Address after: 511442 3108, 79 Wanbo 2nd Road, Nancun Town, Panyu District, Guangzhou City, Guangdong Province

Applicant after: GUANGZHOU CUBESILI INFORMATION TECHNOLOGY Co.,Ltd.

Address before: 511442 29 floor, block B-1, Wanda Plaza, Huambo business district, Panyu District, Guangzhou, Guangdong.

Applicant before: GUANGZHOU HUADUO NETWORK TECHNOLOGY Co.,Ltd.

EE01 Entry into force of recordation of patent licensing contract
EE01 Entry into force of recordation of patent licensing contract

Application publication date: 20190510

Assignee: GUANGZHOU HUADUO NETWORK TECHNOLOGY Co.,Ltd.

Assignor: GUANGZHOU CUBESILI INFORMATION TECHNOLOGY Co.,Ltd.

Contract record no.: X2021440000054

Denomination of invention: Anti theft chain method and system of live streaming media

License type: Common License

Record date: 20210208

GR01 Patent grant
GR01 Patent grant