CN109510838A - Port starts method and apparatus - Google Patents

Port starts method and apparatus Download PDF

Info

Publication number
CN109510838A
CN109510838A CN201811577850.2A CN201811577850A CN109510838A CN 109510838 A CN109510838 A CN 109510838A CN 201811577850 A CN201811577850 A CN 201811577850A CN 109510838 A CN109510838 A CN 109510838A
Authority
CN
China
Prior art keywords
port
queue
idle
busy
range
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
CN201811577850.2A
Other languages
Chinese (zh)
Other versions
CN109510838B (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.)
Beijing Wondersoft Technology Co Ltd
Original Assignee
Beijing Wondersoft 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 Beijing Wondersoft Technology Co Ltd filed Critical Beijing Wondersoft Technology Co Ltd
Priority to CN201811577850.2A priority Critical patent/CN109510838B/en
Publication of CN109510838A publication Critical patent/CN109510838A/en
Application granted granted Critical
Publication of CN109510838B publication Critical patent/CN109510838B/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/60Network streaming of media packets
    • H04L65/65Network streaming protocols, e.g. real-time transport protocol [RTP] or real-time control protocol [RTCP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer And Data Communications (AREA)

Abstract

The embodiment of the invention provides a kind of ports to start method and apparatus, this method comprises: receiving stream media agency's starting request;Start in response to the streaming cache proxy and request, according to preconfigured idle port range, idle port queue and busy port queue, obtain first port, wherein the idle port queue, the busy port queue original state be sky;Start the first port and the next second port adjacent with the first port;If any one port in the first port and the second port starts failure, it then continues to execute described according to preconfigured idle port range, idle port queue and busy port queue, the step of obtaining first port, until the first port and the second port start success.The present invention is able to ascend the starting efficiency of the proxy port of streaming media, and promote streaming media act on behalf of efficiency, and reduces network delay.

Description

Port starts method and apparatus
Technical field
The present invention relates to field of computer technology, start method and apparatus more particularly to a kind of port.
Background technique
Streaming Media refers to the media formats continuously played in real time on network using streaming technology, such as audio, video Or multimedia file.Stream medium data generally uses Real-time Transport Protocol (real-time transport protocol, Real-time Transport Protocol it) is transmitted.Real-time Transport Protocol is based on udp protocol and carries out point-to-point transmission, Gu it is transmitted between different networks When, it needs to carry out agency's forwarding to it, network can be penetrated, reaches final purpose address.
When the stream medium data to Real-time Transport Protocol format carries out agency's forwarding, first have to do is exactly streaming media transmission Required Real-time Transport Protocol port and rtcp protocol (Real-time Transport Control Protocol, real-time Transmission control Agreement) port starting work, the two ports be two adjacent UDP (User Datagram Protocol, user data Datagram protocol) port.Wherein, RTP message uses low port, and RTCP message uses high port.
The Starting mode of the current port RTP and the port RTCP are as follows: then one port RTP of random start first will open The port numbers of the dynamic port RTP (transmitting the udp port of RTP message) add 1, i.e., (transmit RTCP message to the port RTCP Udp port) started.If the port RTCP is occupied, closes the port RTP and restart (one end RTP of random start again Mouthful), and so on, until the straight cause port RTCP successfully starts up.
So it is this use the port RTP random start, RTCP port binding starting mode when, if streaming cache proxy service Device has only acted on behalf of Media Stream all the way, caused by influence also to be subjected to (because Streaming Media only needs to occupy two ports, institute all the way It is less with occupied port).But streaming cache proxy server need to generally act on behalf of multipath media stream, and all per Streaming Media all the way It needs to start two continuous udp ports, along with the occupied port of other programs on streaming cache proxy server, will make It is greatly increased at the probability of port starting conflict, causing port to restart repeatedly can just successfully start up, and greatly affected stream matchmaker Body proxy server streaming media acts on behalf of efficiency, and increases network delay.
Summary of the invention
The present invention provides a kind of ports to start method and apparatus, is deposited with the port starting scheme of solution in the related technology Because the proxy port starting failure rate of Streaming Media it is high, caused streaming cache proxy low efficiency and network delay is high asks Topic.
To solve the above-mentioned problems, according to an aspect of the present invention, the invention discloses a kind of ports to start method, packet It includes:
Receiving stream media agency's starting request;
Start in response to the streaming cache proxy and request, according to preconfigured idle port range, idle port queue And busy port queue, obtain first port, wherein the idle port queue, the busy port queue just Beginning state is sky;
Start the first port and the next second port adjacent with the first port;
If any one port in the first port and the second port starts failure, described is continued to execute According to preconfigured idle port range, idle port queue and busy port queue, the step of obtaining first port, directly Start success to the first port and the second port.
According to another aspect of the present invention, the invention also discloses a kind of port starters, comprising:
First receiving module, for receiving stream media agency's starting request;
First obtains module, requests for starting in response to the streaming cache proxy, according to preconfigured idle port Range, idle port queue and busy port queue obtain first port, wherein the idle port queue, described non- The original state of idle port queue is sky;
Starting module, for starting the first port and the next second port adjacent with the first port;
Described first obtains module, if any one port being also used in the first port and the second port is opened Dynamic failure is then proceeded to respond to start in the streaming cache proxy and be requested, according to preconfigured idle port range, idle port Queue and busy port queue obtain first port, until the first port and the second port start at Function.
Compared with prior art, the present invention includes the following advantages:
In this way, the embodiment of the present invention is configured by port that is in advance that application program is seldom or will not occupying in idle port In range, then after the streaming cache proxy starting request for receiving Streaming Media all the way, it can be according to preconfigured idle end Mouth range (i.e. available port range) and idle port queue and busy queue, flow matchmaker for acting on behalf of this to obtain all the way Then the first port of body starts the first port, and the next port adjacent with the first port, i.e. second port, Due to two port references for acting on behalf of Streaming Media idle port range and two queues of starting, so as to ensure two The starting success rate of port, occupied possibility is smaller, even if also, any one port it is occupied, then can continue to hold The method that row obtains first port, then reacquires first port, can find faster the first port that can start and Second port, promotes the efficiency of acting on behalf of of streaming media, and reduces network delay.
Detailed description of the invention
Fig. 1 is a kind of step flow chart of starting embodiment of the method in port of the invention;
Fig. 2 is the step flow chart of starting embodiment of the method in another port of the invention;
Fig. 3 is the step flow chart of starting embodiment of the method in another port of the invention;
Fig. 4 is a kind of work flow diagram of Video transmission system embodiment of the invention;
Fig. 5 is a kind of structural block diagram of port starter embodiment of the invention.
Specific embodiment
In order to make the foregoing objectives, features and advantages of the present invention clearer and more comprehensible, with reference to the accompanying drawing and specific real Applying mode, the present invention is described in further detail.
Referring to Fig.1, a kind of step flow chart of starting embodiment of the method in port of the invention is shown, can be applied to flow Media proxy server, this method can specifically include following steps:
Step 101, receiving stream media agency starting request;
Wherein, streaming cache proxy starting request indicates that request streaming cache proxy server carries out generation to Streaming Media all the way Reason, which may include request address information, i.e. the address information of the Streaming Media on streaming media server all the way;In addition, The request can also include receiving port information, that is, request the client of the road Streaming Media to the receiving end message of the road Streaming Media Breath.
Wherein, Streaming Media includes but is not limited to audio, video or multimedia file, hereinafter in order to make it easy to understand, with generation The Streaming Media of transmission is managed to be illustrated for video data.
Step 102, start in response to the streaming cache proxy and request, according to preconfigured idle port range, free time Port queue and busy port queue obtain first port;
Wherein, in embodiments of the present invention, in order to all the way or multiple stream medium datas carry out efficiently agency transmission, The method for providing the port on the efficient starting streaming cache proxy server of one kind can use in embodiments of the present invention The mode of predistribution starts two ports for acting on behalf of Streaming Media all the way, i.e., the end UDP of RTP message (is transmitted in the port RTP Mouthful) and the port RTCP the udp port of RTCP message (transmit), rather than random fashion in the related technology starts two ends Mouthful.
Specifically, the embodiment of the present invention can be pre-configured with port range, each port in the port range is all The udp port that will not or seldom be occupied by other programs on streaming cache proxy server, then being based on the preconfigured free time Port range, to start two continuous udp ports therein, so that it may greatly reduce starting for proxy video stream A possibility that port and other programs port collision currently in use.
Wherein, preconfigured idle port range may include one or more port sections, each port section packet Include at least two continuous udp ports.
Such as the preconfigured idle port range includes [1,100], [105,107], [109,110] match in advance The idle port set includes No. 1 to No. 100 port, No. 105 to No. 107 ports and 109 to No. 110 ports.
Wherein, the first port obtained here is a port within the scope of above-mentioned idle port, also, the free time end It further include port numbers in mouthful range is that the port numbers of the first port add 1 adjacent second port.
Wherein, after step 101, can create original state is empty (i.e. there is no data) two queues, one Queue is referred to as idle port queue, another queue is referred to as busy port queue.
Wherein, idle port queue, for storing the port RTP having acted on behalf of stream medium data and being in close state, Rather than idle port queue is used to store acting on behalf of stream medium data and is being in the port RTP of starting state;
So start request in response to the streaming cache proxy that for example video data is acted on behalf of all the way, it can be with According to preconfigured idle port range, the idle port queue and busy port queue, belong to obtain one Udp port within the scope of the idle port, the udp port are denoted as first port.Wherein, first port refers to transmission RTP message Udp port also known as the port RTP.
Since each udp port within the scope of the preconfigured idle port is all seldom to be occupied by other application Udp port, therefore, the probability that the first port obtained here is in idle condition are high.
Optionally, in order to avoid after configuring the idle port range, which is mounted with newly again Application program, cause the application program to occupy one or more ports within the scope of the idle port when running, this In the case of kind, in order to avoid the influence of the port starting efficiency to the embodiment of the present invention.
In one embodiment, can also include: according to the method for the embodiment of the present invention
After configuring the idle port range, if detecting the application program newly installed, the application program pair is obtained The third port (can be according to the priori data of the application program, to determine which udp port is the application program often use) answered;It will The third port is deleted from the idle port range.
Then, after deleting third port, if the idle port range further include it is adjacent with the third port, And the 4th port that port numbers add one or subtract one for the port numbers of the third port, also, the idle port range does not include The fifth port that adjacent and port numbers add one or subtract one with the 4th port for the port numbers of the 4th port, then by the 4th Also it is deleted from the idle port range port.
On the contrary, if after third port is deleted, if the idle port range further includes and the third port The 4th port that adjacent and port numbers add one or subtract one for the port numbers of the third port, also, the idle port range packet Include the port numbers fifth port that adds one or subtract one that and port numbers adjacent with the 4th port are the 4th port, then not into Any processing of row.
By above-mentioned steps, the update to the idle port range may be implemented.
Such as No. 106 ports in above-mentioned idle port range are third port, then No. 105 and No. 107 ports are all the Four ports, it is clear that do not include No. 104 ports within the scope of the idle port, also do not include No. 108 ports, therefore, by No. 106 After port is deleted, adjacent thereto No. 105 and No. 107 ports be also not present with the respectively continuous port of adjacent and port numbers, Therefore, No. 105 and No. 107 can not be as distribution to the port of streaming cache proxy, thus by the two from the idle port model Interior deletion is enclosed, is reduced because of influence of the installation application program to the port starting efficiency of streaming cache proxy of the present invention.
Optionally, in order to avoid after configuring the idle port range, which has unloaded application Program, and the application program is corresponding with common port, then in order to keep the port within the scope of idle port more abundant, Promote port starting efficiency.
In one embodiment, can also include: according to the method for the embodiment of the present invention
After configuring the idle port range, if detecting, mounted application program is unloaded, and is obtained this and is unloaded It corresponding 6th port of the application program of load (can be normal come the application program that determines according to the priori data of the application program With which udp port);If continuous at least two port of port-for-port No. the 6th, or, if the port numbers of the 6th port It is continuous with the port numbers of a port within the scope of the idle port, then the 6th port is added to the idle port Range.
Such as the common port of application program of unloading is No. 108 ports, and No. 108 ports are in for example preconfigured sky There are No. 107 and No. 109 ports that port numbers are adjacent thereto in not busy port range, therefore, which can be supplemented To within the scope of the idle port.
Idle port range is updated due to it is noted, of course, that the embodiment of the present invention is for the installation because of application program The step of, and due to the unloading of application program more like idle port range the step of execution sequence with no restrictions.Two implementations The step of example, can achieve the purpose that be updated the port numbers within the scope of idle port.
Step 103, start the first port and the next second port adjacent with the first port;
Such as the preconfigured idle port range includes [1,100], [105,107], [109,110], here the Single port is No. 1 port, then this step need to start No. 1 port and port numbers add 1 No. 2 ports (second port).
It should be noted that the next second port adjacent with first port limited here, need be port numbers with The port numbers of first port are adjacent, such as No. 2 adjacent with No. 1, and the port numbers of second port are that the port numbers of first port add 1。
Step 104, if any one port in the first port and the second port starts failure, continue to hold Row step 102, until the first port and the second port start success.
Wherein, since pre-set idle port range is that application program is seldom on streaming cache proxy server or will not The port of occupancy, therefore, under normal circumstances, the two ports all will not be occupied.
But if after configuring the idle port range, if being mounted with new answer on streaming cache proxy server With program, or because of other reasons, causes some port within the scope of the idle port occupied, then there can be this step The case where there are the starting failures of at least one port in the first port and second port.So in this case, then Need to continue to execute above-mentioned steps 102, to obtain another first port, it should be noted that again when step 102, Then to obtain first port, such as No. 3 ports can be obtained, directly in such a way that the port numbers for the first port that the last time obtains add 2 Start success to first port and second port, i.e. two ports are not all occupied.
It should be noted that combining idle port range and free time since the present embodiment is when obtaining first port Port queue and busy port queue, therefore, in first port and second port the reason of any one port starting failure It will not be the proxied another way video flowing at least one port in two ports and occupy.
Such as video flowing 1 occupies No. 5 ports and No. 6 ports all the way, then receives agency's starting of video flowing all the way again After request, when obtaining first port, No. 5 ports will not be obtained.
In this way, the embodiment of the present invention is configured by port that is in advance that application program is seldom or will not occupying in idle port In range, then after the streaming cache proxy starting request for receiving Streaming Media all the way, it can be according to preconfigured idle end Mouth range (i.e. available port range) and idle port queue and busy queue, flow matchmaker for acting on behalf of this to obtain all the way Then the first port of body starts the first port, and the next port adjacent with the first port, i.e. second port, Due to two port references for acting on behalf of Streaming Media idle port range and two queues of starting, so as to ensure two The starting success rate of port, occupied possibility is smaller, even if also, any one port it is occupied, then can continue to hold The method that row obtains first port, then reacquires first port, can find faster the first port that can start and Second port, promotes the efficiency of acting on behalf of of streaming media, and reduces network delay.
Referring to Fig. 2, the step flow chart of starting embodiment of the method in another port of the invention is shown, specifically can wrap Include following steps:
S201, receiving stream media agency's starting request;
Referring in particular to step 101, which is not described herein again.
S202 starts in response to the streaming cache proxy and requests, and judges whether idle port queue is empty;
Wherein, be under the idle port queue original state it is empty, i.e., streaming media server this booting after, do not connect also Any streaming cache proxy starting request was received, did not acted on behalf of any Streaming Media;Alternatively, acting on behalf of one or more Streaming Media Data.
If so, S203 obtains first end according to preconfigured idle port range and busy port queue Mouthful;
Wherein, busy port queue is used to store acting on behalf of stream medium data and is being in starting state The port RTP (i.e. first port), therefore, can be identified according to the busy port queue within the scope of the idle port those first Port is in the starting state for acting on behalf of Streaming Media, then obtaining first for acting on behalf of the Streaming Media all the way of the present embodiment When port, so that it may within the scope of the idle port, except the first port within the busy port queue, and with the team In the port range except the corresponding second port of first port in column, obtain current embodiment require that the first port used.
Such as busy port queue is stored with No. 1 port, No. 3 ports.So here when obtaining first port, so that it may To include [1,100] in the preconfigured idle port range, [105,107] in [109,110], remove No. 1~No. 4 ends Mouthful, it obtains new port range [5,100], [105,107], [109,110], available the is obtained in the new port range Single port, still, the first port obtained here need in the new port range to there are port numbers adjacent thereto to add 1 Second port.
Optionally, it when executing S203, can be realized by method shown in Fig. 3:
S301 judges whether busy port queue is empty;
If so, S302 identifies continuous two ports of port numbers according to preconfigured idle port range;
Wherein, if idle port queue be it is empty, and busy port queue be it is empty, then illustrate what this was received Streaming cache proxy starting request is the first streaming cache proxy starting request received after streaming cache proxy server is switched on, so It only needs by means of the preconfigured idle port range, to identify continuous two ports of port numbers.Such as it can be with From the idle port range [1,100], [105,107], the identification continuous any two port of port numbers is in [109,110] Can, such as can be No. 1 and No. 2 ports, No. 5 and No. 6 ports, 106 and No. 107 ports etc., it is not listed here.
If it is not, then S303 according to the busy port queue identifies busy target first port;According to preparatory The idle port range of configuration identifies that and port numbers adjacent with the target first port are greater than the target first port Target second port;Within the scope of preconfigured idle port, identification removes the target first port and the target second Continuous two ports of port numbers except port;
Wherein, if idle port queue is empty, and busy port queue is non-empty, then can be according to the non-empty Not busy port queue, to identify the target first port currently occupied because Streaming Media is acted on behalf of, wherein the target first end All first ports that mouth can be understood as storing in the busy port queue (such as No. 1 port and No. 3 ports are just occupied With);Then, within the scope of the preconfigured idle port, identify that and port numbers adjacent with No. 1 port are greater than No. 1 mesh Second port, i.e. No. 2 ports are marked, and identify that and port numbers adjacent with No. 3 ports are greater than the target second end of No. 2 ports Mouthful, i.e. No. 4 ports;Then, within the scope of the preconfigured idle port ([1,100], [105,107], [109,110]), Identify continuous two ports of port numbers in addition to 1~No. 4 port, two ports here can be except 1~No. 4 port Except the continuous any two port of port numbers, such as can be No. 5 and No. 6 ports, No. 98 and No. 99 ports, 105 and No. 106 Port etc. is not listed here.
After S302 or S303, S304 obtains described two lesser first ports of port middle-end slogan.
So whether S302 or S303 can be recognized within the scope of preconfigured idle port not by other The proxy requests of road Streaming Media and the two continuous ports occupied only need to obtain the two port middle ports recognized here Number lesser first port.Such as two ports that S302 or S303 are recognized are No. 105 and No. 106 ports, then obtain here No. 105 ports, as the port RTP for responding the streaming cache proxy starting request that this is received.
In this way, in embodiments of the present invention, when idle port queue is empty, the method for the embodiment of the present invention can be non- Idle port queue be empty or two kinds of non-empty in the case of, in conjunction with the data in busy port queue, from preconfigured The idle port that other not proxied road Streaming Medias occupy accurately is recognized within the scope of idle port, is used for generation to obtain The first port of Li Benlu Streaming Media can not only be occupied to avoid the port RTP and the port RTCP got by other programs, Port punching is reduced in the port that the Streaming Media for other branches that the first port got can also be avoided not acted on behalf of occupies A possibility that burst is raw improves the starting efficiency of the port RTP, the port RTCP.
If it is not, then S204, obtains first port from the idle port queue;
Wherein, if idle port queue be not it is empty, i.e., its be stored with had acted on behalf of stream medium data and in closing The port RTP (first port) of state.
That is, each first port in the idle port queue is selected within the scope of the preconfigured idle port The port being in idle condition, and acted on behalf of other branches Streaming Media and pent first port.So the idle port Any one first port in queue is all available, therefore it may only be necessary to obtain any one end from the idle port queue Mouth, i.e. first port.
S205 starts the first port and the next second port adjacent with the first port;
Wherein it is possible to which the port numbers for starting the first port and first port add 1 second port.
S206, judges whether the first port and the second port start successfully;
That is, it is judged that whether any one port in two ports is occupied by other programs.
If it is not, then executing S202;
Wherein, at least one port is occupied if it exists, then executes S202, restarts next group of first port and second Port.
If so, S207, is written the busy port queue for the first port;
Wherein, if two ports start success, the of this branch stream medium data can successfully be acted on behalf of by starting Single port is written in busy port queue, and the first port is avoided to be used to act on behalf of the stream medium data of other branches.
Optionally, if so, S208, starts according to the streaming cache proxy and request, the first session id is identified;
It wherein, may include session id, the corresponding stream matchmaker of the Streaming Media of different branch in streaming cache proxy starting request Session id in body agency's starting request is different.
Optionally, S209 establishes the first port and the second port, is associated with pass with first session id System;
Wherein, due to the first port and second port that start here, for acting on behalf of streaming cache proxy starting request pair Therefore the Streaming Media all the way answered can establish the incidence relation of the first port and second port and first session id.
S210, receiving stream media act on behalf of turn-off request;
Wherein, when streaming cache proxy server uses first port and second port by the video all the way on video server After being streamed to video request person, that is, complete the factorage that corresponding Streaming Media all the way is requested in streaming cache proxy starting Afterwards, it can receive streaming cache proxy turn-off request.
Optionally, which can also carry session id, and the session id and above-mentioned Streaming Media start The session id that request carries is identical.
That is, for entrained by the streaming cache proxy starting request of same branch Streaming Media and streaming cache proxy turn-off request Session id is identical.
S211 closes the first port and the second port in response to the streaming cache proxy turn-off request, and The idle port queue is written into the first port, and the first port is deleted from the busy port queue It removes.
Wherein, after the factorage of Streaming Media all the way needs to close, then it can not only close and act on behalf of the road Streaming Media The first port for acting on behalf of the road Streaming Media can also be written in idle port queue by first port and second port, with And the first port for acting on behalf of the road Streaming Media is deleted from busy port queue.
In this way, therefore the embodiment of the present invention is in view of the agency that streaming cache proxy server needs to do multichannel Streaming Media Make multichannel stream medium data high efficiency of transmission, needs efficiently to start the multi-channel port on streaming cache proxy server, it is specific logical It crosses and judges whether idle port queue and busy port queue are sky, to use different strategies to obtain available first end Mouthful, and in the case where the first port and second port for acting on behalf of Streaming Media all the way start successful situation, will start the Single port is written busy port queue, and when in response to streaming cache proxy turn-off request to the road Streaming Media, by this First port is deleted from busy port queue, and is written into idle port queue, by the management to available port, and In first port, i.e. timely release port resource improves so that the agency of subsequent Streaming Media uses when RTP agency closes The service efficiency of port resource.
Optionally, the method includes S208 and S209 the step of in the case where, when executing S211, can by with Lower S401~S405 is realized:
S401 identifies the second session id according to the streaming cache proxy turn-off request;
S402, identification and the associated first port of second session id and second port;
Wherein, the session due to the first port and second port for acting on behalf of Streaming Media all the way, with the Streaming Media all the way ID has been set up incidence relation, therefore, can with the corresponding session id of Direct Recognition streaming cache proxy turn-off request, and identify with The associated first port of the session id and second port.
Such as streaming cache proxy server is acting on behalf of two-way Streaming Media, session id 1 and No. 1 port of Streaming Media 1 and No. 2 Port association;Session id 2 and No. 3 port of Streaming Media 2 and No. 4 port associations.
Here the session id that streaming cache proxy service is closed in request is ID2, then can recognize No. 3 ports and No. 4 ports.
S403 closes the first port and the second port;
Here No. 3 ports and No. 4 ports can be closed.
The idle port queue will be written with the associated first port of second session id in S404, and will be with institute The associated first port of the second session id is stated to delete from the busy port queue;
S405 deletes the incidence relation of the first port and the second port and second session id.
Wherein it is possible to which No. 3 ports are written to idle port queue, and No. 3 ports are deleted from busy port queue It removes.
Wherein, the present invention for S403 and S404 execution sequence with no restrictions, S405 has been performed both by S403 and S404 At executing again later.
In this way, the embodiment of the present invention is by establishing two ports after starting agency all the way two ports of Streaming Media With the incidence relation of the session id of the road Streaming Media, and close the road Streaming Media agency service when, utilize the incidence relation It closes two ports for acting on behalf of the road Streaming Media, and the first port in two ports is deleted from busy port queue, And be added in idle port queue, finally, the incidence relation of two ports and the session id is deleted, so that closing certain road When the agency service of the Streaming Media of branch, corresponding two ports can be accurately closed, avoid that other branch streams will be acted on behalf of The case where two port shutdowns of media, by effective management to available port and unavailable port, to be promoted to multi-way stream Media act on behalf of efficiency.
Port based on the above embodiment starts method, and the embodiment of the invention also provides a kind of Video transmission systems, should System is as shown in figure 4, include front-end client, front end streaming cache proxy server, rear end streaming cache proxy server and video Server.
Wherein, front-end client, front end streaming cache proxy server are located in outer net, rear end streaming cache proxy server and Video server is in Intranet, and Intranet belongs to safety zone, and outer net belongs to public domain.The video server of Intranet is stored with Interior video, the embodiment of the invention provides a kind of video transmission methods, obtain video data from the video server of Intranet To outer net.
Due to the isolation between Intranet and outer net there is information, pass through two unidirectional gateway (1 Hes of gateway here Gateway 2) Lai Shixian Intranet and outer net information exchange.
As shown in figure 4, the video transmission method of the embodiment of the present invention may include steps of:
S51, front-end client send video request to front end streaming cache proxy server;Also, front-end client is opened No. 1000 ports come prepare receive video data;
Wherein, video request includes the port numbers of receiving port --- 1000 and video server on requested mesh Mark the location information A of video file)
The video request is forwarded to rear end streaming cache proxy service via gateway 1 by S52, front end streaming cache proxy server Device;
S53, rear end streaming cache proxy server after the video request for receiving front end, a really conversation message, First determine whether the conversation message is the information for indicating request video, i.e. video request namely above-mentioned port starting method is real The starting request of streaming cache proxy described in example is applied, if it is, starting method using above-mentioned port to start rear end Streaming Media generation The first port and second port for being used to respond the video request on reason server, i.e., the port RTP (such as No. 2000 ports) With the port RTCP.
Due to being the video counts for receiving the location A from video server by No. 1000 ports of front-end client originally According to still, since the method for the embodiment of the present invention has used rear end streaming cache proxy server, to the transmission work of multi-path video stream It is acted on behalf of, therefore, the video data of the location A from video server is first by rear end streaming cache proxy server No. 2000 ports receive, and then, can just be transmitted to No. 1000 ports of front-end client, so rear end streaming cache proxy takes here Business device needs to save the mapping relations between No. 1000 ports and No. 2000 ports.The mapping relations can in the video request Session id it is associated.
The message for indicating RTP port open (is carried No. 2000 ports by S54, then, rear end streaming cache proxy server Information) via gateway 2 it is sent to front end streaming cache proxy server;
S55, if rear end streaming cache proxy server judges the above-mentioned meeting received from front end streaming cache proxy server Words message is not representing the information of request video, but indicates to terminate the information of session, i.e., described in above-mentioned port starting method Streaming cache proxy turn-off request searches the port RTP being associated then according to the session id in streaming cache proxy turn-off request, That is No. 2000 ports, and close No. 2000 ports, and the message for indicating RTP port shutdown (is not needed to carry port numbers, be taken Band session id, because front end streaming cache proxy server also saves being associated between session id and No. 1000 ports It is) it is sent to front end streaming cache proxy server via gateway 2, so that the RTP of rear end streaming cache proxy server is known in front end Port has been switched off;
S56, front end streaming cache proxy server, then can roots after receiving the message of expression RTP port shutdown of S55 No. 1000 ports of front-end client are closed according to the session id in the message;
S57, front end streaming cache proxy server is after receiving the message of expression RTP port open of S56, then before confirming Rear end RTP acts on behalf of forwarding channel and is successfully established;
S58, rear end streaming cache proxy server forward video request (wherein, by the port numbers in video request from 1000 Number it is revised as No. 2000) to video server, and receive using No. 2000 ports the video of the location A from video server Data;
S59, rear end streaming cache proxy server is after receiving video data using No. 2000 ports, according to reflecting for preservation Relationship is penetrated, No. 1000 ports of client are found, video data and port numbers 1000 are sent to front end stream matchmaker via gateway 2 Body proxy server;
S60, front end streaming cache proxy server connect front-end customer according to the video data and port numbers 1000 received No. 1000 ports at end, and video data is sent to No. 1000 ports of front-end client.
By means of the technical solution of the above embodiment of the present invention, the video transmission method and system of the embodiment of the present invention can be with Using streaming cache proxy server, the transmission of video to net outward to Intranet provides efficient multichannel factorage, is promoted to more The efficiency of transmission of road stream medium data.
It should be noted that for simple description, therefore, it is stated as a series of action groups for embodiment of the method It closes, but those skilled in the art should understand that, embodiment of that present invention are not limited by the describe sequence of actions, because according to According to the embodiment of the present invention, some steps may be performed in other sequences or simultaneously.Secondly, those skilled in the art also should Know, the embodiments described in the specification are all preferred embodiments, and the related movement not necessarily present invention is implemented Necessary to example.
It is corresponding with method provided by the embodiments of the present invention, referring to Fig. 5, show a kind of port starting of the present invention The structural block diagram of Installation practice, can specifically include following module:
First receiving module 501, for receiving stream media agency's starting request;
First obtains module 502, requests for starting in response to the streaming cache proxy, according to preconfigured idle end Mouthful range, idle port queue and busy port queue obtain first port, wherein the idle port queue, described The original state of busy port queue is sky;
Starting module 503, for starting the first port and the next second end adjacent with the first port Mouthful;
Described first obtains module 502, if any one end being also used in the first port and the second port Mouth starting failure is then proceeded to respond to start in the streaming cache proxy and be requested, according to preconfigured idle port range, free time Port queue and busy port queue obtain first port, until the first port and the second port open It moves successfully.
Optionally, the first acquisition module 502 includes:
Judging submodule, for judging whether idle port queue is empty;
First acquisition submodule, if judging idle port queue for the judging submodule for sky, basis is matched in advance The idle port range set and busy port queue obtain first port;
Second acquisition submodule, if judging idle port queue not for the judging submodule is sky, from the sky Not busy port queue obtains first port;
Optionally, described device further include:
First joins the team module, for after the first port and the second port starts successfully, will described in The busy port queue is written in first port;
Second receiving module acts on behalf of turn-off request for receiving stream media;
Closedown module, in response to the streaming cache proxy turn-off request, closing the first port and described the Two-port netwerk;
Second joins the team module, will be described in first port write-in in response to the streaming cache proxy turn-off request Idle port queue;
First goes out team's module, in response to the streaming cache proxy turn-off request, by the first port from described non- Idle port queue is deleted.
Optionally, first acquisition submodule includes:
Judging unit, for judging whether busy port queue is empty;
First recognition unit, if judging busy port queue for the judging unit for sky, basis is pre-configured with Idle port range, identify continuous two ports of port numbers;
Second recognition unit, if judging busy port queue not for the judging unit is sky, according to described non- Idle port queue identifies busy target first port, and according to preconfigured idle port range, identification and institute It states that target first port is adjacent and port numbers is greater than the target second port of the target first port, and preconfigured Within the scope of idle port, port numbers continuous two in addition to the target first port and the target second port are identified Port;
Acquiring unit, for obtaining described two lesser first ports of port middle-end slogan.
Optionally, described device further include:
Identification module is used for after the first port and the second port start successfully, according to the stream Media proxy starting request, identifies the first session id;
Relating module, for establishing the first port and the second port, with being associated with for first session id Relationship;
The closedown module is also used to identify the second session id, identification and institute according to the streaming cache proxy turn-off request The associated first port of the second session id and second port are stated, the first port and the second port are closed;
Described second joins the team module, is also used in response to the streaming cache proxy turn-off request, will be with second session The idle port queue is written in the associated first port of ID;
Described first goes out team's module, is also used in response to the streaming cache proxy turn-off request, will be with second session The associated first port of ID is deleted from the busy port queue;
First removing module, for deleting being associated with for the first port and the second port and second session id Relationship.
Optionally, described device further include:
Second obtains module, is used for after configuring the idle port range, if detecting the application program newly installed, Then obtain the corresponding third port of the application program;
Second removing module, for deleting the third port from the idle port range;
Third removing module, for after deleting the third port, if the idle port range further include with The third port is adjacent and port numbers are port numbers the 4th port that adds one or subtract one of the third port, also, described Idle port range does not include that the port numbers that and port numbers adjacent with the 4th port are the 4th port add one or subtract one Fifth port, then the 4th port is deleted from the idle port range.
Optionally, described device further include:
Third obtains module, is used for after configuring the idle port range, if detecting mounted application program It is unloaded, then obtains corresponding 6th port of the application program being unloaded;
Update module, if continuous at least two port of port-for-port No. the 6th, or, if the port of the 6th port It is number continuous with the port numbers of a port within the scope of the idle port, then the 6th port is added to the idle end Mouth range.
For device embodiment, since it is basically similar to the method embodiment, related so being described relatively simple Place illustrates referring to the part of embodiment of the method.
All the embodiments in this specification are described in a progressive manner, the highlights of each of the examples are with The difference of other embodiments, the same or similar parts between the embodiments can be referred to each other.
It should be understood by those skilled in the art that, the embodiment of the embodiment of the present invention can provide as method, apparatus or calculate Machine program product.Therefore, the embodiment of the present invention can be used complete hardware embodiment, complete software embodiment or combine software and The form of the embodiment of hardware aspect.Moreover, the embodiment of the present invention can be used one or more wherein include computer can With in the computer-usable storage medium (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.) of program code The form of the computer program product of implementation.
The embodiment of the present invention be referring to according to the method for the embodiment of the present invention, terminal device (system) and computer program The flowchart and/or the block diagram of product describes.It should be understood that flowchart and/or the block diagram can be realized by computer program instructions In each flow and/or block and flowchart and/or the block diagram in process and/or box combination.It can provide these Computer program instructions are set to general purpose computer, special purpose computer, Embedded Processor or other programmable data processing terminals Standby processor is to generate a machine, so that being held by the processor of computer or other programmable data processing terminal devices Capable instruction generates for realizing in one or more flows of the flowchart and/or one or more blocks of the block diagram The device of specified function.
These computer program instructions, which may also be stored in, is able to guide computer or other programmable data processing terminal devices In computer-readable memory operate in a specific manner, so that instruction stored in the computer readable memory generates packet The manufacture of command device is included, which realizes in one side of one or more flows of the flowchart and/or block diagram The function of being specified in frame or multiple boxes.
These computer program instructions can also be loaded into computer or other programmable data processing terminal devices, so that Series of operation steps are executed on computer or other programmable terminal equipments to generate computer implemented processing, thus The instruction executed on computer or other programmable terminal equipments is provided for realizing in one or more flows of the flowchart And/or in one or more blocks of the block diagram specify function the step of.
Although the preferred embodiment of the embodiment of the present invention has been described, once a person skilled in the art knows bases This creative concept, then additional changes and modifications can be made to these embodiments.So the following claims are intended to be interpreted as Including preferred embodiment and fall into all change and modification of range of embodiment of the invention.
Finally, it is to be noted that, herein, relational terms such as first and second and the like be used merely to by One entity or operation are distinguished with another entity or operation, without necessarily requiring or implying these entities or operation Between there are any actual relationship or orders.Moreover, the terms "include", "comprise" or its any other variant meaning Covering non-exclusive inclusion, so that process, method, article or terminal device including a series of elements not only wrap Those elements are included, but also including other elements that are not explicitly listed, or further includes for this process, method, article Or the element that terminal device is intrinsic.In the absence of more restrictions, being wanted by what sentence "including a ..." limited Element, it is not excluded that there is also other identical elements in process, method, article or the terminal device for including the element.
Above to a kind of port starting method provided by the present invention and a kind of port starter, detailed Jie has been carried out It continues, used herein a specific example illustrates the principle and implementation of the invention, and the explanation of above embodiments is only It is to be used to help understand method and its core concept of the invention;At the same time, for those skilled in the art, according to this hair Bright thought, there will be changes in the specific implementation manner and application range, in conclusion the content of the present specification should not manage Solution is limitation of the present invention.

Claims (10)

1. a kind of port starts method characterized by comprising
Receiving stream media agency's starting request;
In response to the streaming cache proxy start request, according to preconfigured idle port range, idle port queue and Busy port queue, obtain first port, wherein the idle port queue, the busy port queue initial shape State is sky;
Start the first port and the next second port adjacent with the first port;
If any one port in the first port and the second port starts failure, it is pre- to continue to execute the basis The step of idle port range, idle port queue and busy port queue first configured, acquisition first port, until institute It states first port and the second port starts success.
2. the method according to claim 1, wherein
It is described according to preconfigured idle port range, idle port queue and busy port queue, obtain first end Mouthful, comprising:
Judge whether idle port queue is empty;
If so, obtaining first port according to preconfigured idle port range and busy port queue;
If it is not, then obtaining first port from the idle port queue;
After the first port and the second port start successfully, the method also includes:
The busy port queue is written into the first port;
Receiving stream media acts on behalf of turn-off request;
In response to the streaming cache proxy turn-off request, the first port and the second port are closed, and by described The idle port queue is written in Single port, and the first port is deleted from the busy port queue.
3. according to the method described in claim 2, it is characterized in that, described according to preconfigured idle port range and non- Idle port queue obtains first port, comprising:
Judge whether busy port queue is empty;
If so, identifying continuous two ports of port numbers according to preconfigured idle port range;
If it is not, then identifying busy target first port according to the busy port queue;According to the preconfigured free time Port range identifies that and port numbers adjacent with the target first port are greater than the target second end of the target first port Mouthful;Within the scope of preconfigured idle port, identify in addition to the target first port and the target second port Continuous two ports of port numbers;
Obtain described two lesser first ports of port middle-end slogan.
4. according to the method described in claim 2, it is characterized in that,
After the first port and the second port start successfully, the method also includes:
Started according to the streaming cache proxy and requested, identifies the first session id;
The first port and the second port are established, the incidence relation with first session id;
It is described to close the first port and the second port in response to the streaming cache proxy turn-off request, and by institute It states first port and the idle port queue is written, and the first port is deleted from the busy port queue, packet It includes:
According to the streaming cache proxy turn-off request, the second session id is identified;
Identification and the associated first port of second session id and second port;
Close the first port and the second port;
The idle port queue will be written with the associated first port of second session id, and will be with second session The associated first port of ID is deleted from the busy port queue;
Delete the incidence relation of the first port and the second port and second session id.
5. the method according to claim 1, wherein after configuring the idle port range, the method Further include:
If detecting the application program newly installed, the corresponding third port of the application program is obtained;
The third port is deleted from the idle port range;
After deleting the third port, if the idle port range further includes adjacent with the third port and holds Slogan is port numbers the 4th port that adds one or subtract one of the third port, also, the idle port range do not include with 4th port is adjacent and port numbers are the port numbers fifth port that adds one or subtract one of the 4th port, then by the 4th It is deleted from the idle port range port.
6. a kind of port starter characterized by comprising
First receiving module, for receiving stream media agency's starting request;
First obtain module, in response to the streaming cache proxy start request, according to preconfigured idle port range, Idle port queue and busy port queue obtain first port, wherein the idle port queue, described busy The original state of port queue is sky;
Starting module, for starting the first port and the next second port adjacent with the first port;
Described first obtains module, if any one port starting being also used in the first port and the second port is lost It loses, then proceeds to respond to start in the streaming cache proxy and request, according to preconfigured idle port range, idle port queue And busy port queue, first port is obtained, until the first port and the second port start success.
7. device according to claim 6, which is characterized in that
Described first, which obtains module, includes:
Judging submodule, for judging whether idle port queue is empty;
First acquisition submodule, if judging idle port queue for sky, according to preconfigured for the judging submodule Idle port range and busy port queue obtain first port;
Second acquisition submodule, if judging idle port queue not for the judging submodule is sky, from the idle end Mouth queue obtains first port;
Described device further include:
First joins the team module, for after the first port and the second port start successfully, by described first The busy port queue is written in port;
Second receiving module acts on behalf of turn-off request for receiving stream media;
Closedown module, for closing the first port and the second end in response to the streaming cache proxy turn-off request Mouthful;
Second joins the team module, in response to the streaming cache proxy turn-off request, the free time to be written in the first port Port queue;
First goes out team's module, in response to the streaming cache proxy turn-off request, by the first port from described busy Port queue is deleted.
8. device according to claim 7, which is characterized in that first acquisition submodule includes:
Judging unit, for judging whether busy port queue is empty;
First recognition unit, if judging busy port queue for sky, according to preconfigured sky for the judging unit Not busy port range identifies continuous two ports of port numbers;
Second recognition unit, if judging busy port queue not for the judging unit is sky, according to described busy Port queue identifies busy target first port, and according to preconfigured idle port range, identification and the mesh It marks that first port is adjacent and port numbers is greater than the target second port of the target first port, and in the preconfigured free time In port range, continuous two ends of port numbers in addition to the target first port and the target second port are identified Mouthful;
Acquiring unit, for obtaining described two lesser first ports of port middle-end slogan.
9. device according to claim 7, which is characterized in that
Described device further include:
Identification module is used for after the first port and the second port start successfully, according to the Streaming Media Agency's starting request, identifies the first session id;
Relating module, the incidence relation for establishing the first port and the second port, with first session id;
The closedown module, is also used to according to the streaming cache proxy turn-off request, identifies the second session id, identification and described the The associated first port of two session ids and second port, close the first port and the second port;
Described second joins the team module, is also used in response to the streaming cache proxy turn-off request, will close with second session id The idle port queue is written in the first port of connection;
Described first goes out team's module, is also used in response to the streaming cache proxy turn-off request, will close with second session id The first port of connection is deleted from the busy port queue;
First removing module, for deleting being associated with for the first port and the second port and second session id System.
10. device according to claim 6, which is characterized in that described device further include:
Second obtains module, for if detecting the application program newly installed, obtaining after configuring the idle port range Take the corresponding third port of the application program;
Second removing module, for deleting the third port from the idle port range;
Third removing module, for after deleting the third port, if the idle port range further include with it is described Third port is adjacent and port numbers are port numbers the 4th port that adds one or subtract one of the third port, also, the free time Port range does not include that the port numbers that and port numbers adjacent with the 4th port are the 4th port add one or subtract one Five ports then delete the 4th port from the idle port range.
CN201811577850.2A 2018-12-20 2018-12-20 Port starting method and device Active CN109510838B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811577850.2A CN109510838B (en) 2018-12-20 2018-12-20 Port starting method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811577850.2A CN109510838B (en) 2018-12-20 2018-12-20 Port starting method and device

Publications (2)

Publication Number Publication Date
CN109510838A true CN109510838A (en) 2019-03-22
CN109510838B CN109510838B (en) 2020-08-28

Family

ID=65754395

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811577850.2A Active CN109510838B (en) 2018-12-20 2018-12-20 Port starting method and device

Country Status (1)

Country Link
CN (1) CN109510838B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1604589A (en) * 2004-10-28 2005-04-06 无锡三通科技有限公司 SIP crossing supported firewall implementing method
CN101917409A (en) * 2010-07-23 2010-12-15 深圳粤和通科技有限公司 Multimedia stream transmission method and system
CN103702001A (en) * 2013-12-17 2014-04-02 中国联合网络通信集团有限公司 Teleconference platform and teleconference processing method
US20150124614A1 (en) * 2013-11-05 2015-05-07 Cisco Technology, Inc. Randomized per-packet port channel load balancing
US20170041289A1 (en) * 2015-08-07 2017-02-09 Avaya Inc. Management for communication ports
CN106656596A (en) * 2016-12-21 2017-05-10 瑞斯康达科技发展股份有限公司 SNMP network management method and device based on DHCP server
CN108833611A (en) * 2018-08-01 2018-11-16 中国联合网络通信集团有限公司 A kind of distribution method of method NAT address conversion

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1604589A (en) * 2004-10-28 2005-04-06 无锡三通科技有限公司 SIP crossing supported firewall implementing method
CN101917409A (en) * 2010-07-23 2010-12-15 深圳粤和通科技有限公司 Multimedia stream transmission method and system
US20150124614A1 (en) * 2013-11-05 2015-05-07 Cisco Technology, Inc. Randomized per-packet port channel load balancing
CN103702001A (en) * 2013-12-17 2014-04-02 中国联合网络通信集团有限公司 Teleconference platform and teleconference processing method
US20170041289A1 (en) * 2015-08-07 2017-02-09 Avaya Inc. Management for communication ports
CN106656596A (en) * 2016-12-21 2017-05-10 瑞斯康达科技发展股份有限公司 SNMP network management method and device based on DHCP server
CN108833611A (en) * 2018-08-01 2018-11-16 中国联合网络通信集团有限公司 A kind of distribution method of method NAT address conversion

Also Published As

Publication number Publication date
CN109510838B (en) 2020-08-28

Similar Documents

Publication Publication Date Title
CN111355669B (en) Method, device and system for controlling network congestion
US9998352B2 (en) Method and system for sending flow table in SDN, of controller, and of switch
CN110502259B (en) Server version upgrading method, video networking system, electronic equipment and storage medium
US9479727B1 (en) Call recording with screen and audio correlation
CN114500633B (en) Data forwarding method, related device, program product and data transmission system
EP2827553B1 (en) Rapid startup with dynamic reservation capabilities for network communication systems
EP3313031B1 (en) Sdn-based arp realization method and apparatus
US8437266B2 (en) Flow through call control
CN109587082B (en) Message asynchronous forwarding system and method based on Linux operating system
US10979562B2 (en) Call recording system, call recording method, and call recording program
CN110690990B (en) Server upgrading method and device, electronic equipment and storage medium
WO2009021424A1 (en) A device and method for handling messages
CN113612759B (en) High-performance high-concurrency intelligent broadcasting system based on SIP protocol and implementation method
CN103152266A (en) Synchronization method among network equipment, network equipment and system
US7843931B1 (en) iSCSI switching method and apparatus
US20050165983A1 (en) System and method for processing data in kernel area by a user command
CN105306755A (en) Quality detection method and device for contact centre
CN109510838A (en) Port starts method and apparatus
US20140143315A1 (en) Communication device and communication method
CN112218104B (en) Data transmission method, device, terminal equipment and storage medium
WO2018090315A1 (en) Data request processing method and cache system
CN109327730B (en) Method and device for downloading data packet
CN114915656A (en) Internet of vehicles terminal access method, device, storage medium and electronic equipment
WO2016197885A1 (en) Method and device for managing media cascade
CN110120937B (en) Resource acquisition method, system, device and computer readable storage medium

Legal Events

Date Code Title Description
PB01 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