Movatterモバイル変換


[0]ホーム

URL:


CN104202334B - A kind of method and device for establishing network connection - Google Patents

A kind of method and device for establishing network connection
Download PDF

Info

Publication number
CN104202334B
CN104202334BCN201410472857.3ACN201410472857ACN104202334BCN 104202334 BCN104202334 BCN 104202334BCN 201410472857 ACN201410472857 ACN 201410472857ACN 104202334 BCN104202334 BCN 104202334B
Authority
CN
China
Prior art keywords
port
network
information
server
network port
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.)
Expired - Fee Related
Application number
CN201410472857.3A
Other languages
Chinese (zh)
Other versions
CN104202334A (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.)
Guangzhou Cheetah Network Technology Co Ltd
Original Assignee
Guangzhou Cheetah 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 Guangzhou Cheetah Network Technology Co LtdfiledCriticalGuangzhou Cheetah Network Technology Co Ltd
Priority to CN201410472857.3ApriorityCriticalpatent/CN104202334B/en
Publication of CN104202334ApublicationCriticalpatent/CN104202334A/en
Application grantedgrantedCritical
Publication of CN104202334BpublicationCriticalpatent/CN104202334B/en
Expired - Fee Relatedlegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Landscapes

Abstract

The embodiment of the invention discloses a kind of method and devices for establishing network connection.A method of network connection is established, server is applied to, this method includes:The request message that client is sent is obtained, the request message that client is sent carries the communication method information that the client is communicated with the server;According to the corresponding relationship of the network port in preset communication method information and the server, the port information of the network port of the communication method information corresponded in the request message is obtained;Port information obtained is sent to the client, is connected to the network so that the client is established with the network port for corresponding to the port information.Using above-mentioned technical proposal, the network port in server changes, and the embodiment of the present invention still is able to the request message sent according to the client, determines the port information for corresponding to the network port of the request message, then the port information is sent to client, so that the two establishes network connection.

Description

A kind of method and device for establishing network connection
Technical field
The present invention relates to Internet technical field, in particular to a kind of method and device for establishing network connection.
Background technique
Core equipment one of of the server as the network equipment, the forwarding of message, the storage of content and in terms ofIn occupation of leading position.Server generally includes the network port of multiple types, and the different types of network port provides differentFunction.The different function of client executing just requires connect on the different network ports of the server, such as payment softwareWhen executing its payment function, it is necessary to be connected on the payment network port of corresponding server.
In the prior art, when executing a certain function, client can have client function according to local pre-stored recordThe network port for corresponding to this function in the server can be found, is connected to the network with the document of network port corresponding relationship.
However, once the network port in server changes, the network port and client functionality in the serverCorresponding relationship can also change, and client has the text of client functionality Yu network port corresponding relationship according to original recordShelves, can not find the network port corresponding with its function, lead to connection failure.
Summary of the invention
To solve the above-mentioned problems, the embodiment of the invention discloses a kind of method and devices for establishing network connection, specificallyTechnical solution is as follows:
A method of network connection is established, is applied to server, the server includes multiple network ports, the sideMethod includes:
Obtain the request message that client is sent, the request message that the client is sent carry the client with it is describedThe communication method information that server is communicated;
According to the corresponding relationship of the network port in preset communication method information and the server, obtains and correspond to instituteState the port information of the network port of the communication method information in request message;
Port information obtained is sent to the client so that the client with correspond to the port informationThe network port establishes network connection.
Optionally, the corresponding relationship according to the network port in preset communication method information and the server,The port information of the network port of the communication method information corresponded in the request message is obtained, including:
According to the corresponding relationship of the network port in preset communication method information and the server, determines and correspond to instituteState the network port of the communication method information in request message;
The port information for a network port being in idle condition in the network port determined by obtaining.
Optionally, multiple network ports that the server includes carry type identification;The method also includes:
Count the duration that all types of network ports are in running order in the first preset duration;
Increase the port number of the network port of target type, the target type is that operating time is more than the first default thresholdPort type belonging to the network port of value.
Optionally, the method also includes:
Count the quantity of the in running order network port;
The obtained quantitative value of statistics is output to display equipment, so as to user can port service condition to server intoRow monitoring.
Optionally, the method also includes:
Obtain the status information of the network port;
The status information for the network port that will acquire is output to display equipment, so that user can be to the port of serverWorking condition is monitored.
Optionally, the communication mode of the client and the server is long connection type or short connection type;Work as instituteWhen the communication mode for stating client and the server is long connection type, the method also includes:
Monitor the network connection disconnection times in the second preset duration between the client and the network port;
It will be switched off number and reach the network port of the second preset threshold labeled as failure;
It determines in the server corresponding to the client present communications mode, the unmarked network-side for failureMouthful, obtain the port information of a network port in the identified network port;
The port information is sent to the client, so that the client and the network-side for corresponding to the port informationMouth establishes network connection.
A method of network connection is established, client is applied to, the method includes:
Request message is sent to server, the request message carries what the client was communicated with the serverCommunication method information;
The server is received after obtaining the request message, the communication mode of transmission corresponded in the request messageThe port information of the network port of information;It is stored in the server in preset communication method information and the serverThe corresponding relationship of the network port;
Establish the network connection of the network port corresponding with received port information.
A kind of device for establishing network connection, is applied to server, the server includes multiple network ports, the dressSet including:
Message capturing module, for obtaining the request message of client transmission, the request message that the client is sent is takenThe communication method information communicated with the client with the server;
The first information obtains module, for according to the network port in preset communication method information and the serverCorresponding relationship obtains the network port of the communication method information corresponded in request message acquired in the message capturing modulePort information;
First information sending module, it is described for first information acquisition module port information obtained to be sent toClient is connected to the network so that the client is established with the network port for corresponding to the port information.
Optionally, the first information obtains module, including:
Port determines submodule, for pair according to the network port in preset communication method information and the serverIt should be related to, determine the network port of the communication method information corresponded in request message acquired in the message capturing module;
Information acquisition submodule determines in the network port determined by submodule for obtaining the port in idle shapeThe port information of one network port of state.
Optionally, multiple network ports that the server includes carry type identification;Described device further includes:
Duration statistical module, for counting the duration that all types of network ports are in running order in the first preset duration;
Port number increases module, the port number of the network port for increasing target type, and the target type isOperating time is more than port type belonging to the network port of the first preset threshold.
Optionally, described device further includes:
Quantity statistics module, for counting the quantity of the in running order network port;
First output module, the quantitative value for counting the quantity statistics module are output to display equipment, withJust user can the port service condition to server be monitored.
Optionally, described device further includes:
State information acquisition module, for obtaining the status information of the network port;
Second output module, the status information output of the network port for getting the state information acquisition moduleTo display equipment, so as to user can the port working state to server be monitored.
Optionally, the communication mode of the client and the server is long connection type or short connection type;Work as instituteWhen the communication mode for stating client and the server is long connection type, described device further includes:
Monitoring modular is disconnected for monitoring the network connection in the second preset duration between the client and the network portNumber;
Mark module, for by the monitoring module monitors to disconnection times reach the network port of the second preset thresholdLabeled as failure;
Second information acquisition module, for determine in the server corresponding to the client present communications mode,The unmarked network port for failure obtains the port information of a network port in the identified network port;
Second information sending module, it is described for the second information acquisition module port information obtained to be sent toClient is connected to the network so that the client is established with the network port for corresponding to the port information.
A kind of device for establishing network connection, is applied to client, and described device includes:
Message transmission module, for server send request message, the request message carry the client withThe communication method information that the server is communicated;
Information receiving module is obtaining request message transmitted by the message transmission module for receiving the serverAfterwards, the port information of the network port for corresponding to the communication method information in the request message of transmission;It is deposited in the serverContain the corresponding relationship of the network port in preset communication method information and the server;
Module is established in network connection, for establishing net corresponding with port information received by the information receiving moduleThe network connection of network port.
Method and device provided in an embodiment of the present invention can be according to pre- after obtaining the request message that client is sentIf communication method information and server in the network port corresponding relationship, determine correspond to the request message in communicationThe port information of the network port of mode information, and identified port information is sent to the client, so that the visitorFamily end is established with the network port for corresponding to the port information and is connected to the network.
Compared with prior art, the network port in server changes, and the embodiment of the present invention still is able to according to the visitorThe request message that family end is sent determines the port information for corresponding to the network port of the request message, then by the port informationIt is sent to client, so that the two establishes network connection.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show belowThere is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only thisSome embodiments of invention for those of ordinary skill in the art without creative efforts, can be withIt obtains other drawings based on these drawings.
Fig. 1 is a kind of flow chart of method for establishing network connection provided in an embodiment of the present invention;
Fig. 2 is a kind of flow chart of embodiment of S102 in Fig. 1 provided in an embodiment of the present invention;
Fig. 3 is the flow chart of another method for establishing network connection provided in an embodiment of the present invention;
Fig. 4 is the flow chart of another method for establishing network connection provided in an embodiment of the present invention;
Fig. 5 is the flow chart of another method for establishing network connection provided in an embodiment of the present invention;
Fig. 6 is the flow chart of another method for establishing network connection provided in an embodiment of the present invention;
Fig. 7 is the flow chart of another method for establishing network connection provided in an embodiment of the present invention;
Fig. 8 is a kind of structural schematic diagram of device for establishing network connection provided in an embodiment of the present invention;
Fig. 9 is a kind of structural schematic diagram that the first information obtains module 802 in Fig. 8 provided in an embodiment of the present invention;
Figure 10 is the structural schematic diagram of another device for establishing network connection provided in an embodiment of the present invention;
Figure 11 is the structural schematic diagram of another device for establishing network connection provided in an embodiment of the present invention;
Figure 12 is the structural schematic diagram of another device for establishing network connection provided in an embodiment of the present invention;
Figure 13 is the structural schematic diagram of another device for establishing network connection provided in an embodiment of the present invention;
Figure 14 is the structural schematic diagram of another device for establishing network connection provided in an embodiment of the present invention.
Specific embodiment
In order to make those skilled in the art more fully understand the technical solution in the present invention, implement below in conjunction with the present inventionAttached drawing in example, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described embodimentOnly a part of the embodiment of the present invention, instead of all the embodiments.Based on the embodiments of the present invention, the common skill in this fieldArt personnel every other embodiment obtained without making creative work belongs to the model that the present invention protectsIt encloses.
One of core equipment as the network equipment, server the forwarding of message, the storage of content and in terms ofIn occupation of leading position.Server generally includes the network port of multiple types, and the different types of network port provides differentFunction.The different function of client executing just requires connect on the different network ports of the server, such as downloading softwareWhen executing its download function, it is necessary to be connected on the downloading network port of corresponding server.
In the existing method for establishing network connection, client needs to have client function according to local pre-stored recordThe network port for corresponding to this function in the server can be found, is connected to the network with the document of network port corresponding relationship.But when the network port upgrading or port number variation in server, client cannot have according to original recordThe document of client functionality and network port corresponding relationship can not find corresponding port.To solve the above-mentioned problems, of the inventionA kind of method and device for foundation network connection that embodiment provides.
First below to it is provided in an embodiment of the present invention it is a kind of establish network connection method be introduced.
It should be noted that present invention method, suitable for server, the server includes multiple network-sidesMouthful;In practical applications, which can be the IM chat server developed based on netty.
As shown in Figure 1, a kind of method for establishing network connection provided in an embodiment of the present invention, is applied to server, it is describedServer includes multiple network ports, and this method may include:
S101, obtains the request message that client is sent, and the request message that the client is sent carries the clientThe communication method information communicated with the server.
It should be noted that in a larger sense, communication mode can be divided into:Long connection type and short connection type,Wherein, long connection type, which refers to, can continuously transmit multiple data packets in a connection, during connecting holding, if do not countedIt is sent according to packet, both sides is needed to send out link detecting packet;When short connection type refers to that communication two party has data interaction, a company is just establishedIt connects, after data are sent completely, then disconnect this connection, i.e., connect the transmission for only completing a business every time.For example, client carries outWhen website and webpage access, the communication mode used is short connection type;When chat tool carries out Internet chat, the communication party of useFormula is long connection type.
Specifically, in practical applications, long connection type may include the communication mode of chat-type;Short connection type canTo include:The communication mode of the communication mode of type of payment, the communication mode of type of download or website visiting type.For example it props upWhen the tool of paying carries out network payment, the communication mode of use is exactly the communication mode of type of payment;Download tool is downloaded from networkWhen content, the communication mode of use is exactly the communication mode of type of download.
In addition, client functionality is in diversified development, the division of labor of the network port is more and more clear in server, a seed typeThe network port usually only provide a kind of function for client, for example, the payment network port in server is only payment workTool provides network on-line payment function, and the downloading network port is only download tool and provides network download online function, website netNetwork port is only website visiting tool and provides online access web sites function.It should be noted that above-mentioned is only implementation of the present inventionExample a specific example, the embodiment of the present invention includes but be not limited to above example.
It is understood that client must obtain the network-side that can be realized the function before realizing a certain functionThe port information of mouth, the network connection of the network port to be built on, to realize its function according to the port information gotEnergy.
In embodiments of the present invention, due to including numerous network ports, and the network port of each type in serverThe function of offer is different, and therefore, this request message for just needing server that can be sent according to client finds correspondenceThe network port of function is currently executed in client.
Further, it since type network a certain in server port usually only corresponds to a kind of communication mode, is only adoptingIn the case where the communication mode, client could be established with the network port and is connected to the network.Therefore, this just needs server energyIt is enough to be found current corresponding to client from numerous network ports according to the request message for carrying communication method informationExecute the network port of function.
S102, according to the corresponding relationship of the network port in preset communication method information and the server, acquisition pairThe port information of the network port of communication method information in request message described in Ying Yu.
It should be noted that in practical applications, after the definition or update for completing local network port, server can be withIt is locally generated the file that record has the network port Yu communication mode corresponding relationship, so that the server carries out looking into for the network portIt is used when looking for.
It further, can be according in local after obtaining the communication method information in the request message that client is sentRecord has the file of the corresponding relationship of the network port in communication method information and server, it is first determined and should in the serverWhich the corresponding network port of communication method information has;Later, it can select one from the identified network port and be used forThe network port being connected to the network with the client, and obtain the port information of the network port.
Specifically, in an embodiment of the embodiment of the present invention, as shown in Fig. 2, above-mentioned S102, may include:
S102a, according to the corresponding relationship of the network port in preset communication method information and the server, determining pairThe network port of communication method information in request message described in Ying Yu.
It is understood that a type of network port generally comprises multiple network ports in server, the serverMultiple network ports corresponding to the communication mode can be found according to a kind of communication mode.
S102b obtains the port information for a network port being in idle condition in the identified network port.
Preferably, it is connected to the network to guarantee more quickly to establish with the server, identified network-side can be obtainedThe port information for a network port being in idle condition in mouthful.
Port information obtained is sent to the client by S103 so that the client with correspond to the portThe network port of information establishes network connection.
In embodiments of the present invention, the port letter for corresponding to the network port of communication method information obtained is being obtainedBreath, need port information obtained being sent to the client so that the client with correspond to transmitted portThe network port of information establishes network connection.
It can be seen that the method provided in an embodiment of the present invention for establishing network connection, in the request for obtaining client transmissionAfter message, it can determine according to the corresponding relationship of the network port in preset communication method information and server and correspond to instituteIt states the port information of the network port of the communication method information in request message, and identified port information is sent to describedClient is connected to the network so that the client is established with the network port for corresponding to the port information.
Compared with prior art, the network port in server changes, and the embodiment of the present invention still is able to according to the visitorThe request message that family end is sent determines the port information for corresponding to the network port of the request message, then by the port informationIt is sent to client, so that the two establishes network connection.
Optionally, in one embodiment of the invention, multiple network ports that the server includes carry classType mark;The method provided in an embodiment of the present invention for establishing network connection can be to increase on the basis of method shown in Fig. 1S104 and S105.
It, can also be with it should be noted that S104 and S105 can both be executed according to the execution of method shown in Fig. 3 sequenceEach step in method shown in Fig. 1 executes parallel, and the embodiment of the present invention is not construed as limiting this.S104 and S105 is carried out below detailedThin description.
S104 counts the duration that all types of network ports are in running order in the first preset duration.
Such as first preset duration be 1 hour, in server include 4 kinds of network ports, respectively the first kind network port,The second class network port, the third class network port, the 4th class network port, wherein have 3 network-sides in the first kind network portMouthful, there are 3 network ports in the second class network port, there is 4 network ports, the 4th class network port in the third class network portIn have 5 network ports, in 1 hour, the work total duration of 3 network ports is 20 minutes in the first kind network port, theThe work total duration of 3 network ports is 30 minutes in the two class network ports, the work of 4 network ports in the third class network portMaking total duration is 50 minutes, and the work total duration of 5 network ports is 30 minutes in the 4th class network port.
It should be noted that can according to the actual situation, to the value of the first preset duration in the embodiment of the present invention intoRow adjustment, it is not limited in the embodiment of the present invention.
S105, increases the port number of the network port of target type, and the target type is that operating time is more than firstPort type belonging to the network port of preset threshold.
Such as first preset threshold be 45 minutes, since the work of 4 network ports in the above-mentioned third class network port is totalShi Changwei 50 minutes, be more than 45 minutes, therefore can increase the port number of the network port in the third class network port.
It should be noted that can according to the actual situation, to the value of the first preset threshold in the embodiment of the present invention intoRow adjustment, it is not limited in the embodiment of the present invention.
It can be seen that the method provided in an embodiment of the present invention for establishing network connection, it can be according to the reality of each network portThe port number of all types of network ports in the server is adaptively adjusted in border service condition, improves the port benefit of serverWith rate.
Optionally, in one embodiment of the invention, provided in an embodiment of the present invention to establish the method being connected to the network alsoIt can be to increase S106 and S107 on the basis of method shown in Fig. 1.
It, can also be with it should be noted that S106 and S107 can both be executed according to the execution of method shown in Fig. 4 sequenceEach step in method shown in Fig. 1 executes parallel, and the embodiment of the present invention is not construed as limiting this.S106 and S107 is carried out below detailedThin description.
S106 counts the quantity of the in running order network port.
Optionally, in one embodiment of the embodiment of the present invention, it can count in running order under current timeThe quantity of the network port.
It optionally, can be according to the preset time cycle, periodically in an embodiment of the embodiment of the present inventionCount the quantity of the in running order network port.
Optionally, in an embodiment of the embodiment of the present invention, in running order net can be counted in real timeThe quantity of network port.
The quantitative value that statistics obtains is output to display equipment, so that user can use the port of server by S107Situation is monitored.
Further, after the quantity for counting the in running order network port, obtained quantitative value will can be countedOutput so that user is monitored, analyzes, and then improves the responding ability and working efficiency of user.
Optionally, in one embodiment of the invention, provided in an embodiment of the present invention to establish the method being connected to the network alsoIt can be to increase S108 and S109 on the basis of method shown in Fig. 1.
It, can also be with it should be noted that S108 and S109 can both be executed according to the execution of method shown in Fig. 5 sequenceEach step in method shown in Fig. 1 executes parallel, and the embodiment of the present invention is not construed as limiting this.S108 and S109 is carried out below detailedThin description.
S108 obtains the status information of the network port.
Optionally, in one embodiment of the embodiment of the present invention, the state of available current time lower network portInformation.
It optionally, can be according to the preset time cycle, periodically in an embodiment of the embodiment of the present inventionObtain the status information of the network port.
Optionally, in an embodiment of the embodiment of the present invention, the state letter of the network port can be obtained in real timeBreath.
S109, the status information for the network port that will acquire are output to display equipment, so that user can be to serverPort working state be monitored.
Further, after the status information for obtaining the network port, the status information for the network port that can be will acquireOutput so that user is monitored, analyzes, and then improves the responding ability and working efficiency of user.
Optionally, in one embodiment of the invention, the communication mode of the client and the server is long connectsConnect mode or short connection type;When the communication mode of the client and the server is long connection type, the present invention is realApply example offer foundation network connection method can on the basis of method shown in Fig. 1 increase S110, S111, S112 andS113。
It should be noted that S110, S111, S112 and S113 can both be held according to the execution of method shown in Fig. 6 sequenceRow, can also execute, the embodiment of the present invention is not construed as limiting this parallel with each step in method shown in Fig. 1.Below to S110,S111, S112 and S113 are described in detail.
S110 monitors the network connection disconnection times in the second preset duration between the client and the network port.
It is understood that when the communication mode of client and server is long connection type, the client and serviceDevice needs to keep network connection state within a certain period of time, for example chat tool is when carrying out online chatting, it is necessary to protect alwaysIt holds and is in network connection state with server.If during this period, the network connection of client and server often disconnects, such asChat tool often goes offline, and just will affect the usage experience of user.
Based on the above issues, the embodiment of the present invention can be to the network connection disconnection times between client and the network portIt is monitored, further, the network connection that can be monitored in the second preset duration between the client and the network port is disconnectedOpen number.
It should be noted that can according to the actual situation, to the value of the second preset duration in the embodiment of the present invention intoRow adjustment, it is not limited in the embodiment of the present invention.
S111 will be switched off number and reach the network port of the second preset threshold labeled as failure.
It should be noted that can according to the actual situation, to the value of the second preset threshold in the embodiment of the present invention intoRow adjustment, it is not limited in the embodiment of the present invention.
It can be seen that the method provided in an embodiment of the present invention for establishing network connection, can automatically detect network connectionIt is failure in the presence of the abnormal network port, and by the port label, thus the quick positioning device failure of aspect operation maintenance personnel.
S112 is determined in the server corresponding to the client present communications mode, the unmarked net for failureNetwork port obtains the port information of a network port in the identified network port.
The port information is sent to the client by S113 so that the client with correspond to the port informationThe network port establishes network connection.
As shown in fig. 7, a kind of method for establishing network connection provided in an embodiment of the present invention, is applied to client, the partyMethod may include:
S701 sends request message to server, and the request message carries the client and the server carries outThe communication method information of communication.
It should be noted that in a larger sense, communication mode can be divided into:Long connection type and short connection type,Wherein, long connection type, which refers to, can continuously transmit multiple data packets in a connection, during connecting holding, if do not countedIt is sent according to packet, both sides is needed to send out link detecting packet;When short connection type refers to that communication two party has data interaction, a company is just establishedIt connects, after data are sent completely, then disconnect this connection, i.e., connect the transmission for only completing a business every time.For example, client carries outWhen website and webpage access, the communication mode used is short connection type;When chat tool carries out Internet chat, the communication party of useFormula is long connection type.
Specifically, in practical applications, long connection type may include the communication mode of chat-type;Short connection type canTo include:The communication mode of the communication mode of type of payment, the communication mode of type of download or website visiting type.For example it props upWhen the tool of paying carries out network payment, the communication mode of use is exactly the communication mode of type of payment;Download tool is downloaded from networkWhen content, the communication mode of use is exactly the communication mode of type of download.
S702 receives the server after obtaining the request message, and corresponding to for transmission is logical in the request messageThe port information of the network port of letter mode information;Preset communication method information and the service are stored in the serverThe corresponding relationship of the network port in device.
S703 establishes the network connection of the network port corresponding with received port information.
It should be noted that in practical applications, after the definition or update for completing local network port, server can be withIt is locally generated the file that record has the network port Yu communication mode corresponding relationship, so that the server carries out looking into for the network portIt is used when looking for.
Further, after obtaining the communication method information in the request message that client is sent, server can basisRecord has the file of the corresponding relationship of the network port in communication method information and server in local, it is first determined the serverIn the network port corresponding with the communication method information which has;Later, one can be selected from the identified network portA network port for being connected to the network with the client obtains the port information of the network port, and the port is believedBreath is sent to client.
Client in the embodiment of the present invention can receive the port information of server transmission, and according to the port information,Establish the network connection of the network port corresponding with the port information.
It can be seen that the method provided in an embodiment of the present invention for establishing network connection, can send to server and carryThe request message of communication method information, and the server is received after obtaining the request message, transmission is asked corresponding to thisThe port information of the network port of the communication method information in message is sought, and then is established corresponding with received port informationThe network connection of the network port.
Compared with prior art, the network port in server changes, and the embodiment of the present invention still is able to the clothesIt is engaged in after device transmission request message, receives and identifies the port letter of the network port corresponding to the request message of server transmissionBreath, and establish and be connected to the network with the network port for corresponding to the port information.
Corresponding to embodiment of the method shown in FIG. 1, the embodiment of the invention also provides a kind of devices for establishing network connection.
As shown in figure 8, a kind of device for establishing network connection provided in an embodiment of the present invention, is applied to server, it is describedServer includes multiple network ports, the apparatus may include:
Message capturing module 801, for obtaining the request message of client transmission, the request message that the client is sentCarry the communication method information that the client is communicated with the server;
The first information obtains module 802, for according to the network-side in preset communication method information and the serverThe corresponding relationship of mouth obtains the communication method information corresponded in request message acquired in the message capturing module 801The port information of the network port;
First information sending module 803 is sent for the first information to be obtained the port information obtained of module 802To the client, so that the network port of the client and the port information for corresponding to this is established and is connected to the network.
It can be seen that the device provided in an embodiment of the present invention for establishing network connection, in the request for obtaining client transmissionAfter message, it can determine according to the corresponding relationship of the network port in preset communication method information and server and correspond to instituteIt states the port information of the network port of the communication method information in request message, and identified port information is sent to describedClient is connected to the network so that the client is established with the network port for corresponding to the port information.
Compared with prior art, the network port in server changes, and the embodiment of the present invention still is able to according to the visitorThe request message that family end is sent determines the port information for corresponding to the network port of the request message, then by the port informationIt is sent to client, so that the two establishes network connection.
Optionally, in one embodiment of the invention, the first information as shown in Figure 9 obtains module 802, can wrapIt includes:
Port determines submodule 802a, for according to the network port in preset communication method information and the serverCorresponding relationship, determine the net for corresponding to the communication method information acquired in the message capturing module 801 in request messageNetwork port;
Information acquisition submodule 802b is determined in the network port determined by submodule 802a for obtaining the portIn the port information of a network port of idle state.
Optionally, in one embodiment of the invention, multiple network ports that the server includes carry classType mark;When the device provided in an embodiment of the present invention for establishing network connection can be to increase on the basis of device shown in Fig. 8Long statistical module 804 and port number increase module 805.
It should be noted that duration statistical module 804 and port number increase module 805 can both fill according to shown in Figure 10The connection type set is attached, and can also be attached according to other connection types, the embodiment of the present invention does not limit thisIt is fixed.The function of increasing module 805 to duration statistical module 804 and port number below is described in detail.
Duration statistical module 804, for count all types of network ports in the first preset duration it is in running order whenIt is long;
Port number increases module 805, the port number of the network port for increasing target type, the target typeIt is more than port type belonging to the network port of the first preset threshold for operating time.
Optionally, in one embodiment of the invention, provided in an embodiment of the present invention to establish the device being connected to the network alsoIt can be with statistical module 806 and the first output module 807 of accelerating on the basis of device shown in Fig. 8.
It should be noted that quantity statistics module 806 and the first output module 807 both can be according to Figure 11 shown devicesConnection type is attached, and can also be attached according to other connection types, the embodiment of the present invention is not construed as limiting this.UnderFunction in face of quantity statistics module 806 and the first output module 807 is described in detail.
Quantity statistics module 806, for counting the quantity of the in running order network port;
First output module 807, the quantitative value for obtaining the quantity statistics module 806 statistics are output to display and setIt is standby, so as to user can the port service condition to server be monitored.
Optionally, in one embodiment of the invention, provided in an embodiment of the present invention to establish the device being connected to the network alsoIt can be to increase state information acquisition module 808 and the second output module 809 on the basis of device shown in Fig. 8.
It should be noted that state information acquisition module 808 and the second output module 809 can both be filled according to shown in Figure 12The connection type set is attached, and can also be attached according to other connection types, the embodiment of the present invention does not limit thisIt is fixed.The function of state information acquisition module 808 and the second output module 809 is described in detail below.
State information acquisition module 808, for obtaining the status information of the network port;
Second output module 809, the state letter of the network port for getting the state information acquisition module 808Breath be output to display equipment, so as to user can the port working state to server be monitored.
Optionally, in one embodiment of the invention, the communication mode of the client and the server is long connectsConnect mode or short connection type;When the communication mode of the client and the server is long connection type, the present invention is realThe device for applying the foundation network connection of example offer can be to increase monitoring modular 810, label mould on the basis of device shown in Fig. 8Block 811, the second information acquisition module 812 and the second information sending module 813.
It should be noted that monitoring modular 810, mark module 811, the second information acquisition module 812 and the second information hairSend module 813 that can both be attached according to the connection type of Figure 13 shown device, can also according to other connection types intoRow connection, the embodiment of the present invention are not construed as limiting this.Below to monitoring modular 810, mark module 811, the second information acquisition mouldThe function of block 812 and the second information sending module 813 is described in detail.
Monitoring modular 810, for monitoring the network connection in the second preset duration between the client and the network portDisconnection times;
Mark module 811, the disconnection times for monitoring the monitoring modular 810 reach the net of the second preset thresholdNetwork port label is failure;
Second information acquisition module 812 corresponds to the client present communications mode for determining in the server, the unmarked network port for failure, obtain determined by the network port network port port information;
Second information sending module 813, for sending second information acquisition module 812 port information obtainedTo the client, it is connected to the network so that the client is established with the network port for corresponding to the port information.
Corresponding to embodiment of the method shown in Fig. 7, the embodiment of the invention also provides a kind of devices for establishing network connection.
As shown in figure 14, a kind of device for establishing network connection provided in an embodiment of the present invention, is applied to client, the dressIt sets and may include:
Message transmission module 1401, for sending request message to server, the request message carries the clientHold the communication method information communicated with the server;
Information receiving module 1402 is obtaining transmitted by the message transmission module 1401 for receiving the serverAfter request message, the port information of the network port corresponding to the communication method information of transmission;It is stored in the serverThe corresponding relationship of the network port in preset communication method information and the server;
Module 1403 is established in network connection, for establishing and port information received by the information receiving module 1402The network connection of the corresponding network port.
It can be seen that the device provided in an embodiment of the present invention for establishing network connection, can send to server and carryThe request message of communication method information, and the server is received after obtaining the request message, transmission is asked corresponding to thisThe port information of the network port of the communication method information in message is sought, and then is established corresponding with received port informationThe network connection of the network port.
Compared with prior art, the network port in server changes, and the embodiment of the present invention still is able to the clothesIt is engaged in after device transmission request message, receives and identifies the port letter of the network port corresponding to the request message of server transmissionBreath, and establish and be connected to the network with the network port for corresponding to the port information.
For device embodiment, since it is substantially similar to the method embodiment, related so being described relatively simplePlace illustrates referring to the part of embodiment of the method.
For convenience of description, it is divided into various modules when description apparatus above with function to describe respectively.Certainly, implementing thisThe function of each module can be realized in the same or multiple software and or hardware when invention.
It should be noted that, in this document, relational terms such as first and second and the like are used merely to a realityBody or operation are distinguished with another entity or operation, are deposited without necessarily requiring or implying between these entities or operationIn any actual relationship or order or sequence.Moreover, the terms "include", "comprise" or its any other variant are intended toNon-exclusive inclusion, so that the process, method, article or equipment including a series of elements is not only wanted including thoseElement, but also including other elements that are not explicitly listed, or further include for this process, method, article or equipmentIntrinsic element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded thatThere is also other identical elements in process, method, article or equipment including the element.
Each embodiment in this specification is all made of relevant mode and describes, same and similar portion between each embodimentDividing may refer to each other, and each embodiment focuses on the differences from other embodiments.Especially for device realityFor applying example, since it is substantially similar to the method embodiment, so being described relatively simple, related place is referring to embodiment of the methodPart explanation.
Those of ordinary skill in the art will appreciate that all or part of the steps in realization above method embodiment is canIt is completed with instructing relevant hardware by program, the program can store in computer-readable storage medium,The storage medium designated herein obtained, such as:ROM/RAM, magnetic disk, CD etc..
The foregoing is merely illustrative of the preferred embodiments of the present invention, is not intended to limit the scope of the present invention.It is allAny modification, equivalent replacement, improvement and so within the spirit and principles in the present invention, are all contained in protection scope of the present inventionIt is interior.

Claims (14)

CN201410472857.3A2014-09-162014-09-16A kind of method and device for establishing network connectionExpired - Fee RelatedCN104202334B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN201410472857.3ACN104202334B (en)2014-09-162014-09-16A kind of method and device for establishing network connection

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN201410472857.3ACN104202334B (en)2014-09-162014-09-16A kind of method and device for establishing network connection

Publications (2)

Publication NumberPublication Date
CN104202334A CN104202334A (en)2014-12-10
CN104202334Btrue CN104202334B (en)2018-11-16

Family

ID=52087559

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN201410472857.3AExpired - Fee RelatedCN104202334B (en)2014-09-162014-09-16A kind of method and device for establishing network connection

Country Status (1)

CountryLink
CN (1)CN104202334B (en)

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN106303702A (en)*2015-06-112017-01-04阿里巴巴集团控股有限公司Connection status inspection method, device and intelligent television system
CN105610924B (en)*2015-12-242019-03-12深圳市华讯方舟软件技术有限公司 A method and device for cloud desktop multi-node connection
CN109347933B (en)*2018-09-292021-07-20卓米私人有限公司Method and device for establishing connection
CN109495600B (en)*2018-11-192022-04-29北京知道创宇信息技术股份有限公司Website access method and device and readable storage medium
CN111181807B (en)*2019-12-262022-04-08国汽(北京)智能网联汽车研究院有限公司Communication interface device and multi-port communication interaction method
CN111586714B (en)*2020-04-212021-07-20珠海格力电器股份有限公司Network port allocation method, device, electronic equipment and computer usable medium
CN113645294B (en)*2021-08-062022-08-26腾讯科技(深圳)有限公司Message acquisition method and device, computer equipment and message transmission system
CN114866421B (en)*2022-05-132024-05-14西安广和通无线通信有限公司Port management method, device, equipment and computer readable storage medium
CN115512481B (en)*2022-09-222023-07-14广东便捷神科技股份有限公司Server data processing method networked with vending machine

Citations (3)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN101583086A (en)*2009-06-192009-11-18广州市中海达测绘仪器有限公司Method for controlling data interaction among mobile terminals and system thereof
CN102185856A (en)*2011-03-222011-09-14北京朗玛数联科技有限公司Team organizing video method, device and system used in team organizing game
CN102572003A (en)*2010-12-082012-07-11中国电信股份有限公司Method and system for acquiring and processing multiplexing address and port range

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
JP5618886B2 (en)*2011-03-312014-11-05株式会社日立製作所 Network system, computer distribution apparatus, and computer distribution method
CN103095783B (en)*2011-11-082015-10-14阿里巴巴集团控股有限公司A kind of method and device debugging Web application

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN101583086A (en)*2009-06-192009-11-18广州市中海达测绘仪器有限公司Method for controlling data interaction among mobile terminals and system thereof
CN102572003A (en)*2010-12-082012-07-11中国电信股份有限公司Method and system for acquiring and processing multiplexing address and port range
CN102185856A (en)*2011-03-222011-09-14北京朗玛数联科技有限公司Team organizing video method, device and system used in team organizing game

Also Published As

Publication numberPublication date
CN104202334A (en)2014-12-10

Similar Documents

PublicationPublication DateTitle
CN104202334B (en)A kind of method and device for establishing network connection
CN101953139B (en)DHCP in response to Internet connectedness initializes
CN101459534B (en)Network topology collecting method for tree shaped network and network equipment
CN105721318B (en)The method and apparatus of network topology are found in a kind of software defined network SDN
CN103731870B (en)The management method and device of monitor task
EP3252999A1 (en)Home network device management method and network management system
CN103916275A (en)BFD detection device and method
CN103416022B (en)Throughput testing approach and system in service in distribution router/exchange board structure
CN109842566A (en)A kind of dns resolution method and device
CN110191059A (en) A routing information monitoring method and device
EP3217597A1 (en)Method and apparatus for performing an automatic bandwidth management in a communication network
CN106936729A (en)Control method, system and broadband access network system that a kind of terminal device is accessed
CN104980368A (en)Bandwidth guarantee method and apparatus in software defined network (SDN)
CN108614450A (en)Mechanical system and its method under a kind of Internet of Things
CN105553762B (en)Communication means, system and related device between household electrical appliance and mobile terminal
CN105306303B (en)The real-time monitoring system of failure and terminal network appliance based on terminal network appliance
CN108986437A (en)A kind of electric power acquisition terminal monitoring adjustment method based on WIFI
CN103096361B (en)The exchange method of performance statistic and device in a kind of wireless local area network (WLAN) system
CN105897879B (en)A kind of method, equipment and client migrating Automatic Configuration Server ACS
CN107819596B (en)SDN network fault diagnosis method, device and system
CN103391303B (en)Service fault noticing method and server using same
CN104536926B (en)The control method and device of serial equipment
EP2561646B1 (en)Apparatuses and methods for registering transmission capacities in a broadband access network
CN110018677A (en)A kind of internet of things equipment management system and method
CN106130787B (en)Service processing system based on software defined network

Legal Events

DateCodeTitleDescription
C06Publication
PB01Publication
C10Entry into substantive examination
SE01Entry into force of request for substantive examination
CB02Change of applicant information
CB02Change 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:GUANGZHOU KINGSOFT NETWORK TECHNOLOGY Co.,Ltd.

GR01Patent grant
GR01Patent grant
CF01Termination of patent right due to non-payment of annual fee
CF01Termination of patent right due to non-payment of annual fee

Granted publication date:20181116


[8]ページ先頭

©2009-2025 Movatter.jp