CN114157605B - Communication method, system, electronic equipment and computer readable storage medium - Google Patents

Communication method, system, electronic equipment and computer readable storage medium Download PDF

Info

Publication number
CN114157605B
CN114157605B CN202111318682.7A CN202111318682A CN114157605B CN 114157605 B CN114157605 B CN 114157605B CN 202111318682 A CN202111318682 A CN 202111318682A CN 114157605 B CN114157605 B CN 114157605B
Authority
CN
China
Prior art keywords
equipment
load balancing
cluster
routing
service
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
CN202111318682.7A
Other languages
Chinese (zh)
Other versions
CN114157605A (en
Inventor
刘舟
杨帆
谢林廷
黎广璘
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangzhou Sanqi Jichuang Network Technology Co ltd
Original Assignee
Guangzhou Sanqi Jichuang Network Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangzhou Sanqi Jichuang Network Technology Co ltd filed Critical Guangzhou Sanqi Jichuang Network Technology Co ltd
Priority to CN202111318682.7A priority Critical patent/CN114157605B/en
Publication of CN114157605A publication Critical patent/CN114157605A/en
Application granted granted Critical
Publication of CN114157605B publication Critical patent/CN114157605B/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
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/12Avoiding congestion; Recovering from congestion
    • H04L47/125Avoiding congestion; Recovering from congestion by balancing the load, e.g. traffic engineering
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/14Network analysis or design
    • H04L41/147Network analysis or design for predicting network behaviour
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/29Flow control; Congestion control using a combination of thresholds
    • 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/146Markers for unambiguous identification of a particular session, e.g. session cookie or URL-encoding
    • 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/148Migration or transfer of sessions

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The present disclosure relates to the field of communications technologies, and in particular, to a communication method, a system, an electronic device, and a computer readable storage medium. The method comprises the following steps: selecting a load balancing mode according to the service flow prediction; under the condition that the service flow prediction is normal, carrying out route cluster load balancing; and under the condition of abnormal service flow prediction, carrying out client load balancing. The technical problem of communication blockage inside the game service architecture is solved.

Description

Communication method, system, electronic equipment and computer readable storage medium
Technical Field
The present disclosure relates to the field of communications technologies, and in particular, to a communication method, a system, an electronic device, and a computer readable storage medium.
Background
At present, the system processing capability of a large-scale network service for realizing the game function becomes a research hotspot of the internet, wherein a server distributed deployment mode is proposed based on solving the load balancing and improving the equipment performance. The distributed deployment of the servers means that data and programs in the same game in the game are not located on the same server, but are distributed to a plurality of servers, and the data are remotely transmitted between the client and the servers through a network, so that a complete system for communication is realized.
Existing gaming service architecture includes devices, including player clothing, map clothing, etc., as well as routing. Referring to fig. 1, a simple model of a gaming service architecture includes devices and routing nodes through which traffic between the devices is forwarded. Referring to fig. 2, in the case of cross-cluster, hybrid cloud communication, the game service architecture includes devices and routing clusters, through which the devices forward for information interaction.
In the process of implementing the present application, the inventor finds that at least the following problems exist in the prior art: in the game service architecture, a routing cluster can be adopted for solving the problem of internal load balancing among servers, and service traffic generated by interaction among the servers is shared through the routing cluster, so that the processing mode cannot adapt to the situation of sudden increase of the service traffic, and communication blockage inside the servers can be caused when the service traffic suddenly increases.
Disclosure of Invention
Therefore, the embodiments of the present application provide a communication method, a system, an electronic device, and a computer readable storage medium, which can solve the technical problem of communication congestion inside a game service architecture, and the specific technical scheme is as follows:
in a first aspect, embodiments of the present application provide a communication method, the method including:
selecting a load balancing mode according to the service flow prediction;
under the condition that the service flow prediction is normal, carrying out route cluster load balancing;
and under the condition of abnormal service flow prediction, carrying out client load balancing.
By adopting the technical scheme, the service flow balancing is carried out based on the service flow prediction in the game service architecture, and the load balancing of the routing clusters and the load balancing of the clients are provided, so that the problem of communication blockage between devices caused by blockage of the routing clusters under the condition of rapid increase of the service flow is solved, and the technical problem of communication blockage in the game service architecture is further solved.
Preferably, the method further comprises:
and migrating the related data of the current equipment from the first equipment to the second equipment, wherein the first equipment is a node which is in communication connection with the current equipment, and the second equipment is a new node which is in communication connection with the current equipment according to a load balancing strategy.
By adopting the technical scheme, when the traffic flow prediction is abnormal, the data of the equipment with the rapidly increased data volume is migrated, and the traffic flow is balanced, so that the congestion among the equipment is reduced.
Preferably, the migrating the current device-related data from the first device to the second device includes:
the current device informs the first device to persist the session between the first device and the current device or directly copy the session between the first device and the current device to the second device, wherein the session records the identity information of the devices;
the first device generates a unique identifier and sends the unique identifier to the current device and the second device.
By adopting the technical scheme, the session is persistent or directly copied to the second device, the current device and the second device are associated through the unique identifier, so that the device is confirmed, and communication can be performed without establishing connection again.
Preferably, the session also stores game character data.
By adopting the technical scheme, the switching logic of equipment switching is simplified, and the game development and maintenance are facilitated.
Preferably, the routing cluster is a central routing cluster.
By adopting the technical scheme, the central router realizes load balancing so as to solve the problems of resource waste and partial route congestion caused by uneven sharing of a plurality of route service flows in the same cluster, and solve the problems of network penetration, cross-cluster equipment treatment, communication stability (the problem of communication delay caused by network packet loss due to adoption of rudp in cross-cluster communication) and the like.
Preferably, the method further comprises: and establishing long connection between the equipment and the routing cluster and/or between the routing cluster and the routing cluster, and realizing communication connection between the equipment and the routing cluster through the long connection.
By adopting the technical scheme, long connection is used, the cost is lower, repeated handshaking and waving can be reduced, the application and release of the port can be reduced, and the service flow of the request connection can be reduced; the equipment and the routing clusters are respectively used as a single main body to establish long connection, the number of the routing clusters in the game service architecture is known, the number of the equipment is known, the number of the established long connection is known, the complexity of operation and maintenance management is simplified, and the operation and maintenance management is facilitated.
Preferably, when a long connection is established between the device and the routing cluster, the routing cluster registers the device information and the corresponding long connection, and roams this registration information to the routing cluster by means of a gossip algorithm.
By adopting the technical scheme, the long connection is managed, the gossip algorithm is adopted to transmit information to the whole network in a random mode, and all node data in the game service architecture are consistent within a certain time, so that the problems of transmission of states in the cluster and ensuring of state consistency are solved, and the method has the advantages of expandability, fault tolerance, robustness, final consistency, simplicity and the like.
Preferably, a long connection is established from device to device.
By adopting the technical scheme, the point-to-point communication between the equipment is realized by establishing the long connection between the equipment, the times of handshaking and waving in the request are reduced, and the service flow of the request is further reduced.
Preferably, the routing cluster is used as service registration discovery, and the ip and port number of the equipment are acquired to establish a routing table;
the establishing of the point-to-point communication between the devices comprises: and establishing long connection between the devices according to the routing table.
By adopting the technical scheme, the routing cluster is used as service registration discovery, when the equipment registers in the routing cluster, the ip and the port of the equipment are reported, and when the routing cluster establishes a routing table, the ip and the port number of the equipment are directly obtained by the routing table when the traffic flow prediction exceeds a threshold value.
Preferably, before performing load balancing of the client, under the condition that the traffic prediction is abnormal, the method includes:
if the service flow predicted value exceeds the first threshold value or the flow dynamic change peak-valley difference value is larger than the second threshold value, the routing cluster is used as service registration discovery, the ip of the service is acquired, and the port number is used for establishing a routing table.
By adopting the technical scheme, when the traffic flow prediction exceeds the threshold value, the routing cluster performs service registration discovery on the equipment and stores the routing table, and under the condition that the traffic flow is normal, the routing cluster does not need to perform service registration discovery and establish the routing table, so that the calculated amount of the routing cluster and the stored data amount are reduced.
Preferably, the selecting a load balancing manner according to the traffic flow prediction includes: before the current game service architecture operates, predicting the situation of abrupt change of the service flow occurring in the current game service architecture operation based on historical service flow data in advance, and presetting a time node for replacing a load balancing mode.
By adopting the technical scheme, the method for predicting the service flow in advance is adopted, the time node for the rapid increase of the service flow is predicted before the game service architecture operates, the preparation for selecting the load balancing mode is made in advance, the rapid increase of the service flow is better in processing capacity, the pressure of a routing cluster is reduced, the delay of communication interaction between the cross-cluster and the cross-cloud business is reduced, and the upper layer service is free from the sense of the bottom layer environment.
In a second aspect, embodiments of the present application provide a communication system, the system comprising:
the configuration module is used for selecting a load balancing mode according to the service flow prediction;
the route cluster balancing module is used for carrying out route cluster load balancing under the condition that the service flow prediction is normal;
and the client balancing module is used for carrying out client load balancing under the condition of abnormal service flow prediction.
In a third aspect, embodiments of the present application provide a computer device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, the processor implementing the steps of any one of the preceding communication methods when the computer program is executed.
In a fourth aspect, embodiments of the present application provide a computer-readable storage medium storing a computer program which, when executed by a processor, implements the steps of any one of the foregoing communication methods.
In summary, compared with the prior art, the technical scheme provided by the embodiment of the application has the beneficial effects that at least:
1. setting two load balancing modes of route cluster load balancing and client load balancing, selecting a load balancing mode according to service flow prediction, and realizing service flow by adopting route cluster load balancing under the condition that service flow prediction is normal; under the condition that the service flow prediction exceeds a threshold value, optimizing and establishing the load balance of the client between the devices, and effectively reducing the internal congestion of the devices;
2. the session is persistent or directly copied to the target equipment to which the session needs to be migrated, the complete session is restored through the unique identification, and the new connection established between the current service and the target equipment does not need repeated authentication;
3. by adopting the method for predicting the service flow in advance, the time node for the service flow surge is predicted before the game service architecture operates, the preparation for selecting the load balancing mode is made in advance, the surge service flow has better processing capacity, the pressure of a routing cluster is reduced, the delay of communication interaction between the cross clusters and the cross cloud providers is reduced, the upper layer service is free from the sense of the bottom layer environment, and the experience of a user is further improved.
Drawings
Fig. 1 is a schematic diagram of a simple model of a game service architecture in the background art.
Fig. 2 is a schematic structural diagram of a game service architecture in the context of cross-cluster, hybrid cloud communication.
Fig. 3 is a flow chart of a communication method according to an embodiment of the present application.
Fig. 4 is a flow chart of a communication method according to another embodiment of the present application.
Fig. 5 is a second flowchart of a communication method according to another embodiment of the present application.
Fig. 6 is a third flow chart of a communication method according to another embodiment of the present application.
Fig. 7 is a flowchart of a communication method according to another embodiment of the present application.
Fig. 8 is a schematic diagram of a communication method according to an embodiment of the present application.
Fig. 9 is a schematic structural diagram of a communication system according to an embodiment of the present application.
Fig. 10 is a schematic structural diagram of a computer device according to an embodiment of the present application.
Detailed Description
The present embodiment is merely illustrative of the present application and is not intended to be limiting, and those skilled in the art, after having read the present specification, may make modifications to the present embodiment without creative contribution as required, but is protected by patent laws within the scope of the claims of the present application.
For the purposes of making the objects, technical solutions and advantages of the embodiments of the present application more clear, the technical solutions of the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is apparent that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art based on the embodiments herein without making any inventive effort, are intended to be within the scope of the present application.
In addition, the term "and/or" in this application is merely an association relationship describing an association object, and indicates that three relationships may exist, for example, a and/or B may indicate: a exists alone, A and B exist together, and B exists alone. In this application, unless otherwise specified, the term "/" generally indicates that the associated object is an "or" relationship.
Embodiments of the present application are described in further detail below with reference to the drawings attached hereto.
Referring to fig. 3, in one embodiment of the present application, a communication method is provided, and the main steps of the method are described as follows:
s1: selecting a load balancing mode according to the service flow prediction;
s11: under the condition that the service flow prediction is normal, carrying out route cluster load balancing;
s12: and under the condition of abnormal service flow prediction, carrying out client load balancing.
Specifically, in this embodiment, a load balancing policy is set in the game service architecture, where the load balancing policy is to select a load balancing mode according to service traffic prediction, and if the service traffic prediction is normal, it is indicated that the service traffic is within the bearing range of the game service architecture; and if the service flow prediction is abnormal, the estimated flow is overlarge or the peak-valley difference of the dynamic flow change is larger.
Under the condition of abnormal traffic flow prediction, the load balancing of the routing cluster and the load balancing of the client can coexist, and the load balancing of the client can be independently executed.
The route cluster load balancing is a way of coordinating traffic flow by each route node in the route cluster, and there are two ways, but not limited to: 1. equivalent load balancing: equally distributing the traffic to a plurality of paths with the same measurement; 2. non-equivalent load balancing: traffic is distributed over multiple paths of different metrics, with the traffic distributed over each path inversely proportional to the routing overhead.
Further, in other implementations of the embodiment, when load balancing is performed on the client, load balancing is performed on the routing cluster synchronously, that is, when the traffic prediction exceeds the threshold, communications between the partial devices are forwarded through the routing cluster, and load balancing is performed on the routing cluster; and carrying out client load balancing on communication among part of devices through the devices.
The client load balancing is a mode that a client determines which service is used by a single request through a load balancing strategy, namely, the device establishes connection with corresponding devices through the load balancing strategy request, message forwarding is not required to be carried out by adopting a routing cluster in the current game service architecture, and point-to-point communication is established between the devices.
By balancing the service flow in the equipment, the load balancing of the routing clusters and the load balancing of the clients are provided, and the problem of communication blocking between game service frameworks caused by blocking of the routing clusters under the condition of rapid increase of the service flow is solved.
In this embodiment, the method for predicting the switching load balancing manner of the traffic flow is not limited to the following two methods:
1. when the game service architecture operates, the service flow prediction is synchronously performed in real time, and the specific mode can be as follows: detecting player request data in real time, judging that the service flow prediction exceeds a threshold when the player request data is subjected to small-range surge, and starting client load balancing, wherein the threshold is set according to actual conditions; in other embodiments, other real-time prediction methods may be used, and will not be described in detail herein.
2. Predicting in advance, before the current game service architecture operates, predicting the condition of service flow mutation occurring in the current game service architecture operation based on historical service flow data in advance, and presetting a time node for replacing a load balancing mode, wherein the time node specifically can be as follows:
(1) Based on a graph of historical traffic data changing in time, the mode of estimating the traffic state according to the historical traffic data is as follows: the time node of which the service flow exceeds a threshold value or the peak-valley difference exceeds the threshold value is used for replacing the load balancing mode;
examples are as follows: for example, a service flow state is estimated according to the condition that the service flow exceeds a threshold value at 8 pm every day according to a time-varying graph of historical daily service flow data, the estimated service flow state is that the service flow suddenly increases at 8 pm every day, and a load balancing mode is switched at 8 pm every day and is preset to be a client load balancing mode; according to a time-varying graph of historical daily traffic data, obtaining that traffic flow is recovered to be normal at 11 th night every day, estimating traffic flow state to be recovered to be normal at 11 th night every day, presetting a switching load balancing mode at 11 th night every day to be route cluster load balancing, and the specific meaning of a threshold is related to the mode of estimating traffic flow;
the threshold value is set according to the mode of estimating the service flow state, and when the service flow exceeds the threshold value, the threshold value is a service flow value of the current game service architecture, wherein communication blockage is possible to occur; when the peak-valley difference of the dynamic change of the service flow exceeds a threshold value to estimate the service flow state, setting the threshold value as a difference value between a normal average value of the service flow and a service flow value of the current game service architecture, wherein communication blockage is likely to occur;
it should be noted that, the method of estimating the traffic state is not limited to the above method, and the setting of the threshold is not limited to the above method, which is not described herein. Referring to fig. 4, further, in the present embodiment, the load balancing mode is selected according to traffic flow prediction, and the following advantages are obtained by using the advance prediction: by adopting the method for predicting the service flow in advance, the time node for the service flow surge is predicted before the game service architecture operates, the preparation for selecting the load balancing mode is made in advance, the surge service flow has better processing capacity, the pressure of a routing cluster is reduced, the delay of communication interaction between the cross-cluster and the cross-cloud business is reduced, and the upper layer service has no sense on the bottom layer environment.
Alternatively, in another embodiment, the routing clusters use a central routing cluster, i.e. a routing cluster provided with a central router, which enables routing and forwarding of data packets. Load balancing is achieved through the central router, so that the problem of resource waste caused by uneven sharing of multiple routing service flows in the same routing cluster is solved.
Referring to fig. 5, in an alternative embodiment, performing client load balancing includes: and migrating the related data of the current equipment from the first equipment to the second equipment, wherein the first equipment is a node in communication connection with the current equipment, and the second equipment is a new node which needs to be in communication connection with the current equipment according to a load balancing strategy, and in the embodiment, the second equipment is set as an example.
When the traffic prediction of the information interaction service between the current device and the first device is abnormal, partial data of the current device is migrated from the first device to the second device, so that the occurrence of crowding of the information interaction between the devices is reduced.
Referring to fig. 6, migrating current device-related data from a first device to a second device includes:
s121: the current device informs the first device to persist the session between the first device and the current device or directly copy the session between the first device and the current device to the second device, wherein the session records the identity information of the devices;
s122: the first device generates a unique identifier and sends the unique identifier to the current device and the second device.
Specifically, the identity information is recorded in the session, so that the safety problem that the equipment needs to be repeatedly authenticated when the equipment is switched can be solved, the session between the equipment is bound to the communication connection between the equipment, the identity information of the equipment and the state information of the communication connection are recorded by the session, when the equipment is switched to be connected with the target equipment, the new connection is established without repeated authentication, and the service flow of repeated authentication is reduced.
Session persistence is also called session maintenance, and when a device logs in another device for the first time, for example, a player end (i.e., a current device) logs in the device end (i.e., a first device), after the login is successful, the device end can save user information, such as identity information, state information of communication connection and the like, recorded in the session by the player end at the device end, and generate a unique identifier, the device end transfers the saved user information to other device ends (i.e., a second device) under the condition of abnormal traffic flow, logs in other device ends according to the unique identifier when the next time the player end logs in, and the other device ends can restore the session information of the player end according to the unique identifier.
When the connection between the player end and the equipment end is established, the relevant user information can be directly copied to the other equipment end with the processing space on the premise of establishing the connection, namely, directly copied to the second equipment when the service flow prediction is abnormal.
The unique identifier is a key, and in other embodiments, may be a unique serial number, etc., which is not described in detail herein.
Optionally, in another embodiment, the session further stores game role data, and in general, the session between the player clothing and other devices stores game role data, where the game role data generally includes role information, status, and the like of the game, which are not described herein in detail.
Through the setting, when the equipment is switched, the switching logic between the equipment can be simplified through session persistence, and the game development is facilitated.
Referring to fig. 7, in an alternative embodiment, the communication method includes:
s2: and establishing long connection between the equipment and the routing cluster and/or between the routing cluster and the routing cluster, and realizing communication connection between the equipment and the routing cluster through the long connection.
The load balancing in the manner of establishing long connections has the following effects: 1. the long connection is used, the cost is lower, repeated handshaking and waving, the application and release of the port can be reduced, and the service flow of the request connection is reduced; 2. the equipment and the routing clusters are respectively used as a single main body to establish long connection, the number of the routing clusters in the game service architecture is known, the number of the established long connection is predictable, the complexity of operation and maintenance management is simplified, and the operation and maintenance management is facilitated.
In the present embodiment, there are the following 3 cases: 1. establishing long connections only between the device and the routing clusters; 2. establishing long connections only between the routing clusters and the routing clusters; 3. long connections are established between the device and the routing cluster, and between the routing cluster and the routing cluster.
Furthermore, in this embodiment, the above 3 rd situation is commonly used in the game service architecture, long connections are established between the device and the routing cluster, and between the routing cluster and the routing cluster, so that the process of establishing connections between the device and the routing cluster, and between the routing cluster and the routing cluster through information interaction is simplified.
Further, in this embodiment, a long connection is established between the device and the routing cluster and/or between the routing cluster and the routing cluster, and the routing cluster in the communication connection between the device and the routing cluster is preferably a central routing cluster through the long connection.
In the game service architecture, long connection is established between the equipment and the routing cluster and/or between the routing cluster and the routing cluster, and the process of establishing connection in each request is subtracted, so that the traffic flow is reduced; the central router is arranged inside the routing cluster, the central router is used for realizing the grouping distribution of the service flow and processing the request of the equipment, the central routing cluster can reduce the conditions of blocking and unreasonable resource distribution in the service request, and the establishment of long connection between the equipment and the routing group and/or between the routing group and the routing group reduces the service quantity of the central router for processing the connection establishment request, so that the central router can have more calculation space for grouping distribution of the service flow, the condition of blocking the service request of the equipment is further reduced, and the problem of communication blocking caused by the service flow surge in the game service architecture can be effectively solved by establishing the long connection and adopting a mode of supplementing the central routing cluster.
Optionally, in another embodiment, authorization verification is performed when a long connection is established.
Authorization verification is performed when long connection is established, so that the safety of the communication process is improved, and the situation that an attacker accesses the game service architecture and collapses is avoided. The verification of the long connection may be performed by means of a key, a verification code, etc., which are not described in detail herein.
Optionally, in another embodiment, when a long connection is established between the device and the routing cluster, the routing cluster registers the device information and the corresponding long connection, and roams this registration information to the routing cluster through a gossip algorithm to manage the long connection.
Alternatively, in another embodiment, point-to-point communication is established from device to device.
When the traffic flow prediction is abnormal, point-to-point communication is established between the devices, so that the communication between the devices does not need to pass through a routing cluster, and the effect of balancing traffic flow load is achieved.
The peer-to-peer communication between devices needs to acquire the device ip and the port number, and the method for acquiring the ip and the port number may be: before a time node when traffic flow prediction exceeds a threshold, a device requests in advance an ip and port number of another device that needs to make a point-to-point connection to establish point-to-point communication between devices at or before the time node when traffic flow prediction exceeds the threshold.
Alternatively, in another embodiment, the point-to-point communication is to establish a long connection.
By establishing long connection between the devices, point-to-point communication between the devices is realized, and the times of handshaking and waving in the request are reduced, so that the service flow of the request is reduced.
Optionally, in another embodiment, the communication method further includes:
taking the routing cluster as service registration discovery, acquiring an ip and a port number of the equipment, and establishing a routing table;
establishing a long connection between devices includes: and establishing long connection between the devices according to the routing table.
The routing cluster is used as service registration discovery, when the equipment registers the routing cluster, the ip and the port of the equipment are reported, and when the routing cluster establishes a routing table, the ip and the port number of the equipment are directly obtained by the routing table when the traffic flow prediction is abnormal.
Examples are as follows: the existing equipment service A and service B access the routing cluster, and simultaneously open the local communication port and report the communication ip and port to the routing cluster in a metadata mode, in the initial stage of access of the service A and the service B (the service B comprises the service B-1 and the service B-2), the service A and the service B adopt the routing cluster for communication, the routing cluster can collect self-load information at regular time and communication flow among the equipment, and the routing cluster node can inform the access service of the service A and the service B of changing the communication mode on the assumption that the flow of the service A and the service B exceeds the preset flow value of the routing cluster, and referring to FIG. 8. The access service performs direct communication with the upstream and downstream services according to the synchronized upstream and downstream service information (i.e. routing table).
Optionally, in another embodiment, the route cluster is used as service registration discovery to establish the route table when the traffic prediction is abnormal, and under the condition that the traffic is normal, the route cluster is not required to perform service registration discovery and establish the route table, so that the calculation amount of the route cluster and the stored data amount are reduced.
It should be understood that the sequence number of each step in the foregoing embodiment does not mean that the execution sequence of each process should be determined by the function and the internal logic, and should not limit the implementation process of the embodiment of the present invention.
Referring to fig. 9, in one embodiment of the present application, a communication system is provided, which corresponds to the communication method in the above embodiment one by one. The communication system includes:
the configuration module is used for selecting a load balancing mode according to the service flow prediction;
the route cluster balancing module is used for carrying out route cluster load balancing under the condition that the service flow prediction is normal;
and the client balancing module is used for carrying out client load balancing under the condition of abnormal service flow prediction.
Further, in another embodiment, the configuration module is configured to predict, in advance, a situation of a sudden change in service flow occurring in the operation of the current game service architecture based on historical service flow data before the operation of the current game service architecture, and preset a time node for changing the load balancing mode.
Further, in another embodiment, the routing clusters employ a central routing cluster.
Further, in another embodiment, the device further includes a long connection establishment module, where the long connection establishment module is configured to establish a long connection between the device and the routing cluster and/or between the routing cluster and the routing cluster, and implement a communication connection between the device and the routing cluster through the long connection.
Further, in another embodiment, the communication system further includes a verification module.
The checking module is used for carrying out authorization checking when the long connection is established.
Further, in another embodiment, the communication system further includes a long connection management module.
The long connection management module is used for registering the equipment information and the corresponding long connection by the routing cluster when the long connection is established between the equipment and the routing cluster, and roaming the registration information to the routing cluster through a gossip algorithm so as to manage the long connection.
Further, in another embodiment, the long connection establishment module is further configured to establish a long connection between devices.
Further, in another embodiment, the communication system further includes a registration module.
The registration module is used for registering and finding by taking the routing cluster as a service, acquiring the ip and the port number of the equipment and establishing a routing table.
Further, in another embodiment, the client balancing module includes: and migrating the related data of the current equipment from the first equipment to the second equipment, wherein the first equipment is a node which is in communication connection with the current equipment, and the second equipment is a new node which is in communication connection with the current equipment according to a load balancing strategy.
Further, in another embodiment, the client balancing module further includes an information holding sub-module and an identification generating sub-module.
The information-holding sub-module is used for the current device to inform the first device to persist or directly copy the session with the current device to the second device.
The identifier generation submodule is used for generating a unique identifier by the opposite device and sending the unique identifier to the current device and the second device.
The above-described modules of the communication system may be implemented in whole or in part by software, hardware, and combinations thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules.
Referring to fig. 10, in one embodiment of the present application, a computer device, which may be a server, is provided. The computer device includes a processor, a memory, and a network interface connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device may be implemented by any type of volatile or nonvolatile memory device, including but not limited to: magnetic disk, optical disk, EEPROM (Electrically Erasable Programmable Read Only Memory, electrically erasable programmable Read-Only Memory), EPROM (Erasable Programmable Read Only Memory, erasable programmable Read-Only Memory), SRAM (Static Random Access Memory ), ROM (Read Only Memory), magnetic Memory, flash Memory, PROM (Programmable Read Only Memory, programmable Read-Only Memory). The memory of the computer device provides an environment for the running of an operating system and computer programs stored therein. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program, when executed by a processor, implements the steps of the communication method described in the above embodiments.
In one embodiment of the present application, a computer readable storage medium is provided, which stores a computer program, which when executed by a processor, implements the steps of the communication method described in the above embodiments. The computer readable storage medium includes ROM (Read Only Memory), RAM (Random Access Memory ), CD ROM (Compact Disc Read Only Memory, optical disk Read Only), magnetic disk, floppy disk, and the like.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-described division of the functional units and modules is illustrated, and in practical application, the above-described functional distribution may be performed by different functional units and modules according to needs, i.e. the internal structure of the system described in the present application is divided into different functional units or modules to perform all or part of the above-described functions.

Claims (10)

1. A method of communication, the method comprising:
selecting a load balancing mode according to the service flow prediction;
under the condition that the service flow prediction is normal, carrying out route cluster load balancing, wherein the route cluster load balancing is a mode of coordinating the service flow by each route node in the route cluster, and at least comprises two modes: equivalent load balancing: equally distributing the traffic to a plurality of paths with the same measurement; and non-equivalent load balancing: distributing the traffic flow to a plurality of paths with different metrics, wherein the distributed traffic flow on each path is inversely proportional to the routing overhead;
under the condition of abnormal service flow prediction, taking a routing cluster as service registration discovery, acquiring an ip and a port number of equipment to establish a routing table, and establishing long connection between the equipment according to the routing table to perform client load balancing; the client load balancing comprises the following steps: and migrating the related data of the current equipment from the first equipment to the second equipment, wherein the first equipment is a node which is in communication connection with the current equipment, and the second equipment is a new node which is in communication connection with the current equipment according to a load balancing strategy.
2. The method of claim 1, wherein the transferring the current device-related data from the first device to the second device comprises:
the current device informs the first device to persist the session between the first device and the current device or directly copy the session between the first device and the current device to the second device, wherein the session records the identity information of the current device;
the first device generates a unique identifier based on the identity information, sends the unique identifier to the current device and the second device, and associates the current device with the second device through the unique identifier.
3. The communication method of claim 2, wherein the session further stores game character data.
4. The communication method of claim 1, wherein the routing cluster is a central routing cluster.
5. The communication method according to any one of claims 1-4, wherein the method further comprises: and establishing long connection between the equipment and the routing cluster and/or between the routing cluster and the routing cluster, and realizing communication connection between the equipment and the routing cluster through the long connection.
6. The communication method according to claim 5, wherein when a long connection is established between the device and the routing cluster, the routing cluster registers the device information and the corresponding long connection, and roams the registration information to the routing cluster by a gossip algorithm.
7. The communication method according to claim 1, wherein selecting a load balancing manner according to traffic flow prediction comprises: before the current game service architecture operates, predicting the situation of abrupt change of the service flow occurring in the current game service architecture operation based on historical service flow data in advance, and presetting a time node for replacing a load balancing mode.
8. A communication system, the system comprising:
the configuration module is used for selecting a load balancing mode according to the service flow prediction;
the route cluster balancing module is used for carrying out route cluster load balancing under the condition that the traffic flow prediction is normal, wherein the route cluster load balancing is a mode of coordinating the traffic flow by each route node in the route cluster, and at least comprises two modes: equivalent load balancing: equally distributing the traffic to a plurality of paths with the same measurement; and non-equivalent load balancing: distributing the traffic flow to a plurality of paths with different metrics, wherein the distributed traffic flow on each path is inversely proportional to the routing overhead;
the client balancing module is used for taking the routing cluster as service registration discovery under the condition of abnormal service flow prediction, acquiring an ip and port number of the equipment to establish a routing table, establishing long connection between the equipment according to the routing table, and balancing the load of the client, wherein the balancing the load of the client comprises the following steps: and migrating the related data of the current equipment from the first equipment to the second equipment, wherein the first equipment is a node which is in communication connection with the current equipment, and the second equipment is a new node which is in communication connection with the current equipment according to a load balancing strategy.
9. A computer device comprising a memory, a processor and a computer program stored in the memory and running on the processor, the processor implementing the steps of the communication method according to any one of claims 1-7 when the computer program is executed.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program which, when executed by a processor, implements the steps of the communication method of any of claims 1-7.
CN202111318682.7A 2021-11-08 2021-11-08 Communication method, system, electronic equipment and computer readable storage medium Active CN114157605B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111318682.7A CN114157605B (en) 2021-11-08 2021-11-08 Communication method, system, electronic equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111318682.7A CN114157605B (en) 2021-11-08 2021-11-08 Communication method, system, electronic equipment and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN114157605A CN114157605A (en) 2022-03-08
CN114157605B true CN114157605B (en) 2024-03-01

Family

ID=80459964

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111318682.7A Active CN114157605B (en) 2021-11-08 2021-11-08 Communication method, system, electronic equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN114157605B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115225560B (en) * 2022-07-15 2023-08-22 国网河南省电力公司信息通信公司 Route planning method in power communication service
CN115474215B (en) * 2022-09-06 2023-03-21 广东九博科技股份有限公司 Router-based networking method and system

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101593133A (en) * 2009-06-29 2009-12-02 北京航空航天大学 Load balancing of resources of virtual machine method and device
CN103108039A (en) * 2013-01-25 2013-05-15 暨南大学 Service quality guarantee method in low-energy cluster environment
CN108574727A (en) * 2018-03-07 2018-09-25 天津麒麟信息技术有限公司 A kind of improved load balance scheduling system based on platform of soaring
US10356223B1 (en) * 2016-03-17 2019-07-16 Amazon Technologies, Inc. Connection migration for Internet of Things (IoT) devices
CN112671928A (en) * 2020-12-31 2021-04-16 北京天融信网络安全技术有限公司 Equipment centralized management architecture, load balancing method, electronic equipment and storage medium

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10348812B2 (en) * 2015-06-22 2019-07-09 Vmware Inc. Sticky session data migration
CN110417842B (en) * 2018-04-28 2022-04-12 北京京东尚科信息技术有限公司 Fault processing method and device for gateway server

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101593133A (en) * 2009-06-29 2009-12-02 北京航空航天大学 Load balancing of resources of virtual machine method and device
CN103108039A (en) * 2013-01-25 2013-05-15 暨南大学 Service quality guarantee method in low-energy cluster environment
US10356223B1 (en) * 2016-03-17 2019-07-16 Amazon Technologies, Inc. Connection migration for Internet of Things (IoT) devices
CN108574727A (en) * 2018-03-07 2018-09-25 天津麒麟信息技术有限公司 A kind of improved load balance scheduling system based on platform of soaring
CN112671928A (en) * 2020-12-31 2021-04-16 北京天融信网络安全技术有限公司 Equipment centralized management architecture, load balancing method, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN114157605A (en) 2022-03-08

Similar Documents

Publication Publication Date Title
CN107852604B (en) System for providing Global Virtual Network (GVN)
CN114157605B (en) Communication method, system, electronic equipment and computer readable storage medium
CN108023812B (en) Content distribution method and device of cloud computing system, computing node and system
WO2011140951A1 (en) Method, device and system for load balancing
CN106713378B (en) Method and system for providing service by multiple application servers
WO2023124309A1 (en) Cloud native upf signaling plane load balancing selection method and system
EP2613500A1 (en) Content-centric network and method of performing routing between domains therefor
JP5564661B2 (en) Relay node and relay processing program
CN116633934A (en) Load balancing method, device, node and storage medium
CN109639502B (en) Return source control method and content distribution network
CN112243036B (en) Data processing method and device for PaaS service, equipment and storage medium
CN112087382B (en) Service routing method and device
US11894978B1 (en) Computing power scheduling methods, apparatus, electronic devices and storage media
CN111510958B (en) Message access load balancing method and system
JP2016508695A (en) Security device that performs network flow prediction, flow ownership assignment, and event aggregation in a distributed processor system
Shuai et al. A cost-based distributed algorithm for load balancing in content delivery network
CN106909322B (en) Routing method and device for supporting storage disaster recovery in virtualization system
AlShammari et al. BL‐Hybrid: A graph‐theoretic approach to improving software‐defined networking‐based data center network performance
Hoang et al. New distributed constraint satisfaction algorithms for load balancing in edge computing: A feasibility study
D’Alessandro Costa et al. Performance analysis of a locality-aware BitTorrent protocol in enterprise networks
Alomari et al. Towards optimal synchronization in NFV‐based environments
Keizer et al. Rewarding relays for decentralised nat traversal using smart contracts
KR20190048324A (en) Method for providing service based on multi network and apparatus therefor
CN112769590B (en) Software defined content distribution network server selection method based on blockchain
CN112653653B (en) Communication circuit management method, network equipment and storage medium

Legal Events

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