CN106230839A - The acceptance control method of Real Time Streaming and device - Google Patents

The acceptance control method of Real Time Streaming and device Download PDF

Info

Publication number
CN106230839A
CN106230839A CN201610633869.9A CN201610633869A CN106230839A CN 106230839 A CN106230839 A CN 106230839A CN 201610633869 A CN201610633869 A CN 201610633869A CN 106230839 A CN106230839 A CN 106230839A
Authority
CN
China
Prior art keywords
data
control command
media data
thread
digital independent
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201610633869.9A
Other languages
Chinese (zh)
Other versions
CN106230839B (en
Inventor
王雄才
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hisense Broadband Multimedia Technology Co Ltd
Original Assignee
Hisense Broadband Multimedia Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hisense Broadband Multimedia Technology Co Ltd filed Critical Hisense Broadband Multimedia Technology Co Ltd
Priority to CN201610633869.9A priority Critical patent/CN106230839B/en
Publication of CN106230839A publication Critical patent/CN106230839A/en
Application granted granted Critical
Publication of CN106230839B publication Critical patent/CN106230839B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/1066Session management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/30003Arrangements for executing specific machine instructions
    • G06F9/30076Arrangements for executing specific machine instructions to perform miscellaneous control operations, e.g. NOP
    • G06F9/3009Thread control instructions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/30098Register arrangements
    • G06F9/3012Organisation of register space, e.g. banked or distributed register file
    • G06F9/30123Organisation of register space, e.g. banked or distributed register file according to context, e.g. thread buffers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/40Support for services or applications
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/60Network streaming of media packets
    • H04L65/65Network streaming protocols, e.g. real-time transport protocol [RTP] or real-time control protocol [RTCP]

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Business, Economics & Management (AREA)
  • General Business, Economics & Management (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The disclosure discloses acceptance control method and the device of a kind of Real Time Streaming.Described method includes: the data receiving channel that control command receiving or sending thread self is triggered after carrying out digital independent in exclusive Real Time Streaming;Carry out data receiver by exclusive data receiving channel, data also exist media data;In the data receiver carried out, control command receiving or sending thread is controlled the reading of order and media data, and buffered media data waits that digital independent thread reads;Complete the data receiving channel that during reading of control command, release is exclusive.Control command receiving or sending thread carries out the reading of media data and control command, this media data is cached, to wait that digital independent thread reads, and then the situation of the digital independent generation data perturbation carried out when same data receiving channel under multi-thread mechanism receives media data and control command can be prevented effectively from, it is ensured that digital independent thread and control command receiving or sending thread can read the most required data.

Description

The acceptance control method of Real Time Streaming and device
Technical field
It relates to transmission control technology field, particularly to acceptance control method and the dress of a kind of Real Time Streaming Put.
Background technology
Real Time Streaming, the data that i.e. application RTSP agreement (Real Time Streaming Protocol) is realized Transmission, mainly by the control of RTSP protocol realization media data transmission, this is that the application layer in media data transmission realizes. And in the Internet of media data transmission, (Transmission Control Protocol, transmission controls to be all based on greatly TCP Agreement), UDP (User Datagram Protocol, UDP) or other agreement carry out.
In the transmission of media data, the data transmitted, except media data itself, further comprises the biography of control command Defeated.And in media data transmission based on Transmission Control Protocol, for receiving terminal, the control command that it is carried out reads and matchmaker Volume data reads and is both for what same port was carried out, i.e. control command and media data is received by same port, therefore needs Be controlled the reading of order and media data at same port, this has occurred as soon as control command and media data mixed transport , i.e. there is the data interlacing described in RTSP standard in situation.
Existing RTSP agreement realizes being based on single-threaded mechanism in the transmission of media data.Under single-threaded mechanism, Execution process is relatively simple, it is only necessary to order carries out digital independent.Such as, when reading media data, it is only necessary to according to The RTSP standard regulation to interleaving data, from the beginning of a specific character, parses data length, long according to the data parsed Degree reads corresponding data.
But, when multithreading, the above-mentioned process that realizes will lose efficacy, and then cause the situation of data perturbation to occur.
Concrete, owing to control command and media data are all at same port, the most same data receiving channel transmits, Perform during media data reads at the thread being responsible for carrying out media data reading, if server returns control life Order, then cannot read media data, but read control command.
Now, for being responsible for being controlled the thread that order is read, it will read the control returned less than server Order, the situation that the most just result in data perturbation in system occurs.
Summary of the invention
In order to solve the technical problem of the data perturbation occurred when multithreading present in correlation technique performs digital independent, Present disclose provides acceptance control method and the device of a kind of Real Time Streaming.
A kind of acceptance control method of Real Time Streaming, including:
The data receiver that control command receiving or sending thread self is triggered after carrying out digital independent in exclusive Real Time Streaming Passage;
Carry out data receiver by exclusive described data receiving channel, described data also exist media data;
In the data receiver carried out, described control command receiving or sending thread carries out the reading of described control command and media data Take, cache described media data and wait that digital independent thread reads;
Complete during the reading of described control command, to discharge described exclusive data receiving channel.
A kind of receiving control device of Real Time Streaming, including:
Order receiving or sending thread monopolizes module, self is triggered for control command receiving or sending thread exclusive after carrying out digital independent Data receiving channel in Real Time Streaming;
Data reception module, for carrying out data receiver by exclusive described data receiving channel, deposits in described data At media data;
Reading cache module, in the data receiver carried out, described control command receiving or sending thread carries out described control Order and the reading of media data, cache described media data and wait that digital independent thread reads;
Exclusive release module, has been used for during the reading of described control command discharging described exclusive data receiving channel.
Embodiment of the disclosure that the technical scheme of offer can include following beneficial effect:
In the data receiver of Real Time Streaming, self it is triggered at control command receiving or sending thread and carries out digital independent After, this control command receiving or sending thread, by the data receiving channel in exclusive Real Time Streaming, is led to by exclusive data receiver Road carries out data receiver, along with the carrying out of data receiver, receives media data by inevasible in data receiving channel, And the control command required for control command receiving or sending thread, to this, on the one hand control command receiving or sending thread carries out media data With the reading of control command, on the other hand, this media data is cached, to wait that digital independent thread reads, at this just Same data receiving channel under multi-thread mechanism can be effectively prevent and receive each thread when media data and control command, i.e. The situation of the digital independent generation data perturbation that control command receiving or sending thread and data read line journey are carried out, and then ensure same number According to when receiving channel reception to media data and control command, digital independent thread and control command receiving or sending thread can read To the most required data.
It should be appreciated that it is only exemplary that above general description and details hereinafter describe, can not be limited this Open.
Accompanying drawing explanation
Accompanying drawing herein is merged in description and constitutes the part of this specification, it is shown that meet the enforcement of the present invention Example, and in description together for explaining the principle of the present invention.
Fig. 1 is the schematic diagram according to the implementation environment involved by the disclosure;
Fig. 2 is the block diagram according to a kind of device shown in an exemplary embodiment;
Fig. 3 is the flow chart of the acceptance control method according to a kind of Real Time Streaming shown in an exemplary embodiment;
Fig. 4 is the flow chart being carried out data reception step by exclusive data receiving channel in Fig. 3 correspondence embodiment;
Fig. 5 be in Fig. 3 correspondence embodiment in the data receiver carried out, control command receiving or sending thread is controlled order With the reading of media data, buffered media data waits the flow chart of digital independent thread read step;
Fig. 6 is according to the existing forms schematic diagram of data in the data transmission shown in an exemplary embodiment;
Fig. 7 is the flow chart of the acceptance control method according to a kind of Real Time Streaming shown in an exemplary embodiment;
Fig. 8 is the form schematic diagram according to the media data shown in an exemplary embodiment;
Fig. 9 is to perform schematic diagram according to order in the data receiver shown in an exemplary embodiment;
Figure 10 is according to the ideal model schematic diagram of digital independent under the multi-thread mechanism shown in an exemplary embodiment;
Figure 11 is to show according to the digital independent being unsatisfactory for ideal model under the multi-thread mechanism shown in an exemplary embodiment It is intended to;
Figure 12 is according to the digital independent schematic diagram under the multi-thread mechanism shown in an exemplary embodiment;
Figure 13 is the work reading thread according to the control command receiving or sending thread shown in an exemplary embodiment and media data Make process schematic;
Figure 14 is the work reading thread according to the control command receiving or sending thread shown in an exemplary embodiment and media data Make the sequential chart of process;
Figure 15 is to read thread according to the control command receiving or sending thread shown in another exemplary embodiment and media data The sequential chart of work process;
Figure 16 is the receiving control device according to a kind of Real Time Streaming shown in an exemplary embodiment;
Figure 17 is the block diagram of the data reception module of Figure 16 correspondence embodiment;
Figure 18 is the block diagram reading cache module of Figure 16 correspondence embodiment;
Figure 19 is the block diagram of the receiving control device according to a kind of Real Time Streaming shown in an exemplary embodiment.
Detailed description of the invention
Here in detail exemplary embodiment will be performed explanation, its example represents in the accompanying drawings.Explained below relates to During accompanying drawing, unless otherwise indicated, the same numbers in different accompanying drawings represents same or analogous key element.Following exemplary embodiment Described in embodiment do not represent all embodiments consistent with the present invention.On the contrary, they are only with the most appended The example of the apparatus and method that some aspects that described in detail in claims, the present invention are consistent.
Fig. 1 is the schematic diagram according to the implementation environment involved by the disclosure.This implementation environment includes: at least one data connects Receiving end 110 and server 130.
Interrelational form between data receiver 110 and server 130, including network associate mode and/or the association of hardware View, and the data association mode come and gone therebetween.
Fig. 2 is the block diagram according to a kind of device 200 shown in an exemplary embodiment.Such as, device 200 can be Fig. 1 Data receiver 110 in shown implementation environment.Data receiver 110 can be such as Set Top Box and the broadcasting of intelligent television Device etc..
With reference to Fig. 2, device 200 can include following one or more assembly: processes assembly 202, memorizer 204, power supply Assembly 206, multimedia groupware 208, audio-frequency assembly 210, sensor cluster 214 and communications component 216.
Process assembly 202 and generally control the integrated operation of device 200, such as with display, call, data communication, phase The operation etc. that machine operation and record operation are associated.Process assembly 202 and can include that one or more processor 218 performs Instruction, to complete all or part of step of above-mentioned method.Additionally, process assembly 202 can include one or more module, Be easy between process assembly 202 and other assemblies is mutual.Such as, process assembly 202 and can include multi-media module, with convenient Multimedia groupware 208 and process between assembly 202 mutual.
Memorizer 204 is configured to store various types of data to support the operation at device 200.Showing of these data Example includes any application program for operating on the device 200 or the instruction of method.Memorizer 204 can be by any kind of Volatibility or non-volatile memory device or combinations thereof realize, such as static RAM (SRAM), electrically erasable Except programmable read only memory (EEPROM), Erasable Programmable Read Only Memory EPROM (EPROM), programmable read only memory (PROM), read only memory (ROM), magnetic memory, flash memory, disk or CD.In memorizer 204, also storage has one Or multiple module, these one or more modules are configured to be performed by these one or more processors 218, to complete following execution All or part of step in method shown in Fig. 3, Fig. 4, Fig. 5 and Fig. 7 are arbitrary.
The various assemblies that power supply module 206 is device 200 provide electric power.Power supply module 206 can include power management system System, one or more power supplys, and other generate, manage and distribute, with for device 200, the assembly that electric power is associated.
The screen of one output interface of offer that multimedia groupware 208 is included between described device 200 and user.One In a little embodiments, screen can include liquid crystal display (LCD) and touch panel (TP).If screen includes touch panel, screen Curtain may be implemented as touch screen, to receive the input signal from user.Touch panel includes one or more touch sensing Device is with the gesture on sensing touch, slip and touch panel.Described touch sensor can not only sense touch or sliding action Border, but also detect the persistent period relevant to described touch or slide and pressure.
Audio-frequency assembly 210 is configured to output and/or input audio signal.Such as, audio-frequency assembly 210 includes a Mike Wind (MIC), when device 200 is in operator scheme, during such as call model, logging mode and speech recognition mode, mike is joined It is set to receive external audio signal.The audio signal received can be further stored at memorizer 204 or via communication set Part 216 sends.In certain embodiments, audio-frequency assembly 210 also includes a speaker, is used for exporting audio signal.
Sensor cluster 214 includes one or more sensor, for providing the state of various aspects to comment for device 200 Estimate.Such as, what sensor cluster 214 can detect device 200 opens/closed mode, the relative localization of assembly, sensor group Part 214 can also detect device 200 or the position change of 200 1 assemblies of device and the variations in temperature of device 200.At some In embodiment, this sensor cluster 214 can also include Magnetic Sensor, pressure transducer or temperature sensor.
Communications component 216 is configured to facilitate the communication of wired or wireless mode between device 200 and other equipment.Device 200 can access wireless network based on communication standard, such as WiFi, 2G or 3G, or combinations thereof.An exemplary enforcement In example, communications component 216 receives the broadcast singal from external broadcasting management system or broadcast related information via broadcast channel. In one exemplary embodiment, described communications component 216 also includes near-field communication (NFC) module, to promote junction service.Example As, can be based on RF identification (RFID) technology in NFC module, Infrared Data Association (IrDA) technology, ultra broadband (UWB) technology, Bluetooth (BT) technology and other technologies realize.
In the exemplary embodiment, device 200 can be by one or more application specific integrated circuits (ASIC), numeral letter Number processor (DSP), digital signal processing appts (DSPD), PLD (PLD), field programmable gate array (FPGA), controller, microcontroller, microprocessor or other electronic components realize, be used for performing following method.
Fig. 3 is the flow chart of the acceptance control method according to a kind of Real Time Streaming shown in an exemplary embodiment. The acceptance control method of this Real Time Streaming is used for the data receiver 110 shown in Fig. 1.As it is shown on figure 3, this real-time streaming passes Defeated acceptance control method, can be performed by data receiver 110, may comprise steps of.
In the step 310, exclusive Real Time Streaming after control command receiving or sending thread self is triggered and carries out digital independent In data receiving channel.
Wherein, the control command receiving or sending thread of indication can be that in data receiver, arbitrary needs is controlled order reading Thread.Data receiving channel in Real Time Streaming for realize media data transmission in Real Time Streaming and with Media data transmission control command transmission alternately.It is to say, the data of transmission are intertexture in data receiving channel Data.
After a control command receiving or sending thread is triggered execution data read process, this control command receiving or sending thread application number According to the control of reception passage, with exclusive data receiving channel.
Concrete, control command receiving or sending thread is triggered after execution data read process, first carries out request for data reception The control of passage asks exclusive data receiving channel, then judges the exclusive the most successful, if not becoming of data receiving channel Merit, then proceed the application of data receiving channel control, until exclusive data receiving channel.
For this control command receiving or sending thread having monopolized data receiving channel, subsequent data reception can be led to by it In road, the data of transmission are read out;And for other thread, will be prohibited to carry out the read operation of data, the most right The execution that thread-data reads provides protection.
In one exemplary embodiment, in data receiver, the line data in data receiving channel can being read out Journey is multiple, and substantially can be divided into two big classes, and one is control command receiving or sending thread, and two is digital independent thread.Control life Making receiving or sending thread is for obtaining the thread of control command in data receiver, and media data reads thread and is responsible for obtaining media The thread of data.
At this it should be noted that in the Real Time Streaming that carried out of data receiver, the thread of operation includes controlling Order receiving or sending thread and media data read the big class of thread two, and the quantity of each class thread can need to carry out spirit according to actual operation Live and adjust.
In a step 330, carry out data receiver by exclusive data receiving channel, these data also exist media number According to.
Wherein, in the Internet at exclusive data receiving channel place, the data of server transport are received.For exclusive number For control command receiving or sending thread according to reception passage, it is in order to obtain control command from data receiving channel.
But, the data receiving channel that control command receiving or sending thread is monopolized, it is before receiving control command, The most inevasible receiving media data, therefore, the data receiving channel monopolized at control command transceiver channel is entered In the data receiver of row, there is the reception of media data.
In step 350, in the data receiver carried out, control command receiving or sending thread is controlled order and media data Reading, buffered media data wait digital independent thread read.
Wherein, control command receiving or sending thread will read Internet, i.e. its data receiving channel monopolized and be received and obtain Data.It should be understood that in the Real Time Streaming carried out during control command receiving or sending thread monopolizes data receiving channel, The data received, on the one hand include media data, and the control command transmitted subsequently;On the other hand, these data received It is media data, it addition, these data received can also is that control command.
It follows that during control command receiving or sending thread monopolizes data receiving channel, it may appear that same data receiver leads to Road is sequentially received the scene of media data and control command, and under this scene, control command receiving thread will be controlled life Order and the reading of media data, and cache the media data of reading.
In step 370, the data receiving channel that during reading of control command, release is exclusive is completed.
Wherein, perform the thread of digital independent, i.e. control command receiving or sending thread and complete the reading of its control command carried out After taking, discharge exclusive data receiving channel immediately, in order to other thread can carry out the reading of data.
In the reception of Real Time Streaming as above controls, each thread alternately data receiving channel only Account for, so realize its in data receiving channel to receive data reading, thus data receiving channel is alternately present For media data and control command, it is possible to realize the orderly reading of Various types of data, and formed when carrying out digital independent Protection mechanism it also avoid thread self and originally need the data read to be read to walk by other thread, control under multi-thread mechanism Data receiver properly functioning.
Fig. 4 is the description carried out according to the details to step 330 shown in an exemplary embodiment.Thread is control command Receiving or sending thread, as shown in Figure 4, step 330, may comprise steps of.
In step 331, sending request by control command receiving or sending thread, request waits for data when being sent and connects Receive the reception of data in passage.
Wherein, control command receiving or sending thread is for realizing the reading of control command in data receiving channel.Control command is also Non-server actively sends, but needs after server sends request, can receive this request of server response and The control command returned.In one exemplary embodiment, to server send request in carry transmission command method, with It is easy to server this is responded.
Concrete, that control command receiving or sending thread is made requests on by data transmitting channel transmission, at data transmitting channel Middle realize the data receiver transmission to the request of server.
In step 333, carrying out data receiver at data receiving channel, the data of reception include the control command of request.
Wherein, when server sends data, data receiving channel all will carry out the reception of data.Reception in these data In, owing to control command thread have sent request to server, the data that therefore data receiving channel receives contain clothes The control command that business device is responded request and sent.
Thus it will be clear that for control command receiving or sending thread, at its data receiving channel carried out Time exclusive, completing the transmission of request and the reception of control command, whole transmission request is until receiving the whole mistake of control command Journey has been carried out protection, and is not restricted to receive this stage of control command.
If this is because go request for data to receive the control of passage the most again, in the feelings that application is failed Under condition, the control command of server response is the most very likely read by other thread, and then causes mistake.
Therefore, when control command receiving or sending thread needs the reading being controlled order, it should realize before request sends Monopolizing of data receiving channel, and then avoid the generation of data read errors.
Additionally, the ratio that the data volume shared by Qing Qiu is shared by whole Real Time Streaming is extremely low, major part is media Data, and server to request response speed be exceedingly fast, therefore, send request until receiving the whole process of control command The of short duration of the data receiving channel carried out is monopolized, and can't impact for program feature.
Embodiment corresponding to Fig. 3 is combined, it is provided that control command transmitting-receiving line in data receiver in Fig. 4 correspondence embodiment The process that Cheng Shixian control command receives.Data receiver also exists one or more control command receiving or sending thread, at Fig. 3 Corresponding embodiment provides control command receiving or sending thread and realizes the flow process that realizes of control command reception, and right in Fig. 4 institute The realization of data receiver after data receiving channel exclusive in Fig. 3 is provided more detailed concrete real by the embodiment answered Show, and then the digital independent realized by control command receiving or sending thread provides guarantee.
Fig. 5 is the description carried out according to the details to step 350 shown in an exemplary embodiment.Transmission data are for controlling Order, as it is shown in figure 5, step 350, may comprise steps of.
In step 351, along with the reception of data in data receiving channel, it is judged that whether the data of reception are media number According to, if it has not, then perform step 353, if it has, then perform step 355.
Wherein, foregoing, the data receiving channel that control command receiving or sending thread is monopolized, its number received According to, include the control command that server response asks to be returned.
Server is that control command thread is controlled to the transmission of control command, and i.e. control command thread is to service After device have sent request, this just can be responded by server, to return control command;For media data, it is by taking Business device actively sends to data receiver.
It follows that even if control command receiving or sending thread has monopolized data receiving channel, data receiving channel still may be used The media data that server actively sends can be received.It is to say, data receiving channel received data, including controlling life Order, in addition, may also include media data.
When control command receiving or sending thread is controlled the reading of order, it is necessary first to identify media data in the data received Existence, and then the media data that on the one hand will exist for digital independent thread caching, on the other hand be only the reading of control command Take.
In one exemplary embodiment, it is judged that whether the data of reception are that media data can initiateing according to media data Character realizes.
In media data, it is $ (0x24) that first character, i.e. leader are known, and therefore, finds first in the received data Character is $ (0x24), then the data at this character place are media data.
In step 353, it is controlled the reading of order.
Wherein, monopolize the control command receiving or sending thread of data receiving channel after have sent request to server, with In data receiving channel, receive control command, for control command receiving or sending thread, be directly controlled order Read.
In one exemplary embodiment, the bebinning character of control command is a specific character, such as, with the character of R switch, Such as RTSP**, and control command terminates with new line, i.e. and CRLF is end mark, therefore, can be according to controlling life Bebinning character and the end mark of order find the data corresponding to control command in the received data, and then are read out Come.
In step 355, buffered media data waits that digital independent thread reads.
Wherein, for the existence of media data in the data receiving channel that control command receiving or sending thread is monopolized, also will enter The reading of row media data, and cache this media data.
It is to say, for the media data arriving data receiving channel prior to control command, control command receiving or sending thread Cross-thread read and caches, to avoid occurring the situation of data read errors, also ensure that media data reads thread follow-up The digital independent carried out.
In one exemplary embodiment, control command receiving or sending thread is when reading out media data, by media data cache To FIFO (First Input First Output, FIFO) queue, to realize the pre-cache of media data, and at FIFO Under the effect of queue, improve subsequent media digital independent thread and carry out the efficiency of media data lookup.
In one exemplary embodiment, it is according to media data that the media data that control command receiving or sending thread is carried out reads In initial character carry out, the follow-up all digital independent that will start with character $ (0x24) are complete.
Should further illustrate at this, in data receiving channel receive data, although be control command and Media data intertexture exists, but is not to mix, i.e. control command and media data is to intersect but is that independent completion exists 's.
Fig. 6 is according to the existing forms schematic diagram of data in the data transmission shown in an exemplary embodiment.As shown in Figure 6 , media data 410 and control command 430 are the partial data sections of separate existence.In media data 410, character $ (0x24) it is its leader and knows 411.In control command 430, bebinning character is with the character of R beginning, i.e. RTSP/1.0 200OK。
Therefore, control command receiving or sending thread, for the data in data receiving channel, can know 411 realizations according to its leader The reading of media data 410, it is also possible to realize the reading of control command 430 according to the character started with R.
In the embodiment that Fig. 3 and Fig. 4 is realized, in conjunction with the embodiment corresponding to Fig. 5, in control command receiving or sending thread institute The data receiving channel carried out is exclusive with in the reading realization of data in data receiving channel, is entered by control command receiving or sending thread The control command of row reads to provide and implements, and the intertexture existence being media data and control command in the data of reception carries Supply the process that realizes reading control command and the process to existing media data, and then realized under multi-thread mechanism The control command of control command receiving or sending thread reads.
Fig. 7 is the flow chart of the acceptance control method according to a kind of Real Time Streaming shown in an exemplary embodiment. Being triggered, to carry out the thread of digital independent be that media data reads thread, as it is shown in fig. 7, the reception of this Real Time Streaming controls Method, may comprise steps of.
In step 510, after digital independent thread self is triggered and carries out digital independent, it may be judged whether there is the matchmaker of caching Volume data, if it has, then perform step 530, if it has not, then perform step 550.
Wherein, foregoing, control command receiving or sending thread is when its exclusive data receiving channel, for existing in data Media data, carried out reading and caching process, in follow-up digital independent, read the media of caching for other thread Data.
Media data reads thread and carries out media data reading in data receiving terminal, so that media data is supplied to phase The application answered.Therefore, media data reading thread is triggered when carrying out digital independent, will first determine whether the media data of caching In, if there is its required media data, if it is present need not read from data receiving channel, but directly Connect the media data reading caching.
In step 530, the media data of caching is read.
Wherein, after judging the media data obtaining having there is caching, media data reads thread and directly carries out media The reading of data, now will need not exclusive data receiving channel, it is not required that carry out data in data receiving channel Read.
In step 550, digital independent thread monopolizes the data receiving channel in Real Time Streaming.
Wherein, if there is not media data in Huan Cun to read the media data corresponding to thread, then need to count According to the application of reception passage control, with exclusive data receiving channel, and then side is capable of media number in data receiving channel According to reading.
By mode as above, under multi-thread mechanism, read thread for media data in data receiver provide What media data read realizes process.During realizing at this, media data reads thread and control command receiving or sending thread is mutual Coordinate so that the reception of media data and control command is read and will not be got muddled, and then is also not result in data read errors Situation occur.
Here, by Fig. 7 correspondence embodiment, the media data reading thread constituted at Fig. 1 and Fig. 1 and Fig. 5 is carried out In the embodiment that media data reads, provide for media data read step and implement, and then by enforcement corresponding for Fig. 7 In example, solving under multi-thread mechanism, media data reads the carrying out of thread read operation relative to media data, prior to reaching several During according to reception passage, the reading problem of media data, and then the media data reading that media data thread is carried out can Under multi-thread mechanism properly functioning.
Additionally, combine Fig. 4 with Fig. 5 to be distinguished corresponding embodiment, under the multi-thread mechanism of data receiver, it is provided that What media data reading thread and control command receiving or sending thread cooperated implements, and ensures to interweave under multi-thread mechanism with this The reading of data, prevent data-crosstalk, it is to avoid system in case of system halt or media decoder are abnormal.
In acceptance control method according to a kind of Real Time Streaming shown in an exemplary embodiment, step 370 it After, the acceptance control method of this Real Time Streaming, it is also possible to comprise the following steps.
Judge whether the digital independent that media data reading thread is carried out terminates, if it has not, then return step 510, if It is yes, then terminates.
Wherein, also needing to proceed if reading the digital independent that carried out of thread at media data, i.e. yet suffering from The media data not read, the most now, aforementioned for return described media data is read thread and carries out the realization of digital independent Process, i.e. returns step 510.
Understand in conjunction with embodiment corresponding for Fig. 1 with Fig. 7, read thread at media data and need nonetheless remain for carrying out media data reading When taking, first return step 510 is carried out the judgement of the media data cached, if for media data reads thread, There is not the media data of caching, then need to be realized by exclusive data receiving channel the reading of media data.
Distinguished corresponding embodiment by Fig. 3, Fig. 4, Fig. 5 with Fig. 7, achieved multi-thread mechanism for data receiving terminal Lower control command receiving or sending thread and media data read thread and cooperate the reading of carried out interleaving data, are i.e. controlling life The control command and the media data that make receiving or sending thread and media data read between thread interlaced transmission realize the accurate of data Read, thus will improve reliability and efficiency that under multi-thread mechanism, interleaving data reads.
Below will be with data receiver as Set Top Box, as a example by server is RTSP server, in conjunction with concrete application scenarios, retouch State the acceptance control method of this Real Time Streaming.
The transmission of media data is carried out based on its agreement such as TCP, UDP or RTP/RTCP, and its transmission control is then By real-time streaming protocol, i.e. RTSP protocol realization.
Corresponding transmission means concrete example is as shown in the table:
Transmission means Explanation
MP2T/TCP Use TCP directly to carry MPEG2-TS, do not use RTP encapsulation
MP2T/UDP Use UDP directly to carry MPEG2-TS, do not use RTP encapsulation
MP2T/RTP/TCP RTP based on TCP is used to carry MPEG2-TS
MP2T/RTP/UDP RTP based on UDP is used to carry MPEG2-TS
Wherein, MPEG2 represents the audio and video data streams of TS stream format, and MPEG2-TS is the data stream of transmission, i.e. media Data.
Here, with Transmission Control Protocol for illustrating.
In media data transmission based on Transmission Control Protocol, control command is also to use Transmission Control Protocol to realize, and i.e. controls life Order and media data use same port, and i.e. for data receiver, control command and media data are present in same TCP number According to receiving passage, there is the mixed transport of control command data and media data.
In transmission realizes, by sending the request carrying transmission command method to RTSP server, control with this The transmitting-receiving process of control command;And for media data transmission, then server actively sends,
In RTSP standard, for carrying out the mode of media data carrying based on TCP, it is allowed to control command and media data Interweaving, the most all transmitted by TCP, to realize penetrating of fire wall, Fig. 8 is according to the media number shown in an exemplary embodiment According to form, media data contains 0x24 leader know 411.
The transmission of control command and media data is carried out interting, therefore, for data receiver, i.e. and Set Top Box institute The process performed, will be also that order performs.Such as, Fig. 9 is according to suitable in the data receiver shown in an exemplary embodiment Sequence performs schematic diagram, and i.e. reading media data 610, transmission request 630 and reading control command 650 is that order performs.
According to the execution process in embodiment illustrated in fig. 9, under multi-thread mechanism, say as a example by two threads at this Bright, ideal model as shown in Figure 10 will be obtained.
In Fig. 10, the longitudinal axis represents the task of execution, and transverse axis is time shaft, represents that CPU time slice runs axle.Can from Figure 10 Know, if the segmentation of CPU time slice, just carry out according to the complete cycle of one-off, then consistent, no with under single-threaded scene Can come into question.
But, it practice, owing to the distribution of CPU time slice is to be determined by the dispatching algorithm of operating system, not completely Ideal model can be met, herein it is possible to there will be the result shown in Figure 11.
In fig. 11, media data 1 and media data 2 are one group of complete data, but are divided into 2 CPU time slice Perform, and the reading of the transmission asked and control command is also partitioned into 2 CPU time slice and performs.
On this basis, further regard to Figure 12, if CPU time slice does change shown in Figure 12, read media data 1 He Read in the CPU time slice between media data 2, also insert the control command that server returns, and then media data 1, control Order and media data 2 receive conduits weave at same tcp data and exist.
Owing to control command is between media data 1 and media data 2, if media data reads thread and performs reading After media data 1, server returns control command, now, media data read thread read obtain may the most not It is media data, but control command;And for control command receiving or sending thread, read to walk owing to media data reads thread Control command, the most also will not read control command, and then cause system disorders, and then also results in later stage command character solution Analysis is abnormal, even crashes or media decoder is abnormal.
Accordingly, it would be desirable to realize in media data transmission based on disclosure Fig. 3, embodiment that Fig. 4, Fig. 5 are corresponding with Fig. 7 Receive and control, and then the accurate reading of media data and control command can be realized under many mechanism.
Figure 13 is to control process according to the reception of Real Time Streaming under the multi-thread mechanism shown in an exemplary embodiment Flow chart.
Control command receiving or sending thread illustrated in fig. 13 represents and performs the class thread that control command reads in Set Top Box, Media data reads thread and then represents the class thread performing media data reading in Set Top Box.
According to the embodiment corresponding to Fig. 3 and Fig. 4, control command receiving or sending thread will perform step 810 to shown in step 840 Process, the transmission made requests on when exclusive tcp data receives passage and the reception of control command.
According to the embodiment shown in Fig. 5, control command receiving or sending thread, by being made whether to exist the judgement of media data, is i.e. sentenced Whether disconnected data are to start with 0x24, perform step 850 to 870 processes crossed.
When reading media data, it is deposited into fifo queue.
For media data read thread, its be triggered carry out digital independent time, will realize corresponding to Fig. 1 and Fig. 7 Embodiment.
Concrete, perform step 910, first determine whether whether fifo queue exists its required media data read, If it has, then directly this media data is read to applying, i.e. step 920.
If it is not, exclusive tcp data receives passage, perform step 930 and step 940.Now, by exclusive Tcp data receives channel reception media data, and media data reads thread and directly reads from tcp data reception passage.
Here, by the process shown in Figure 13 so that control command receiving or sending thread and media data read thread and mutually join Close, it is achieved the interleaving data under multi-thread mechanism reads.
Further, embodiment illustrated in fig. 13 corresponding time program process as shown in Figure 14 and Figure 15.
In the embodiment shown in fig. 13, control command receiving or sending thread and media data read thread and perform the suitable of digital independent Sequence does not set, but needs to perform respectively digital independent according to actual motion.
Therefore, Figure 14 shows that control command receiving or sending thread reads thread prior to media data and performs digital independent, and is Media data reads thread and has carried out the cross-thread pre-cache of media data.
Now, media data reads thread and is not required to receive passage reading media data from tcp data, and only from FIFO Queue reading media data.
Figure 15 shows that media data reads thread and performs the time program process of digital independent prior to control command receiving or sending thread, In the process, the pre-cache of media data, therefore, media data read line are not carried out due to control command receiving or sending thread Journey needs to receive passage reading media data at exclusive tcp data.
It is disclosure device embodiment below, may be used for performing the reality that the disclosure above-mentioned data receiving terminal 110 performs Time stream transmission acceptance control method embodiment.For the details not disclosed in disclosure device embodiment, refer to these public affairs Open the acceptance control method embodiment of Real Time Streaming.
Figure 16 is the block diagram of the receiving control device according to a kind of Real Time Streaming shown in an exemplary embodiment.Should The receiving control device of Real Time Streaming may be used in the data receiver 110 of implementation environment shown in Fig. 1, performs Fig. 3 institute The Overall Steps of the acceptance control method of the Real Time Streaming shown.As shown in figure 16, the reception of this Real Time Streaming controls Device includes but not limited to: order receiving or sending thread is monopolized module 1210, data reception module 1230, read cache module 1250 and Exclusive release module 1270.
Order receiving or sending thread monopolizes module 1210, exclusive after order receiving or sending thread self is triggered ground oyster digital independent Data receiving channel in Real Time Streaming.
Data reception module 1230, for carrying out data receiver by exclusive data receiving channel, also exists in data Media data.
Reading cache module 1250, in the data receiver carried out, control command receiving or sending thread is controlled order With the reading of media data, buffered media data waits that digital independent thread reads.
Exclusive release module 1270, has been used for the data receiving channel that during reading of control command, release is exclusive.
Figure 17 is the description carried out according to the details to data reception module shown in an exemplary embodiment.These data connect Receive module 1230, as shown in figure 17, include but not limited to: request transmitting unit 1231 and reception performance element 1233.
Request transmitting unit 1231, for sending request by control command receiving or sending thread, when this request is sent etc. The reception of data in pending data receiving channel.
Receiving performance element 1233, for carrying out data receiver at data receiving channel, the data of reception include request Control command and media data.
Figure 18 is the description carrying out the details reading cache module shown according to an exemplary embodiment.This reading caches Module 1250, as shown in figure 18, includes but not limited to: media data judging unit 1251, buffer unit 1253 and order are read Unit 1255.
Media data judging unit 1251, for along with the reception of data in data receiving channel, it is judged that the data of reception Whether it is media data, if it has, then notice buffer unit 1253, if it has not, then notification command reads unit 1255.
For buffered media data, buffer unit 1253, waits that digital independent thread reads.
Unit 1255 is read in order, for being controlled the reading of order.
Figure 19 is the block diagram of the receiving control device according to a kind of Real Time Streaming shown in an exemplary embodiment.Should The receiving control device of Real Time Streaming, as shown in figure 19, includes but not limited to: digital independent thread trigger module 1310, Caching read module 1330 and data read line journey monopolize module 1350.
Digital independent thread trigger module 1310, self is triggered for described digital independent thread and carries out digital independent After, it may be judged whether there is the media data of caching, if it has, then notice caching read module 1330, if it has not, then notify data Read thread and monopolize module.

Claims (10)

1. an acceptance control method for Real Time Streaming, including:
The data receiving channel that control command receiving or sending thread self is triggered after carrying out digital independent in exclusive Real Time Streaming;
Carry out data receiver by exclusive described data receiving channel, described data also exist media data;
In the data receiver carried out, described control command receiving or sending thread carries out the reading of described control command and media data, Cache described media data and wait that digital independent thread reads;
Complete during the reading of described control command, to discharge described exclusive data receiving channel.
Method the most according to claim 1, it is characterised in that described carry out data by exclusive data receiving channel and connect The step received includes:
Sending request by described control command receiving or sending thread, described request waits for described data receiver and leads to when being sent The reception of data in road;
Carrying out data receiver at described data receiving channel, the data of described reception include control command and the media number of request According to.
Method the most according to claim 1, it is characterised in that described in the data receiver carried out, described control command Receiving or sending thread carries out the reading of described control command and media data, caches described media data and waits that digital independent thread reads Step include:
Along with the reception of data in data receiving channel, it is judged that whether the data of described reception are media data, if it has, then slow Deposit described media data and wait that digital independent thread reads, if it has not, then
Carry out the reading of described control command.
Method the most according to claim 1, it is characterised in that described method also includes:
Described digital independent thread self is triggered after carrying out digital independent, it may be judged whether there is the media data of caching, if It is then to read the media data of described caching.
Method the most according to claim 4, it is characterised in that described method also includes:
When determining the media data that there is not caching, described digital independent thread monopolizes the data in described Real Time Streaming Receive passage.
6. the receiving control device of a Real Time Streaming, it is characterised in that including:
Order receiving or sending thread monopolizes module, self is triggered for control command receiving or sending thread exclusive real-time after carrying out digital independent Data receiving channel in stream transmission;
Data reception module, for carrying out data receiver by exclusive described data receiving channel, also exists in described data Media data;
Reading cache module, in the data receiver carried out, described control command receiving or sending thread carries out described control command With the reading of media data, cache described media data and wait that digital independent thread reads;
Exclusive release module, has been used for during the reading of described control command discharging described exclusive data receiving channel.
Device the most according to claim 6, it is characterised in that described data reception module includes:
Request transmitting unit, for sending request by described control command receiving or sending thread, waits when described request is sent Carry out the reception of data in described data receiving channel;
Receiving performance element, for carrying out data receiver at described data receiving channel, the data of described reception include request Control command and media data.
Device the most according to claim 6, it is characterised in that described reading cache module includes:
Media data judging unit, for along with the reception of data in data receiving channel, it is judged that whether the data of described reception For media data, if it has, then notice buffer unit, if it has, then notification command reads unit;
Buffer unit, is used for caching described media data and waits that digital independent thread reads;
Unit is read in order, for carrying out the reading of described control command.
Device the most according to claim 6, it is characterised in that described device also includes:
Digital independent thread trigger module, self is triggered for described digital independent thread after carrying out digital independent, it is judged that be The no media data that there is caching, if it has, then notice caching read module;
Described caching read module is for reading the media data of described caching.
Device the most according to claim 9, it is characterised in that described device also includes:
Digital independent thread monopolizes module, and in time determining the media data that there is not caching, described digital independent thread is only Account for the data receiving channel in described Real Time Streaming.
CN201610633869.9A 2016-08-03 2016-08-03 Receiving control method and device for real-time streaming transmission Active CN106230839B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610633869.9A CN106230839B (en) 2016-08-03 2016-08-03 Receiving control method and device for real-time streaming transmission

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610633869.9A CN106230839B (en) 2016-08-03 2016-08-03 Receiving control method and device for real-time streaming transmission

Publications (2)

Publication Number Publication Date
CN106230839A true CN106230839A (en) 2016-12-14
CN106230839B CN106230839B (en) 2020-02-07

Family

ID=57546951

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610633869.9A Active CN106230839B (en) 2016-08-03 2016-08-03 Receiving control method and device for real-time streaming transmission

Country Status (1)

Country Link
CN (1) CN106230839B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108089468A (en) * 2018-01-11 2018-05-29 尚健静 A kind of medical examination equipment control sequential visualized generation method
CN110058947A (en) * 2019-04-26 2019-07-26 海光信息技术有限公司 The exclusive release method and relevant apparatus of spatial cache
CN111510759A (en) * 2020-03-17 2020-08-07 视联动力信息技术股份有限公司 Video display method, device and readable storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103065098A (en) * 2011-10-24 2013-04-24 联想(北京)有限公司 Access method and electronic device
CN103257888A (en) * 2012-02-16 2013-08-21 阿里巴巴集团控股有限公司 Method and equipment for concurrently executing read and write access to buffering queue
US20140075091A1 (en) * 2012-09-10 2014-03-13 Texas Instruments Incorporated Processing Device With Restricted Power Domain Wakeup Restore From Nonvolatile Logic Array
CN104714792A (en) * 2013-12-17 2015-06-17 腾讯科技(深圳)有限公司 Multi-process shared data processing method and device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103065098A (en) * 2011-10-24 2013-04-24 联想(北京)有限公司 Access method and electronic device
CN103257888A (en) * 2012-02-16 2013-08-21 阿里巴巴集团控股有限公司 Method and equipment for concurrently executing read and write access to buffering queue
US20140075091A1 (en) * 2012-09-10 2014-03-13 Texas Instruments Incorporated Processing Device With Restricted Power Domain Wakeup Restore From Nonvolatile Logic Array
CN104714792A (en) * 2013-12-17 2015-06-17 腾讯科技(深圳)有限公司 Multi-process shared data processing method and device

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108089468A (en) * 2018-01-11 2018-05-29 尚健静 A kind of medical examination equipment control sequential visualized generation method
CN110058947A (en) * 2019-04-26 2019-07-26 海光信息技术有限公司 The exclusive release method and relevant apparatus of spatial cache
CN111510759A (en) * 2020-03-17 2020-08-07 视联动力信息技术股份有限公司 Video display method, device and readable storage medium
CN111510759B (en) * 2020-03-17 2023-10-13 视联动力信息技术股份有限公司 Video display method, device and readable storage medium

Also Published As

Publication number Publication date
CN106230839B (en) 2020-02-07

Similar Documents

Publication Publication Date Title
US11271803B2 (en) Method and apparatus for extending service capabilities in a communication network
US20150046830A1 (en) Methods, Device and Social Network Manager for Enabling Interaction with Another Device
US10789452B2 (en) Method and system for aggregating video content
CN106230839A (en) The acceptance control method of Real Time Streaming and device
CN107690077A (en) The method and apparatus for monitoring net cast interim card
CN105656739A (en) Method and device for batch configuration of Internet of things devices
CN106101825A (en) A kind of method and apparatus of terminal monitoring
US10944829B2 (en) Methods, systems, and devices for multiplexing service information from sensor data
CN105515834A (en) Equipment management system, method and device
CN106559707A (en) Video quality detection method, device and Quality management center
CN104683865B (en) A kind of channels ARC setting method and equipment
CN110121114A (en) Send the method and data transmitting equipment of flow data
WO2015137740A1 (en) Home network system using robot and control method thereof
CN103491119A (en) Airsharing system and airsharing method
CN109714221A (en) The determination method, apparatus and system of network packet
CN104735473A (en) Video stream playing detection method and device
CN104462570A (en) Webpage content obtaining method and device
CN104168605A (en) Data transmission control method and apparatus
CN105404201A (en) Intelligence control system of refrigerator and intelligent control method thereof
EP3325116A1 (en) Method and telecommunications network for streaming and for reproducing applications
CN112104893A (en) Video stream management method and device for realizing plug-in-free playing of webpage end
JP2008160732A (en) Communication system and method of providing information for its fault detection
CN105516746B (en) Video preprocessor download system and its method
CN108958057A (en) Control method and device of household appliance, storage medium and electronic device
CN110225395A (en) Programme content methods of exhibiting, STB terminal and program management system

Legal Events

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