The load simulator and the load simulation system that are used for streaming media service
Technical field
The invention belongs to Computer Multimedia Technology, particularly a kind of implementation method of the load simulator that stream media service system is tested.
Background technology
Streaming Media (Stream Media) is meant the continuous time-base media that uses the stream transmission technology in Internet/Intranet, as audio frequency, video or multimedia file.
Stream media service system can be under network environment, for the user who adopts set-top box, personal computer and other type stream media terminal provides movie-on-demand, live telecast service and other media services.
Stream media service system generally refers to head end (center) system.Generally include important component parts such as streaming media server, certificate server, charging and applied business Management Support System, video acquisition manufacturing terminal system, media content searching system, digital copyright management (DRM), media store and dissemination system.
Wherein streaming media server is the most crucial parts of stream media service system, and its management also transmits a large amount of streaming medium contents.Send the mode of Streaming Media according to it, be divided into clean culture and multicast services again.Need to set up an independent data channel between client and media server, each packet of sending from a station server can only send a client computer to, and this load mode is called clean culture.Each user must distinguish convection media server and send independent inquiry, and streaming media server must send the packet copy of being applied for to each user.The IP multicasting technology makes up a kind of network with multicast-capable, allows router once packet to be copied on a plurality of passages.Adopt the multicast mode, the separate unit server can send continuous data stream simultaneously and not have time-delay hundreds of thousands platform client computer.Streaming media server only need send a packets of information, rather than a plurality of.All send the client of request and share same packets of information.Information can send to the client computer of arbitrary address, reduces the total amount of transmission over networks packets of information.Clean culture and multicast are two kinds of main methods of service that load simulator of the present invention will be accepted.
The load of stream media service system refers to stream media terminal.Common stream media terminal generally includes set-top box, personal computer, mobile phone, palmtop PC, special information terminal etc.Stream media terminal contains a DST PLAYER.It can pass through net connection with head-end system, sends service requests such as movies on demand, and accepts the stream medium data that head-end system sends, and decodes, and plays out Streaming Media in real time.DST PLAYER also has the function of " VCR pattern " remote controller operations such as carrying out F.F., rewind down, time-out, play, stop.It is by these remote controller operation requests are sent to streaming media server, and streaming media server cooperates alternately with DST PLAYER finishes these operations.These operations are main operations of stream media service system load.It also is the main operation that load simulator of the present invention will be simulated.
According to storage of adopting and transmission file format, Streaming Media is divided into MPEG1, MPEG2, MPEG4, Windows Media, Real Media, Quick Time etc. again.
Because Streaming Media transmits by network, stream media service system can be divided into different types again according to the network transportation protocol of Streaming Media.For example, the MMS (Microsoft Media Server) Protocol of Microsoft, http protocol, File Transfer Protocol, RTP and RTSP agreement, RTP and RTCP, UDP and RTSP agreement, RTP and Transmission Control Protocol etc.Different agreements has the advantage of oneself in using towards different emphasis.Load simulator of the present invention is towards RTP and RTSP agreement, and RTP and RTSP agreement can satisfy great majority, common Streaming Media is used.
RTP (Real-time Transport Protocol) be defined as real time datas such as transmission of audio, video, analogue data host-host protocol (referring to RFC 3550:Real TimeTransport Protocol,
Http:// www.ietf.org).Compare with the transition layer protocol of the highly reliable transfer of data of traditional emphasis, RTP stresses real time of data transmission more, and the service that it provides comprises time carrying capacity sign, data sequence, time stamp, transmission control etc.RTP is the standard of IETF (Internet Engineering Task Force) tissue issue.
RTSP (Real Time Streaming Protocol), real-time streaming protocol (referring to RFC2326:Real Time Streaming Protocol,
Http:// www.ietf.org), be the multimedia programming agreement of a client/server form, it can the transmission of control flows media data on IP network, is provided for " VCR pattern " remote control function of audio and video stream simultaneously, as stop, F.F., rewind down and location.Simultaneously RTSP is again an application layer protocol, and being used for provides a whole set of fluidisation service based on Internet with such as the agreement of low layer more such as RTP, RSVP.RTSP also is the standard of IETF issue.
What participate in the stream media technology competition at present in the world mainly is three tame major companies, i.e. RealNetworks company, Microsoft company and Apple company.Their product is each has something to recommend him.
Because the stream media service system complexity, the customer volume that serve is big, and promptly load capacity is big, must have a load simulation system to satisfy debugging test, the system testing of commercial operation phase and maintenance and the user performance assessment test of development process.
The load simulation here, be meant software---stream media service system load simulator (being called for short " load simulator "), operate on one or more computer, simulate the operation and the operation of one or more (even up to a million) set-top box, personal computer and other type stream media terminal, mutual with stream media service system, thus stream media service system (comprising network) is carried out performance test and pressure test.The computer that has moved load simulator software is called the loaded work piece station.
About the load simulator of stream media service system,, up to the present, do not see the product of this respect in China.In the world, have only U.S. Microsoft company openly to issue such product, but there is following subject matter in it: the one, and it only supports the MMS (Microsoft Media Server) Protocol of U.S. Microsoft company oneself, also can only test the streaming media server of Microsoft company oneself; The 2nd, it does not support the data at distributed a plurality of loaded work pieces station to gather and analysis; The 3rd, it does not support hierarchical analysis mechanism as required; The 4th, it does not support the stream media service system that contains a plurality of streaming media servers is tested; The 5th, it can only move at the Windows series platform.
Summary of the invention
An aspect of of the present present invention is characterised in that the load simulator that provides is based on the international standard protocol of IETF issue, such as standard RTP and RSTP agreement.Because RTP and RTSP are the international agreement standards, are used very widely, thereby can be realized test most stream media service systems.And the product of prior art such as Microsoft is only supported the self-developed MMS (Microsoft Media Server) Protocol of Microsoft, then can only test the streaming media server of Microsoft oneself.Technical scheme of the present invention also can realize based on other international standard protocol that is used for the Streaming Media transmission.
Another aspect of the present invention is characterised in that, has simulated a plurality of client terminals in the single loaded work piece station in the load simulator that provides, with a computer realization function of many computers, from this angle, the present invention has improved the performance of computer.
Another aspect of the present invention is characterised in that, the operation when load simulator that provides can be supported distributed a plurality of loaded work pieces station, data gather and analyze, can also be real-time, obtain statistic analysis result automatically.Preferably, can also provide a display workstation, be used to gather and show the data at described distributed a plurality of loaded work pieces station.
Another aspect of the present invention is characterised in that, the load simulator that provides can be supported hierarchical analysis mechanism as required, especially support detailed flow media data packet (such as the RTP bag) to analyze, like this, can obtain the test result of various granularities, to satisfy different application requirements such as performance evaluation, error detection, detection in real time.
Another aspect of the present invention is characterised in that the load simulator that provides can support to have the stream media service system of a plurality of streaming media servers.Because the concurrent load service ability that single streaming media server provides is always limited, having a plurality of streaming media servers in a stream media service system provides service simultaneously, supports more user, and developing direction will be inevitable.Therefore, load simulator support of the present invention is tested important meaning to the stream media service system that contains a plurality of streaming media servers.
Another aspect of the present invention is characterised in that the load simulator that provides has used threading.Because threading is independent of the simulator structure of hardware and is supported by various platforms, agreement, therefore technical scheme of the present invention can realize on such as Windows series platform, Linux platform and Unix platform.
Another aspect of the present invention is characterised in that the load simulator that provides is taked the multithreaded architecture based on three kinds of threads, and has defined the number of every kind of thread, and like this, the stream media terminal number of simulating on separate unit loaded work piece station is more.
One aspect of the present invention provides the load simulator of at least one client that is used for the analog stream media services, this load simulator can be communicated by letter with a streaming media server by a network, described simulator comprises: a shared storage, following three kinds of threads of operation when as follows, the third thread, periodically produce the predetermined request of some clients, and this request is write in the shared storage media content; Second kind of thread, it sends described request according to first-class media communication agreement to streaming media server according to the described request that is written in the described shared storage, and the answer of receiving stream media server is stored in answer in the shared storage then; First kind of thread reads the described answer in the shared storage, agrees described request if reply, and then constantly receives the media content of being asked according to the second circulation New Deal from streaming media server.
The present invention provides a kind of load simulation system that is used for the analog stream media delivery on the other hand, it comprises a load simulator, a stream media service system and a demonstration Control work station, wherein said load simulator can be communicated by letter with demonstration Control work station with stream media service system by network, described stream media service system comprises at least one streaming media server and a dispatching management machine, described load simulator comprises: a shared storage, below three kinds simultaneously the operation threads, the third thread, periodically produce the predetermined request of some clients, and this request is write in the shared storage media content; Second kind of thread, it sends described request according to first-class media communication agreement to stream media service system according to the described request that is written in the described shared storage, and the answer of receiving stream media service system is stored in answer in the shared storage then; First kind of thread reads the described answer in the shared storage, if described request is agreed in described answer, then according to the media content that reception asked of the second streaming media communication agreement from described at least one streaming media server.
Description of drawings
Fig. 1 has shown the structure according to a kind of load simulator of the embodiment of the invention.
Fig. 2 has shown a kind of distributed terminator simulated testing system according to the embodiment of the invention.
Fig. 3 has shown mutual according to the load simulator of the embodiment of the invention and stream media service system.
Fig. 4 has shown the program request flow chart according to the analog stream media termination of the embodiment of the invention.
Fig. 5 has shown the flow chart according to the RTSP thread of the embodiment of the invention.
Fig. 6 has shown the flow chart according to the RTP thread of the embodiment of the invention.
Fig. 7 has shown the flow chart according to the timing thread of the embodiment of the invention.
Embodiment
Fig. 1 has shown the load simulator of feature according to an aspect of the present invention.As shown in Figure 1, the structure of load simulator is the multithreaded architecture under the one process.That is, a load simulator only moves a process on a computer.But having a plurality of threads in this process moves simultaneously.These threads are divided into three types thread by function, first kind of thread that is based on Real-time Transport Protocol, second kind of thread that is based on the RTSP agreement, the third is to be trigger mechanism with the timing, simulate such as " VCR pattern " operation (remote controller operation), test result gather in real time, the test result demonstration and with the thread of other compunication; Wherein, the number of first kind of thread is identical with the number of the stream media terminal that needs simulation, and the number of second kind of thread is one, and the number of the third thread is one or more.
Preferably, load simulator shown in Figure 1 can comprise a shared storage.Here, described shared storage is used for the data sharing between the thread, thereby has realized the data communication between the thread, and described data can comprise management information and media content datas such as various requests, answer, instruction.Described shared storage can be by making the shared array of a plurality of threads, and the internal storage location that perhaps direct shared a slice is distributed is realized.Can certainly use other means to realize data communication between the thread, for example the direct communication technology between the thread of this area existing (Windows, operating systems such as Linux are all supported).But it is simple to adopt a shared storage to realize, clear in structure, and the size of shared storage can be easy to adjust as required.Load simulator can also comprise a controller and a timing device, and when carrying out described simulation test, described controller is controlled above-mentioned three kinds of threads and moved simultaneously.The operation that timing device triggers for various timings provides clock signal regularly.Load simulator can also comprise a display, with video data.Load simulator can also comprise a communication interface with described streaming media server and other devices communicatings.
In first kind of thread, the reception of the Streaming Media bag of the stream media terminal that each thread simulation is corresponding and the broadcast of medium.Described in one embodiment of the invention Streaming Media bag is the RTP bag, and the operation of described first kind of thread is based on Real-time Transport Protocol.Also can adopt other the international standard protocol that is used for media delivery.
In second kind of thread, preferably designed one second thread, simulate the interactive operation of all stream media terminals and stream media service system, in this embodiment, these are operated based on the RTSP agreement, also can adopt his international standard protocol.Why designing single second thread, is in order to reduce the requirement to the operation computer, to have improved the stream media terminal number of simulating on the single computer.Take also can realize technical scheme of the present invention more than one second thread.
The third thread after it is created by a host process, every an official hour at interval, just is triggered operation once for regularly triggering thread.Usually at this kind thread, only a thread need be set.If the fixed time interval that requires is very little, and in fixed time interval, can not finish in proper order all stream media terminals of simulation such as remote controller operation, test result gather in real time, test result shows and during with operation such as other compunication, can be divided into a plurality of threads and realize.
Load simulator takes RTP to wrap hierarchical analysis mechanism as required.Classification as required is meant a stream or many streams of the Streaming Media of simulation, specifies the rank that its () is carried out statistical analysis.Different analysis ranks can provide the test result of different the level of details.
Embodiment is divided into four kinds of RTP bag AGs as shown in the table according to an aspect of the present invention, and promptly Streaming Media stream enlivens and surveys level, bag statistics level, frame integrity analysis level, broadcast level etc., shown in the table 1 specific as follows.It is very useful for the error detection of development phase to play level, and the active detection level of Streaming Media stream can be usually used in routine monitoring and the maintenance of operation stage, and bag statistics level and frame integrity analysis level can be applicable to performance test and pressure test.
Table 1:RTP bag is analyzed classification
Rank |
The level another name |
Function |
Detailed granularity |
A |
The active level of surveying of Streaming Media stream |
Detect which stream and keep active, which stream does not enliven, and causes reason that stream interrupts etc. |
Substantially |
B |
Bag statistics level |
Comprise the A level, add up RTP bag and situations such as RTPS packet loss, LOF simultaneously. |
More detailed |
C |
Frame integrity analysis level |
Comprise the B level, simultaneously situations such as statistics, frame integrality, frame period |
In detail |
D |
Play level |
Comprise the C level,,, carry out statistical analysis and outcome record each RTP bag simultaneously according to the standard-required of playing.The parameter of analyzing comprises the streaming server, media identification, media time parameter, inter-packet gap, frame period, the Bale No. of lost package, the frame number of imperfect frame, the Digital Right Management that RTP wraps of time of reception, stream number, packet number, frame number, service |
The most detailed |
|
|
Information analysis, various mistakes etc. |
|
Why load simulator of the present invention can realize that RTP wraps hierarchical analysis mechanism as required, at first is the load simulator structure Design, especially the just corresponding mechanism of Real-time Transport Protocol thread independently of streaming media data stream.
The distributed terminator simulated testing system of forming by a plurality of load simulation work stations that Fig. 2 has shown that the present invention provides on the other hand, and the data of system gather signal.In the distributed terminator simulated testing system, a plurality of load simulation work stations are arranged, all move a load simulator on each load simulation work station, and a demonstration Control work station, wherein said a plurality of load simulation work stations and demonstration Control work station are by being connected to each other such as a network.Timing thread in each load simulator, according to the regular time interval, at first the detecting information of each stream media terminal that its is simulated is collected in together, then, the test result of carrying out on this load simulation work station gathers, by network test result is mail to one at last and show the Control work station, this demonstration Control work station receives the test result of each load simulation work station, carry out once more gathering of system-wide then, at last final result carried out form demonstration, graphical display, record file and printing.
As shown in Figure 3, the present invention also provides the load simulation implementation method that the stream media service system that contains a plurality of streaming media servers is tested on the other hand.If stream media service system has at a plurality of streaming media servers, for example streaming media server 1,2 ..., m, then offer dispatching management machine of this stream media service system, to carry out load balance and task scheduling, at this moment, load simulator only needs at first to communicate by letter with the dispatching management machine, provides service thereby by the dispatching management machine each fictitious load is distributed and is directed to corresponding streaming media server, and corresponding RTP thread just can be from these corresponding streaming media server reception data; Otherwise, then need with each media program and the address that the streaming media server of this program service is provided, as the input data of simulator.Technical solution of the present invention does not relate to concrete dispatching principle or the algorithm that is adopted, but those skilled in the art can select any known dispatching principle and algorithm as required.
Load simulator and one are as follows towards the mutual mutually flow process of the multithread media server service system with automatic scheduling feature:
(1) the RTSP thread of load simulator is the stream media terminal Ti of simulation, sends a program request (for example film of program request) request by network to stream media service system dispatching management machine;
(2) the dispatching management machine is told the RTSP thread of load simulator, the IP address and the port of the streaming media server of serving for it;
(3) the RTSP thread is gone into stream media terminal Ti with the IP address of streaming media server and port write and is specified addressable internal storage location;
(4) the RTSP thread mails to this streaming media server with order request;
(5) streaming media server begins to send media data with the RTP packet form; While, Ti RTP thread read the IP address and the port of this streaming media server from internal memory, just began the RTP bag that the receiving stream media server is sent.
Fig. 4 has shown feature according to an aspect of the present invention, the flow chart of the process of the movies on demand by a stream media terminal of load simulator simulation:
At first finish the foundation and the initialization (step S401) of various threads, a simulation process is set by a host process of system.At step S402, a timing triggers thread information such as film sign and " opening-play " order is write " shared storage " (a step S403).A RISP thread is read " shared storage " (step S404), if find new order, then arrives step S405, otherwise returns step S403.At step S405, the RTSP thread finds that from " shared storage " some stream media terminals have a newer command, and then it will order the form according to the RTSP agreement, send to stream media service system through network.At step S406, stream media service system confirms that the identity of its executable operations is qualified and checking film sign is correct, RTSP order specifies a streaming media server to serve for after the effective order, and the address of the streaming media server of this appointment is sent back to load simulator.At step S407, the RTSP thread of load simulator writes " shared storage " with the streaming media server address that receives.At step S408, constantly accept the RTP packet from the streaming media server of described appointment corresponding to the RTP thread of described stream media terminal.At step S409, the RTP bag AG according to appointment carries out data analysis, and Measurement results is constantly write in " shared storage ".At step S410, described timing thread gathers calculating to the test analysis of all Media Streams at interval according to regular time, be presented on the screen, and/or record hereof, and/or is sent to other equipment.At step S411, check whether the simulation test time of load simulator finishes, if then arrive step S412, the end simulation process.If do not finish as yet, then arrive step S413, constitute the RTSP order by the timing thread, and write " shared storage ", return step S403 then.
Fig. 5 has shown the workflow diagram of the RTSP thread of feature according to an aspect of the present invention:
After host process was finished the establishment of RTSP thread, at step S501, the RTSP thread was read shared storage, and whether check has new order (step S502).If there is not new order, then return step S501.At step S503, find a newer command of some stream media terminals from shared storage, should order according to RTSP protocol format, be sent to stream media service system through network.At step S504, check whether streaming media server has response.If no, error message is write shared storage (step S506).If response is arranged, then the response message that receives is write shared storage (step S505).At step S507, the RTSP thread is read shared storage, and whether check has EOT order (S508).If have, end simulation process (step S509) then.If no, then return step S501.
Fig. 6 has shown the workflow diagram of a RTP thread according to an aspect of the present invention.
Host process is finished after the establishment of a plurality of RTP threads, and the operation of each RTP thread is as follows.At step S601, obtain the IP address and the port of streaming media server from shared storage.At step S602, receive the RTP bag.At step S603, check whether new packet is arranged.If do not have, then return step S602 and continue to receive.If new packet is arranged, then carry out such as bag decoding, bag statistics, frame statistics, frame integrity analysis, error statistics at step S604.At step S605, statistical information and error message are write shared storage and log file.At step S606, the RTP thread is read shared storage, to watch whether EOT order (S607) is arranged.If have, then arrive step S608, the end simulation process.
Fig. 7 has shown the workflow diagram of timing thread according to an aspect of the present invention.
Main thread is finished the regularly establishment of thread, and regularly triggers this thread.At step S701, regularly thread is read statistical summaries test data, the log file of shared storage.At step S702,, perhaps send to a display workstation with the local demonstration of summarized results.At step S703, produce operational order, and write shared storage such as the VCR pattern.At step S704, check whether the simulation test time finish, if do not finish then return step S701.If finish, then arrive step S705, the EOT order is write shared storage, indication RTP thread and RTSP thread are deactivated.