CN112202918B - 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
CN112202918B
CN112202918B CN202011112666.8A CN202011112666A CN112202918B CN 112202918 B CN112202918 B CN 112202918B CN 202011112666 A CN202011112666 A CN 202011112666A CN 112202918 B CN112202918 B CN 112202918B
Authority
CN
China
Prior art keywords
long connection
server
client
servers
information
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.)
Active
Application number
CN202011112666.8A
Other languages
Chinese (zh)
Other versions
CN112202918A (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

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. After receiving a request for establishing long connection sent by a client, the load scheduling method responds to the connection address of at least one long connection server, so that the client can select the long connection server to be connected, the problem of poor stability after the client is fixedly connected to the long connection server is avoided, and the bottleneck of the upper limit of the number of the client connections is broken through 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 the long connection is mostly used for a communication scene with frequent operation, point-to-point and few connections, such as mobile phone push service, for example, 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 is directly sent through the link.
Because different operators or gateway strategies adopted by the same operator in different areas have differences, the current 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 a client only adopts a fixed access mode to establish long connection with a server and the stability of the long connection cannot be ensured.
The first aspect of the present invention provides a load scheduling method for long-connection communication, where 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 status information that is regularly 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 the form of a heartbeat packet, 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, according to status information of all long connection servers, a connection address of at least one long connection server to send to the client specifically includes:
removing long connection servers which do not meet preset conditions, and sequencing the rest long connection servers;
and selecting the connection address of at least one long connection server with the top ranking to send to the client.
Optionally, in a third implementation manner of the first aspect of the present invention, the step of scheduling the client to establish a long connection with the selected long connection server specifically includes:
acquiring the operator information of at least one long connection server with the front ranking;
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 the long connection server that does not meet the preset condition specifically includes:
rejecting long connection servers which are not served;
removing the CPU and the long connection server with the memory load exceeding a threshold value;
the long connection server whose number of client connections has exceeded the maximum number of supported connections is rejected.
Optionally, in a fifth implementation manner of the first aspect of the present invention, the ranking remaining long connection servers specifically includes:
acquiring the network connection quality of the rest long connection servers;
and sequencing the rest long connection servers 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 acquiring 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.
The 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 the client;
the collecting module is used for receiving state information reported by all 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 and at least one processor, the memory having instructions stored therein, the memory and the at least one processor being 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 of any one of the above.
A fourth aspect of the present 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 described in any of the above.
Drawings
FIG. 1 is a schematic diagram of a first embodiment of a load scheduling method for long connection communication according to the present invention;
FIG. 2 is a diagram illustrating a second embodiment of a load scheduling method for long connection communication according to the present invention;
FIG. 3 is a diagram illustrating a third embodiment of a load scheduling method for long connection communication according to the present invention;
FIG. 4 is a schematic diagram of one embodiment of a load scheduling system for long connection communication of the present invention;
FIG. 5 is a diagram illustrating an exemplary communication procedure of a 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 of the present invention;
fig. 7 is a schematic diagram of an embodiment of a scheduling apparatus for long connection communication of the present invention.
Detailed Description
The embodiment of the invention provides a load scheduling method, device and equipment for long-connection communication and a storage medium.
The terms "first," "second," "third," "fourth" and the like in the description and in the claims and in the above drawings, if any, are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments described herein may be implemented in other sequences than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, 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 or inherent to such process, method, article, or apparatus.
For the sake of understanding, the following description will describe a specific flow of an embodiment of the present invention, and it should be noted that an execution body 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 description will take the execution body as a scheduling server as an example, referring to fig. 1, and an embodiment of a load scheduling method of 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 of the device (physical address, device identifier, authentication parameter, etc.) and a connection quality (mainly network delay) of the long connection server to be selected, where the identifier of the device is mainly used to inquire whether the cache of the scheduling server stores the identity information of the client later, and if the cache of the scheduling server stores the identity information of the client, it is determined that the long connection server and the client establish long connection.
102. Receiving state information reported by all long connection servers at regular time;
in this embodiment, the long connection server reports the state of the long connection server (including the maximum number of supported connections, the current number of connections, the service state of the server processor, the service state of the server memory, the machine room in which the server is located, the server operator, and the 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 continued development of internet technology, the number of accesses faced by long connection servers has increased significantly and is more unpredictable. In a network, if only one long connection server is used to provide services for clients, the processing capability and the input/output capability of the long connection server must become a bottleneck for providing services, in the load balancing technology, when the scheduling server receives an access request of a client, the long connection server for providing services for the client must be selected, and at present, with the continuous increase of the requirements of users on service quality, after the users send the access request through the client, the users can receive a message responded by the server in a short time. Thus, the load balancing device is required to consider the current load situation of the server when selecting the server, and consider whether the selected server can respond to the client in the shortest time.
In this embodiment, the scheduling server may screen and obtain the long connection server suitable for being connected with 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 that the stability of the client after being connected with the long connection server is ensured to be 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 long connection, or may select one long connection server to establish long connection according to a preset selection rule.
The load scheduling method for long connection communication of the invention, after receiving the request for establishing long connection sent by the client, the obtained response is to return the connection address of at least one long connection server, so that the client can select the long connection server for connection, thereby avoiding the problems that the client adopts a fixed access long connection server and has poor stability on one hand, and on the other hand, the load scheduling method can support the transverse expansion of the long connection server, and can realize the improvement of the concurrency capacity of the system by adding the long connection server, thereby effectively solving the problems that the upper limit of the connection quantity of the client exists in the long connection server and single-point faults are easy to occur.
In an optional implementation manner, the receiving the status 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 the form of a heartbeat packet, 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 writes the relevant data of the heartbeat packet into the status information table correspondingly, so that the load information of each server can be mastered by the status information table in the database, and when the long connection is established, the status information table is periodically obtained from the database, and statistical analysis is performed, so that the load condition of each server obtained 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 alternative embodiment, the connection between the corresponding long connection server and the client can be selected according to a preset working mode, so that a proper working mode can be flexibly selected according to actual needs to set, the set scheduling server distributes the IP address of the long connection server for the client to connect according to the set working mode, and the technical scheme of the invention is not limited to the fixed distribution mode.
Referring to fig. 2, in an alternative embodiment, an example of step 103 of the load scheduling method of long connection communication of the present invention specifically includes:
301. removing long connection servers which do not meet preset conditions, and sequencing the rest long connection servers;
302. and selecting the connection address of at least one long connection server with the top ranking to send to the client.
In an alternative embodiment, an example of "eliminating a long connection server that does not meet a preset condition" in step 301 of the load scheduling method of long connection communication of the present invention specifically includes:
rejecting long connection servers which are not served;
removing the CPU and the long connection server with the memory load exceeding a threshold value;
the long connection server whose number of client connections has exceeded the maximum number of supported connections is rejected.
In an alternative embodiment, an example of the "order remaining long connection servers" of the load scheduling method for long connection communication of the present invention 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 according to the network connection quality from high to low.
In this embodiment, the method further includes grading the quality of network connection of the long connection servers, for example, grading the quality of network connection according to the length of network delay, and only ordering the long connection servers with low network delay in the ordering process, so that the workload of ordering can be further reduced, and the ordering speed is improved.
Referring to fig. 3, in an alternative embodiment, an example of step 104 of the load scheduling method of long connection communication of the present invention specifically includes:
401. acquiring the operator information of at least one long connection server with the front ranking;
in this embodiment, since the long connection servers returned after the sorting operation are all long connection servers with better network connection quality, the client may randomly select to establish long connection with one of the long connection servers, and for better communication, the operators of the client and the long connection servers 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 this embodiment, since the server of the same operator is preferentially selected when there are more long connection servers to be selected, the client and the long connection server have better compatibility, so that the communication performance between the client and the long connection server can be fully exerted.
In an alternative embodiment, an example of the step of acquiring the network connection quality of the remaining long connection server in the load scheduling method for long connection communication of the present invention specifically includes:
receiving network quality information of a long connection server sent by the client;
in this embodiment, the client sends a message to each long connection server, starts a timer when sending the message to each long connection server, obtains a current value of the timer corresponding to the long connection server when receiving a response message returned by any long connection server, and determines the current value of the timer obtained for each long connection server as a current response time of each long connection server, thereby obtaining network quality information of the long connection server.
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 this 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 as the client, and because the response time of the server to the message can reflect the current service load condition of the server most accurately, the invention can ensure that the server selected by the scheduling server can respond to the client in the fastest time, that is, the client can receive the message responded by the server in the shortest time, thereby greatly improving the service quality.
In an alternative embodiment, when the scheduling server is taken as the execution main body in the technical scheme of the invention, a short connection mode is adopted for the service provided by the client, because the short connection can be adopted to process a lot of scheduling requests in a short time, and the scheduling request does not become a bottleneck for 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 a long connection server, and the bottom layer of the client correspondingly processes the disconnection of the long connection, so that the upper layer application considers that the long connection exists all the time, and the logic used by the long connection is maintained; the client needs to reinitiate the communication with the long connection server, firstly the bottom layer of the client finds the disconnected long connection, then the client is re-associated with the dispatching server, and meanwhile the dispatching server modifies the connection state in the long connection record into connection, and the communication between the client and the long connection server is re-established.
Fig. 4 is a schematic diagram of a dispatching system corresponding to the load dispatching method of the present invention, where the dispatching system includes a client, a dispatching server and a long connection server, where the long connection server is deployed in a cluster manner, one dispatching server may be configured to at least manage more than 50 long connection servers, when one or more long connection servers in the dispatching server fail, the dispatching server may automatically and quickly switch the client to other long connection servers that do not fail, see fig. 5, after the client communicates with the dispatching server in a short connection manner, an instruction requesting an address of the long connection server is sent to the dispatching server, after the dispatching server receives the instruction requesting the address of the long connection server sent by the client, the dispatching server returns a connection address of at least one long connection server to the client, after the client receives the connection address of at least one long connection server returned by the dispatching server, and according to an actual situation, the connection address of one long connection server is selected, and according to the connection address of the selected long connection server, a long connection is established with the corresponding long connection server.
The invention is mainly used for solving the problems of the upper limit of the connection quantity and single point of failure in long connection service. The invention supports transverse expansion, and can realize the improvement of the total concurrency capacity of the system by adding the long connection servers (adding the same servers and expanding the concurrency bearing capacity of the whole long connection service, after a plurality of nodes can be deployed by a single server, the concurrency performance of the system is improved a lot, but the concurrency quantity which can be borne by the single server still has an upper limit. The invention considers the conditions of both the client and the long connection server when realizing load balancing and scheduling, not only can realize load balancing, but also can better enable the client to be connected to the long connection server with optimal quality.
The load scheduling method of long-link communication in the embodiment of the present invention is described above, and the scheduling apparatus of long-link communication in the embodiment of the present invention is described below, referring to fig. 6, where an embodiment of the scheduling apparatus of long-link 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;
the collecting module 701 receives state information reported by all long connection servers at regular time;
the processing module 702 returns 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 sends the connection address to the client;
a scheduling module 703, configured to schedule the client to establish a long connection with the selected long connection server.
In an alternative embodiment, the scheduling apparatus further includes:
the setting module is used for presetting a database and establishing a state information table in the database;
the first receiving module is used for receiving state information reported by the long connection server in the form of heartbeat packets, wherein the state information comprises IP information of the long connection server and load information of the long connection server;
and the writing module is used for 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 an alternative embodiment, the scheduling module 703 may be further configured to obtain operator information of at least one long connection server that is ranked first; and selecting one of the long connection servers which is the same as the operator of the client to establish long connection.
In an alternative embodiment, the processing module 702 may be further configured to reject long connection servers that do not meet the preset condition, and rank the remaining long connection servers; and selecting the connection address of at least one long connection server with the top ranking to send to the client.
In an alternative embodiment, the processing module 702 may also be used to reject long connection servers that have not been serviced; removing the CPU and the long connection server with the memory load exceeding a threshold value; long connection server for eliminating connection number of client side exceeding maximum support connection number
In an alternative embodiment, the processing module 702 may be further configured to obtain network connection quality of the remaining long connection servers; and sequencing the rest long connection servers according to the network connection quality from high to low.
In an alternative embodiment, the processing module 702 may be further configured to receive 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.
Fig. 7 is a schematic structural diagram of a long-connection communication scheduling device according to an embodiment of the present invention, where the long-connection communication scheduling device may have a relatively large difference due to different configurations or performances, and may include one or more processors 704 (central processing units, CPU) (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 application programs or data. Wherein the memory 705 and the storage medium 706 may be transitory 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 apparatus for long-connection communications. Still further, the processor 704 may be configured to communicate with a storage medium and execute a series of instruction operations in the storage medium 706 on a scheduling device in long-connection communication.
The scheduling 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 Serve, mac OS X, unix, linux, freeBSD, etc. It will be appreciated by those skilled in the art 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 less components than illustrated, or may combine certain components, or may be 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, or a volatile computer readable storage medium, having stored therein instructions that, when executed on a computer, cause the computer to perform the steps of the scheduling method for long connection communication.
It will be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working process of the system or apparatus and unit described above may refer to the corresponding process in the foregoing method embodiment, which is not repeated herein.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied essentially or in part or all of the technical solution or in part in the form of a software product stored in a storage medium, including instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a read-only memory (ROM), a random access memory (random access memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The above embodiments are only for illustrating the technical solution of the present invention, and not for limiting the same; although the 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 scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims (5)

1. A load scheduling method for long connection communication, the load scheduling method comprising the steps of:
receiving a request for establishing long connection sent by a client;
presetting a database, and establishing a state information table in the database;
receiving state information reported by a long connection server in the form of a heartbeat packet, wherein the state information comprises IP information of the long connection server and load information of the long connection server;
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;
removing long connection servers which do not meet preset conditions, and receiving network quality information of the long connection servers sent by the client;
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;
sequencing the rest long connection servers according to the network connection quality from high to low;
acquiring the operator information of at least one long connection server with the front ranking;
and selecting one of the long connection servers which is the same as the operator of the client to establish long connection.
2. The load scheduling method according to claim 1, wherein the eliminating the long connection servers that do not meet the preset condition specifically includes:
rejecting long connection servers which are not served;
removing the CPU and the long connection server with the memory load exceeding a threshold value;
the long connection server whose number of client connections has exceeded the maximum number of supported connections is rejected.
3. A scheduling apparatus, characterized in that the scheduling apparatus comprises:
the receiving module is used for receiving a request for establishing long connection sent by the client;
the collecting module is used for presetting a database and establishing a state information table in the database;
the method is also used for receiving the state information reported by the long connection server in the form of heartbeat packets, wherein the state information comprises the IP information of the long connection server and the load information of the long connection server;
the method is also used for 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;
the processing module is used for eliminating the long connection servers which do not meet the preset conditions and receiving the network quality information of the long connection servers sent by the client;
the network connection quality of the remaining long connection servers is obtained according to the network quality information of the long connection servers sent by the client;
the method is also used for sequencing the rest long connection servers in sequence from high to low according to the network connection quality;
the method is also used for acquiring the operator information of at least one long connection server with the front ranking;
and the scheduling module is used for selecting one long connection server which is the same as the operator of the client to establish long connection.
4. A scheduling apparatus, characterized in that the scheduling apparatus comprises: a memory and at least one processor, the memory having instructions stored therein, the memory and the at least one processor being 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 one of claims 1-2.
5. A computer readable storage medium having stored thereon a computer program, which when executed by a processor implements the load scheduling method of any one of claims 1-2.
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 CN112202918A (en) 2021-01-08
CN112202918B true 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)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112866394B (en) * 2021-01-26 2022-09-13 广州虎牙科技有限公司 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
CN113810304A (en) * 2021-09-30 2021-12-17 深圳前海微众银行股份有限公司 Load balancing method, device, equipment and computer storage medium
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

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

Also Published As

Publication number Publication date
CN112202918A (en) 2021-01-08

Similar Documents

Publication Publication Date Title
CN112202918B (en) Load scheduling method, device, equipment and storage medium for long connection communication
US11736561B2 (en) Load balanced network file accesses
US11418620B2 (en) Service request management
EP1869868B1 (en) System, network device, method, and computer program product for active load balancing using clustered nodes as authoritative domain name servers
CN103442030B (en) Send and process method and system and the client terminal device of service requesting information
US20030065703A1 (en) Automated server replication
CN101076978B (en) Method for distributing loads among servers
WO2004036344A2 (en) System and method for the optimization of database
US20070150602A1 (en) Distributed and Replicated Sessions on Computing Grids
JP2000276432A (en) Dynamic load distribution system for transaction message
JPH10307783A (en) Site access control system and recording medium
CN109672711B (en) Reverse proxy server Nginx-based http request processing method and system
CN109510878B (en) Long connection session keeping method and device
US7844708B2 (en) Method and apparatus for load sharing and data distribution in servers
CN103220165B (en) Processing method and device for server active downtime
CN107689878A (en) TCP length connection SiteServer LBSs based on name scheduling
WO2003069473A1 (en) A method and apparatus for reconfiguring a server system
CN110601989A (en) Network traffic balancing method and device
CN110661836B (en) Message routing method, device and system, and storage medium
JP2005182702A (en) Access control system in ip network
CN114024968B (en) Message sending method and device based on intermediate equipment and electronic equipment
CN111309476B (en) Method for pushing system to automatically adjust resources and storage medium
CN113535402A (en) Load balancing processing method and device based on 5G MEC and electronic equipment
CN112738193B (en) Load balancing method and device for cloud computing
CN112929410A (en) System and method for supporting cloud desktop multi-terminal display

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