CN117729379A - Video playing method and device and electronic equipment - Google Patents

Video playing method and device and electronic equipment Download PDF

Info

Publication number
CN117729379A
CN117729379A CN202311764938.6A CN202311764938A CN117729379A CN 117729379 A CN117729379 A CN 117729379A CN 202311764938 A CN202311764938 A CN 202311764938A CN 117729379 A CN117729379 A CN 117729379A
Authority
CN
China
Prior art keywords
video file
video
client
state
token
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.)
Pending
Application number
CN202311764938.6A
Other languages
Chinese (zh)
Inventor
洪定乾
徐锐波
陈斯
刘熠
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Yunsizhixue Technology Co ltd
Original Assignee
Beijing Yunsizhixue 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 Beijing Yunsizhixue Technology Co ltd filed Critical Beijing Yunsizhixue Technology Co ltd
Priority to CN202311764938.6A priority Critical patent/CN117729379A/en
Publication of CN117729379A publication Critical patent/CN117729379A/en
Pending legal-status Critical Current

Links

Abstract

The invention discloses a video playing method, a video playing device and electronic equipment, and relates to the technical field of video processing, wherein the method comprises the following steps: responding to a video playing request sent by a client through a video playing interface, and checking a user login state and a user identity state of the client; if the user login state is the logged-in state, processing the encrypted video file, and sending the processed complete video file to the client; responding to a token verification request sent by the client through a key address in the complete video file, and verifying whether the token in the complete video file is valid or not; if the token is valid and the user identity state is a member state, acquiring a key of a storage device pre-stored in the server, and sending the key to the client through a key address. The method and the device ensure that only authorized users can play the video file, prevent unauthorized users from intercepting, downloading or pirating the content, and protect the safety of the video content and the rights and interests of the authorized users.

Description

Video playing method and device and electronic equipment
Technical Field
The disclosure relates to the technical field of video processing, and in particular relates to a video playing method, a video playing device and electronic equipment.
Background
As usage scenarios and coverage of member videos increase, HLS (HTTP Live Streaming) streaming technology and content encryption functionality become increasingly important. The development of streaming media markets and the need for content protection have further driven the popularity and application of HLS streaming media technology. By using HLS streaming technology and content encryption functionality, a better viewing experience can be provided to users and the interests of content providers are protected, thereby promoting the healthy development of the streaming market.
However, in the related art, the playing process of the member video does not encrypt the video clip, so that the user can relatively easily intercept, download and share the video clip, which results in unauthorized transmission and piracy of the video content and damages the profitability of the member video. Meanwhile, unencrypted video content is also vulnerable to tampering or injection of malicious content, exposing users to security risks.
Disclosure of Invention
In view of the above, the present disclosure provides a video playing method, a device and an electronic device, and aims to solve the problem of poor video playing security caused by that a video playing process of a member video in the related art does not encrypt a video clip.
In a first aspect, the present disclosure provides a video playing method, where the method is applied to a server, and the method includes:
responding to a video playing request sent by a client through a video playing interface, and checking a user login state and a user identity state of the client;
if the user login state is the logged-in state, processing the encrypted video file, and sending the processed complete video file to the client, wherein the encrypted video file is obtained by sectionally encrypting a video file in a first format, the video file in the first format is obtained by transcoding the video file in an original format, and the encrypted video file comprises a text play list and a plurality of video fragments corresponding to the text play list;
responding to a token verification request sent by the client through a key address in the complete video file, and verifying whether the token in the complete video file is valid or not;
if the token is valid and the user identity state is a member state, acquiring a key of a storage device pre-stored in the server, and sending the key to the client through a key address, so that the client decrypts the complete video file through the key and plays a plurality of video clips in the complete video file.
In a second aspect, the present disclosure provides a video playing method, where the method is applied to a client, and the method includes:
responding to a video playing page triggered by a user, and acquiring a video playing interface address corresponding to the video playing page;
sending a video playing request to a server through a video playing interface, and receiving a complete video file sent by the server when the user login state is a logged-in state;
the player of the client sends a token verification request to the server through a key address so that the server verifies whether the token in the complete video file is valid or not, and the key address is obtained by analyzing the complete video file through the player;
and receiving the key sent by the server according to the condition that the user identity is in the member state and the server verifies that the token is valid, and decrypting the complete video file through the key so as to play a plurality of video clips in the complete video file.
In a third aspect, the present disclosure provides a video playing device, which is applied to a server, the device including:
the checking unit is used for responding to a video playing request sent by the client through the video playing interface and checking the user login state and the user identity state of the client;
The video sending unit is used for processing the encrypted video file and sending the processed complete video file to the client if the login state of the user is the logged-in state, wherein the encrypted video file is obtained by sectionally encrypting a video file in a first format, the video file in the first format is obtained by transcoding a video file in an original format, and the encrypted video file comprises a text play list and a plurality of video clips corresponding to the text play list;
the verification unit is used for responding to a token verification request sent by the client through the key address in the complete video file and verifying whether the token in the complete video file is valid or not;
and the decryption unit is used for acquiring a key of the storage device pre-stored in the server and sending the key to the client through the key address if the token is effective and the user identity state is a member state, so that the client decrypts the complete video file through the key and plays the video fragment in the complete video file.
In a fourth aspect, the present disclosure provides a video playing device, where the method is applied to a client, the method includes:
the acquisition unit is used for responding to the video playing page triggered by the user and acquiring a video playing interface address corresponding to the video playing page;
The video receiving unit is used for sending a video playing request to the server through the video playing interface and receiving a complete video file sent by the server when the user login state is the logged-in state;
the verification unit is used for sending a token verification request to the server through a key address by the player of the client so that the server verifies whether the token in the complete video file is valid or not, and the key address is obtained by analyzing the complete video file through the player;
and the decryption unit is used for receiving the secret key sent by the server when the server is in the member state according to the user identity state and the server verifies that the token is valid, and decrypting the complete video file through the secret key so as to play the video clip in the complete video file.
In a fifth aspect, the present disclosure provides a computer readable storage medium having stored thereon a computer program which when executed by a processor implements the method of the first or second aspect.
In a sixth aspect, the present disclosure provides an electronic device comprising a storage medium, a processor and a computer program stored on the storage medium and executable on the processor, the processor implementing the method of the first or second aspect when executing the computer program.
By means of the technical scheme, the video playing method, the video playing device, the video playing system and the electronic equipment provided by the disclosure, specifically, the user login state and the user identity state of the client are checked in response to a video playing request sent by the client through the video playing interface; if the user login state is the logged-in state, processing the encrypted video file, and sending the processed complete video file to the client, wherein the encrypted video file is obtained by sectionally encrypting a video file in a first format, the video file in the first format is obtained by transcoding the video file in an original format, and the encrypted video file comprises a text play list and a plurality of video fragments corresponding to the text play list; responding to a token verification request sent by the client through a key address in the complete video file, and verifying whether the token in the complete video file is valid or not; if the token is valid and the user identity state is a member state, acquiring a key of a storage device pre-stored in the server, and sending the key to the client through a key address, so that the client decrypts the complete video file through the key and plays a plurality of video clips in the complete video file. Compared with the prior art, the method and the device can carry out sectional encryption on the video file, set a detection mechanism of a user login state and an identity state and a token verification mechanism, ensure that only authorized users can play the video file, avoid interception, downloading or pirating of the content by unauthorized users, and help to maintain copyrights of the content, thereby protecting the safety of the video content and the rights of the authorized users and ensuring that content providers can reclaim the creation and investment of the content providers.
The foregoing description is merely an overview of the technical solutions of the present disclosure, and may be implemented according to the content of the specification in order to make the technical means of the present disclosure more clearly understood, and in order to make the above and other objects, features and advantages of the present disclosure more clearly understood, the following specific embodiments of the present disclosure are specifically described.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the disclosure and together with the description, serve to explain the principles of the disclosure.
In order to more clearly illustrate the embodiments of the present disclosure or the solutions in the prior art, the drawings that are required for the description of the embodiments or the prior art will be briefly described below, and it will be obvious to those skilled in the art that other drawings can be obtained from these drawings without inventive effort.
Fig. 1 is a schematic flow chart of a video playing method according to an embodiment of the disclosure;
fig. 2 is a schematic flow chart of a video playing method according to an embodiment of the disclosure;
FIG. 3 illustrates a schematic diagram of video encryption transcoding provided by an embodiment of the present disclosure;
Fig. 4 is a schematic flow chart of a video playing method according to an embodiment of the disclosure;
fig. 5 is a schematic diagram illustrating a specific video playing method according to an embodiment of the disclosure;
fig. 6 is a schematic diagram of a video playing device according to an embodiment of the disclosure;
fig. 7 is a schematic diagram of a video playing device according to an embodiment of the disclosure.
Detailed Description
In order that the above objects, features and advantages of the present disclosure may be more clearly understood, a further description of aspects of the present disclosure will be provided below. It should be noted that, without conflict, the embodiments of the present disclosure and features in the embodiments may be combined with each other.
In order to improve the problem of poor video playing security caused by the fact that the video clip is not encrypted in the playing flow of the member video in the related art. The video playing method is safer, protected and high in quality, and ensures the safety of video playing, so that benefits of member video providers are protected, and better user experience is provided.
The video playing method provided by the disclosure is mainly applied to the intelligent terminal, can be particularly applied to video playing scenes in the intelligent terminal, can be particularly applied to scenes such as entertainment, education, news media and the like, and is not limited in the embodiment of the disclosure.
The video playing method provided by the present disclosure is described in detail below with reference to the accompanying drawings.
Fig. 1 is a flowchart of a video playing method according to an embodiment of the present disclosure. As shown in fig. 1, the method is applied to a server, and the video playing method includes steps 101-104.
Step 101, responding to a video playing request sent by a client through a video playing interface, and checking a user login state and a user identity state of the client.
In the embodiment of the disclosure, the video playing interface is a network interface, which is acquired by the client through a video playing page triggered by a user and is used for realizing interaction between the client and the server. The video playing interfaces corresponding to different video playing pages may be the same or different, which is not limited in the embodiments of the present disclosure.
The video playing request refers to a request sent by a client to a server, and is used for requesting to play a video file or streaming media data.
The checking of the user login status and the user identity status of the client may be performed by a video playing service in the server. The user login state includes a logged-in state and a non-logged-in state, and the user identity state includes a member state and a non-member state.
Specifically, after receiving a video playing request sent by a client through a video playing interface, the video playing service of the server can check the user login state and the user identity state of the client so as to perform subsequent operations of video playing according to the user login state and the user identity state.
It can be understood that by checking the user login status and the user identity status of the client, it can be ensured that only logged in and qualified users can play the encrypted video file, thereby protecting the security of the video content and the rights and interests of authorized users.
Step 102, if the user login state is the logged-in state, processing the encrypted video file, and sending the processed complete video file to the client.
In the present disclosure, an encrypted video file is obtained by segment-encrypting a video file in a first format, which is obtained by transcoding a video file in an original format, and the encrypted video file includes a text playlist and a plurality of video clips corresponding to the text playlist.
In the embodiment of the disclosure, if the video playing service of the server detects that the user login state is the logged-in state, the encrypted video file is processed to obtain the processed complete video file. And sends the complete video file to the client.
The complete video file also comprises a determined key address and a token generated based on the token request of the client.
Step 103, in response to the token verification request sent by the client through the key address in the complete video file, verifying whether the token in the complete video file is valid.
In the disclosed embodiment, the key address refers to an interface address of the video key service, and the token verification request refers to a request for the video token service of the server to verify whether the token in the current complete video file is valid.
The Token may also be called Token, and in the application of video playing, the Token is a string of characters generated by the video Token service of the server, and may be used as a Token requested by the client. When the user logs in for the first time, the video Token service of the server generates a Token and returns the Token to the client. After that, the client only needs to carry the Token to request data, and does not need to carry the user name and the password again. Token's composition typically includes a user's unique identity, validity time, and signature (i.e., the first few bits of Token are compressed into a length of hexadecimal string by a hash algorithm).
In the present disclosure, the video token service of the server may specifically verify whether the current token is valid according to the validity time of the token.
Step 104, if the token is valid and the user identity state is a member state, acquiring a key of a storage device pre-stored in the server, and sending the key to the client through a key address, so that the client decrypts the complete video file through the key and plays a plurality of video clips in the complete video file.
In the embodiment of the disclosure, if the current token is verified to be valid according to the valid time of the token and the current user identity state is a member state, a key pre-stored in a storage device of a server is acquired and sent to a client through a key address.
The storage device of the server may refer to a cloud disk of the server. Yun Pan is a specialized internet storage tool, is a product of internet cloud technology, provides services such as information storage, reading and downloading for enterprises and individuals through the internet, and has the characteristics of safety, stability and mass storage. The cloud disk is used on the server, so that the data can be stored and managed more conveniently, and meanwhile, the safety and reliability of the data can be improved.
In summary, by the method provided by the present disclosure, the video file may be encrypted in segments, and a detection mechanism for a user login state and an identity state and a token verification mechanism are set, so that only an authorized user is ensured to play the video file, interception, downloading or pirating of content by an unauthorized user is avoided, and maintenance of copyright of the content is facilitated, thereby protecting security of the video content and rights of the authorized user, and ensuring that a content provider can reclaim creation and investment of the content provider.
Based on the embodiment shown in fig. 1, fig. 2 further shows a flow chart of a video playing method proposed in the present disclosure. Fig. 2 further defines steps 102 and 103 based on the embodiment shown in fig. 1. In the embodiment shown in fig. 2, step 102 includes step 202, step 203, and step 204, and step 103 includes step 205. As shown in fig. 2, the method comprises the steps of:
step 201, responding to a video playing request sent by a client through a video playing interface, and checking a user login state and a user identity state of the client.
In an embodiment of the present disclosure, a user login identifier and a user identity identifier of a client are obtained; respectively inquiring a user identification list pre-stored in a database according to the user login identification and the user identification; if the user login identification or the user identity identification is inquired in the user identity list, determining that the user login state is a logged-in state or the user identity state is a member state; if the user login identification or the user identity identification is not queried in the user identity list, determining that the user login state is an unregistered state or the user identity state is a non-member state.
In an optional embodiment of the present disclosure, the client may obtain, through a video playing page triggered by a user, an address of a video playing interface corresponding to a current food playing page. The client accesses the video playing interface through the address of the food playing interface and sends a video playing request to the video playing service of the server. And responding to the video playing request, the video playing service of the server acquires the user login identification and the user identity identification of the current client, queries a user identification list stored in a database, and determines the user login state and the user identity state of the current client according to the query result.
Step 202, if the user login state is the logged-in state, generating a token in response to the token request of the client.
In an embodiment of the present disclosure, if a video playback service in a server checks that a user login state is a logged-in state, a video token service of the server generates a token in response to a token request sent by a client.
Optionally, before step 202, the method further includes: receiving a video file in an original format, and triggering a transcoding task; transcoding the video file in the original format based on a transcoding command in the transcoding task to generate a video file in a first format; the method comprises the steps of carrying out segmented encryption on a video file in a first format through a secret key and an encryption algorithm, obtaining an encrypted video file, storing the encrypted video file into a storage device of a server, and obtaining the secret key under a transcoding task according to the encryption algorithm.
The method comprises the steps of encrypting a video file in a first format through a secret key and an encryption algorithm, obtaining an encrypted video file, and storing the encrypted video file into a storage device of a server, wherein the method comprises the following steps: and adding a preset label to the text play list in the video file in the first format, wherein the preset label comprises an encryption algorithm and a key address.
Specifically, in an alternative embodiment of the present disclosure, as shown in the schematic diagram of video encryption transcoding in fig. 3, a video provider uploads a video in a raw format to a video transcoding service of a server. Wherein the original format may be an mp4 format. A video provider refers to a content creator, media agency, individual user, or other entity that owns a video asset.
And triggering a transcoding task after the video transcoding service receives the video file in the original format, and requesting the video key service of the server to generate a key. The video key service generates a key according to an encryption algorithm and stores the corresponding relation among the video identification, the key identification and the key ciphertext. The encryption algorithm may be an AES encryption algorithm, and the key may be a random 128-bit AES key generated by the AES encryption algorithm.
The video transcoding service transcodes the video file in the original format to generate a video file in a first format, wherein the video file in the first format comprises a text play list and a plurality of video clips corresponding to the text play list. The first format may be M3U8 format, the text playlist may be a header of a video file in M3U8 format, and the plurality of video clips may be TS video clips.
The video key service uses the generated key to encrypt the video file in the first format in a segmented way to obtain an encrypted video file, and stores the encrypted video file to a cloud disk, namely a storage device of the server.
It should be noted that, before the encrypted video file is obtained, a preset tag (for example, "#ext-X-KEY" tag) may be added to the video file in the first format after the transcoding is completed, where the preset tag includes an encryption algorithm and a KEY address. I.e. the preset tag contains an encryption algorithm attribute ("METHOD" attribute) which may be designated as AES-128, and a key address attribute ("URI" attribute) which is the key address of the video key service.
Wherein M3U8 is a Unicode version of M3U encoded with UTF-8. Both the "M3U" and "M3U8" files are the basis for the HTTP Live Streaming (HLS) protocol format used by apple inc, which can be played on devices such as iPhone and Macbook.
The TS (Transport Stream) is a packaged format, which is all called MPEG2-TS. MPEG2-TS is a standard data container format for transmitting and storing audio and video, program and system information protocol data, and is mainly used in digital broadcasting systems such as DVB, ATSC and IPTV. Transport streams were originally designed for broadcast. Later, by adding 4-byte Time Code (TC) to standard 188-byte data packet, the data packet is converted into 192-byte data packet, and the 192-byte data packet is suitable for digital video cameras, video recorders and players
The advanced encryption standard (Advanced Encryption Standard, AES), also known as Rijndael encryption, in AES cryptography is a block encryption standard adopted by the federal government in the united states.
In addition, in the embodiment of the disclosure, if the login state is the unregistered state, a part of the video file of the encrypted video file is intercepted and sent to the client.
Specifically, if the login state is an unregistered state or the user identity state is a non-member state, a part of video file with a preset size is intercepted according to the video file with the current first format, and the part of video file is sent to the client, so that the client can directly play the part of video file. The preset size may be determined according to practical situations, and is not limited in the embodiments of the present disclosure.
Step 203, determining a key address in a preset tag in the encrypted video file, and adding the token to the encrypted video file to obtain a complete video file.
In the embodiment of the present disclosure, the KEY address ("URI" address) in the preset tag ("#ext-X-KEY" tag) is modified, so as to determine the KEY address in the preset tag in the current encrypted video file, and the token acquired in step 202 is added to the encrypted video file, so as to acquire the complete video file.
And step 204, transmitting the complete video file to the client.
In the embodiment of the present disclosure, the complete video file obtained in step 203 is sent to the client through the video playing interface.
Step 205, in response to the token verification request sent by the client through the key address, verifying whether the token is valid or not according to the valid time of the token.
In an embodiment of the disclosure, if the current time does not exceed the valid time of the token, determining that the token is valid; and if the current time exceeds the valid time of the token, determining that the token is invalid.
In an alternative embodiment of the present disclosure, a token authentication request sent by a client via a key address is received and in response to the token authentication request, it is verified whether the token is valid. The method specifically comprises the steps of comparing the current time with the effective time of the current token by acquiring the current time and the effective time of the current token, and determining that the token is effective if the current time does not exceed the effective time; if the current time exceeds the valid time of the token, then the token is determined to be invalid.
Step 206, if the token is valid and the user identity state is a member state, acquiring a key of a storage device pre-stored in the server, and sending the key to the client through a key address, so that the client decrypts the complete video file through the key and plays a plurality of video clips in the complete video file.
In the embodiment of the disclosure, if the token is valid and the checked user identity state is a member state, a key stored in the server cloud disk is queried and sent to the client, so that the client decrypts the encrypted video file through the key and plays the video clip in the encrypted video file.
In addition, in the embodiment of the disclosure, if the token is invalid or the checked user identity state is not the non-membership state, a verification error message is returned to the client at this time.
In summary, the present disclosure uses HLS encryption to ensure that member video content is effectively cryptographically protected, helping to maintain privacy rights for users, ensuring that only authorized members can access the content. Unauthorized users are prevented from intercepting, downloading or pirating the content, which is helpful for maintaining the copyright of the content, ensuring that the content provider can reclaim the creation and investment of the content provider, and protecting the rights and interests of members and the income sources of the content provider. Meanwhile, the video playing method can use the HTTPS protocol to transmit the encrypted video content and the secret key, so that the safety of data in the transmission process is ensured. This prevents data leakage and tampering, protecting the integrity of the user data. And the video playing method has wide compatibility, can play the encrypted video stream on various devices and operating systems, which means that members can watch contents on the devices selected by the members, and provides greater flexibility.
Fig. 4 is a flowchart of a video playing method according to an embodiment of the present disclosure. As shown in fig. 4, the method is applied to a client, and the video playing method includes steps 301 to 304.
Step 301, responding to a video playing page triggered by a user, and acquiring a video playing interface address corresponding to the video playing page.
Step 302, a video playing request is sent to a server through a video playing interface, and a complete video file sent by the server when the user login state is the logged-in state is received.
In step 303, the player of the client sends a token verification request to the server through a key address, so that the server verifies whether the token in the complete video file is valid, and the key address is obtained by analyzing the complete video file through the player.
In the embodiment of the disclosure, after receiving the complete video file sent by the server, the client sends the complete video file to the player, and the player obtains a key address by analyzing the complete video file and sends a token verification request to the server according to the key address.
Step 304, receiving the key sent by the server when the user identity state is the member state and the server verifies that the token is valid, and decrypting the complete video file through the key to play a plurality of video clips in the complete video file.
In summary, by the method provided by the present disclosure, the video file encrypted in segments can be decrypted and played, and a detection mechanism and a token verification mechanism for the user login state and the identity state are set, so that only authorized users can play the video file, unauthorized users are prevented from intercepting, downloading or pirating the content, copyright of the content is maintained, safety of the video content and rights of authorized users are protected, and content providers can be ensured to reclaim creation and investment.
Further, in order to fully describe the specific implementation procedure of the method of the present embodiment, the present embodiment provides the following examples, but is not limited thereto, and a schematic diagram of a specific video playing method is shown in fig. 5.
In an embodiment of the disclosure, a client obtains a video playing interface address according to a video playing page triggered by a user. The client accesses the video playing interface, and the server video playing service checks the user login state and the user identity state of the client after receiving the video playing request sent by the client.
If the user login state is the unregistered state or the user identity state is the non-membership state, part of the video files in the complete video files are intercepted as file resources of the trial viewing M3U8 and sent to the client.
If the user login state is the login state and the user identity state is the member state, a video token service (video token service) of the request server acquires a token (token), determines a key address ('URI' address) in an encrypted video file (complete m3u8 file resource), adds the token into the encrypted video file, acquires a complete video file, and sends the complete video file to the client;
after the client acquires the complete video file, the complete video file is transmitted to a player of the client, the player analyzes the complete video file after receiving the complete video file, acquires a key address in a preset tag in the complete video file, and requests the server to send a key according to the key address.
After receiving the key request through the key interface corresponding to the key address, the video key service in the server requests the video token service to verify whether the token is valid. If the token is invalid or the user identity state is a non-member state, returning verification error information to the client; if the token is valid and the user identity state is a member state, inquiring a corresponding key, and sending the key to the client for decrypting the complete video file and playing the video clip in the complete video file.
Compared with the related art, the video playing method of the HLS encrypted video file brings multiple benefits to the member video, including content protection, user privacy protection, transmission safety, multi-platform compatibility, member rights protection and the like, and improves the safety of video playing. Creating a safer, more controllable and more pleasant viewing experience for content providers and members.
Further, as a specific implementation of the method shown in fig. 1 and fig. 2, the present embodiment provides a video playing device, as shown in fig. 6, where the device is applied to a server, and the device includes:
the checking unit 610 is configured to check a user login status and a user identity status of the client in response to a video play request sent by the client through the video play interface;
the video sending unit 620 is configured to process the encrypted video file and send the processed complete video file to the client if the user login status is a logged-in status, where the encrypted video file is obtained by performing segment encryption on a video file in a first format, and the video file in the first format is obtained by transcoding a video file in an original format, and the encrypted video file includes a text playlist and a plurality of video clips corresponding to the text playlist;
A verification unit 630, configured to verify whether the token in the complete video file is valid in response to a token verification request sent by the client through the key address in the complete video file;
and the decryption unit 640 is configured to obtain a key pre-stored in the storage device of the server if the token is valid and the user identity state is a member state, and send the key to the client through the key address, so that the client decrypts the complete video file through the key and plays the video clip in the complete video file.
In an embodiment of the present disclosure, if the user login status is a logged-in status, the encrypted video file is processed, and the processed complete video file is sent to the client, and before that, the video playing device further includes: the transcoding unit is used for receiving the video file in the original format and triggering a transcoding task; transcoding the video file in the original format based on a transcoding command in the transcoding task to generate a video file in a first format; the method comprises the steps of carrying out segmented encryption on a video file in a first format through a secret key and an encryption algorithm, obtaining an encrypted video file, storing the encrypted video file into a storage device of a server, and obtaining the secret key under a transcoding task according to the encryption algorithm.
In an embodiment of the present disclosure, the transcoding unit is further adapted to: and before encrypting the video file in the first format through the key and the encryption algorithm to obtain an encrypted video file and storing the encrypted video file in a storage device of the server, adding a preset tag in a text play list in the video file in the first format, wherein the preset tag comprises the encryption algorithm and a key address.
In an embodiment of the present disclosure, the checking unit 610 is configured to: acquiring a user login identifier and a user identity identifier of a client; respectively inquiring a user identification list pre-stored in a database according to the user login identification and the user identification; if the user login identification or the user identity identification is inquired in the user identity list, determining that the user login state is a logged-in state or the user identity state is a member state; if the user login identification or the user identity identification is not queried in the user identity list, determining that the user login state is an unregistered state or the user identity state is a non-member state.
In an embodiment of the present disclosure, the video playing device further includes: and the examination unit is used for intercepting part of the video files of the encrypted video files if the login state is the unregistered state and sending the part of the video files to the client.
In an embodiment of the present disclosure, the video transmitting unit 620 is configured to: if the user login state is the logged-in state, responding to a token request of the client, and generating a token; determining a key address in a preset tag in the encrypted video file, and adding a token into the encrypted video file to obtain a complete video file; and sending the complete video file to the client.
In an embodiment of the present disclosure, the verification unit 630 is configured to: responding to a token verification request sent by the client through the key address, and verifying whether the token is valid or not according to the valid time of the token; if the current time does not exceed the effective time of the token, determining that the token is effective; and if the current time exceeds the valid time of the token, determining that the token is invalid.
In summary, through the video playing device, the present disclosure may perform segment encryption on a video file, and set a detection mechanism for a user login state and an identity state, and a token verification mechanism, so as to ensure that only an authorized user can play the video file, avoid interception, downloading or pirating of content by an unauthorized user, and help to maintain copyrights of content, thereby protecting security of video content and rights of authorized users, and ensuring that a content provider can reclaim authoring and investment thereof.
It should be noted that, for other corresponding descriptions of each functional unit related to the video playing device provided in this embodiment, reference may be made to corresponding descriptions in fig. 1 and fig. 2, and no further description is given here.
Further, as a specific implementation of the method shown in fig. 4, the embodiment provides a video playing device, as shown in fig. 7, where the device is applied to a client, and the device includes:
an obtaining unit 710, configured to obtain a video playing interface address corresponding to a video playing page in response to a video playing page triggered by a user;
the video receiving unit 720 is configured to send a video playing request to the server through the video playing interface, and receive a complete video file sent by the server when the server is in a logged-in state according to the user login state;
the verifying unit 730 is configured to send a token verifying request to the server by using a key address, where the key address is obtained by analyzing the complete video file by using the player, so that the server verifies whether the token in the complete video file is valid;
the decryption unit 740 is configured to receive a key sent by the server when the server is in a member state according to the user identity state and the server verifies that the token is valid, and decrypt the complete video file through the key, so as to play the video clip in the complete video file.
In summary, through the video playing device, the present disclosure may decrypt the video file encrypted in segments, and set a detection mechanism for the user login status and the identity status, and a token verification mechanism, so as to ensure that only authorized users can play the video file, avoid interception, downloading or pirating of the content by unauthorized users, and facilitate maintenance of copyrights of the content, thereby protecting security of the video content and rights of authorized users, and ensuring that content providers can reclaim their authoring and investment.
Based on the above-described methods shown in fig. 1, 2 and 4, correspondingly, the embodiments of the present disclosure further provide a computer readable storage medium having a computer program stored thereon, which when executed by a processor, implements the above-described methods shown in fig. 1 and 2 or 4.
Based on such understanding, the technical solution of the present disclosure may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (may be a CD-ROM, a U-disk, a mobile hard disk, etc.), and includes several instructions for causing a computer device (may be a personal computer, a server, or a network device, etc.) to execute the method of each implementation scenario of the present disclosure.
Based on the methods shown in fig. 1, fig. 2 and fig. 4 and the virtual device embodiments shown in fig. 6 and fig. 7, in order to achieve the above objects, the embodiments of the present disclosure further provide an electronic device, which may be configured on a computer side or the like, and the device includes a storage medium and a processor; a storage medium storing a computer program; a processor for executing a computer program to implement the method as shown in fig. 1 and 2 or 4.
In some embodiments, the physical device may further include a user interface, a network interface, a camera, radio Frequency (RF) circuitry, sensors, audio circuitry, WI-FI modules, and the like. The user interface may include a Display screen (Display), an input unit such as a Keyboard (Keyboard), etc., and the optional user interface may also include a USB interface, a card reader interface, etc. The network interface may include a standard wired interface, a wireless interface (e.g., WI-FI interface), etc. in some embodiments.
It will be appreciated by those skilled in the art that the above-described physical device structure provided by the embodiments of the present disclosure is not limiting of the physical device, and may include more or fewer components, or may combine certain components, or may be a different arrangement of components.
The storage medium may also include an operating system, a network communication module. The operating system is a program that manages the physical device hardware and software resources described above, supporting the execution of information handling programs and other software and/or programs. The network communication module is used for realizing communication among all components in the storage medium and communication with other hardware and software in the information processing entity equipment.
Through the description of the embodiments disclosed above, those skilled in the art can clearly understand that the present disclosure can ensure that only authorized users can play video files by encrypting video files in sections and setting a detection mechanism for user login status and identity status and a token verification mechanism, so as to avoid interception, downloading or pirating of content by unauthorized users, and help to maintain copyrights of content, thereby protecting the security of video content and the rights of authorized users, and ensuring that content providers can reclaim their creation and investment.
It is noted that relational terms such as "first" and "second", and the like, are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The foregoing is merely a specific embodiment of the disclosure to enable one skilled in the art to understand or practice the disclosure. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the disclosure. Thus, the present disclosure is not intended to be limited to the embodiments shown and described herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (12)

1. A video playing method, wherein the method is applied to a server, and the method comprises:
responding to a video playing request sent by a client through a video playing interface, and checking a user login state and a user identity state of the client;
if the user login state is the logged-in state, processing an encrypted video file, and sending the processed complete video file to the client, wherein the encrypted video file is obtained by sectionally encrypting a video file in a first format, the video file in the first format is obtained by transcoding a video file in an original format, and the encrypted video file comprises a text play list and a plurality of video fragments corresponding to the text play list;
Responding to a token verification request sent by the client through a key address in the complete video file, and verifying whether a token in the complete video file is valid or not;
and if the token is valid and the user identity state is a member state, acquiring a key pre-stored in a storage device of the server, and sending the key to the client through the key address, so that the client decrypts the complete video file through the key and plays a plurality of video clips in the complete video file.
2. The method according to claim 1, wherein if the user login status is a logged-in status, processing the encrypted video file and transmitting the processed complete video file to the client comprises:
receiving the video file in the original format and triggering a transcoding task;
transcoding the video file in the original format based on the transcoding command in the transcoding task to generate the video file in the first format;
and carrying out sectional encryption on the video file in the first format through a secret key and an encryption algorithm to obtain an encrypted video file, and storing the encrypted video file into a storage device of the server, wherein the secret key is obtained according to the encryption algorithm under the transcoding task.
3. The method of claim 2, wherein encrypting the video file in the first format by a key and an encryption algorithm, obtaining an encrypted video file, and storing the encrypted video file to a storage device of the server, previously comprises:
and adding a preset tag to a text play list in the video file in the first format, wherein the preset tag comprises the encryption algorithm and a key address.
4. The method of claim 1, wherein the checking the user login status and the user identity status of the client in response to a video play request sent by the client through a video play interface comprises:
acquiring a user login identifier and a user identity identifier of the client;
respectively inquiring a user identification list pre-stored in a database according to the user login identification and the user identification;
if the user login identification or the user identity identification is inquired in the user identity list, determining that the user login state is a logged-in state or the user identity state is a member state;
and if the user login identification or the user identity identification is not queried in the user identity list, determining that the user login state is an unregistered state or the user identity state is a non-member state.
5. The method according to claim 4, wherein the method further comprises:
and if the login state is the unregistered state, intercepting part of the video file of the encrypted video file, and sending the part of the video file to the client.
6. The method of claim 1, wherein processing the encrypted video file and transmitting the processed complete video file to the client if the user login status is a logged-in status comprises:
if the user login state is the logged-in state, responding to the token request of the client side, and generating a token;
determining a key address in a preset tag in the encrypted video file, and adding the token into the encrypted video file to obtain a complete video file;
and sending the complete video file to a client.
7. The method of claim 1, wherein verifying whether the token is valid in response to a token verification request sent by the client via the key address comprises:
responding to a token verification request sent by the client through the key address, and verifying whether the token is valid or not according to the valid time of the token;
If the current time does not exceed the effective time of the token, determining that the token is effective;
and if the current time exceeds the valid time of the token, determining that the token is invalid.
8. A video playing method, wherein the method is applied to a client, and the method comprises:
responding to a video playing page triggered by a user, and acquiring a video playing interface address corresponding to the video playing page;
sending a video playing request to the server through the video playing interface, and receiving a complete video file sent by the server when the user login state is a logged-in state;
the player of the client sends a token verification request to the server through the key address so that the server verifies whether the token in the complete video file is valid or not, and the key address is obtained by analyzing the complete video file through the player;
and receiving a key sent by the server when the server is in a member state according to the user identity state and the server verifies that the token is valid, and decrypting the complete video file through the key so as to play a plurality of video clips in the complete video file.
9. A video playback device, the device being applied to a server, the device comprising:
the checking unit is used for responding to a video playing request sent by the client through the video playing interface and checking the user login state and the user identity state of the client;
the video sending unit is used for processing the encrypted video file and sending the processed complete video file to the client if the user login state is the logged-in state, wherein the encrypted video file is obtained by sectionally encrypting a video file in a first format, the video file in the first format is obtained by transcoding the video file in an original format, and the encrypted video file comprises a text play list and a plurality of video fragments corresponding to the text play list;
the verification unit is used for responding to a token verification request sent by the client through the key address in the complete video file and verifying whether the token in the complete video file is valid or not;
and the decryption unit is used for acquiring a key of the storage device pre-stored in the server and sending the key to the client through the key address if the token is valid and the user identity state is a member state, so that the client decrypts the complete video file through the key and plays the video clip in the complete video file.
10. A video playback device, the device being applied to a client, the device comprising:
the device comprises an acquisition unit, a display unit and a display unit, wherein the acquisition unit is used for responding to a video playing page triggered by a user and acquiring a video playing interface address corresponding to the video playing page;
the video receiving unit is used for sending a video playing request to the server through the video playing interface and receiving a complete video file sent by the server when the server is in a logged-in state according to the login state of the user;
the verification unit is used for sending a token verification request to the server through the key address by the player of the client so that the server verifies whether the token in the complete video file is valid or not, and the key address is obtained by analyzing the complete video file through the player;
and the decryption unit is used for receiving a key sent by the server when the server is in a member state according to the user identity state and the server verifies that the token is valid, and decrypting the complete video file through the key so as to play the video clip in the complete video file.
11. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the method of any one of claims 1 to 7 or 8.
12. An electronic device comprising a storage medium, a processor and a computer program stored on the storage medium and executable on the processor, characterized in that the processor implements the method of any one of claims 1 to 7 or 8 when executing the computer program.
CN202311764938.6A 2023-12-20 2023-12-20 Video playing method and device and electronic equipment Pending CN117729379A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311764938.6A CN117729379A (en) 2023-12-20 2023-12-20 Video playing method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311764938.6A CN117729379A (en) 2023-12-20 2023-12-20 Video playing method and device and electronic equipment

Publications (1)

Publication Number Publication Date
CN117729379A true CN117729379A (en) 2024-03-19

Family

ID=90210409

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311764938.6A Pending CN117729379A (en) 2023-12-20 2023-12-20 Video playing method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN117729379A (en)

Similar Documents

Publication Publication Date Title
US11055429B2 (en) Key providing method, video playing method, server and client
US10999631B2 (en) Managed content distribution systems and methods
TWI510066B (en) Systems and methods for securely streaming media content
US9038147B2 (en) Progressive download or streaming of digital media securely through a localized container and communication protocol proxy
US9026782B2 (en) Token-based entitlement verification for streaming media decryption
US10055553B2 (en) PC secure video path
CN107707504B (en) Streaming media playing method and system, server and client
CN101977190B (en) Digital content encryption transmission method and server side
US20150121484A1 (en) System and method for signaling and verifying url signatures for both url authentication and url-based content access authorization in adaptive streaming
KR20110004333A (en) Processing recordable content in a stream
US11432039B2 (en) Systems and methods for data processing, storage, and retrieval from a server
KR20130085926A (en) System and method for processing security based on http live streaming
CN113259720B (en) Video encryption method and system based on HLS protocol
KR20110004332A (en) Processing recordable content in a stream
US8196214B2 (en) Method and apparatus for securing content using encryption with embedded key in content
CN110139136B (en) Method and device for playing network television based on DRM technology
US20200364317A1 (en) Method and system for identifying a user terminal in order to receive streaming protected multimedia content
CN117729379A (en) Video playing method and device and electronic equipment
CN114501069A (en) HLS-based multimedia playing method, system, device and storage medium
Dabholkar et al. Looney tunes: Exposing the lack of DRM protection in indian music streaming services
Costa et al. Securing video on demand content with SGX: a decryption performance evaluation in client-side
Mikityuk et al. Content protection in HTML5 TV platforms: Towards browser-agnostic DRM and cloud UI environments
CN114760501A (en) Digital copyright protection method, system, server, module, player and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination