CN104580224A - Network connection method and device and computer system - Google Patents

Network connection method and device and computer system Download PDF

Info

Publication number
CN104580224A
CN104580224A CN201510017504.9A CN201510017504A CN104580224A CN 104580224 A CN104580224 A CN 104580224A CN 201510017504 A CN201510017504 A CN 201510017504A CN 104580224 A CN104580224 A CN 104580224A
Authority
CN
China
Prior art keywords
server
client
information
request
specified
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
CN201510017504.9A
Other languages
Chinese (zh)
Other versions
CN104580224B (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 Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information 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 Jingdong Century Trading Co Ltd, Beijing Jingdong Shangke Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN201510017504.9A priority Critical patent/CN104580224B/en
Publication of CN104580224A publication Critical patent/CN104580224A/en
Application granted granted Critical
Publication of CN104580224B publication Critical patent/CN104580224B/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
    • 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/46Interconnection of networks

Abstract

The invention provides a network connection method and device and a computer system. By means of the network connection method and device and the computer system, the problem that all clients need to be connected with all servers respectively is solved, connection between the servers and the clients is simplified, the using rate of system resources of the servers and the clients is greatly reduced, an existing program does not need to be modified when the number of the servers is increased, and system horizontal expansion is facilitated. The network connection method includes the steps that request information requiring to be connected with a designated client is received; the corresponding server connected with the client is determined; the request information is sent to the corresponding server.

Description

A kind of method for connecting network and device and computer system
Technical field
The present invention relates to field of computer technology, particularly a kind of method for connecting network and device and computer system.
Background technology
Along with the scale of software systems is increasing, most of system all can utilize reverse proxy to do load balancing in front end.But for carrying out for the client computer of communication with hardware, Socket long connection is but only have a physical connection.And connect the service end and client that need to rely on and set up Socket connection, can not accomplish to call arbitrarily.
When HTTP request arrives after Reverse Proxy, Reverse Proxy according to rule by Requests routing to server.If HTTP request is distributed to server 1, and HTTP request is wanted to communicate with the Socket of client computer 1, at this moment, just need server 1 and client computer to be set up a Socket to be connected, as shown in Figure 1, Fig. 1 is the network connection diagram according to prior art.
But in actual motion, which station server is HTTP request be distributed to is uncertain, if wish that every station server can process the request received arbitrarily, just need long for the Socket of each client computer connection to do on each server once to connect, not only waste system resource, be also unfavorable for that system level is expanded simultaneously.
Summary of the invention
In view of this, the invention provides a kind of method for connecting network and device and computer system, solve the problem that each client computer needs to connect respectively with each server, simplify the connection between server and client computer, server and client machine system resource utilization are reduced greatly, and do not need when number of servers increases to make an amendment existing program, be beneficial to system level expansion.
For achieving the above object, according to an aspect of the present invention, a kind of method for connecting network is provided.
Method for connecting network of the present invention comprises: receive the solicited message asking to carry out with specified client being connected; Determine and the server that described specified client is connected; By described request distribution of information to described server.
Alternatively, determine to comprise with the step of the server that described specified client connects: from the connection relation information of the server preserved and client computer, inquire the server corresponding with specified client.
Alternatively, described connection relation information is using client identifying as key, the key-value pair using server identification as value.
Alternatively, described client identifying is IP address.
Alternatively, described request information comprises HTTP request information; Described connection comprises Socket and connects.
According to a further aspect in the invention, a kind of network connection device is provided.
Network connection device of the present invention comprises: receiver module, for receiving the solicited message that request and specified client carry out being connected; Determination module, for determining the server be connected with specified client; Distribution module, for by described request distribution of information to described server.
Alternatively, described determination module is also for inquiring the server corresponding with specified client from the server preserved with the connection relation information of client computer.
According to a further aspect in the invention, a kind of computer system is provided.
Computer system of the present invention comprises: reverse proxy, multiple server and multiple client computer, and wherein, reverse proxy, for receiving the solicited message that request and specified client carry out being connected; Determine and the server that described specified client is connected; By described request distribution of information to this server; Each server is connected with described reverse proxy respectively, for receiving the solicited message of described reverse proxy distribution; Each client computer is connected with a server respectively.
Alternatively, also comprise storage device, for storing the connection relation information of described client computer and described server.
Alternatively, the storage mode of described connection relation information is buffer memory, file, database or program variable.
According to technical scheme of the present invention, after reception request carries out with specified client the solicited message be connected, by determining and the server that described specified client is connected, each client computer need not be connected respectively with each server, simplify the connection between server and client computer, server and client machine system resource utilization are reduced greatly, and does not need when number of servers increases to make an amendment existing program, be beneficial to system level expansion.
Accompanying drawing explanation
Accompanying drawing is used for understanding the present invention better, does not form inappropriate limitation of the present invention.Wherein:
Fig. 1 is the network connection diagram according to prior art;
Fig. 2 is the computer system schematic diagram according to the embodiment of the present invention;
Fig. 3 is the method for connecting network schematic diagram according to the embodiment of the present invention;
Fig. 4 is the network connection device schematic diagram according to the embodiment of the present invention.
Embodiment
Below in conjunction with accompanying drawing, one exemplary embodiment of the present invention is explained, comprising the various details of the embodiment of the present invention to help understanding, they should be thought it is only exemplary.Therefore, those of ordinary skill in the art will be appreciated that, can make various change and amendment, and can not deviate from scope and spirit of the present invention to the embodiments described herein.Equally, for clarity and conciseness, the description to known function and structure is eliminated in following description.
Fig. 2 is the computer system schematic diagram according to the embodiment of the present invention.As shown in Figure 2, the computer system 20 of the embodiment of the present invention mainly comprises reverse proxy 21, multiple server 22 and multiple client computer 23.The solicited message that reverse proxy 21 is carried out being connected for receiving request and specified client; Determine the server 22 be connected with described specified client; By described request distribution of information to this server 22; Each server 22 is connected with reverse proxy 21 respectively, for receiving the solicited message of described reverse proxy 21 distribution; Each client computer 23 is connected with a server 22 respectively.
Computer system 20 also can comprise storage device (not shown), for storing the connection relation information of described client computer and described server.This storage device can be an independent caching server, and buffer memory read-write is by key-being worth right mode carries out; Data can be accomplished atomicity like this, all programs can ensure when reading cache data correctly, consistent.The storage mode of connection relation information can be buffer memory, file, database or program variable etc.
Fig. 3 is the method for connecting network schematic diagram according to the embodiment of the present invention.The method is performed by reverse proxy 21, and as shown in Figure 3, the method mainly comprises following step S30 to S32.
Step S30: receive the solicited message asking to carry out with specified client being connected.Solicited message in the present embodiment comprises HTTP request information, connects and comprises Socket connection.
Step S31: determine the server be connected with specified client.The server corresponding with specified client is inquired with the connection relation information of client computer from the server preserved; Wherein, connection relation information is using client identifying as key, the key-value pair using server identification as value.At this, using the IP of client computer as key, service IP is kept in connection relation information as the key-value pair of value.Like this, the Socket connection data that each client computer has connected is saved in connection relation information.When receiving request and carrying out with specified client the HTTP request be connected, by server ip corresponding to the IP that checks client computer in connection relation information, just can determine to need which station server is HTTP request is distributed to, therefore, server and client computer need not keep multiple connection, and server and client machine system resource utilization are reduced greatly.In addition, if increase server/client, without the need to making an amendment existing program, only need the link information of adding increased server/client in connection relation information.
Step S32: by described request distribution of information to described server.And then solicited message just can be sent to client computer by server, realize requesting party and be connected with the network of specified client.
Fig. 4 is the network connection device schematic diagram according to the embodiment of the present invention.This device can be arranged in reverse proxy 21 as software.As shown in Figure 4, the network connection device 40 of the embodiment of the present invention mainly comprises receiver module 41, determination module 42 and distribution module 43.The solicited message that receiver module 41 carries out being connected for receiving request and specified client; Determination module 42 is for determining the server be connected with specified client; The server that also can be used for from preserving inquires the server corresponding with specified client with the connection relation information of client computer; Distribution module 43 is for being distributed to corresponding server by solicited message.
According to the technical scheme of the embodiment of the present invention, after reception request carries out with specified client the solicited message be connected, by determining and the server that described specified client is connected, each client computer need not be connected respectively with each server, simplify the connection between server and client computer, server and client machine system resource utilization are reduced greatly, and does not need when number of servers increases to make an amendment existing program, be beneficial to system level expansion.
Below describe general principle of the present invention in conjunction with specific embodiments, in apparatus and method of the present invention, obviously, each parts or each step can decompose and/or reconfigure.These decompose and/or reconfigure and should be considered as equivalents of the present invention.Further, the step performing above-mentioned series of processes can order naturally following the instructions perform in chronological order, but does not need necessarily to perform according to time sequencing.Some step can walk abreast or perform independently of one another.
Above-mentioned embodiment, does not form limiting the scope of the invention.It is to be understood that depend on designing requirement and other factors, various amendment, combination, sub-portfolio can be there is and substitute in those skilled in the art.Any amendment done within the spirit and principles in the present invention, equivalent replacement and improvement etc., all should be included within scope.

Claims (10)

1. a method for connecting network, is characterized in that, comprising:
Receive the solicited message asking to carry out with specified client being connected;
Determine and the server that described specified client is connected;
By described request distribution of information to described server.
2. method according to claim 1, is characterized in that, determines to comprise with the step of the server that described specified client connects: from the connection relation information of the server preserved and client computer, inquire the server corresponding with specified client.
3. method according to claim 2, is characterized in that, described connection relation information is using client identifying as key, the key-value pair using server identification as value.
4. method according to claim 3, is characterized in that, described client identifying is IP address.
5. the method according to claim 1,2,3 or 4, is characterized in that, described request information comprises HTTP request information; Described connection comprises Socket and connects.
6. a network connection device, is characterized in that, comprising:
Receiver module, for receiving the solicited message that request and specified client carry out being connected;
Determination module, for determining the server be connected with specified client;
Distribution module, for by described request distribution of information to described server.
7. device according to claim 6, is characterized in that, described determination module is also for inquiring the server corresponding with specified client from the server preserved with the connection relation information of client computer.
8. a computer system, is characterized in that, comprising: reverse proxy, multiple server and multiple client computer, wherein,
Reverse proxy, for receiving the solicited message that request and specified client carry out being connected; Determine and the server that described specified client is connected; By described request distribution of information to this server;
Each server is connected with described reverse proxy respectively, for receiving the solicited message of described reverse proxy distribution;
Each client computer is connected with a server respectively.
9. system according to claim 8, is characterized in that, also comprises storage device, for storing the connection relation information of described client computer and described server.
10. system according to claim 9, is characterized in that, the storage mode of described connection relation information is buffer memory, file, database or program variable.
CN201510017504.9A 2015-01-14 2015-01-14 A kind of method for connecting network and device and computer system Active CN104580224B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510017504.9A CN104580224B (en) 2015-01-14 2015-01-14 A kind of method for connecting network and device and computer system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510017504.9A CN104580224B (en) 2015-01-14 2015-01-14 A kind of method for connecting network and device and computer system

Publications (2)

Publication Number Publication Date
CN104580224A true CN104580224A (en) 2015-04-29
CN104580224B CN104580224B (en) 2018-06-01

Family

ID=53095404

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510017504.9A Active CN104580224B (en) 2015-01-14 2015-01-14 A kind of method for connecting network and device and computer system

Country Status (1)

Country Link
CN (1) CN104580224B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106294403A (en) * 2015-05-21 2017-01-04 阿里巴巴集团控股有限公司 The method of across a network operating database, system, client and server

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100017500A1 (en) * 2008-07-17 2010-01-21 Rubik Lee Methods and systems for peer-to-peer proxy sharing
CN101729598A (en) * 2009-11-18 2010-06-09 福建星网锐捷网络有限公司 Method and system for increasing Web service response speed and network processor
CN101753478A (en) * 2008-12-05 2010-06-23 中国移动通信集团公司 Distributed E-mail system and service method thereof
CN102624920A (en) * 2012-03-31 2012-08-01 奇智软件(北京)有限公司 Method and device for performing access through proxy server
CN102984277A (en) * 2012-12-17 2013-03-20 北京奇虎科技有限公司 System and method for preventing malicious connection
CN103067417A (en) * 2011-10-19 2013-04-24 华耀(中国)科技有限公司 Web service mapping method and system of security agent in virtual private network (VPN)

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100017500A1 (en) * 2008-07-17 2010-01-21 Rubik Lee Methods and systems for peer-to-peer proxy sharing
CN101753478A (en) * 2008-12-05 2010-06-23 中国移动通信集团公司 Distributed E-mail system and service method thereof
CN101729598A (en) * 2009-11-18 2010-06-09 福建星网锐捷网络有限公司 Method and system for increasing Web service response speed and network processor
CN103067417A (en) * 2011-10-19 2013-04-24 华耀(中国)科技有限公司 Web service mapping method and system of security agent in virtual private network (VPN)
CN102624920A (en) * 2012-03-31 2012-08-01 奇智软件(北京)有限公司 Method and device for performing access through proxy server
CN102984277A (en) * 2012-12-17 2013-03-20 北京奇虎科技有限公司 System and method for preventing malicious connection

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106294403A (en) * 2015-05-21 2017-01-04 阿里巴巴集团控股有限公司 The method of across a network operating database, system, client and server

Also Published As

Publication number Publication date
CN104580224B (en) 2018-06-01

Similar Documents

Publication Publication Date Title
CN109640319B (en) Scheduling method and device based on access information and electronic equipment
US10440069B2 (en) System and method for acquiring, processing, and updating global information
CN104834722A (en) CDN (Content Delivery Network)-based content management system
CN104954468A (en) Resource allocation method and resource allocation device
CN110430274A (en) A kind of document down loading method and system based on cloud storage
CN104980289A (en) Message pushing method, device and system
US20140122723A1 (en) Dynamic registration of listener resources for cloud services
CN103024085A (en) System and method for processing P2P (peer-to-peer) node request
US20170279738A1 (en) Method, apparatus, and system for transmitting data
US20150006622A1 (en) Web contents transmission method and apparatus
CN111083204B (en) File transmission method, device and storage medium
CN109873855A (en) A kind of resource acquiring method and system based on block chain network
CN107277087B (en) Data processing method and device
CN110798495A (en) Method and server for end-to-end message push in cluster architecture mode
CN107579929B (en) Method, system and related device for setting reliable connection communication queue pair
CN103795642A (en) Load balancing method and device
CN106973106B (en) Method, device and system for acquiring session information
CN105099885A (en) Information transmitting method and device
CN106790354B (en) Communication method and device for preventing data congestion
CN114490100A (en) Message queue telemetry transmission load balancing method and device and server
CN103188243A (en) Method providing services for users in Internet and system providing services for users in Internet
CN111131367B (en) Distributed access service processing method and device
CN104580224A (en) Network connection method and device and computer system
CN103560937A (en) Data accessing method and entry server
CN105871972A (en) Video resource distributed cathe method, device and system

Legal Events

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