CN104142868A - Connection establishment method and device - Google Patents

Connection establishment method and device Download PDF

Info

Publication number
CN104142868A
CN104142868A CN201310172564.9A CN201310172564A CN104142868A CN 104142868 A CN104142868 A CN 104142868A CN 201310172564 A CN201310172564 A CN 201310172564A CN 104142868 A CN104142868 A CN 104142868A
Authority
CN
China
Prior art keywords
connection
identifier
connection identifier
pool
application program
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
CN201310172564.9A
Other languages
Chinese (zh)
Other versions
CN104142868B (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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201310172564.9A priority Critical patent/CN104142868B/en
Publication of CN104142868A publication Critical patent/CN104142868A/en
Application granted granted Critical
Publication of CN104142868B publication Critical patent/CN104142868B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention discloses a connection establishment method and device, and belongs to the field of computers. The method comprises the steps as follows: acquiring a connection request corresponding to service provided by an application program; determining a connection identifier matched with a connection identifier carried by the connection request in a pre-built connection pool; and acquiring a connection corresponding to the connection request in at least one connection corresponding to the matched connection identifier, and sending the acquired connection to a user terminal so as to enable the application program at the user terminal to establish a service corresponding connection with the server according to the acquired connection. According to the connection establishment method and device, the connection identifier matched with the connection identifier carried by the connection request is determined in the connection pool, the acquire connection is sent to the application program after the connection corresponding to the connection request is acquired, so that the connection pool can provide connection for a plurality of application programs, server connection resource waste is avoided, the use ratio of the connection pool is improved, and the cost for building the connection pool is reduced.

Description

The method connecting and device
Technical field
The present invention relates to computer realm, particularly a kind of method connecting and device.
Background technology
In computer realm, the application program of user terminal can provide multiple services for user, in the time that each service is provided, and conventionally all can be to server read/write data.Before read/write data, application program need to connect with of a server port.Therefore, each connection can be by the IP(Internet Protocol of server, Internet protocol) address and port id (Identifier, mark) is unique determines.It is longer that some is connected to the time required while foundation, for example, in the time setting up TCP and connect, application program and server will carry out " three-way handshake " (three-way handshake), and application program and server are connected carrying out could setting up TCP after three confirmations.Therefore, how Rapid Establishment connects, and is the key that improves the data signaling rate between application program and server.
Prior art is in the time connecting, and for each application program of user terminal, the device connecting is pre-created multiple connections, and according to each application program, corresponding multiple connections build connection pool corresponding to each application program; In the time that the application program of user terminal need to connect with server, this device connecting obtains the connection request of application program, and determines connection pool corresponding to this application program; From connection pool corresponding to this application program, obtain the connection that connection request is corresponding, and the connection getting is sent to user terminal, the application program on this user terminal is connected according to the connection and the server that get.
Realizing in process of the present invention, inventor finds that prior art at least exists following problem:
In the mode that prior art connects, need to be pre-created multiple connections for each application program, thereby form connection pool corresponding to each application program, even the connection that the connection request of different application is corresponding identical, still need to repeat the process that builds corresponding connection pool for different application, the connection that repeats to create causes the waste of server connection resource; And connection pool corresponding to each application program, only for this application program provides connection, causes the utilization factor of connection pool not high, and cost is higher.
Summary of the invention
In order to solve the problem of prior art, the embodiment of the present invention provides a kind of method connecting and device.Described technical scheme is as follows:
On the one hand, provide a kind of method connecting, described method comprises:
The connection request that obtains the service correspondence that application program provides, carries the connection identifier of answering with described service relative in described connection request;
In the connection pool building in advance, determine the connection identifier that the connection identifier that carries with described connection request matches, described in corresponding at least one connection of connection identifier of matching;
From connecting, corresponding at least one of the described connection identifier matching obtain the connection that described connection request is corresponding, and the connection getting is sent to user terminal, make application program on described user terminal according to described in the connection that gets set up connection corresponding to described service with server.
On the other hand, provide a kind of device connecting, described device comprises:
The first acquisition module, for obtaining the connection request of the service correspondence that application program provides, carries the connection identifier of answering with described service relative in described connection request;
Determination module, determines for the connection pool building in advance the connection identifier that connection identifier that the connection request that gets with described the first acquisition module carries matches, described in corresponding at least one connection of connection identifier of matching;
The second acquisition module, connects and obtains the connection that described connection request is corresponding for corresponding at least one of the connection identifier matching of determining from described determination module;
The first sending module, sends to user terminal for the connection that described the second acquisition module is got, make application program on described user terminal according to described in the connection that gets set up connection corresponding to described service with server.
The beneficial effect that the technical scheme that the embodiment of the present invention provides is brought is:
The connection identifier that the connection identifier carrying by the connection request of determining in the connection pool building in advance and get matches, and obtain after the connection that connection request is corresponding in connection corresponding to the connection identifier matching, the connection getting is sent to user terminal, application program and the server of user terminal are connected, in the time that connection corresponding to the connection request of application program has been pre-created in connection pool, connect without repeating to create, make the connection pool building in advance to provide connection for multiple application programs, avoid the waste of server connection resource, improve the utilization factor of connection pool, reduce the cost that builds connection pool.
Brief description of the drawings
In order to be illustrated more clearly in the technical scheme in the embodiment of the present invention, below the accompanying drawing of required use during embodiment is described is briefly described, apparently, accompanying drawing in the following describes is only some embodiments of the present invention, for those of ordinary skill in the art, do not paying under the prerequisite of creative work, can also obtain according to these accompanying drawings other accompanying drawing.
Fig. 1 is the schematic diagram of a kind of implementation environment connecting that the embodiment of the present invention provides;
Fig. 2 is a kind of method flow diagram connecting that the embodiment of the present invention one provides;
Fig. 3 is a kind of method flow diagram connecting that the embodiment of the present invention two provides;
Fig. 4 is the apparatus structure schematic diagram that the first that the embodiment of the present invention three provides connects;
Fig. 5 is the apparatus structure schematic diagram that the second that the embodiment of the present invention three provides connects;
Fig. 6 is the third apparatus structure schematic diagram connecting that the embodiment of the present invention three provides;
Fig. 7 is the 4th kind of apparatus structure schematic diagram connecting that the embodiment of the present invention three provides;
Fig. 8 is the 5th kind of apparatus structure schematic diagram connecting that the embodiment of the present invention three provides;
Fig. 9 is the 6th kind of apparatus structure schematic diagram connecting that the embodiment of the present invention three provides;
Figure 10 is the 7th kind of apparatus structure schematic diagram connecting that the embodiment of the present invention three provides;
Figure 11 is the structural representation of a kind of terminal of providing of the embodiment of the present invention four.
Embodiment
For making the object, technical solutions and advantages of the present invention clearer, below in conjunction with accompanying drawing, embodiment of the present invention is described further in detail.
The embodiment of the present invention provides a kind of method connecting, and please refer to Fig. 1, and it shows the structural representation of the related implementation environment of the method connecting that the embodiment of the present invention provides.This implementation environment comprises the device 101, user terminal 102 and the server 103 that connect.
Wherein, the device that connect of the device 101 connecting as described in embodiment tri-below.In addition, the device 101 connecting can be configured in user terminal 102, also can be configured in server 103, the device connecting 101 can also be configured to other equipment except user terminal 101 and server 103 etc.In the time that the device 101 connecting is configured to other equipment except user terminal 101 and server 103, the device 101 connecting all carries out data communication by network with user terminal 102, user terminal 102 with server 103.The device 101 connecting, for getting connection from the connection pool building in advance, sends to user terminal 102; Connection and server 103 that the application program of user terminal 102 gets according to the device 101 connecting connect.
Embodiment mono-
In conjunction with above-mentioned implementation environment, the embodiment of the present invention provides a kind of method connecting, and referring to Fig. 2, method flow comprises:
201: obtain the connection request of the service correspondence that application program provides, in connection request, carry the connection identifier of answering with service relative.
Preferably, after the connection getting is sent to user terminal, also comprise:
If the application program of user terminal is set up connection failure corresponding to service according to the connection getting and server, from connection pool, delete the connection getting.
202: the connection identifier that definite connection identifier carrying with connection request matches in the connection pool building in advance, corresponding at least one connection of the connection identifier matching.
Wherein, the connection identifier that each connection request carries is for each service of identification application.
Preferably, after the connection identifier that definite connection identifier carrying with connection request matches from the connection pool building in advance, also comprise:
If do not get the connection that connection request is corresponding from corresponding at least one of connection identifier matching connects, create the connection that connection request is corresponding, and the connection of establishment is sent to user terminal, make the application program of user terminal set up connection corresponding to described service according to the connection creating with server.
Preferably, after creating the connection that connection request is corresponding, also comprise:
Using the connection of establishment as the connection corresponding with the connection identifier matching, and add in the connection pool building in advance.
Preferably, using the connection of establishment as the connection corresponding with the connection identifier matching, and before adding in the connection pool building in advance, also comprise:
Whether the quantity of the connection that the connection identifier that matches of judgement is corresponding reaches predetermined threshold value;
If the quantity of the connection that the connection identifier matching is corresponding does not reach predetermined threshold value, carry out using the connection of establishment as the connection corresponding with the connection identifier matching, and add the step in the connection pool building in advance to.
Preferably, the quantity of the corresponding connection of connection identifier that judgement matches also comprises after whether reaching predetermined threshold value:
If the quantity of the connection that the connection identifier matching is corresponding reaches predetermined threshold value, from connection pool, delete at least one connection corresponding to connection identifier matching, and carry out using the connection of establishment as the connection corresponding with the connection identifier matching, and add the step in the connection pool building in advance to.
Preferably, before the connection identifier that definite connection identifier carrying with connection request matches in the connection pool building in advance, also comprise:
For connection identifier corresponding to each service distribution of application program, and be that each connection identifier is pre-created at least one corresponding connection;
Connect structure connection pool according to each connection identifier and corresponding at least one thereof.
203: from corresponding at least one of connection identifier matching connects, obtain the connection that connection request is corresponding, and the connection getting is sent to user terminal, make the application program on user terminal set up connection corresponding to service according to the connection getting and server.
In sum, the method that the embodiment of the present invention provides, the connection identifier that the connection identifier carrying by the connection request of determining in the connection pool building in advance and get matches, and obtain after the connection that connection request is corresponding in connection corresponding to the connection identifier matching, the connection getting is sent to user terminal, application program and the server of user terminal are connected, in the time that connection corresponding to the connection request of application program has been pre-created in connection pool, connect without repeating to create, make the connection pool building in advance to provide connection for multiple application programs, avoid the waste of server connection resource, improve the utilization factor of connection pool, reduce the cost that builds connection pool.
Embodiment bis-
In order to improve the utilization factor of connection pool, reduce costs, the embodiment of the present invention provides a kind of method connecting, and the main body of carrying out the method for the embodiment of the present invention is the device connecting, and this device connecting can be terminal, server or other equipment etc.In conjunction with the content of above-described embodiment one, referring to Fig. 3, the method flow that the present embodiment provides comprises:
301: obtain the connection request of the service correspondence that application program provides, in connection request, carry the connection identifier of answering with this service relative.
For this step, a common application program can provide multiple services, in the time that each service is provided, all needs to corresponding server read/write data.For the server read/write data to corresponding, first need to connect with server.Because application program is normally operated on user terminal, the connection request that can send the service correspondence that application program provides by user terminal is to the device connecting, the device connecting is receiving after the connection request of application program that user terminal sends, and obtains the connection request of the service correspondence that application program provides.Except connection identifier, in connection request, can also carry the information such as the user ID of application program, for the information of carrying in connection request, the embodiment of the present invention does not specifically limit at this.
302: the connection identifier that definite connection identifier carrying with connection request matches in the connection pool building in advance.
In order to connect more quickly, need to build in advance connection pool, specifically comprise: be connection identifier corresponding to each service distribution of application program, and be that each connection identifier is pre-created at least one corresponding connection; Connect structure connection pool according to each connection identifier and corresponding at least one thereof.
Wherein, because application program can provide multiple services, need to be the connection identifier corresponding to each service distribution of application program, for identifying this service.Except being in advance sends in above-mentioned steps 301 the service distribution mark of application program of connection request, can also be according to the needs of practical application, be the mark corresponding to service distribution of other application programs in advance, the embodiment of the present invention does not specifically limit this.Because the service that multiple application programs can provide can be identical, in the time of connection identifier corresponding to the each service distribution that is application program, can be the identical same connection identifier of service distribution.Certainly, can be also the identical plural connection identifier of service distribution, the embodiment of the present invention does not specifically limit the quantity of the connection identifier for each service distribution at this, ensures that each connection identifier can identify a service.
After being the connection identifier that each service distribution is corresponding, for each connection identifier is pre-created at least one corresponding connection.The mode that is pre-created connection is same as the prior art, does not repeat them here.The type of the connection being pre-created can be selected according to actual conditions, for example, and can be for TCP connection etc.Because each connection identifier is corresponding to each service of application terminal, thereby when be pre-created at least one corresponding connection for each connection identifier, at least one connection that can be corresponding according to the each connection identifier of each service-creation of application terminal.
In concrete application, when the application program of user terminal and server connect, be all by connecting with a port of server, thereby to server read/write data.Because the quantity of server can be multiple, and the port of each server can be also multiple, and can be with a connection of (IP, Port) two tuples marks, wherein, IP represents the IP address of server, Port(port) represent the port id of server.Conventionally, a service of application program can be to the arbitrary port read/write data at least two of a server port, or to the same port read/write data of multiple servers, therefore, can be multiple connection (IP corresponding to each service-creation of application terminal, Port), be also each connection identifier and create corresponding multiple connections (IP, Port).
After distribution obtains connection identifier and sets up corresponding connection, connect structure connection pool according to each connection identifier and corresponding at least one thereof.Wherein, the connection pool of structure can be stored in the device connecting, and can also be stored in other database, and the embodiment of the present invention does not specifically limit the memory location of the connection pool building at this.In the time connecting, do not need all to carry out the operation that builds in advance connection pool at every turn at every turn.After connection pool builds, follow-up while connecting at every turn, can use this connection pool.
Build by the way after connection pool, due to the connection identifier corresponding to each service distribution of application programs in the preferential connection pool building, and create at least one connection for each connection identifier, in the time that being connected to of service correspondence that other application programs can provide created in the connection pool building in advance, can from the connection pool building in advance, get connection corresponding to this service according to the connection identifier of answering with this service relative, and without the connection that repeats to create this service, avoid the waste of server connection resource, and the connection pool building in advance can provide service for multiple application programs, its utilization factor has also improved greatly.
For instance, can provide 3 services with application program 1, the service of being respectively 1, service 2 and service 3, application program 2 can provide 2 services, the service of being respectively 1 and service 4 are for example describes, for service 1 to the service 4 of application program 1 and application program 2 distributes corresponding connection identifier NetID1 to NetID4; And be respectively at least one connection corresponding to NetID1 to NetID4 establishment, and build connection pool according to each connection identifier and corresponding connection thereof, as shown in table 1 below.
Table 1
After connection pool has built in advance, based on the connection pool building in advance, can therefrom determine and connection identifier that the connection identifier that carries of connection request matches.
For instance, to carry connection identifier NetID1 in the connection request getting in step 301 as example, from the as shown in table 1 connection pool building in advance, determine with connection request in the connection identifier NetID1 that matches of the connection identifier that carries.
It should be noted that, after the connection identifier that definite connection identifier carrying with connection request matches in the connection pool building in advance, if there is the connection corresponding with connection request in connecting in corresponding at least one of the connection identifier matching, specifically referring to following steps 303 to step 304.If there is not the connection corresponding with connection request during corresponding at least one of the connection identifier matching connects, can select to carry out following steps 305.
303: from corresponding at least one of connection identifier matching connects, obtain the connection that connection request is corresponding.
For this step, due to the connection identifier that matches corresponding at least one connect, obtain connection corresponding to connection request from corresponding at least one of connection identifier matching connects time, can select the either type in following two kinds of modes according to actual conditions:
(1) from connecting, corresponding at least one of connection identifier matching obtain arbitrarily a connection as connection corresponding to connection request.
Because the corresponding each connection of the connection identifier matching is the service-creation of the application program corresponding according to the connection identifier that matches, therefore, the corresponding arbitrary connection of connection identifier matching can be served as the connection that connection request is corresponding, therefrom obtains arbitrarily a connection.
(2), if also carry user ID in connection request, from connecting, corresponding at least one of connection identifier matching obtain the connection that connection request is corresponding according to the user ID of carrying in connection request.
In the time building connection pool in advance, can distribute for each connection corresponding to connection identifier the numerical range of corresponding user ID, the numerical range of a user ID can corresponding multiple connections.Therefore, obtain corresponding connection in corresponding at least one of the connection identifier matching according to the user ID of carrying in connection request connects time, can first determine the numerical range of the residing user ID of user ID that connection request carries, the connection corresponding to numerical range of obtaining definite user ID again from connection corresponding to the connection identifier that matches, using the connection getting as connection corresponding to connection request.Certainly, if the numerical range of definite user ID corresponding be connected with multiplely, can therefrom obtain arbitrarily a connection as connection corresponding to connection request.
Wherein, the numerical range of user ID, it can be the numerical range of the complete number of user ID, also can be the residing numerical range of wherein several bit digital of user ID, for example, can be the residing numerical range of rear two digits of user ID, for the numerical range of pre-assigned user ID, the embodiment of the present invention specifically limit at this.
For instance, also to carry user ID in the connection request getting in step 301 as 186435, in the connection pool building in advance, distribute for each connection corresponding to connection identifier the residing numerical range of rear two digits that the numerical range of corresponding user ID and the numerical range of user ID are user ID, obtaining connection pool as shown in table 2 below is example, the numerical range of determining the rear two digits 35 residing user ID of the user ID of carrying in connection request is [00-50], the numerical range of obtaining user ID from 2 connections corresponding to the connection identifier NetID1 that matches is connection (202.198.0.0 corresponding to [00-50], 100), to connect (202.198.0.0, 100) be defined as the connection that connection request is corresponding.
Table 2
304: the connection getting is sent to user terminal, make the application program of user terminal set up connection corresponding to this service according to the connection getting with server, the flow process connecting finishes.
In step 303, get after the connection that connection request is corresponding, the connection getting is sent to user terminal by the device connecting.Because the connection getting is the connection being pre-created, the application program of user terminal is without carrying out connecting after " three-way handshake " with server again, but directly sets up connection corresponding to this service according to the connection getting and server.Due to the connection getting can identification server port, therefore, the port of the server that the application program of user terminal can identify with this connection according to the connection getting is directly set up connection corresponding to this service.
For instance, to get connection (202.198.0.0 in step 303,100) be example, to connect (202.198.0.0,100) send to user terminal, make the application program of user terminal set up connection corresponding to this service according to the port one 00 that connects the server that (202.198.0.0,100) are 202.198.0.0 with IP address.
It should be noted that, the application program of user terminal is set up connection corresponding to this service with server, the port of the server also identifying with the connection getting is set up after connection corresponding to this service, and the application program of user terminal can be by the port of this server to server read/write data.Concrete operations after setting up connection corresponding to this service for the application program of user terminal with server, the embodiment of the present invention does not specifically limit at this.
Preferably, after the connection getting is sent to user terminal, if the application program of user terminal is set up connection failure corresponding to this service according to the connection getting with server, from connection pool, delete the connection getting.Wherein, the reason of the failure that connects can be because the port of the server of the connection correspondence getting is damaged, or because the configuration of server changes, this port is not used further to carry out with the application program of user terminal the operation of read/write data.Application program for user terminal is set up the reason of connection failure corresponding to this service according to the connection getting with server, and the embodiment of the present invention does not specifically limit at this.Due to after the application program of user terminal sets up connection failure corresponding to this service according to the connection getting with server, can determine that this connection getting also cannot be used to other application programs and server to set up connection corresponding to this service, in order to ensure the availability of the connection in connection pool, can from connection pool, delete the connection getting.
Application program at user terminal is set up after connection failure corresponding to service according to the connection getting and server, can continue to perform step 301-304, or step 301-302 and step 305, can set up connection corresponding to service with server so that obtain the application program of user terminal, or, the application program of user terminal also can select the mode of carrying out " three-way handshake " with server to connect, application program for user terminal is set up the operation after connection failure corresponding to service according to the connection getting and server, the embodiment of the present invention does not specifically limit at this.
305: create connection corresponding to connection request, and the connection of establishment is sent to user terminal, make the application program of user terminal set up connection corresponding to this service according to the connection creating with server, the flow process connecting finishes.
Do not get connection corresponding to connection request in corresponding at least one of the connection identifier matching connects time, the device connecting can create corresponding connection for this connection request, and the connection of establishment is sent to user terminal.Due to connect created by the device connecting, the application program of user terminal according to create connection also can with server between set up connection corresponding to this service.
Wherein, in connecting, corresponding at least one of the connection identifier matching do not get the reason of the connection that connection request is corresponding, can be due in advance not for this connection identifier matching creates corresponding connection, or the numerical range of the residing numerical range of the user ID that connection request the carries user ID corresponding with each connection in the connection identifier matching is all not identical, certainly, can also be not get because other reasons causes in corresponding at least one of the connection identifier matching connects the connection that connection request is corresponding, the embodiment of the present invention specifically limits in this reason that corresponding at least one do not get the connection that connection request is corresponding in connecting to the connection identifier matching.
Further, in order to save follow-up connecting the spent time, after creating corresponding connection for connection request, can also comprise: using the connection of establishment as the connection corresponding with the connection identifier matching, and add in the connection pool building in advance.By the connection of establishment being added in the connection pool building in advance, when the device connecting gets identical connection request, can from connection pool, get the connection corresponding with this connection request when next time.
It should be noted that, because the port number of server is limited, the connection resource of server is limited, in order to ensure the normal operation of server, can not unrestrictedly create connection.Therefore, can be that the quantity of the connection that each connection identifier is corresponding is set a threshold value, thereby ensure that the quantity of the connection that each connection identifier is corresponding can grow without bound.Using the connection of establishment as the connection corresponding with the connection identifier matching, and before adding in the connection pool building in advance, further comprising the steps of:
Whether the quantity of the connection that the connection identifier that matches of judgement is corresponding reaches predetermined threshold value; If the quantity of the connection that the connection identifier matching is corresponding does not reach predetermined threshold value, carry out using the connection of establishment as the connection corresponding with the connection identifier matching, and add the step in the connection pool building in advance to.Wherein, the size of predetermined threshold value can specifically be set according to actual conditions, for example, can be set to 20,25 or 30 etc., and the embodiment of the present invention does not specifically limit the size of predetermined threshold value at this.
In addition, if the quantity of connection corresponding to the connection identifier matching reaches predetermined threshold value, can select not carry out using the connection of establishment as the connection corresponding with the connection identifier matching, and add the step in the connection pool building in advance to.Preferably, can also from connection pool, delete corresponding at least one of connection identifier matching and connect, and carry out using the connection of establishment as the connection corresponding with the connection identifier matching, and add the step in the connection pool building in advance to.Connect by first deleting corresponding at least one of the connection identifier that matches, then carry out the connection of establishment is added in the connection pool building in advance, ensured that the quantity of the connection that the connection identifier that matches is corresponding is no more than predetermined threshold value.
To delete in order reducing at least one connection impact on the process connecting according to this connection pool afterwards corresponding to connection identifier matching, when corresponding at least one of connection identifier matching connects, can to consider following strategy in deletion:
When adopting while obtaining connection corresponding to connection request the connection corresponding from the connection identifier that matches of mode one in step 303, because each connection corresponding to the connection identifier matching is the service-creation of the application program corresponding according to the connection identifier that matches, all can serve as the connection that connection request is corresponding, therefore, from connection pool, delete corresponding at least one of connection identifier matching and connect, all less on the impact of the process connecting according to the connection pool of this structure next time.When adopting while obtaining connection corresponding to connection request the connection corresponding from the connection identifier that matches of mode two in step 303, in connection corresponding to the connection identifier matching, the numerical range of a user ID can corresponding multiple connections, in order to reduce the impact of the process that connects according to the connection pool of this structure next time, need to from connection pool, delete at least one connection in multiple connections corresponding to the numerical range of user ID.
In the time of concrete deletion, can from connection pool, delete arbitrarily at least one connection that the connection identifier that matches is corresponding or at least one connection in multiple connections corresponding to the numerical range of any deletion user ID from connection pool.In addition, cannot be used for application program and set up connection corresponding to this service with server because the connection early of creation-time in connection pool often has larger probability, for the availability of the connection that ensures to create in connection pool, the creation-time of the connection that all right pre-recorded each connection identifier is corresponding, deleting corresponding at least one of the connection identifier that matches while connecting from connection pool, delete creation-time at least one connection early in the connection that the connection identifier that matches is corresponding; Or, when at least one in multiple connections corresponding to the numerical range of deleting user ID from connection pool connects, delete creation-time at least one connection early in multiple connections corresponding to the numerical range of user ID.
Except above-mentioned deletion strategy, in the time deleting, also can be without consider it is to adopt which kind of mode to obtain the connection that connection request is corresponding from connection corresponding to the connection identifier that matches in step 303, but direct at least one connection of deletion arbitrarily from connection corresponding to the connection identifier matching, or according to the creation-time of connection corresponding to the connection identifier matching, therefrom delete creation-time at least one connection early.Now, if the corresponding connection of the numerical range of user ID and this connection are deleted, carry in the connection request of user ID when next time, in the numerical range of user ID in this user ID, can adopt the method for step 205 again to create a connection, and the connection again creating is set to corresponding with the numerical range of this user ID.For the specific strategy of at least one connection corresponding to the connection identifier matching in deletion, the embodiment of the present invention does not specifically limit at this.
It should be noted that, if do not get the connection that connection request is corresponding in corresponding at least one of the connection identifier matching connects, except selecting to carry out above-mentioned steps 305, can also select to be connected by the mode of " three-way handshake " by application program and the server of user terminal, for do not get the connection that connection request is corresponding in corresponding at least one of the connection identifier matching connects after, how the application program of user terminal and server connect, and the embodiment of the present invention does not specifically limit at this.
In sum, the method that the embodiment of the present invention provides, the connection identifier that the connection identifier carrying by the connection request of determining in the connection pool building in advance and get matches, and obtain after the connection that connection request is corresponding in connection corresponding to the connection identifier matching, the connection getting is sent to user terminal, application program and the server of user terminal are connected, in the time that connection corresponding to the connection request of application program has been pre-created in connection pool, connect without repeating to create, make the connection pool building in advance to provide connection for multiple application programs, avoid the waste of server connection resource, improve the utilization factor of connection pool, reduce the cost that builds connection pool.
Embodiment tri-
The embodiment of the present invention provides a kind of device connecting, the method connecting that this device provides for carrying out above-described embodiment one or embodiment bis-.Referring to Fig. 4, this device comprises:
The first acquisition module 401, for obtaining the connection request of the service correspondence that application program provides, carries the connection identifier of answering with service relative in connection request;
Determination module 402, the connection identifier that the connection identifier carrying for the connection request that the connection pool building is in advance determined and the first acquisition module 401 gets matches, corresponding at least one connection of the connection identifier matching;
The second acquisition module 403, connects and obtains the connection that connection request is corresponding for corresponding at least one of the connection identifier matching of determining from determination module 402;
The first sending module 404, sends to user terminal for the connection that the second acquisition module 403 is got, and makes the application program on user terminal set up connection corresponding to service according to the connection getting and server.
Preferably, referring to Fig. 5, this device also comprises:
The first removing module 405, in the time that the application program of user terminal is set up connection failure corresponding to described service according to the connection getting and server, the connection that deletion gets from connection pool.
Preferably, referring to Fig. 6, this device also comprises:
The first creation module 406, while not getting connection corresponding to connection request, creates connection corresponding to connection request for connecting in corresponding at least one of the connection identifier from matching;
The second sending module 407, sends to user terminal for the connection that the first creation module 406 is created, and makes the application program of user terminal set up connection corresponding to service according to the connection creating and server.
Preferably, referring to Fig. 7, this device also comprises:
Add module 408,, and add in the connection pool building in advance as the connection corresponding with the connection identifier matching for connection that the first creation module 406 is created.
Preferably, referring to Fig. 8, this device also comprises:
Whether judge module 409, reach predetermined threshold value for the quantity that judges the connection that the connection identifier that matches is corresponding, and in the time that the quantity of connection corresponding to the connection identifier matching does not reach predetermined threshold value, add module 408.
Preferably, referring to Fig. 9, this device also comprises:
The second removing module 410 while judging that the quantity of the connection that the connection identifier that matches is corresponding reaches predetermined threshold value, is deleted corresponding at least one of connection identifier matching and is connected, and carry out and add module 408 for judge module 409 from connection pool.
Preferably, referring to Figure 10, this device also comprises:
Distribution module 411, is used to the connection identifier corresponding to each service distribution of application program;
The second creation module 412, is used to each connection identifier that distribution module 411 is distributed to be pre-created at least one corresponding connection;
Build module 413, corresponding at least one of each connection identifier creating for each connection identifier of distributing according to distribution module 411 and the second creation module 412 connects and builds connection pool.
In sum, the device that the embodiment of the present invention provides, the connection identifier that the connection identifier carrying by the connection request of determining in the connection pool building in advance and get matches, and obtain after the connection that connection request is corresponding in connection corresponding to the connection identifier matching, the connection getting is sent to user terminal, application program and the server of user terminal are connected, in the time that connection corresponding to the connection request of application program has been pre-created in connection pool, connect without repeating to create, make the connection pool building in advance to provide connection for multiple application programs, avoid the waste of server connection resource, improve the utilization factor of connection pool, reduce the cost that builds connection pool.
Embodiment tetra-
Referring to Figure 11, the embodiment of the present invention provides a kind of terminal, and this terminal can be for the method connecting of implementing to provide in above-described embodiment.Specifically:
Terminal 1100 can comprise RF(Radio Frequency, radio frequency) circuit 110, the storer 120 that includes one or more computer-readable recording mediums, input block 130, display unit 140, sensor 150, voicefrequency circuit 160, WiFi (wireless fidelity, Wireless Fidelity) module 170, include one or one parts such as processor 180 and power supply 190 of processing above core.It will be understood by those skilled in the art that the not restriction of structure paired terminal of the terminal structure shown in Figure 11, can comprise the parts more more or less than diagram, or combine some parts, or different parts are arranged.Wherein:
RF circuit 110 can be used for receiving and sending messages or communication process in, the reception of signal and transmission, especially, after the downlink information of base station is received, transfer to more than one or one processor 180 to process; In addition, send to base station by relating to up data.Conventionally, RF circuit 110 includes but not limited to antenna, at least one amplifier, tuner, one or more oscillator, subscriber identity module (SIM) card, transceiver, coupling mechanism, LNA(Low Noise Amplifier, low noise amplifier), diplexer etc.In addition, RF circuit 110 can also be by radio communication and network and other devices communicatings.Described radio communication can be used arbitrary communication standard or agreement, include but not limited to GSM (Global System of Mobile communication, global system for mobile communications), GPRS (General Packet Radio Service, general packet radio service), CDMA (Code Division Multiple Access, CDMA), WCDMA (Wideband Code Division Multiple Access, Wideband Code Division Multiple Access (WCDMA)), LTE (Long Term Evolution, Long Term Evolution), Email, SMS (Short Messaging Service, Short Message Service) etc.
Storer 120 can be used for storing software program and module, and processor 180 is stored in software program and the module of storer 120 by operation, thereby carries out various function application and data processing.Storer 120 can mainly comprise storage program district and storage data field, wherein, and the application program (such as sound-playing function, image player function etc.) that storage program district can storage operation system, function is required etc.; The data (such as voice data, phone directory etc.) that create according to the use of terminal 1100 etc. can be stored in storage data field.In addition, storer 120 can comprise high-speed random access memory, can also comprise nonvolatile memory, for example at least one disk memory, flush memory device or other volatile solid-state parts.Correspondingly, storer 120 can also comprise Memory Controller, so that processor 180 and the access of input block 130 to storer 120 to be provided.
Input block 130 can be used for receiving numeral or the character information of input, and generation is inputted with user arranges and function control is relevant keyboard, mouse, control lever, optics or trace ball signal.Particularly, input block 130 can comprise touch-sensitive surperficial 131 and other input equipments 132.Touch-sensitive surperficial 131, also referred to as touch display screen or Trackpad, can collect user or near touch operation (using any applicable object or near the operations of annex on touch-sensitive surperficial 131 or touch-sensitive surperficial 131 such as finger, stylus such as user) thereon, and drive corresponding coupling arrangement according to predefined formula.Optionally, touch-sensitive surperficial 131 can comprise touch detecting apparatus and two parts of touch controller.Wherein, touch detecting apparatus detects user's touch orientation, and detects the signal that touch operation brings, and sends signal to touch controller; Touch controller receives touch information from touch detecting apparatus, and converts it to contact coordinate, then gives processor 180, and the order that energy receiving processor 180 is sent is also carried out.In addition, can adopt the polytypes such as resistance-type, condenser type, infrared ray and surface acoustic wave to realize touch-sensitive surperficial 131.Except touch-sensitive surperficial 131, input block 130 can also comprise other input equipments 132.Particularly, other input equipments 132 can include but not limited to one or more in physical keyboard, function key (such as volume control button, switch key etc.), trace ball, mouse, control lever etc.
Display unit 140 can be used for showing the information inputted by user or the various graphical user interface of the information that offers user and terminal 1100, and these graphical user interface can be made up of figure, text, icon, video and its combination in any.Display unit 140 can comprise display panel 141, optionally, can adopt the form such as LCD (Liquid Crystal Display, liquid crystal display), OLED (Organic Light-Emitting Diode, Organic Light Emitting Diode) to configure display panel 141.Further, touch-sensitive surperficial 131 can cover display panel 141, when touch-sensitive surperficial 131 detect thereon or near touch operation after, send processor 180 to determine the type of touch event, corresponding vision output is provided according to the type of touch event with preprocessor 180 on display panel 141.Although in Figure 11, touch-sensitive surperficial 131 with display panel 141 be as two independently parts realize input and input function, in certain embodiments, can by touch-sensitive surperficial 131 and display panel 141 integrated and realize input and output function.
Terminal 1100 also can comprise at least one sensor 150, such as optical sensor, motion sensor and other sensors.Particularly, optical sensor can comprise ambient light sensor and proximity transducer, and wherein, ambient light sensor can regulate according to the light and shade of ambient light the brightness of display panel 141, proximity transducer can, in the time that terminal 1100 moves in one's ear, cut out display panel 141 and/or backlight.As the one of motion sensor; Gravity accelerometer can detect the size of the acceleration that (is generally three axles) in all directions; when static, can detect size and the direction of gravity, can be used for identifying application (such as horizontal/vertical screen switching, dependent game, magnetometer pose calibrating), Vibration identification correlation function (such as passometer, knock) of mobile phone attitude etc.; As for also other sensors such as configurable gyroscope, barometer, hygrometer, thermometer, infrared ray sensor of terminal 1100, do not repeat them here.
Voicefrequency circuit 160, loudspeaker 161, microphone 162 can provide the audio interface between user and terminal 1100.Voicefrequency circuit 160 can, by the electric signal after the voice data conversion receiving, be transferred to loudspeaker 161, is converted to voice signal output by loudspeaker 161; On the other hand, the voice signal of collection is converted to electric signal by microphone 162, after being received by voicefrequency circuit 160, be converted to voice data, after again voice data output processor 180 being processed, through RF circuit 110 to send to such as another terminal, or export voice data to storer 120 so as further process.Voicefrequency circuit 160 also may comprise earphone jack, so that communicating by letter of peripheral hardware earphone and terminal 1100 to be provided.
WiFi belongs to short range wireless transmission technology, terminal 1100 by WiFi module 170 can help that user sends and receive e-mail, browsing page and access streaming video etc., it provides wireless broadband internet access for user.Although Figure 11 shows WiFi module 170, be understandable that, it does not belong to must forming of terminal 1100, completely can be as required in the essential scope that does not change invention and omit.
Processor 180 is control centers of terminal 1100, utilize the various piece of various interface and the whole mobile phone of connection, by moving or carry out the software program and/or the module that are stored in storer 120, and call the data that are stored in storer 120, carry out various functions and the deal with data of terminal 1100, thereby mobile phone is carried out to integral monitoring.Optionally, processor 180 can comprise one or more processing cores; Preferably, processor 180 can integrated application processor and modem processor, and wherein, application processor is mainly processed operating system, user interface and application program etc., and modem processor is mainly processed radio communication.Be understandable that, above-mentioned modem processor also can not be integrated in processor 180.
Terminal 1100 also comprises that the power supply 190(powering to all parts is such as battery), preferably, power supply can be connected with processor 180 logics by power-supply management system, thereby realizes the functions such as management charging, electric discharge and power managed by power-supply management system.Power supply 190 can also comprise the random component such as one or more direct current or AC power, recharging system, power failure detection circuit, power supply changeover device or inverter, power supply status indicator.
Although not shown, terminal 1100 can also comprise camera, bluetooth module etc., does not repeat them here.Specifically in the present embodiment, the display unit of terminal is touch-screen display, terminal also includes storer, and one or more than one program, one of them or more than one program are stored in storer, and are configured to be carried out and stated more than one or one routine package containing for carrying out the instruction of following operation by more than one or one processor:
The connection request that obtains the service correspondence that application program provides, carries the connection identifier of answering with service relative in connection request;
The connection identifier that definite connection identifier carrying with connection request matches in the connection pool building in advance, corresponding at least one connection of the connection identifier matching;
From connecting, corresponding at least one of connection identifier matching obtain the connection that connection request is corresponding, and the connection getting is sent to user terminal, make the application program on user terminal set up connection corresponding to service according to the connection getting and server.
Supposing above-mentioned is the possible embodiment of the first,, in the possible embodiment of the first embodiment possible as the second basic and that provide, in the storer of terminal, also comprises the instruction for carrying out following operation:
If the application program of user terminal is set up connection failure corresponding to service according to the connection getting and server, from connection pool, delete the connection getting.
In the third the possible embodiment providing as basis at the possible embodiment of the first, in the storer of terminal, also comprise the instruction for carrying out following operation:
If do not get the connection that connection request is corresponding from corresponding at least one of connection identifier matching connects, create the connection that connection request is corresponding, and the connection of establishment is sent to user terminal, make the application program of user terminal set up connection corresponding to service according to the connection creating and server.
In the 4th kind of possible embodiment providing as basis at the third possible embodiment, in the storer of terminal, also comprise the instruction for carrying out following operation:
Using the connection of establishment as the connection corresponding with the connection identifier matching, and add in the connection pool building in advance.
In the 5th kind of possible embodiment providing as basis at the 4th kind of possible embodiment, in the storer of terminal, also comprise the instruction for carrying out following operation:
Whether the quantity of the connection that the connection identifier that matches of judgement is corresponding reaches predetermined threshold value;
If the quantity of the connection that the connection identifier matching is corresponding does not reach predetermined threshold value, carry out using the connection of establishment as the connection corresponding with the connection identifier matching, and add the step in the connection pool building in advance to.
In the 6th kind of possible embodiment providing as basis at the 5th kind of possible embodiment, in the storer of terminal, also comprise the instruction for carrying out following operation:
If the quantity of the connection that the connection identifier matching is corresponding reaches predetermined threshold value, from connection pool, delete at least one connection corresponding to connection identifier matching, and carry out using the connection of establishment as the connection corresponding with the connection identifier matching, and add the step in the connection pool building in advance to.
In the 7th kind of possible embodiment providing as basis at the possible embodiment of the first, in the storer of terminal, also comprise the instruction for carrying out following operation:
For connection identifier corresponding to each service distribution of application program, and be that each connection identifier is pre-created at least one corresponding connection;
Connect structure connection pool according to each connection identifier and corresponding at least one thereof.
In sum, the terminal that the embodiment of the present invention provides, the connection identifier that the connection identifier carrying by the connection request of determining in the connection pool building in advance and get matches, and obtain after the connection that connection request is corresponding in connection corresponding to the connection identifier matching, the connection getting is sent to user terminal, application program and the server of user terminal are connected, in the time that connection corresponding to the connection request of application program has been pre-created in connection pool, connect without repeating to create, make the connection pool building in advance to provide connection for multiple application programs, avoid the waste of server connection resource, improve the utilization factor of connection pool, reduce the cost that builds connection pool.
Implement five
The embodiment of the present invention provides a kind of computer-readable recording medium, and this computer-readable recording medium can be the computer-readable recording medium comprising in the storer in above-described embodiment; Also can be individualism, be unkitted the computer-readable recording medium of allocating in terminal.Described computer-readable recording medium stores more than one or one program, and described more than one or one program is used for carrying out a method connecting by one or more than one processor, and described method comprises:
The connection request that obtains the service correspondence that application program provides, carries the connection identifier of answering with service relative in connection request;
The connection identifier that definite connection identifier carrying with connection request matches in the connection pool building in advance, corresponding at least one connection of the connection identifier matching;
From connecting, corresponding at least one of connection identifier matching obtain the connection that connection request is corresponding, and the connection getting is sent to user terminal, make the application program on user terminal set up connection corresponding to service according to the connection getting and server.
Supposing above-mentioned is the possible embodiment of the first,, in the possible embodiment of the first embodiment possible as the second basic and that provide, after the connection getting is sent to user terminal, also comprises:
If the application program of user terminal is set up connection failure corresponding to service according to the connection getting and server, from connection pool, delete the connection getting.
In the third the possible embodiment providing as basis at the possible embodiment of the first, after the connection identifier that definite connection identifier carrying with connection request matches from the connection pool building in advance, also comprise:
If do not get the connection that connection request is corresponding from corresponding at least one of connection identifier matching connects, create the connection that connection request is corresponding, and the connection of establishment is sent to user terminal, make the application program of user terminal set up connection corresponding to service according to the connection creating and server.
In the 4th kind of possible embodiment providing as basis at the third possible embodiment, after creating the connection that connection request is corresponding, also comprise:
Using the connection of establishment as the connection corresponding with the connection identifier matching, and add in the connection pool building in advance.
In the 5th kind of possible embodiment providing as basis at the 4th kind of possible embodiment, using the connection of establishment as the connection corresponding with the connection identifier matching, and before adding in the connection pool building in advance, also comprise:
Whether the quantity of the connection that the connection identifier that matches of judgement is corresponding reaches predetermined threshold value;
If the quantity of the connection that the connection identifier matching is corresponding does not reach predetermined threshold value, carry out using the connection of establishment as the connection corresponding with the connection identifier matching, and add the step in the connection pool building in advance to.
In the 6th kind of possible embodiment providing as basis at the 5th kind of possible embodiment, the quantity of the corresponding connection of connection identifier that judgement matches also comprises after whether reaching predetermined threshold value:
If the quantity of the connection that the connection identifier matching is corresponding reaches predetermined threshold value, from connection pool, delete at least one connection corresponding to connection identifier matching, and carry out using the connection of establishment as the connection corresponding with the connection identifier matching, and add the step in the connection pool building in advance to.
In the 7th kind of possible embodiment providing as basis at the possible embodiment of the first, before the connection identifier that definite connection identifier carrying with connection request matches in the connection pool building in advance, also comprise:
For connection identifier corresponding to each service distribution of application program, and be that each connection identifier is pre-created at least one corresponding connection;
Connect structure connection pool according to each connection identifier and corresponding at least one thereof.
In sum, the computer-readable medium that the embodiment of the present invention provides, the connection identifier that the connection identifier carrying by the connection request of determining in the connection pool building in advance and get matches, and obtain after the connection that connection request is corresponding in connection corresponding to the connection identifier matching, the connection getting is sent to user terminal, application program and the server of user terminal are connected, in the time that connection corresponding to the connection request of application program has been pre-created in connection pool, connect without repeating to create, make the connection pool building in advance to provide connection for multiple application programs, avoid the waste of server connection resource, improve the utilization factor of connection pool, reduce the cost that builds connection pool.
It should be noted that: the device connecting that above-described embodiment provides is in the time connecting, only be illustrated with the division of above-mentioned each functional module, in practical application, can above-mentioned functions be distributed and completed by different functional modules as required, the inner structure of the device that is about to connect is divided into different functional modules, to complete all or part of function described above.In addition, the device connecting that above-described embodiment provides belongs to same design with the embodiment of the method connecting, and its specific implementation process refers to embodiment of the method, repeats no more here.
The invention described above embodiment sequence number, just to describing, does not represent the quality of embodiment.
One of ordinary skill in the art will appreciate that all or part of step that realizes above-described embodiment can complete by hardware, also can carry out the hardware that instruction is relevant by program completes, described program can be stored in a kind of computer-readable recording medium, the above-mentioned storage medium of mentioning can be ROM (read-only memory), disk or CD etc.
The foregoing is only preferred embodiment of the present invention, in order to limit the present invention, within the spirit and principles in the present invention not all, any amendment of doing, be equal to replacement, improvement etc., within all should being included in protection scope of the present invention.

Claims (14)

1. the method connecting, is characterized in that, described method comprises:
The connection request that obtains the service correspondence that application program provides, carries the connection identifier of answering with described service relative in described connection request;
In the connection pool building in advance, determine the connection identifier that the connection identifier that carries with described connection request matches, described in corresponding at least one connection of connection identifier of matching;
From connecting, corresponding at least one of the described connection identifier matching obtain the connection that described connection request is corresponding, and the connection getting is sent to user terminal, make application program on described user terminal according to described in the connection that gets set up connection corresponding to described service with server.
2. method according to claim 1, is characterized in that, described the connection getting is sent to user terminal after, also comprise:
If the connection getting described in the application program of described user terminal basis is set up connection failure corresponding to described service with server, the connection getting described in deleting from described connection pool.
3. method according to claim 1, is characterized in that, after the described connection identifier that definite connection identifier carrying with described connection request matches from the connection pool building in advance, also comprises:
If do not get the connection that described connection request is corresponding from corresponding at least one of the described connection identifier matching connects, create the connection that described connection request is corresponding, and the connection of described establishment is sent to described user terminal, make the application program of described user terminal set up connection corresponding to described service according to the connection of described establishment and server.
4. method according to claim 3, is characterized in that, after connection corresponding to the described connection request of described establishment, also comprises:
Using the connection of described establishment as the connection corresponding with the described connection identifier matching, and in the connection pool building in advance described in adding to.
5. method according to claim 4, is characterized in that, described using the connection of described establishment as the connection corresponding with the described connection identifier matching, and before in the connection pool building in advance described in adding to, also comprises:
Whether the quantity of the connection that the connection identifier that matches described in judgement is corresponding reaches predetermined threshold value;
If described in the quantity of connection corresponding to the connection identifier that matches do not reach predetermined threshold value, carry out using the connection of described establishment as the connection corresponding with the described connection identifier matching, and step in the connection pool building in advance described in adding to.
6. method according to claim 5, is characterized in that, the quantity of the corresponding connection of connection identifier matching described in described judgement also comprises after whether reaching predetermined threshold value:
If described in the quantity of connection corresponding to the connection identifier that matches reach predetermined threshold value, at least one connection corresponding to connection identifier matching described in deleting from described connection pool, and carry out using the connection of described establishment as the connection corresponding with the described connection identifier matching, and described in adding in advance build connection pool in step.
7. method according to claim 1, is characterized in that, before the connection identifier that in the described connection pool building in advance, definite connection identifier carrying with described connection request matches, also comprises:
For connection identifier corresponding to each service distribution of described application program, and be that each connection identifier is pre-created at least one corresponding connection;
Connect structure connection pool according to each connection identifier and corresponding at least one thereof.
8. the device connecting, is characterized in that, described device comprises:
The first acquisition module, for obtaining the connection request of the service correspondence that application program provides, carries the connection identifier of answering with described service relative in described connection request;
Determination module, determines for the connection pool building in advance the connection identifier that connection identifier that the connection request that gets with described the first acquisition module carries matches, described in corresponding at least one connection of connection identifier of matching;
The second acquisition module, connects and obtains the connection that described connection request is corresponding for corresponding at least one of the connection identifier matching of determining from described determination module;
The first sending module, sends to user terminal for the connection that described the second acquisition module is got, make application program on described user terminal according to described in the connection that gets set up connection corresponding to described service with server.
9. device according to claim 8, is characterized in that, described device also comprises:
The first removing module, for the application program of described user terminal according to described in the connection that gets and server while setting up connection failure corresponding to described service, the connection getting described in deletion from described connection pool.
10. device according to claim 8, is characterized in that, described device also comprises:
The first creation module, for connecting from corresponding at least one of the described connection identifier matching while not getting connection corresponding to described connection request, creates the connection that described connection request is corresponding;
The second sending module, sends to described user terminal for the connection that described the first creation module is created, and makes the application program of described user terminal set up connection corresponding to described service according to the connection of described establishment and server.
11. devices according to claim 10, is characterized in that, described device also comprises:
Add module, for using described first creation module create connection as the connection corresponding with the described connection identifier matching, and described in adding in advance build connection pool in.
12. devices according to claim 11, is characterized in that, described device also comprises:
Whether judge module, reach predetermined threshold value for the quantity of connection corresponding to the connection identifier that matches described in judging, and in the time that the quantity of connection corresponding to the described connection identifier matching does not reach predetermined threshold value, described interpolation module.
13. devices according to claim 12, is characterized in that, described device also comprises:
The second removing module, while judging that for described judge module the quantity of the connection that the connection identifier that matches is corresponding reaches predetermined threshold value, corresponding at least one of connection identifier matching described in deleting from described connection pool connects, and carries out described interpolation module.
14. devices according to claim 8, is characterized in that, described device also comprises:
Distribution module, is used to the connection identifier corresponding to each service distribution of described application program;
The second creation module, is used to each connection identifier of described module assigns to be pre-created at least one corresponding connection;
Build module, for connecting and build connection pool according to corresponding at least one of each connection identifier of each connection identifier of described module assigns and described the second creation module establishment.
CN201310172564.9A 2013-05-10 2013-05-10 Establish the method and device of connection Active CN104142868B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310172564.9A CN104142868B (en) 2013-05-10 2013-05-10 Establish the method and device of connection

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310172564.9A CN104142868B (en) 2013-05-10 2013-05-10 Establish the method and device of connection

Publications (2)

Publication Number Publication Date
CN104142868A true CN104142868A (en) 2014-11-12
CN104142868B CN104142868B (en) 2019-05-07

Family

ID=51852049

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310172564.9A Active CN104142868B (en) 2013-05-10 2013-05-10 Establish the method and device of connection

Country Status (1)

Country Link
CN (1) CN104142868B (en)

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105956000A (en) * 2016-04-20 2016-09-21 广州华多网络科技有限公司 Data exchange method and client
CN106469156A (en) * 2015-08-17 2017-03-01 华为终端(东莞)有限公司 Data base read-write method and device
CN107547634A (en) * 2017-07-28 2018-01-05 新华三信息安全技术有限公司 A kind of conversation managing method and device
CN107885537A (en) * 2016-09-28 2018-04-06 平安科技(深圳)有限公司 Configuration file loading method and device
CN107995233A (en) * 2016-10-26 2018-05-04 阿里巴巴集团控股有限公司 Establish the method for connection and corresponding equipment
CN108156488A (en) * 2017-12-22 2018-06-12 北京数码视讯软件技术发展有限公司 Interactive approach and electronic equipment based on gateway server
CN108366004A (en) * 2018-02-07 2018-08-03 北京奇艺世纪科技有限公司 A kind of connection method and the connection system of intelligent sound box and controlled device
CN108932948A (en) * 2017-05-26 2018-12-04 腾讯科技(深圳)有限公司 Audio data processing method, device, computer equipment and computer readable storage medium
CN110493353A (en) * 2019-09-05 2019-11-22 香港乐蜜有限公司 Communication means, device and server
CN110971703A (en) * 2019-12-11 2020-04-07 腾讯科技(深圳)有限公司 Service request method, device, server and storage medium based on connection pool
WO2021114518A1 (en) * 2019-12-09 2021-06-17 深圳市盛铂科技有限公司 Connection method for network device, and network device
CN115568036A (en) * 2022-10-14 2023-01-03 荣耀终端有限公司 Application connection method and electronic equipment
CN117539949A (en) * 2024-01-10 2024-02-09 腾讯科技(深圳)有限公司 Processing method and device of database access request, electronic equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101309233A (en) * 2008-06-04 2008-11-19 腾讯科技(深圳)有限公司 Method realizing TCP connection reusing in instant communication
CN101447993A (en) * 2008-12-23 2009-06-03 深圳市金蝶中间件有限公司 Method and device for finding unreleased connection in connection pool
US20100036957A1 (en) * 2008-08-08 2010-02-11 Oracle International Corporation Method and System for Implementing Transfer of a Network Session
CN102957627A (en) * 2012-11-19 2013-03-06 浪潮电子信息产业股份有限公司 Method for improving data transmission efficiency on basis of TCP (Transmission Control Protocol) long connection

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101309233A (en) * 2008-06-04 2008-11-19 腾讯科技(深圳)有限公司 Method realizing TCP connection reusing in instant communication
US20100036957A1 (en) * 2008-08-08 2010-02-11 Oracle International Corporation Method and System for Implementing Transfer of a Network Session
CN101447993A (en) * 2008-12-23 2009-06-03 深圳市金蝶中间件有限公司 Method and device for finding unreleased connection in connection pool
CN102957627A (en) * 2012-11-19 2013-03-06 浪潮电子信息产业股份有限公司 Method for improving data transmission efficiency on basis of TCP (Transmission Control Protocol) long connection

Cited By (19)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106469156A (en) * 2015-08-17 2017-03-01 华为终端(东莞)有限公司 Data base read-write method and device
CN106469156B (en) * 2015-08-17 2019-10-18 华为终端有限公司 Data base read-write method and device
CN105956000A (en) * 2016-04-20 2016-09-21 广州华多网络科技有限公司 Data exchange method and client
CN107885537A (en) * 2016-09-28 2018-04-06 平安科技(深圳)有限公司 Configuration file loading method and device
CN107995233A (en) * 2016-10-26 2018-05-04 阿里巴巴集团控股有限公司 Establish the method for connection and corresponding equipment
CN107995233B (en) * 2016-10-26 2021-12-17 阿里巴巴集团控股有限公司 Method for establishing connection and corresponding equipment
CN108932948B (en) * 2017-05-26 2021-12-14 腾讯科技(深圳)有限公司 Audio data processing method and device, computer equipment and computer readable storage medium
CN108932948A (en) * 2017-05-26 2018-12-04 腾讯科技(深圳)有限公司 Audio data processing method, device, computer equipment and computer readable storage medium
CN107547634A (en) * 2017-07-28 2018-01-05 新华三信息安全技术有限公司 A kind of conversation managing method and device
CN107547634B (en) * 2017-07-28 2020-11-03 新华三信息安全技术有限公司 Session management method and device
CN108156488A (en) * 2017-12-22 2018-06-12 北京数码视讯软件技术发展有限公司 Interactive approach and electronic equipment based on gateway server
CN108366004A (en) * 2018-02-07 2018-08-03 北京奇艺世纪科技有限公司 A kind of connection method and the connection system of intelligent sound box and controlled device
CN110493353A (en) * 2019-09-05 2019-11-22 香港乐蜜有限公司 Communication means, device and server
WO2021114518A1 (en) * 2019-12-09 2021-06-17 深圳市盛铂科技有限公司 Connection method for network device, and network device
CN110971703A (en) * 2019-12-11 2020-04-07 腾讯科技(深圳)有限公司 Service request method, device, server and storage medium based on connection pool
CN115568036A (en) * 2022-10-14 2023-01-03 荣耀终端有限公司 Application connection method and electronic equipment
CN115568036B (en) * 2022-10-14 2023-10-20 荣耀终端有限公司 Application connection method, electronic equipment, chip and storage medium
CN117539949A (en) * 2024-01-10 2024-02-09 腾讯科技(深圳)有限公司 Processing method and device of database access request, electronic equipment and storage medium
CN117539949B (en) * 2024-01-10 2024-04-12 腾讯科技(深圳)有限公司 Processing method and device of database access request, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN104142868B (en) 2019-05-07

Similar Documents

Publication Publication Date Title
CN104142868A (en) Connection establishment method and device
CN105005909A (en) Method and device for predicting lost users
CN104518953A (en) Message deleting method, instant messaging terminal and system
CN104142862A (en) Overload protection method and device for server
CN104462119A (en) Data migration method and device
CN105490919A (en) Message withdrawal method and device
CN104618217A (en) Method, terminal, server and system for sharing resource
CN103442330A (en) Position notification method and device
CN103179026B (en) Communication means in user interactive system, system and server and client side
CN104636047A (en) Method and device for operating objects in list and touch screen terminal
CN104427074A (en) Method, device and system for displaying incoming information
CN104426962A (en) Multi-terminal binding method, binding server, terminal and multi-terminal binding system
CN104301315A (en) Method and device for limiting information access
CN104111927A (en) Method, equipment and system for information classification
CN104717341A (en) Message prompting method and terminal
CN104065693A (en) Method, device and system for accessing network data in webpage applications
CN104252341A (en) Method and device for resurfacing application program and client side device of application program
CN104618223A (en) Information recommendation management method, device and system
CN104954159A (en) Network information statistics method and device
CN104516624A (en) Method and device for inputting account information
CN104660769A (en) Method, device and system for adding contact person information
CN103561155B (en) Send the method for note, device and terminal
CN103200077B (en) The method of data interaction during a kind of voice call, Apparatus and system
CN104092657A (en) Information transmission method, device and system
CN104901992A (en) Resource transfer method and device

Legal Events

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