CN112533034A - HLS-based video providing method, device, equipment, medium and system - Google Patents

HLS-based video providing method, device, equipment, medium and system Download PDF

Info

Publication number
CN112533034A
CN112533034A CN201910876641.6A CN201910876641A CN112533034A CN 112533034 A CN112533034 A CN 112533034A CN 201910876641 A CN201910876641 A CN 201910876641A CN 112533034 A CN112533034 A CN 112533034A
Authority
CN
China
Prior art keywords
video
link
time
playing
video server
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
CN201910876641.6A
Other languages
Chinese (zh)
Other versions
CN112533034B (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.)
Hisense Broadband Multimedia Technology Co Ltd
Original Assignee
Hisense Broadband Multimedia 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 Hisense Broadband Multimedia Technology Co Ltd filed Critical Hisense Broadband Multimedia Technology Co Ltd
Priority to CN201910876641.6A priority Critical patent/CN112533034B/en
Publication of CN112533034A publication Critical patent/CN112533034A/en
Application granted granted Critical
Publication of CN112533034B publication Critical patent/CN112533034B/en
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/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/258Client or end-user data management, e.g. managing client capabilities, user preferences or demographics, processing of multiple end-users preferences to derive collaborative data
    • H04N21/25808Management of client data
    • H04N21/25816Management of client data involving client authentication
    • 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
    • H04N21/2541Rights Management
    • 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/258Client or end-user data management, e.g. managing client capabilities, user preferences or demographics, processing of multiple end-users preferences to derive collaborative data
    • H04N21/25866Management of end-user data
    • H04N21/25875Management of end-user data involving end-user authentication
    • 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/262Content or additional data distribution scheduling, e.g. sending additional data at off-peak times, updating software modules, calculating the carousel transmission frequency, delaying a video stream transmission, generating play-lists
    • H04N21/26291Content or additional data distribution scheduling, e.g. sending additional data at off-peak times, updating software modules, calculating the carousel transmission frequency, delaying a video stream transmission, generating play-lists for providing content or additional data updates, e.g. updating software modules, stored at the client
    • 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/437Interfacing the upstream path of the transmission network, e.g. for transmitting client requests to a VOD server
    • 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/8456Structuring of content, e.g. decomposing content into time segments by decomposing the content in the time domain, e.g. in time segments

Abstract

The invention discloses a video providing method, a device, equipment, a medium and a system based on an HLS protocol, wherein the method comprises the following steps: the method comprises the steps that a video server receives a playing request which is sent by playing equipment and carries identification information of a video to be played, and sends a first link of a directory file of the video to the playing equipment; receiving a second link which is returned by the playing device and generated according to the first link, wherein the second link comprises the current first time when the playing device generates the second link; the video server judges whether the first time is not later than a second time saved for the video, and if so, the video server refuses to send the directory file of the video to the playing device; otherwise, the directory file of the video is sent to the playing equipment. Because the only effective link of the video is stored and the link has uncertainty, the query efficiency is improved, and the problem that the video link is subjected to packet capturing and illegal embezzlement to obtain the video is solved.

Description

HLS-based video providing method, device, equipment, medium and system
Technical Field
The present invention relates to the technical field of multimedia services, and in particular, to a video providing method, apparatus, device, medium, and system based on an HLS protocol.
Background
When mass wonderful video experience is brought to mass users by network videos in the internet era, copyright theft of the videos is rampant more and more. The pirate often acquires a file of a certain video content by capturing a packet of a network of a legal playing device, and then requests to play a link of a directory file containing the video by using an illegal device, so that the copyright of the video is divorced from the supervision and is pirated. Moreover, when the pirate uses the pirated link to perform illegal playing, if the legal playing device uses the link to perform playing at the moment, the request of linking two different playing devices with the same link will occur, resulting in unexpected errors.
In the streaming media playing and controlling method based on the HLS protocol, when a certain legal playing device requests a certain video, all adopted links are fixed and unchangeable, so that convenience for extracting and copying the links is provided for a pirate, the pirate can easily acquire the legal links issued by a video server to the legal playing device through methods such as network packet capturing or decoding the legal playing device, and the like, and further request ts fragments of the video, thereby carrying out illegal video piracy.
In order to prevent video from being stolen, the prior art provides a method for preventing video from being stolen based on user identity information and a user identity key, and a method for realizing video theft prevention according to a reassembled HTTP request.
The method for preventing video burglary based on user identity information and a user identity key is mainly characterized in that a video server compares whether a user signature in a playing request sent by playing equipment is matched with a verification signature or not so as to prevent an illegal user from accessing the video server to obtain video content. Although the check signature contains the user ID and the key corresponding to the ID, if the pirate packets the legal playback device or decrypts the legal playback device to obtain the legal file link, the anti-theft function of the method is disabled.
The method for video anti-theft according to the re-assembly HTTP request mainly adds an expiration date and a verification value in a link of a directory file issued by a video server to prevent link theft. When the verification value is not passed or the validity period is invalid, the video directory file is refused to be issued, but the method has the problem that a pirate can still pirate legal links by methods of capturing network packets and the like within the validity period to steal the video content.
Disclosure of Invention
The embodiment of the invention provides a video providing method, a video providing device, video providing equipment, video providing media and a video providing system based on an HLS protocol, which are used for solving the problem that a pirate packets a video link to illegally obtain a video when the video is provided based on the HLS protocol.
The embodiment of the invention provides a video providing method based on an HLS protocol, which comprises the following steps:
the method comprises the steps that a video server receives a playing request which is sent by playing equipment and carries identification information of a video to be played, and sends a first link of a directory file of the video to the playing equipment;
receiving a second link which is returned by the playing device and generated according to the first link, wherein the second link comprises the current first time when the playing device generates the second link;
the video server judges whether the first time is not later than a second time saved for the video, and if so, the video server refuses to send the directory file of the video to the playing device; otherwise, the directory file of the video is sent to the playing equipment.
Further, determining whether the first time is not later than a second time saved for the video comprises:
the video server extracts time in the multiplexed link as second time according to the multiplexed link corresponding to the currently stored video;
and judging whether the first time is not later than the second time.
Wherein, if not, sending the directory file of the video to the playing device includes:
when the first time is later than the second time, sending a directory file of the video to the playing device;
and when the second time is not extracted, sending the directory file of the video to the playing device.
Further, after the directory file of the video is sent to the playing device, the method is further configured to update the multiplexed link corresponding to the currently stored video according to the currently received second link.
Further, after the directory file of the video is sent to the playing device, the playing device is further configured to receive an exit request that is sent by the playing device and includes a third link, where the third link is generated according to the first link, and the third link includes a current third time when the playing device generates the third link; and updating the multiplexed link corresponding to the currently stored video according to the currently received third link.
In addition, the device is also used for decrypting the authentication information in the second link; judging whether the fourth time obtained after decryption is later than the second time or not and whether the account identification information obtained after decryption is a legal account or not; and if so, sending the directory file of the video to the playing equipment.
Specifically, if the fourth time is not later than the second time or the account identification information obtained after decryption is an illegal account, the sending of the directory file of the video to the playing device is refused.
The embodiment of the invention also provides a video providing method based on the HLS protocol, which comprises the following steps:
the method comprises the steps that a playing device sends a playing request carrying identification information of a video to be played to a video server and receives a first link sent by the video server;
generating a second link containing the first time according to the first link and the current first time, and sending the second link to the video server;
and playing the video according to the directory file of the video returned by the video server, wherein the target file is sent when the video server judges that the first time is later than a second time saved for the video.
Wherein, after playing according to the directory file of the video sent by the video server, the method comprises the following steps:
and when the video is determined to be quitted from watching, generating a third link containing the third time according to the first link and the current third time, and sending a quitting request containing the third link to the video server.
Further, the generating the link including the time according to the first link and the current time includes:
encrypting the current time and the account information for watching the video by adopting a preset encryption algorithm to generate corresponding authentication information;
and generating a link containing the current time and the authentication information.
The embodiment of the invention also provides a device for providing video based on HLS protocol, which comprises:
the data transmission module is used for receiving a playing request which carries identification information of a video to be played and is sent by playing equipment, and sending a first link of a directory file of the video to the playing equipment;
a data receiving module, configured to receive a second link, generated according to the first link, returned by the playback device, where the second link includes a current first time when the playback device generates the second link;
the data judgment module is used for judging whether the first time is not later than second time saved aiming at the video, and if so, refusing to send the directory file of the video to the playing equipment; otherwise, the directory file of the video is sent to the playing equipment.
In addition, the above apparatus further comprises:
and the data updating module is used for updating the multiplexed link corresponding to the currently stored video according to the currently received second link.
Further, the data judgment module is specifically configured to extract, according to a multiplexed link corresponding to the currently stored video, a time in the multiplexed link as a second time; and judging whether the first time is not later than the second time.
The data judgment module is specifically configured to send the directory file of the video to the playback device when the first time is later than the second time; and when the second time is not extracted, sending the directory file of the video to the playing device.
Specifically, the data receiving module is further configured to receive an exit request that includes a third link and is sent by the playback device, where the third link is generated according to the first link, and the third link includes a current third time when the playback device generates the third link.
The data updating module is further configured to update the multiplexed link corresponding to the currently stored video according to the currently received third link.
Further, the data judgment module is further configured to decrypt the authentication information in the second link; and judging whether the fourth time obtained after decryption is later than the second time or not and whether the account identification information obtained after decryption is a legal account or not, and if so, sending the directory file of the video to the playing device.
Further, the data determining module is further configured to refuse to send the directory file of the video to the playback device if the fourth time is not later than the second time or the account identification information obtained after decryption is an illegal account.
The modules described above are all for a video server comprising a processor for implementing the steps of the method for video provision based on the HLS protocol in the video server described above when executing a computer program stored in a memory.
Based on the same inventive concept, an embodiment of the present invention further provides a device for providing a video based on an HLS protocol, including:
the receiving module is used for sending a playing request carrying identification information of a video to be played to a video server and receiving a first link sent by the video server;
a sending module, configured to generate a second link including the first time according to the first link and the current first time, and send the second link to the video server;
and the playing module is used for playing the video according to the directory file of the video returned by the video server, wherein the target file is sent when the video server judges that the first time is later than a second time for storing the video.
Further, the sending module is further configured to generate a third link including the third time according to the first link and the current third time when determining to quit viewing the video, and send a quit request including the third link to the video server.
Further, the sending module is further configured to encrypt the current time and the account information for watching the video by using a preset encryption algorithm to generate corresponding authentication information; and generating a link containing the current time and the authentication information.
The above modules are all used in a playback device, which includes a processor for implementing the steps of any of the above methods for providing video based on HLS protocol in the playback device when executing a computer program stored in a memory.
An embodiment of the present invention provides a computer-readable storage medium, which stores a computer program executable by a video server apparatus, and when the program runs on the video server apparatus, causes the video server apparatus to execute the steps of any one of the above methods for video provision based on HLS protocol in the video server.
An embodiment of the present invention provides a computer-readable storage medium, which stores a computer program executable by a playback device, and when the program runs on the playback device, the program causes the playback device to execute the steps of any one of the methods described above for video provision based on an HLS protocol in the playback device.
The embodiment of the present invention further provides a system for providing a video based on the HLS protocol, where the system includes that any one of the methods for providing a video based on the HLS protocol is applied to a video server, and any one of the methods for providing a video based on the HLS protocol is applied to a playing device.
The embodiment of the invention provides a video providing method, a device, equipment, a medium and a system based on an HLS protocol, wherein the method comprises the following steps: the method comprises the steps that a video server receives a playing request which is sent by playing equipment and carries identification information of a video to be played, and sends a first link of a directory file of the video to the playing equipment; receiving a second link which is returned by the playing device and generated according to the first link, wherein the second link comprises the current first time when the playing device generates the second link; the video server judges whether the first time is not later than a second time saved for the video, and if so, the video server refuses to send the directory file of the video to the playing device; otherwise, the directory file of the video is sent to the playing equipment. According to the embodiment of the invention, after the playing device receives the first link of the directory file of the video to be played, the second link containing the first time for sending the second link is generated, so that the video server can judge whether the first time in the second link is later than the second time for storage, determine the link sent by the legal playing device according to the judgment of the time, and provide the directory file according to the link sent by the legal terminal, thereby effectively preventing the problem of obtaining the video through network packet capturing and improving the safety of video provision.
Drawings
Fig. 1 is a schematic diagram of a video providing process based on the HLS protocol according to an embodiment of the present invention;
fig. 2 is a flowchart of a video providing method of a specific HLS protocol according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of a video providing apparatus based on an HLS protocol according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of another video providing apparatus based on the HLS protocol according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of a video server according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of a playing device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer, the present invention will be described in further detail with reference to the accompanying drawings, and it is apparent that the described embodiments are only a part of the embodiments of the present invention, not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In order to prevent video from being stolen and improve the security of video providing, embodiments of the present invention provide a video providing method, apparatus, device, medium, and system based on an HLS protocol.
Example 1:
fig. 1 is a schematic diagram of a video providing process based on the HLS protocol according to an embodiment of the present invention, where the process includes the following steps:
s101: the playing device sends a playing request carrying identification information of a video to be played to the video server.
The playing device is a device for playing a video, when playing the video, a user can select the video according to the content displayed by the playing device, and after the corresponding playing device receives the selection operation of the user, a playing request carrying identification information of the video to be played is generated, wherein the identification information of the video can be information which is predetermined by the playing device and a server and uniquely identifies the video, such as the name, the number and the like of the video.
For example, after a user clicks a certain video poster, the playing device determines a video requested by the user according to a clicking operation of the user, so as to generate a playing request, and the playing request carries identification information of the video to be played.
In order to improve the security of video provision, the playing device capable of sending the playing request to the video server in the embodiment of the present invention is a legal device that has been authenticated.
Specifically, when the playback device is started, the playback device may send an authentication request to the video server, and after the video server determines that the playback device is a valid playback device based on another protocol, the playback device is normally started.
S102: the video server receives a playing request which is sent by playing equipment and carries identification information of a video to be played, and sends a first link of a directory file of the video to the playing equipment.
The video server is a device for providing videos, and due to the fact that a preset agreement is made with the playing device, after the video server receives the request, the video server can determine the video to be played according to the identification information of the video carried in the playing request, and the first link of the video is sent to the playing device.
The first link is a link of a directory file of the video, specifically, a link of an m3u8 file of the video, address information of each ts slice of the video is recorded in the m3u8 file, and the playing device requests the corresponding ts slice to decode and play according to the address information.
S103: the playing device receives the first link, generates a second link containing the first time according to the first link and the current first time, and sends the second link to the video server.
In the embodiment of the present invention, when the playing device requests the directory file of the video sent by the video server by using the first link, the directory file may be captured, and a pirate acquires the first link to request the video, so as to improve the security of video provision, after receiving the first link sent by the video server, the playing device acquires the current time when generating the second link, where the current time is the first time, and adds the first time to the first link to generate the second link including the first time. And the playing equipment sends the second link to the video server so as to request the directory file of the video to be played. The directory file of the video contains the address information of each ts fragment of the video, and the playing device requests the corresponding ts fragment to be decoded and played according to the address information.
For example, the first link received by the playback device is:
http://182.245.29.142:8089/hevc/20160418/meirenyugaomalv/prog.m3u8?playTyp=vod&expiredTime=600&stbNo=00109199010290600001AC4AFE9348D9。
the playing device adds the first time at the corresponding position of the first link through the adding position of the first time prearranged with the video server, and the generated second link is as follows:
http://182.245.29.142:8089/hevc/20160418/meirenyugaomalv/prog.m3u8?playType=vod&ProgramDate=1463735568528&expiredTime=600&checkKey=7f324c84 953d6ffb9be0beff56fc446e&stbNo=00109199010290600001AC4AFE9348D9。
where the ProgramDate 1463735568528 in the second link is a first time, where the first time is a time when the playing device generates the second link.
It should be noted that, the first link and the second link in the above example are only for convenience of explaining the embodiment of the present invention, and in the specific implementation process, the video server and the playing device may agree in advance on the adding position at the first time.
S104: and receiving a second link which is returned by the playing device and generated according to the first link, wherein the second link comprises the current first time when the playing device generates the second link.
After receiving the second link, the video server may extract the first time at a corresponding position of the second link according to a predetermined agreement with the playback device.
S105: the video server judges whether the first time is not later than a second time saved for the video, and if so, the video server refuses to send the directory file of the video to the playing device; otherwise, the directory file of the video is sent to the playing equipment.
In the embodiment of the present invention, the video server stores, for each playback device, a video name played by the playback device, a first link, and a multiplexed link corresponding to the first link. The multiplexed link is generated according to the first link, wherein the multiplexed link includes the time when the playing device generates the link, and the time is the second time.
And after acquiring the first time from the second link, the video server judges whether the first time is not later than a second time in the multiplexed link stored for the video of the playing device, and if the first time is later than the second time, the link is sent by legal playing device. Since the playing device sends the playing request, the directory file of the video, that is, the m3u8 file of the video is sent to the playing device; and if the first time is not later than the second time, the link is sent by illegal playing equipment, and the directory file of the video is refused to be sent to the playing equipment at the moment.
For example, the numerical value of the time is used for determining the time sequence, and the time with the larger numerical value is later than the time with the smaller numerical value. Assuming that the first time is 1463735690960 and the second time is 146373556852, the first time is later than the second time; assuming that the first time is 146373556852 or 1463735690960 and the second time is 1463735690960, it is known that the first time is not later than the second time.
S106: and the playing equipment plays the video according to the directory file of the video returned by the video server, wherein the target file is sent when the video server judges that the first time is later than a second time saved for the video.
And after receiving the directory file returned by the video server, the playing device directly requests the ts fragment according to the address information of the ts fragment in the directory file and plays the video.
According to the embodiment of the invention, after the playing device receives the first link of the directory file of the video to be played, the second link containing the first time for generating the second link is generated, so that the video server can judge whether the first time in the second link is later than the second time for storage, determine the link sent by the legal playing device according to the judgment of the time, and provide the directory file according to the link sent by the legal terminal, thereby effectively preventing the problem of obtaining the video through network packet capturing and improving the safety of video provision.
Example 2:
in order to prevent a pirate from stealing a video by grabbing a packet over a network, in an embodiment of the present invention, on the basis of the above embodiment, the determining, by the video server, whether the first time is not later than a second time stored for the video includes:
the video server extracts time in the multiplexed link as second time according to the multiplexed link corresponding to the currently stored video;
and judging whether the first time is not later than the second time.
The multiplexed link is stored by the video server according to the link sent by the legal playing device, because the legal playing device and the video server are agreed in advance, the time is extracted from the corresponding position in the stored multiplexed link according to the adding position of the time agreed in advance by the playing device and the video server, so that the second time is extracted, and whether the first time is not later than the second time is judged.
For example, the second link currently received is http://182.245.29.142: 8089/hevc/20160418/meirenyunaomalv/prog.m3u8playType ═ vod&ProgramDate=1463735690960&expiredTime=600&checkKey=7f324c84953d6ffb9be0be3556fc4897&stbNo=00109199010290600001AC4AFE9348D9。
Wherein the "ProgramDate-1463735690960" in the second link represents the first time in the link.
And the multiplexed link corresponding to the video currently stored by the video server is http://182.245.29.142:8089/hevc/20160418/meirenyugaomalv/prog.m3u8playType ═ vod&ProgramDate= 1463735568528&expiredTime=600&checkKey=7f324c84953d6ffb9be0beff56fc446e&stbNo=00109199010290600001AC4AFE9348D9。
Wherein the "ProgramDate" 1463735568528 in the multiplexed link indicates the second time in the link.
The video server may compare the extracted first time with the extracted second time.
It should be noted that the second link and the multiplexed link in the above example are only for convenience of describing the embodiment of the present invention. In a specific implementation process, no matter the second link or the multiplexed link contains time information, the video server and the playing device may agree in advance on the adding position of the time information.
In the embodiment of the invention, the video server extracts the second time contained in the saved multiplexed link of the video, judges the second time based on the received first time in the second link, and sends the directory file of the video to the playing device if the first time is later than the second time.
Example 3:
on the basis of the foregoing embodiment, in an embodiment of the present invention, in order to provide a video to a legitimate playback device, a method for sending a directory file of the video to the playback device by a video server determining that the first time is not later than a second time saved for the video includes:
when the first time is later than the second time, sending a directory file of the video to the playing device;
and when the second time is not extracted, sending the directory file of the video to the playing device.
Specifically, the video server may receive the second link including the time for the first time, that is, the video server does not store the multiplexed link corresponding to the video, so the video server cannot extract the second time from the stored multiplexed link of the video, and meanwhile, because the pirate obtains the link through network packet capture and then sends the link, the time for sending the link of the pirate to the video server is necessarily later than the time for the link sent by the legal playback device to reach the video server, that is, the link sent by the legal playback device must first reach the video server, so when the video server receives the second link in this case, it indicates that the playback device sending the second link is legal, and the video server sends the directory file of the video to the playback device.
The video server may not receive the link containing the time of the video sent by the playing device for the first time, that is, the video server currently stores the multiplexed link of the video, and when the video server receives the second link sent by the playing device, because the multiplexed link of the video is stored at this time, the second time may be extracted from the multiplexed link, and the morning and the evening of the first time and the second time may be determined. When the pirate catches the link sent by the legal playing device through the network packet, the time for sending the link to the video server is definitely later than the time for sending the link to the video server by the legal playing device, and the video server takes the last link aiming at the video sent by the legal playing device as the multiplexed link, so that if the video server judges that the first time is not later than the second time in the stored multiplexed link, namely the first time is earlier than the second time, or the first time is equal to the second time, the second link is sent by the pirate, and the directory file is not provided at this moment; and only when the first time is later than the second time, the second link is indicated to be sent by legal playing equipment, and the directory file of the video can be sent to the playing equipment at the moment.
Example 4:
for convenience of subsequent playing and theft prevention, on the basis of the foregoing embodiments, in an embodiment of the present invention, after the directory file of the video is sent to the playing device, the method further includes:
and the video server updates the multiplexed link corresponding to the currently stored video according to the currently received second link.
And when judging that the second link is sent by the legal playing device, the video server sends the directory file of the video to the playing device. Because the second link is sent by the legal playing device and is a link which is sent by the legal playing device and is closest to the current playing device, in order to facilitate subsequent judgment and prevent the video from being stolen, the video server updates the multiplexed link of the locally stored video according to the received second link, namely, the second link is stored as the multiplexed link corresponding to the video.
Specifically, the current video server stores, for the playback device, the video name played by the playback device, the first link, and the multiplexed link corresponding to the first link, and stores, for the playback device, the video name played by the playback device, the first link, and the multiplexed link corresponding to the first link, through a video link correspondence table shown in the following table.
Figure BDA0002204560340000131
In the above embodiments, the video server is described to send the directory file of the video to the playing device, and the video server may or may not store the multiplexed link. Therefore, when the video server determines to send the directory file of the video to the playing device, if the current video server does not store the multiplexed link, the received second link is stored as an update; and if the current video server stores the multiplexed link, replacing the currently stored multiplexed link with the received second link.
For example, if the current video server does not store the multiplexed link and receives the second link corresponding to the video of the playing device, the second link is:
http://182.245.29.142:8089/hevc/20160418/meirenyugaomalv/prog.m3u8?playType=vod&ProgramDate=1463735568528&expiredTime=600&checkKey=7f324c84 953d6ffb9be0beff56fc446e&stbNo=00109199010290600001AC4AFE9348D9。
the received second link is saved in the video link mapping table, that is:
Figure BDA0002204560340000141
if the current video server already stores the multiplexed link, and the multiplexed link is:
http://182.245.29.142:8089/hevc/20160418/meirenyugaomalv/prog.m3u8?playType=vod&ProgramDate=1463735568528&expiredTime=600&checkKey=7f324c84 953d6ffb9be0beff56fc446e&stbNo=00109199010290600001AC4AFE9348D9。
and the video server receives a second link sent by the playing device, wherein the second link is as follows:
http://182.245.29.142:8089/hevc/20160418/meirenyugaomalv/prog.m3u8?playType=vod&ProgramDate=1463735690960&expiredTime=600&checkKey=7f324c84 953d6ffb9be0be3556fc4897&stbNo=00109199010290600001AC4AFE9348D9。
the video server extracts the second time from the multiplexed link according to the predetermined positions of the first time and the second time, extracts the first time from the received second link, and judges whether the first time in the second link is later than the second time in the multiplexed link. Therefore, in the above example, the first time in the second link is 1463735690960, the second time in the multiplexed link is 1463735568528, and if the value of the first time is greater than the value of the second time, the first time is later than the second time, which indicates that the playback device is legal, the video server sends the directory file of the video to the playback device, updates the currently saved multiplexed link as the received second link, and the updated video link mapping table is:
Figure BDA0002204560340000151
as can be seen from the updated video link correspondence table, the updated multiplexed links are as follows: http://182.245.29.142: 8089/hevc/20160418/meirenyugaomallv/prog.m3u8playtype ═ vod&ProgramDate=1463735690960&expiredTime=600&checkKey=7f324c84953d6ffb9be0be 3556fc4897&stbNo=00109199010290600001AC4AFE9348D9。
The second time in the updated multiplexed link is 1463735690960, the second time in the multiplexed link before updating is 1463735568528, the authentication information in the updated multiplexed link has a value of 7f324c84953d6ffb9be0be3556fc4897, and the authentication information in the updated multiplexed link before updating has a value of 7f324c84953d6ffb9be0beff56fc446e, so that the updated multiplexed link changes from the previous multiplexed link at the second time and the value of the authentication information, and the entire multiplexed link is dynamically updated.
In the embodiment of the invention, after the video server sends the directory file of the video, the multiplexed link corresponding to the currently stored video is updated to be the second link currently responding. The current second time of the video server for requesting video storage can help to determine whether the received second link is valid, so that the situation that a pirate requests the video server to send the directory file of the video again by using the updated link because the video server does not update the multiplexed link is prevented.
Example 5:
for convenience of subsequent use, on the basis of the foregoing embodiments, in an embodiment of the present invention, after the sending the directory file of the video to the playback device, the method further includes:
the video server receives an exit request which is sent by the playing device and contains a third link, wherein the third link is generated according to the first link, and the third link contains the current third time when the playing device generates the third link;
and the video server updates the multiplexed link corresponding to the currently stored video according to the currently received third link.
If the playing device recognizes that the user does not watch the video any more, a quitting request is sent to the video server, and in order to further prevent the video from being stolen, when the playing device sends the quitting request, the quitting request contains a third link, wherein the third link is generated according to the first link of the video, and carries a current third time when the playing device generates the third link.
Specifically, a generation method of the third link is the same as the generation method of the second link, and a specific generation process has been described in the above embodiments, and is not described herein again.
When the video server receives a third link contained in an exit request sent by the playing device, a second time is extracted from the multiplexed link of the video stored at present, and whether the third time in the third link is later than the second time in the multiplexed link is judged. Meanwhile, the third time in the third link generated when the legal playing device exits the video playing is certainly later than the second time in the multiplexed link, that is, certainly later than the time when the playing device generates the link to the video server last time.
Therefore, if the third time in the third link is later than the second time in the multiplexed link, it indicates that the playing device is legal, and updates the currently stored multiplexed link of the video to the currently received third link;
and if the third time in the third link is not later than the second time in the multiplexed link, the playing device is illegal, and the video server does not update the multiplexed link of the video stored currently.
In addition, after the video server updates the multiplexed link of the video, the video server receives a link rejection response earlier than the second time of the currently stored multiplexed link of the video.
In the embodiment of the invention, the video server updates according to the third link sent by the playing device, which is more beneficial to preventing a pirate from stealing the video by using the link obtained by the previous network packet capturing.
Example 6:
in order to further ensure the security of video provision, on the basis of the foregoing embodiments, in an embodiment of the present invention, the sending, to the playback device, the directory file of the video includes:
decrypting the authentication information in the second link;
judging whether the fourth time obtained after decryption is later than the second time or not and whether the account identification information obtained after decryption is a legal account or not;
and if so, sending the directory file of the video to the playing equipment.
And if the fourth time is not later than the second time or the account identification information obtained after decryption is an illegal account, refusing to send the directory file of the video to the playing device.
The authentication information includes the fourth time and account identification information. The fourth time is the current time at which the second link was generated and should be numerically equal to the first time in the second link.
It should be noted that the decryption method of the authentication information may be a decryption method for algorithms such as MD5 and CRC, and a specific decryption method may be negotiated and agreed by the video server and the playing device, which is not specifically limited in the embodiment of the present invention.
Specifically, if the fourth time is later than the second time and the account identification information is legal, it indicates that the second link is legal, and the directory file of the video can be sent to the playing device sending the second link;
if the fourth time is not later than the second time or the account identification information is illegal, the second link is probably the link acquired by the embezzler through an illegal means, and the video server refuses to send the directory file of the video to the playing device sending the second link.
In addition, since the third link is generated by the same method as the second link, the third link also includes the authentication information generated by the same method. The authentication information includes a fifth time, which is the current time for generating the third link and should be equal to the third time in the third link.
The decryption method for the authentication information in the third link may be the same as or different from the decryption method for the second link, and may be a decryption method for the MD5, CRC, and other algorithms, but the specific decryption method still needs to be negotiated and agreed by the video server and the playing device, and is not limited in the embodiment of the present invention.
Further, if the fifth time is later than the second time and the account identification information is legal, it indicates that the third link is legal, and the multiplexed link stored for the video at present can be updated according to the third link;
if the fifth time is not later than the second time or the account identification information is illegal, the third link is probably the link acquired by the embezzler through an illegal means, the video server does not respond to the third link, and the multiplexed link stored aiming at the video at present is not updated.
In the embodiment of the invention, the video server judges whether the fourth time obtained after decryption in the authentication information is later than the first time and whether the account identification information obtained after decryption is a legal account by decrypting the authentication information in the second link, and helps the video server to further select whether the requester after the second link is a legal user.
Example 7:
to implement dynamic update of the second link, on the basis of the foregoing embodiment, in an embodiment of the present invention, after the playing is performed according to the directory file of the video sent by the video server, the method further includes:
and when the playing equipment determines to quit watching the video, generating a third link containing the third time according to the first link and the current third time, and sending a quit request containing the third link to the video server.
If the playing device recognizes that the user does not watch the video any more, a quitting request is sent to the video server, and in order to further prevent the video from being stolen, when the playing device sends the quitting request, the quitting request contains a third link, wherein the third link is generated according to the first link of the video, and carries a current third time when the playing device generates the third link.
Specifically, a generation method of the third link is the same as the generation method of the second link, and a specific generation process has been described in the above embodiments, and is not described herein again.
In the embodiment of the invention, the third link sent in time by the playing device effectively helps the video server to store the latest multiplexed link sent by the legal playing device for the requested video, so that the second link before the current multiplexed link loses effectiveness, and the function of preventing the pirate from stealing the video through network packet capture is enhanced.
Example 8:
to help the video server further screen whether the requester after selecting the second link is a legal user, on the basis of the above embodiment, in an embodiment of the present invention, the generating the link including the time according to the first link and the current time includes:
encrypting the current time and the account information for watching the video by adopting a preset encryption algorithm to generate corresponding authentication information; and generating a link containing the current time and the authentication information.
Specifically, in the embodiment of the present invention, the second link and the third link sent by the playback device are both obtained by adding, according to the first link, the current time and the authentication information when the corresponding link is generated on the basis of the first link, and the authentication information included in the link is a value obtained by performing a certain encryption algorithm on the current time and the account information when the corresponding link is generated.
Further, the encryption algorithm of the authentication information may be MD5, CRC algorithm, or other agreed encryption algorithm, and a specific encryption algorithm may be negotiated between the video server and the playback device and agreed with a certain algorithm for encryption, which is not specifically limited in the embodiment of the present invention.
In the embodiment of the invention, the playing device helps the video server to further select whether the requester sending the link is a legal user by adding the authentication information to the link.
Fig. 2 shows a flow of a method for providing a video according to a specific HLS protocol according to an embodiment of the present invention, where the method includes:
s201: the playing device sends a playing request carrying identification information of a video to be played to the video server.
S202: the video server receives a playing request which is sent by playing equipment and carries identification information of a video to be played, and sends a first link of a directory file of the video to the playing equipment.
S203: the playback device generates a second link including a time T1 based on the first link and the current time T1, and sends the second link to the video server.
S204: after receiving the second link generated according to the first link returned by the playing device, the video server extracts the time T2 in the multiplexed link according to the multiplexed link corresponding to the currently stored request video.
S205: the video server determines whether the time T1 is not later than the time T2 for the requested video save, if so, performs S213, otherwise performs S206.
S206: the video server decrypts the authentication information in the second link and then performs S207.
S207: the video server judges whether the time T4 obtained after decryption is later than the time T2 or not and whether the account identification information obtained after decryption is a legal account or not, if so, S208 is executed, otherwise, S213 is executed.
S208: the video server transmits the directory file of the video to the playback device, and then executes S209.
S209: the video server updates the multiplexed link corresponding to the currently stored request video according to the currently received second link, and then executes S210.
S210: and the playing equipment plays the video according to the directory file of the video returned by the video server.
The S209 and the S210 are not in sequence during execution, and the embodiment of the present invention only provides a possible implementation manner, and in specific implementation, the S210 may be executed first and then the S209 is executed, or the S209 and the S210 are executed synchronously.
S211: the video server determines whether the playback device has sent an exit request including the third link, if so, S212 is performed, otherwise, S211 is performed.
S212: and the video server extracts the time T3 in the third link according to the currently received third link, judges whether the time T3 is later than the time T1 contained in the multiplexed link for requesting video saving, if so, executes S214, and otherwise executes S215.
The video server may further decrypt the authentication information in the third link, and determine whether to update the multiplexed link according to the decrypted time and the account identification information, where a specific determination process is described in the above embodiment and is not described herein again.
S213: refusing to respond to the playing device.
S214: and the video server updates the multiplexed link corresponding to the currently stored video according to the currently received third link information.
S215: and refusing to update the multiplexed link corresponding to the currently stored video.
The method for providing video based on HLS protocol according to the embodiment of the present invention is described below with specific embodiments:
when the playing device is started, the playing device initiates an authentication request to the video server, the video server judges that the playing device is a legal user, and when the playing device requests a certain video, the video server sends a first link of the video, such as:
http://182.245.29.142:8089/hevc/20160418/meirenyugaomalv/prog.m3u8?playType=vod&expiredTime=600&stbNo=00109199010290600001AC4AFE9348D9。
the playing device generates a second link containing the first time according to the first link and the current first time, the second link also contains authentication information, the authentication information is obtained through an encryption algorithm of the current time and account information when the second link is generated, and the encryption algorithm is a private algorithm of the playing device and the video server.
The resulting second link after multiplexing of one video is as follows:
http://182.245.29.142:8089/hevc/20160418/meirenyugaomalv/prog.m3u8?playType=vod&ProgramDate=1463735690960&expiredTime=600&checkKey=7f324c84 953d6ffb9be0be3556fc4897&stbNo=00109199010290600001AC4AFE9348D9。
the playing device requests the video server to provide the directory file of the video through the second link, the directory file of the video contains the addresses of the whole ts fragments of the video, and the playing device requests the corresponding ts fragments to be decoded and played according to the fragment addresses.
The video server finds the corresponding first link according to the received second link, and further determines the corresponding multiplexed link, wherein the multiplexed link is as follows:
http://182.245.29.142:8089/hevc/20160418/meirenyugaomalv/prog.m3u8?playType=vod&ProgramDate=1463735568528&expiredTime=600&checkKey=7f324c84 953d6ffb9be0beff56fc446e&stbNo=00109199010290600001AC4AFE9348D9。
the video server extracts the time in the multiplexed link as a second time, "ProgramDate ═ 1463735568528". The first time in the second link, i.e., "ProgramDate 1463735690960", is compared to the second time to determine whether the first time is no later than the second time.
For convenience of explanation, in the embodiments of the present invention, the time sequence is determined according to the magnitude of the numerical value of the time, and the time with the large numerical value is later than the time with the small numerical value, so that it can be determined that the first time is later than the second time, and the video server sends the directory file of the video to the playing device.
Meanwhile, the video server updates the multiplexed link by adopting the second link, namely the updated multiplexed link is as follows:
http://182.245.29.142:8089/hevc/20160418/meirenyugaomalv/prog.m3u8?playType=vod&ProgramDate=1463735690960&expiredTime=600&checkKey=7f324c84 953d6ffb9be0be3556fc4897&stbNo=00109199010290600001AC4AFE9348D9。
if the playing device performs an operation of exiting the video in the process of playing the video, the playing device will report an exit request containing a third link to the video server, where the third link is:
http://182.245.29.142:8089/hevc/20160418/meirenyugaomalv/prog.m3u8?playType=vod&ProgramDate=1463735704962&expiredTime=600&checkKey=7f324c84 953d6ffb9bf3be6574fc5996&stbNo=00109199010290600001AC4AFE9348D9。
after receiving the quit request sent by the playing device and detecting the operation of the playing device, the video server extracts the time in the multiplexed link updated for the video, namely the time
"progrmdate" 1463735690960 ". At the same time, the video server extracts the third time in the third link, i.e., "ProgramDate ═ 1463735704962".
Correspondingly, the corresponding relation between the numerical value of the time and the morning and the evening is used to know that the third time is later than the time in the multiplexed link updated for the video, the video server dynamically changes the multiplexed link, and updates the multiplexed link stored for the requested video according to the third link in the quit request. I.e. the updated multiplexed links are as follows:
http://182.245.29.142:8089/hevc/20160418/meirenyugaomalv/prog.m3u8?playType=vod&ProgramDate=1463735704962&expiredTime=600&checkKey=7f324c84 953d6ffb9bf3be6574fc5996&stbNo=00109199010290600001AC4AFE9348D9。
compared with the previous multiplexed link, the link of the updated link of "ProgramDate ═ 1463735704962" and "checkKey ═ 7f324c84953d6ffb9bf3be6574fc 5996" has "ProgramDate ═ 1463735690960" and "checkKey ═ 7f324c84953d6ffb9b 0be3556fc 4897", and changes are made in the values of ProgramDate and checkKey, that is, the values of time information and authentication information in the multiplexed link change, so that the link of the whole m3u8 file is dynamically updated.
Example 9:
fig. 3 is a device for providing video based on HLS protocol according to an embodiment of the present invention, which includes:
a data sending module 301, configured to receive a play request sent by a playing device and carrying identification information of a video to be played, and send a first link of a directory file of the video to the playing device;
a data receiving module 302, configured to receive a second link, generated according to the first link, returned by the playback device, where the second link includes a current first time when the playback device generates the second link;
a data determining module 303, configured to determine whether the first time is not later than a second time saved for the video, and if so, refuse to send the directory file of the video to the playing device; otherwise, the directory file of the video is sent to the playing equipment.
In addition, the above apparatus further comprises:
a data updating module 304, configured to update the multiplexed link corresponding to the currently stored video according to the currently received second link.
Further, the data determining module 303 is specifically configured to extract, according to a multiplexed link corresponding to the currently stored video, a time in the link as a second time; and judging whether the first time is not later than the second time.
The data determining module 303 is specifically configured to send the directory file of the video to the playing device when the first time is later than the second time; and when the second time is not extracted, sending the directory file of the video to the playing device.
Specifically, the data receiving module 302 is further configured to receive an exit request that is sent by the playback device and includes a third link, where the third link is generated according to the first link, and the third link includes a current third time when the playback device generates the third link.
The data updating module 304 is further configured to update the multiplexed link corresponding to the currently stored video according to the currently received third link.
Further, the data determining module 303 is further configured to decrypt the authentication information in the second link; and judging whether the fourth time obtained after decryption is later than the second time or not and whether the account identification information obtained after decryption is a legal account or not, and if so, sending the directory file of the video to the playing device.
In addition, the data determining module 303 is further configured to refuse to send the directory file of the video to the playback device if the fourth time is not later than the second time or the account identification information obtained after decryption is an illegal account.
According to the embodiment of the invention, after the playing device receives the first link of the directory file of the video to be played, the second link containing the first time for sending the second link is generated, so that the video server can judge whether the first time in the second link is later than the second time for storage, determine the link sent by the legal playing device according to the judgment of the time, and provide the directory file according to the link sent by the legal terminal, thereby effectively preventing the problem of obtaining the video through network packet capturing and improving the safety of video provision.
Example 10:
fig. 4 is a device for providing video based on HLS protocol according to another embodiment of the present invention, which includes:
a receiving module 401, configured to send a play request carrying identification information of a video to be played to a video server, and receive a first link sent by the video server;
a sending module 402, configured to generate a second link including the first time according to the first link and the current first time, and send the second link to the video server;
a playing module 403, configured to play the video according to the directory file of the video returned by the video server, where the target file is sent when the video server determines that the first time is later than a second time for storing the video.
The sending module 402 is further configured to, when it is determined to quit viewing the video, generate a third link including the third time according to the first link and the current third time, and send a quit request including the third link to the video server.
Further, the sending module 402 is further configured to encrypt the current time and the account information for watching the video by using a preset encryption algorithm, so as to generate corresponding authentication information; and generating a link containing the current time and the authentication information.
According to the embodiment of the invention, after the playing device receives the first link of the directory file of the video to be played, the second link containing the first time for sending the second link is generated, so that the video server can judge whether the first time in the second link is later than the second time for storage, determine the link sent by the legal playing device according to the judgment of the time, and provide the directory file according to the link sent by the legal terminal, thereby effectively preventing the problem of obtaining the video through network packet capturing and improving the safety of video provision.
Example 11:
as shown in fig. 5, a schematic structural diagram of a video server is further provided in the embodiment of the present invention, and on the basis of the foregoing embodiments, a video server is further provided in the embodiment of the present invention, and includes a processor 501 and a memory 502;
the processor 501 is adapted to implement the steps of the above-described video providing method based on the HLS protocol when executing the computer program stored in the memory 502.
Alternatively, the processor 501 may be a CPU (central processing unit), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array), or a CPLD (Complex Programmable Logic Device).
A processor 501 for executing the following steps when following the computer program stored in the memory 502:
receiving a playing request which carries identification information of a video to be played and is sent by playing equipment, and sending a first link of a directory file of the video to the playing equipment;
receiving a second link which is returned by the playing device and generated according to the first link, wherein the second link comprises the current first time when the playing device generates the second link;
judging whether the first time is not later than a second time saved for the video, if so, refusing to send the directory file of the video to the playing device; otherwise, the directory file of the video is sent to the playing equipment.
Further, determining whether the first time is not later than a second time saved for the video comprises:
the video server extracts time in the link as second time according to the multiplexed link corresponding to the currently stored video;
and judging whether the first time is not later than the second time.
Wherein, if not, sending the directory file of the video to the playing device includes:
when the first time is later than the second time, sending a directory file of the video to the playing device;
and when the second time is not extracted, sending the directory file of the video to the playing device.
Further, after the directory file of the video is sent to the playing device, the method is further configured to update the multiplexed link corresponding to the currently stored video according to the currently received second link.
Correspondingly, after the directory file of the video is sent to the playing device, the playing device is further configured to receive an exit request containing a third link sent by the playing device, where the third link is generated according to the first link, and the third link contains a current third time when the playing device generates the third link; and updating the multiplexed link corresponding to the currently stored video according to the currently received third link.
In addition, the device is also used for decrypting the authentication information in the second link; judging whether the fourth time obtained after decryption is later than the second time or not and whether the account identification information obtained after decryption is a legal account or not; and if so, sending the directory file of the video to the playing equipment.
Specifically, if the fourth time is not later than the second time or the account identification information obtained after decryption is an illegal account, the sending of the directory file of the video to the playing device is refused.
Example 12:
as shown in fig. 6, a schematic structural diagram of a playing device is further provided in the embodiment of the present invention, on the basis of the foregoing embodiments, a playing device is further provided in the embodiment of the present invention, and includes a processor 601 and a memory 602;
the processor 601 is adapted to implement the steps of the video providing method based on the HLS protocol described above when executing the computer program stored in the memory 602.
Alternatively, the processor 601 may be a CPU (central processing unit), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array), or a CPLD (Complex Programmable Logic Device).
Specifically, the processor 601 is configured to read the program in the memory 602 and execute:
sending a playing request carrying identification information of a video to be played to a video server, and receiving a first link sent by the video server;
generating a second link containing the first time according to the first link and the current first time, and sending the second link to the video server;
and playing the video according to the directory file of the video returned by the video server, wherein the target file is sent when the video server judges that the first time is later than a second time saved for the video.
Wherein, after playing according to the directory file of the video sent by the video server, the method comprises the following steps:
and when the video is determined to be quitted from watching, generating a third link containing the third time according to the first link and the current third time, and sending a quitting request containing the third link to the video server.
Further, the generating the link including the time according to the first link and the current time includes:
encrypting the current time and the account information for watching the video by adopting a preset encryption algorithm to generate corresponding authentication information;
and generating a link containing the current time and the authentication information.
Example 13:
on the basis of the foregoing embodiments, the present invention further provides a computer-readable storage medium storing a computer program executable by a video server apparatus, where the program, when executed on the video server apparatus, causes the video server apparatus to perform the following steps:
receiving a playing request which carries identification information of a video to be played and is sent by playing equipment, and sending a first link of a directory file of the video to the playing equipment;
receiving a second link which is returned by the playing device and generated according to the first link, wherein the second link comprises the current first time when the playing device generates the second link;
judging whether the first time is not later than a second time saved for the video, if so, refusing to send the directory file of the video to the playing device; otherwise, the directory file of the video is sent to the playing equipment.
Further, determining whether the first time is not later than a second time saved for the video comprises:
the video server extracts time in the link as second time according to the multiplexed link corresponding to the currently stored video;
and judging whether the first time is not later than the second time.
Wherein, if not, sending the directory file of the video to the playing device includes:
when the first time is later than the second time, sending a directory file of the video to the playing device;
and when the second time is not extracted, sending the directory file of the video to the playing device.
Further, after the directory file of the video is sent to the playing device, the method is further configured to update the multiplexed link corresponding to the currently stored video according to the currently received second link.
Correspondingly, after the directory file of the video is sent to the playing device, the playing device is further configured to receive an exit request containing a third link sent by the playing device, where the third link is generated according to the first link, and the third link contains a current third time when the playing device generates the third link; and updating the multiplexed link corresponding to the currently stored video according to the currently received third link.
In addition, the device is also used for decrypting the authentication information in the second link; judging whether the fourth time obtained after decryption is later than the first time or not and whether the account identification information obtained after decryption is a legal account or not; and if so, sending the directory file of the video to the playing equipment.
Specifically, if the fourth time is not later than the second time or the account identification information obtained after decryption is an illegal account, the sending of the directory file of the video to the playing device is refused.
Example 14:
on the basis of the foregoing embodiments, an embodiment of the present invention further provides a computer-readable storage medium, which stores a computer program executable by a playback device, and when the program runs on the playback device, the playback device is caused to execute the following steps:
sending a playing request carrying identification information of a video to be played to a video server, and receiving a first link sent by the video server;
generating a second link containing the first time according to the first link and the current first time, and sending the second link to the video server;
and playing the video according to the directory file of the video returned by the video server, wherein the target file is sent when the video server judges that the first time is later than a second time saved for the video.
Wherein, after playing according to the directory file of the video sent by the video server, the method comprises the following steps:
and when the video is determined to be quitted from watching, generating a third link containing the third time according to the first link and the current third time, and sending a quitting request containing the third link to the video server.
Further, the generating the link including the time according to the first link and the current time includes:
encrypting the current time and the account information for watching the video by adopting a preset encryption algorithm to generate corresponding authentication information;
and generating a link containing the current time and the authentication information.
The embodiment of the invention provides a video providing method, a device, equipment, a medium and a system based on an HLS protocol, wherein the method comprises the following steps: the method comprises the steps that a video server receives a playing request which is sent by playing equipment and carries identification information of a video to be played, and sends a first link of a directory file of the video to the playing equipment; receiving a second link which is returned by the playing device and generated according to the first link, wherein the second link comprises the current first time when the playing device generates the second link; the video server judges whether the first time is not later than a second time saved for the video, and if so, the video server refuses to send the directory file of the video to the playing device; otherwise, the directory file of the video is sent to the playing equipment. According to the embodiment of the invention, after the playing device receives the first link of the directory file of the video to be played, the second link containing the first time for sending the second link is generated, so that the video server can judge whether the first time in the second link is later than the second time for storage, determine the link sent by the legal playing device according to the judgment of the time, and provide the directory file according to the link sent by the legal terminal, thereby effectively preventing the problem of obtaining the video through network packet capturing and improving the safety of video provision.
The computer readable storage medium may be any available medium or data storage device that can be accessed by a processor in an electronic device, including but not limited to magnetic memory such as floppy disks, hard disks, magnetic tape, magneto-optical disks (MOs), etc., optical memory such as CDs, DVDs, BDs, HVDs, etc., and semiconductor memory such as ROMs, EPROMs, EEPROMs, non-volatile memory (NAND FLASH), Solid State Disks (SSDs), etc.
For the system/apparatus embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and reference may be made to some descriptions of the method embodiments for relevant points.
It is to be noted that, in this document, relational terms such as first and second, and the like are used solely to distinguish one entity or operation from another entity or operation without necessarily requiring or implying any actual such relationship or order between such entities or operations.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely application embodiment, or an embodiment combining application and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the invention.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.

Claims (25)

1. A method for video provision based on HLS protocol, comprising:
the method comprises the steps that a video server receives a playing request which is sent by playing equipment and carries identification information of a video to be played, and sends a first link of a directory file of the video to the playing equipment;
receiving a second link which is returned by the playing device and generated according to the first link, wherein the second link comprises the current first time when the playing device generates the second link;
the video server judges whether the first time is not later than a second time saved for the video, and if so, the video server refuses to send the directory file of the video to the playing device; otherwise, the directory file of the video is sent to the playing equipment.
2. The method of claim 1, wherein the video server determining whether the first time is not later than a second time saved for the video comprises:
the video server extracts time in the multiplexed link as second time according to the multiplexed link corresponding to the currently stored video;
and judging whether the first time is not later than the second time.
3. The method of claim 1, wherein the otherwise sending the directory file of the video to the playback device comprises:
when the first time is later than the second time, sending a directory file of the video to the playing device;
and when the second time is not extracted, sending the directory file of the video to the playing device.
4. The method of any of claims 1-3, wherein after sending the directory file of the video to the playback device, further comprising:
and the video server updates the multiplexed link corresponding to the currently stored video according to the currently received second link.
5. The method of claim 1, wherein after sending the directory file of the video to the playback device, the method further comprises:
the video server receives an exit request which is sent by the playing device and contains a third link, wherein the third link is generated according to the first link, and the third link contains the current third time when the playing device generates the third link;
and the video server updates the multiplexed link corresponding to the currently stored video according to the currently received third link.
6. The method as claimed in claim 1, wherein the second link includes authentication information, and before sending the directory file of the video to the playback device, the method includes:
decrypting the authentication information in the second link;
judging whether the fourth time obtained after decryption is later than the second time or not and whether the account identification information obtained after decryption is a legal account or not;
and if so, sending the directory file of the video to the playing equipment.
7. The method according to claim 6, wherein if the fourth time is not later than the second time or the account identification information obtained after decryption is an illegal account, the transmission of the directory file of the video to the playback device is denied.
8. A method for video provision based on HLS protocol, comprising:
the method comprises the steps that a playing device sends a playing request carrying identification information of a video to be played to a video server and receives a first link sent by the video server;
generating a second link containing the first time according to the first link and the current first time, and sending the second link to the video server;
and playing the video according to the directory file of the video returned by the video server, wherein the target file is sent when the video server judges that the first time is later than a second time saved for the video.
9. The method of claim 8, wherein after playing according to the directory file of the video sent by the video server, comprising:
and when the video is determined to be quitted from watching, generating a third link containing the third time according to the first link and the current third time, and sending a quitting request containing the third link to the video server.
10. The method of claim 8 or 9, wherein generating the link including the time based on the first link and a current time comprises:
encrypting the current time and the account information for watching the video by adopting a preset encryption algorithm to generate corresponding authentication information;
and generating a link containing the current time and the authentication information.
11. An apparatus for video provisioning based on HLS protocol, comprising:
the data transmission module is used for receiving a playing request which carries identification information of a video to be played and is sent by playing equipment, and sending a first link of a directory file of the video to the playing equipment;
a data receiving module, configured to receive a second link, generated according to the first link, returned by the playback device, where the second link includes a current first time when the playback device generates the second link;
the data judgment module is used for judging whether the first time is not later than second time saved aiming at the video, and if so, refusing to send the directory file of the video to the playing equipment; otherwise, the directory file of the video is sent to the playing equipment.
12. The apparatus according to claim 11, wherein the data determining module is specifically configured to extract, according to a multiplexed link corresponding to the currently stored video, a time in the multiplexed link as a second time; and judging whether the first time is not later than the second time.
13. The apparatus according to claim 11, wherein the data determining module is specifically configured to send the directory file of the video to the playback device when the first time is later than the second time; and when the second time is not extracted, sending the directory file of the video to the playing device.
14. The apparatus of any one of claims 11-13, further comprising:
and the data updating module is used for updating the multiplexed link corresponding to the currently stored video according to the currently received second link.
15. The apparatus according to claim 11, wherein the data receiving module is further configured to receive an exit request sent by the playback device and including a third link, where the third link is generated according to the first link, and the third link includes a current third time when the playback device generates the third link;
the device further comprises:
and the data updating module is used for updating the multiplexed link corresponding to the currently stored video according to the currently received third link.
16. The apparatus of claim 11, wherein the data determining module is further configured to decrypt authentication information in the second link; and judging whether the fourth time obtained after decryption is later than the second time or not and whether the account identification information obtained after decryption is a legal account or not, and if so, sending the directory file of the video to the playing device.
17. The apparatus according to claim 16, wherein the data determining module is further configured to refuse to send the directory file of the video to the playback device if the fourth time is not later than the second time or the account identification information obtained after decryption is an illegal account.
18. An apparatus for video provisioning based on HLS protocol, comprising:
the receiving module is used for sending a playing request carrying identification information of a video to be played to a video server and receiving a first link sent by the video server;
a sending module, configured to generate a second link including the first time according to the first link and the current first time, and send the second link to the video server;
and the playing module is used for playing the video according to the directory file of the video returned by the video server, wherein the target file is sent when the video server judges that the first time is later than a second time for storing the video.
19. The apparatus of claim 18, wherein the sending module is further configured to generate a third link including the third time according to the first link and a current third time when determining to quit viewing the video, and send a quit request including the third link to the video server.
20. The apparatus according to claim 18 or 19, wherein the sending module is further configured to encrypt the current time and the account information for viewing the video by using a preset encryption algorithm to generate corresponding authentication information; and generating a link containing the current time and the authentication information.
21. A video server, characterized in that the video server comprises a processor for implementing the steps of the method according to any one of claims 1-7 when executing a computer program stored in a memory.
22. A playback device, characterized in that the playback device comprises a processor for implementing the steps of the method as claimed in any one of claims 8-10 when executing a computer program stored in a memory.
23. A computer-readable storage medium, characterized in that it stores a computer program executable by a video server, which program, when run on said video server apparatus, causes said video server apparatus to perform the steps of the method of any one of claims 1 to 7.
24. A computer-readable storage medium, characterized in that it stores a computer program executable by a playback device, which program, when run on the playback device, causes the playback device to carry out the steps of the method of any one of claims 8 to 10.
25. A system for video provision based on the HLS protocol, characterized in that the system comprises a method as claimed in any of claims 1 to 7 applied to a video server and a method as claimed in any of claims 8 to 10 applied to a playback device.
CN201910876641.6A 2019-09-17 2019-09-17 HLS-based video providing method, device, equipment, medium and system Active CN112533034B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910876641.6A CN112533034B (en) 2019-09-17 2019-09-17 HLS-based video providing method, device, equipment, medium and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910876641.6A CN112533034B (en) 2019-09-17 2019-09-17 HLS-based video providing method, device, equipment, medium and system

Publications (2)

Publication Number Publication Date
CN112533034A true CN112533034A (en) 2021-03-19
CN112533034B CN112533034B (en) 2023-08-25

Family

ID=74974708

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910876641.6A Active CN112533034B (en) 2019-09-17 2019-09-17 HLS-based video providing method, device, equipment, medium and system

Country Status (1)

Country Link
CN (1) CN112533034B (en)

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2013109941A2 (en) * 2012-01-19 2013-07-25 Vid Scale, Inc. Methods and systems for video delivery supporting adaption to viewing conditions
WO2013166851A1 (en) * 2012-05-10 2013-11-14 华为技术有限公司 Media playing method, device and system
CN103607634A (en) * 2013-11-19 2014-02-26 四川长虹电器股份有限公司 Method for reducing network video ordering terminal user waiting time
CN104284239A (en) * 2013-07-11 2015-01-14 中兴通讯股份有限公司 Video playing method and device, video playing client side and multimedia server
CN106131660A (en) * 2016-07-15 2016-11-16 青岛海信宽带多媒体技术有限公司 video positioning playing method and device
CN106603660A (en) * 2016-12-14 2017-04-26 传线网络科技(上海)有限公司 Collaborative downloading method, terminal and system for distributed type videos
CN107222480A (en) * 2017-05-27 2017-09-29 中国联合网络通信集团有限公司 A kind of flow media playing method, terminal device and CDN server
TW201840204A (en) * 2017-04-17 2018-11-01 中華電信股份有限公司 Method of preventing illegal link to content delivery network audio/video services capable of determining an illegal link user by analyzing Token-IP corresponding information
CN108810658A (en) * 2017-05-05 2018-11-13 广东亿迅科技有限公司 A kind of method and system of HLS net casts door chain
WO2019136838A1 (en) * 2018-01-09 2019-07-18 武汉斗鱼网络科技有限公司 Method for preventing video stream from being stolen, storage medium, device, and system

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2013109941A2 (en) * 2012-01-19 2013-07-25 Vid Scale, Inc. Methods and systems for video delivery supporting adaption to viewing conditions
WO2013166851A1 (en) * 2012-05-10 2013-11-14 华为技术有限公司 Media playing method, device and system
CN104284239A (en) * 2013-07-11 2015-01-14 中兴通讯股份有限公司 Video playing method and device, video playing client side and multimedia server
CN103607634A (en) * 2013-11-19 2014-02-26 四川长虹电器股份有限公司 Method for reducing network video ordering terminal user waiting time
CN106131660A (en) * 2016-07-15 2016-11-16 青岛海信宽带多媒体技术有限公司 video positioning playing method and device
CN106603660A (en) * 2016-12-14 2017-04-26 传线网络科技(上海)有限公司 Collaborative downloading method, terminal and system for distributed type videos
TW201840204A (en) * 2017-04-17 2018-11-01 中華電信股份有限公司 Method of preventing illegal link to content delivery network audio/video services capable of determining an illegal link user by analyzing Token-IP corresponding information
CN108810658A (en) * 2017-05-05 2018-11-13 广东亿迅科技有限公司 A kind of method and system of HLS net casts door chain
CN107222480A (en) * 2017-05-27 2017-09-29 中国联合网络通信集团有限公司 A kind of flow media playing method, terminal device and CDN server
WO2019136838A1 (en) * 2018-01-09 2019-07-18 武汉斗鱼网络科技有限公司 Method for preventing video stream from being stolen, storage medium, device, and system

Also Published As

Publication number Publication date
CN112533034B (en) 2023-08-25

Similar Documents

Publication Publication Date Title
US11055429B2 (en) Key providing method, video playing method, server and client
US9607132B2 (en) Token-based validation method for segmented content delivery
CA2405489C (en) Secure digital content licensing system and method
US7155415B2 (en) Secure digital content licensing system and method
JP5626816B2 (en) Method and apparatus for partial encryption of digital content
US20120072729A1 (en) Watermark extraction and content screening in a networked environment
US11640448B2 (en) License confirmation via embedded confirmation challenge
JP2004193843A (en) Device, method, and program for content delivery and device, method, and program for reproducing content
AU2001253243A1 (en) Secure digital content licensing system and method
CN110011950B (en) Authentication method and device for video stream address
CN109040079A (en) The establishment of live streaming chained address and verification method and related device
CN108235067B (en) Authentication method and device for video stream address
CN108206961B (en) Method for calculating popularity of live broadcast platform and related equipment
TWI640194B (en) Content delivery network audio and video service anti-theft connection method
KR100963420B1 (en) Device and method for detecting dcas host with duplicated secure micro
CN103250423B (en) For receiving the method for content of multimedia by control word scrambling and CAPTCHA
US20200364317A1 (en) Method and system for identifying a user terminal in order to receive streaming protected multimedia content
CN111131849A (en) Streaming media live broadcast method and device and computer readable storage medium
CN112533034B (en) HLS-based video providing method, device, equipment, medium and system
US20100241863A1 (en) Device for reproducing digital content, secure electronic entity, system comprising said elements and method for reproducing digital content
CN110012319B (en) Authentication method and device for video stream address
CN109218773B (en) Authentication method and device for video stream address
CN111355980A (en) Copyright attribution processing method, middleware and system for digital video product
US20230315882A1 (en) Secure Client Watermark
US11949933B2 (en) Systems and methods for managing access to content assets

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