CN105306598A - Remote data invocation method capable of realizing load balancing - Google Patents

Remote data invocation method capable of realizing load balancing Download PDF

Info

Publication number
CN105306598A
CN105306598A CN201510802719.1A CN201510802719A CN105306598A CN 105306598 A CN105306598 A CN 105306598A CN 201510802719 A CN201510802719 A CN 201510802719A CN 105306598 A CN105306598 A CN 105306598A
Authority
CN
China
Prior art keywords
haproxy
rmi
load balancing
server
siteserver lbs
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.)
Pending
Application number
CN201510802719.1A
Other languages
Chinese (zh)
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.)
Xuan Cai Interactive Network Science And Technology Ltd
Original Assignee
Xuan Cai Interactive Network Science And Technology 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 Xuan Cai Interactive Network Science And Technology Ltd filed Critical Xuan Cai Interactive Network Science And Technology Ltd
Priority to CN201510802719.1A priority Critical patent/CN105306598A/en
Publication of CN105306598A publication Critical patent/CN105306598A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers

Abstract

The invention provides a remote data invocation method capable of realizing load balancing. The remote data invocation method comprises the following steps that a client initiates a control chain to be connected to a load balancing system HAProxy, and after load balancing, RMI (Remote Method Invocation) object information of a corresponding server is acquired; then the client initiates a data chain again to be connected to the load balancing system HAProxy, and after load balancing again, the client is guided to a corresponding server side to perform data processing. The remote data invocation method capable of realizing load balancing provided by the invention realizes the load balancing of java RMI control chain and data chain in combination with the load balancing system, so that after RMI Client gets the RMI object information of any one server through the HAProxy, the HAProxy transmits the object information to any one another server, and right return can be obtained; all RMI servers are completely utilized, therefore the load balancing is truly achieved.

Description

A kind of teledata call method realizing load balancing
Technical field
The present invention relates to a kind of network communication field, specifically a kind of teledata call method realizing load balancing.
Background technology
At present, JavaRMI (RMI RemoteMethodInvocation) is a kind of mechanism, the method for object in another Java Virtual Machine of object reference that can allow on certain Java Virtual Machine.This remote interface can must be realized with any object that the method is called.After Client is connected to Server by Quality Initiative, obtains RMI object information [IP, PORT, ObjId], set up data link by [IP:Port], send request and obtain the response of object corresponding to ObjID.
HAProxy: a kind of SiteServer LBS, receive a new client when connecting, certain server can be selected to connect according to the load-balancing algorithm of configuration, the data forwarding 2 socket realize load balancing.
In order to client and server of RMI is separated, the deployment scenario realizing server is transparent to client, introduce HAProxy assembly, client initiates Quality Initiative and connects the RMI object information that HAProxy takes RMI server A, again initiate Data-Link and connect HAProxy, an other RMI server B can be directed to during Data-Link load balancing, cause server B to return errored response.Like this, for the thread of same Client, whenever cause, follow-up concurrent request of being initiated by this clinet only has 1 station server can response request on backstage, other server is all in idle state, does not well realize load balancing.
Summary of the invention
The object of the invention is for the problem in existing SiteServer LBS, propose a kind of teledata call method realizing load balancing.Allow RMIclient and server all realize the stateless of RMI object in Quality Initiative aspect and Data-Link aspect, thus realize the load balancing of RMI communication.
Technical scheme of the present invention is:
A kind of teledata call method realizing load balancing, client is initiated Quality Initiative and is connected SiteServer LBS HAProxy, the RMI object information of respective server is obtained after load balancing, client is again initiated Data-Link and is connected SiteServer LBS HAProxy, is again directed to corresponding server end after load balancing and carries out data processing.
The present invention includes following steps:
(1), by RMI object information and object ID in each RMI server generate according to the order of sequence, keep the overall situation unified, described object ID comprises RMI server ID+method sequence number;
The data transmission port of each RMI server is mapped in SiteServer LBS HAProxy;
Client is initiated control command to SiteServer LBS HAProxy and is searched RMI server, and this control command comprises HAProxyIP+HAProxy port;
(2), SiteServer LBS HAProxy selects RMI server to forward the control command of step (1) according to load balancing result;
(3), aforementioned RMI server receives after control command, and return control command to SiteServer LBS HAProxy, this control command comprises the data transmission port+object ID of HAProxyIP+RMI server;
(4), SiteServer LBS HAProxy forward step (3) control command to client, this control command comprises data transmission port+object ID that HAProxyIP+RMI server maps in SiteServer LBS HAProxy;
(5), client sends data transfer instruction to SiteServer LBS HAProxy, and this data transfer instruction comprises data transmission port+object ID that HAProxyIP+RMI server maps in SiteServer LBS HAProxy;
(6), SiteServer LBS HAProxy carries out load balancing, again according to load balancing result selection RMI server;
(7) after, aforementioned RMI server receives data command, when RMI object information subsidiary in data command and object ID are compared with local RMI object information, the comparison of shielding RMI server ID and virtual machine, comparative approach sequence number, carry out data processing according to method sequence number, return data result is to SiteServer LBS HAProxy;
(8), SiteServer LBS HAProxy forwards the data processed result of step (7) to client.
In step of the present invention (1), object ID generates according to the order of sequence and refers to: in each RMI server, the sequence number of same procedure is consistent.
Beneficial effect of the present invention:
The present invention realizes the load balancing of javaRMI Quality Initiative and Data-Link in conjunction with SiteServer LBS (such as HAProxy, Nginx etc.), after making RMIClient take the RMI object information of any station server by HAProxy, this object information is sent on any other station server by HAProxy, all can obtain correct returning, make use of all RMI servers completely, really achieve load balancing.
Accompanying drawing explanation
Fig. 1 is flow chart of the present invention.
Fig. 2 is the flow chart of conventional method.
Embodiment
Below in conjunction with drawings and Examples, the present invention is further illustrated.
As shown in Figure 2, in conventional method, due to the load balancing not supporting Data-Link aspect between client and server of primary JavaRMI scheme, make between RMI client and Server end, directly to introduce similar HAProxy assembly to realize the scheme existing problems of load balancing.
For the thread of same Client, whenever cause, follow-up concurrent request of being initiated by this clinet only has 1 station server can response request on backstage, other server is all in idle state.Also be utilized to allow server B, [5 request] is needed also to be directed to HAProxy, HAProxy can request forward to ServerA or B, but there is new problem like this, the ID of what if [1234] process was taken is A, then reach B by the flow process that [5678] are such, in fact B is that the request of the ID not approving A performs in B the machine, and execution makes mistakes.
As shown in Figure 1, by amendment remote invocation method, realize the request for [5678], can realize [ID to the B of A is upper to be performed] and [ID to the A of B is upper to be performed], all can not make mistakes, so just give full play to the load-balancing function of HAProxy, the server that in utilization, rear end is all, realize the stateless of RMI object, server resource very used, specifically comprises the following steps:
(1), by RMI object information and object ID in each RMI server generate according to the order of sequence, keep the overall situation unified, described object ID comprises RMI server ID+method sequence number;
The data transmission port of each RMI server is mapped in SiteServer LBS HAProxy;
Client is initiated control command to SiteServer LBS HAProxy and is searched RMI server, and this control command comprises HAProxyIP+HAProxy port;
(2), SiteServer LBS HAProxy selects RMI server to forward the control command of step (1) according to load balancing result;
(3), aforementioned RMI server receives after control command, and return control command to SiteServer LBS HAProxy, this control command comprises the data transmission port+object ID of HAProxyIP+RMI server;
(4), SiteServer LBS HAProxy forward step (3) control command to client, this control command comprises data transmission port+object ID that HAProxyIP+RMI server maps in SiteServer LBS HAProxy;
(5), client sends data transfer instruction to SiteServer LBS HAProxy, and this data transfer instruction comprises data transmission port+object ID that HAProxyIP+RMI server maps in SiteServer LBS HAProxy;
(6), SiteServer LBS HAProxy carries out load balancing, again according to load balancing result selection RMI server;
(7) after, aforementioned RMI server receives data command, when RMI object information subsidiary in data command and object ID are compared with local RMI object information, the comparison of shielding RMI server ID and virtual machine, comparative approach sequence number, carry out data processing according to method sequence number, return data result is to SiteServer LBS HAProxy;
(8), SiteServer LBS HAProxy forwards the data processed result of step (7) to client.
The part that the present invention does not relate to prior art that maybe can adopt all same as the prior art is realized.

Claims (3)

1. one kind can realize the teledata call method of load balancing, it is characterized in that: client is initiated Quality Initiative and connected SiteServer LBS HAProxy, the RMI object information of respective server is obtained after load balancing, client is again initiated Data-Link and is connected SiteServer LBS HAProxy, is again directed to corresponding server end after load balancing and carries out data processing.
2. the teledata call method of the realized load balancing according to patent requirements 1, is characterized in that it comprises the following steps:
(1), by RMI object information and object ID in each RMI server generate according to the order of sequence, keep the overall situation unified, described object ID comprises RMI server ID+method sequence number;
The data transmission port of each RMI server is mapped in SiteServer LBS HAProxy;
Client is initiated control command to SiteServer LBS HAProxy and is searched RMI server, and this control command comprises HAProxyIP+HAProxy port;
(2), SiteServer LBS HAProxy selects RMI server to forward the control command of step (1) according to load balancing result;
(3), aforementioned RMI server receives after control command, and return control command to SiteServer LBS HAProxy, this control command comprises the data transmission port+object ID of HAProxyIP+RMI server;
(4), SiteServer LBS HAProxy forward step (3) control command to client, this control command comprises data transmission port+object ID that HAProxyIP+RMI server maps in SiteServer LBS HAProxy;
(5), client sends data transfer instruction to SiteServer LBS HAProxy, and this data transfer instruction comprises data transmission port+object ID that HAProxyIP+RMI server maps in SiteServer LBS HAProxy;
(6), SiteServer LBS HAProxy carries out load balancing, again according to load balancing result selection RMI server;
(7) after, aforementioned RMI server receives data command, when RMI object information subsidiary in data command and object ID are compared with local RMI object information, the comparison of shielding RMI server ID and virtual machine, comparative approach sequence number, carry out data processing according to method sequence number, return data result is to SiteServer LBS HAProxy;
(8), SiteServer LBS HAProxy forwards the data processed result of step (7) to client.
3. the remote invocation method of the realized load balancing according to patent requirements 2, is characterized in that in step (1), object ID generates according to the order of sequence and refers to: in each RMI server, the sequence number of same procedure is consistent.
CN201510802719.1A 2015-11-19 2015-11-19 Remote data invocation method capable of realizing load balancing Pending CN105306598A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510802719.1A CN105306598A (en) 2015-11-19 2015-11-19 Remote data invocation method capable of realizing load balancing

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510802719.1A CN105306598A (en) 2015-11-19 2015-11-19 Remote data invocation method capable of realizing load balancing

Publications (1)

Publication Number Publication Date
CN105306598A true CN105306598A (en) 2016-02-03

Family

ID=55203340

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510802719.1A Pending CN105306598A (en) 2015-11-19 2015-11-19 Remote data invocation method capable of realizing load balancing

Country Status (1)

Country Link
CN (1) CN105306598A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106161467A (en) * 2016-08-31 2016-11-23 成都九鼎瑞信科技股份有限公司 Water utilities data access method and device
CN109302724A (en) * 2017-12-20 2019-02-01 上海创远仪器技术股份有限公司 A kind of distribution multinode radio real-time data processing system and method

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1549978A (en) * 2001-07-16 2004-11-24 BEAϵͳ��˾ Method and apparatus for session replication and failover
CN1754146A (en) * 2003-02-24 2006-03-29 Bea系统公司 System and method for server load balancing and server affinity

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1549978A (en) * 2001-07-16 2004-11-24 BEAϵͳ��˾ Method and apparatus for session replication and failover
CN1754146A (en) * 2003-02-24 2006-03-29 Bea系统公司 System and method for server load balancing and server affinity

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
闫钧华等: "基于Java的分布式测控系统任务调度研究", 《系统工程与电子技术》 *
陈志刚等: "分布式系统中一种动态负载均衡策略、相关模型及算法研究", 《小型微型计算机系统》 *
陈志刚等: "基于Java RMI技术的中间应用服务器动态负载均衡模型的实现", 《计算机工程》 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106161467A (en) * 2016-08-31 2016-11-23 成都九鼎瑞信科技股份有限公司 Water utilities data access method and device
CN109302724A (en) * 2017-12-20 2019-02-01 上海创远仪器技术股份有限公司 A kind of distribution multinode radio real-time data processing system and method

Similar Documents

Publication Publication Date Title
CN111586670A (en) Method for realizing service continuity and related equipment
EP3386157A1 (en) Packet transmission method, device and system
EP3096490B1 (en) Method for realizing network virtualization and related device and communication system
CN109474936B (en) Internet of things communication method and system applied among multiple lora gateways
EP3343364A1 (en) Accelerator virtualization method and apparatus, and centralized resource manager
CN111193773B (en) Load balancing method, device, equipment and storage medium
US20150263862A1 (en) Communication system, control apparatus, communication control method, transfer control method, and transfer control program
CN112468529B (en) Session management method and device
WO2013097484A1 (en) Method, server and system for balancing loads of virtual machine cluster
EP3331247A1 (en) Multi-screen control method and device
CN105245521A (en) Protocol format conversion method and device and interface platform
CN108093041B (en) Single-channel VDI proxy service system and implementation method
EP3182649B1 (en) A method and a system for sideband server management
CN111741129A (en) MQTT protocol communication method and system for realizing multiplexing
CN104811383A (en) Message forwarding method and equipment
CN103916320A (en) Method and device for message processing after cross-network relocation of VM device
CN106789993B (en) TCP agent method and device
CN105306598A (en) Remote data invocation method capable of realizing load balancing
US10992635B2 (en) Establishing connection between different overlay networks using edge application gateway
CN112968965B (en) Metadata service method, server and storage medium for NFV network node
CN104734823A (en) Communication system, communication terminal, transfer tables and handshake communication method
US10498637B2 (en) Switch processing method, controller, switch, and switch processing system
CN104158877A (en) Remote control method, and device and system
CN113364660A (en) Data packet processing method and device in LVS load balancing
CN116010130B (en) Cross-card link aggregation method, device, equipment and medium for DPU virtual port

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20160203