CN112202918A - Load scheduling method, device, equipment and storage medium for long connection communication - Google Patents

Load scheduling method, device, equipment and storage medium for long connection communication Download PDF

Info

Publication number
CN112202918A
CN112202918A CN202011112666.8A CN202011112666A CN112202918A CN 112202918 A CN112202918 A CN 112202918A CN 202011112666 A CN202011112666 A CN 202011112666A CN 112202918 A CN112202918 A CN 112202918A
Authority
CN
China
Prior art keywords
long connection
client
server
servers
long
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202011112666.8A
Other languages
Chinese (zh)
Other versions
CN112202918B (en
Inventor
向金如
陈锡华
李鑫
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Happycast Technology Co Ltd
Original Assignee
Shenzhen Happycast 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 Shenzhen Happycast Technology Co Ltd filed Critical Shenzhen Happycast Technology Co Ltd
Priority to CN202011112666.8A priority Critical patent/CN112202918B/en
Publication of CN112202918A publication Critical patent/CN112202918A/en
Application granted granted Critical
Publication of CN112202918B publication Critical patent/CN112202918B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/141Setup of application sessions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
    • H04L67/1004Server selection for load balancing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
    • H04L67/1004Server selection for load balancing
    • H04L67/1008Server selection for load balancing based on parameters of servers, e.g. available memory or workload
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
    • H04L67/63Routing a service request depending on the request content or context
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/50Reducing energy consumption in communication networks in wire-line communication networks, e.g. low power modes or reduced link rate

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Hardware Design (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer And Data Communications (AREA)

Abstract

The invention relates to the field of long connection communication, and discloses a load scheduling method, a device, equipment and a storage medium for long connection communication, wherein the load scheduling method comprises the following steps: receiving a request for establishing long connection sent by a client; receiving state information reported by all long connection servers at regular time; returning the address of at least one long connection server to the client according to the state information of all the long connection servers; and scheduling the client to establish long connection with the selected long connection server. The load scheduling method responds to the connection address of at least one long connection server after receiving the request for establishing the long connection sent by the client, so that the client can select the connected long connection server, the problem of poor stability after the long connection is established due to the fact that the client accesses the long connection server in a fixed mode is solved, and the bottleneck of the upper limit of the connection quantity of the client is broken through by transversely expanding the long connection server.

Description

Load scheduling method, device, equipment and storage medium for long connection communication
Technical Field
The present invention relates to the field of long connection load balancing, and in particular, to a load scheduling method, apparatus, device, and storage medium for long connection communication.
Background
The long connection means that a plurality of data packets can be continuously sent on one connection, and is mostly used in a communication scene with frequent operation, point-to-point and a small number of connections, for example, a mobile phone push service, in which a connection link between a mobile phone client and a server is established in advance, and when a message needs to be sent to a mobile phone, the message can be directly sent through the link.
Because the gateway strategies adopted by different operators or the same operator in different regions have differences, the client only adopts a fixed access mode to establish long connection with the server no matter what network environment, and the stability of the long connection cannot be ensured.
Disclosure of Invention
The invention mainly aims to solve the technical problem that the client establishes long connection with a server only by adopting a fixed access mode and cannot ensure the stability of the long connection.
The first aspect of the present invention provides a load scheduling method for long connection communication, wherein the load scheduling method includes the steps of:
receiving a request for establishing long connection sent by a client;
receiving state information reported by all long connection servers at regular time;
returning the address of at least one long connection server to the client according to the state information of all the long connection servers;
and scheduling the client to establish long connection with the selected long connection server.
Optionally, in a first implementation manner of the first aspect of the present invention, the receiving state information periodically reported by all long connection servers specifically includes:
presetting a database, and establishing a state information table in the database;
receiving state information reported by a long connection server in a heartbeat packet mode, wherein the state information comprises IP information of the long connection server and load information of the long connection server;
and writing the load information of the long connection server into the corresponding position of the state information table according to the received IP information of the long connection server.
Optionally, in a second implementation manner of the first aspect of the present invention, the step of returning the connection address of at least one long connection server according to the state information of all long connection servers and sending the connection address to the client specifically includes:
eliminating long connection servers which do not meet preset conditions, and sequencing the remaining long connection servers;
and selecting the connection address of at least one long connection server in the top sequence to send to the client.
Optionally, in a third implementation manner of the first aspect of the present invention, the scheduling, by the step, the client and the selected long connection server to establish the long connection specifically includes:
acquiring operator information of at least one long connection server which is ranked in the front;
and selecting one of the long connection servers which is the same as the operator of the client to establish long connection.
Optionally, in a fourth implementation manner of the first aspect of the present invention, the removing long connection servers that do not meet the preset condition specifically includes:
eliminating long connection servers which are not already served;
eliminating long connection servers with cpu and memory loads exceeding a threshold;
and eliminating long connection servers of which the number of client connections exceeds the maximum number of supported connections.
Optionally, in a fifth implementation manner of the first aspect of the present invention, the sorting the remaining long connection servers specifically includes:
acquiring the network connection quality of the rest long connection servers;
and sequencing the rest long connection servers in sequence according to the network connection quality from high to low.
Optionally, in a sixth implementation manner of the first aspect of the present invention, the obtaining of the network connection quality of the remaining long connection servers specifically includes:
receiving network quality information of a long connection server sent by the client;
and obtaining the network connection quality of the rest long connection servers according to the network quality information of the long connection servers sent by the client.
A second aspect of the present invention provides a scheduling apparatus, wherein the scheduling apparatus includes:
the receiving module is used for receiving a request for establishing long connection sent by a client;
the collection module is used for receiving the state information reported by all the long connection servers at regular time;
the processing module returns the connection address of at least one long connection server according to the state information of all the long connection servers and sends the connection address to the client;
and the scheduling module is used for scheduling the client to establish long connection with the selected long connection server.
A third aspect of the present invention provides a scheduling apparatus, wherein the scheduling apparatus includes: a memory having instructions stored therein and at least one processor, the memory and the at least one processor interconnected by a line;
the at least one processor invokes the instructions in the memory to cause the scheduling apparatus to perform the load scheduling method as defined in any one of the above.
A fourth aspect of the invention provides a computer readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements a load scheduling method as defined in any of the above.
Drawings
Fig. 1 is a schematic diagram of a load scheduling method for long-connection communication according to a first embodiment of the present invention;
fig. 2 is a schematic diagram of a second embodiment of the load scheduling method for long-connection communication according to the present invention;
fig. 3 is a schematic diagram of a third embodiment of the load scheduling method for long connection communication according to the present invention;
FIG. 4 is a schematic diagram of an embodiment of a load scheduling system for long connection communication according to the present invention;
fig. 5 is a diagram of an exemplary communication process of the load scheduling method for long connection communication according to the present invention;
fig. 6 is a schematic diagram of an embodiment of a scheduling apparatus for long-connection communication according to the present invention;
fig. 7 is a schematic diagram of an embodiment of a scheduling apparatus for long connection communication according to the present invention.
Detailed Description
The embodiment of the invention provides a load scheduling method, a device, equipment and a storage medium for long connection communication.
The terms "first," "second," "third," "fourth," and the like in the description and in the claims, as well as in the drawings, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It will be appreciated that the data so used may be interchanged under appropriate circumstances such that the embodiments described herein may be practiced otherwise than as specifically illustrated or described herein. Furthermore, the terms "comprises," "comprising," or "having," and any variations thereof, are intended to cover non-exclusive inclusions, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
For convenience of understanding, a specific flow of the embodiment of the present invention is described below, it should be noted that an execution subject for implementing the following method of the present invention includes hardware and software, and the technical solution of the present invention is not limited herein, and the following is described by taking the execution subject as a scheduling server as an example, please refer to fig. 1, and an embodiment of the load scheduling method for long connection communication in the embodiment of the present invention includes:
101. receiving a request for establishing long connection sent by a client;
in this embodiment, the content of the request sent by the client includes an identifier (a physical address, an equipment identifier, an authentication parameter, etc.) of the equipment and a connection quality (mainly network latency) of the candidate long connection server, where the identifier of the equipment is mainly used to subsequently query whether the cache of the scheduling server stores the identity information of the client, and if the cache of the scheduling server stores the identity information of the client, it is determined that the long connection server establishes a long connection with the client.
102. Receiving state information reported by all long connection servers at regular time;
in this embodiment, the long connection server may report the state of the long connection server (including the maximum number of supported connections, the current number of connections, the state of use of a processor of the server, the state of use of a memory of the server, a machine room in which the server is located, a server operator, and a server address) to the scheduling server at regular time, so that the long connection server has the server states of all the long connection servers.
103. And returning the connection address of at least one long connection server according to the state information of all the long connection servers and sending the connection address to the client.
In particular, with the constant development of internet technology, the number of accesses faced by long connection servers has increased substantially and is even less predictable. In the network, if only one long connection server is used to provide service for a client, the processing capacity and the input/output capacity of the long connection server inevitably become the bottleneck of providing service, in the load balancing technology, a scheduling server must select the long connection server providing service for the client when receiving an access request of the client, and at present, along with the continuous improvement of the requirement of a user on the service quality, the user can receive a message responded by the server within a short time after sending the access request through the client. Thus, the load balancing device is required to consider the current load condition of the server when selecting the server, and to consider whether the selected server can respond to the client in the shortest time.
In this embodiment, the scheduling server may screen the long connection servers suitable for being connected to the client according to the states of all the long connection servers, and return the connection address of at least one long connection server to the client, so as to ensure that the stability of the client after being connected to the long connection server is better.
104. And scheduling the client to establish long connection with the selected long connection server.
In this embodiment, after receiving the response from the scheduling server, the client may randomly select one long connection server from the connection addresses of the long connection servers returned by the scheduling server to establish the long connection, or certainly may select one long connection server according to a preset selection rule to establish the long connection.
The load scheduling method of long connection communication of the invention, after receiving the request for establishing long connection sent by the client, the response obtained is to return the connection address of at least one long connection server, so the client can select the long connection server connected, thus on one hand, the problem of poor stability caused by the fact that the client adopts fixed access to the long connection server is avoided, on the other hand, the load scheduling method of the invention can support the horizontal extension of the long connection server, and the improvement of the concurrency capability of the system can be realized by increasing the long connection servers, thereby effectively solving the problems of the upper limit of the number of client connections and the easy occurrence of single point faults in the long connection server.
In an optional implementation manner, the receiving the state information periodically reported by all the long connection servers specifically includes:
presetting a database, and establishing a state information table in the database;
receiving state information reported by a long connection server in a heartbeat packet mode, wherein the state information comprises IP information of the long connection server and load information of the long connection server;
and writing the load information of the long connection server into the corresponding position of the state information table according to the received IP information of the long connection server.
In this embodiment, the scheduling server periodically sends the heartbeat packet recorded with the IP information and the load information of the long connection server to the database, and the database correspondingly writes the relevant data of the heartbeat packet into the state information table, so that the load information of each server can be grasped through the state information table in the database, when a long connection is established, the state information table is periodically obtained from the database, and statistical analysis is performed, so that the load condition obtained by each server through statistical analysis can be obtained and used as a reference basis for reasonably scheduling the connection between the client and the long connection server.
In an optional implementation manner, a corresponding long connection server may be selected according to a preset working mode to establish a connection with a client, a suitable working mode may be flexibly selected according to actual needs to be set, and the set scheduling server allocates an IP address of the long connection server according to the set working mode for the client to connect.
Referring to fig. 2, in an alternative implementation, an embodiment of step 103 of the load scheduling method for long connection communication according to the present invention specifically includes:
301. eliminating long connection servers which do not meet preset conditions, and sequencing the remaining long connection servers;
302. and selecting the connection address of at least one long connection server in the top sequence to send to the client.
In an optional implementation manner, an embodiment of the method for load scheduling of long connection communication according to the present invention, in step 301, "removing long connection servers that do not meet the preset condition" specifically includes:
eliminating long connection servers which are not already served;
eliminating long connection servers with cpu and memory loads exceeding a threshold;
and eliminating long connection servers of which the number of client connections exceeds the maximum number of supported connections.
In an optional implementation manner, an embodiment of the load scheduling method for long connection communication according to the present invention, in which "the remaining long connection servers are sorted", specifically includes:
acquiring the network connection quality of the rest long connection servers;
in this embodiment, the method for obtaining the network quality of the long connection server includes sending a message to the long connection server through the client, receiving a message returned by the long connection server, and calculating a network packet loss rate and/or a network delay according to the message returned by the long connection server.
And sequencing the rest long connection servers in sequence according to the network connection quality from high to low.
In this embodiment, before the sorting, the network connection quality of the long connection servers is further processed in a hierarchical manner, for example, the network connection quality is divided into three levels, i.e., high, medium and low, according to the length of the network delay, and only the long connection servers with low network delay are sorted in the sorting process, so that the workload of sorting can be further reduced, and the sorting speed is increased.
Referring to fig. 3, in an alternative implementation, an embodiment of the step 104 of the load scheduling method for long connection communication according to the present invention specifically includes:
401. acquiring operator information of at least one long connection server which is ranked in the front;
in this embodiment, because the long connection servers returned after the sorting operation are all the long connection servers with better network connection quality, the client may randomly select one of the long connection servers to establish a long connection, and for better communication, the operators of the client and the long connection server may also be considered.
402. And selecting one of the long connection servers which is the same as the operator of the client to establish long connection.
In the embodiment, the server of the same operator is preferentially selected when more long connection servers to be selected exist, so that the client and the long connection server have better compatibility, and the communication performance between the client and the long connection server can be fully exerted.
In an optional implementation manner, an embodiment of the step of "obtaining network connection quality of remaining long connection servers" in the load scheduling method for long connection communication according to the present invention specifically includes:
receiving network quality information of a long connection server sent by the client;
in this embodiment, the client sends the message to each long connection server, starts the timer when sending the message to each long connection server, obtains a current value of the timer corresponding to any long connection server when receiving a response message returned by the long connection server, and determines the current value of the timer obtained for each long connection server as the current response time of each long connection server, thereby obtaining the network quality information of the long connection servers.
And obtaining the network connection quality of the rest long connection servers according to the network quality information of the long connection servers sent by the client.
In the embodiment, when the scheduling server receives an access request message of a client, the server with the shortest current response time can be selected to serve the client, and the response time of the server to the message can most accurately reflect the current service load condition of the server, so that the server selected by the scheduling server can respond to the client in the fastest time, namely, the client can receive the message responded by the server in the shortest time, and the service quality is greatly improved.
In an optional implementation manner, when the scheduling server is taken as the execution subject in the technical solution of the present invention, the short connection is adopted for the service provided by the client, because a lot of scheduling requests can be processed in a short time by adopting the short connection, which does not become a bottleneck limiting the scheduling performance of the scheduling server.
In an optional implementation manner, when the scheduling server is taken as an execution main body in the technical scheme of the invention, the scheduling server can also replace a client to establish long connection with the long connection server, and the bottom layer of the client performs corresponding processing on the disconnected long connection, so that an upper layer application considers that the long connection exists all the time and keeps the logic used by the long connection; the client needs to initiate communication with the long connection server again, firstly, the client bottom layer finds the disconnected long connection, then the client is associated with the scheduling server again, meanwhile, the scheduling server modifies the connection state in the long connection record into connection, and the communication between the client and the long connection server is reestablished.
Fig. 4 is a schematic diagram of a scheduling system corresponding to the load scheduling method of the present invention, where the scheduling system includes a client, a scheduling server and a long connection server, where the long connection server is deployed in a cluster manner, one scheduling server may be configured to manage at least more than 50 long connection servers, and when one or more long connection servers of the scheduling server fails, the scheduling server may automatically and quickly switch the client to another long connection server that does not fail, referring to fig. 5, after the client communicates with the scheduling server in a short connection, an instruction requesting an address of the long connection server is sent to the scheduling server, after the scheduling server receives the instruction requesting the address of the long connection server sent by the client, the scheduling server returns a connection address of at least one long connection server to the client, and after the client receives the connection address of at least one long connection server returned by the scheduling server, and selecting the connection address of one long connection server according to the actual situation, and establishing long connection with the corresponding long connection server according to the selected connection address of the long connection server.
The invention is mainly used for solving the problems of the upper limit of the connection quantity and single point failure in long connection service. The invention supports horizontal expansion, can realize the promotion of the total concurrent capability of the system by increasing the long connection server (increase the same server, expand the concurrent bearing capability of the whole long connection service, after solving the problem that a single server can deploy a plurality of nodes, the concurrent performance of the system is promoted a lot, but the concurrent amount that the single server can bear still has an upper limit. The invention considers the conditions of the client and the long connection server when realizing load balancing and scheduling, not only realizing load balancing, but also better connecting the client to the long connection server with optimal quality.
With reference to fig. 6, the method for scheduling a load of long connection communication in the embodiment of the present invention is described above, and a scheduling apparatus of long connection communication in the embodiment of the present invention is described below, where an embodiment of the scheduling apparatus of long connection communication in the embodiment of the present invention includes:
a receiving module 700, configured to receive a request for establishing a long connection sent by a client;
a collecting module 701, configured to receive state information periodically reported by all long connection servers;
the processing module 702 returns the connection address of at least one long connection server according to the state information of all the long connection servers and sends the connection address to the client;
and the scheduling module 703 is configured to schedule the client to establish a long connection with the selected long connection server.
In an optional implementation manner, the scheduling apparatus further includes:
the system comprises a setting module, a state information table and a state information processing module, wherein the setting module is used for presetting a database and establishing the state information table in the database;
the first receiving module is used for receiving state information reported by the long connection server in a heartbeat packet mode, wherein the state information comprises IP information of the long connection server and load information of the long connection server;
and the writing module writes the load information of the long connection server into the corresponding position of the state information table according to the received IP information of the long connection server.
In an optional implementation manner, the scheduling module 703 may be further configured to obtain operator information of at least one long connection server ranked in the top; and selecting one of the long connection servers which is the same as the operator of the client to establish long connection.
In an optional implementation manner, the processing module 702 may be further configured to remove long connection servers that do not meet a preset condition, and sort the remaining long connection servers; and selecting the connection address of at least one long connection server in the top sequence to send to the client.
In an alternative embodiment, the processing module 702 may also be configured to eliminate long connection servers that are not already being served; eliminating long connection servers with cpu and memory loads exceeding a threshold; eliminating long connection servers where the number of client connections has exceeded the maximum number of supported connections
In an optional embodiment, the processing module 702 may be further configured to obtain the network connection quality of the remaining long connection servers; and sequencing the rest long connection servers in sequence according to the network connection quality from high to low.
In an optional implementation manner, the processing module 702 may be further configured to receive network quality information of the long connection server sent by the client; and obtaining the network connection quality of the rest long connection servers according to the network quality information of the long connection servers sent by the client.
Fig. 7 is a schematic structural diagram of a scheduling device for long-connection communication according to an embodiment of the present invention, which may have a relatively large difference due to different configurations or performances, and may include one or more processors 704 (CPUs) (e.g., one or more processors) and a memory 705, and one or more storage media 706 (e.g., one or more mass storage devices) for storing applications or data. The memory 705 and storage medium 706 may be, among other things, transient storage or persistent storage. The program stored on the storage medium 706 may include one or more modules (not shown), each of which may include a series of instruction operations in a scheduling device for long connection communications. Still further, the processor 704 may be configured to communicate with a storage medium to execute a series of instruction operations in the storage medium 706 on a scheduling device in communication with the long connection.
The dispatcher device for long-connection communications may also include one or more power supplies 707, one or more wired or wireless network interfaces 708, one or more input-output interfaces 709, and/or one or more operating systems, such as Windows Server, Mac OS X, Unix, Linux, FreeBSD, etc. Those skilled in the art will appreciate that the configuration of the scheduling device for long connection communication shown in fig. 7 does not constitute a limitation of the scheduling device for long connection communication, and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
The present invention also provides a computer readable storage medium, which may be a non-volatile computer readable storage medium, and which may also be a volatile computer readable storage medium, having stored therein instructions, which, when run on a computer, cause the computer to perform the steps of the scheduling method for long connection communication.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses, and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a read-only memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (10)

1. A load scheduling method for long connection communication, the load scheduling method comprising:
receiving a request for establishing long connection sent by a client;
receiving state information reported by all long connection servers at regular time;
returning the connection address of at least one long connection server to the client according to the state information of all the long connection servers;
and scheduling the client to establish long connection with the selected long connection server.
2. The load scheduling method according to claim 1, wherein the receiving the status information periodically reported by all the long connection servers specifically comprises:
presetting a database, and establishing a state information table in the database;
receiving state information reported by a long connection server in a heartbeat packet mode, wherein the state information comprises IP information of the long connection server and load information of the long connection server;
and writing the load information of the long connection server into the corresponding position of the state information table according to the received IP information of the long connection server.
3. The load scheduling method according to claim 1, wherein the step of returning the connection address of at least one long connection server to the client according to the status information of all long connection servers specifically comprises:
eliminating long connection servers which do not meet preset conditions, and sequencing the remaining long connection servers;
and selecting the connection address of at least one long connection server in the top sequence to send to the client.
4. The load scheduling method according to claim 3, wherein the step of scheduling the client to establish the long connection with the selected long connection server specifically comprises:
acquiring operator information of at least one long connection server which is ranked in the front;
and selecting one of the long connection servers which is the same as the operator of the client to establish long connection.
5. The load scheduling method according to claim 3, wherein the removing long connection servers that do not meet the preset condition specifically comprises:
eliminating long connection servers which are not already served;
eliminating long connection servers with cpu and memory loads exceeding a threshold;
and eliminating long connection servers of which the number of client connections exceeds the maximum number of supported connections.
6. The load scheduling method according to claim 1, wherein the sorting of the remaining long connection servers specifically comprises:
acquiring the network connection quality of the rest long connection servers;
and sequencing the rest long connection servers in sequence according to the network connection quality from high to low.
7. The load scheduling method according to claim 6, wherein the obtaining of the network connection quality of the remaining long connection servers specifically comprises:
receiving network quality information of a long connection server sent by the client;
and obtaining the network connection quality of the rest long connection servers according to the network quality information of the long connection servers sent by the client.
8. A scheduling apparatus, comprising:
the receiving module is used for receiving a request for establishing long connection sent by a client;
the collection module is used for receiving the state information reported by all the long connection servers at regular time;
the processing module returns the connection address of at least one long connection server according to the state information of all the long connection servers and sends the connection address to the client;
and the scheduling module is used for scheduling the client to establish long connection with the selected long connection server.
9. A scheduling apparatus, characterized in that the scheduling apparatus comprises: a memory having instructions stored therein and at least one processor, the memory and the at least one processor interconnected by a line;
the at least one processor invoking the instructions in the memory to cause the scheduling apparatus to perform the load scheduling method of any of claims 1-7.
10. A computer-readable storage medium, having stored thereon a computer program, wherein the computer program, when being executed by a processor, is adapted to carry out the load scheduling method according to any of the claims 1-7.
CN202011112666.8A 2020-10-16 2020-10-16 Load scheduling method, device, equipment and storage medium for long connection communication Active CN112202918B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011112666.8A CN112202918B (en) 2020-10-16 2020-10-16 Load scheduling method, device, equipment and storage medium for long connection communication

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011112666.8A CN112202918B (en) 2020-10-16 2020-10-16 Load scheduling method, device, equipment and storage medium for long connection communication

Publications (2)

Publication Number Publication Date
CN112202918A true CN112202918A (en) 2021-01-08
CN112202918B CN112202918B (en) 2023-08-08

Family

ID=74009309

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011112666.8A Active CN112202918B (en) 2020-10-16 2020-10-16 Load scheduling method, device, equipment and storage medium for long connection communication

Country Status (1)

Country Link
CN (1) CN112202918B (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112866394A (en) * 2021-01-26 2021-05-28 广州虎牙科技有限公司 Load balancing method, device, system, computer equipment and storage medium
CN113489803A (en) * 2021-07-15 2021-10-08 深圳竹云科技有限公司 Load balancing method, terminal and gateway server
CN114124970A (en) * 2021-11-29 2022-03-01 深圳腾视科技有限公司 Terminal communication coordination service system and method
CN114286425A (en) * 2021-12-17 2022-04-05 北京达佳互联信息技术有限公司 Long connection establishing system, method and device, electronic equipment and storage medium
WO2023050901A1 (en) * 2021-09-30 2023-04-06 深圳前海微众银行股份有限公司 Load balancing method and apparatus, device, computer storage medium and program

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105871977A (en) * 2015-11-27 2016-08-17 乐视体育文化产业发展(北京)有限公司 Long connection establishment method and system, and devices
WO2017140216A1 (en) * 2016-02-16 2017-08-24 阿里巴巴集团控股有限公司 Method and device for network load balancing, control, and network interaction

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105871977A (en) * 2015-11-27 2016-08-17 乐视体育文化产业发展(北京)有限公司 Long connection establishment method and system, and devices
WO2017140216A1 (en) * 2016-02-16 2017-08-24 阿里巴巴集团控股有限公司 Method and device for network load balancing, control, and network interaction

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112866394A (en) * 2021-01-26 2021-05-28 广州虎牙科技有限公司 Load balancing method, device, system, computer equipment and storage medium
CN113489803A (en) * 2021-07-15 2021-10-08 深圳竹云科技有限公司 Load balancing method, terminal and gateway server
WO2023050901A1 (en) * 2021-09-30 2023-04-06 深圳前海微众银行股份有限公司 Load balancing method and apparatus, device, computer storage medium and program
CN114124970A (en) * 2021-11-29 2022-03-01 深圳腾视科技有限公司 Terminal communication coordination service system and method
CN114286425A (en) * 2021-12-17 2022-04-05 北京达佳互联信息技术有限公司 Long connection establishing system, method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN112202918B (en) 2023-08-08

Similar Documents

Publication Publication Date Title
CN112202918A (en) Load scheduling method, device, equipment and storage medium for long connection communication
US11736561B2 (en) Load balanced network file accesses
CN109660607B (en) Service request distribution method, service request receiving method, service request distribution device, service request receiving device and server cluster
CN111641583B (en) Internet of things resource access system and resource access method
WO2022002209A1 (en) Data transmission method, proxy server, storage medium, and electronic device
US7373644B2 (en) Automated server replication
CN110096336B (en) Data monitoring method, device, equipment and medium
US20170324823A1 (en) Server cluster and method for push notification service
WO2004036344A2 (en) System and method for the optimization of database
CN104618164A (en) Management method for rapid cloud computing platform application deployment
US7844708B2 (en) Method and apparatus for load sharing and data distribution in servers
JP2012090194A (en) Network system
JP6272190B2 (en) Computer system, computer, load balancing method and program thereof
US20130346513A1 (en) Migrating a chat message service provided by a chat server to a new chat server
CN103458013A (en) Streaming media server cluster load balancing system and balancing method
US8458702B1 (en) Method for implementing user space up-calls on java virtual machine before/after garbage collection
WO2003069473A1 (en) A method and apparatus for reconfiguring a server system
CN102724104A (en) Apparatus and method for automatically configuring Java EE application cluster
KR20160025926A (en) Apparatus and method for balancing load to virtual application server
CN110661836B (en) Message routing method, device and system, and storage medium
CN111880932A (en) Data storage method and device based on multiple network ports
CN109005071B (en) Decision deployment method and scheduling equipment
KR20130028554A (en) Large capacity distributed processing apparatus using a message bus and the method thereof
CN109510864B (en) Forwarding method, transmission method and related device of cache request
CN113535402A (en) Load balancing processing method and device based on 5G MEC and electronic equipment

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
GR01 Patent grant
GR01 Patent grant