CN104202334A - Network connection establishing method and device - Google Patents

Network connection establishing method and device Download PDF

Info

Publication number
CN104202334A
CN104202334A CN201410472857.3A CN201410472857A CN104202334A CN 104202334 A CN104202334 A CN 104202334A CN 201410472857 A CN201410472857 A CN 201410472857A CN 104202334 A CN104202334 A CN 104202334A
Authority
CN
China
Prior art keywords
port
network
information
network port
server
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
CN201410472857.3A
Other languages
Chinese (zh)
Other versions
CN104202334B (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.)
Kingsoft Guangzhou Network Technology Co Ltd
Original Assignee
Kingsoft Guangzhou Network 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 Kingsoft Guangzhou Network Technology Co Ltd filed Critical Kingsoft Guangzhou Network Technology Co Ltd
Priority to CN201410472857.3A priority Critical patent/CN104202334B/en
Publication of CN104202334A publication Critical patent/CN104202334A/en
Application granted granted Critical
Publication of CN104202334B publication Critical patent/CN104202334B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)
  • Computer And Data Communications (AREA)

Abstract

An embodiment of the invention discloses a network connection establishing method and device. The network connection establishing method is applied to a server. The method includes: acquiring a request message sent by a client, wherein the request message sent by the client carries communication mode information of communication of the client with the server; according to correspondence of preset communication mode information and network ports in the server, acquiring port information corresponding to the network ports of the communication mode information in the request message; sending the acquired port information to the client to enable the client to establish network connection with the network ports corresponding to the port information. By application of the method and device, even though the network ports in the server are changed, the port information corresponding to the network ports of the request message can be determined according to the request message sent by the client, and then the port information is sent to the client so as to establish network connection between the client and the network ports.

Description

A kind of method and device of setting up network connection
Technical field
The present invention relates to Internet technical field, particularly a kind of method and device of setting up network connection.
Background technology
Server is as one of nucleus equipment of the network equipment, in the forwarding of message, the storage of content and the aspect such as issue in occupation of leading position.Server generally includes the network port of a plurality of types, and the dissimilar network port provides different functions.The function that client executing is different just need to be connected on the different network port of this server, such as payment software is when carrying out its payment function, just need to be connected on the payment network port of corresponding server.
In prior art, when carrying out a certain function, the document that records client functionality and network port corresponding relation that client can be pre-stored according to this locality, finds in this server the network port that should item function, carries out network connection.
Yet, once the network port change in server, in this server, the corresponding relation of the network port and client functionality also can change, client is according to original document that records client functionality and network port corresponding relation, cannot find the network port corresponding with its function, cause connection failure.
Summary of the invention
In order to address the above problem, the embodiment of the invention discloses a kind of method and device that network connects of setting up, concrete technical scheme is as follows:
Set up the method that network connects, be applied to server, described server comprises a plurality of network ports, and described method comprises:
Obtain the request message that client sends, the request message that described client sends carries the communication mode information that this client and described server communicate;
According to default communication mode information and the corresponding relation of the network port in described server, obtain the port information corresponding to the network port of the communication mode information in described request message;
Obtained port information is sent to described client so that described client with corresponding to the network port of this port information, set up network and be connected.
Optionally, the communication mode information that described basis is default and the corresponding relation of the network port in described server, obtain the port information corresponding to the network port of the communication mode information in described request message, comprising:
According to default communication mode information and the corresponding relation of the network port in described server, determine the network port corresponding to the communication mode information in described request message;
Obtain the port information of a network port in idle condition in the determined network port.
Optionally, a plurality of network ports that described server comprises all carry type identification; Described method also comprises:
The in running order duration of all types of network ports in the default duration of statistics first;
Increase the port number of the network port of target type, described target type is the affiliated port type of the network port that work duration surpasses the first predetermined threshold value.
Optionally, described method also comprises:
Add up the quantity of the in running order network port;
The quantitative value that statistics is obtained outputs to display device, so that user can monitor the port service condition of server.
Optionally, described method also comprises:
Obtain the state information of the network port;
The state information of the network port getting is outputed to display device, so that the port working monitoring state that user can be to server.
Optionally, the communication mode of described client and described server is long connected mode or short connected mode; When the communication mode of described client and described server is long connected mode, described method also comprises:
In the default duration of monitoring second, described client is connected disconnection times with the network between the network port;
The network port that disconnection times is reached to the second predetermined threshold value is labeled as fault;
Determine in described server corresponding to the current communication mode of described client, unmarked be the network port of fault, obtain the port information of a network port in the determined network port;
This port information is sent to described client so that described client with corresponding to the network port of this port information, set up network and be connected.
Set up the method that network connects, be applied to client, described method comprises:
To server, send a request message, described request message carries the communication mode information that described client and this server communicate;
Receive described server after obtaining described request message, the port information of the network port corresponding to the communication mode information in this request message of transmission; In described server, store default communication mode information and the corresponding relation of the network port in described server;
The network of setting up the network port corresponding with received port information connects.
Set up the device that network connects, be applied to server, described server comprises a plurality of network ports, and described device comprises:
Message acquisition module, the request message sending for obtaining client, the request message that described client sends carries the communication mode information that this client and described server communicate;
The first information obtains module, for according to the corresponding relation of the network port of default communication mode information and described server, obtains the port information of the network port of the communication mode information in the request message obtaining corresponding to described message acquisition module;
First information sending module, sends to described client for the described first information being obtained to the port information that module obtains so that described client with corresponding to the network port of this port information, set up network and be connected.
Optionally, the described first information obtains module, comprising:
Port is determined submodule, for according to the corresponding relation of the network port of default communication mode information and described server, determines the network port of the communication mode information in the request message obtaining corresponding to described message acquisition module;
Information acquisition submodule, determines the port information of the network port of the determined network port of submodule in idle condition for obtaining described port.
Optionally, a plurality of network ports that described server comprises all carry type identification; Described device also comprises:
Duration statistical module, for adding up the in running order duration of all types of network ports in the first default duration;
Port number increases module, and for increasing the port number of the network port of target type, described target type is that work duration surpasses the port type under the network port of the first predetermined threshold value.
Optionally, described device also comprises:
Quantity statistics module, for adding up the quantity of the in running order network port;
The first output module, outputs to display device for the quantitative value that described quantity statistics module statistics is obtained, so that user can monitor the port service condition of server.
Optionally, described device also comprises:
State information acquisition module, for obtaining the state information of the network port;
The second output module, outputs to display device for the state information of the network port that described state information acquisition module is got, so that the port working monitoring state that user can be to server.
Optionally, the communication mode of described client and described server is long connected mode or short connected mode; When the communication mode of described client and described server is long connected mode, described device also comprises:
Monitoring modular, is connected disconnection times for monitoring described client in the second default duration with the network between the network port;
Mark module, for by described monitoring module monitors to the disconnection times network port that reaches the second predetermined threshold value be labeled as fault;
The second information acquisition module, for determine described server corresponding to the current communication mode of described client, unmarked be the network port of fault, obtain the port information of a network port in the determined network port;
The second information sending module, sends to described client for the port information that described the second information acquisition module is obtained so that described client with corresponding to the network port of this port information, set up network and be connected.
Set up the device that network connects, be applied to client, described device comprises:
Message transmission module, for sending a request message to server, described request message carries the communication mode information that described client and this server communicate;
Information receiving module, for receiving described server after obtaining the request message that described message transmission module sends, the port information of the network port corresponding to the communication mode information in this request message of transmission; In described server, store default communication mode information and the corresponding relation of the network port in described server;
Network connects sets up module, for setting up the network of the network port that the port information received with described information receiving module is corresponding, connects.
The method that the embodiment of the present invention provides and device, after obtaining the request message of client transmission, can be according to default communication mode information and the corresponding relation of the network port in server, determine the port information corresponding to the network port of the communication mode information in described request message, and determined port information is sent to described client so that described client with corresponding to the network port of this port information, set up network and be connected.
Compared with prior art, network port change in server, the request message that the embodiment of the present invention still can send according to this client, determines the port information corresponding to the network port of this request message, then this port information is sent to client, so that both set up network, connect.
Accompanying drawing explanation
In order to be illustrated more clearly in the embodiment of the present invention or technical scheme of the prior art, to the accompanying drawing of required use in embodiment or description of the Prior Art be briefly described below, apparently, accompanying drawing in the following describes is only some embodiments of the present invention, for those of ordinary skills, do not paying under the prerequisite of creative work, can also obtain according to these accompanying drawings other accompanying drawing.
A kind of flow chart of setting up the method for network connection that Fig. 1 provides for the embodiment of the present invention;
The flow chart of a kind of execution mode of S102 in Fig. 1 that Fig. 2 provides for the embodiment of the present invention;
The another kind that Fig. 3 provides for the embodiment of the present invention is set up the flow chart of the method for network connection;
The another kind that Fig. 4 provides for the embodiment of the present invention is set up the flow chart of the method for network connection;
The another kind that Fig. 5 provides for the embodiment of the present invention is set up the flow chart of the method for network connection;
The another kind that Fig. 6 provides for the embodiment of the present invention is set up the flow chart of the method for network connection;
The another kind that Fig. 7 provides for the embodiment of the present invention is set up the flow chart of the method for network connection;
A kind of structural representation of setting up the device of network connection that Fig. 8 provides for the embodiment of the present invention;
In Fig. 8 that Fig. 9 provides for the embodiment of the present invention, the first information obtains a kind of structural representation of module 802;
The another kind that Figure 10 provides for the embodiment of the present invention is set up the structural representation of the device of network connection;
The another kind that Figure 11 provides for the embodiment of the present invention is set up the structural representation of the device of network connection;
The another kind that Figure 12 provides for the embodiment of the present invention is set up the structural representation of the device of network connection;
The another kind that Figure 13 provides for the embodiment of the present invention is set up the structural representation of the device of network connection;
The another kind that Figure 14 provides for the embodiment of the present invention is set up the structural representation of the device of network connection.
Embodiment
In order to make those skilled in the art understand better the technical scheme in the present invention, below in conjunction with the accompanying drawing in the embodiment of the present invention, technical scheme in the embodiment of the present invention is clearly and completely described, obviously, described embodiment is only the present invention's part embodiment, rather than whole embodiment.Embodiment based in the present invention, those of ordinary skills, not making the every other embodiment obtaining under creative work prerequisite, belong to the scope of protection of the invention.
As one of nucleus equipment of the network equipment, server in the forwarding of message, the storage of content and the aspect such as issue in occupation of leading position.Server generally includes the network port of a plurality of types, and the dissimilar network port provides different functions.The function that client executing is different just need to be connected on the different network port of this server, such as downloading software when carrying out its download function, just need to be connected on the download network port of corresponding server.
Existing foundation in the method that network connects, the document that records client functionality and network port corresponding relation that client need to be pre-stored according to this locality, finds in this server the network port that should item function, carries out network connection.But when the network port upgrading in server or port number change, client just can not, according to original document that records client functionality and network port corresponding relation, cannot find corresponding port.In order to address the above problem, a kind of method and device of setting up network connection that the embodiment of the present invention provides.
First a kind of method of the setting up network connection embodiment of the present invention being provided is below introduced.
It should be noted that, embodiment of the present invention method is applicable in server, and described server comprises a plurality of network ports; In actual applications, this server can be the IM chat server based on netty exploitation.
As shown in Figure 1, a kind of method of setting up network connection that the embodiment of the present invention provides, is applied to server, and described server comprises a plurality of network ports, and the method can comprise:
S101, obtains the request message that client sends, and the request message that described client sends carries the communication mode information that this client and described server communicate.
It should be noted that, from broadly, communication mode can be divided into: long connected mode, and short connected mode, wherein, long connected mode refers in a connection and can send continuously a plurality of packets, during connecting maintenance, if there is no Packet Generation, need both sides to send out link detecting bag; Short connected mode refers to when communication two party has data interaction, just sets up a connection, after data are sent completely, disconnect this and connects, i.e. each connection only completes the transmission of a business.Such as, when client is carried out website and webpage access, the communication mode of employing is short connected mode; When chat tool carries out Internet chat, the communication mode of employing is long connected mode.
Concrete, in actual applications, long connected mode can comprise the communication mode of the type of chatting; Short connected mode can comprise: the communication mode of the communication mode of type of payment, the communication mode of type of download or website visiting type.While carrying out network payment such as the means of payment, the communication mode of employing is exactly the communication mode of type of payment; Download tool is during from network downloading contents, and the communication mode of employing is exactly the communication mode of type of download.
In addition, client functionality is diversified development, in server, the division of labor of the network port is more and clearer and more definite, the network port of one type is conventionally only for client provides a kind of function, such as, payment network port in server can only provide network on-line payment function for the means of payment, and download network port can only provide network download online function for download tool, and the website network port can only provide online access web sites function for website visiting instrument.It should be noted that, above-mentioned is only an instantiation of the embodiment of the present invention, and the embodiment of the present invention includes but not limited to above example.
Be understandable that, before realizing a certain function, client must be obtained the port information of the network port that can realize this function, so that according to the port information getting, the network that builds on this network port connects, thereby realizes its function.
In embodiments of the present invention, because server comprises numerous network ports, and the function that the network port of each type provides is different, therefore, the request message that this just needs server to send according to client, finds the network port corresponding to the current execution function of client.
Further, due to the corresponding a kind of communication mode only conventionally of a certain type network port in server, only, in the situation that adopting this communication mode, client could be set up network with this network port and be connected.Therefore, this just needs server according to the request message that carries communication mode information, from numerous network ports, to find the network port corresponding to the current execution function of client.
S102, according to default communication mode information and the corresponding relation of the network port in described server, obtains the port information corresponding to the network port of the communication mode information in described request message.
It should be noted that, in actual applications, after completing the definition of local network port or upgrading, server can generate in this locality the file that record the network port and communication mode corresponding relation, so that the use while carrying out searching of the network port of this server.
Further, after communication mode information in the request message that obtains client transmission, can, according to the file that records the corresponding relation of the network port in communication mode information and server in this locality, first determine in this server, which the network port corresponding with this communication mode information have; Afterwards, can, from the determined network port, select one for carrying out with this client the network port that network is connected, and obtain the port information of this network port.
Concrete, in an execution mode of the embodiment of the present invention, as shown in Figure 2, above-mentioned S102, can comprise:
S102a, according to default communication mode information and the corresponding relation of the network port in described server, determines the network port corresponding to the communication mode information in described request message.
Be understandable that, in server, the network port of a type comprises a plurality of network ports conventionally, and this server can, according to a kind of communication mode, find a plurality of network ports corresponding to this communication mode.
S102b, obtains the port information of a network port in idle condition in the determined network port.
Preferably, in order to guarantee that setting up network with this server is more quickly connected, can obtain the port information of a network port in idle condition in the determined network port.
S103, sends to described client by obtained port information so that described client with corresponding to the network port of this port information, set up network and be connected.
In embodiments of the present invention, at the port information obtaining corresponding to the network port of obtained communication mode information, obtained port information need to be sent to described client, so that described client is set up network with the network port of port information corresponding to sent, be connected.
As can be seen here, the method of setting up network connection that the embodiment of the present invention provides, after obtaining the request message of client transmission, can be according to default communication mode information and the corresponding relation of the network port in server, determine the port information corresponding to the network port of the communication mode information in described request message, and determined port information is sent to described client so that described client with corresponding to the network port of this port information, set up network and be connected.
Compared with prior art, network port change in server, the request message that the embodiment of the present invention still can send according to this client, determines the port information corresponding to the network port of this request message, then this port information is sent to client, so that both set up network, connect.
Optionally, in one embodiment of the invention, a plurality of network ports that described server comprises all carry type identification; The method of setting up network connection that the embodiment of the present invention provides can also increase S104 and S105 on the basis of method shown in Fig. 1.
It should be noted that, S104 and S105 both can carry out according to the execution sequence of method shown in Fig. 3, also can with method shown in Fig. 1 in each step executed in parallel, the embodiment of the present invention is not construed as limiting this.Below S104 and S105 are described in detail.
S104, the in running order duration of all types of network ports in the default duration of statistics first.
Such as the first default duration is 1 hour, server comprises 4 kinds of network ports, be respectively the first kind network port, the Equations of The Second Kind network port, the 3rd class network port, the 4th class network port, wherein, in the first kind network port, there are 3 network ports, in the Equations of The Second Kind network port, there are 3 network ports, in the 3rd class network port, there are 4 network ports, in the 4th class network port, there are 5 network ports, in 1 hour, in the first kind network port, the total duration of the work of 3 network ports is 20 minutes, in the Equations of The Second Kind network port, the total duration of the work of 3 network ports is 30 minutes, in the 3rd class network port, the total duration of work of 4 network ports is 50 minutes, in the 4th class network port, the total duration of work of 5 network ports is 30 minutes.
It should be noted that, can the value of the default duration of first in the embodiment of the present invention be adjusted according to actual conditions, the embodiment of the present invention does not limit this.
S105, the port number of the network port of increase target type, described target type is the affiliated port type of the network port that work duration surpasses the first predetermined threshold value.
Such as the first predetermined threshold value is 45 minutes, because the total duration of work of 4 network ports in above-mentioned the 3rd class network port is 50 minutes, surpassed 45 minutes, therefore can increase the port number of the network port in the 3rd class network port.
It should be noted that, can the value of the first predetermined threshold value in the embodiment of the present invention be adjusted according to actual conditions, the embodiment of the present invention does not limit this.
As can be seen here, the embodiment of the present invention provides sets up the method that network connects, can be according to the actual service condition of each network port, and the port number of all types of network ports in this server of accommodation, has improved the port utilization ratio of server.
Optionally, in one embodiment of the invention, the method for setting up network connection that the embodiment of the present invention provides can also increase S106 and S107 on the basis of method shown in Fig. 1.
It should be noted that, S106 and S107 both can carry out according to the execution sequence of method shown in Fig. 4, also can with method shown in Fig. 1 in each step executed in parallel, the embodiment of the present invention is not construed as limiting this.Below S106 and S107 are described in detail.
S106, the quantity of adding up the in running order network port.
Optionally, in execution mode of the embodiment of the present invention, can add up the quantity of the network port in running order under current time.
Optionally, in an execution mode of the embodiment of the present invention, can be according to the default time cycle, periodically add up the quantity of the in running order network port.
Optionally, in an execution mode of the embodiment of the present invention, can add up in real time the quantity of the in running order network port.
S107, the quantitative value that statistics is obtained outputs to display device, so that user can monitor the port service condition of server.
Further, after the quantity of the in running order network port of statistics, the quantitative value output that statistics can be obtained, monitors, analyzes for user, and then improves user's responding ability and operating efficiency.
Optionally, in one embodiment of the invention, the method for setting up network connection that the embodiment of the present invention provides can also increase S108 and S109 on the basis of method shown in Fig. 1.
It should be noted that, S108 and S109 both can carry out according to the execution sequence of method shown in Fig. 5, also can with method shown in Fig. 1 in each step executed in parallel, the embodiment of the present invention is not construed as limiting this.Below S108 and S109 are described in detail.
S108, obtains the state information of the network port.
Optionally, in execution mode of the embodiment of the present invention, can obtain the state information of current time lower network port.
Optionally, in an execution mode of the embodiment of the present invention, can, according to the default time cycle, periodically obtain the state information of the network port.
Optionally, in an execution mode of the embodiment of the present invention, can obtain in real time the state information of the network port.
S109, outputs to display device by the state information of the network port getting, so that the port working monitoring state that user can be to server.
Further, after obtaining the state information of the network port, can, by the state information output of the network port getting, for user, monitor, analyze, and then improve user's responding ability and operating efficiency.
Optionally, in one embodiment of the invention, the communication mode of described client and described server is long connected mode or short connected mode; When the communication mode of described client and described server is long connected mode, the method for setting up network connection that the embodiment of the present invention provides can also increase S110, S111, S112 and S113 on the basis of method shown in Fig. 1.
It should be noted that, S110, S111, S112 and S113 both can carry out according to the execution sequence of method shown in Fig. 6, also can with method shown in Fig. 1 in each step executed in parallel, the embodiment of the present invention is not construed as limiting this.Below S110, S111, S112 and S113 are described in detail.
S110, in the default duration of monitoring second, described client is connected disconnection times with the network between the network port.
Be understandable that, when the communication mode of client and server is long connected mode, this client and server need to keep network connection state within a certain period of time, such as chat tool is when carrying out online chatting, just need to remain with server in network connection state.If during this period, client is connected often disconnection with the network of server, such as chat tool often goes offline, will affect user's experience.
Based on the problems referred to above, the embodiment of the present invention can be connected disconnection times to client and network between the network port monitors, and further, can monitor described client in the second default duration and be connected disconnection times with the network between the network port.
It should be noted that, can the value of the default duration of second in the embodiment of the present invention be adjusted according to actual conditions, the embodiment of the present invention does not limit this.
S111, the network port that disconnection times is reached to the second predetermined threshold value is labeled as fault.
It should be noted that, can the value of the second predetermined threshold value in the embodiment of the present invention be adjusted according to actual conditions, the embodiment of the present invention does not limit this.
As can be seen here, the method for setting up network connection that the embodiment of the present invention provides, can automatically detect network connection and have the abnormal network port, and be fault by this port label, thus the quick positioning equipment fault of aspect O&M personnel.
S112, determine in described server corresponding to the current communication mode of described client, unmarked be the network port of fault, obtain the port information of a network port in the determined network port.
S113, sends to described client by this port information so that described client with corresponding to the network port of this port information, set up network and be connected.
As shown in Figure 7, a kind of method of setting up network connection that the embodiment of the present invention provides, is applied to client, and the method can comprise:
S701, sends a request message to server, and described request message carries the communication mode information that described client and this server communicate.
It should be noted that, from broadly, communication mode can be divided into: long connected mode, and short connected mode, wherein, long connected mode refers in a connection and can send continuously a plurality of packets, during connecting maintenance, if there is no Packet Generation, need both sides to send out link detecting bag; Short connected mode refers to when communication two party has data interaction, just sets up a connection, after data are sent completely, disconnect this and connects, i.e. each connection only completes the transmission of a business.Such as, when client is carried out website and webpage access, the communication mode of employing is short connected mode; When chat tool carries out Internet chat, the communication mode of employing is long connected mode.
Concrete, in actual applications, long connected mode can comprise the communication mode of the type of chatting; Short connected mode can comprise: the communication mode of the communication mode of type of payment, the communication mode of type of download or website visiting type.While carrying out network payment such as the means of payment, the communication mode of employing is exactly the communication mode of type of payment; Download tool is during from network downloading contents, and the communication mode of employing is exactly the communication mode of type of download.
S702, receives described server after obtaining described request message, the port information of the network port corresponding to the communication mode information in this request message of transmission; In described server, store default communication mode information and the corresponding relation of the network port in described server.
S703, the network of setting up the network port corresponding with received port information connects.
It should be noted that, in actual applications, after completing the definition of local network port or upgrading, server can generate in this locality the file that record the network port and communication mode corresponding relation, so that the use while carrying out searching of the network port of this server.
Further, after communication mode information in the request message that obtains client transmission, server can, according to the file that records the corresponding relation of the network port in communication mode information and server in this locality, first determine in this server, which the network port corresponding with this communication mode information have; Afterwards, can, from the determined network port, select one and obtain the port information of this network port for carrying out with this client the network port that network is connected, and this port information is sent to client.
The port information that client in the embodiment of the present invention can reception server sends, and according to this port information, sets up the network connection of the network port corresponding with this port information.
As can be seen here, the method of setting up network connection that the embodiment of the present invention provides, can send the request message that carries communication mode information to server, and receive described server after obtaining described request message, the port information of the network port corresponding to the communication mode information in this request message sending, and then the network connection of the foundation network port corresponding with received port information.
Compared with prior art, network port change in server, the embodiment of the present invention still can be after sending a request message to this server, receive and identify the port information of the network port corresponding to this request message of this server transmission, and foundation is connected with the network port network corresponding to this port information.
Corresponding to the embodiment of the method shown in Fig. 1, the embodiment of the present invention also provides a kind of device that network connects of setting up.
As shown in Figure 8, a kind of device of setting up network connection that the embodiment of the present invention provides, is applied to server, and described server comprises a plurality of network ports, and this device can comprise:
Message acquisition module 801, the request message sending for obtaining client, the request message that described client sends carries the communication mode information that this client and described server communicate;
The first information obtains module 802, for according to the corresponding relation of the network port of default communication mode information and described server, obtain the port information of the network port of the communication mode information in the request message obtaining corresponding to described message acquisition module 801;
First information sending module 803, sends to described client for the described first information being obtained to the port information that module 802 obtains, so that described client is set up network with the network port of port information corresponding to this, is connected.
As can be seen here, the device of setting up network connection that the embodiment of the present invention provides, after obtaining the request message of client transmission, can be according to default communication mode information and the corresponding relation of the network port in server, determine the port information corresponding to the network port of the communication mode information in described request message, and determined port information is sent to described client so that described client with corresponding to the network port of this port information, set up network and be connected.
Compared with prior art, network port change in server, the request message that the embodiment of the present invention still can send according to this client, determines the port information corresponding to the network port of this request message, then this port information is sent to client, so that both set up network, connect.
Optionally, in one embodiment of the invention, the first information as shown in Figure 9 obtains module 802, can comprise:
Port is determined submodule 802a, for according to the corresponding relation of the network port of default communication mode information and described server, determines the network port of the communication mode information in the request message obtaining corresponding to described message acquisition module 801;
Information acquisition submodule 802b, determines the port information of the network port of the determined network port of submodule 802a in idle condition for obtaining described port.
Optionally, in one embodiment of the invention, a plurality of network ports that described server comprises all carry type identification; The device of setting up network connection that the embodiment of the present invention provides can also on the basis of Fig. 8 shown device, increase duration statistical module 804 and port number increases module 805.
It should be noted that, duration statistical module 804 increases module 805 with port number and both can be connected according to the connected mode of Figure 10 shown device, also can connect according to other connected mode, and the embodiment of the present invention is not construed as limiting this.Below the function of duration statistical module 804 and port number increase module 805 is described in detail.
Duration statistical module 804, for adding up the in running order duration of all types of network ports in the first default duration;
Port number increases module 805, and for increasing the port number of the network port of target type, described target type is that work duration surpasses the port type under the network port of the first predetermined threshold value.
Optionally, in one embodiment of the invention, the embodiment of the present invention provides sets up device that network connects can also on the basis of Fig. 8 shown device, accelerate statistical module 806 and the first output module 807.
It should be noted that, quantity statistics module 806 both can be connected according to the connected mode of Figure 11 shown device with the first output module 807, also can connect according to other connected mode, and the embodiment of the present invention is not construed as limiting this.Below the function of quantity statistical module 806 and the first output module 807 is described in detail.
Quantity statistics module 806, for adding up the quantity of the in running order network port;
The first output module 807, outputs to display device for the quantitative value that described quantity statistics module 806 statistics are obtained, so that user can monitor the port service condition of server.
Optionally, in one embodiment of the invention, the device of setting up network connection that the embodiment of the present invention provides can also increase state information acquisition module 808 and the second output module 809 on the basis of Fig. 8 shown device.
It should be noted that, state information acquisition module 808 both can be connected according to the connected mode of Figure 12 shown device with the second output module 809, also can connect according to other connected mode, and the embodiment of the present invention is not construed as limiting this.Below the function of state information acquisition module 808 and the second output module 809 is described in detail.
State information acquisition module 808, for obtaining the state information of the network port;
The second output module 809, outputs to display device for the state information of the network port that described state information acquisition module 808 is got, so that the port working monitoring state that user can be to server.
Optionally, in one embodiment of the invention, the communication mode of described client and described server is long connected mode or short connected mode; When the communication mode of described client and described server is long connected mode, the device of setting up network connection that the embodiment of the present invention provides can also increase monitoring modular 810, mark module 811, the second information acquisition modules 812 and the second information sending module 813 on the basis of Fig. 8 shown device.
It should be noted that, monitoring modular 810, mark module 811, the second information acquisition module 812 both can be connected according to the connected mode of Figure 13 shown device with the second information sending module 813, also can connect according to other connected mode, and the embodiment of the present invention is not construed as limiting this.Below the function of monitoring modular 810, mark module 811, the second information acquisition modules 812 and the second information sending module 813 is described in detail.
Monitoring modular 810, is connected disconnection times for monitoring described client in the second default duration with the network between the network port;
Mark module 811, the network port that reaches the second predetermined threshold value for the disconnection times that described monitoring modular 810 is monitored is labeled as fault;
The second information acquisition module 812, for determine described server corresponding to the current communication mode of described client, unmarked be the network port of fault, obtain the port information of a network port in the determined network port;
The second information sending module 813, sends to described client for the port information that described the second information acquisition module 812 is obtained so that described client with corresponding to the network port of this port information, set up network and be connected.
Corresponding to the embodiment of the method shown in Fig. 7, the embodiment of the present invention also provides a kind of device that network connects of setting up.
As shown in figure 14, a kind of device of setting up network connection that the embodiment of the present invention provides, is applied to client, and this device can comprise:
Message transmission module 1401, for sending a request message to server, described request message carries the communication mode information that described client and this server communicate;
Information receiving module 1402, for receiving described server after obtaining the request message that described message transmission module 1401 sends, the port information of the network port corresponding to this communication mode information of transmission; In described server, store default communication mode information and the corresponding relation of the network port in described server;
Network connects sets up module 1403, for setting up the network of the network port that the port information received with described information receiving module 1402 is corresponding, connects.
As can be seen here, the device of setting up network connection that the embodiment of the present invention provides, can send the request message that carries communication mode information to server, and receive described server after obtaining described request message, the port information of the network port corresponding to the communication mode information in this request message sending, and then the network connection of the foundation network port corresponding with received port information.
Compared with prior art, network port change in server, the embodiment of the present invention still can be after sending a request message to this server, receive and identify the port information of the network port corresponding to this request message of this server transmission, and foundation is connected with the network port network corresponding to this port information.
For device embodiment, because it is substantially similar in appearance to embodiment of the method, so description is fairly simple, relevant part is referring to the part explanation of embodiment of the method.
While for convenience of description, describing above device, with function, being divided into various modules describes respectively.Certainly, when enforcement is of the present invention, the function of each module can be realized in same or a plurality of software and/or hardware.
It should be noted that, in this article, relational terms such as the first and second grades is only used for an entity or operation to separate with another entity or operating space, and not necessarily requires or imply and between these entities or operation, have the relation of any this reality or sequentially.And, term " comprises ", " comprising " or its any other variant are intended to contain comprising of nonexcludability, thereby the process, method, article or the equipment that make to comprise a series of key elements not only comprise those key elements, but also comprise other key elements of clearly not listing, or be also included as the intrinsic key element of this process, method, article or equipment.The in the situation that of more restrictions not, the key element being limited by statement " comprising ... ", and be not precluded within process, method, article or the equipment that comprises described key element and also have other identical element.
Each embodiment in this specification all adopts relevant mode to describe, between each embodiment identical similar part mutually referring to, each embodiment stresses is the difference with other embodiment.Especially, for device embodiment, because it is substantially similar in appearance to embodiment of the method, so description is fairly simple, relevant part is referring to the part explanation of embodiment of the method.
One of ordinary skill in the art will appreciate that all or part of step realizing in said method execution mode is to come the hardware that instruction is relevant to complete by program, described program can be stored in computer read/write memory medium, here alleged storage medium, as: ROM/RAM, magnetic disc, CD etc.
The foregoing is only preferred embodiment of the present invention, be not intended to limit protection scope of the present invention.All any modifications of doing within the spirit and principles in the present invention, be equal to replacement, improvement etc., be all included in protection scope of the present invention.

Claims (14)

1. set up the method that network connects, be applied to server, described server comprises a plurality of network ports, it is characterized in that, comprising:
Obtain the request message that client sends, the request message that described client sends carries the communication mode information that this client and described server communicate;
According to default communication mode information and the corresponding relation of the network port in described server, obtain the port information corresponding to the network port of the communication mode information in described request message;
Obtained port information is sent to described client so that described client with corresponding to the network port of this port information, set up network and be connected.
2. method according to claim 1, it is characterized in that, the communication mode information that described basis is default and the corresponding relation of the network port in described server, obtain the port information corresponding to the network port of the communication mode information in described request message, comprising:
According to default communication mode information and the corresponding relation of the network port in described server, determine the network port corresponding to the communication mode information in described request message;
Obtain the port information of a network port in idle condition in the determined network port.
3. method according to claim 1, is characterized in that, a plurality of network ports that described server comprises all carry type identification; Described method also comprises:
The in running order duration of all types of network ports in the default duration of statistics first;
Increase the port number of the network port of target type, described target type is the affiliated port type of the network port that work duration surpasses the first predetermined threshold value.
4. method according to claim 1, is characterized in that, described method also comprises:
Add up the quantity of the in running order network port;
The quantitative value that statistics is obtained outputs to display device, so that user can monitor the port service condition of server.
5. method according to claim 1, is characterized in that, described method also comprises:
Obtain the state information of the network port;
The state information of the network port getting is outputed to display device, so that the port working monitoring state that user can be to server.
6. method according to claim 1, is characterized in that, the communication mode of described client and described server is long connected mode or short connected mode; When the communication mode of described client and described server is long connected mode, described method also comprises:
In the default duration of monitoring second, described client is connected disconnection times with the network between the network port;
The network port that disconnection times is reached to the second predetermined threshold value is labeled as fault;
Determine in described server corresponding to the current communication mode of described client, unmarked be the network port of fault, obtain the port information of a network port in the determined network port;
This port information is sent to described client so that described client with corresponding to the network port of this port information, set up network and be connected.
7. set up the method that network connects, be applied to client, it is characterized in that, comprising:
To server, send a request message, described request message carries the communication mode information that described client and this server communicate;
Receive described server after obtaining described request message, the port information of the network port corresponding to the communication mode information in this request message of transmission; In described server, store default communication mode information and the corresponding relation of the network port in described server;
The network of setting up the network port corresponding with received port information connects.
8. set up the device that network connects, be applied to server, described server comprises a plurality of network ports, it is characterized in that, comprising:
Message acquisition module, the request message sending for obtaining client, the request message that described client sends carries the communication mode information that this client and described server communicate;
The first information obtains module, for according to the corresponding relation of the network port of default communication mode information and described server, obtains the port information of the network port of the communication mode information in the request message obtaining corresponding to described message acquisition module;
First information sending module, sends to described client for the described first information being obtained to the port information that module obtains so that described client with corresponding to the network port of this port information, set up network and be connected.
9. device according to claim 8, is characterized in that, the described first information obtains module, comprising:
Port is determined submodule, for according to the corresponding relation of the network port of default communication mode information and described server, determines the network port of the communication mode information in the request message obtaining corresponding to described message acquisition module;
Information acquisition submodule, determines the port information of the network port of the determined network port of submodule in idle condition for obtaining described port.
10. device according to claim 8, is characterized in that, a plurality of network ports that described server comprises all carry type identification; Described device also comprises:
Duration statistical module, for adding up the in running order duration of all types of network ports in the first default duration;
Port number increases module, and for increasing the port number of the network port of target type, described target type is that work duration surpasses the port type under the network port of the first predetermined threshold value.
11. devices according to claim 8, is characterized in that, described device also comprises:
Quantity statistics module, for adding up the quantity of the in running order network port;
The first output module, outputs to display device for the quantitative value that described quantity statistics module statistics is obtained, so that user can monitor the port service condition of server.
12. devices according to claim 8, is characterized in that, described device also comprises:
State information acquisition module, for obtaining the state information of the network port;
The second output module, outputs to display device for the state information of the network port that described state information acquisition module is got, so that the port working monitoring state that user can be to server.
13. devices according to claim 8, is characterized in that, the communication mode of described client and described server is long connected mode or short connected mode; When the communication mode of described client and described server is long connected mode, described device also comprises:
Monitoring modular, is connected disconnection times for monitoring described client in the second default duration with the network between the network port;
Mark module, for by described monitoring module monitors to the disconnection times network port that reaches the second predetermined threshold value be labeled as fault;
The second information acquisition module, for determine described server corresponding to the current communication mode of described client, unmarked be the network port of fault, obtain the port information of a network port in the determined network port;
The second information sending module, sends to described client for the port information that described the second information acquisition module is obtained so that described client with corresponding to the network port of this port information, set up network and be connected.
Set up the device that network connects for 14. 1 kinds, be applied to client, it is characterized in that, comprising:
Message transmission module, for sending a request message to server, described request message carries the communication mode information that described client and this server communicate;
Information receiving module, for receiving described server after obtaining the request message that described message transmission module sends, the port information of the network port corresponding to the communication mode information in this request message of transmission; In described server, store default communication mode information and the corresponding relation of the network port in described server;
Network connects sets up module, for setting up the network of the network port that the port information received with described information receiving module is corresponding, connects.
CN201410472857.3A 2014-09-16 2014-09-16 A kind of method and device for establishing network connection Active CN104202334B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410472857.3A CN104202334B (en) 2014-09-16 2014-09-16 A kind of method and device for establishing network connection

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410472857.3A CN104202334B (en) 2014-09-16 2014-09-16 A kind of method and device for establishing network connection

Publications (2)

Publication Number Publication Date
CN104202334A true CN104202334A (en) 2014-12-10
CN104202334B CN104202334B (en) 2018-11-16

Family

ID=52087559

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410472857.3A Active CN104202334B (en) 2014-09-16 2014-09-16 A kind of method and device for establishing network connection

Country Status (1)

Country Link
CN (1) CN104202334B (en)

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105610924A (en) * 2015-12-24 2016-05-25 深圳市华讯方舟软件技术有限公司 Multi-node connection method and device of cloud desktop
CN106303702A (en) * 2015-06-11 2017-01-04 阿里巴巴集团控股有限公司 Connection status inspection method, device and intelligent television system
CN109347933A (en) * 2018-09-29 2019-02-15 乐蜜有限公司 A kind of method and apparatus for establishing connection
CN109495600A (en) * 2018-11-19 2019-03-19 北京知道创宇信息技术有限公司 Website access method, device and readable storage medium storing program for executing
CN111181807A (en) * 2019-12-26 2020-05-19 国汽(北京)智能网联汽车研究院有限公司 Communication interface device and multi-port communication interaction method
CN111586714A (en) * 2020-04-21 2020-08-25 珠海格力电器股份有限公司 Network port allocation method, device, electronic equipment and computer usable medium
CN113645294A (en) * 2021-08-06 2021-11-12 腾讯科技(深圳)有限公司 Message acquisition method and device, computer equipment and message transmission system
CN114866421A (en) * 2022-05-13 2022-08-05 西安广和通无线通信有限公司 Port management method, device, equipment and computer readable storage medium
CN115512481A (en) * 2022-09-22 2022-12-23 广东便捷神科技股份有限公司 Server data processing method networked with vending machine

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101583086A (en) * 2009-06-19 2009-11-18 广州市中海达测绘仪器有限公司 Method for controlling data interaction among mobile terminals and system thereof
CN102185856A (en) * 2011-03-22 2011-09-14 北京朗玛数联科技有限公司 Team organizing video method, device and system used in team organizing game
CN102572003A (en) * 2010-12-08 2012-07-11 中国电信股份有限公司 Method and system for acquiring and processing multiplexing address and port range
JP2012216884A (en) * 2011-03-31 2012-11-08 Hitachi Ltd Network system, computer distribution device and distribution method
CN103095783A (en) * 2011-11-08 2013-05-08 阿里巴巴集团控股有限公司 Method and device for web application debugging

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101583086A (en) * 2009-06-19 2009-11-18 广州市中海达测绘仪器有限公司 Method for controlling data interaction among mobile terminals and system thereof
CN102572003A (en) * 2010-12-08 2012-07-11 中国电信股份有限公司 Method and system for acquiring and processing multiplexing address and port range
CN102185856A (en) * 2011-03-22 2011-09-14 北京朗玛数联科技有限公司 Team organizing video method, device and system used in team organizing game
JP2012216884A (en) * 2011-03-31 2012-11-08 Hitachi Ltd Network system, computer distribution device and distribution method
CN103095783A (en) * 2011-11-08 2013-05-08 阿里巴巴集团控股有限公司 Method and device for web application debugging

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106303702A (en) * 2015-06-11 2017-01-04 阿里巴巴集团控股有限公司 Connection status inspection method, device and intelligent television system
CN105610924A (en) * 2015-12-24 2016-05-25 深圳市华讯方舟软件技术有限公司 Multi-node connection method and device of cloud desktop
CN105610924B (en) * 2015-12-24 2019-03-12 深圳市华讯方舟软件技术有限公司 A kind of method and apparatus of cloud desktop multinode connection
CN109347933A (en) * 2018-09-29 2019-02-15 乐蜜有限公司 A kind of method and apparatus for establishing connection
CN109495600B (en) * 2018-11-19 2022-04-29 北京知道创宇信息技术股份有限公司 Website access method and device and readable storage medium
CN109495600A (en) * 2018-11-19 2019-03-19 北京知道创宇信息技术有限公司 Website access method, device and readable storage medium storing program for executing
CN111181807A (en) * 2019-12-26 2020-05-19 国汽(北京)智能网联汽车研究院有限公司 Communication interface device and multi-port communication interaction method
CN111586714A (en) * 2020-04-21 2020-08-25 珠海格力电器股份有限公司 Network port allocation method, device, electronic equipment and computer usable medium
CN111586714B (en) * 2020-04-21 2021-07-20 珠海格力电器股份有限公司 Network port allocation method, device, electronic equipment and computer usable medium
CN113645294A (en) * 2021-08-06 2021-11-12 腾讯科技(深圳)有限公司 Message acquisition method and device, computer equipment and message transmission system
CN114866421A (en) * 2022-05-13 2022-08-05 西安广和通无线通信有限公司 Port management method, device, equipment and computer readable storage medium
CN114866421B (en) * 2022-05-13 2024-05-14 西安广和通无线通信有限公司 Port management method, device, equipment and computer readable storage medium
CN115512481A (en) * 2022-09-22 2022-12-23 广东便捷神科技股份有限公司 Server data processing method networked with vending machine
CN115512481B (en) * 2022-09-22 2023-07-14 广东便捷神科技股份有限公司 Server data processing method networked with vending machine

Also Published As

Publication number Publication date
CN104202334B (en) 2018-11-16

Similar Documents

Publication Publication Date Title
CN104202334A (en) Network connection establishing method and device
US10715639B2 (en) Data processing method and apparatus for performing protocol parsing in a cloud
US8115631B2 (en) Determining endpoint connectivity of cabling interconnects
CN106844645B (en) Power communication equipment information inquiry system
CN102904903B (en) Communication system and communication means
CN109656755A (en) The method and system of detection device state
AU2015234371A1 (en) Apparatus and method for analyzing a control network
CN105099763A (en) Method and device for reminding lost connection of equipment
CN112737800A (en) Service node fault positioning method, call chain generation method and server
CN103746840A (en) Method and system for automatic checking of software version information of network equipment
CN104270434A (en) Service state monitoring system based on cloud service
CN101964923A (en) Configuration system and method for interactive commands
CN117176802B (en) Full-link monitoring method and device for service request, electronic equipment and medium
CN105530137A (en) Traffic data analysis method and traffic data analysis system
CN104639351A (en) Processing system and method for constructing network structure deployment diagram
CN103986620A (en) Monitoring item management method and system based on XML mode
CN107430391A (en) Management system
CN108965403A (en) O&M monitors establishment of connection method and terminal device
CN115951923B (en) Subscription event management method, display system, device and storage medium
CN103546563A (en) Method and system for intelligent update of terminal software
CN114244686B (en) Communication fault detection method, device and system
CN105281944B (en) Method for setting network protocol address and service management system
CN105871659A (en) Monitoring method and device of newly added server
Liu et al. A middleware-based implementation for data integration of remote devices
CN102480388A (en) Monitoring method

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 510623 3101-31063108-3110 house, Hua Xia Road, Tianhe District, Guangzhou, Guangdong.

Applicant after: Guangzhou cheetah Network Technology Co., Ltd.

Address before: 510623 01-B sixth unit, Guangzhou bank building, 30 Zhujiang East Road, Tianhe District, Guangzhou, Guangdong.

Applicant before: Kingsoft, Guangzhou network technology Co., Ltd

GR01 Patent grant
GR01 Patent grant