Decryption device processing method for TS stream, TS stream processing system
By encapsulating the TS stream into fragments and separating, filtering and re-encapsulating the processed TS stream in the decryption device, the decryption device suspend or error restart problems caused by packet loss during TS streaming is solved, and continuous processing and improved user experience is achieved.
Patent Information
- Application Number
- CN202111486347.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-07
- Publication Date
- 2025-04-15
- Estimated Expiration
- 2041-12-07
AI Technical Summary
When an existing TS stream decryption device loses packets during transmission, it may cause the decryption device to hang or restart incorrectly, affecting the user experience.
By encapsulating the TS stream into fragments, the decryption device separates the protocol data and TS stream data after receiving, filters invalid packets, decrypts valid packets, and re-encapsulates and transmits the processed TS packets.
This method enables the decryption device to continuously receive and process TS streams, and even if packet loss occurs, it will not affect the processing of other packets, reduce compatibility issues, and improve user experience.
Smart Images

Figure CN114205135B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of TS stream processing, and in particular to a TS stream processing method by a decryption device and a TS stream processing system. Background Art
[0002] The TS stream decryption device is used to receive the TS stream from the host, perform relevant decryption processing, and then transmit it to the host.
[0003] Existing TS stream decryption devices usually transmit data with the host through a USB interface. The USB decryption device receives the TS stream from the host through the USB protocol. After decryption processing, the processed stream is transmitted back to the host through the USB protocol. In the current implementation, the data received by the USB decryption device must be strictly equal to the data sent back to the host. In actual scenarios, packet loss may occur during TS decryption processing, and the specific number of lost packets may not be known, which will cause the USB decryption device to hang or restart due to errors, which will cause the data packet to be unable to be processed during this period, seriously affecting the user experience. This is because the decryption is handled by a module in the decryption device. Due to the chip defects of this module, the chip will hang and not work when it receives an invalid packet, so it cannot decrypt and needs to be reset before it can work again. Summary of the invention
[0004] In order to solve the technical problem of decryption device hanging or compatibility due to packet loss during TS stream transmission in the prior art, the present invention proposes a TS stream processing method and a TS stream processing system for a decryption device.
[0005] The method for processing TS stream by a decryption device proposed by the present invention comprises:
[0006] The sending device encapsulates the TS stream into segments and transmits them to the decryption device through the corresponding protocol;
[0007] The decryption device receives the fragment and separates the protocol data of the fragment from the TS stream data;
[0008] The decryption device processes the protocol data and the TS stream data respectively, filters out invalid TS packets in the TS stream data, and decrypts valid TS packets;
[0009] The decryption device re-encapsulates the processed TS packets according to the protocol data, and transmits them to the sending device via the corresponding protocol.
[0010] Furthermore, after decrypting the valid TS, the decryption device also performs at least one of descrambling and secondary encryption.
[0011] Furthermore, the TS stream segments are transmitted between the sending device and the decryption device via a USB protocol.
[0012] The TS stream processing system proposed in the present invention includes a sending device and a decryption device, wherein the sending device includes: a segmentation module for encapsulating the TS stream into fragments, and a first transmission module for transmitting the fragments to the decryption device through a corresponding protocol; the decryption device includes: a second transmission module for communicating with the first transmission module through a corresponding protocol, a fragment disassembly module for separating the protocol data of the fragments received by the second transmission module from the TS stream data, an effective TS packet filtering module for filtering out invalid TS packets in the TS stream data and retaining valid TS packets, a TS packet processing module for decrypting valid TS packets, and a fragment assembly module for re-encapsulating the processed TS packets output by the TS packet processing module according to the protocol data.
[0013] Furthermore, the first transmission module and the second transmission module are USB modules.
[0014] Furthermore, the TS packet processing module performs at least one of descrambling and secondary encryption on the decrypted TS packets.
[0015] The present invention utilizes the characteristics of TS stream, so that the decryption device continuously receives TS stream from the sending device (host), and re-encapsulates the processed TS and sends it back to the sending device. In this way, if some packets are lost during the processing of TS stream, it will not affect the decryption device to process other normal packets. This can reduce the compatibility problems caused by packet loss during the processing of TS stream and improve the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] The present invention is described in detail below with reference to the embodiments and accompanying drawings, wherein:
[0017] Figure 1 It is a system structure block diagram of an embodiment of the present invention. DETAILED DESCRIPTION
[0018] In order to make the technical problems, technical solutions and beneficial effects to be solved by the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0019] Thus, a feature indicated in this specification will be used to illustrate one of the features of an embodiment of the present invention, rather than implying that each embodiment of the present invention must have the described feature. In addition, it should be noted that this specification describes many features. Although some features can be combined together to illustrate possible system designs, these features can also be used in other combinations that are not explicitly described. Thus, unless otherwise stated, the described combinations are not intended to be limiting.
[0020] The method for processing the TS stream by the decryption device of the present invention requires that the sending device first encapsulates the TS stream into fragments, and then transmits the fragments to the decryption device through a corresponding protocol.
[0021] After receiving the fragment sent by the sending device, the decryption device separates the protocol data from the TS stream data in the fragment, and processes the protocol data and TS stream data respectively, filters out invalid TS packets in the TS stream data, and decrypts valid TS packets. In addition to decrypting valid TS packets, the decryption device can also perform other processing on the TS packets, including but not limited to at least one of descrambling and secondary encryption.
[0022] The decryption device then re-encapsulates the processed TS packets according to the protocol data and transmits them to the sending device through the corresponding protocol.
[0023] The repackaging of the present invention is mainly based on the characteristics of the TS stream. The protocol data and the TS stream are first separated, and after filtering the invalid packets and performing corresponding processing, the protocol data and the TS stream are recombined. This method avoids the interruption of the TS stream transmitted back to the sending device due to error processing (such as protocol renegotiation, resetting the decryption device, etc.) when packet loss occurs during the decryption process. According to the characteristics of the TS stream, the method continuously receives the TS stream from the sending device, so that even if packet loss occurs, the TS packets received later can be filled in and sent back.
[0024] The main reason for separation in the above process is that the decryption and encryption of TS streams are usually implemented by hardware modules in embedded devices. Hardware modules usually only process pure TS stream data and cannot recognize protocol data. Sending protocol data together will cause errors. Re-encapsulation is because the sending device (host) and the decryption device transmit TS stream data through a specific protocol, including the fragmentation method, transmission protocol, etc. The re-encapsulated data meets the specific protocol.
[0025] The present invention mainly filters invalid packets based on the characteristics of TS packet 0x47 synchronization byte and 188 bytes fixed size, which is fast and efficient.
[0026] In a specific embodiment, the sending device acts as a host, and the host and the decryption device transmit segments of the TS stream via the USB protocol. In addition to the USB protocol, other protocols can also be used to transmit relevant data of the TS stream between the host and the decryption device.
[0027] like Figure 1 As shown, corresponding to the above method, the present invention also protects a TS stream processing system, which includes a sending device and a decryption device.
[0028] The sending device acts as a host, and includes a segmentation module and a first transmission module. The segmentation module encapsulates the TS stream into segments, and the first transmission module transmits the segments to the decryption device through a corresponding protocol. In a specific embodiment, the first transmission module is a USB module.
[0029] The decryption device includes a second transmission module, a segment disassembling module, a valid TS packet filtering module, a TS packet processing module and a segment assembling module.
[0030] The second transmission module communicates with the first transmission module through the corresponding protocol. When the first transmission module is a USB module, the second transmission module is also a USB transmission module, so the decryption device is also called a USB decryption device. The fragment disassembly module is also called the Fragments disassembly module. The fragment disassembly module separates the protocol data and TS stream data of the fragments received by the second transmission module. The valid TS packet filtering module filters out invalid TS packets in the TS stream data and retains valid TS packets. The TS packet processing module decrypts the valid TS packets. On this basis, the TS packet processing module can also perform at least one of descrambling and secondary encryption on the decrypted TS packets. The fragment assembly module is also called the Fragments assembly module. The fragment assembly module re-encapsulates the processed TS packets output by the TS packet processing module according to the protocol data.
[0031] The filtering and decryption process of invalid packets will cause inconsistency between the received data and the data sent back to the sending device after processing, at least the data length will be different. Generally, the device needs to be restarted or renegotiated, and the negotiation process will cause more data loss; but our patented method continuously obtains data from the sending device and repackages it according to the characteristics of the flow, so that no renegotiation is required and the number of lost packets is reduced.
[0032] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for processing a TS stream by a decryption device, characterized in that: include: The sending device encapsulates the TS stream into segments and then transmits it to the decryption device via the USB protocol; The decryption device receives the fragment and separates the protocol data of the fragment from the TS stream data; The decryption device processes the protocol data and the TS stream data respectively, filters out invalid TS packets in the TS stream data, and decrypts valid TS packets; distinguishes valid TS packets from invalid TS packets based on the synchronization bytes and fixed size of the TS packets; The decryption device re-encapsulates the processed TS packets according to the protocol data, and transmits them to the sending device via the corresponding protocol.
2. The method for processing a TS stream by a decryption device as claimed in claim 1, characterized in that: After decrypting the valid TS, the decryption device also performs at least one of descrambling and secondary encryption.
3. A TS stream processing system, comprising a sending device and a decryption device, characterized in that: The sending device comprises: a segmentation module for encapsulating the TS stream into segments, and transmitting the segments to a first transmission module of a decryption device through a corresponding protocol; The decryption device comprises: a second transmission module communicating with the first transmission module through a corresponding protocol, a segment disassembling module for separating the protocol data of the segment received by the second transmission module from the TS stream data, a valid TS packet filtering module for filtering out invalid TS packets in the TS stream data and retaining valid TS packets, a TS packet processing module for decrypting valid TS packets, and a segment assembling module for repackaging the processed TS packets output by the TS packet processing module according to the protocol data; The first transmission module and the second transmission module are USB modules; The filtering module distinguishes valid TS packets from invalid TS packets based on the synchronization bytes and fixed sizes of the TS packets.
4. The TS stream processing system according to claim 3, characterized in that: The TS packet processing module performs at least one of descrambling and secondary encryption on the decrypted TS packets.
Citation Information
Patent Citations
Transfer system protection method and device
CN102595197A
Hybrid network gateway supporting multiple access modes
CN108282397A
System and processing method supporting AC-3, AAC and DRA audio transparent transmission
CN108322777A