Background technology
Growing along with Internet technology, the service content that the Internet provides also gets more and more, for being applied to the communication of the mediaphone MMTel of webpage real-time Communication for Power WebRTC system, typically require and multiple server is set service is provided simultaneously, namely server cluster process is carried out, to carry out load balancing, it is to avoid single server cannot provide the situation of service in time for multiple users, to improve service quality simultaneously.
Current load balancing is by providing a load equalizer LB (LoadBalancer) in the front end of each server, being assigned on each station server by user's connection request. Specifically including two kinds of methods, a kind of method is, client is connected to load equalizer, and after asking to obtain server ip address, load equalizer is according to one server of load balance scheduling algorithms selection, and this server ip address is returned to client; Client is connected to the server of correspondence, initiating business request according to the server ip address returned. But, this method needs to connect and just can carry out Business Processing twice, and treatment effeciency is relatively low, and owing to client need to be firstly connected to load equalizer, making load equalizer become the bottleneck of system, once it is not provided that service, whole system is all in unusable state.
Another kind of method is that client is connected to load equalizer initiating business request. Load equalizer is according to one server of load balance scheduling algorithms selection, and service request is transmitted to this server. After server process completes, returning result to load equalizer, load equalizer returns result to client again. Equally, in this method, load equalizer becomes the performance bottleneck of system, and all of request and response are required for forwarding through it. Once load equalizer is not provided that service, whole system is all in unusable state.
Summary of the invention
In order to overcome the deficiencies in the prior art, embodiments provide communication cluster method and the device of a kind of mediaphone MMTel.
In order to solve above-mentioned technical problem, the embodiment of the present invention adopts the following technical scheme that
An aspect according to the embodiment of the present invention, it is provided that the communication cluster method of a kind of mediaphone MMTel, is applied to webpage real-time Communication for Power WebRTC system, and described method includes: send the request for distribution server to load equalizer LB; Receive the described LB response message returned for described request, described response message carries the IP address of the server of LB distribution, records the IP address of the server carried in described response message; IP address according to the server recorded, is connected to the server of correspondence, initiating business request.
Wherein, described transmission to load equalizer LB includes for the request of distribution server: sending the request for distribution server to multiple LB, the plurality of LB is deployed in the circuit machine room of different operators; The response message that the described LB of described reception returns for described request, described response message carries the IP address of the server of LB distribution, the IP address recording the server carried in described response message includes: receive the plurality of LB response message returned for described request, the IP address of server entrained in the response message that record returns at first.
Wherein, described method also includes: after send the request for distribution server to LB, if do not meet with a response in Preset Time, then the IP address of the escape server pre-set according to this locality, the escape server initiating business request that IP address to described escape server is corresponding.
Wherein, described method also includes: after send the request for distribution server to LB, when not meeting with a response in Preset Time, if the escape server ip address that this locality pre-sets is sky, then the IP address of the server of previous record is saved as the IP address of escape server the server initiating business request corresponding to the IP address of the escape server after preservation.
Another aspect according to the embodiment of the present invention, additionally provide the communication Extension arrangement of a kind of mediaphone MMTel, being applied to webpage real-time Communication for Power WebRTC system, described device includes: the first sending module, for sending the request for distribution server to load equalizer LB; Receiver module, for receiving the described LB response message returned for described request, carries the IP address of the server of LB distribution, records the IP address of the server carried in described response message in described response message; Second sending module, for the IP address according to the server recorded, is connected to the server of correspondence, initiating business request.
Wherein, described first sending module includes: the first transmitting element, and for sending the request for distribution server to multiple LB, the plurality of LB is deployed in the circuit machine room of different operators; Described receiver module includes: receive unit, for receiving the plurality of LB response message returned for described request, the IP address of server entrained in the response message that record returns at first.
Wherein, described device also includes: the first Service Processing Module, for after send the request for distribution server to LB, if do not meet with a response in Preset Time, the IP address of the escape server then pre-set according to this locality, the escape server initiating business request that IP address to described escape server is corresponding.
Wherein, described device also includes: the second Service Processing Module, for after send the request for distribution server to LB, when not meeting with a response in Preset Time, if the IP address of the escape server that this locality pre-sets is sky, then the IP address of the server of previous record is saved as the IP address of escape server the server initiating business request corresponding to the IP address of the escape server after preservation.
The beneficial effect of the embodiment of the present invention: the method for the embodiment of the present invention can be prevented effectively from depending on unduly load equalizer LB, avoid just inoperable situation generation after LB breaks down, making LB is no longer system bottleneck, improves the distribution capability of load balancing simultaneously.
Detailed description of the invention
For making the technical problem to be solved in the present invention, technical scheme and advantage clearly, it is described in detail below in conjunction with the accompanying drawings and the specific embodiments.
As it is shown in figure 1, be the flow chart of the communication cluster method of the mediaphone MMTel of the embodiment of the present invention, the method is applied to webpage real-time Communication for Power WebRTC system, and with reference to Fig. 1, the method comprises the steps:
Step 101, sends the request for distribution server to load equalizer LB.
Step 102, receives the described LB response message returned for described request, carries the IP address of the server of LB distribution, record the IP address of the server carried in described response message in described response message.
Specifically, LB according to load-balancing algorithm, selects a server, and this server ip address is returned to webapp after receiving the request of the client webapp described distribution server sent.
Step 103, the IP address according to the server recorded, it is connected to the server of correspondence, initiating business request.
In an embodiment of the present invention, it is possible to be prevented effectively from webapp depending on unduly LB, it is to avoid after LB breaks down, just inoperable situation occurs, and making LB is no longer system bottleneck, improves the distribution capability of load balancing simultaneously.
Further, the step 101 of the above embodiment of the present invention specifically includes: sending the request for distribution server to multiple LB, the plurality of LB is deployed in the circuit machine room of different operators. Should be noted that, in embodiments of the present invention, load balancing service all it is deployed with in each operator, and can be one or more LB circuit machine rooms being distributed in A operator, one or more LB distribution is at the circuit machine room of B operator, particular number is arranged can carry out corresponding configuration according to the concrete bearing capacity of operator and number of users, does not limit in embodiments of the present invention.
Further, the step 102 of the above embodiment of the present invention specifically includes: receive the plurality of LB response message returned for described request, the IP address of server entrained in the response message that record returns at first. Should be understood that, webapp when sending the request for distribution server to multiple LB being deployed in different operators circuit machine room, if the response message that the LB in A operator returns is the fastest, then show that network residing for webapp accesses the network speed of A operator fast, the network speed accessing B operator is slow, now webapp selects the IP address of server entrained in the response message that record returns at first, and the IP address choice of corresponding described server is deployed in the server of A operator as follow-up service supplier.
Further, the method of the embodiment of the present invention also includes: after send the request for distribution server to LB, if do not meet with a response in Preset Time, the IP address of the escape server then pre-set according to this locality, the escape server initiating business request that IP address to described escape server is corresponding.Should be understood that, this function pre-set is that webapp is when issuing, preset the IP address of escape server, and when not meeting with a response in the Preset Time after sending, to LB, the request being used for distribution server, enable escaping function, namely corresponding to the IP address of this escape server escape server initiating business request. Thus being prevented effectively from depending on unduly LB, it is to avoid after LB breaks down, just inoperable situation occurs, and making LB is no longer system bottleneck, improves the distribution capability of load balancing simultaneously.
Further, the method of the embodiment of the present invention also includes: after send the request for distribution server to LB, when not meeting with a response in Preset Time, if the IP address of the escape server that this locality pre-sets is sky, then the IP address of the server of previous record is saved as the IP address of escape server the server initiating business request corresponding to the IP address of the escape server after preservation. Thus the guide changing the LB that places one's entire reliance upon just can find the pattern of server.
In order to better implement above-mentioned purpose, as shown in Figure 2, embodiments provide the communication Extension arrangement of a kind of mediaphone MMTel, this device is applied to webpage real-time Communication for Power WebRTC system, described device 20 includes: the first sending module 21, receiver module 22 and the second sending module 23, wherein
First sending module 21, for sending the request for distribution server to load equalizer LB;
Receiver module 22, for receiving the described LB response message returned for described request, carries the IP address of the server of LB distribution, records the IP address of the server carried in described response message in described response message;
Second sending module 23, for the IP address according to the server recorded, is connected to the server of correspondence, initiating business request.
In an embodiment of the present invention, it is possible to be prevented effectively from depending on unduly LB, it is to avoid after LB breaks down, just inoperable situation occurs, and making LB is no longer system bottleneck, improves the distribution capability of load balancing simultaneously.
Further, described first sending module 21 includes: the first transmitting element, and for sending the request for distribution server to multiple LB, the plurality of LB is deployed in the circuit machine room of different operators; Described receiver module 22 includes: receive unit, for receiving the plurality of LB response message returned for described request, the IP address of server entrained in the response message that record returns at first.
Further, described device 20 also includes: the first Service Processing Module, for after send the request for distribution server to LB, if do not meet with a response in Preset Time, the IP address of the escape server then pre-set according to this locality, the escape server initiating business request that IP address to described escape server is corresponding.
Further, described device 20 also includes: the second Service Processing Module, for after send the request for distribution server to LB, when not meeting with a response in Preset Time, if the IP address of the escape server that this locality pre-sets is sky, then the IP address of the server of previous record is saved as the IP address of escape server the server initiating business request corresponding to the IP address of the escape server after preservation.
The above is the preferred embodiment of the present invention; it should be pointed out that, for those skilled in the art, under the premise without departing from principle of the present invention; can also making some improvements and modifications, these improvements and modifications also should be regarded as protection scope of the present invention.