CN104580224B - A kind of method for connecting network and device and computer system - Google Patents
A kind of method for connecting network and device and computer system Download PDFInfo
- Publication number
- CN104580224B CN104580224B CN201510017504.9A CN201510017504A CN104580224B CN 104580224 B CN104580224 B CN 104580224B CN 201510017504 A CN201510017504 A CN 201510017504A CN 104580224 B CN104580224 B CN 104580224B
- Authority
- CN
- China
- Prior art keywords
- server
- client
- solicited message
- specified
- connection relation
- 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.)
- Active
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/1001—Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/28—Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
- H04L12/46—Interconnection of networks
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Information Transfer Between Computers (AREA)
- Computer And Data Communications (AREA)
Abstract
The present invention provides a kind of method for connecting network and device and computer system, solve the problems, such as that each client computer is required for establishing connection respectively with each server, simplify the connection between server and client computer, substantially reduce server and client machine system resource utilization, and existing program need not be made an amendment in number of servers increase, extended beneficial to system level.The method for connecting network of the present invention includes:Receive the solicited message that request is attached with specified client;Determine the server being connected with the specified client;The solicited message is distributed to the server.
Description
Technical field
The present invention relates to field of computer technology, more particularly to a kind of method for connecting network and device and department of computer science
System.
Background technology
Increasing with the scale of software systems, most of system can all do load in front end using reverse proxy
Weighing apparatus.But for the client computer for being communicated with hardware, Socket long connections are that only there are one physical connections.And even
Connect the server-side and client needed by Socket connections are established, it is impossible to accomplish arbitrary calling.
After HTTP request reaches Reverse Proxy, request is distributed to service by Reverse Proxy according to rule
Device.If HTTP request is distributed to server 1, and HTTP request is wanted to communicate with the Socket of client computer 1, this
When, it is necessary to server 1 is established into a Socket with client computer and is connected, as shown in Figure 1, Fig. 1 is net according to prior art
Network connection diagram.
But in actual motion, it is uncertain which platform server is HTTP request, which be distributed to, if it is desired to every service
Device can handle the request of arbitrary reception, it is necessary to do the Socket long connections of each client computer once on each server
Connection, not only wastes system resource, while is also unfavorable for system level extension.
The content of the invention
In view of this, the present invention provides a kind of method for connecting network and device and computer system, solves each visitor
The problem of family machine is required for establishing connection respectively with each server simplifies the connection between server and client computer, makes clothes
Business device and client machine system resource utilization substantially reduce, and existing program need not be repaiied in number of servers increase
Change, extended beneficial to system level.
To achieve the above object, according to an aspect of the invention, there is provided a kind of method for connecting network.
The method for connecting network of the present invention includes:Receive the solicited message that request is attached with specified client;It determines
The server being connected with the specified client;The solicited message is distributed to the server.
Optionally it is determined that be connected with the specified client server the step of include:From the server of preservation with
Server corresponding with specified client is inquired in the connection relation information of client computer.
Optionally, the connection relation information is using client identifying as key, using server identification as the key assignments of value
It is right.
Optionally, the client identifying is IP address.
Optionally, the solicited message includes HTTP request information;The connection includes Socket connections.
According to another aspect of the present invention, a kind of network connection device is provided.
The network connection device of the present invention includes:Receiving module asks what is be attached with specified client for receiving
Solicited message;Determining module, for determining the server being connected with specified client;Distribution module, for by the request
Information is distributed to the server.
Optionally, the determining module is additionally operable to inquire from the connection relation information of the server of preservation and client computer
Server corresponding with specified client.
According to another aspect of the present invention, a kind of computer system is provided.
The computer system of the present invention includes:Reverse proxy, multiple servers and multiple client computer, wherein, reversed generation
Reason, for receiving the solicited message that request and specified client are attached;Determine the clothes being connected with the specified client
Business device;The solicited message is distributed to the server;Each server is connected respectively with the reverse proxy, for receiving
State the solicited message of reverse proxy distribution;Each client computer is connected respectively with a server.
Optionally, storage device is further included, for storing the connection relation information of the client computer and the server.
Optionally, the storage mode of the connection relation information is caching, file, database or program variable.
Technique according to the invention scheme after the solicited message that request is attached with specified client is received, passes through
Determine the server being connected with the specified client so that make each client computer woth no need to be established respectively with each server
Connection, simplifies the connection between server and client computer, substantially reduces server and client machine system resource utilization, and
And existing program need not be made an amendment in number of servers increase, it is extended beneficial to system level.
Description of the drawings
Attached drawing does not form inappropriate limitation of the present invention for more fully understanding the present invention.Wherein:
Fig. 1 is network connection schematic diagram according to prior art;
Fig. 2 is computer system schematic diagram according to embodiments of the present invention;
Fig. 3 is method for connecting network schematic diagram according to embodiments of the present invention;
Fig. 4 is network connection device schematic diagram according to embodiments of the present invention.
Specific embodiment
It explains below in conjunction with attached drawing to the exemplary embodiment of the present invention, including the various of the embodiment of the present invention
Details should think them only exemplary to help understanding.Therefore, those of ordinary skill in the art should recognize
It arrives, various changes and modifications can be made to the embodiments described herein, without departing from scope and spirit of the present invention.Together
For clarity and conciseness, the description to known function and structure is omitted in sample in following description.
Fig. 2 is computer system schematic diagram according to embodiments of the present invention.As shown in Fig. 2, the calculating of the embodiment of the present invention
Machine system 20 mainly includes reverse proxy 21, multiple servers 22 and multiple client computer 23.Reverse proxy 21 please for receiving
Seek the solicited message being attached with specified client;Determine the server 22 being connected with the specified client;By described in
Solicited message is distributed to the server 22;Each server 22 is connected respectively with reverse proxy 21, for receiving the reversed generation
The solicited message of 21 distribution of reason;Each client computer 23 is connected respectively with a server 22.
Computer system 20 may also include storage device (not shown), for storing the client computer and the service
The connection relation information of device.The storage device can be an individual cache server, and caching read-write is by key-value pair
Mode carries out;Data can so be accomplished to atomicity, all programs can ensure correct, consistent in reading cache data.
The storage mode of connection relation information can be caching, file, database or program variable etc..
Fig. 3 is method for connecting network schematic diagram according to embodiments of the present invention.This method is performed by reverse proxy 21, such as
Shown in Fig. 3, this method mainly includes steps S30 to S32.
Step S30:Receive the solicited message that request is attached with specified client.Request packet in the present embodiment
HTTP request information is included, connection includes Socket connections.
Step S31:Determine the server being connected with specified client.The connection of server and client computer from preservation is closed
It is that server corresponding with specified client is inquired in information;Wherein, connection relation information be using client identifying as key,
Using server identification as the key-value pair of value.Here, using the IP of client computer as key, service IP is stored in as the key-value pair of value
In connection relation information.In this way, the Socket connection data that each client computer has connected are saved in connection relation information.When
When receiving the HTTP request that request is attached with specified client, the IP institutes by checking client computer in connection relation information are right
Server ip is answered, just can determine that needs the HTTP request which platform server be distributed to, and therefore, server and client computer need not be kept
Multiple connections substantially reduce server and client machine system resource utilization.In addition, if increase server/client, nothing
Existing program need to be made an amendment, it is only necessary in connection relation information addition increased server/client link information
.
Step S32:The solicited message is distributed to the server.And then server can send out solicited message
Client computer is given, realizes the network connection of requesting party and specified client.
Fig. 4 is network connection device schematic diagram according to embodiments of the present invention.The device can be arranged on instead as software
Into agency 21.As shown in figure 4, the network connection device 40 of the embodiment of the present invention mainly includes receiving module 41, determining module
42 and distribution module 43.The solicited message that receiving module 41 is attached for reception request with specified client;Determine mould
Block 42 is for the definite server being connected with specified client;It can also be used to close from the server of preservation and the connection of client computer
It is that server corresponding with specified client is inquired in information;Distribution module 43 is used to solicited message being distributed to corresponding clothes
Business device.
Technical solution according to embodiments of the present invention, in the solicited message that reception request is attached with specified client
Afterwards, pass through and determine the server that is connected with the specified client so that make each client computer woth no need to each server
Connection is established respectively, is simplified the connection between server and client computer, is made server and client machine system resource utilization big
It is big to reduce, and existing program need not be made an amendment in number of servers increase, it is extended beneficial to system level.
The basic principle of the present invention is described above in association with specific embodiment, in apparatus and method of the present invention, it is clear that
Each component or each step can be decomposed and/or reconfigured.These decompose and/or reconfigure should be regarded as the present invention etc.
Efficacious prescriptions case.Also, the step of performing above-mentioned series of processes can perform in chronological order according to the order of explanation naturally, still
And it need not centainly perform sequentially in time.Some steps can perform parallel or independently of one another.
Above-mentioned specific embodiment, does not form limiting the scope of the invention.Those skilled in the art should be bright
It is white, depending on design requirement and other factors, various modifications, combination, sub-portfolio and replacement can occur.It is any
Modifications, equivalent substitutions and improvements made within the spirit and principles in the present invention etc., should be included in the scope of the present invention
Within.
Claims (5)
1. a kind of method for connecting network, which is characterized in that including:
Receive the solicited message that request is attached with specified client;
Determine the server being connected with the specified client;
The solicited message is distributed to the server;
Wherein it is determined that be connected with the specified client server the step of include:From the server and client computer of preservation
Connection relation information in inquire server corresponding with specified client;The connection relation information is with client identifying
As key, using server identification as the key-value pair of value;The client identifying is IP address.
2. according to the method described in claim 1, it is characterized in that, the solicited message includes HTTP request information;The company
It connects including Socket connections.
3. a kind of network connection device, which is characterized in that including:
Receiving module, for receiving the solicited message that request and specified client are attached;
Determining module, for determining the server being connected with specified client;Wherein, the determining module is additionally operable to from preservation
Server with inquiring server corresponding with specified client in the connection relation information of client computer;The connection relation letter
Breath is using client identifying as key, using server identification as the key-value pair of value;The client identifying is IP address;
Distribution module, for the solicited message to be distributed to the server.
4. a kind of computer system, which is characterized in that including:Reverse proxy, multiple servers and multiple client computer, wherein,
Reverse proxy, for receiving the solicited message that request and specified client are attached;It determines and the specified client
The server connected;The solicited message is distributed to the server;
Each server is connected respectively with the reverse proxy, for receiving the solicited message of the reverse proxy distribution;
Each client computer is connected respectively with a server;
Storage device is further included, for storing the connection relation information of the client computer and the server;The connection relation
Information is using client identifying as key, using server identification as the key-value pair of value;The client identifying is IP address.
5. system according to claim 4, which is characterized in that the storage mode of the connection relation information is caching, text
Part, database or program variable.
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 CN104580224A (en) | 2015-04-29 |
CN104580224B true 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) |
Families Citing this family (1)
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 (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
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) |
Family Cites Families (4)
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 |
CN102624920B (en) * | 2012-03-31 | 2015-09-16 | 北京奇虎科技有限公司 | A kind of method of being conducted interviews by proxy server and device |
-
2015
- 2015-01-14 CN CN201510017504.9A patent/CN104580224B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103067417A (en) * | 2011-10-19 | 2013-04-24 | 华耀(中国)科技有限公司 | Web service mapping method and system of security agent in virtual private network (VPN) |
CN102984277A (en) * | 2012-12-17 | 2013-03-20 | 北京奇虎科技有限公司 | System and method for preventing malicious connection |
Also Published As
Publication number | Publication date |
---|---|
CN104580224A (en) | 2015-04-29 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108632374B (en) | Software gray level release method and device | |
CN105915633B (en) | Automatic operation and maintenance system and method | |
CN108494860B (en) | WEB access system, WEB access method and device for client | |
CN104811488A (en) | Load balancing equipment-based session keeping method and system and load balancing equipment | |
CN110830374B (en) | Method and device for gray level release based on SDK | |
CN103209223A (en) | Distributed application conversation information sharing method and system and application server | |
CN105337787A (en) | Multi-server monitoring method, device and system | |
CN111861140A (en) | Service processing method, device, storage medium and electronic device | |
CN104980289A (en) | Message pushing method, device and system | |
CN108377247B (en) | Message pushing method and device | |
CN111038906B (en) | Order sorting method and device | |
CN107333248B (en) | A kind of real-time sending method of short message and system | |
CN105548749B (en) | A kind of communication terminal test method, apparatus Internet-based and system | |
CN109151025A (en) | Load-balancing method, device, computer storage medium and equipment based on URL | |
CN106303125A (en) | Automated refill system, method and device | |
CN107277087B (en) | Data processing method and device | |
CN105530311A (en) | Load distribution method and device | |
CN105099769A (en) | Method, device and system for processing abnormal operations of service platform | |
CN111200649A (en) | Scheduling method and device and scheduling model generation method and device | |
CN103237089A (en) | Method and device for repairing domain name system (DNS) polling mode-based webpages and server | |
CN103684977B (en) | Method for sending information and device, method for information display and device | |
CN104125303A (en) | Data read-and-write requesting method, client end and data read-and-write requesting system | |
CN111427703A (en) | Industrial data real-time display method and system | |
CN111008220A (en) | Dynamic identification method and device of data source, storage medium and electronic device | |
CN106686040A (en) | Message processing method and message processing device |
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 |