Demultiplexing method, device, storage medium and electronic device for transmission data

By using the second parser in the player to find and parse matching audio and video data, the player's lag problem in abnormal situations is solved, which improves playback efficiency and reduces memory consumption and cost.

CN115460454BActive Publication Date: 2024-12-13TENCENT TECH (BEIJING) CO LTD
View PDF 9 Cites 0 Cited by

Patent Information

Application Number
CN202110635172.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-06-08
Publication Date
2024-12-13
Estimated Expiration
2041-06-08

AI Technical Summary

Technical Problem

In abnormal situations, the player is prone to stuttering when analyzing audio and video data, resulting in a decrease in playback efficiency.

Method used

By receiving and transmitting data stream, the first parser is used to parse and store the data. If the first type of M frame data is continuously stored, the second parser is turned on to find and parse the matching second type of data to solve the problem of data discarding Playback stuttering problem.

Benefits of technology

Improve the player's playback efficiency, reduce memory consumption and cost, and avoid playback lag caused by data discarding.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115460454B_ABST
    Figure CN115460454B_ABST
Patent Text Reader

Abstract

The demultiplexing method, device, storage medium and electronic device of the transmission data provided in the embodiment of the present application relate to the field of computer technology. The demultiplexing method of the transmission data provided in the embodiment of the present application can receive a transmission data stream, which includes transmission data of two different data types arranged at intervals, and uses a first parser to parse the transmission data stream. After each frame of transmission data is obtained by parsing, it is stored in a corresponding data buffer. The transmission data can be a first type of transmission data or a second type of transmission data. If M frames of the first type of transmission data are continuously stored in the corresponding data buffer, the second parser is turned on, and the second parser is used to search and parse in the transmission data stream to obtain the second type of transmission data that matches the M frames of the first type of transmission data. Thereby, the problem of playback jamming of the player can be solved and the playback efficiency of the player can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of computer technology, and in particular to a method, device, storage medium and electronic device for demultiplexing transmission data. Background Art

[0002] Under normal circumstances, audio data and video data are evenly distributed in the transport stream (TS) in the encapsulation format; for example, when watching a live broadcast, audio data and video data are collected at the same time, and accordingly, in the process of encoding to form a TS stream, audio data and video data are also evenly distributed in the TS stream.

[0003] However, in abnormal circumstances, if multiple frames of video data are parsed continuously, or multiple frames of audio data are parsed continuously, the playback of the parsed audio and video may become stuck, reducing the playback efficiency of the player. Summary of the invention

[0004] In order to solve the technical problems existing in the related art, the embodiments of the present application provide a demultiplexing method, device, storage medium and electronic device for transmitting data, which can solve the problem of playback jams of the player and improve the playback efficiency of the player.

[0005] To achieve the above purpose, the technical solution of the embodiment of the present application is implemented as follows:

[0006] In a first aspect, an embodiment of the present application provides a method for demultiplexing transmission data, the method comprising:

[0007] receiving a transmission data stream, wherein the transmission data stream includes transmission data of two different data types arranged at intervals;

[0008] The transmission data stream is parsed by a first parser, and a frame of transmission data is obtained after each parsing, and the frame of transmission data is stored in a corresponding data buffer, wherein the frame of transmission data is the first type of transmission data or the second type of transmission data;

[0009] If M frames of first-type transmission data are continuously stored in the corresponding data buffer, the second parser is started, and the second parser is used to search and parse the transmission data stream to obtain second-type transmission data that matches the M frames of first-type transmission data; M is a preset natural number.

[0010] In a second aspect, an embodiment of the present application further provides a demultiplexing device for transmission data, the device comprising:

[0011] A data stream receiving unit, configured to receive a transmission data stream, wherein the transmission data stream includes transmission data of two different data types arranged at intervals;

[0012] A data parsing unit, configured to parse the transmission data stream using a first parser, obtain a frame of transmission data each time through the parsing, and store the frame of transmission data in a corresponding data buffer, wherein the frame of transmission data is first type transmission data or second type transmission data;

[0013] A data search unit is used to start a second parser if M frames of first-type transmission data are continuously stored in a corresponding data buffer, and use the second parser to search and parse in the transmission data stream to obtain second-type transmission data that matches the M frames of first-type transmission data; M is a preset natural number.

[0014] In an optional embodiment, the data search unit is specifically used to:

[0015] Determine a timestamp of a first frame of first type transmission data among the M frames of first type transmission data;

[0016] Using the second parser to search the transmission data stream for second type transmission data that is located after the M frames of first type transmission data and has the same timestamp as the first frame of first type transmission data, and parse to obtain the second type data;

[0017] The second parser is used to parse in sequence to obtain the second type transmission data that matches the first type transmission data of other frames in the M frames other than the first frame.

[0018] In an optional embodiment, the data search unit is further used to:

[0019] The second parser is used to sequentially obtain transmission data in the transmission data stream located after the M frames of the first type of transmission data according to the set frame quantity threshold, wherein each time a frame of transmission data is obtained, the following operations are performed:

[0020] If the currently acquired frame of transmission data is the second type of transmission data, using the second parser to determine the timestamp of the currently acquired second type of transmission data;

[0021] If the timestamp of the currently acquired second type transmission data is the same as the timestamp of the first type transmission data of the first frame, the step of parsing the currently acquired second type transmission data is performed.

[0022] In an optional embodiment, the data search unit is further used to:

[0023] For each frame transmission data located after the second type transmission data matching the first type transmission data of the first frame, the following operations are performed respectively: if a frame transmission data is determined to be the first type transmission data, the frame transmission data is discarded; if the frame transmission data is determined to be the second type data, the second parser is used to parse the frame transmission data; the last frame transmission data among the frames transmission data is the second type transmission data matching the first type transmission data of the Mth frame.

[0024] In an optional embodiment, the M frame is determined by:

[0025] Determining the number of storage frames of the data buffer according to the storage capacity of the data buffer and the transmission rate of the transmission data stream;

[0026] A value smaller than the number of stored frames is selected as the M frames.

[0027] In an optional embodiment, the device further includes a parser closing unit, configured to:

[0028] After parsing and obtaining the second type transmission data matching the M frames of the first type transmission data, if it is determined that the first parser does not continue to store the M frames of the first type transmission data into the corresponding data buffer, the second parser is closed.

[0029] In a third aspect, an embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the transmission data demultiplexing method of the first aspect is implemented.

[0030] In a fourth aspect, an embodiment of the present application further provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and when the computer program is executed by the processor, the processor implements the demultiplexing method of transmission data of the first aspect.

[0031] The transmission data demultiplexing method, device, storage medium and electronic device provided in the embodiment of the present application can receive a transmission data stream, wherein the transmission data stream includes transmission data of two different data types arranged at intervals, and the transmission data stream is parsed by a first parser, and after each parsing obtains a frame of transmission data, it is stored in a corresponding data buffer, and the transmission data can be first-type transmission data or second-type transmission data. If M frames of first-type transmission data are continuously stored in the corresponding data buffer, the second parser is started, and the second parser is used to search and parse in the transmission data stream to obtain second-type transmission data that matches the M frames of first-type transmission data. When the player parses the transmission data stream, if it continuously parses the M frames of first-type transmission data but cannot parse the corresponding second-type transmission data, it will discard the parsed first-type transmission data and cause the video playback to freeze. The present application can use the second parser to search and parse to obtain the second-type transmission data corresponding to the M frames of first-type transmission data, thereby solving the player's playback freeze problem and improving the player's playback efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0033] Figure 1 An application scenario diagram of a demultiplexing method for transmission data provided in an embodiment of the present application;

[0034] Figure 2 A schematic diagram of a process flow of a universal player provided in an embodiment of the present application;

[0035] Figure 3 A schematic diagram of a flow chart of a method for demultiplexing transmission data provided in an embodiment of the present application;

[0036] Figure 4 A schematic diagram of a TS stream provided in an embodiment of the present application;

[0037] Figure 5 A schematic diagram of a process for determining an M frame provided in an embodiment of the present application;

[0038] Figure 6 A schematic diagram of another TS stream provided in an embodiment of the present application;

[0039] Figure 7 A schematic diagram of a flow chart of another method for demultiplexing transmission data provided in an embodiment of the present application;

[0040] Figure 8 A schematic diagram of another TS stream provided in an embodiment of the present application;

[0041] Fig. 9 A schematic diagram of a flow chart of another method for demultiplexing transmission data provided in an embodiment of the present application;

[0042] Fig.10 A schematic diagram of the structure of a demultiplexing device for transmission data provided in an embodiment of the present application;

[0043] Fig.11 A schematic diagram of the structure of another demultiplexing device for transmission data provided in an embodiment of the present application;

[0044] Fig.12 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;

[0045] Fig.13 A schematic diagram of the structure of another electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0046] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present application.

[0047] It should be noted that the terms "including" and "having" and their variations involved in the documents of this application are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0048] Some of the terms used in the embodiments of the present application are explained below to facilitate understanding by those skilled in the art.

[0049] (1) TS stream: It is an audio and video encapsulation format proposed by MPEG (Moving Picture Experts Group).

[0050] (2) Demultiplexing (Demuxer): The process of splitting encapsulated format data into audio and video compressed data.

[0051] (3) Elementary Stream (ES): It is a data stream that comes directly from the encoder. It can be an encoded video data stream (such as H.264, MJPEG (Motion Joint Photographic Experts Group), etc.), an audio data stream (AAC (Advanced Audio Coding)), or a general term for other encoded data streams.

[0052] (4) Packetized Elementary Streams (PES): The basic code stream ES is divided into data packets of varying lengths as needed and a packet header is added to form it.

[0053] (5) Internet Protocol TV or Interactive Personal TV (IPTV): It is a new technology that uses broadband cable television networks to integrate multiple technologies such as the Internet, multimedia, and communications to provide home users with a variety of interactive services including digital television.

[0054] The word “exemplary” is used hereinafter to mean “serving as an example, example, or illustration.” Any embodiment described as “exemplary” is not necessarily to be construed as preferred or advantageous over other embodiments.

[0055] The terms "first" and "second" in this document are used for descriptive purposes only and should not be understood as explicitly or implicitly indicating relative importance or implicitly indicating the number of technical features indicated. Therefore, features defined as "first" and "second" may explicitly or implicitly include one or more of the features, and in the description of the embodiments of this application, unless otherwise specified, "plurality" means two or more.

[0056] Cloud computing is a computing model that distributes computing tasks on a resource pool composed of a large number of computers, allowing various application systems to obtain computing power, storage space and information services as needed. The network that provides resources is called a "cloud". From the user's perspective, the resources in the "cloud" are infinitely scalable and can be obtained at any time, used on demand, expanded at any time, and paid for by use.

[0057] As a provider of basic cloud computing capabilities, a cloud computing resource pool (referred to as a cloud platform, generally referred to as an IaaS (Infrastructure as a Service) platform) will be established, and various types of virtual resources will be deployed in the resource pool for external customers to choose to use. The cloud computing resource pool mainly includes: computing devices (virtualized machines, including operating systems), storage devices, and network devices.

[0058] According to the logical function division, the PaaS (Platform as a Service) layer can be deployed on the IaaS (Infrastructure as a Service) layer, and the SaaS (Software as a Service) layer can be deployed on the PaaS layer. SaaS can also be deployed directly on IaaS. PaaS is a platform for software operation, such as databases, web containers, etc. SaaS is a variety of business software, such as web portals, SMS mass senders, etc. Generally speaking, SaaS and PaaS are upper layers relative to IaaS.

[0059] Cloud storage is a new concept that extends and develops from the concept of cloud computing. A distributed cloud storage system (hereinafter referred to as storage system) refers to a storage system that uses cluster applications, grid technology, and distributed storage file systems to bring together a large number of different types of storage devices (storage devices are also called storage nodes) in the network through application software or application interfaces to work together and provide external data storage and business access functions.

[0060] At present, the storage method of the storage system is: create a logical volume, and when creating a logical volume, allocate physical storage space for each logical volume. The physical storage space may be composed of disks of a storage device or several storage devices. The client stores data on a logical volume, that is, stores the data on the file system. The file system divides the data into many parts, each of which is an object. The object contains not only data but also additional information such as data identification (ID, ID entity). The file system writes each object into the physical storage space of the logical volume, and the file system records the storage location information of each object, so that when the client requests to access the data, the file system can allow the client to access the data according to the storage location information of each object.

[0061] The process of allocating physical storage space for a logical volume by a storage system is specifically as follows: according to the estimated capacity of the object stored in the logical volume (the estimated capacity often has a large margin relative to the actual capacity of the object to be stored) and the group of the independent redundant disk array (RAID, Redundant Array of Independent Disk), the physical storage space is pre-divided into stripes, and a logical volume can be understood as a stripe, thereby allocating physical storage space for the logical volume. In the embodiment of the present application, the server can store audio and video data in the cloud platform through cloud storage, and send a transmission data stream to the terminal device through the cloud platform. The embodiment of the present application uses a first parser and a second parser to demultiplex the transmission data stream sent by the cloud platform.

[0062] In order to better understand the technical solutions provided in the embodiments of the present application, the following briefly introduces the application scenarios to which the technical solutions provided in the embodiments of the present application are applicable. It should be noted that the application scenarios introduced below are only used to illustrate the embodiments of the present application and are not limited thereto. In specific implementation, the technical solutions provided in the embodiments of the present application can be flexibly applied according to actual needs.

[0063] The demultiplexing method for transmission data provided in the embodiment of the present application can be applied to Figure 1 See the application scenario shown in Figure 1 As shown, the server 100 is connected to the terminal device 300 through the network 200 for communication, wherein the network 200 may be, but is not limited to, a local area network, a metropolitan area network, or a wide area network, etc., and the number of the terminal devices 300 connected to the server 100 may be multiple. The terminal device 300 may transmit communication data and messages to each other through the network 200 and the server 100.

[0064] The terminal device 300 can be a portable device (for example, a mobile phone, a tablet computer, a laptop computer, etc.), or a computer, a smart screen or a personal computer (PC), etc. The server 100 can be a server or a server cluster or a cloud computing center composed of several servers, or a virtualization platform, or a personal computer, a large or medium-sized computer or a computer cluster, etc. According to the implementation needs, the application scenario in the embodiment of the present application can have any number of terminal devices and servers. The embodiment of the present application does not make special restrictions on this. The demultiplexing method of the transmission data provided in the embodiment of the present application can be performed by the terminal device 300, or by the terminal device 300 and the server 100 in collaboration.

[0065] For example, a player may be installed in the terminal device 300, and the server 100 may send a multimedia file to the terminal device 300. After receiving the multimedia file, the terminal device 300 may perform a protocol decompression operation on the multimedia file through the player to obtain a transport data stream in an encapsulated format, and then perform a demultiplexing operation on the transport data stream to obtain audio compression data and video compression data, respectively. The player may decode the audio compression data and the video compression data, respectively, and then perform an audio and video synchronization operation to play the multimedia file.

[0066] When the player performs a demultiplexing operation on the transport data stream, the first parser can be used to parse the transport data stream, and each time a frame of transport data is obtained through the parsing, the frame of transport data is stored in a corresponding data buffer. Among them, a frame of transport data can be a first type of transport data or a second type of transport data. If M frames of first type transport data are continuously stored in the corresponding data buffer, the second parser is turned on, and the second parser is used to search and parse the TS stream to obtain the second type of transport data that matches the M frames of first type transport data. After parsing to obtain the second type of transport data that matches the M frames of first type transport data, if it is determined that the first parser does not continue to store the M frames of first type transport data in the corresponding data buffer, the second parser is turned off.

[0067] TS streams are currently widely used in IPTV scenarios. TS streams are usually encapsulated into fixed 188-byte packets, which are composed of adding TS headers to PES (it should be noted that the valid data in a TS packet is not necessarily a complete PES packet). The general player process can be as follows Figure 2 As shown, after obtaining a multimedia file, the player installed on the terminal device will first perform a protocol decompression operation on the multimedia file to obtain encapsulation format data, and then perform a demultiplexing operation on the encapsulation format data to obtain corresponding audio compression data and video compression data. The player can perform an audio decoding operation on the audio compression data to obtain corresponding audio original data, perform a video decoding operation on the video compression data to obtain corresponding video original data, and then perform an audio and video synchronization operation on the obtained audio original data and video original data, and finally play the multimedia file.

[0068] Under normal circumstances, in the TS stream of the encapsulation format, the audio data and video data are evenly distributed, and the audio and video playback of the player after demultiplexing the TS stream is also normal. However, under abnormal circumstances, such as when the encoding or transmission is abnormal, there will be a large gap between the audio data and the video data in the TS stream; for example, in the TS stream, the first 60s are all video data, and after 60s, it is all audio data, then the audio and video playback of the player after demultiplexing the TS stream will be stuck.

[0069] This is because the player will first parse the audio data and video data in the TS stream in the order of the TS stream, and then store the obtained audio compressed data and video compressed data in the corresponding buffer. Therefore, when the player parses the audio data and video data in the TS stream, the following two situations may occur, causing the player to play stuck:

[0070] The first case is: if the player first parses a frame of audio data, then parses a frame of video data, and then continuously parses multiple frames of video data, the buffer will first store a frame of compressed audio data, then a frame of compressed video data, and then multiple frames of compressed video data.

[0071] Since the audio compression data and video compression data are stored in a matching manner when they are stored in the buffer, that is, to store one frame of audio compression data, it is necessary to store one frame of video compression data that matches the audio compression data. Then, after the buffer stores a part of the video compression data among multiple frames of video compression data, it still cannot start storing audio compression data. The buffer will discard the other part of the video compression data among the stored multiple frames of video compression data, thereby causing the player to play jerky.

[0072] The second situation is: if the player first parses a frame of video data, then parses a frame of audio data, and then continuously parses multiple frames of audio data, then after the buffer stores part of the audio compression data in the multiple frames of audio compression data, it still cannot start storing video compression data. The buffer will discard another part of the audio compression data in the stored multiple frames of audio compression data, which will also cause the player to play stuck.

[0073] It can be seen that in the related art under the prior art, since the player discards a part of the audio compression data or video compression data in the buffer, it will cause playback jamming, thereby reducing the playback efficiency of the player;

[0074] Furthermore, even if the storage capacity of the buffer is increased to a certain extent to alleviate the occurrence of the above two situations, although the player can play normally, the memory consumption will be greatly increased, thereby increasing the cost of the player.

[0075] In order to solve the above problems, the embodiment of the present application provides a method for demultiplexing transmission data. After receiving a transmission data stream including transmission data of two different data types arranged at intervals, a first parser can be used to parse the transmission data stream. Each time a frame of transmission data is obtained through parsing, the frame of transmission data is stored in a corresponding data buffer, wherein the frame of transmission data is the first type of transmission data or the second type of transmission data. When M frames of the first type of transmission data are continuously stored in the corresponding data buffer, a second parser can be started, and the second parser can be used to search and parse the transmission data stream to obtain the second type of transmission data that matches the M frames of the first type of transmission data. This method can solve the problem of playback jams in the player, improve the player's playback efficiency, and also reduce the player's memory consumption, thereby reducing the cost of the player.

[0076] To further illustrate the technical solution provided by the embodiment of the present application, this is described in detail below in conjunction with the accompanying drawings and specific implementation methods. Although the embodiment of the present application provides the method operation steps as shown in the following embodiments or drawings, more or fewer operation steps may be included in the method based on routine or no creative labor. In the steps where there is no necessary causal relationship logically, the execution order of these steps is not limited to the execution order provided by the embodiment of the present application. The method may be executed in the order of the method shown in the embodiment or drawings or in parallel during the actual processing process or when the device is executed.

[0077] Figure 3 A flowchart of a method for demultiplexing transmission data provided by an embodiment of the present application is shown. The method can be performed by Figure 1 The method may be executed by the terminal device 300 in the embodiment, or may be executed by other electronic devices. By way of example, the following uses the terminal device for demultiplexing the transmission data as the execution subject to illustrate the specific implementation process of the demultiplexing method of the transmission data in the embodiment of the present application. The specific implementation process executed by other devices is similar to the process executed by the terminal device alone, and will not be repeated herein.

[0078] like Figure 3 As shown, the demultiplexing method of the transmission data includes the following steps:

[0079] Step S301, receiving a transmission data stream.

[0080] The transport data stream may include two different data types of transport data arranged at intervals. Specifically, the transport data stream may be a TS stream in an encapsulated format, and the TS may include audio data and video data distributed at intervals. For example, the audio data and video data in the TS stream may be distributed as follows: Figure 4 shown.

[0081] Step S302: parse the transmission data stream using a first parser, obtain a frame of transmission data each time through parsing, and store the frame of transmission data in a corresponding data buffer.

[0082] A frame of transmission data may be first type transmission data or second type transmission data. The first type transmission data may be audio data, and correspondingly, the second type transmission data may be video data; or the first type transmission data may be video data, and correspondingly, the second type transmission data may be audio data.

[0083] For example, the first parser can be used to parse the TS stream, and each time a frame of audio data is parsed, the obtained audio compressed data is stored in the corresponding audio buffer, and each time a frame of video data is parsed, the obtained video compressed data is stored in the corresponding video buffer.

[0084] Step S303, if the M frames of first type transmission data are continuously stored in the corresponding data buffer, the second parser is started, and the second parser is used to search and parse the transmission data stream to obtain the second type transmission data matching the M frames of first type transmission data.

[0085] If the first parser continuously stores the parsed first-type transmission data of M frames to the corresponding data buffer, the second parser can be started and the timestamp of the first-type transmission data of the first frame in the M frames can be determined. Then, the second parser is used to search the transmission data stream for the second-type transmission data that is located after the first-type transmission data of the M frames and has the same timestamp as the first-type transmission data of the first frame, and parse to obtain the second-type data, and the second parser is used to parse in sequence to obtain the second-type transmission data that matches the first-type transmission data of other frames in the M frames other than the first frame. After the second parser parses and obtains the second-type transmission data that matches the first-type transmission data of the M frames, the second parser can store the second-type transmission data to the corresponding data buffer.

[0086] Wherein, M can be a preset natural number. The playable duration of the data buffer can be determined based on the storage capacity of the data buffer and the transmission rate of the transmission data stream, and the number of storage frames of the data buffer can be determined based on the playable duration. After determining the number of storage frames of the data buffer, a value less than the number of storage frames can be selected as the M frame. For example, the M frame can be half of the number of storage frames of the data buffer, or one-third of the number of storage frames of the data buffer, etc., which is not limited in the embodiments of the present application.

[0087] After the first parser continuously parses and obtains multiple frames of first-type transmission data, it will store multiple frames of first-type transmission data in the data buffer. After the data buffer continuously stores a part of the first-type transmission data, if it still cannot store the second-type transmission data, it will discard the other part of the first-type transmission data obtained by parsing. In this case, the player will freeze. Therefore, part of the number of stored frames in the data buffer can be used as M frames, so that when the number of frames of the first-type transmission data stored in the data buffer reaches M frames, the second parser can be turned on to search and parse to obtain the second-type transmission data that matches the M-frame first-type transmission data, so that the player can play normally.

[0088] In one embodiment, the Figure 5 The process shown is to determine the M frame, such as Figure 5 As shown, the first parser can determine M frames according to the storage capacity of the data buffer and the current bitstream information. Specifically, the first parser can first determine the playable duration of the data buffer when it is full according to the storage capacity of the data buffer and the current playback bitstream rate, and the playable duration of the data buffer when it is full = the storage capacity of the data buffer / the current playback bitstream rate, and then the number of storage frames in the data buffer can be determined according to the playable duration of the data buffer when it is full, and half of the number of storage frames is taken as M frames. When the data buffer is an audio buffer, the playable duration of the audio buffer when it is full = the storage capacity of the audio buffer / the current audio playback bitstream rate; when the data buffer is a video buffer, the playable duration of the video buffer when it is full = the storage capacity of the video buffer / the current video playback bitstream rate.

[0089] For example, the audio data and video data in the TS stream can be distributed as follows: Figure 6 And, in Figure 6 In the TS stream shown, the distribution of audio data and video data is: the first frame of audio data, the first frame of video data, the second frame of audio data, the second-20th frame of video data, the third frame of audio data, and the 21st frame of video data. Assuming M=6, after the first parser parses the second frame of video data and stores the parsed second frame of video compressed data into the video buffer, the first parser continuously parses 6 frames of video data, that is, the 3rd-8th frame of video data, but cannot parse the corresponding audio data, the second parser will be turned on to search for the third frame of audio data in the TS stream, and the second parser will be used to parse the third frame of audio data, and the parsed third frame of audio compressed data will be stored in the audio buffer. After the parsed third frame of audio compressed data is stored in the audio buffer, the second parser can parse the 4th-8th frame of audio data and store the obtained 4th-8th frame of audio compressed data in the audio buffer.

[0090] Specifically, the timestamp of the first type of transmission data in the first frame of M frames of first type transmission data can be determined first, and then the second parser can be used to obtain the transmission data in sequence according to the set frame number threshold in the transmission data stream located after the M frames of first type transmission data, wherein each time a frame of transmission data is obtained, the following operations can be performed: if the currently obtained frame of transmission data is the second type of transmission data, the second parser is used to determine the timestamp of the currently obtained second type of transmission data; if the timestamp of the currently obtained second type of transmission data is the same as the timestamp of the first type of transmission data in the first frame, the search process is stopped, and the step of parsing the currently obtained second type of transmission data is performed; otherwise, the currently obtained second type of transmission data is discarded, and the search process is continued to obtain the next frame of transmission data; if the currently obtained frame of transmission data is the first type of transmission data, the currently obtained first type of transmission data is discarded, and the search process is continued to obtain the next frame of transmission data.

[0091] Further, a second parser can be used to sequentially acquire transmission data according to the first frame number threshold in the transmission data stream located after the M frames of the first type of transmission data, and each time a frame of transmission data is acquired, it is determined whether the currently acquired transmission data is the second type of transmission data. If the currently acquired transmission data is not the second type of transmission data, the currently acquired transmission data is skipped, and the search process is continued to acquire the next frame of transmission data; if the currently acquired transmission data is the second type of transmission data, the timestamp of the currently acquired second type of transmission data is determined by the second parser, and if the timestamp of the currently acquired second type of transmission data is the same as the timestamp of the first type of transmission data of the first frame, the search process is stopped, and the step of parsing the currently acquired second type of transmission data is executed. For example, the distribution of audio data and video data in the TS stream is: the first frame of audio data, the first frame of video data, the second frame of audio data, the second to 19 frames of video data, the third frame of audio data, and the 20th frame of video data. Assume that M=10, that is, the first parser continuously parses the 3rd-12th frames of video data, then the second parser needs to find the audio data with the same timestamp as the 3rd frame of video data in the TS stream after the 12th frame of video data. The first frame quantity threshold can be set to 4, that is, in the TS stream, one frame of data is obtained every 4 frames. If the frame data is video data, it is ignored, and then another frame of data is obtained after an interval of 4 frames; if the frame data is audio data, the timestamp of the frame audio data is obtained. In the TS stream, starting from the 12th frame of video data, one frame of data is obtained every 4 frames. The first data obtained by the second parser is the 16th frame of video data. Since the current data obtained is video data rather than audio data, it can be ignored and the search can be continued backward. The second data obtained by the second parser is the 3rd frame of audio data. Since the current data obtained is audio data, it is necessary to determine whether the timestamp of the currently obtained data is the same as the timestamp of the 3rd frame of video data. After comparison, it is found that the timestamp of the currently obtained data is the same as the timestamp of the 3rd frame of video data. In this way, the search process can be stopped and the step of parsing the 3rd frame of audio data can be executed.

[0092] If the timestamp of the currently acquired second type transmission data is greater than the timestamp of the first type transmission data of the first frame, the second type transmission data that the second parser expects to parse is in the previous transmission data stream, that is, the second parser can start from the currently acquired second type transmission data and move forward, sequentially acquire transmission data according to the second frame quantity threshold, and determine whether the currently acquired transmission data is the second type transmission data for each acquired frame of transmission data. If the currently acquired transmission data is the second type transmission data, the second parser is used to determine the timestamp of the currently acquired second type transmission data. If the timestamp of the currently acquired second type transmission data is the same as the timestamp of the first type transmission data of the first frame, the search process is stopped, and the step of parsing the currently acquired second type transmission data is performed. Wherein, the second frame quantity threshold is less than the first frame quantity threshold.

[0093] For example, the distribution of audio data and video data in the TS stream is: audio data of the first frame, video data of the first frame, audio data of the second frame, video data of the second to the 19th frames, audio data of the third frame, video data of the 20th frame, audio data of the fourth frame, video data of the 21st frame, audio data of the fifth frame, and video data of the 22nd frame. Assuming that M=10, that is, the first parser continuously parses the video data of the third to the 12th frames, the second parser needs to find the audio data with the same timestamp as the video data of the third frame in the TS stream after the video data of the 12th frame. The first frame quantity threshold can be set to 5, then the data acquired by the second parser for the first time is the 17th frame of video data, which can be ignored and continue to search backward; the data acquired by the second parser for the second time is the 4th frame of audio data, and the timestamp of the currently acquired data is compared with the timestamp of the 3rd frame of video data. If it is found that the timestamp of the currently acquired data is greater than the timestamp of the 3rd frame of video data, then the data can be acquired in sequence according to the second frame quantity threshold, and the second frame quantity threshold can be set to 2, that is, in the TS stream before the 4th frame of audio data, starting from the 4th frame of audio data forward, one frame of data is acquired every 2 frames, then the data acquired by the second parser for the first time is the 3rd frame of audio data, and the timestamp of the currently acquired audio data is compared with the timestamp of the 3rd frame of video data. If it is found that the timestamp of the currently acquired audio data is the same as the timestamp of the 3rd frame of video data, then the search process can be stopped and the step of parsing the 3rd frame of audio data can be executed.

[0094] If the timestamp of the currently acquired second type transmission data is smaller than the timestamp of the first type transmission data of the first frame, the second parser continues to search for the second type transmission data with the same timestamp as the first type transmission data of the first frame in the transmission data stream after the currently acquired second type transmission data.

[0095] If the timestamp of the currently acquired second type transmission data is greater than the timestamp of the first type transmission data of the first frame, the second parser continues to search for the second type transmission data with the same timestamp as the first type transmission data of the first frame in the transmission data stream before the currently acquired second type transmission data.

[0096] After finding the second type transmission data having the same timestamp as the first type transmission data of the first frame, the second parser may parse and obtain the second type transmission data.

[0097] For each frame transmission data after the second type transmission data matching the first type transmission data of the first frame, the following operations can be performed respectively: if a frame transmission data is determined to be the first type data, the transmission data is discarded; if a frame transmission data is determined to be the second type data, the transmission data is parsed by a second parser to obtain the transmission data. Among them, the last frame transmission data in each frame transmission data can be the second type transmission data matching the first type transmission data of the Mth frame.

[0098] The second parser is used to obtain a frame of second type transmission data matching M frames of first type transmission data through each parsing, and the frame of second type transmission data can be stored in a corresponding data buffer.

[0099] In one embodiment, after the second parser parses and obtains the second type of transmission data that matches the first type of transmission data of the M frames, and stores the second type of transmission data in the corresponding data buffer, if it is determined that the first parser does not continue to store the first type of transmission data of the M frames in the corresponding data buffer, the second parser is closed.

[0100] The demultiplexing method of transmission data provided by the embodiment of the present application, after receiving the transmission data stream, which may include transmission data of two different data types arranged at intervals, can use the first parser to parse the transmission data stream, and each parsing obtains a frame of transmission data, and stores the frame of transmission data in the corresponding data buffer, wherein the frame of transmission data is the first type of transmission data or the second type of transmission data, and when the first type of transmission data of M frames is continuously stored in the corresponding data buffer, the second parser can be turned on, and the second parser is used to search and parse in the transmission data stream to obtain the second type of transmission data matching the first type of transmission data of M frames. And, after parsing to obtain the second type of transmission data matching the first type of transmission data of M frames, in the process of continuing to parse the transmission data stream using the first parser, if the first type of transmission data of M frames is not continued to be stored in the corresponding data buffer, the second parser is turned off. Thereby, the problem of the player's playback jamming can be solved, the player's playback efficiency can be improved, and the player's memory consumption can also be reduced, thereby reducing the cost of the player.

[0101] In some embodiments, the demultiplexing method of transmission data proposed in the present application can be performed according to Figure 7 The process shown is implemented by Figure 1 The terminal device 300 in the embodiment may also be executed by other electronic devices. For example, the terminal device for demultiplexing the transmission data is used as the execution subject below, and the specific implementation process executed by other devices is similar to the process executed by the terminal device alone, which will not be repeated in this article.

[0102] like Figure 7 As shown, the following steps may be included:

[0103] Step S701: receiving a transmission data stream.

[0104] The transmission data stream may include transmission data of two different data types arranged at intervals.

[0105] Step S702: parse the transmission data stream using the first parser, obtain one frame of transmission data each time through the parsing, and store the frame of transmission data in a corresponding data buffer.

[0106] Among them, a frame of transmission data can be first type transmission data or second type transmission data.

[0107] Step S703, determining whether to continuously store M frames of first type transmission data into the corresponding data buffer; if not, executing step S704; if yes, executing step S705.

[0108] In the process of using the first parser to parse the transmission data stream and storing the transmission data obtained by the parsing into the corresponding data buffer, it can be determined whether to continuously store M frames of the first type of transmission data into the corresponding data buffer. Wherein, M can be a preset natural number.

[0109] Step S704: do not start the second parser.

[0110] Step S705, start the second parser, and use the second parser to find the second type transmission data located after the M frames of the first type transmission data in the transmission data stream and having the same timestamp as the first type transmission data of the first frame.

[0111] If it is determined that the M frames of first-type transmission data are not continuously stored in the corresponding data buffer, the second parser is not started, and only the first parser is still used to parse the transmission data in the transmission data stream. If it is determined that the M frames of first-type transmission data are continuously stored in the corresponding data buffer, the second parser is started, and the second parser is used to find the second-type transmission data located after the M frames of first-type transmission data in the transmission data stream and having the same timestamp as the first frame of first-type transmission data.

[0112] Specifically, the timestamp of the first frame of the first type of transmission data in the M frames of the first type of transmission data may be determined first, and then the second parser may be used to sequentially obtain the transmission data in the transmission data stream after the M frames of the first type of transmission data according to the set frame quantity threshold, wherein each time a frame of transmission data is obtained, the following operations may be performed:

[0113] If the currently acquired frame of transmission data is the second type of transmission data, a second parser is used to determine the timestamp of the currently acquired second type of transmission data; if the timestamp of the currently acquired second type of transmission data is the same as the timestamp of the first type of transmission data of the first frame, the step of parsing the currently acquired second type of transmission data is executed, otherwise, the currently acquired second type of transmission data is discarded.

[0114] Step S706: Use a second parser to parse and obtain second type transmission data having the same timestamp as the first type transmission data of the first frame, and store the second type transmission data in a corresponding data buffer area.

[0115] After finding the second type transmission data with the same timestamp as the first type transmission data of the first frame, the second type transmission data can be parsed by a second parser to obtain the second type transmission data, and the second type transmission data is stored in a corresponding data buffer.

[0116] Step S707: Use a second parser to parse in sequence to obtain second type transmission data that matches the first type transmission data of other frames in the M frames other than the first frame, and store the second type transmission data in a corresponding data buffer.

[0117] After the second parser is used to complete the parsing of the second type transmission data having the same timestamp as the first type transmission data of the first frame, the following operations may be performed for each frame transmission data located after the second type transmission data matching the first type transmission data of the first frame:

[0118] If a frame of transmission data is determined to be the first type of data, the transmission data is discarded; if a frame of transmission data is determined to be the second type of data, the transmission data is parsed by a second parser to obtain the transmission data. The last frame of transmission data in each frame of transmission data can be the second type of transmission data that matches the Mth frame of the first type of transmission data.

[0119] After the second parser is used to parse and obtain the second type transmission data that matches the first type transmission data of other frames other than the first frame in the M frames, the second type transmission data can be stored in corresponding data buffers respectively.

[0120] Step S708, after the second parser stores the second type transmission data into the corresponding data buffer, if it is determined that the first parser does not continue to store the M frames of the first type transmission data into the corresponding data buffer, the second parser is closed.

[0121] After the second parser stores the second type transmission data matching the M frames of the first type transmission data into the corresponding data buffer, if it is determined that the first parser does not continuously store the M frames of the first type transmission data into the corresponding data buffer, the second parser is closed.

[0122] The demultiplexing method for transmission data provided in the embodiment of the present application, during the process of the first parser parsing the TS stream, if a long audio and video interval appears in the TS stream, the second parser can be started to search for the required audio and video data in the TS stream, and the second parser can be used to parse the required audio and video data, thereby solving the problem of playback jams in the player and improving the playback efficiency of the player.

[0123] See also Figure 8 As shown, a specific application scenario is used below to further describe the demultiplexing method for transmission data provided in the embodiment of the present application:

[0124] Step S801, receiving TS stream.

[0125] Assume that the audio and video distribution in the received TS stream can be as follows Fig. 9 As shown by Fig. 9 It can be seen that the audio and video distribution in the TS stream is: the 1st frame video data, the 1st frame audio data, the 2nd frame video data, the 2nd-9th frames audio data, the 3rd frame video data, the 10th frame audio data, the 4th frame video data, the 11th frame audio data, the 5th frame video data, the 12th frame audio data, the 6th frame video data...

[0126] Step S802, using the first parser to parse the TS stream, each time a frame of audio compression data is obtained by parsing, the frame of audio compression data is stored in the audio buffer, each time a frame of video compression data is obtained by parsing, the frame of video compression data is stored in the video buffer.

[0127] The first parser can be used to parse the first frame of video data in the TS stream, and store the first frame of video compressed data obtained by the analysis in the video buffer; the first parser can be used to parse the first frame of audio data in the TS stream, and store the first frame of audio compressed data obtained by the analysis in the audio buffer; the first parser can be used to parse the second frame of video data in the TS stream, and store the second frame of video compressed data obtained by the analysis in the video buffer; the first parser can be used to parse the second frame of audio data in the TS stream, and store the second frame of audio compressed data obtained by the analysis in the audio buffer….

[0128] Step S803: If 4 frames of compressed audio data are continuously stored in the audio buffer, the second parser is started.

[0129] It can be assumed that M=4. Then, when the first parser parses the 3rd frame audio data, the 4th frame audio data, the 5th frame audio data and the 6th frame audio data respectively, and stores the parsed 3rd frame audio compression data, the 4th frame audio compression data, the 5th frame audio compression data and the 6th frame audio compression data into the audio buffer respectively, the second parser can be started.

[0130] Step S804, determining the timestamp of the third frame of audio data, and using the second parser to search the TS stream for the third frame of video data having the same timestamp as the third frame of audio data.

[0131] The timestamp of the 3rd frame audio data may be determined first, and then a second parser may be used to search for the 3rd frame video data having the same timestamp as the 3rd frame audio data starting from the position of the 6th frame audio data.

[0132] Specifically, the frame number threshold can be set to 4, and then the second parser can be used to obtain a frame of data every 4 frames in the TS stream after the 6th frame of audio data. The first data obtained by the second parser is the 3rd frame of video data. Since the current acquisition is video data, it is necessary to determine the timestamp of the currently acquired video data, and compare the timestamp of the currently acquired video data with the timestamp of the 3rd frame of audio data. If it is determined that the timestamp of the currently acquired video data is the same as the timestamp of the 3rd frame of audio data, the search process can be stopped and the step of parsing the 3rd frame of video data can be executed. The setting of the frame number threshold can be set arbitrarily as needed, and the embodiments of the present application are not limited here.

[0133] Step S805: Use the second parser to parse and obtain the third frame of video compression data, and store the third frame of video compression data in the video buffer.

[0134] After the third frame of video data is found, the second parser may be used to parse and obtain the third frame of video compression data, and the third frame of video compression data may be stored in the video buffer.

[0135] Step S806, using the second parser to parse in sequence to obtain the 4th frame video compression data, the 5th frame video compression data and the 6th frame video compression data, and storing the 4th frame video compression data, the 5th frame video compression data and the 6th frame video compression data in the video buffer.

[0136] The second parser may be used to parse the 4th frame of video data, the 5th frame of video data and the 6th frame of video data in sequence starting from the position of the 3rd frame of video data. Figure 8 It can be seen that the audio and video distribution in TS is: the 10th frame audio data, the 4th frame video data, the 11th frame audio data, the 5th frame video data, the 12th frame audio data, and the 6th frame video data. If the second parser encounters the 16th frame audio data, the 17th frame audio data, and the 18th frame audio data during the parsing process, it can be ignored and only the 4th frame video data, the 5th frame video data, and the 6th frame video data can be parsed, and the 4th frame video compressed data, the 5th frame video compressed data, and the 6th frame video compressed data obtained by parsing are stored in the video buffer.

[0137] Step S807, after storing the 3rd frame video compression data, the 4th frame video compression data, the 5th frame video compression data and the 6th frame video compression data obtained by parsing into the video buffer, if it is determined that the first parser does not continue to store the 4 frames of audio compression data into the audio buffer, or does not continue to store the 4 frames of video compression data into the video buffer, then close the second parser.

[0138] In the process that the second parser searches and parses to obtain the third frame of video compression data, and parses to obtain the fourth frame of video compression data, the fifth frame of video compression data, and the sixth frame of video compression data, the first parser has been parsing the TS stream and storing the parsed audio compression data in the audio buffer or storing the parsed video compression data in the video buffer. After the second parser stores the parsed third frame of video compression data, the fourth frame of video compression data, the fifth frame of video compression data, and the sixth frame of video compression data in the video buffer, if it is determined that the first parser has not continuously parsed to obtain 4 frames of audio compression data or video compression data, and stored the 4 frames of audio compression data in the audio buffer or stored the 4 frames of video compression data in the video buffer, the second parser is closed.

[0139] and Figure 3 The demultiplexing method for transmission data shown is based on the same inventive concept, and a demultiplexing device for transmission data is also provided in the embodiment of the present application, and the demultiplexing device for transmission data can be deployed in a server or a terminal device. Since the device is a device corresponding to the demultiplexing method for transmission data of the present application, and the principle of solving the problem by the device is similar to that of the method, the implementation of the device can refer to the implementation of the above method, and the repeated parts will not be repeated.

[0140] Fig.10 A schematic diagram of the structure of a demultiplexing device for transmission data provided in an embodiment of the present application is shown. Fig.10 As shown, the transmission data demultiplexing device includes a data stream receiving unit 1001 , a data parsing unit 1002 and a data searching unit 1003 .

[0141] The data stream receiving unit 1001 is used to receive a transmission data stream, wherein the transmission data stream includes transmission data of two different data types arranged at intervals;

[0142] The data parsing unit 1002 is used to parse the transmission data stream using the first parser, and each time a frame of transmission data is obtained through the parsing, the frame of transmission data is stored in a corresponding data buffer, and the frame of transmission data is the first type of transmission data or the second type of transmission data;

[0143] The data search unit 1003 is used to start the second parser if M frames of first type transmission data are continuously stored in the corresponding data buffer, and use the second parser to search and parse in the transmission data stream to obtain second type transmission data that matches the M frames of first type transmission data; M is a preset natural number.

[0144] In an optional embodiment, the data searching unit 1003 is specifically configured to:

[0145] Determine the timestamp of the first type of transmission data in the first frame among the M frames of the first type of transmission data;

[0146] Using a second parser to search in the transmission data stream for second type transmission data that is located after the first type transmission data of the M frames and has the same timestamp as the first type transmission data of the first frame, and parse to obtain the second type data;

[0147] The second parser is used to parse in sequence to obtain the second type transmission data that matches the first type transmission data of other frames in the M frames other than the first frame.

[0148] In an optional embodiment, the data searching unit 1003 is further configured to:

[0149] The second parser is used to sequentially obtain transmission data in the transmission data stream located after the M frames of the first type of transmission data according to the set frame number threshold, wherein each time a frame of transmission data is obtained, the following operations are performed:

[0150] If the currently acquired frame of transmission data is the second type of transmission data, using the second parser to determine the timestamp of the currently acquired second type of transmission data;

[0151] If the timestamp of the currently acquired second type transmission data is the same as the timestamp of the first type transmission data of the first frame, the step of parsing the currently acquired second type transmission data is performed.

[0152] In an optional embodiment, the data searching unit 1003 is further configured to:

[0153] For each frame transmission data located after the second type transmission data that matches the first type transmission data of the first frame, the following operations are performed respectively: if a frame transmission data is determined to be the first type transmission data, the frame transmission data is discarded; if a frame transmission data is determined to be the second type data, a second parser is used to parse the frame transmission data; the last frame transmission data in each frame transmission data is the second type transmission data that matches the first type transmission data of the Mth frame.

[0154] In an optional embodiment, the M frame is determined by:

[0155] Determining the number of storage frames of the data buffer according to the storage capacity of the data buffer and the transmission rate of the transmission data stream;

[0156] A value smaller than the number of stored frames is selected as M frames.

[0157] In an optional embodiment, if Fig.11 As shown, the above-mentioned demultiplexing device for transmission data may further include a parser closing unit 1101, which is used to:

[0158] After parsing to obtain the second type transmission data matching the M frames of the first type transmission data, if it is determined that the first parser does not continue to store the M frames of the first type transmission data into the corresponding data buffer, the second parser is closed.

[0159] Based on the same inventive concept as the above method embodiment and device embodiment, an electronic device is also provided in the embodiment of the present application.

[0160] In one embodiment, the electronic device may be a server, such as Figure 1 In this embodiment, the structure of the electronic device can be as follows: Fig.12As shown, it includes a memory 1201 , a communication module 1203 and one or more processors 1202 .

[0161] The memory 1201 is used to store computer programs executed by the processor 1202. The memory 1201 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system and programs required for running the instant messaging function, etc.; the data storage area may store various instant messaging information and operation instruction sets, etc.

[0162] The memory 1201 may be a volatile memory, such as a random-access memory (RAM); the memory 1201 may also be a non-volatile memory, such as a read-only memory, a flash memory, a hard disk drive (HDD) or a solid-state drive (SSD), or the memory 1201 is any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory 1201 may be a combination of the above memories.

[0163] The processor 1202 may include one or more central processing units (CPU) or a digital processing unit, etc. The processor 1202 is used to implement the above-mentioned demultiplexing method of transmission data when calling the computer program stored in the memory 1201 .

[0164] The communication module 1203 is used to communicate with the terminal device and other electronic devices. If the electronic device is a server, the server can receive the transmission data stream sent by the terminal device through the communication module 1203.

[0165] The specific connection medium between the memory 1201, the communication module 1203 and the processor 1202 is not limited in the embodiment of the present application. Fig.12 In the embodiment, the memory 1201 and the processor 1202 are connected via a bus 1204. The bus 1204 is connected to the processor 1202 via a bus 1204. Fig.12 The connections between other components are shown in bold lines, and are not intended to be limiting. Bus 1204 can be divided into address bus, data bus, control bus, etc. For ease of representation, Fig.12 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0166] In another embodiment, the electronic device may be any electronic device such as a mobile phone, a tablet computer, a POS (Point of Sales), a car computer, a smart wearable device, a PC, etc. For example, the electronic device may also be Figure 1 The terminal device 300 shown in FIG.

[0167] Fig.13 FIG. 1 shows a structural block diagram of an electronic device provided by an embodiment of the present application. Fig.13 As shown, the electronic device includes: a radio frequency (RF) circuit 1310, a memory 1320, an input unit 1330, a display unit 1340, a sensor 1350, an audio circuit 1360, a wireless fidelity (WiFi) module 1370, a processor 1380 and other components. Those skilled in the art can understand that Fig.13 The electronic device structure shown in the figure does not constitute a limitation of the electronic device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.

[0168] Combine the following Fig.13 A detailed introduction to the various components of electronic equipment:

[0169] The RF circuit 1310 may be used for receiving and sending signals during information transmission or communication. In particular, after receiving downlink information from the base station, the information is sent to the processor 1380 for processing. In addition, the uplink data is sent to the base station.

[0170] The memory 1320 can be used to store software programs and modules, such as the program instructions / modules corresponding to the transmission data demultiplexing method and the device in the embodiment of the present application. The processor 1380 executes various functional applications and data processing of the electronic device by running the software programs and modules stored in the memory 1320, such as the transmission data demultiplexing method provided in the embodiment of the present application. The memory 1320 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, at least one application application, etc.; the data storage area may store data created according to the use of the electronic device, etc. In addition, the memory 1320 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.

[0171] The input unit 1330 may be used to receive numbers or character information input by a user, and to generate key signal input related to user settings and function control of the terminal.

[0172] Optionally, the input unit 1330 may include a touch panel 1331 and other input devices 1332 .

[0173] Among them, the touch panel 1331, also known as a touch screen, can collect the user's touch operations on or near it (such as the user's operation on the touch panel 1331 or near the touch panel 1331 using any suitable object or accessory such as a finger, stylus, etc.), and implement corresponding operations according to a pre-set program, such as the user clicking on the shortcut logo of the function module. Optionally, the touch panel 1331 may include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into contact coordinates, and then sends it to the processor 1380, and can receive and execute commands sent by the processor 1380. In addition, the touch panel 1331 can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic wave.

[0174] Optionally, other input devices 1332 may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, etc.

[0175] The display unit 1340 can be used to display information input by the user or interface information displayed to the user and various menus of the electronic device. The display unit 1340 is a display system of the terminal device, which is used to present an interface, such as displaying a desktop, an application operation interface, or an operation interface of a live broadcast application.

[0176] The display unit 1340 may include a display panel 1341. Optionally, the display panel 1341 may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), or the like.

[0177] Furthermore, the touch panel 1331 may cover the display panel 1341. When the touch panel 1331 detects a touch operation on or near it, it is transmitted to the processor 1380 to determine the type of touch event. The processor 1380 then provides a corresponding interface output on the display panel 1341 according to the type of touch event.

[0178] Although in Fig.13 In the embodiment, the touch panel 1331 and the display panel 1341 are used as two independent components to implement the input and output functions of the electronic device, but in some embodiments, the touch panel 1331 and the display panel 1341 can be integrated to implement the input and output functions of the terminal.

[0179] The electronic device may also include at least one sensor 1350, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display panel 1341 according to the brightness of the ambient light, and the proximity sensor may turn off the backlight of the display panel 1341 when the electronic device is moved to the ear. As a type of motion sensor, the accelerometer sensor can detect the magnitude of acceleration in all directions (generally three axes), and can detect the magnitude and direction of gravity when stationary. It can be used for applications that identify the posture of electronic devices (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometers, tapping), etc.; as for other sensors that can be configured in electronic devices, such as gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc., they will not be repeated here.

[0180] The audio circuit 1360, the speaker 1361, and the microphone 1362 can provide an audio interface between the user and the electronic device. The audio circuit 1360 can transmit the received audio data to the speaker 1361 after converting the received audio data into an electrical signal, which is converted into a sound signal for output; on the other hand, the microphone 1362 converts the collected sound signal into an electrical signal, which is received by the audio circuit 1360 and converted into audio data, and then the audio data is output to the processor 1380 for processing, and then sent to another electronic device through the RF circuit 1310, or the audio data is output to the memory 1320 for further processing.

[0181] WiFi is a short-range wireless transmission technology. Electronic devices can help users send and receive emails, browse web pages, and access streaming media through WiFi modules 1370. It provides users with wireless broadband Internet access. Fig.13 A WiFi module 1370 is shown, but it is understandable that it is not an essential component of the electronic device and can be omitted as needed without changing the essence of the invention.

[0182] The processor 1380 is the control center of the electronic device. It uses various interfaces and lines to connect various parts of the entire electronic device. By running or executing software programs and / or modules stored in the memory 1320, and calling data stored in the memory 1320, it performs various functions of the electronic device and processes data, thereby monitoring the electronic device as a whole. Optionally, the processor 1380 may include one or more processing units; optionally, the processor 1380 may integrate an application processor and a modem processor, wherein the application processor mainly processes software programs such as operating systems, applications, and functional modules within applications, such as the demultiplexing method for transmission data provided in the embodiments of the present application. The modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 1380.

[0183] Understandably, Fig.13 The structure shown is for illustration only. The electronic device may also include Fig.13 More or fewer components as shown, or with Fig.13 Different configurations are shown. Fig.13 Each component shown in the figure can be implemented by hardware, software or a combination thereof.

[0184] According to one aspect of the present application, a computer program product or computer program is provided, which includes computer instructions stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions so that the computer device executes the demultiplexing method of the transmission data in the above embodiment. The program product can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can be, for example, - but not limited to - an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of readable storage media (non-exhaustive list) include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0185] The above description is only a specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application.

Claims

1. A method for demultiplexing transmission data, characterized in that: The method comprises: receiving a transmission data stream, wherein the transmission data stream includes transmission data of two different data types arranged at intervals; The transmission data stream is parsed by a first parser, and each time a frame of transmission data is obtained through parsing, the frame of transmission data is stored in a corresponding data buffer, wherein the frame of transmission data is the first type of transmission data or the second type of transmission data; If M frames of first-type transmission data are continuously stored in the corresponding data buffer, the second parser is started, and the second parser is used to search and parse the transmission data stream to obtain second-type transmission data that matches the M frames of first-type transmission data; M is a preset natural number.

2. The method according to claim 1, characterized in that The using the second parser to search and parse in the transmission data stream to obtain the second type transmission data matching the M frame first type transmission data comprises: Determine a timestamp of a first frame of first type transmission data among the M frames of first type transmission data; Using the second parser to search the transmission data stream for second type transmission data that is located after the M frames of first type transmission data and has the same timestamp as the first frame of first type transmission data, and parse to obtain the second type transmission data; The second parser is used to parse in sequence to obtain the second type transmission data that matches the first type transmission data of other frames in the M frames other than the first frame.

3. The method according to claim 2, characterized in that The step of using the second parser to search the transmission data stream for the second type transmission data that is located after the M frames of the first type transmission data and has the same timestamp as the first frame of the first type transmission data includes: The second parser is used to sequentially obtain transmission data in the transmission data stream located after the M frames of the first type of transmission data according to the set frame quantity threshold, wherein each time a frame of transmission data is obtained, the following operations are performed: If the currently acquired frame of transmission data is the second type of transmission data, using the second parser to determine the timestamp of the currently acquired second type of transmission data; If the timestamp of the currently acquired second type transmission data is the same as the timestamp of the first type transmission data of the first frame, the step of parsing the currently acquired second type transmission data is performed.

4. The method according to claim 2, characterized in that: The second type of transmission data obtained by sequentially parsing with the second parser and matching the first type of transmission data of other frames other than the first frame in the M frames includes: For each frame transmission data located after the second type transmission data matching the first type transmission data of the first frame, the following operations are performed respectively: if a frame transmission data is determined to be the first type transmission data, the frame transmission data is discarded; if the frame transmission data is determined to be the second type transmission data, the second parser is used to parse the frame transmission data; the last frame transmission data among the frames transmission data is the second type transmission data matching the first type transmission data of the Mth frame.

5. The method according to claim 1, characterized in that The M frame is determined by: Determining the number of storage frames of the data buffer according to the storage capacity of the data buffer and the transmission rate of the transmission data stream; A value smaller than the number of stored frames is selected as the M frames.

6. The method according to claim 1, characterized in that The method further comprises: After parsing and obtaining the second type transmission data matching the M frames of the first type transmission data, if it is determined that the first parser does not continue to store the M frames of the first type transmission data into the corresponding data buffer, the second parser is closed.

7. A demultiplexing device for transmission data, characterized in that: The device comprises: A data stream receiving unit, configured to receive a transmission data stream, wherein the transmission data stream includes transmission data of two different data types arranged at intervals; A data parsing unit, configured to parse the transmission data stream using a first parser, obtain a frame of transmission data each time through the parsing, and store the frame of transmission data in a corresponding data buffer, wherein the frame of transmission data is first type transmission data or second type transmission data; A data search unit is used to start a second parser if M frames of first-type transmission data are continuously stored in a corresponding data buffer, and use the second parser to search and parse in the transmission data stream to obtain second-type transmission data that matches the M frames of first-type transmission data; M is a preset natural number.

8. The device according to claim 7, characterized in that The data search unit is specifically used for: Determine a timestamp of a first frame of first type transmission data among the M frames of first type transmission data; Using the second parser to search the transmission data stream for second type transmission data that is located after the M frames of first type transmission data and has the same timestamp as the first frame of first type transmission data, and parse to obtain the second type transmission data; The second parser is used to parse in sequence to obtain the second type transmission data that matches the first type transmission data of other frames in the M frames other than the first frame.

9. A computer-readable storage medium having a computer program stored therein, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.

10. An electronic device, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program executable on the processor, and when the computer program is executed by the processor, the method according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • AVS (audio video standard) audio and video presynchronizing method based on RTP (real time protocol) package

    CN102665141A

  • Method and device of synthesizing audio video data stream

    CN108769786A

  • Audio and video network playing method and device and electronic device

    CN109963184A

  • Audio and video synchronization error determination method and device, electronic equipment and storage medium

    CN111654736A

  • Apparatus and method for synchronizing video and audio mpeg streams in a video playback device

    EP1289306A2