Summary of the invention
The invention provides a kind of channel based on door chain and play implementation method, system and equipment, easily stolen problem is play in order to solve the channel video existed in prior art, better can realize the real-time authorization playing authority, ensure the safe handling of channel video better.
The invention provides a kind of channel based on door chain and play implementation method, comprising:
The video-see request that live TV stream server receives client sends, according to timestamp and default key, generates live authority character string;
Live TV stream server sends described live authority character string and first video segment to client;
The video segment carrying live authority character string of live TV stream server receives client transmission obtains request;
Live TV stream server is according to the term of validity of live authority character string, client is verified, verify by time, upgrade the term of validity of described live authority character string, return next video segment and the live authority character string after upgrading, until all video segments obtain complete.
Some beneficial effects of the embodiment of the present invention can comprise:
During the video-see request that live TV stream server receives client sends, can according to timestamp and the live authority character string of secret generating preset, by the term of validity of live authority character string, realize the real-time authorization to client, when the video segment receiving user obtains request at every turn, upgrade the term of validity of live authority character string, ensure that the smoothness of video obtains, even if unauthorized user gets video segment, also can only play the time span of a term of validity, thus effectively avoid the stolen use of video resource, usurp; The method can realize the real-time authorization playing authority, ensures the safe handling of channel video better; And can ensure that various video resource is reasonable, Normalization rule, the video resource effectively avoiding not having the user of authority to use it having no right to use, different users can use the video resource of different channel according to its authority, also ensures the fail safe that video resource uses simultaneously.
In some optional embodiments, live TV stream server, according to the term of validity of live authority character string, verifies client, specifically comprises:
According to timestamp, the key that live TV stream server parses timestamp and presets from live authority character string, according to the legitimacy of the key verification client preset, and determines that whether the term of validity of live authority character string is expired.
In this embodiment, by the term of validity of live authority character string, real-time authorized client uses the time of video resource, thus ensure that the safe handling of video resource better, is more conducive to the use control and management of video resource.
In some optional embodiments, said method also comprises:
Live TV stream server receives logon server and obtains and the user ID of the use client logs sent, the default set password of user's tenant and channel list, and buffer memory.
In this embodiment, the user ID of the use client logs that logon server provides by live TV stream server, the default set password of user's tenant and channel list, so that according to the default set password of user's tenant, the rights of using of authentication of users, and provide client to use the video resource of the channel having rights of using in channel list, further ensure the reasonable employment of video resource.
In some optional embodiments, in the described video-see request that live TV stream server receives, also comprise the broadcast address of the channel of default set password and selection viewing;
Live TV stream server verifies client, also comprises:
According to described user ID and default set password, live TV stream server determines that user has rights of using.
In this embodiment, live TV stream server, when receiving the video-see request that client sends, by the information of buffer memory, carries out rights of using checking to client, and the safe and reasonable further ensuring video resource uses.
The embodiment of the present invention also provides a kind of live TV stream server, comprising:
Receiver module, for receiving the video-see request that client sends, and the video segment carrying live authority character string receiving client transmission obtains request;
Generation module, for when described receiver module receives video-see request, according to timestamp and default key, generates live authority character string;
Inspection module, during for receiving video segment acquisition request at described receiver module, according to the term of validity of live authority character string, client is verified, verify by time, upgrade the term of validity of described live authority character string, until all video segments obtain complete;
Sending module, after generating live authority character string at described generation module, sends described live authority character string and first video segment to client; And after the term of validity of the described live authority character string of inspection module renewal, return next video segment and the live authority character string after upgrading to client.
In some optional embodiments, described correction verification module, specifically for:
According to timestamp, the key parsing timestamp and preset from live authority character string, according to the legitimacy of the key verification client preset, and determines that whether the term of validity of live authority character string is expired.
In some optional embodiments, above-mentioned live TV stream server, also comprises cache module;
Described receiver module, also obtains and the user ID of the use client logs sent, the default set password of user's tenant and channel list for receiving logon server;
Described cache module, uses the user ID of client logs, the default set password of user's tenant and channel list for buffer memory.
The embodiment of the present invention also provides a kind of client, comprising:
Sending module, for sending video-see request to live TV stream server, and sends the video segment acquisition request of carrying live authority character string to live TV stream server;
Receiver module, for receiving live authority character string and first video segment of the transmission of live TV stream server, wherein said live authority character string is live TV stream server when receiving video-see request, according to timestamp and the live authority character string of secret generating preset; And receive the next video segment of live TV stream server transmission and the live authority character string after upgrading, until all video segments obtain complete, wherein, described next video segment and upgrade after live authority character string be live TV stream server receive video segment obtain request time, according to the term of validity of live authority character string, client is verified, verify by time, return after upgrading the term of validity of described live authority character string.
The embodiment of the present invention also provides a kind of channel based on door chain to play and realizes system, comprising: above-mentioned live TV stream server and above-mentioned client.
In some optional embodiments, the above-mentioned channel based on door chain is play and is realized system, also comprises:
Logon server, uses the user ID of client logs, the default set password of user's tenant and channel list to live TV stream server buffer for obtaining and sending.
Other features and advantages of the present invention will be set forth in the following description, and, partly become apparent from specification, or understand by implementing the present invention.Object of the present invention and other advantages realize by structure specifically noted in write specification, claims and accompanying drawing and obtain.
Below by drawings and Examples, technical scheme of the present invention is described in further detail.
Embodiment
Below in conjunction with accompanying drawing, the preferred embodiments of the present invention are described, should be appreciated that preferred embodiment described herein is only for instruction and explanation of the present invention, is not intended to limit the present invention.
In order to solve the problems of the prior art, the embodiment of the present invention provides a kind of channel based on door chain to play implementation method, the video resource of different channel can be used according to its authority for different users, avoid channel video and play stolen problem, better can realize the real-time authorization playing authority, ensure the safe handling of channel video.
The channel based on door chain that the embodiment of the present invention provides plays implementation method, and its flow process as shown in Figure 1, comprises the steps:
Step S101: the video-see request that live TV stream server receives client sends.
Client sends video-see request to live TV stream server after selecting the channel wanting to watch.
Step S102: live TV stream server, according to timestamp and default key, generates live authority character string.
After live TV stream server receives video-see request, according to timestamp and default key, generate live authority character string, i.e. live token.
Such as: live token can obtain after carrying out Message-Digest Algorithm 5 (Message-Digest Algorithm 5, MD5) encryption to timestamp and default key, also obtains by other selected generation methods.
Live token has certain term of validity, the control to video resource service time can be realized, after client takes live token, video resource can be used before the deadline, if the term of validity of live token is expired, client no longer will can use video resource.
Step S103: live TV stream server sends live authority character string and first video segment to client.
After live TV stream server receives video-see request, client can be provided by the live token generated, meanwhile, first video segment can be provided for user's viewing to client.
Such as: net cast stream can be 10 seconds video clip files of, such as TS files, after client takes live token, if the term of validity of live token is 10 seconds, that client normally can only watch first TS file.Certain term of validity of live token and the length of video clip files are not limited to 10 seconds, can arrange as the case may be.
Step S104: the video segment carrying live authority character string of live TV stream server receives client transmission obtains request.
When client needs the next video segment obtaining net cast stream, need to send live authority character string to live TV stream server, verified by live TV stream server, the verification of live authority character string by time, live TV stream server just can to client transmissions next one video clip files.
Such as: receive live token when client will receive first TS file and send to live TV stream server, for obtaining verification during second TS file, when client obtains next TS file at every turn, all need the live token received when obtaining a upper TS file to send to live TV stream server to verify.
Step S105: live TV stream server, according to the term of validity of live authority character string, verifies client.
Live TV stream server, according to the term of validity of live authority character string, verifies the rights of using of client, verify by time, next video clip files just can be provided to client.
According to timestamp, the key that live TV stream server parses timestamp and presets from live authority character string, according to the legitimacy of the key verification client preset, and determines that whether the term of validity of live authority character string is expired.By the term of validity of live authority character string, real-time authorized client uses the time of video resource, thus ensure that the safe handling of video resource better, is more conducive to the use control and management of video resource.
Step S106: live TV stream server verification by time, upgrade the term of validity of live authority character string, return next video segment and upgrade after live authority character string, until all video segments obtain complete.
Live TV stream server is when carrying out verification and passing through to client, the term of validity of live authority character string can be upgraded, such as by extension of validity 10 seconds, when being supplied to client next one video segment, also the live authority character string after extending the expiration date is sent to client, for use in verification next time, like this by upgrading the term of validity of live authority character string, thering is provided successively of video resource is provided, and ensures smooth, the smooth playing of video resource.
When last video segment of client-requested, can as above-mentioned provide video segment to client while, continue the live authority character string after renewal is provided.Optionally, during last video segment of client-requested, also can not reoffer the live authority character string after renewal, and last video segment is only provided.
The technical scheme that the embodiment of the present invention provides, during the video-see request that live TV stream server receives client sends, can according to timestamp and the live authority character string of secret generating preset, by the term of validity of live authority character string, realize the real-time authorization to client, when the video segment receiving user obtains request at every turn, upgrade the term of validity of live authority character string, ensure that the smoothness of video obtains, even if unauthorized user gets video segment, also the time span of a term of validity can only be play, thus effectively avoid the stolen use of video resource, usurp, the method can realize the real-time authorization playing authority, ensures the safe handling of channel video better, and can ensure that various video resource is reasonable, Normalization rule, the video resource effectively avoiding not having the user of authority to use it having no right to use, different users can use the video resource of different channel according to its authority, also ensures the fail safe that video resource uses simultaneously.
Embodiment one
The embodiment of the present invention one provides a kind of channel based on door chain to play implementation method, and on the basis of the method provided in embodiment one, increase the verification step to default set authority belonging to client, its flow process as shown in Figure 2, comprises the steps:
Step S201: live TV stream server receives logon server and obtains and the user ID of the use client logs sent, the default set password of user's tenant and channel list, and buffer memory.
After logon server gets and uses the user ID of client logs, the default set password of user's tenant and channel list, the use user ID of client logs, the default set password of user's tenant and channel list are supplied to live TV stream server, these information of live TV stream server buffer, use when carrying out rights management so that follow-up, thus the default set password of the tenant realized belonging to user and tenant, carry out channel resource and license.
Step S202: the video-see request that live TV stream server receives client sends.
The broadcast address of the channel of default set password and selection viewing is also comprised in the video-see request that live TV stream server receives; Wherein, default set password is used for determining whether user has permission according to user's tenant and uses institute ask the video resource of channel used, and the broadcast address of the channel that the selection that viewing request comprises is watched can be channel ID.
Step S203: according to user ID and default set password, live TV stream server determines that user has rights of using.
In above-described embodiment one, live TV stream server verifies client, also comprises and determines that user has the step of rights of using according to user ID and default set password.
After live TV stream server receives viewing request, determine whether user has permission the video resource of the channel that use is asked according to the default set password in user ID and viewing request, when determining that user has permission the video resource using this channel, provide the video resource of the channel of selected viewing to user.
Determine that user has rights of using, concrete can verify that whether channel ID that the client sent request asks is the channel ID in default set, can also verify that whether the IP address of the client sent request is legal.
Step S204: according to timestamp and default key, generate live authority character string.
In this embodiment, when determining that user's tenant has permission the video resource of the channel that use is asked by default set password, generating live authority character string, and continuing subsequent step.
The technical scheme that the embodiment of the present invention provides, the user ID of the use client logs that logon server provides by live TV stream server, the default set password of user's tenant and channel list, when receiving the video-see request that client sends, according to the information of buffer memory, the default set password etc. of such as user's tenant, rights of using checking is carried out to client, after the rights of using of authentication of users, there is provided client to use the video resource of the channel having rights of using in channel list again, further ensure the safety of video resource, reasonable employment.
Embodiment two
The concrete methods of realizing that the embodiment of the present invention two provides a kind of channel based on door chain to play, its flow process as shown in Figure 3, comprises the steps:
Step S301: logon server obtains and uses the user ID of client logs, the default set password of user's tenant and channel list, sends to live TV stream server buffer.
The use user ID of client logs, the default set password of user's tenant and channel list are supplied to live TV stream server by logon server, these information of live TV stream server buffer, use when carrying out rights management so that follow-up, thus the default set password of the tenant realized belonging to user and tenant, carry out channel resource and license.
Logon server obtains the default set password of the user's tenant using client logs, can have following two kinds of optional manner.
Mode one: logon server receives user ID and the user cipher of client transmission, according to user ID and user cipher, determines the default set password of user's tenant.
Which generates default set password by logon server according to the ID of login user and user cipher, is supplied to live TV stream server after obtaining default set password, meanwhile, also can be supplied to client in order to follow-up use.
Concrete, the user ID that logon server can send according to client and user cipher, generate user right character string; According to user right character string, determine user's tenant and obtain the default set password of tenant.
Mode two: logon server receives the default set password of user ID, user cipher and the user's tenant that client sends, and when determining that the default set password that user sends is legal according to user ID and user cipher, obtains the default set password of user's tenant.
Which has client that default set password is reported logon server, and the default set password reported can be that client is obtained by other approach or once issued by logon server before.
Step S302: live TV stream server receives logon server and obtains and the user ID of the use client logs sent, the default set password of user's tenant and channel list, and buffer memory.
Step S303: client sends channel list and obtains request to logon server.
When user wants to watch the video resource of channel, need first to obtain channel list information from logon server, to select the channel that will watch.
Step S304: logon server returns the channel list and default set password that comprise all channel broadcast address to client.
When client will obtain the video resource of channel, send channel list to logon server and obtain request, to know the information such as channel list and default set password, thus to know the broadcast address of each channel, according to the video resource of broadcast address to live TV stream server request corresponding channel.
Logon server receives the channel list acquisition request that client sends, request is obtained according to the channel list that client sends, return to client and comprise the channel list of all channel broadcast address and the process of default set password, can comprise: logon server receives the channel list acquisition request comprising user right character string that client sends; Logon server is according to the broadcast address of all channels below the default set of user right string searching user tenant; Logon server returns the channel list and default set password that comprise all channel broadcast address to client.
Logon server obtains the user right character string in request according to channel list, i.e. user token, the broadcast address of all channels below the default set of searching user's tenant, and the channel list and default set password that comprise all channel broadcast address are supplied to client.Simultaneously also default set password to be supplied to client for subsequent use for logon server.
Step S305: client sends and comprises default set password and select the viewing of the broadcast address of the channel of viewing to ask to live TV stream server.
Client gets the channel list and default set password comprising all channel broadcast address from logon server after, the channel wanting to watch can be selected from channel list, according to the broadcast address selecting the channel watched, default set password is used to send viewing request to live TV stream server, the video resource of the channel selected by request viewing.Viewing asks the broadcast address of the channel of the selection viewing comprised can be channel ID.
Step S306: the viewing request that live TV stream server receives client sends.
Step S307: according to user ID and default set password, live TV stream server determines that user has rights of using.
After live TV stream server receives viewing request, determine whether user has permission the video resource of the channel that use is asked according to the default set password in user ID and viewing request, when determining that user has permission the video resource using this channel, continue subsequent step.
Step S308: live TV stream server, according to timestamp and default key, generates live authority character string.
Live TV stream server, when determining that user's tenant has permission the video resource of the channel that use is asked by default set password, generates live authority character string, and continues subsequent step.
Step S309: live TV stream server, according to timestamp and default key, generates live authority character string.
After live TV stream server receives video-see request, according to timestamp and default key, generate live authority character string, i.e. live token.
Step S310: live TV stream server sends live authority character string and first video segment to client.
Such as: net cast stream is every 10 seconds TS files of, after client takes live token, normally can watch first TS file, when reception second ts file, need to send live token to live TV stream server.
Step S311: the video segment carrying live authority character string of live TV stream server receives client transmission obtains request.
Client you can live authority character string be placed on after the address of the page, separate with question mark and address above, there is no the user of live token, the page of this channel of not opening.
Step S312: live TV stream server, according to the term of validity of live authority character string, verifies client.
Such as: live TV stream server verifies live token, verify by rear, transmit next TS file to client.
Such as: live TV stream server verifies the IP address of the client sent request, the term of validity of live token, and channel ID be whether channel ID etc. in default set.
Step S313: live TV stream server verification by time, upgrade the term of validity of live authority character string.
The time span that the extension of validity of live authority character string sets by live TV stream server, such as by the extension of validity 10 seconds of live token.If the web page address with live token is copied to other people, other people also can only see the content of 10 seconds.
Step S314: live TV stream server returns next video segment and the live authority character string after upgrading to client.
Live authority character string after live TV stream server returns next video segment and from renewal to client is until determine that the acquisition of all video segments is complete.
When suspend play after again continued broadcasting time, client needs to resend request, and live TV stream server regenerates live token to client.
Step S315: it is complete whether video segment obtains.
If so, perform step S316 process ends, if not, return step S311 and continue monitoring receiver, video fragment acquisition request.
Step S316: terminate.
The technical scheme that the embodiment of the present invention provides, the default set codon pair of user's tenant is adopted to use the user of video resource to carry out rights management and control, concrete, by logon server by user ID, the information such as the default set password of user's tenant and channel list send to live TV stream server buffer, when client obtains video resource from live TV stream server, live TV stream server can confirm according to the rights of using of information to client such as user ID and default set passwords, when confirming that client has rights of using, there is provided and select the video resource of the channel watched to client, and realize the real-time control to video resource rights of using by live authority character string, thus the user realized for different user groups, the video resource of different channel is used according to rights of using, avoid the user not having authority use its have no right use video resource, realize video resource reasonable employment, ensure the fail safe that video resource uses and normalization.The method realizes simple, convenient, can realize the reasonable employment of video resource well, avoids video resource use management chaotic.
Based on same inventive concept, the embodiment of the present invention also provides a kind of channel based on door chain to play and realizes system, and this system configuration as shown in Figure 4, comprising: live TV stream server 401 and client 402.
Live TV stream server 401, for receiving the video-see request that client sends, according to timestamp and default key, generates live authority character string; Described live authority character string and first video segment is sent to client; Receive the video segment acquisition request of carrying live authority character string that client sends; According to the term of validity of live authority character string, client is verified, verify by time, upgrade the term of validity of described live authority character string, return next video segment and upgrade after live authority character string, until all video segments obtain complete.
Client 402, for sending video-see request to live TV stream server, the live authority character string that reception live TV stream server returns and first video segment; And sending video segment acquisition request to live TV stream server, the next video segment that reception live TV stream server returns and the live authority character string after upgrading, until the acquisition of all video segments is complete.
Preferably, above-mentioned live TV stream server 401, specifically for the key parsing timestamp and preset from live authority character string, according to the legitimacy of the key verification client preset, and determine that whether the term of validity of live authority character string is expired according to timestamp.
Preferably, above-mentioned live TV stream server 401, also obtains and the user ID of the use client logs sent, the default set password of user's tenant and channel list for receiving logon server, and buffer memory.And according to user ID and default set password, live TV stream server 401 determines that user has rights of using.
Preferably, the above-mentioned channel based on door chain is play and is realized system and also comprise:
Logon server 403, for, obtain and send the use user ID of client logs, the default set password of user's tenant and channel list to live TV stream server buffer.
The structure of above-mentioned live TV stream server 401 as shown in Figure 5, comprising: receiver module 501, generation module 502, inspection module 503 and sending module 504.
Receiver module 501, for receiving the video-see request that client sends, and the video segment carrying live authority character string receiving client transmission obtains request.
Generation module 502, for when receiver module 501 receives video-see request, according to timestamp and default key, generates live authority character string.
Inspection module 503, during for receiving video segment acquisition request at receiver module 501, according to the term of validity of live authority character string, client is verified, verify by time, upgrade the term of validity of live authority character string, until all video segments obtain complete.
Sending module 504, after generating live authority character string at generation module 502, sends live authority character string and first video segment to client; And after the term of validity upgrading live authority character string at inspection module 503, return next video segment and the live authority character string after upgrading to client.
Preferably, according to timestamp, above-mentioned correction verification module 503, specifically for the key parsing timestamp and preset from live authority character string, according to the legitimacy of the key verification client preset, and determines that whether the term of validity of live authority character string is expired.
Preferably, above-mentioned live TV stream server, also comprises cache module 505.
Above-mentioned receiver module 501, also obtains and the user ID of the use client logs sent, the default set password of user's tenant and channel list for receiving logon server.
Above-mentioned cache module 505, uses the user ID of client logs, the default set password of user's tenant and channel list for buffer memory.
Preferably, the broadcast address of the channel of default set password and selection viewing is also comprised in the described video-see request that above-mentioned receiver module 501 receives.Accordingly, above-mentioned inspection module 503 pairs of clients verify, and also comprise: according to user ID and default set password, live TV stream server determines that user has rights of using.
The structure of above-mentioned client 402 as shown in Figure 6, comprising: sending module 601 and receiver module 602.
Sending module 601, for sending video-see request to live TV stream server, and sends the video segment acquisition request of carrying live authority character string to live TV stream server.
Receiver module 602, for receiving live authority character string and first video segment of the transmission of live TV stream server, wherein live authority character string is live TV stream server when receiving video-see request, according to timestamp and the live authority character string of secret generating preset; And receive the next video segment of live TV stream server transmission and the live authority character string after upgrading, until all video segments obtain complete, wherein, next video segment and the live authority character string after upgrading are that live TV stream server receives video segment when obtaining request, according to the term of validity of live authority character string, client is verified, verify by time, return after upgrading the term of validity of live authority character string.
Preferably, above-mentioned sending module 601, also uses the user ID of client logs, the default set password of user's tenant and channel list for sending to logon server.
Those skilled in the art should understand, embodiments of the invention can be provided as method, system or computer program.Therefore, the present invention can adopt the form of complete hardware embodiment, completely software implementation or the embodiment in conjunction with software and hardware aspect.And the present invention can adopt in one or more form wherein including the upper computer program implemented of computer-usable storage medium (including but not limited to magnetic disc store and optical memory etc.) of computer usable program code.
The present invention describes with reference to according to the flow chart of the method for the embodiment of the present invention, equipment (system) and computer program and/or block diagram.Should understand can by the combination of the flow process in each flow process in computer program instructions realization flow figure and/or block diagram and/or square frame and flow chart and/or block diagram and/or square frame.These computer program instructions can being provided to the processor of all-purpose computer, special-purpose computer, Embedded Processor or other programmable data processing device to produce a machine, making the instruction performed by the processor of computer or other programmable data processing device produce device for realizing the function of specifying in flow chart flow process or multiple flow process and/or block diagram square frame or multiple square frame.
These computer program instructions also can be stored in can in the computer-readable memory that works in a specific way of vectoring computer or other programmable data processing device, the instruction making to be stored in this computer-readable memory produces the manufacture comprising command device, and this command device realizes the function of specifying in flow chart flow process or multiple flow process and/or block diagram square frame or multiple square frame.
These computer program instructions also can be loaded in computer or other programmable data processing device, make on computer or other programmable devices, to perform sequence of operations step to produce computer implemented process, thus the instruction performed on computer or other programmable devices is provided for the step realizing the function of specifying in flow chart flow process or multiple flow process and/or block diagram square frame or multiple square frame.
Obviously, those skilled in the art can carry out various change and modification to the present invention and not depart from the spirit and scope of the present invention.Like this, if these amendments of the present invention and modification belong within the scope of the claims in the present invention and equivalent technologies thereof, then the present invention is also intended to comprise these change and modification.