CN114286425A - Long connection establishing system, method and device, electronic equipment and storage medium - Google Patents

Long connection establishing system, method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN114286425A
CN114286425A CN202111554948.8A CN202111554948A CN114286425A CN 114286425 A CN114286425 A CN 114286425A CN 202111554948 A CN202111554948 A CN 202111554948A CN 114286425 A CN114286425 A CN 114286425A
Authority
CN
China
Prior art keywords
access point
access
access points
client
long connection
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.)
Pending
Application number
CN202111554948.8A
Other languages
Chinese (zh)
Inventor
翁祥
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Dajia Internet Information Technology Co Ltd
Original Assignee
Beijing Dajia Internet Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Dajia Internet Information Technology Co Ltd filed Critical Beijing Dajia Internet Information Technology Co Ltd
Priority to CN202111554948.8A priority Critical patent/CN114286425A/en
Publication of CN114286425A publication Critical patent/CN114286425A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Mobile Radio Communication Systems (AREA)

Abstract

The present disclosure relates to a long connection establishing system, method, apparatus, electronic device and storage medium, including: the method comprises the steps of receiving access information of a plurality of access points sent by a server, wherein the plurality of access points comprise recommended access points, the recommended access points are determined by the server according to the connection speed and the load information of each access point corresponding to a client, the recommended access points are access points of which the load information meets a preset condition and the connection speed corresponding to the client is the fastest, and then sending a long connection request aiming at the recommended access points to the server according to the access information of the recommended access points after the access points are disconnected from the server so as to establish long connection between the client and the recommended access points. In this way, the client preferentially tries to establish a long connection with the recommended access point, and the recommended access point is connected faster and has more balanced load compared with other access points, so that the client is more likely to be connected to the access point with shorter time consumption and better performance, thereby improving the service implementation effect and the user experience.

Description

Long connection establishing system, method and device, electronic equipment and storage medium
Technical Field
The present disclosure relates to the field of network communications, and in particular, to a long connection establishment system, method, apparatus, electronic device, and storage medium.
Background
The long connection is a bottom layer uplink and downlink signaling channel, and can be applied to various services such as private signaling/games/live broadcasting between the client and the server. After any service is started, a long connection sdk (Software Development Kit) of the client establishes a long connection based on TCP (Transmission Control Protocol) with an access point of the server, so that multiple data packets for the service can be continuously sent between the client and the server through the long connection.
In the prior art, a server issues all access points of the client to the client in full, wherein the access points include a randomly selected recommended access point, then the client first tries to establish connection with the recommended access point of the server in the process of establishing connection with the server again, if the connection with the recommended access point fails to be established, the client can adopt a three-horse race mode to randomly select three other access points to try to establish connection, and randomly supplement a new access point from the remaining access points which do not try to establish connection each time one of the access points fails to be established until the connection with any one of the access points is successfully established.
It can be understood that, the time consumption for establishing connection and transmitting data packets between the clients under different regional operators and different long connection access points is different, and the shorter the time consumption is, the better the service implementation effect and the user experience are, while the prior art cannot ensure that each client is connected to an access point which consumes the shorter time, thereby causing the poor service implementation effect and the user experience.
Disclosure of Invention
The present disclosure provides a long connection establishment method, apparatus, electronic device, and storage medium, to at least solve the problem in the related art that it is an access point that consumes less time for each client to connect, which results in poor service implementation effect and user experience. The technical scheme of the disclosure is as follows:
according to a first aspect of the embodiments of the present disclosure, a long connection establishing method is provided, which is applied to a client, and includes:
receiving access information of a plurality of access points sent by a server, wherein the plurality of access points comprise recommended access points, the recommended access points are determined by the server according to the connection speed and the load information of each access point corresponding to the client, and the recommended access points are access points of which the load information meets a preset condition and the connection speed corresponding to the client is the fastest;
and after the client is disconnected with the server, sending a long connection request aiming at the recommended access point to the server according to the access information of the recommended access point so as to establish long connection between the client and the recommended access point.
Optionally, the receiving access information of multiple access points sent by the server includes:
receiving access information and sequencing of a plurality of access points sent by the server, wherein the sequencing is determined by the server according to the sequence of the connection speed of each access point corresponding to the client from high to low;
in the case of a failure to establish a long connection with the recommended access point, the method further comprises:
and according to the sequence of the plurality of access points, selecting a first preset number of access points from other access points except the recommended access point as candidate access points, and sending a long connection request aiming at the candidate access points to the server until the long connection with any one of the candidate access points is successfully established.
Optionally, in a case that the long connection with any of the candidate access points fails to be established, the method further includes:
and according to the sequence of the plurality of access points, selecting one access point from unselected access points, supplementing the selected access point as the candidate access point, and returning to the step of sending the long connection request aiming at the candidate access point to the server until the long connection with any one candidate access point is successfully established.
Optionally, the selecting, according to the ranking of the plurality of access points, a first preset number of access points from access points other than the recommended access point as candidate access points, and sending a long connection request for the candidate access points to the server includes:
and according to the sequence of the plurality of access points, selecting a second preset number of access points from other access points except the recommended access point, taking the selected second preset number of access points and the history access point as candidate access points, and sending a long connection request aiming at the candidate access points to the server, wherein the second preset number is obtained by subtracting one from the first preset number, and the history access point is an access point which establishes long connection with the client at the last time.
Optionally, after the sending the long connection request for the recommended access point to the server, the method further includes:
and sending a long connection request aiming at a historical access point to the server to establish long connection between the client and the recommended access point or the historical access point under the condition that the long connection with the recommended access point is not established within preset time.
Optionally, the receiving access information of multiple access points sent by the server includes:
receiving access information and sequencing of a plurality of access points sent by the server, wherein the sequencing is determined by the server according to the sequence of the connection speed of each access point corresponding to the client from high to low;
in the event of a failure to establish a long connection with the recommended access point or the historical access point, the method further comprises:
and according to the sequence of the plurality of access points, selecting a second preset number of access points from the access points except the recommended access point and the historical access point as candidate access points, and sending a long connection request aiming at the candidate access points and a target access point to the server, wherein the target access point is an access point which is not failed to connect in the recommended access point or the historical access point.
Optionally, in the case that the long connection with the recommended access point or the historical access point or any one of the candidate access points fails to be established, the method further includes:
and according to the sequence of the plurality of access points, selecting one access point from unselected access points, supplementing the selected access point as the candidate access point, and returning to the step of sending the long connection request aiming at the candidate access point and the target access point to the server until the long connection with the target access point or any one of the candidate access points is successfully established.
Optionally, the receiving access information of multiple access points sent by the server includes:
sending a long connection request aiming at a preset access point to a server according to pre-acquired access information of the preset access point so as to establish long connection with the preset access point;
and receiving access information of the plurality of access points sent by the server through long connection with the preset access point.
According to a second aspect of the embodiments of the present disclosure, there is provided a long connection establishing method, applied to a server, including:
the method comprises the steps that access information of a plurality of access points of the access point is sent to a client side, wherein the access points comprise recommended access points, the recommended access points are determined from the access points according to the connection speed and the load information of each access point corresponding to the client side, and the recommended access points are access points with the highest connection speed corresponding to the client side in the access points of which the load information meets the preset conditions;
and after the connection with the client is disconnected, responding to a long connection request aiming at the recommended access point sent by the client, and establishing the long connection between the recommended access point and the client.
Optionally, the issuing the access information of the multiple access points to the client includes:
sending access information and sequencing of a plurality of access points to the client, wherein the sequencing is determined according to the sequence of the connection speed of each access point corresponding to the client from high to low;
in the event of a failure to establish a long connection between the recommended access point and the client, the method further comprises:
responding to a long connection request aiming at a candidate access point sent by the client, and establishing long connection between the candidate access point and the client until the long connection between any candidate access point and the client is successfully established, wherein the candidate access point is selected from other access points except the recommended access point by the client according to the sequence of the plurality of access points.
Optionally, in a case that a long connection between the recommended access point and the client is not established within a preset time, the method further includes:
responding to a long connection request aiming at a history access point sent by the client, and establishing long connection between the history access point and the client until the recommended access point or the long connection between the history access point and the client is successfully established, wherein the history access point is the access point which is used for establishing the long connection with the client last time.
Optionally, the issuing the access information of the multiple access points to the client includes:
sending access information and sequencing of a plurality of access points to the client, wherein the sequencing is determined according to the sequence of the connection speed of each access point corresponding to the client from high to low;
in the event that establishing the long connection between the recommended access point or the historical access point and the client fails, the method further comprises:
and in response to a long connection request which is sent by the client and aims at a candidate access point and a target access point, establishing long connection between the candidate access point or the target access point and the client, wherein the candidate access point is selected by the client from other access points except the recommended access point and the historical access point according to the sequence of the plurality of access points, and the target access point is an access point which is not failed to connect in the recommended access point or the historical access point.
Optionally, the issuing the access information and the sequence of the multiple access points to the client includes:
acquiring the connection speed of each access point corresponding to the client;
sequencing the plurality of access points according to the sequence of the connection speeds from large to small;
and transmitting the access information of the plurality of access points and the sequence of the plurality of access points to a client.
Optionally, the obtaining the connection speed of each access point corresponding to the client includes:
according to a first preset period, carrying out dialing detection between each access point and each regional service device to obtain the access speed between each access point and each regional service device;
and calculating the average access speed between each access point and each regional service device according to at least one access speed obtained in a second preset period, wherein the average access speed is used as the connection speed of each access point corresponding to the client connected with each regional service device.
Optionally, before the sending the access information of the multiple access points to the client, the method further includes:
taking the access point with the highest connection speed as the access point to be recommended, and judging whether the load information of the access point to be recommended meets a preset condition or not;
if the access point to be recommended meets the preset conditions, determining the access point to be recommended as a recommended access point, if the access point to be recommended does not meet the preset conditions, taking an access point with a connection speed slower than that of the access point to be recommended as a new access point to be recommended, and returning to the step of judging whether the load information of the access point to be recommended meets the preset conditions.
Optionally, the issuing the access information of the multiple access points to the client includes:
responding to a long connection request aiming at a preset access point sent by a client, and establishing long connection between the preset access point and the client;
and issuing the access information of the plurality of access points to the client through the long connection between the preset access point and the client.
According to a third aspect of the embodiments of the present disclosure, there is provided a long connection establishment system including:
the server is used for issuing access information of a plurality of access points to the client, wherein the access points comprise recommended access points, the recommended access points are determined from the access points according to the connection speed and the load information of each access point corresponding to the client, and the recommended access points are the access points with the highest connection speed corresponding to the client in the access points with the load information meeting preset conditions;
the client is used for receiving access information of the plurality of access points sent by the server; after the server is disconnected, sending a long connection request aiming at the recommended access point to the server according to the access information of the recommended access point;
the server is further used for responding to a long connection request which is sent by the client and aims at the recommended access point, and establishing long connection between the recommended access point and the client.
Optionally, the server is specifically configured to send access information and a rank of a plurality of access points of the server to the client, where the rank is determined according to a descending order of connection speed of each access point corresponding to the client;
the client is further configured to select a first preset number of access points from the other access points except the recommended access point according to the ranking of the plurality of access points under the condition that the long connection with the recommended access point fails to be established, to serve as candidate access points, and send a long connection request for the candidate access points to the server;
the server is further configured to respond to a long connection request for a candidate access point sent by the client, and establish a long connection between the candidate access point and the client until the establishment of the long connection between any one of the candidate access point and the client is successful.
Optionally, the client is further configured to send a long connection request for a historical access point to the server when a long connection with the recommended access point is not established within a preset time;
the server is further configured to respond to a long connection request for a history access point sent by the client, and establish a long connection between the history access point and the client until the recommended access point or the long connection between the history access point and the client is successfully established.
Optionally, the server is specifically configured to send access information and a rank of a plurality of access points of the server to the client, where the rank is determined according to a descending order of connection speed of each access point corresponding to the client;
the client is further configured to select a second preset number of access points from the access points except the recommended access point and the historical access point according to the ranking of the plurality of access points under the condition that the long connection with the recommended access point or the historical access point fails, and send a long connection request for the candidate access point and a target access point to the server, where the target access point is an access point which does not fail to connect among the recommended access point or the historical access point;
the server is further configured to establish a long connection between the candidate access point or the target access point and the client in response to a long connection request for the candidate access point and the target access point sent by the client.
Optionally, the client is further configured to send a long connection request for a preset access point to a server according to access information of the preset access point, which is acquired in advance, so as to establish a long connection with the preset access point;
the server is also used for responding to a long connection request aiming at a preset access point sent by a client and establishing long connection between the preset access point and the client; sending the access information of a plurality of access points to the client through the long connection between the preset access point and the client;
the client is further configured to receive access information of the plurality of access points sent by the server through long connection with the preset access point.
According to a fourth aspect of the embodiments of the present disclosure, there is provided a long connection establishing apparatus, applied to a client, including:
the access control device comprises a receiving unit, a processing unit and a processing unit, wherein the receiving unit is configured to execute access information of a plurality of access points sent by a server, the plurality of access points comprise recommended access points, the recommended access points are determined by the server according to the connection speed and the load information of each access point corresponding to the client, and the recommended access points are access points of which the load information meets a preset condition and the connection speed corresponding to the client is the fastest;
the request unit is configured to send a long connection request aiming at the recommended access point to the server according to the access information of the recommended access point after disconnecting from the server so as to establish long connection between the client and the recommended access point.
Optionally, the receiving unit is specifically configured to perform receiving access information of a plurality of access points sent by the server and performing ranking, where the ranking is determined by the server according to a descending order of connection speeds of the access points corresponding to the clients;
the device further comprises:
and the first racing unit is configured to select a first preset number of access points from other access points except the recommended access point according to the sequence of the plurality of access points when the long connection with the recommended access point is failed to be established, and send a long connection request aiming at the candidate access points to the server as candidate access points until the long connection with any one of the candidate access points is successfully established.
Optionally, the apparatus further comprises:
and a first supplementing unit configured to, in the case that the long connection with any one of the candidate access points fails, select one access point from unselected access points according to the ranking of the plurality of access points, supplement the selected access point as the candidate access point, and return to the step of sending the long connection request for the candidate access point to the server until the long connection with any one of the candidate access points is successfully established.
Optionally, the first racing unit is configured to select a second preset number of access points from other access points except the recommended access point according to the ranking of the plurality of access points, use the selected second preset number of access points and a historical access point as candidate access points, and send a long connection request for the candidate access points to the server, where the second preset number is obtained by subtracting one from the first preset number, and the historical access point is an access point that has last established long connection with the client.
Optionally, the apparatus further comprises:
a second racing unit configured to perform sending a long connection request for a history access point to the server to establish a long connection between the client and the recommended access point or the history access point, in a case where a long connection with the recommended access point is not established within a preset time.
Optionally, the receiving unit is specifically configured to perform receiving access information of a plurality of access points sent by the server and performing ranking, where the ranking is determined by the server according to a descending order of connection speeds of the access points corresponding to the clients;
the device further comprises:
a second supplementing unit, configured to select a second preset number of access points from other access points except the recommended access point and the historical access point according to the ranking of the plurality of access points when the long connection with the recommended access point or the historical access point fails, and send a long connection request for the candidate access point and a target access point to the server, where the target access point is an access point which does not fail to connect among the recommended access point or the historical access point.
Optionally, the second supplementing unit is configured to, in a case that the long connection with the recommended access point or the historical access point or any one of the candidate access points fails, select one access point from unselected access points according to the ranking of the plurality of access points, supplement the selected access point as the candidate access point, and return to the step of sending the long connection request for the candidate access point and the target access point to the server until the long connection with the target access point or any one of the candidate access points is successfully established.
Optionally, the receiving unit is specifically configured to execute sending a long connection request for a preset access point to a server according to access information of the preset access point acquired in advance, so as to establish a long connection with the preset access point; and receiving access information of the plurality of access points sent by the server through long connection with the preset access point.
According to a fifth aspect of the embodiments of the present disclosure, there is provided a long connection establishment system apparatus, applied to a server, including:
the system comprises a sending unit, a receiving unit and a sending unit, wherein the sending unit is configured to execute sending of access information of a plurality of access points of the sending unit to a client, the plurality of access points comprise recommended access points, the recommended access points are determined from the plurality of access points according to connection speed and load information of each access point corresponding to the client, and the recommended access points are access points with the fastest connection speed corresponding to the client in the access points of which the load information meets preset conditions;
a response unit configured to perform, after disconnecting from the client, establishing a long connection between the recommended access point and the client in response to a long connection request for the recommended access point sent by the client.
Optionally, the issuing unit is configured to execute issuing access information and a sequence of multiple access points of the issuing unit to the client, where the sequence is determined according to a descending order of a connection speed of each access point corresponding to the client;
the response unit is further configured to execute, in a case that the establishment of the long connection between the recommended access point and the client fails, in response to a long connection request for a candidate access point sent by the client, the establishment of the long connection between the candidate access point and the client until the establishment of the long connection between any one of the candidate access point and the client succeeds, where the candidate access point is selected by the client from other access points except the recommended access point according to the ranking of the plurality of access points.
Optionally, the responding unit is further configured to perform, in response to a long connection request for a history access point sent by the client, establishing a long connection between the history access point and the client until the recommended access point or the long connection between the history access point and the client is successfully established, where the history access point is an access point that has last established a long connection with the client.
Optionally, the issuing unit is further configured to execute issuing access information and a sequence of multiple access points of the issuing unit to the client, where the sequence is determined according to a descending order of a connection speed of each access point corresponding to the client;
the response unit is further configured to perform, in a case where the establishment of the long connection between the recommended access point or the historical access point and the client fails, the establishment of the long connection between the candidate access point or the target access point and the client in response to a long connection request sent by the client for a candidate access point and a target access point, where the candidate access point is selected by the client from access points other than the recommended access point and the historical access point according to the ranking of the plurality of access points, and the target access point is an access point that has not failed to connect among the recommended access point or the historical access point.
Optionally, the issuing unit is specifically configured to execute obtaining a connection speed of each access point corresponding to the client; sequencing the plurality of access points according to the sequence of the connection speeds from large to small; and transmitting the access information of the plurality of access points and the sequence of the plurality of access points to a client.
Optionally, the issuing unit is specifically configured to perform dialing detection between each access point and each regional service device according to a first preset period, so as to obtain an access speed between each access point and each regional service device; and calculating the average access speed between each access point and each regional service device according to at least one access speed obtained in a second preset period, wherein the average access speed is used as the connection speed of each access point corresponding to the client connected with each regional service device.
Optionally, the issuing unit is further configured to execute taking the access point with the fastest connection speed as the access point to be recommended, and determine whether load information of the access point to be recommended meets a preset condition; if the access point to be recommended meets the preset conditions, determining the access point to be recommended as a recommended access point, if the access point to be recommended does not meet the preset conditions, taking an access point with a connection speed slower than that of the access point to be recommended as a new access point to be recommended, and returning to the step of judging whether the load information of the access point to be recommended meets the preset conditions.
Optionally, the issuing unit is further configured to execute a long connection request for a preset access point sent by a client, and establish a long connection between the preset access point and the client; and issuing the access information of the plurality of access points to the client through the long connection between the preset access point and the client.
According to a sixth aspect of the embodiments of the present disclosure, there is provided a long connection establishment electronic device including:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the long connection establishment method of the first item.
According to a seventh aspect of embodiments of the present disclosure, there is provided a computer-readable storage medium, wherein instructions, when executed by a processor of a long connection establishment electronic device, enable the long connection establishment electronic device to perform the long connection establishment method of the first item described above.
According to an eighth aspect of embodiments of the present disclosure, there is provided a computer program product comprising computer programs/instructions which, when executed by a processor, implement the long connection establishment method of the first item described above.
The technical scheme provided by the embodiment of the disclosure at least brings the following beneficial effects:
the method comprises the steps that a client receives access information of a plurality of access points sent by a server, wherein the plurality of access points comprise recommended access points, the recommended access points are determined by the server according to the connection speed and the load information of each access point corresponding to the client, the recommended access points are access points with load information meeting preset conditions and corresponding to the client with the fastest connection speed, and then after the access points are disconnected from the server, long connection requests aiming at the recommended access points are sent to the server according to the access information of the recommended access points so as to establish long connection between the client and the recommended access points.
Therefore, the client preferentially tries to establish long connection with the recommended access point according to the access information of the access points sent by the server, and the recommended access point is determined according to the connection speed and the load information of each access point corresponding to the client.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the disclosure and are not to be construed as limiting the disclosure.
Fig. 1 is an interaction diagram illustrating a long connection establishment system according to an exemplary embodiment.
Fig. 2 is a flow chart illustrating a method for long connection establishment in accordance with an example embodiment.
Fig. 3 is a flow chart illustrating a method for long connection establishment in accordance with an example embodiment.
Fig. 4 is a block diagram illustrating a long connection establishment apparatus according to an example embodiment.
Fig. 5 is a block diagram illustrating a long connection establishment apparatus according to an example embodiment.
Fig. 6 is a block diagram illustrating an electronic device for long connection establishment in accordance with an example embodiment.
Fig. 7 is a block diagram illustrating an apparatus for long connection establishment in accordance with an example embodiment.
Detailed Description
In order to make the technical solutions of the present disclosure better understood by those of ordinary skill in the art, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.
It should be noted that the terms "first," "second," and the like in the description and claims of the present disclosure and in the above-described drawings are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the disclosure described herein are capable of operation in sequences other than those illustrated or otherwise described herein. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
Fig. 1 is an interaction diagram illustrating a long connection establishment system according to an exemplary embodiment, where the long connection establishment system includes a client and a server, where the server may be a cloud server, each server has a plurality of access points, the client may be any user equipment, such as a mobile terminal, a computer terminal, and the like, a long connection sdk is configured on the user equipment, and the client may establish a long connection with an access point on the server through a long connection sdk, and further, data transmission between the client and the server may be achieved through the long connection.
In the disclosure, the process of establishing a long connection between a client and a server in a long connection establishment system includes:
in S101, the server issues access information of multiple access points of the server to the client.
The plurality of access points comprise recommended access points, the recommended access points are determined from the plurality of access points according to the connection speed and the load information of each access point corresponding to the client, and the recommended access points are the access points with the fastest connection speed corresponding to the client in the access points with the load information meeting the preset conditions.
The access information may include domain name information and ip (Internet Protocol) information of corresponding access points, that is, after the server issues the access information of multiple access points to the client, the client may establish a long connection with any access point according to the access information of the access point.
The server comprises a plurality of access points, each access point can provide long connection service, and it can be understood that, due to different network states of each access point, the connection speed of each access point corresponding to the client may also be different, and the faster the connection speed is, that is, the shorter the time required for the client to establish a long connection with the access point is, the earlier the client can implement data transmission with the server, and the better the user experience is.
In addition, because the bandwidth corresponding to each access point and the number of the connected clients are different, and the load condition of each access point is also different, the load information can reflect the load condition of the corresponding access point, including the information such as the total bandwidth, the occupied bandwidth or the residual bandwidth of the access point, and it can be understood that the server can realize load balance, and can provide better and more stable long connection service for the clients under the condition that each access point is not overloaded.
In the disclosure, the server may determine, in advance, the recommended access point from the plurality of access points according to the average connection establishment speed and the load information of each access point corresponding to the client, where the connection speed of the recommended access point corresponding to the client is fast and the recommended access point is not overloaded, that is, time consumption required for establishing a long connection between the client and the recommended access point is short, performance is excellent, and it is beneficial to improve a service implementation effect and user experience.
For example, the process of the server determining the recommended access point from the plurality of access points may include: firstly, an access point with the highest connection speed is used as an access point to be recommended, whether the load information of the access point to be recommended meets a preset condition is judged, if yes, the fact that the access point to be recommended is not overloaded currently and has a certain load quota is indicated, then the access point to be recommended can be determined as the recommended access point, if not, the fact that the access point to be recommended is overloaded or the load quota cannot meet the requirements of a client side is indicated, then the access point with the connection speed only slower than that of the access point to be recommended can be used as a new access point to be recommended, and the step of judging whether the load information of the access point to be recommended meets the preset condition is returned until the recommended access point is determined.
The connection speed of each access point corresponding to the client can be determined according to the access speed of the access point and the client within a period of time, or a periodic dial testing and offline computing module can be configured on the server, the access speed between each access point and the client is periodically acquired through the periodic dial testing of each access point to the client, and then the connection speed of each access point corresponding to the client is acquired through offline computing.
In one implementation, a plurality of clients in the same area are connected to the same area service device, and then long connections are established with the server through the connected area service device, and long connections are established between any access point and the clients, and are all established with the same area service device, that is, the connection speeds of any access point corresponding to the clients connected to the same area service device are all the same, and the connection speed of the access point corresponding to the area service device can be used as the connection speed of the access point corresponding to each client connected to the area service device.
For example, in the present disclosure, the server may take the following steps to obtain the connection speed of each access point corresponding to the client: firstly, the server performs dialing detection between each access point and each regional service device according to a first preset period to obtain an access speed between each access point and each regional service device, and then calculates an average access speed between each access point and each regional service device according to at least one access speed obtained in a second preset period, wherein the average access speed is used as a connection speed of each access point corresponding to a client connected with each regional service device, and the second preset period is longer than the first preset period.
In this way, the server can further determine a recommended access point which is favorable for improving the service implementation effect and the user experience from the plurality of access points according to the connection speed and the load information of each access point corresponding to the client.
In the disclosure, the server may issue the access information of each access point to the client through a long connection between a preset access point and the client.
Specifically, first, the client may send a long connection request for a preset access point to the server according to the access information of the preset access point acquired in advance, so as to establish a long connection with the preset access point. That is, the access information of the preset access point for establishing the first connection with the server is stored in the client in advance, so that the client can send a long connection request for the preset access point to the server according to the domain name information and the ip information of the preset access point through the long connection sdk configured by the client.
Then, the server responds to a long connection request aiming at a preset access point sent by the client, long connection between the preset access point and the client is established, access information of a plurality of self access points is issued to the client through the long connection between the preset access point and the client, and the client receives the access information of the plurality of access points sent by the server through the long connection with the preset access point.
In the present disclosure, the long connection between the client and the server may be a long connection based on a TCP protocol, where the long connection refers to a connection that can continuously send a plurality of data packets, and a connection between the client and a certain access point of the server may not be interrupted for a long period of time after the long connection is established, and data transmission may be continuously performed through the connection.
In S102, the client receives the access information of the plurality of access points transmitted by the server, and transmits a long connection request for the recommended access point to the server according to the access information of the recommended access point after disconnecting from the server.
In this step, after the long connection established between the client and the server is disconnected, the client may send a long connection request for the recommended access point to the server according to the access information of the recommended access point, so as to establish the long connection between the client and the recommended access point.
In one implementation, the client successfully establishes a long connection with the recommended access point, and then the client can implement data transmission with the server through the established long connection. Therefore, the connection speed of the recommended access point corresponding to the client is high, and the overload is avoided, so that the time consumed for establishing the long connection between the client and the recommended access point is short, the performance of the established long connection is high, the data transmission speed is high and stable, and the service implementation effect and the user experience are improved.
In S103, the server establishes a long connection between the recommended access point and the client in response to a long connection request for the recommended access point sent by the client.
In one implementation, if the client fails to establish a long connection with the recommended access point, a horse race phase may be entered, that is, a plurality of candidate access points may be selected from other access points, and the client attempts to establish a long connection with the plurality of candidate access points at the same time until a long connection with any one of the candidate access points is successfully established. The selection of the candidate access point may be random, or may be determined according to the connection speed of each access point corresponding to the client.
Specifically, the server may send access information and a rank of a plurality of access points to the client, and then the client may further receive the rank of the plurality of access points sent by the server, where the rank is determined by the server according to a descending order of a connection speed of each access point corresponding to the client, that is, the higher the rank is, the faster the connection speed between the access point and the client is.
For example, the server may obtain a connection speed of each access point corresponding to the client; then, sequencing the access points according to the sequence of the connection speed from high to low; and then, the access information of the plurality of access points and the sequence of the plurality of access points are sent to the client.
Then, when the client fails to establish a long connection with the recommended access point, a first preset number of access points may be selected from the access points other than the recommended access point according to the ranking of the plurality of access points, and the selected access points serve as candidate access points, and a long connection request for the candidate access points is sent to the server. And the server responds to a long connection request aiming at the candidate access points sent by the client, and establishes long connection between the candidate access points and the client until the establishment of the long connection between any candidate access point and the client is successful.
In this way, after the long connection between the client and the recommended access point fails, each time the long connection between the client and the server is attempted, the long connection request for the first preset number of access points with the highest average connection establishment speed that have not failed is sent.
For example, the value of the first preset number may be 3, and then, when the client fails to establish a long connection with the recommended access point, the client may select 3 access points with the fastest connection speed with the client from the other access points except the recommended access point as candidate access points, and then attempt to establish a long connection with the 3 candidate access points at the same time.
The first preset number of candidate access points may further include a history access point, and the history access point is an access point which establishes a long connection with the client last time. Since the history access point successfully establishes the long connection with the client, the success rate and the speed of establishing the long connection between the client and the server can be improved.
That is, the client may select a second preset number of access points from the other access points except the recommended access point according to the ranking of the plurality of access points, and send a long connection request for the candidate access point to the server with the selected second preset number of access points and the historical access points as candidate access points, where the second preset number is the first preset number minus one.
Correspondingly, the server responds to a long connection request aiming at the historical access point sent by the client, and establishes long connection between the historical access point and the client until the recommended access point or the long connection between the historical access point and the client is established successfully.
Continuing with the above example, the value of the second preset number may be 2, and then, in the case that the client fails to establish a long connection with the recommended access point, the client may select 2 access points with the fastest connection speed with the client from the other access points except the recommended access point, take the 2 access points and the historical access points as candidate access points, and then attempt to establish a long connection with the 3 candidate access points at the same time.
Further, in the case that the client fails to establish a long connection with any candidate access point, a candidate access point can be selected from other access points, and the horse race can be continued. Specifically, the client may select one access point from the unselected access points according to the ranking of the plurality of access points, and supplement the selected access point as a candidate access point, and then return to the step of sending the long connection request for the candidate access point to the server until the long connection with any one candidate access point is successfully established.
That is to say, in the process of establishing long connection between the client and the server, a first preset number of access points are maintained to participate in the horse race stage, so that the success rate and the speed of establishing long connection between the client and the server are improved.
For ease of understanding, the above implementation is described below with a specific embodiment.
After the client is disconnected with the server, firstly, a long connection request aiming at the recommended access point is sent to the server according to the access information of the recommended access point, and if the client successfully establishes long connection with the recommended access point, the client does not continue to send the long connection request to the server;
if the client fails to establish long connection with the recommended access point, the client can enter a three-horse-race stage, firstly selects a second preset number of access points from other access points except the recommended access point according to the sequence of the connection speeds of the access points, uses the selected access points and the history access points as candidate access points, and then sends a long connection request aiming at the candidate access points to the server until the server responds to the long connection request aiming at the candidate access points sent by the client and establishes long connection between any candidate access point and the client;
before the long connection between any candidate access point and the client is successfully established, if the long connection between the client and any candidate access point fails to be established, the client continues to select access points from unselected access points according to the sequence of the connection speeds of the plurality of access points, supplements the access points as candidate access points, and continues to send long connection requests for the candidate access points to the server until the server responds to the long connection requests for the candidate access points sent by the client to establish long connection between the candidate access points and the client.
Or, in another implementation manner, the client does not need to wait for the failure of establishing the long connection with the recommended access point, but enters a horse race stage under the condition that the long connection with the recommended access point is not established within a preset time, and sends a long connection request for the historical access point to the server so as to establish the long connection between the client and the recommended access point or the historical access point. This phase may be referred to as a dual-horse race phase, where the client simultaneously attempts to establish a long connection with 2 access points, either the recommended access point or the historical access point.
And the server responds to a long connection request aiming at the recommended access point or the historical access point sent by the client, and establishes long connection between the recommended access point or the historical access point and the client until the long connection between the recommended access point or the historical access point and the client is successfully established.
For example, the preset time may be 100 ms, that is, if the client fails to establish a long connection with the recommended access point within 100 ms, the client may send a long connection request for the historical access point to the server.
Therefore, the waiting time can be further reduced, the speed of establishing long connection between the client and the server is improved, and meanwhile, the recommended access point is ensured to be preferentially established with the client to the greatest extent, so that the load balance of each access point in the server is maintained.
Further, if the client fails to establish a long connection with the recommended access point or the historical access point, the next horse race stage can be entered.
Specifically, the server issues access information and a sequence of a plurality of access points to the client, and then the client receives the sequence of the plurality of access points sent by the server. Furthermore, when the client fails to establish long connection with the recommended access point or the historical access point, a second preset number of access points are selected from other access points except the recommended access point and the historical access point according to the sequence of the access points to serve as candidate access points, and long connection requests for the candidate access points and the target access points are sent to the server.
The server responds to a long connection request which is sent by the client and aims at the candidate access point and the target access point, and long connection between the candidate access point or the target access point and the client is established. Here, for convenience of description, an access point that is not failed in connection among the recommended access points or the history access points is referred to as a target access point in the present disclosure.
Continuing the above example, the value of the second preset number may be 2, and then, when the client fails to establish a long connection with the recommended access point, the client may select 2 access points with the fastest connection speed with the client from the other access points except the recommended access point, take the 2 access points as candidate access points, and then try to establish a long connection with the 2 candidate access points and 1 target access point at the same time, which may be referred to as a three-horse race phase.
Therefore, after the long connection between the client and the recommended access point or the historical access point fails to be established, the average connection establishing speed of the selected candidate access point corresponding to the client in each access point is better, and the service implementation effect and the user experience are favorably improved.
Further, in the case that the client fails to establish a long connection with the historical access point or any candidate access point, the client may select a candidate access point from other access points, and specifically, the client may select one access point from the unselected access points according to the ranking of the plurality of access points, and supplement the selected access point as the candidate access point, and then return to the step of sending long connection requests for the candidate access point and the target access point to the server until the server establishes a long connection between the candidate access point or the target access point and the client in response to the long connection request sent by the client for the candidate access point or the target access point.
That is to say, in the process of establishing long connection between the client and the server, the same number of access points are always maintained to participate in the horse race stage, so that the success rate and the speed of establishing long connection between the client and the server are improved.
For ease of understanding, the above implementation is described below with a specific embodiment.
For example, after the client is disconnected from the server, firstly, a long connection request aiming at the recommended access point is sent to the server according to the access information of the recommended access point, and if the client successfully establishes long connection with the recommended access point within preset time, the client does not continuously send the long connection request to the server;
if the client fails to establish long connection with the recommended access point within the preset time, the client can enter a three-horse-race stage, firstly selects a second preset number of access points from other access points except the recommended access point according to the sequence of the connection speeds of the plurality of access points, takes the selected access points and the historical access points as candidate access points, and then sends a long connection request aiming at the candidate access points to the server; if the long connection with any candidate access point fails to be established, the client continuously selects an access point from unselected access points according to the sequence of the connection speeds of the plurality of access points, supplements the access point as a candidate access point, and continuously sends a long connection request aiming at the candidate access point to the server until the server responds to the long connection request aiming at the candidate access point sent by the client and establishes long connection between the candidate access point and the client;
if the client does not establish long connection with the recommended access point within the preset time, the client can send a long connection request aiming at the historical access point to the server until the server responds to the long connection request aiming at the recommended access point or the historical access point sent by the client and establishes long connection between the recommended access point or the historical access point and the client; if the client fails to establish long connection with the recommended access point or the historical access point, the client selects a second preset number of access points from unselected access points according to the sequence of the connection speeds of the access points, supplements the access points as candidate access points, and sends a long connection request aiming at the candidate access points or the target access point to the server until the server responds to the long connection request aiming at the candidate access points or the target access point sent by the client to establish long connection between the candidate access points or the target access point and the client, wherein the target access point is the recommended access point or the historical access point which fails to establish long connection with the client.
As can be seen from the above, in the present solution, the client preferentially tries to establish a long connection with the recommended access point according to the access information of the multiple access points issued by the server, and the recommended access point is determined according to the connection speed and the load information of each access point corresponding to the client.
Fig. 2 is a flowchart illustrating a long connection establishment method according to an exemplary embodiment, where the long connection establishment method is applied to a client as shown in fig. 2, and includes the following steps.
S201: and receiving access information of a plurality of access points sent by the server, wherein the plurality of access points comprise recommended access points, the recommended access points are determined by the server according to the connection speed and the load information of each access point corresponding to the client, and the recommended access points are the access points of which the load information meets the preset conditions and the connection speed corresponding to the client is the fastest.
S202: and after the client is disconnected from the server, sending a long connection request aiming at the recommended access point to the server according to the access information of the recommended access point so as to establish long connection between the client and the recommended access point.
In one implementation, the receiving access information of multiple access points sent by the server includes:
receiving access information and sequencing of a plurality of access points sent by the server, wherein the sequencing is determined by the server according to the sequence of the connection speed of each access point corresponding to the client from high to low;
in the case of a failure to establish a long connection with the recommended access point, the method further comprises:
and according to the sequence of the plurality of access points, selecting a first preset number of access points from other access points except the recommended access point as candidate access points, and sending a long connection request aiming at the candidate access points to the server until the long connection with any one of the candidate access points is successfully established.
In one implementation, in case of failure to establish a long connection with any of the candidate access points, the method further includes:
and according to the sequence of the plurality of access points, selecting one access point from unselected access points, supplementing the selected access point as the candidate access point, and returning to the step of sending the long connection request aiming at the candidate access point to the server until the long connection with any one candidate access point is successfully established.
In one implementation, the selecting, according to the ranking of the plurality of access points, a first preset number of access points from access points other than the recommended access point as candidate access points, and sending a long connection request for the candidate access points to the server includes:
and according to the sequence of the plurality of access points, selecting a second preset number of access points from other access points except the recommended access point, taking the selected second preset number of access points and the history access point as candidate access points, and sending a long connection request aiming at the candidate access points to the server, wherein the second preset number is obtained by subtracting one from the first preset number, and the history access point is an access point which establishes long connection with the client at the last time.
In one implementation, after the sending the long connection request for the recommended access point to the server, the method further comprises:
and sending a long connection request aiming at a historical access point to the server to establish long connection between the client and the recommended access point or the historical access point under the condition that the long connection with the recommended access point is not established within preset time.
In one implementation, the receiving access information of multiple access points sent by the server includes:
receiving access information and sequencing of a plurality of access points sent by the server, wherein the sequencing is determined by the server according to the sequence of the connection speed of each access point corresponding to the client from high to low;
in the event of a failure to establish a long connection with the recommended access point or the historical access point, the method further comprises:
and according to the sequence of the plurality of access points, selecting a second preset number of access points from the access points except the recommended access point and the historical access point as candidate access points, and sending a long connection request aiming at the candidate access points and a target access point to the server, wherein the target access point is an access point which is not failed to connect in the recommended access point or the historical access point.
In one implementation, in case of failure to establish a long connection with the recommended access point or the historical access point or any of the candidate access points, the method further includes:
and according to the sequence of the plurality of access points, selecting one access point from unselected access points, supplementing the selected access point as the candidate access point, and returning to the step of sending the long connection request aiming at the candidate access point and the target access point to the server until the long connection with the target access point or any one of the candidate access points is successfully established.
In one implementation, the receiving access information of multiple access points sent by a server includes:
sending a long connection request aiming at a preset access point to a server according to pre-acquired access information of the preset access point so as to establish long connection with the preset access point;
and receiving access information of the plurality of access points sent by the server through long connection with the preset access point.
As can be seen from the above, according to the technical scheme provided by the embodiment of the present disclosure, the client preferentially tries to establish a long connection with the recommended access point according to the access information of the multiple access points issued by the server, and the recommended access point is determined according to the connection speed and the load information of each access point corresponding to the client.
Fig. 3 is a flowchart illustrating a long connection establishment method according to an exemplary embodiment, where the long connection establishment method is applied to a server, as shown in fig. 3, and includes the following steps:
s301: and sending access information of a plurality of access points to the client, wherein the plurality of access points comprise recommended access points, the recommended access points are determined from the plurality of access points according to the connection speed and the load information of each access point corresponding to the client, and the recommended access points are access points with the fastest connection speed corresponding to the client in the access points with the load information meeting the preset conditions.
S302: and after the connection with the client is disconnected, responding to a long connection request aiming at the recommended access point sent by the client, and establishing long connection between the recommended access point and the client.
In one implementation manner, the issuing access information of multiple access points to the client includes:
sending access information and sequencing of a plurality of access points to the client, wherein the sequencing is determined according to the sequence of the connection speed of each access point corresponding to the client from high to low;
in the event of a failure to establish a long connection between the recommended access point and the client, the method further comprises:
responding to a long connection request aiming at a candidate access point sent by the client, and establishing long connection between the candidate access point and the client until the long connection between any candidate access point and the client is successfully established, wherein the candidate access point is selected from other access points except the recommended access point by the client according to the sequence of the plurality of access points.
In one implementation, in a case that a long connection between the recommended access point and the client is not established within a preset time, the method further includes:
responding to a long connection request aiming at a history access point sent by the client, and establishing long connection between the history access point and the client until the recommended access point or the long connection between the history access point and the client is successfully established, wherein the history access point is the access point which is used for establishing the long connection with the client last time.
In one implementation manner, the issuing access information of multiple access points to the client includes:
sending access information and sequencing of a plurality of access points to the client, wherein the sequencing is determined according to the sequence of the connection speed of each access point corresponding to the client from high to low;
in the event that establishing the long connection between the recommended access point or the historical access point and the client fails, the method further comprises:
and in response to a long connection request which is sent by the client and aims at a candidate access point and a target access point, establishing long connection between the candidate access point or the target access point and the client, wherein the candidate access point is selected by the client from other access points except the recommended access point and the historical access point according to the sequence of the plurality of access points, and the target access point is an access point which is not failed to connect in the recommended access point or the historical access point.
In one implementation, the issuing the access information and the rank of the multiple access points to the client includes:
acquiring the connection speed of each access point corresponding to the client;
sequencing the plurality of access points according to the sequence of the connection speeds from large to small;
and transmitting the access information of the plurality of access points and the sequence of the plurality of access points to a client.
In one implementation, the obtaining the connection speed of each access point corresponding to the client includes:
according to a first preset period, carrying out dialing detection between each access point and each regional service device to obtain the access speed between each access point and each regional service device;
and calculating the average access speed between each access point and each regional service device according to at least one access speed obtained in a second preset period, wherein the average access speed is used as the connection speed of each access point corresponding to the client connected with each regional service device.
In one implementation, before the issuing the access information of the plurality of access points to the client, the method further includes:
taking the access point with the highest connection speed as the access point to be recommended, and judging whether the load information of the access point to be recommended meets a preset condition or not;
if the access point to be recommended meets the preset conditions, determining the access point to be recommended as a recommended access point, if the access point to be recommended does not meet the preset conditions, taking an access point with a connection speed slower than that of the access point to be recommended as a new access point to be recommended, and returning to the step of judging whether the load information of the access point to be recommended meets the preset conditions.
In one implementation manner, the issuing access information of multiple access points to a client includes:
responding to a long connection request aiming at a preset access point sent by a client, and establishing long connection between the preset access point and the client;
and issuing the access information of the plurality of access points to the client through the long connection between the preset access point and the client.
As can be seen from the above, according to the technical scheme provided by the embodiment of the present disclosure, the client preferentially tries to establish a long connection with the recommended access point according to the access information of the multiple access points issued by the server, and the recommended access point is determined according to the connection speed and the load information of each access point corresponding to the client.
Fig. 4 is a block diagram of a long connection establishment apparatus according to an exemplary embodiment, which is applied to a client, and includes:
a receiving unit 401 configured to perform receiving access information of a plurality of access points sent by a server, where the plurality of access points include a recommended access point, the recommended access point is determined by the server according to a connection speed and load information of each access point corresponding to the client, and the recommended access point is an access point whose load information satisfies a preset condition and has a fastest connection speed corresponding to the client;
a requesting unit 402 configured to perform sending a long connection request for the recommended access point to the server according to the access information of the recommended access point after disconnecting from the server, so as to establish a long connection between the client and the recommended access point.
In one implementation, the receiving unit is specifically configured to perform receiving access information of a plurality of access points sent by the server and performing ranking, where the ranking is determined by the server according to a descending order of connection speeds of each access point corresponding to the client;
the device further comprises:
and the first racing unit is configured to select a first preset number of access points from other access points except the recommended access point according to the sequence of the plurality of access points when the long connection with the recommended access point is failed to be established, and send a long connection request aiming at the candidate access points to the server as candidate access points until the long connection with any one of the candidate access points is successfully established.
In one implementation, the apparatus further includes:
and a first supplementing unit configured to, in the case that the long connection with any one of the candidate access points fails, select one access point from unselected access points according to the ranking of the plurality of access points, supplement the selected access point as the candidate access point, and return to the step of sending the long connection request for the candidate access point to the server until the long connection with any one of the candidate access points is successfully established.
In one implementation, the first racing unit is configured to perform selecting a second preset number of access points from other access points except the recommended access point according to the ranking of the plurality of access points, and send a long connection request for the candidate access point to the server by using the selected second preset number of access points and a history access point as candidate access points, where the second preset number is obtained by subtracting one from the first preset number, and the history access point is an access point that has last established a long connection with the client.
In one implementation, the apparatus further includes:
a second racing unit configured to perform sending a long connection request for a history access point to the server to establish a long connection between the client and the recommended access point or the history access point, in a case where a long connection with the recommended access point is not established within a preset time.
In one implementation, the receiving unit is specifically configured to perform receiving access information of a plurality of access points sent by the server and performing ranking, where the ranking is determined by the server according to a descending order of connection speeds of each access point corresponding to the client;
the device further comprises:
a second supplementing unit, configured to select a second preset number of access points from other access points except the recommended access point and the historical access point according to the ranking of the plurality of access points when the long connection with the recommended access point or the historical access point fails, and send a long connection request for the candidate access point and a target access point to the server, where the target access point is an access point which does not fail to connect among the recommended access point or the historical access point.
In one implementation, the second supplementing unit is configured to, in a case where the establishment of the long connection with the recommended access point or the historical access point or any of the candidate access points fails, select one access point from unselected access points according to the ranking of the plurality of access points, supplement the selected access point as the candidate access point, and return to the step of sending the long connection requests for the candidate access point and the target access point to the server until the establishment of the long connection with the target access point or any of the candidate access points succeeds.
In one implementation, the receiving unit 401 is specifically configured to execute sending a long connection request for a preset access point to a server according to access information of the preset access point acquired in advance, so as to establish a long connection with the preset access point; and receiving access information of the plurality of access points sent by the server through long connection with the preset access point.
As can be seen from the above, according to the technical scheme provided by the embodiment of the present disclosure, the client preferentially tries to establish a long connection with the recommended access point according to the access information of the multiple access points issued by the server, and the recommended access point is determined according to the connection speed and the load information of each access point corresponding to the client.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
Fig. 5 is a block diagram of a long connection establishing apparatus according to an exemplary embodiment, which is applied to a server and includes:
the issuing unit 501 is configured to execute issuing access information of a plurality of access points of the issuing unit to a client, where the plurality of access points include a recommended access point, the recommended access point is determined from the plurality of access points according to connection speed and load information of each access point corresponding to the client, and the recommended access point is an access point with the fastest connection speed corresponding to the client among the access points whose load information meets a preset condition;
a responding unit 502 configured to perform, after disconnecting from the client, establishing a long connection between the recommended access point and the client in response to a long connection request for the recommended access point sent by the client.
In one implementation manner, the issuing unit 501 is configured to execute issuing access information and a sequence of a plurality of access points to the client, where the sequence is determined according to a descending order of a connection speed of each access point corresponding to the client;
the responding unit 502 is further configured to perform, in a case that the establishment of the long connection between the recommended access point and the client fails, in response to a long connection request for a candidate access point sent by the client, the establishment of the long connection between the candidate access point and the client until the establishment of the long connection between any one of the candidate access point and the client succeeds, where the candidate access point is selected by the client from access points other than the recommended access point according to the ranking of the plurality of access points.
In one implementation, the responding unit 502 is further configured to perform, in response to a long connection request sent by the client for a history access point, establishing a long connection between the history access point and the client until the recommended access point or the long connection between the history access point and the client is successfully established, where the history access point is an access point with which a long connection was last established with the client.
In one implementation, the issuing unit 501 is further configured to execute issuing access information and a sequence of multiple access points to the client, where the sequence is determined according to a descending order of a connection speed of each access point corresponding to the client;
the responding unit 502 is further configured to perform, in a case where the establishment of the long connection between the recommended access point or the historical access point and the client fails, the establishment of the long connection between the candidate access point or the target access point and the client in response to a long connection request sent by the client for a candidate access point and a target access point, where the candidate access point is selected by the client from access points other than the recommended access point and the historical access point according to the ranking of the plurality of access points, and the target access point is an access point that has not failed to connect among the recommended access point or the historical access point.
In one implementation, the issuing unit 501 is specifically configured to execute obtaining a connection speed of each access point corresponding to the client; sequencing the plurality of access points according to the sequence of the connection speeds from large to small; and transmitting the access information of the plurality of access points and the sequence of the plurality of access points to a client.
In one implementation, the issuing unit 501 is specifically configured to perform dialing detection between each access point and each regional service device according to a first preset period, so as to obtain an access speed between each access point and each regional service device; and calculating the average access speed between each access point and each regional service device according to at least one access speed obtained in a second preset period, wherein the average access speed is used as the connection speed of each access point corresponding to the client connected with each regional service device.
In one implementation manner, the issuing unit 501 is further configured to execute the access point with the fastest connection speed as the access point to be recommended, and determine whether load information of the access point to be recommended meets a preset condition; if the access point to be recommended meets the preset conditions, determining the access point to be recommended as a recommended access point, if the access point to be recommended does not meet the preset conditions, taking an access point with a connection speed slower than that of the access point to be recommended as a new access point to be recommended, and returning to the step of judging whether the load information of the access point to be recommended meets the preset conditions.
In one implementation, the issuing unit 501 is further configured to execute a long connection request for a preset access point sent by a client, and establish a long connection between the preset access point and the client; and issuing the access information of the plurality of access points to the client through the long connection between the preset access point and the client.
As can be seen from the above, according to the technical scheme provided by the embodiment of the present disclosure, the client preferentially tries to establish a long connection with the recommended access point according to the access information of the multiple access points issued by the server, and the recommended access point is determined according to the connection speed and the load information of each access point corresponding to the client.
Fig. 6 is a block diagram illustrating an electronic device for establishing a long connection according to an example embodiment.
In an exemplary embodiment, a computer-readable storage medium comprising instructions, such as a memory comprising instructions, executable by a processor of an electronic device to perform the above-described method is also provided. Alternatively, the computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
In an exemplary embodiment, a computer program product is also provided, which, when run on a computer, causes the computer to implement the above-described method of establishing a long connection.
As can be seen from the above, according to the technical scheme provided by the embodiment of the present disclosure, the client preferentially tries to establish a long connection with the recommended access point according to the access information of the multiple access points issued by the server, and the recommended access point is determined according to the connection speed and the load information of each access point corresponding to the client.
Fig. 7 is a block diagram illustrating an apparatus 800 for establishing a long connection according to an example embodiment.
For example, the apparatus 800 may be a mobile phone, a computer, a digital broadcast electronic device, a messaging device, a game console, a tablet device, a medical device, an exercise device, a personal digital assistant, and the like.
Referring to fig. 7, the apparatus 800 may include one or more of the following components: a processing component 802, a memory 804, a power component 806, a multimedia component 808, an audio component 810, an input/output (I/O) interface 812, a sensor component 814, and a communication component 816.
The processing component 802 generally controls overall operation of the device 800, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing components 802 may include one or more processors 820 to execute instructions to perform all or a portion of the steps of the methods described above. Further, the processing component 802 can include one or more modules that facilitate interaction between the processing component 802 and other components. For example, the processing component 802 can include a multimedia module to facilitate interaction between the multimedia component 808 and the processing component 802.
The memory 804 is configured to store various types of data to support operation at the device 800. Examples of such data include instructions for any application or method operating on device 800, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 804 may be implemented by any type or combination of volatile or non-volatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
Power supply components 807 provide power to the various components of device 800. The power components 807 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the apparatus 800.
The multimedia component 808 includes a screen that provides an output interface between the device 800 and a user. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front facing camera and/or a rear facing camera. The front-facing camera and/or the rear-facing camera may receive external multimedia data when the device 800 is in an operating mode, such as a shooting mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
The audio component 810 is configured to output and/or input audio signals. For example, the audio component 810 includes a Microphone (MIC) configured to receive external audio signals when the apparatus 800 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals may further be stored in the memory 804 or transmitted via the communication component 816. In some embodiments, audio component 810 also includes a speaker for outputting audio signals.
The I/O interface 812 provides an interface between the processing component 802 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.
The sensor assembly 814 includes one or more sensors for providing various aspects of state assessment for the device 800. For example, the sensor assembly 814 may detect the open/closed state of the device 800, the relative positioning of the components, such as a display and keypad of the apparatus 800, the sensor assembly 814 may also detect a change in position of the apparatus 800 or a component of the apparatus 800, the presence or absence of user contact with the apparatus 800, orientation or acceleration/deceleration of the apparatus 800, and a change in temperature of the apparatus 800. Sensor assembly 814 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 814 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 816 is configured to facilitate communications between the apparatus 800 and other devices in a wired or wireless manner. The apparatus 800 may access a wireless network based on a communication standard, such as WiFi, an operator network (such as 2G, 3G, 4G, or 5G), or a combination thereof. In an exemplary embodiment, the communication component 816 receives a broadcast signal or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 further includes a Near Field Communication (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the apparatus 800 may be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors or other electronic components for performing the methods of the first and second aspects.
In an exemplary embodiment, a non-transitory computer-readable storage medium comprising instructions, such as the memory 804 comprising instructions, executable by the processor 820 of the device 800 to perform the above-described method is also provided. Alternatively, for example, the storage medium may be a non-transitory computer-readable storage medium, such as a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
In an exemplary embodiment, there is also provided a computer program product containing instructions which, when run on a computer, cause the computer to perform the long connection establishment method described in the first of the above embodiments.
As can be seen from the above, according to the technical scheme provided by the embodiment of the present disclosure, the client preferentially tries to establish a long connection with the recommended access point according to the access information of the multiple access points issued by the server, and the recommended access point is determined according to the connection speed and the load information of each access point corresponding to the client.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (10)

1. A long connection establishing method is applied to a client side and comprises the following steps:
receiving access information of a plurality of access points sent by a server, wherein the plurality of access points comprise recommended access points, the recommended access points are determined by the server according to the connection speed and the load information of each access point corresponding to the client, and the recommended access points are access points of which the load information meets a preset condition and the connection speed corresponding to the client is the fastest;
and after the client is disconnected with the server, sending a long connection request aiming at the recommended access point to the server according to the access information of the recommended access point so as to establish long connection between the client and the recommended access point.
2. The method of claim 1, wherein the receiving the access information of the plurality of access points sent by the server comprises:
receiving access information and sequencing of a plurality of access points sent by the server, wherein the sequencing is determined by the server according to the sequence of the connection speed of each access point corresponding to the client from high to low;
in the case of a failure to establish a long connection with the recommended access point, the method further comprises:
and according to the sequence of the plurality of access points, selecting a first preset number of access points from other access points except the recommended access point as candidate access points, and sending a long connection request aiming at the candidate access points to the server until the long connection with any one of the candidate access points is successfully established.
3. The method of claim 2, wherein in case of failure to establish a long connection with any of the candidate access points, the method further comprises:
and according to the sequence of the plurality of access points, selecting one access point from unselected access points, supplementing the selected access point as the candidate access point, and returning to the step of sending the long connection request aiming at the candidate access point to the server until the long connection with any one candidate access point is successfully established.
4. The method according to claim 2, wherein the selecting a first preset number of access points from the access points other than the recommended access point according to the ranking of the plurality of access points as candidate access points, and sending a long connection request for the candidate access points to the server comprises:
and according to the sequence of the plurality of access points, selecting a second preset number of access points from other access points except the recommended access point, taking the selected second preset number of access points and the history access point as candidate access points, and sending a long connection request aiming at the candidate access points to the server, wherein the second preset number is obtained by subtracting one from the first preset number, and the history access point is an access point which establishes long connection with the client at the last time.
5. The long connection setup method according to claim 1, wherein after said sending a long connection request to the server for the recommended access point, the method further comprises:
and sending a long connection request aiming at a historical access point to the server to establish long connection between the client and the recommended access point or the historical access point under the condition that the long connection with the recommended access point is not established within preset time.
6. The method of claim 5, wherein the receiving the access information of the plurality of access points sent by the server comprises:
receiving access information and sequencing of a plurality of access points sent by the server, wherein the sequencing is determined by the server according to the sequence of the connection speed of each access point corresponding to the client from high to low;
in the event of a failure to establish a long connection with the recommended access point or the historical access point, the method further comprises:
and according to the sequence of the plurality of access points, selecting a second preset number of access points from the access points except the recommended access point and the historical access point as candidate access points, and sending a long connection request aiming at the candidate access points and a target access point to the server, wherein the target access point is an access point which is not failed to connect in the recommended access point or the historical access point.
7. The method of claim 6, wherein in case of failure to establish a long connection with the recommended access point or the historical access point or any of the candidate access points, the method further comprises:
and according to the sequence of the plurality of access points, selecting one access point from unselected access points, supplementing the selected access point as the candidate access point, and returning to the step of sending the long connection request aiming at the candidate access point and the target access point to the server until the long connection with the target access point or any one of the candidate access points is successfully established.
8. The method of claim 1, wherein the receiving the access information of the plurality of access points sent by the server comprises:
sending a long connection request aiming at a preset access point to a server according to pre-acquired access information of the preset access point so as to establish long connection with the preset access point;
and receiving access information of the plurality of access points sent by the server through long connection with the preset access point.
9. A long connection establishing method is applied to a server and comprises the following steps:
the method comprises the steps that access information of a plurality of access points of the access point is sent to a client side, wherein the access points comprise recommended access points, the recommended access points are determined from the access points according to the connection speed and the load information of each access point corresponding to the client side, and the recommended access points are access points with the highest connection speed corresponding to the client side in the access points of which the load information meets the preset conditions;
and after the connection with the client is disconnected, responding to a long connection request aiming at the recommended access point sent by the client, and establishing the long connection between the recommended access point and the client.
10. A long connection establishment system, characterized in that the system comprises:
the server is used for issuing access information of a plurality of access points to the client, wherein the access points comprise recommended access points, the recommended access points are determined from the access points according to the connection speed and the load information of each access point corresponding to the client, and the recommended access points are the access points with the highest connection speed corresponding to the client in the access points with the load information meeting preset conditions;
the client is used for receiving access information of the plurality of access points sent by the server; after the server is disconnected, sending a long connection request aiming at the recommended access point to the server according to the access information of the recommended access point;
the server is further used for responding to a long connection request which is sent by the client and aims at the recommended access point, and establishing long connection between the recommended access point and the client.
CN202111554948.8A 2021-12-17 2021-12-17 Long connection establishing system, method and device, electronic equipment and storage medium Pending CN114286425A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111554948.8A CN114286425A (en) 2021-12-17 2021-12-17 Long connection establishing system, method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111554948.8A CN114286425A (en) 2021-12-17 2021-12-17 Long connection establishing system, method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114286425A true CN114286425A (en) 2022-04-05

Family

ID=80872968

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111554948.8A Pending CN114286425A (en) 2021-12-17 2021-12-17 Long connection establishing system, method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114286425A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115132189A (en) * 2022-06-10 2022-09-30 中国第一汽车股份有限公司 Long connection communication connection pool management method based on self-adaptive control strategy

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107135279A (en) * 2017-07-07 2017-09-05 网宿科技股份有限公司 It is a kind of to handle the method and apparatus that request is set up in long connection
CN107548032A (en) * 2016-06-27 2018-01-05 上海连尚网络科技有限公司 For providing the method and apparatus of WAP information
CN112188586A (en) * 2019-07-05 2021-01-05 腾讯科技(深圳)有限公司 Network access method and device
CN112202918A (en) * 2020-10-16 2021-01-08 深圳乐播科技有限公司 Load scheduling method, device, equipment and storage medium for long connection communication
CN113300910A (en) * 2021-05-12 2021-08-24 中国联合网络通信集团有限公司 Method and system for obtaining use rate, terminal, access point and MEC server

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107548032A (en) * 2016-06-27 2018-01-05 上海连尚网络科技有限公司 For providing the method and apparatus of WAP information
CN107135279A (en) * 2017-07-07 2017-09-05 网宿科技股份有限公司 It is a kind of to handle the method and apparatus that request is set up in long connection
CN112188586A (en) * 2019-07-05 2021-01-05 腾讯科技(深圳)有限公司 Network access method and device
CN112202918A (en) * 2020-10-16 2021-01-08 深圳乐播科技有限公司 Load scheduling method, device, equipment and storage medium for long connection communication
CN113300910A (en) * 2021-05-12 2021-08-24 中国联合网络通信集团有限公司 Method and system for obtaining use rate, terminal, access point and MEC server

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115132189A (en) * 2022-06-10 2022-09-30 中国第一汽车股份有限公司 Long connection communication connection pool management method based on self-adaptive control strategy

Similar Documents

Publication Publication Date Title
CN105893129B (en) Method and device for processing application program in terminal
CN109451877B (en) Unmanned aerial vehicle control method and device, unmanned aerial vehicle and remote control equipment
CN108496341A (en) Method, apparatus, equipment and the base station of edge calculations are realized in cellular network
CN110730954A (en) Data processing method and device, electronic equipment and computer readable storage medium
CN111294881A (en) Network link switching method and device, client and computer readable storage medium
CN111385349B (en) Communication processing method, communication processing device, terminal, server and storage medium
CN110769395A (en) Flow-free service synchronization method and device
CN105517078A (en) Network connection switching method and device
US11483263B2 (en) Method and terminal for facilitating chat between users of two terminals
CN114272600A (en) Control right switching system, method, device, equipment and storage medium
CN114286425A (en) Long connection establishing system, method and device, electronic equipment and storage medium
CN105227426B (en) Application interface switching method and device and terminal equipment
CN115706966A (en) Method and device for connecting network and readable storage medium
CN110933773B (en) Link monitoring method and device
CN110913276B (en) Data processing method, device, server, terminal and storage medium
CN106506808B (en) Method and device for prompting communication message
CN108028810B (en) Method and device for establishing service connection
CN112035246A (en) Method, device and system for acquiring virtual resources, electronic equipment and storage medium
CN109245992B (en) Request processing method and device, electronic equipment and storage medium
CN110908814A (en) Message processing method and device, electronic equipment and storage medium
CN107277422B (en) Video call method, device and system
US9774730B2 (en) Method, device, and system for telephone interaction
CN112769677A (en) Data synchronization method, data synchronization device, electronic equipment, storage medium and program product
CN113099307A (en) Data interaction method and device, electronic equipment and storage medium
CN113613348B (en) Connection establishment method, device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination