Multimedia file playing method, device, system, equipment and storage medium
Patent Information
- Application Number
- CN202310444378.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-21
- Publication Date
- 2026-09-22
- Estimated Expiration
- 2043-04-21
AI Technical Summary
[0003]本申请提供一种多媒体文件播放方法、装置、系统、设备及存储介质,用以解决相关技术中基于浏览器/服务器架构的视频播放系统,容易被从浏览器请求中截获到解密密钥,导致是多媒体文件泄漏的问题
[0022]本申请提供的多媒体文件播放方法、装置、系统、设备及存储介质,终端设备可以通过从服务器获取的播放列表文件,获取加密切片和加密切片的密钥信息,并基于预加载的解密处理模块和密钥信息对加密切片进行解密,得到解密后的切片,以进行多媒体文件的播放。能够实现对密钥的加密保护,有效防止密钥被盗取,从而保护多媒体文件的安全。
Smart Images

Figure CN116614653B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of multimedia file security, and in particular to a multimedia file playback method, apparatus, system, device and storage medium. Background Technology
[0002] In related technologies, video systems based on a client / server architecture require the installation of specific applications on the client side, increasing the cost of software maintenance and management, and the applicable platforms of these applications are often limited. Video playback systems based on a browser / server architecture have the advantages of being easy to develop, access, and maintain, but their security is relatively poor. Summary of the Invention
[0003] This application provides a multimedia file playback method, apparatus, system, device, and storage medium to solve the problem in related technologies where video playback systems based on browser / server architecture are easily compromised by intercepting decryption keys from browser requests, leading to multimedia file leakage.
[0004] In a first aspect, this application provides a multimedia file playback method, applied to a terminal device, the terminal device including a decryption processing module that can be loaded and run in a browser, wherein the decryption processing module contains decryption code represented in binary, the method comprising: sending a playback request for a multimedia file to a server, the playback request being used to request a corresponding playlist file from the server; wherein the playlist file is a file obtained by the server after slicing and encrypting the multimedia file; receiving the playlist file returned by the server; parsing the playlist file to obtain key information for encrypting the slices and encrypted slices; decrypting the encrypted slices based on the decryption processing module and the key information to obtain decrypted slices; and playing the decrypted slices.
[0005] In one implementation, the decryption processing module is written in AssemblyScript based on browser WebAssembly technology.
[0006] In one implementation, parsing the playlist file to obtain key information for encrypting the slice includes: parsing the playlist file to obtain key tag information; wherein the key tag information includes a key request address; sending a key request to the server, the key request instructing the server to obtain ciphertext based on the key request address, and sending the ciphertext to the terminal device, wherein the ciphertext is information obtained by encrypting the plaintext; receiving the ciphertext sent by the server, and identifying the ciphertext as key information for encrypting the slice.
[0007] In one optional implementation, the key tag information further includes a specified encryption algorithm for the slice; wherein, the step of decrypting the encrypted slice based on the decryption processing module and the key information to obtain a decrypted slice includes: decrypting the key ciphertext based on the decryption processing module to obtain the key plaintext; and decrypting the encrypted slice using the specified encryption algorithm and the key plaintext based on the decryption processing module to obtain a decrypted slice.
[0008] In one implementation, the multimedia file is an audio / video file; the playlist file is a file obtained by the server after slicing and encrypting the multimedia file; wherein, playing the decrypted slices includes: playing the decrypted slices in the order of the decrypted slices in the playlist file.
[0009] Secondly, this application provides a multimedia file playback method, which is applied to a server. The method includes: receiving a playback request for a multimedia file sent by a terminal device; and sending a playlist file to the terminal device; wherein the playlist file is obtained by slicing and encrypting the multimedia file.
[0010] In one implementation, the method further includes: receiving a key request sent by a terminal device; and sending key ciphertext to the terminal device based on the key request address in the key request; wherein the key ciphertext is information obtained by encrypting the key plaintext used to encrypt the slice.
[0011] Thirdly, this application provides a multimedia file playback device, which is applied to a terminal device. The terminal device includes a decryption processing module that can be loaded and run in a browser. The decryption processing module contains decryption code represented in binary. The device includes: a sending module for sending a playback request for a multimedia file to a server, the playback request being used to request a corresponding playlist file from the server; wherein the playlist file is a file obtained by the server after slicing and encrypting the multimedia file; a receiving module for receiving the playlist file returned by the server; a processing module for parsing the playlist file to obtain key information for encrypting the slices and encrypted slices; a decryption module for decrypting the encrypted slices based on the decryption processing module and the key information to obtain decrypted slices; and a playback module for playing the decrypted slices.
[0012] In one implementation, the decryption processing module is written in AssemblyScript based on browser WebAssembly technology.
[0013] In one implementation, the processing module is specifically configured to: parse the playlist file to obtain key tag information; wherein the key tag information includes a key request address; send a key request to the server, the key request instructing the server to obtain key ciphertext based on the key request address, and send the key ciphertext to the terminal device, wherein the key ciphertext is information obtained by encrypting the key plaintext; receive the key ciphertext sent by the server, and determine the key ciphertext as key information for encrypting the slice.
[0014] In one optional implementation, the key tag information further includes a specified encryption algorithm for the slice; wherein the decryption module is specifically used to: decrypt the key ciphertext based on the decryption processing module to obtain the key plaintext; and decrypt the encrypted slice using the specified encryption algorithm and the key plaintext based on the decryption processing module to obtain the decrypted slice.
[0015] In one implementation, the multimedia file is an audio / video file; the playlist file is a file obtained by the server after slicing and encrypting the multimedia file; wherein, the playback module is specifically used to: play the decrypted slices in the order of the decrypted slices in the playlist file.
[0016] Fourthly, this application provides a multimedia file playback device, which is deployed on a server. The device includes: a first receiving module for receiving a playback request for a multimedia file sent by a terminal device; and a first sending module for sending a playlist file to the terminal device; wherein the playlist file is obtained by slicing and encrypting the multimedia file.
[0017] In one implementation, the apparatus further includes: a second receiving module, configured to receive a key request sent by a terminal device; and a second sending module, configured to send key ciphertext to the terminal device based on the key request address in the key request; wherein the key ciphertext is key information obtained by encrypting the key plaintext used to encrypt the slice.
[0018] Fifthly, this application provides a multimedia file playback system, comprising: a terminal device for performing the method as described in the first aspect; and a server for performing the method as described in the second aspect.
[0019] In a sixth aspect, this application provides an electronic device, comprising: a processor, and a memory communicatively connected to the processor; the memory storing computer-executable instructions; the processor executing the computer-executable instructions stored in the memory to implement the method as described in the first aspect, or to implement the method as described in the second aspect.
[0020] A seventh aspect is a computer-readable storage medium, characterized in that the computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method as described in the first aspect, or to implement the method as described in the second aspect.
[0021] Eighthly, a computer program product, characterized in that it includes a computer program that, when executed by a processor, implements the method described in the first aspect, or implements the method described in the second aspect.
[0022] The multimedia file playback method, apparatus, system, device, and storage medium provided in this application allow a terminal device to obtain encrypted slices and their key information from a playlist file retrieved from a server. Based on a pre-loaded decryption processing module and the key information, the encrypted slices are decrypted to obtain the decrypted slices for playback of multimedia files. This method effectively protects the key from being stolen, thereby safeguarding the security of multimedia files. Attached Figure Description
[0023] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0024] Figure 1 This is the flowchart of the multimedia file playback method provided in the embodiments of this application. Figure 1 ;
[0025] Figure 2 This is the flowchart of the multimedia file playback method provided in the embodiments of this application. Figure 2 ;
[0026] Figure 3 This is the flowchart of the multimedia file playback method provided in the embodiments of this application. Figure 3 ;
[0027] Figure 4 This is a schematic diagram of a multimedia file playback scheme provided in an embodiment of this application;
[0028] Figure 5 This is an application scenario diagram of the multimedia file playback method provided in the embodiments of this application;
[0029] Figure 6This is a schematic diagram of the structure of the multimedia file playback device provided in the embodiments of this application. Figure 1 ;
[0030] Figure 7 This is a schematic diagram of the structure of the multimedia file playback device provided in the embodiments of this application. Figure 2 ;
[0031] Figure 8 This is a schematic diagram of the structure of the multimedia file playback device provided in the embodiments of this application. Figure 3 ;
[0032] Figure 9 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.
[0033] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation
[0034] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0035] Terminology Explanation:
[0036] WebAssembly, abbreviated as wasm, is a programming language that can be executed in a browser. Many compilers for programming languages, such as Java, Rust, and C, as well as languages specifically designed for WebAssembly, support using this language as a compilation target. It can compile bytecode that runs in the WebAssembly virtual machine.
[0037] AseemblyScript: A language designed for WebAssembly, which compiles code files written in this language into WebAssembly, ultimately generating a WebAssembly module that is loaded into a browser and run.
[0038] Please see Figure 1 , Figure 1 This is the flowchart of the multimedia file playback method provided in the embodiments of this application. Figure 1This method is applied to a terminal device that includes a decryption processing module that can be loaded and run in a browser, wherein the decryption processing module contains decryption code represented in binary. Figure 1 As shown, the method may include, but is not limited to, the following steps:
[0039] Step S101: Send a multimedia file playback request to the server.
[0040] In the embodiments of this application, the aforementioned playback request is used to request the corresponding playlist file from the server.
[0041] For example, a terminal device sends a playback request to a server, which requests a playlist file corresponding to the multimedia file that the terminal device needs to play.
[0042] In the embodiments of this application, the playlist file is a file obtained by the server after slicing and encrypting the multimedia file.
[0043] Step S102: Receive the playlist file returned by the server.
[0044] For example, the terminal device receives a playlist file returned by the server, which is the playlist file corresponding to the multimedia file that the terminal device needs to play.
[0045] Step S103: Parse the playlist file to obtain the key information and encrypted slices used for encryption.
[0046] For example, the playlist file is parsed to obtain the tag information and the slice address of the encrypted slice in the playlist. Then, the key information used for the encrypted slice is obtained based on the tag information, and the encrypted slice is obtained from the slice address.
[0047] Step S104: Decrypt the encrypted slice based on the decryption processing module and key information to obtain the decrypted slice.
[0048] For example, the terminal device obtains the key used to encrypt the slice based on the decryption processing module and key information, and then uses the key to decrypt the encrypted slice to obtain the decrypted slice.
[0049] Step S105: Play the decrypted slice.
[0050] For example, the terminal device plays the decrypted video clip in a browser.
[0051] By implementing the embodiments of this application, a decryption module including binary decryption code and acquired key information can be used to decrypt the encrypted slice, obtaining the decrypted slice for playback. This effectively prevents key theft, achieves encrypted protection of the key, and effectively protects the security of multimedia files.
[0052] In the embodiments of this application, the decryption processing module is written in AssemblyScript based on browser WebAssembly technology. It is understood that in related technologies, when a terminal device plays a multimedia file using a browser, it sends a request to the server and uses the key returned by the server to decrypt the encrypted slice. The JavaScript used in this process is a scripting language, which, during transmission, is text source code with syntactic attributes. This makes it difficult to prevent malicious users from obtaining the key used to restore the multimedia file by analyzing the code or forging data, resulting in low key security. However, in the technical solution of this application, based on the binary instruction format characteristics of WebAssembly, the decryption code used to decrypt the encryption key can be converted into custom bytecode, thereby breaking the syntactic attributes of the code text and hiding the code logic. This makes it difficult to crack the program logic through analysis, thus increasing the difficulty of analyzing the decryption algorithm of the key.
[0053] In one implementation, the key tag information also includes a specified encryption algorithm for the slice, allowing the encrypted slice to be decrypted based on that algorithm. For an example, please refer to [link to example]. Figure 2 , Figure 2 This is the flowchart of the multimedia file playback method provided in the embodiments of this application. Figure 2 This method is applied to terminal devices. For example... Figure 2 As shown, the method may include, but is not limited to, the following steps:
[0054] Step S201: Send a multimedia file playback request to the server.
[0055] In the embodiments of this application, step S201 can be implemented in any of the ways described in the embodiments of this application. The embodiments of this application do not limit this, nor will they be described in detail.
[0056] Step S202: Receive the playlist file returned by the server.
[0057] In the embodiments of this application, step S202 can be implemented in any of the ways described in the embodiments of this application. The embodiments of this application do not limit this, nor will they be described in detail.
[0058] Step S203: Parse the playlist file to obtain key tag information and encrypted slices.
[0059] For example, the playlist file is parsed to obtain the key tag information and the address for obtaining the encrypted slice stored in the playlist file, and the encrypted slice is obtained based on the address for obtaining the encrypted slice.
[0060] Step S204: Send a key request to the server.
[0061] In one embodiment of this application, a key request is used to instruct the server to obtain the key ciphertext based on the key request address and send the key ciphertext to the terminal device. The key ciphertext is information obtained by encrypting the key plaintext.
[0062] For example, the terminal device sends a key request containing the key request address to the server.
[0063] Step S205: Receive the key ciphertext sent by the server and identify the key ciphertext as the key information used for encrypting the slice.
[0064] For example, the terminal device receives the ciphertext key sent by the server and identifies it as the key information used to encrypt the slice.
[0065] Step S206: Decrypt the encrypted slice based on the decryption processing module and key information to obtain the decrypted slice.
[0066] For example, the terminal device decrypts the key information based on the decryption processing module to obtain the decrypted key, and then decrypts the encrypted slice based on the decrypted key to obtain the decrypted slice.
[0067] In an optional implementation, the key tag information further includes a specified encryption algorithm for the slice; as an example, please refer to Table 1, which is an example table of key tag information provided in an embodiment of this application. As shown in Table 1, the key tag information may include two attributes: METHOD and URL (Uniform Resource Locator). The specific value of each attribute is used to indicate different content. METHOD specifies the encryption method used, and URL specifies the key request address. In some embodiments of this application, the key tag information may also include an IV (Initialization Vector) to specify the encryption initialization vector.
[0068] Table 1: Example Table of Key Tag Information
[0069]
[0070]
[0071] The above-mentioned decryption of the encrypted slice based on the decryption processing module and key information to obtain the decrypted slice may include the following steps:
[0072] Step a1: Decrypt the ciphertext of the key using the decryption processing module to obtain the plaintext of the key.
[0073] For example, the ciphertext of the key is input into the key processing module to decrypt the ciphertext and obtain the plaintext key.
[0074] Step a2: Based on the decryption processing module, the encrypted slice is decrypted using the specified encryption algorithm and the plaintext key to obtain the decrypted slice.
[0075] For example, based on the decryption processing module, the encrypted slice is decrypted using a specified encryption algorithm and plaintext key to obtain the decrypted slice.
[0076] It is understood that, in the embodiments of this application, the decryption algorithms used in the encryption and decryption key process (e.g., RSA encryption and decryption algorithm, MD5 (Message Digest Algorithm) encryption and decryption algorithm, and SHA (Secure Hash Algorithm) 256 encryption and decryption algorithm, etc.) can be pre-written using AssemblyScript and compiled into a WebAssembly module, thereby generating the corresponding decryption processing module (i.e., the WebAssembly module), and loading the module into the browser used to play multimedia files.
[0077] Step S207: Play the decrypted slice.
[0078] In the embodiments of this application, step S207 can be implemented in any of the ways described in the various embodiments of this application. The embodiments of this application do not limit this, nor will they be described in detail.
[0079] By implementing the embodiments of this application, a decryption module including binary decryption code can be used to decrypt the acquired key ciphertext to obtain the key plaintext. The encrypted slice can then be decrypted based on the key plaintext to obtain the decrypted slice for playing multimedia files. This achieves encrypted protection of the key, effectively preventing key theft and thus protecting the security of multimedia files.
[0080] In some embodiments of this application, the aforementioned multimedia file is an audio / video file; the aforementioned playlist file is a file obtained by slicing and encrypting the multimedia file by the server. Playing the decrypted slices includes playing the decrypted slices in the order they appear in the playlist file.
[0081] For example, the server encodes the multimedia file into the format specified by HLS (Hypertext Transfer Protocol Live Streaming), and segments the multimedia file into multiple TS (transport stream) slices according to keyframes. Then, it encrypts the slices using a preset encryption method (e.g., AES (Advanced Encryption Standard)-128), and generates a playlist file based on the generated slices and encryption information. After the terminal device obtains the playlist file, it sorts the decrypted slices according to their order and uses HTML (Hypertext Markup Language) 5 playback tags. <video>Play the sorted slices in sequence.
[0082] It should be noted that, in the embodiments of this application, the above method steps can be executed by a terminal device based on a browser that supports WebAssembly technology and the HLS protocol. That is, any terminal device (e.g., mobile phone, computer, etc.) that can install a browser that supports WebAssembly technology and the HLS protocol can execute the multimedia file playback method of any of the above embodiments. This achieves cross-platform and plugin-free multimedia file playback, reducing the maintenance and management costs of the multimedia file playback system.
[0083] The multimedia file playback method provided in the above embodiments of this application has been described from the perspective of a terminal device. Next, the multimedia file playback method provided in the embodiments of this disclosure will be further described from the perspective of a server.
[0084] Please see Figure 3 , Figure 3 This is the flowchart of the multimedia file playback method provided in the embodiments of this application. Figure 3 This method is applied to servers. For example... Figure 3 As shown, the method may include, but is not limited to, the following steps:
[0085] Step S301: Receive a multimedia file playback request sent by the terminal device.
[0086] For example, the server receives a playback request sent by a terminal device. This playback request is used to request the server to send a playlist file to the terminal device. The playlist file is the playlist file corresponding to the multimedia file that the terminal device needs to play.
[0087] Step S302: Send the playlist file to the terminal device.
[0088] In the embodiments of this application, the playlist file is obtained by the server slicing and encrypting multimedia files.
[0089] For example, the server encodes the multimedia file into the format specified by the HLS protocol, divides the multimedia file into multiple TS slices according to keyframes and encrypts them, and generates a playlist file based on the generated slices and encryption information.
[0090] By implementing the embodiments of this application, the server can send a playlist file to the terminal device, enabling the terminal device to obtain the encryption key and encrypted slice based on the playlist file. The terminal device can then decrypt the encrypted slice based on the loaded decryption processing module and the encryption key to play the multimedia file. This effectively prevents key theft, achieves encryption protection of the key, and effectively protects the security of multimedia files.
[0091] In one implementation, the above multimedia file playback method may further include the following steps:
[0092] b1: Receive key requests sent by terminal devices.
[0093] For example, the server receives a key request sent by the terminal device.
[0094] b2: Send the key ciphertext to the terminal device based on the key request address in the key request.
[0095] In the embodiments of this application, the aforementioned key ciphertext is information obtained by encrypting the key plaintext used for encrypting the slice.
[0096] For example, the server sends the key ciphertext corresponding to the key request address to the terminal device based on the key request address in the key request.
[0097] In the embodiments provided above, the methods provided by the embodiments of this application have been described from the perspectives of terminal devices and servers, respectively. To implement the functions of the methods provided in the embodiments of this application, the terminal device and server may include hardware structures and software modules, and may implement the above functions in the form of hardware structures, software modules, or a combination of hardware structures and software modules. One of the above functions may be executed in the form of hardware structures, software modules, or a combination of hardware structures and software modules.
[0098] Please see Figure 4 , Figure 4 This is a schematic diagram of a multimedia file playback scheme provided in an embodiment of this application. For example... Figure 4 As shown, the multimedia file playback scheme provided in this application includes two parts: HLS-based video encryption on the server side and WebAssembly-based decryption and playback on the terminal device. The server encodes the video stream according to the format specified by the HLS protocol, then encrypts it and divides it into multiple TS segments. Based on the TS segments and encryption information, it generates an m3u8 file (i.e., the aforementioned playlist file). Thus, the terminal device can use a browser that supports the HLS protocol to obtain the .m3u8 file and decrypt and play it.
[0099] Please see Figure 5 , Figure 5 This is an application scenario diagram of the multimedia file playback method provided in the embodiments of this application. For example... Figure 5 As shown, in practical applications, this can include a web server and an application server. The application server processes the video stream, generating an m3u8 file containing a key address and encrypted video slices (i.e., TS slices). The terminal device can send a request to the web server. The web server receives the request and sends the m3u8 file and TS slices obtained from the application server to the terminal device. The terminal device parses the m3u8 file to obtain the URL used to request the key, and requests the key from the web server based on the URL. After receiving the key request, the web server returns the encrypted key to the terminal device. The terminal device decrypts the key using browser WebAssembly technology to obtain the decrypted key, and uses the decrypted key to decrypt and play the TS slices.
[0100] This application also provides a multimedia file playback device that can be deployed on a terminal device. As an example, please refer to... Figure 6 , Figure 6 This is a schematic diagram of the structure of the multimedia file playback device provided in the embodiments of this application. Figure 1 .like Figure 6 As shown, the device 600 includes a sending module 601, a receiving module 602, a processing module 603, a decryption module 604, and a playback module 605. The sending module 601 sends a playback request for a multimedia file to the server, requesting a corresponding playlist file from the server; the playlist file is a file obtained by the server slicing and encrypting the multimedia file. The receiving module 602 receives the playlist file returned by the server. The processing module 603 parses the playlist file to obtain the key information for encrypting the slices and the encrypted slices. The decryption module 604 decrypts the encrypted slices based on the decryption processing module and the key information to obtain the decrypted slices. The playback module 605 plays the decrypted slices.
[0101] In one implementation, the processing module 603 is specifically used to: parse the playlist file to obtain key tag information; wherein the key tag information includes a key request address; send a key request to the server, the key request being used to instruct the server to obtain the key ciphertext based on the key request address, and send the key ciphertext to the terminal device, wherein the key ciphertext is information obtained by encrypting the key plaintext; receive the key ciphertext sent by the server, and determine the key ciphertext as key information for encrypting the slice.
[0102] In one optional implementation, the key tag information further includes a specified encryption algorithm for the slice; wherein, the decryption module 604 is specifically used to: decrypt the key ciphertext based on the decryption processing module to obtain the key plaintext; and decrypt the encrypted slice using the specified encryption algorithm and the key plaintext based on the decryption processing module to obtain the decrypted slice.
[0103] In one implementation, the multimedia file is an audio / video file; the playlist file is a file obtained by the server after slicing and encrypting the multimedia file; specifically, the playback module 605 is used to play the decrypted slices in the order of the decrypted slices in the playlist file.
[0104] The apparatus described in this application embodiment can use a decryption module and acquired key information to decrypt an encrypted slice, obtaining a decrypted slice for playback. This achieves encryption protection of the key, effectively preventing key theft and thus protecting the security of multimedia files.
[0105] This application also provides another multimedia file playback device, which can be deployed on a server. As an example, please refer to... Figure 7 , Figure 7 This is a schematic diagram of the structure of the multimedia file playback device provided in the embodiments of this application. Figure 2 .like Figure 7 As shown, the device 700 includes a first receiving module 701 and a first sending module 702. The first receiving module 701 is used to receive a playback request for a multimedia file sent by a terminal device; the first sending module 702 is used to send a playlist file to the terminal device; wherein the playlist file is obtained by slicing and encrypting the multimedia file.
[0106] In one implementation, the above-described apparatus further includes: a second receiving module and a second transmitting module. As an example, please refer to... Figure 8 , Figure 8 This is a schematic diagram of the structure of the multimedia file playback device provided in the embodiments of this application. Figure 3 .like Figure 8 As shown, the device 800 further includes a second receiving module 803 for receiving a key request sent by a terminal device; and a second sending module 804 for sending ciphertext to the terminal device based on the key request address in the key request; wherein the ciphertext is key information obtained by encrypting the plaintext key used for encrypting the slice. Figure 8 Modules 801 and 802 in Figure 7 Modules 701 and 702 in the model have the same structure and function.
[0107] The apparatus described in this application allows a server to send a playlist file to a terminal device, enabling the terminal device to obtain an encryption key and encrypted slices based on the playlist file. The terminal device then decrypts the encrypted slices using the loaded decryption processing module and the encryption key, allowing it to play the multimedia file. This effectively prevents key theft, achieving encryption protection of the key and thus effectively protecting the security of the multimedia file.
[0108] This disclosure also provides a multimedia file playback system, which includes the aforementioned... Figure 6 The multimedia file playback device in the embodiment serves as a terminal device and the aforementioned Figure 7 Examples and / or Figure 8 The embodiment is a multimedia file playback device that acts as a server.
[0109] It should be noted that the division of the various modules in the above device is merely a logical functional division. In actual implementation, they can be fully or partially integrated into a single physical entity, or they can be physically separated. Furthermore, these modules can be implemented entirely in software via processing element calls; they can be fully implemented in hardware; or some modules can be implemented by processing element calls to software, while others are implemented in hardware. For example, processing module 603 can be a separate processing element, or it can be integrated into a chip in the above device. Alternatively, it can be stored as program code in the memory of the above device, and its functions can be called and executed by a processing element of the device. The implementation of other modules is similar. Moreover, these modules can be fully or partially integrated together, or they can be implemented independently. The processing element here can be an integrated circuit with signal processing capabilities. In the implementation process, each step of the above method or each of the above modules can be completed through the integrated logic circuits in the hardware of the processor element or through software instructions.
[0110] Figure 9 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 9 As shown, the electronic device may include: a transceiver 901, a processor 902, and a memory 903.
[0111] Processor 902 executes computer execution instructions stored in memory, causing processor 902 to perform the scheme in the above embodiments. Processor 902 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0112] The memory 903 is connected to the processor 902 via the system bus and completes communication between them. The memory 903 is used to store computer program instructions.
[0113] Transceiver 901 can be used to obtain the task to be run and its configuration information.
[0114] The system bus can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The system bus can be divided into address bus, data bus, control bus, etc. For ease of representation, only one thick line is used in the diagram, but this does not indicate that there is only one bus or one type of bus. Transceivers are used to enable communication between database access devices and other computers (e.g., clients, read-write libraries, and read-only libraries). Memory may include random access memory (RAM) and may also include non-volatile memory.
[0115] The electronic device provided in this application embodiment may be the terminal device or server described in the above embodiments.
[0116] This application also provides a chip for executing instructions, which is used to execute the multimedia file playback method described in the above embodiments.
[0117] This application also provides a computer-readable storage medium storing computer instructions. When the computer instructions are executed on a computer, the computer performs the multimedia file playback method described in the above embodiments.
[0118] This application also provides a computer program product, which includes a computer program stored in a computer-readable storage medium. At least one processor can read the computer program from the computer-readable storage medium, and when the at least one processor executes the computer program, it can implement the technical solution of the multimedia file playback method in the above embodiments.
[0119] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this application are indicated by the following claims.
[0120] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.< / video>
Claims
1. A method for playing multimedia files, characterized in that, The method is applied to a terminal device, which includes a decryption processing module that can be loaded and run in a browser. The decryption algorithm used in the encryption / decryption key process is written in AssemblyScript and compiled into a WebAssembly module to obtain the decryption processing module. The decryption processing module contains decryption code represented in binary. The method includes: A playback request for a multimedia file is sent to the server. The playback request is used to request a corresponding playlist file from the server. The multimedia file is an audio or video file. The server encodes the multimedia file into the format specified by HLS, divides the multimedia file into multiple TS transport stream slices according to keyframes, encrypts them according to a preset encryption method, and generates a playlist file based on the generated slices and encryption information. Receive the playlist file returned by the server; The playlist file is parsed to obtain key information and the encrypted slice used to encrypt the slice. Obtaining the key information includes: The playlist file is parsed to obtain key tag information, wherein the key tag information includes METHOD and URL attributes, METHOD is used to specify the encryption algorithm used, and URL is used to specify the key request address; A key request is sent to the server, the key request instructing the server to obtain the key ciphertext based on the key request address and send the key ciphertext to the terminal device, wherein the key ciphertext is information obtained by encrypting the key plaintext; Receive the key ciphertext sent by the server, and determine the key ciphertext as key information for encrypting the slice; The encrypted slice is decrypted based on the decryption processing module and the key information to obtain the decrypted slice, including: The key ciphertext is decrypted using the decryption processing module to obtain the key plaintext. Based on the decryption processing module, the encrypted slice is decrypted using a specified encryption algorithm and the plaintext key to obtain the decrypted slice; Playing the decrypted slice, including: The decrypted segments are sorted according to the order of the decrypted segments described in the playlist file, and then played using the HTML5 play tag. <video> Play the sorted slices in sequence.< / video> 2. A multimedia file playback device, characterized in that, The device is applied to a terminal device, which includes a decryption processing module that can be loaded and run in a browser. The decryption algorithm used in the encryption / decryption key process is written in AssemblyScript and compiled into a WebAssembly module to obtain the decryption processing module. The decryption processing module contains decryption code represented in binary. The device includes: The sending module is used to send a playback request for a multimedia file to the server. The playback request is used to request a corresponding playlist file from the server. The multimedia file is an audio or video file. The server encodes the multimedia file into the format specified by HLS, divides the multimedia file into multiple TS transport stream slices according to keyframes, encrypts them according to a preset encryption method, and generates the playlist file based on the generated slices and encryption information. A receiving module is used to receive the playlist file returned by the server; The processing module is used to parse the playlist file to obtain key information and the encrypted slice for encrypting the slice. The key information includes METHOD and URL attributes. METHOD specifies the encryption algorithm used, and URL specifies the key request address. Obtaining the key information includes: The playlist file is parsed to obtain key tag information; A key request is sent to the server, the key request instructing the server to obtain the key ciphertext based on the key request address and send the key ciphertext to the terminal device, wherein the key ciphertext is information obtained by encrypting the key plaintext; Receive the key ciphertext sent by the server, and determine the key ciphertext as key information for encrypting the slice; The decryption module is used to decrypt the encrypted slice based on the decryption processing module and the key information to obtain the decrypted slice, including: The key ciphertext is decrypted using the decryption processing module to obtain the key plaintext. Based on the decryption processing module, the encrypted slice is decrypted using a specified encryption algorithm and the plaintext key to obtain the decrypted slice; A playback module, used to play the decrypted slice, includes: The decrypted segments are sorted according to the order of the decrypted segments described in the playlist file, and then played using the HTML5 play tag. <video> Play the sorted slices in sequence.< / video> 3. A multimedia file playback system, characterized in that, include: A terminal device is configured to perform the steps executed by the terminal device in the method as described in claim 1; A server for performing the steps executed by the server in the method as described in claim 1.
4. An electronic device, characterized in that, include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory to implement the method as described in claim 1.
5. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method as described in claim 1.
6. A computer program product, characterized in that, Includes a computer program that, when executed by a processor, implements the method of claim 1.
Citation Information
Patent Citations
Web end video playing method and device
CN113301038A
Streaming media service method and system for customizing information security level
CN115811625A