CN113014956A - Video playing method and device - Google Patents

Video playing method and device Download PDF

Info

Publication number
CN113014956A
CN113014956A CN201911323762.4A CN201911323762A CN113014956A CN 113014956 A CN113014956 A CN 113014956A CN 201911323762 A CN201911323762 A CN 201911323762A CN 113014956 A CN113014956 A CN 113014956A
Authority
CN
China
Prior art keywords
video
index
encryption
encrypted
slices
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201911323762.4A
Other languages
Chinese (zh)
Other versions
CN113014956B (en
Inventor
蒋涌
温睿诚
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201911323762.4A priority Critical patent/CN113014956B/en
Publication of CN113014956A publication Critical patent/CN113014956A/en
Application granted granted Critical
Publication of CN113014956B publication Critical patent/CN113014956B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/234Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs
    • H04N21/23418Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs involving operations for analysing video streams, e.g. detecting features or characteristics
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/234Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs
    • H04N21/2347Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs involving video stream encryption
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/25Management operations performed by the server for facilitating the content distribution or administrating data related to end-users or client devices, e.g. end-user or client device authentication, learning user preferences for recommending movies
    • H04N21/262Content or additional data distribution scheduling, e.g. sending additional data at off-peak times, updating software modules, calculating the carousel transmission frequency, delaying a video stream transmission, generating play-lists
    • H04N21/26291Content or additional data distribution scheduling, e.g. sending additional data at off-peak times, updating software modules, calculating the carousel transmission frequency, delaying a video stream transmission, generating play-lists for providing content or additional data updates, e.g. updating software modules, stored at the client
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/25Management operations performed by the server for facilitating the content distribution or administrating data related to end-users or client devices, e.g. end-user or client device authentication, learning user preferences for recommending movies
    • H04N21/266Channel or content management, e.g. generation and management of keys and entitlement messages in a conditional access system, merging a VOD unicast channel into a multicast channel
    • H04N21/26613Channel or content management, e.g. generation and management of keys and entitlement messages in a conditional access system, merging a VOD unicast channel into a multicast channel for generating or managing keys in general
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/80Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
    • H04N21/83Generation or processing of protective or descriptive data associated with content; Content structuring
    • H04N21/845Structuring of content, e.g. decomposing content into time segments
    • H04N21/8456Structuring of content, e.g. decomposing content into time segments by decomposing the content in the time domain, e.g. in time segments
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/80Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
    • H04N21/85Assembly of content; Generation of multimedia applications
    • H04N21/854Content authoring
    • H04N21/8547Content authoring involving timestamps for synchronizing content

Landscapes

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

Abstract

The embodiment of the invention discloses a video playing method and a video playing device, wherein the video playing method comprises the following steps: the method comprises the steps of obtaining a video to be played, extracting video data and a video index of the video to be played, encrypting the video data based on a preset strategy, obtaining a secret key generated in an encryption process, updating the video index according to the secret key to obtain an updated video index, and sending an encryption result and the updated video index to a terminal so that the terminal can play the video to be played according to the encryption result and the updated video index, and therefore the safety of video content can be improved.

Description

Video playing method and device
Technical Field
The invention relates to the technical field of computers, in particular to a video playing method and device.
Background
With the development of internet technology, more and more users can watch videos through various clients or download videos to the local through the clients.
In order to improve the security of video content, a video is usually encrypted on a server side, and the server decrypts the encrypted video and sends the decrypted video to a client for playing or downloads the encrypted video to the client for decryption to generate a temporary buffer video file for playing.
Disclosure of Invention
The embodiment of the invention provides a video playing method and device, which can improve the safety of video contents.
The embodiment of the invention provides a video playing method, which comprises the following steps:
acquiring a video to be played;
extracting video data and a video index of the video to be played;
encrypting the video data based on a preset strategy and acquiring a key generated in the encryption process;
updating the video index according to the key to obtain an updated video index;
and sending the encryption result and the updated video index to the terminal so that the terminal can play the video to be played according to the encryption result and the updated video index.
Correspondingly, an embodiment of the present invention further provides a video playing apparatus, including:
the first acquisition module is used for acquiring a video to be played;
the extraction module is used for extracting the video data and the video index of the video to be played;
the encryption module is used for encrypting the video data based on a preset strategy;
the second acquisition module is used for acquiring a secret key generated in the encryption process;
the updating module is used for updating the video index according to the key to obtain an updated video index;
and the sending module is used for sending the encryption result and the updated video index to the terminal so that the terminal can play the video to be played according to the encryption result and the updated video index.
Optionally, in some embodiments of the present invention, the video data includes a plurality of video slices, and the encryption module includes:
a selecting unit configured to select a video slice to be encrypted from among a plurality of video slices based on a preset policy;
and the encryption unit is used for encrypting the selected video fragments to obtain an encrypted video fragment set.
Optionally, in some embodiments of the present invention, the selecting unit includes:
the acquiring subunit is used for acquiring an encryption starting time point and an encryption ending time point corresponding to a preset strategy;
the extraction subunit is used for extracting the time stamps corresponding to the video fragments;
a first selecting subunit for selecting the video slices having timestamps between the encryption start time point and the encryption end time point.
Optionally, in some embodiments of the present invention, the selecting unit includes:
the determining subunit is used for determining a video fragment corresponding to a preset strategy from the plurality of video fragments to obtain a target video fragment;
and the second selection subunit is used for selecting the video slices within the preset range of the target video slice.
Optionally, in some embodiments of the present invention, the second selecting subunit is specifically configured to:
extracting time stamps corresponding to the video fragments;
determining the arrangement sequence of the video fragments according to the time stamps;
and selecting the video fragments within the preset range of the target video fragments based on the arrangement sequence interval.
Optionally, in some embodiments of the present invention, the selecting unit is specifically configured to:
determining the encryption quantity corresponding to a preset strategy;
a corresponding number of video slices to be encrypted are randomly selected from the plurality of video slices based on the number of encryptions.
Optionally, in some embodiments of the present invention, the encryption unit is specifically configured to:
acquiring a plurality of keys with different key factors;
and respectively encrypting the selected video fragments through a plurality of keys to obtain an encrypted video fragment set.
Optionally, in some embodiments of the present invention, the update module is specifically configured to:
extracting an index file corresponding to the video index;
and adding the key to the index file to obtain an updated index file.
The method comprises the steps of extracting video data and a video index of a video to be played after the video to be played is obtained, encrypting the video data based on a preset strategy, obtaining a key generated in the encryption process, updating the video index according to the key to obtain an updated video index, and finally sending an encryption result and the updated video index to a terminal so that the terminal can play the video to be played according to the encryption result and the updated video index. Therefore, the scheme can effectively improve the safety of the video content.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1a is a schematic scene diagram of a video playing method according to an embodiment of the present invention;
fig. 1b is a schematic flowchart of a video playing method according to an embodiment of the present invention;
fig. 2a is another schematic flow chart of a video playing method according to an embodiment of the present invention;
fig. 2b is a schematic view of another scene of a video playing method according to an embodiment of the present invention;
fig. 2c is a schematic diagram illustrating that a server encrypts video data in a video playing method according to an embodiment of the present invention;
fig. 2d is a schematic diagram of a terminal in the video playing method according to the embodiment of the present invention decrypting encrypted video data;
fig. 3 is a schematic structural diagram of a video playback device according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The embodiment of the invention provides a video playing method and device, electronic equipment and a storage medium.
The video playing device may be specifically integrated in a server, where the server may include an independently operating server or a distributed server, or may include a server cluster composed of a plurality of servers.
Referring to fig. 1a, an embodiment of the present invention provides a video playing system, which may include a video uploader, a server, a terminal, and a user, where the video uploader may upload a video to be uploaded to the server 20 through a network, when the server receives a video playing instruction triggered by the user, the video playing instruction indicates that a video to be played is a video a, the server 20 may obtain the video a according to the video playing instruction, then the server 20 may extract video data of the video a and a video index of the video a, then the server 20 may encrypt the video data based on a preset policy and obtain a key generated in an encryption process, then the server 20 may update the video index according to the key to obtain an updated video index, and finally, the server 20 sends the encrypted result and the updated video index to the terminal 30, the terminal 30 may decrypt the video a according to the encryption result and the updated video index, and play the content of the video a according to the selection of the user after the decryption is completed.
Because the scheme is to encrypt the video data, and update the video index according to the key generated in the encryption process, and finally, the encryption result and the updated video index are sent to the terminal, so that the terminal plays the video to be played according to the encryption result and the updated video index.
The following are detailed below. It should be noted that the description sequence of the following embodiments is not intended to limit the priority sequence of the embodiments.
A video playback method, comprising: the method comprises the steps of obtaining a video to be played, extracting video data and a video index of the video to be played, encrypting the video data based on a preset strategy, obtaining a secret key generated in an encryption process, updating the video index according to the secret key to obtain an updated video index, and sending an encryption result and the updated video index to a terminal so that the terminal can play the video to be played according to the encryption result and the updated video index.
Referring to fig. 1b, fig. 1b is a schematic flowchart illustrating a video playing method according to an embodiment of the present invention. The specific flow of the video playing method can be as follows:
101. and acquiring a video to be played.
The paths for obtaining the video to be played may be various, for example, the video to be played may be obtained from the internet and/or a specified database, and may specifically be determined according to requirements of practical applications, where the video to be played may include a tv show, a movie, a video recorded by a user, and the like.
102. And extracting video data and video indexes of the video to be played.
In some embodiments, the video index may record an attribute and a storage address of each video slice, and the storage address of each video slice may be represented by a Uniform Resource Locator (URL), and in an embodiment of the present invention, a video transmission protocol is followed between the terminal and the server during the video playing process, and the transmission protocol may include: real Time Messaging Protocol (RTMP) and hls (http Live streaming) protocols, among others. Except for special description, the subsequent embodiments of the present invention all take the HLS protocol as an example, and the HLS protocol is a streaming media solution and includes video indexes and video fragments, where the video indexes record indexes of the video fragments, and when a user plays a video through a terminal, the user does not directly play the video indexes, but analyzes the video indexes to obtain the indexes of the video fragments, and finds out the URL of the corresponding video fragment according to the indexes to play, where each video fragment is a segment of video content of the video to be played and includes a timestamp and data such as the video content corresponding to the timestamp.
103. And encrypting the video data based on a preset strategy and acquiring a key generated in the encryption process.
The data encryption process is to process the original plain text file or data according to a certain algorithm to make it become an unreadable section of code, usually called as "ciphertext", to make it only display the original content after inputting the corresponding key, through such a way to achieve the purpose of protecting the data from being stolen and read by the illegal person, wherein, the data encryption algorithm can include symmetric encryption algorithm and asymmetric encryption algorithm, the symmetric encryption means encryption and decryption use the same secret key, so called as symmetric encryption, the symmetric encryption only has one secret key, the asymmetric encryption algorithm means encryption and decryption use different secret keys, one is used as the public key, the other is used as the private key, the information encrypted by the public key can be decrypted only by the private key, the information encrypted by the private key can be decrypted only by the public key.
Wherein, the preset policy may be preset, for example, the preset policy may be used to indicate an encryption manner and/or a key used, and optionally, in some embodiments, the video data may include a plurality of video slices, so that the video slices may be encrypted to implement encryption on the video data, for example, all the video slices may be encrypted to implement encryption on the video data, however, since the video data has high requirements on storage space and transmission channel, even a small video clip may need more storage space than general character-type data, even if the video data is compressed and encoded, the data volume of the compressed video data still needs more storage space than that of the character-type data, that is, if all the video slices are encrypted, the terminal needs to spend a large amount of resources to decrypt all encrypted video segments, and in order to increase the video playing rate, part of the video segments may be encrypted, that is, in some embodiments, the step "encrypting video data based on a preset policy" may specifically include:
(11) selecting a video fragment to be encrypted from a plurality of video fragments based on a preset strategy;
(12) and encrypting the selected video fragments to obtain an encrypted video fragment set.
The number of video slices to be encrypted may be determined according to a preset policy, for example, the video data includes 100 video slices, and the preset policy indicates that 5 video slices need to be selected for encryption, then 5 video slices may be selected from the 100 video slices as video slices to be encrypted, where 5 video slices that are continuous in time may be selected, or 5 video slices may be randomly selected, and the setting is specifically performed according to an actual situation, and in order to improve the security of video content, a corresponding number of video slices to be encrypted may be randomly selected from the multiple video slices, that is, in some embodiments, the step "selecting a video slice to be encrypted from the multiple video slices based on a preset policy" may specifically include:
(21) determining the encryption quantity corresponding to a preset strategy;
(22) a corresponding number of video slices to be encrypted are randomly selected from the plurality of video slices based on the number of encryptions.
For another example, a time period required to be encrypted may be determined according to a preset policy, and all video slices located in the time period are selected as video slices to be encrypted, that is, optionally, in some embodiments, the step "selecting a video slice to be encrypted from a plurality of video slices based on a preset policy" may specifically include:
(31) acquiring an encryption starting time point and an encryption ending time point corresponding to a preset strategy;
(32) extracting time stamps corresponding to the video fragments;
(33) video slices having timestamps between the encryption start point in time and the encryption end point in time are selected.
Specifically, the encryption start time point corresponding to the preset policy is 10 seconds, and the encryption end time point corresponding to the preset policy is 20 seconds, for convenience of illustration, all the video slices have the same size and are 2 seconds of video content, that is, in a 100-second video, 50 video slices are included, that is, the first video slice includes 0 second to 2 second of video content, the first video slice includes 2 second to 4 second of video content, the third video slice includes 4 second to 6 second of video content, and so on, that is, in this embodiment, all the video slices with timestamps between 10 seconds to 20 seconds are selected as the video slices to be encrypted, that is, in this scheme, the number of the videos to be encrypted is 10.
For another example, the preset policy may indicate the target video slice, and then, based on the preset policy, select a video slice within a preset range of the target video slice, and determine the target video slice and the selected video slice as the video slice to be encrypted, that is, optionally, in some embodiments, the step "select a video slice to be encrypted from a plurality of video slices based on the preset policy" includes:
(41) determining a video fragment corresponding to a preset strategy from a plurality of video fragments to obtain a target video fragment;
(42) and selecting the video fragments within the preset range of the target video fragment based on a preset strategy, and determining the target video fragment and the selected video fragments as the video fragments to be encrypted.
Specifically, the preset policy indicates that one video slice in the video data is taken as a target video slice, and indicates that video slices within 6 seconds after the target video slice is selected, for example, the target video slice includes video contents of 6 seconds to 8 seconds, based on the preset policy, the video slices of 10 seconds to 12 seconds, the video slices of 12 seconds to 14 seconds, and the video slices of 14 seconds to 16 seconds are selected, and the target video slice and the selected video slices are determined as video slices to be encrypted.
Further, in some embodiments, in order to improve security of encrypting the video content, after the target video slice is determined, the video slices within the preset range of the target video slice may be selected according to the arrangement order interval of each video slice, that is, optionally, in some embodiments, the step "selecting the video slices within the preset range of the target video slice based on a preset policy" may specifically include:
(51) extracting time stamps corresponding to the video fragments;
(52) determining the arrangement sequence of the video fragments according to the time stamps;
(53) and selecting the video fragments within the preset range of the target video fragments based on the arrangement sequence interval.
For example, specifically, first, a timestamp corresponding to each video slice is extracted, the video slices are sequentially arranged according to the sequence of the timestamps from small to large, and then, video slices within a preset range of the target video slice are selected based on the arrangement sequence interval, for example, the target video slice includes video content from the 6 th second to the 8 th second, video slices within 8 seconds after the target video slice need to be selected, and the selection interval is 1, then, the 12 th to 14 th second video slices and the 16 th to 18 th video slices are selected.
Next, encrypting the selected video segment, where the selected video segment may be encrypted by using the same key to obtain an encrypted video segment set, optionally, in some embodiments, in order to improve the security of the video content, a plurality of keys with different key factors may be obtained, and then encrypting the selected video segment by using the keys to obtain an encrypted video segment set, that is, the step "encrypting the selected video segment to obtain an encrypted video segment set" may specifically include:
(61) acquiring a plurality of keys with different key factors;
(62) and respectively encrypting the selected video fragments through a plurality of keys to obtain an encrypted video fragment set.
For example, 5 video slices are selected, 5 keys with different key factors can be obtained, that is, the number of keys is equal to the number of selected video slices, and then, 5 video slices are encrypted by the 5 keys, wherein one key encrypts one video slice.
It should be noted that, in order to further improve the security of the video content, a dynamic key may be used to encrypt the selected video segment, where the dynamic key refers to updating the key when the key meets a preset condition, for example, when the number of times of using the key is greater than a preset threshold, the key is updated, that is, optionally, in some embodiments, the method further includes:
(71) detecting the use times of the key;
(72) and when the using times are larger than a preset threshold value, updating the key.
For example, the preset threshold is set to 1 time, and then the key needs to be updated after the video segment is encrypted by using the key each time, so that the security of the video content is improved, of course, the preset threshold may also be set to 2 times, which is specifically set according to the actual situation, and is not described herein again.
104. And updating the video index according to the key to obtain the updated video index.
For example, specifically, the information of the key may be added to the video index, so that a subsequent terminal decrypts the encrypted video according to the updated video index, where the key may be specifically added to a file corresponding to the video index, that is, optionally, in some embodiments, the step "update the video index according to the key to obtain the updated video index" may specifically include:
(81) extracting an index file corresponding to the video index;
(82) and adding the key into the index file to obtain an updated index file.
105. And sending the encryption result and the updated video index to the terminal so that the terminal can play the video to be played according to the encryption result and the updated video index.
For example, specifically, when the terminal receives the encryption result and the updated video index, the used key may be extracted from the updated video index, and the encryption result is decrypted by using the key, so as to play the video to be played.
The method and the device for playing the video comprise the steps of extracting video data and a video index of the video to be played after the video to be played is obtained, encrypting the video data based on a preset strategy, obtaining a key generated in the encryption process, updating the video index according to the key to obtain an updated video index, and finally sending an encryption result and the updated video index to a terminal so that the terminal can play the video to be played according to the encryption result and the updated video index. Compared with the existing video playing scheme, the video playing method and the video playing device have the advantages that the video data are encrypted, the video index is updated according to the key generated in the encryption process, finally, the encryption result and the updated video index are sent to the terminal, so that the terminal plays the video to be played according to the encryption result and the updated video index.
The method according to the examples is further described in detail below by way of example.
In this embodiment, the video playback apparatus is specifically integrated in a server as an example.
Referring to fig. 2a, a video playing method may specifically include the following processes:
201. the server obtains a video to be played.
The paths for obtaining the video to be played may be various, for example, the video to be played may be obtained from the internet and/or a specified database, and may specifically be determined according to requirements of practical applications, where the video to be played may include a tv show, a movie, a video recorded by a user, and the like.
202. The server extracts the video data and the video index of the video to be played.
For example, the video index records attributes and storage addresses of video data, and optionally, in some embodiments, the video data may include a plurality of video slices, and thus, the attributes and storage addresses of each video slice may be recorded in the video index.
203. The server encrypts the video data based on a preset strategy and acquires a key generated in the encryption process.
For example, the video data may include a plurality of video fragments, and thus, the server may encrypt the video fragments to implement encryption of the video data, for example, may encrypt all the video fragments to implement encryption of the video data.
Optionally, in some embodiments, in order to increase the video playing speed, part of the video segments may be encrypted, the server may select a video segment to be encrypted from the multiple video segments based on a preset policy, and then encrypt the selected video segment to obtain an encrypted video segment set.
The selection of the video slices to be encrypted may include three ways.
The first mode is as follows: the server may determine the number of video slices to be encrypted according to a preset policy, for example, the video data includes 100 video slices, the preset policy indicates that 5 video slices need to be selected for encryption, and then 5 video slices may be selected from the 100 video slices as the video slices to be encrypted.
The second mode is as follows: the server can determine a time period needing encryption according to a preset strategy, and select all video fragments in the time period as the video fragments to be encrypted.
The third mode is as follows: the server selects video fragments within a preset range of the target video fragment based on a preset strategy, and determines the target video fragment and the selected video fragments as video fragments to be encrypted.
204. And the server updates the video index according to the key to obtain the updated video index.
For example, specifically, the server may extract an index file corresponding to the video index, and then add the key to the index file to obtain an updated index file.
205. And the server sends the encryption result and the updated video index to the terminal so that the terminal can play the video to be played according to the encryption result and the updated video index.
As can be seen from the above, after the server acquires the video to be played, the server extracts the video data and the video index of the video to be played, then encrypts the video data based on the preset policy and acquires the key generated in the encryption process, then updates the video index according to the key by the server to obtain the updated video index, and finally, sends the encryption result and the updated video index to the terminal so that the terminal plays the video to be played according to the encryption result and the updated video index. Compared with the existing video playing scheme, the video playing method and the video playing system have the advantages that the server encrypts the video data and updates the video index according to the key generated in the encryption process, and finally, the server sends the encryption result and the updated video index to the terminal so that the terminal can play the video to be played according to the encryption result and the updated video index.
To facilitate understanding of the video playing method provided by the embodiment of the present invention, please refer to fig. 2b, which takes an example that a user watches a video through a terminal as an example, as shown in fig. 2b, a server includes an encoding unit, an encryption unit, and a storage unit, and after acquiring video data, the server may encode the video data through the encoding unit to generate a plurality of video slices, for example, the playing time of the video slices may be controlled within 1 to 2 seconds to improve real-time performance, then, the encryption unit selects a video slice to be encrypted from the plurality of video slices, and adds a key generated in an encryption process to an index file of the video to be played, as shown in fig. 2c, where "KEYS" represents a key, and the key is added to the index file in a text form, and then, the server transmits the updated index file and the encrypted video data to the terminal, when receiving the updated index file and the encrypted video data, the terminal extracts the key from the updated index file, decrypts the encrypted video data through the extracted key, thereby obtaining the video data, and then plays the video corresponding to the video data through the player, as shown in fig. 2 d.
In order to better implement the document playing method according to the embodiment of the present invention, an embodiment of the present invention further provides a document playing device (playing device for short) based on the foregoing document playing method. The meaning of the noun is the same as that in the document playing method, and the specific implementation details can refer to the description in the method embodiment.
Referring to fig. 3, fig. 3 is a schematic structural diagram of a video playing apparatus according to an embodiment of the present invention, where the video playing apparatus may include a first obtaining module 301, an extracting module 302, an encrypting module 303, a second obtaining module 304, an updating module 305, and a sending module 306, and specifically the following modules may be included:
the first obtaining module 301 is configured to obtain a video to be played.
The paths for obtaining the video to be played may be various, for example, the video to be played may be obtained from the internet and/or a specified database, and may specifically be determined according to requirements of practical applications, where the video to be played may include a tv show, a movie, a video recorded by a user, and the like.
The extracting module 302 is configured to extract video data and a video index of a video to be played.
The video index records attributes and storage addresses of the video data, and optionally, in some embodiments, the video data may include a plurality of video slices, and thus, the attributes and storage addresses of each video slice may be recorded in the video index.
An encryption module 303, configured to encrypt the video data based on a preset policy.
For example, the video data may include a plurality of video fragments, and the encryption module 303 may encrypt the video fragments to encrypt the video data, for example, may encrypt all the video fragments to encrypt the video data
Optionally, in some embodiments, the encryption module 303 includes:
a selecting unit configured to select a video slice to be encrypted from among a plurality of video slices based on a preset policy;
and the encryption unit is used for encrypting the selected video fragments to obtain an encrypted video fragment set.
Optionally, in some embodiments, the selecting unit includes:
the acquiring subunit is used for acquiring an encryption starting time point and an encryption ending time point corresponding to a preset strategy;
the extraction subunit is used for extracting the time stamps corresponding to the video fragments;
a first selecting subunit for selecting the video slices having timestamps between the encryption start time point and the encryption end time point.
Optionally, in some embodiments, the selecting unit includes:
the determining subunit is used for determining a video fragment corresponding to a preset strategy from the plurality of video fragments to obtain a target video fragment;
and the second selection subunit is used for selecting the video slices within the preset range of the target video slice.
Optionally, in some embodiments, the second selecting subunit is specifically configured to: extracting timestamps corresponding to the video fragments, determining the arrangement sequence of the video fragments according to the timestamps, and selecting the video fragments within a preset range of the target video fragments based on the arrangement sequence interval.
Optionally, in some embodiments, the selecting unit is specifically configured to: and determining the encryption number corresponding to the preset strategy, and randomly selecting the corresponding number of video fragments to be encrypted from the plurality of video fragments based on the encryption number.
Optionally, in some embodiments, the encryption unit is specifically configured to: and acquiring a plurality of keys with different key factors, and encrypting the selected video fragments through the plurality of keys respectively to obtain an encrypted video fragment set.
A second obtaining module 304, configured to obtain a key generated in the encryption process.
And the updating module 305 is configured to update the video index according to the key to obtain an updated video index.
For example, specifically, the updating module 305 may extract an index file corresponding to the video index, and then the updating module 305 adds the key to the index file to obtain an updated index file.
Optionally, in some embodiments, the update module 305 is specifically configured to: and extracting an index file corresponding to the video index, and adding the key to the index file to obtain an updated index file.
The sending module 306 is configured to send the encryption result and the updated video index to the terminal, so that the terminal plays the video to be played according to the encryption result and the updated video index.
As can be seen, in the video playing apparatus according to the embodiment of the present invention, after the first obtaining module 301 obtains the video to be played, the extracting module 302 extracts the video data and the video index of the video to be played, then the encrypting module 303 encrypts the video data based on the preset policy, the second obtaining module 304 obtains the key generated in the encrypting process, then the updating module 305 updates the video index according to the key to obtain the updated video index, and finally, the sending module 306 sends the encryption result and the updated video index to the terminal, so that the terminal plays the video to be played according to the encryption result and the updated video index. Compared with the existing video playing scheme, the video playing method has the advantages that the encryption module 303 encrypts the video data, the updating module 305 updates the video index according to the key generated in the encryption process, and finally the sending module 306 sends the encryption result and the updated video index to the terminal so that the terminal can play the video to be played according to the encryption result and the updated video index.
In addition, an embodiment of the present invention further provides an electronic device, as shown in fig. 4, which shows a schematic structural diagram of the electronic device according to the embodiment of the present invention, specifically:
the electronic device may include components such as a processor 401 of one or more processing cores, memory 402 of one or more computer-readable storage media, a power supply 403, and an input unit 404. Those skilled in the art will appreciate that the electronic device configuration shown in fig. 4 does not constitute a limitation of the electronic device and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components. Wherein:
the processor 401 is a control center of the electronic device, connects various parts of the whole electronic device by various interfaces and lines, performs various functions of the electronic device and processes data by running or executing software programs and/or modules stored in the memory 402 and calling data stored in the memory 402, thereby performing overall monitoring of the electronic device. Optionally, processor 401 may include one or more processing cores; preferably, the processor 401 may integrate an application processor, which mainly handles operating systems, user interfaces, application programs, etc., and a modem processor, which mainly handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 401.
The memory 402 may be used to store software programs and modules, and the processor 401 executes various functional applications and data processing by operating the software programs and modules stored in the memory 402. The memory 402 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data created according to use of the electronic device, and the like. Further, the memory 402 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device. Accordingly, the memory 402 may also include a memory controller to provide the processor 401 access to the memory 402.
The electronic device further comprises a power supply 403 for supplying power to the various components, and preferably, the power supply 403 is logically connected to the processor 401 through a power management system, so that functions of managing charging, discharging, and power consumption are realized through the power management system. The power supply 403 may also include any component of one or more dc or ac power sources, recharging systems, power failure detection circuitry, power converters or inverters, power status indicators, and the like.
The electronic device may further include an input unit 404, and the input unit 404 may be used to receive input numeric or character information and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.
Although not shown, the electronic device may further include a display unit and the like, which are not described in detail herein. Specifically, in this embodiment, the processor 401 in the electronic device loads the executable file corresponding to the process of one or more application programs into the memory 402 according to the following instructions, and the processor 401 runs the application program stored in the memory 402, thereby implementing various functions as follows:
the method comprises the steps of obtaining a video to be played, extracting video data and a video index of the video to be played, encrypting the video data based on a preset strategy, obtaining a secret key generated in an encryption process, updating the video index according to the secret key to obtain an updated video index, and sending an encryption result and the updated video index to a terminal so that the terminal can play the video to be played according to the encryption result and the updated video index.
The above operations can be implemented in the foregoing embodiments, and are not described in detail herein.
The method and the device for playing the video comprise the steps of extracting video data and a video index of the video to be played after the video to be played is obtained, encrypting the video data based on a preset strategy, obtaining a key generated in the encryption process, updating the video index according to the key to obtain an updated video index, and finally sending an encryption result and the updated video index to a terminal so that the terminal can play the video to be played according to the encryption result and the updated video index. Compared with the existing video playing scheme, the video playing method and the video playing device have the advantages that the video data are encrypted, the video index is updated according to the key generated in the encryption process, finally, the encryption result and the updated video index are sent to the terminal, so that the terminal plays the video to be played according to the encryption result and the updated video index.
It will be understood by those skilled in the art that all or part of the steps of the methods of the above embodiments may be performed by instructions or by associated hardware controlled by the instructions, which may be stored in a computer readable storage medium and loaded and executed by a processor.
To this end, the present invention provides a storage medium, in which a plurality of instructions are stored, where the instructions can be loaded by a processor to execute the steps in any one of the video playing methods provided by the embodiments of the present invention. For example, the instructions may perform the steps of:
the method comprises the steps of obtaining a video to be played, extracting video data and a video index of the video to be played, encrypting the video data based on a preset strategy, obtaining a secret key generated in an encryption process, updating the video index according to the secret key to obtain an updated video index, and sending an encryption result and the updated video index to a terminal so that the terminal can play the video to be played according to the encryption result and the updated video index.
The above operations can be implemented in the foregoing embodiments, and are not described in detail herein.
Wherein the storage medium may include: read Only Memory (ROM), Random Access Memory (RAM), magnetic or optical disks, and the like.
Since the instructions stored in the storage medium can execute the steps in any video playing method provided in the embodiments of the present invention, the beneficial effects that can be achieved by any video playing method provided in the embodiments of the present invention can be achieved, which are detailed in the foregoing embodiments and will not be described herein again.
The video playing method, the video playing apparatus, the electronic device, and the storage medium according to the embodiments of the present invention are described in detail above, and a specific example is applied in the description to explain the principle and the implementation of the present invention, and the description of the above embodiments is only used to help understanding the method and the core idea of the present invention; meanwhile, for those skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (10)

1. A video playback method, comprising:
acquiring a video to be played;
extracting video data and a video index of the video to be played;
encrypting the video data based on a preset strategy and acquiring a key generated in the encryption process;
updating the video index according to the key to obtain an updated video index;
and sending the encryption result and the updated video index to the terminal so that the terminal can play the video to be played according to the encryption result and the updated video index.
2. The method of claim 1, wherein the video data comprises a plurality of video slices, and wherein encrypting the video data based on the preset policy comprises:
selecting a video fragment to be encrypted from a plurality of video fragments based on a preset strategy;
and encrypting the selected video fragments to obtain an encrypted video fragment set.
3. The method of claim 2, wherein selecting the video slice to be encrypted from the plurality of video slices based on a preset policy comprises:
acquiring an encryption starting time point and an encryption ending time point corresponding to a preset strategy;
extracting time stamps corresponding to the video fragments;
video slices having timestamps between the encryption start point in time and the encryption end point in time are selected.
4. The method of claim 2, wherein selecting the video slice to be encrypted from the plurality of video slices based on a preset policy comprises:
determining a video fragment corresponding to a preset strategy from a plurality of video fragments to obtain a target video fragment;
and selecting the video fragments within the preset range of the target video fragment based on a preset strategy, and determining the target video fragment and the selected video fragments as the video fragments to be encrypted.
5. The method according to claim 4, wherein the selecting video slices within a preset range of target video slices comprises:
extracting time stamps corresponding to the video fragments;
determining the arrangement sequence of the video fragments according to the time stamps;
and selecting the video fragments within the preset range of the target video fragments based on the arrangement sequence interval.
6. The method of claim 2, wherein selecting the video slice to be encrypted from the plurality of video slices based on a preset policy comprises:
determining the encryption quantity corresponding to a preset strategy;
a corresponding number of video slices to be encrypted are randomly selected from the plurality of video slices based on the number of encryptions.
7. The method of claim 2, wherein encrypting the selected video slices to obtain an encrypted set of video slices comprises:
acquiring a plurality of keys with different key factors;
and respectively encrypting the selected video fragments through a plurality of keys to obtain an encrypted video fragment set.
8. The method according to any one of claims 1 to 7, wherein the updating the video index according to the key to obtain an updated video index comprises:
extracting an index file corresponding to the video index;
and adding the key to the index file to obtain an updated index file.
9. A video playback apparatus, comprising:
the first acquisition module is used for acquiring a video to be played;
the extraction module is used for extracting the video data and the video index of the video to be played;
the encryption module is used for encrypting the video data based on a preset strategy;
the second acquisition module is used for acquiring a secret key generated in the encryption process;
the updating module is used for updating the video index according to the key to obtain an updated video index;
and the sending module is used for sending the encryption result and the updated video index to the terminal so that the terminal can play the video to be played according to the encryption result and the updated video index.
10. The apparatus of claim 9, wherein the video data comprises a plurality of video slices, and wherein the encryption module comprises:
the processing unit is used for carrying out fragment processing on the video data to obtain a plurality of video fragments corresponding to the video to be played;
a selecting unit configured to select a video slice to be encrypted from among a plurality of video slices based on a preset policy;
and the encryption unit is used for encrypting the selected video fragments to obtain an encrypted video fragment set.
CN201911323762.4A 2019-12-20 2019-12-20 Video playing method and device Active CN113014956B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911323762.4A CN113014956B (en) 2019-12-20 2019-12-20 Video playing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911323762.4A CN113014956B (en) 2019-12-20 2019-12-20 Video playing method and device

Publications (2)

Publication Number Publication Date
CN113014956A true CN113014956A (en) 2021-06-22
CN113014956B CN113014956B (en) 2022-06-03

Family

ID=76381975

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911323762.4A Active CN113014956B (en) 2019-12-20 2019-12-20 Video playing method and device

Country Status (1)

Country Link
CN (1) CN113014956B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117150537A (en) * 2023-11-01 2023-12-01 北京睿航至臻科技有限公司 Database data encryption and decryption method and system

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102469344A (en) * 2010-11-16 2012-05-23 腾讯科技(深圳)有限公司 Video stream encryption and decryption method, video stream encryption and decryption device, communication terminal and storage terminal
US20130198783A1 (en) * 2012-02-01 2013-08-01 Futurewei Technologies, Inc. System and Method for Organizing Multimedia Content
US20150195259A1 (en) * 2012-04-26 2015-07-09 Futurewei Technologies, Inc. System and Method for Signaling Segment Encryption and Key Derivation for Adaptive Streaming
CN106028154A (en) * 2016-06-30 2016-10-12 青岛海信电器股份有限公司 Program playing method and device based on HLS (HTTP Live Streaming) protocol
CN106452741A (en) * 2016-09-23 2017-02-22 浙江神州量子网络科技有限公司 Communication system for realizing information encryption/decryption transmission based on quantum network and communication method
CN106790074A (en) * 2016-12-21 2017-05-31 中国传媒大学 A kind of fine granularity streaming media video encryption and decryption method based on HLS protocol
CN106791935A (en) * 2016-12-23 2017-05-31 中山大学 A kind of Internet video first broadcast method and system
CN107659829A (en) * 2017-11-06 2018-02-02 网宿科技股份有限公司 A kind of method and system of video-encryption
CN110138716A (en) * 2018-02-09 2019-08-16 网宿科技股份有限公司 A kind of offer of key, video broadcasting method, server and client
CN110572604A (en) * 2019-09-27 2019-12-13 上海依图网络科技有限公司 Imaging system and video processing method

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102469344A (en) * 2010-11-16 2012-05-23 腾讯科技(深圳)有限公司 Video stream encryption and decryption method, video stream encryption and decryption device, communication terminal and storage terminal
US20130198783A1 (en) * 2012-02-01 2013-08-01 Futurewei Technologies, Inc. System and Method for Organizing Multimedia Content
US20150195259A1 (en) * 2012-04-26 2015-07-09 Futurewei Technologies, Inc. System and Method for Signaling Segment Encryption and Key Derivation for Adaptive Streaming
CN106028154A (en) * 2016-06-30 2016-10-12 青岛海信电器股份有限公司 Program playing method and device based on HLS (HTTP Live Streaming) protocol
CN106452741A (en) * 2016-09-23 2017-02-22 浙江神州量子网络科技有限公司 Communication system for realizing information encryption/decryption transmission based on quantum network and communication method
CN106790074A (en) * 2016-12-21 2017-05-31 中国传媒大学 A kind of fine granularity streaming media video encryption and decryption method based on HLS protocol
CN106791935A (en) * 2016-12-23 2017-05-31 中山大学 A kind of Internet video first broadcast method and system
CN107659829A (en) * 2017-11-06 2018-02-02 网宿科技股份有限公司 A kind of method and system of video-encryption
CN110138716A (en) * 2018-02-09 2019-08-16 网宿科技股份有限公司 A kind of offer of key, video broadcasting method, server and client
CN110572604A (en) * 2019-09-27 2019-12-13 上海依图网络科技有限公司 Imaging system and video processing method

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
石焘: "HTML5下监控视频安全播放系统的研究与实现", 《中国优秀硕士学位论文全文数据库 信息科技辑》, 15 August 2019 (2019-08-15) *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117150537A (en) * 2023-11-01 2023-12-01 北京睿航至臻科技有限公司 Database data encryption and decryption method and system
CN117150537B (en) * 2023-11-01 2024-01-09 北京睿航至臻科技有限公司 Database data encryption and decryption method and system

Also Published As

Publication number Publication date
CN113014956B (en) 2022-06-03

Similar Documents

Publication Publication Date Title
US11238165B2 (en) File encryption method, file decryption method, electronic device, and storage medium
EP3557876A1 (en) Secret key providing method, video playback method, server and client
US8190683B2 (en) Synchronizing multiple user remote content playback
US9767300B2 (en) Managing restricted tagged content elements within a published message
KR101603136B1 (en) Support for short cryptoperiods in template mode
JP4674608B2 (en) NODE DEVICE, INFORMATION PROCESSING METHOD, AND NODE DEVICE PROGRAM
US20130283051A1 (en) Persistent License for Stored Content
WO2017071512A1 (en) Cloud storage and cloud download methods for multimedia data and related devices
JP6189438B2 (en) Use media security controllers to protect media items
US11368438B2 (en) Methods, systems, and media for protecting and verifying video files
US8595492B2 (en) On-demand protection and authorization of playback of media assets
CN109120998B (en) Media data transmission method, device and storage medium
CN108881966B (en) Information processing method and related equipment
CN109151507B (en) Video playing system and method
KR100940202B1 (en) Apparatus and method for hierarchical encryption using one-way function
JP6598044B2 (en) Information processing apparatus and information processing method
WO2022257612A1 (en) Video processing methods and apparatus, electronic device, and storage medium
CN113810778A (en) Monitoring video processing method and device, storage medium and electronic equipment
CN110620950B (en) Method, device and equipment for storing audio and video files
CN113014956B (en) Video playing method and device
US20130179546A1 (en) Converting data stream in user equipment
JP2006222674A (en) System and method for content distribution, and program
CN110380843B (en) Information processing method and related equipment
CN115225934B (en) Video playing method, system, electronic device and storage medium
JPWO2011111213A1 (en) Content distribution system, distribution server, and user terminal

Legal Events

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