CN110620673A - Data processing method and system for chat room process - Google Patents

Data processing method and system for chat room process Download PDF

Info

Publication number
CN110620673A
CN110620673A CN201910996327.1A CN201910996327A CN110620673A CN 110620673 A CN110620673 A CN 110620673A CN 201910996327 A CN201910996327 A CN 201910996327A CN 110620673 A CN110620673 A CN 110620673A
Authority
CN
China
Prior art keywords
chat room
chat
service process
process group
load value
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201910996327.1A
Other languages
Chinese (zh)
Other versions
CN110620673B (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.)
Netease Hangzhou Network Co Ltd
Original Assignee
Netease Hangzhou Network 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 Netease Hangzhou Network Co Ltd filed Critical Netease Hangzhou Network Co Ltd
Priority to CN201910996327.1A priority Critical patent/CN110620673B/en
Publication of CN110620673A publication Critical patent/CN110620673A/en
Application granted granted Critical
Publication of CN110620673B publication Critical patent/CN110620673B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5083Techniques for rebalancing the load in a distributed system
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/02Details
    • H04L12/16Arrangements for providing special services to substations
    • H04L12/18Arrangements for providing special services to substations for broadcast or conference, e.g. multicast
    • H04L12/1813Arrangements for providing special services to substations for broadcast or conference, e.g. multicast for computer conferences, e.g. chat rooms
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Multimedia (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The embodiment of the invention provides a data processing method and a system for a chat room process, wherein the chat room process has a corresponding load value, and the method comprises the following steps: establishing a plurality of groups of service processes for running a distributed consistency protocol; the multiple groups of service processes comprise a distributed coordination service process group, a central service process group, a chat service process group and a gateway service process group; monitoring a load value stored by a distributed coordination service process group by adopting a central service process group, and generating a chat room establishment request when the stored load value meets a preset condition; adopting a chat service process group to respond to a chat room creation request to create a chat room process; and when the gateway service process group receives the registration request, determining the target chat room process according to the stored load value. By operating the central service process group of the distributed consistency protocol, the main selection function of the central service process group is realized, and the fault transfer can be realized when the central service process fails at a single point.

Description

Data processing method and system for chat room process
Technical Field
The invention relates to the technical field of data processing, in particular to a data processing method of a chat room process and a data processing system of the chat room process.
Background
The games mostly adopt a separate service architecture, that is, each player is assigned to a specific service process, and only the players can interact with each other on the same service process, and most of the games have the requirement of world chat, that is, the players can speak in an open chat room. This type of chat room solution is mostly in the form of broadcasting, i.e. a single chat room, since the sub-server architecture determines that the number of people per server is relatively limited, above which the overall chat room pressure can be controlled substantially well if speaking is followed by some frequency and item consumption limitations.
However, as the game categories are continuously explored, the architecture of some games is biased towards logical macros, that is, the interaction between players is not limited to the same service process, but can be exchanged across service processes, and although players may be distributed to different service processes, the interaction between players can still be performed, and if the system is also in accordance with the traditional single chat room system, the broadcasting pressure of messages is very large.
In the prior art, in order to implement cross-service process communication on a logic large-scale service, several chat room system schemes appear as follows:
(1) since it is inevitable that the number of game players reaches millions, one type of chat room system adopts the following solutions: since all players cannot be placed in the same chat room, it is possible to open several chat rooms according to the logical distribution, for example, a game of a logical grand uniform is provided by 10 game service processes, and the 10 game service processes provide chat room services respectively.
(2) Another type of chat room system employs the following schemes: the method is characterized in that a fixed number of chat rooms is preset, an upper limit of the maximum number of the chat rooms is preset, and players are distributed to the chat rooms lower than the upper limit of the maximum number of the chat rooms after entering a game, so that the players are distributed to a certain chat room more intensively, and the situation that the number of the players is small and the players are distributed to all the chat rooms is avoided.
(3) Another type of chat room system is the following: the method adopts a central service mode, namely, a central service timely creates chat rooms according to the change of the number of players, namely, the number of the chat rooms is not fixed, but can change along with the change of the number of players.
The above-described chat room system solutions of the prior art actually solve many problems, but each have some disadvantages, among them:
the disadvantages of scheme (1) are: if the user is dispersed in a plurality of game service processes, when the number of players is small, the players are uniformly dispersed in the plurality of service processes because the game service processes pursue load balance, the number of the players in each chat room is sufficient, but the players cannot communicate with each other, and the experience of the players is not good as much as the whole.
The disadvantages of scheme (2) are: the preset fixed number of chats cannot solve the problem when the number of users increases sharply, if 10 chatting rooms are preset and each chatting room is 1000, then newly added players cannot experience the service of the chatting rooms well when the number of the newly added players is more than 10000, and the preset number of chatting suits is very sophisticated and lacks of self-adaptive characteristics.
The disadvantages of scheme (3) are: the number of the chat rooms is dynamically changed according to the number of people, strong flexibility is achieved, the chat rooms are still established and distributed by the central service, and the service of the chat rooms is almost unavailable once the central service fails.
Disclosure of Invention
In view of the above, embodiments of the present invention are proposed to provide a data processing method of a chat room process and a corresponding data processing system of a chat room process that overcome or at least partially solve the above problems.
In order to solve the above problem, an embodiment of the present invention discloses a data processing method for a chat room process, where the chat room process has a corresponding load value, and the method includes:
establishing a plurality of groups of service processes for running a distributed consistency protocol; the multiple groups of service processes comprise a distributed coordination service process group, a central service process group, a chat service process group and a gateway service process group;
monitoring the load value stored by the distributed coordination service process group by adopting the central service process group, and generating a chat room establishing request when the stored load value meets a preset condition;
adopting the chat service process group to respond to the chat room establishing request to establish a chat room process;
and when the gateway service process group receives a registration request, determining a target chat room process according to the stored load value.
Optionally, the method further includes:
and detecting the real-time load value of the chat room process by adopting the chat service process group, and updating the load value stored by the distributed coordination service process group when the real-time load value exceeds a first preset threshold value.
Optionally, the registration request carries a user identifier, and the method further includes:
and extracting the user identification in the chat room process by adopting the chat service process group, and adding the user corresponding to the user identification into the target chat room process.
Optionally, when the gateway service process group receives a registration request, determining a target chat room process according to the stored load value includes:
and when the gateway service process group receives a registration request, increasing the stored load value to generate an intermediate value, and determining the chat room process of which the intermediate value does not exceed a second preset threshold value as a target chat room process.
Optionally, the method further includes:
and receiving the chat message by adopting the gateway service process group, and broadcasting the chat message to the chat room process corresponding to the chat room identifier of the chat message.
The embodiment of the invention also discloses a data processing system of the chat room process, the chat room process has a corresponding load value, and the data processing system comprises:
the process creation module is used for creating a plurality of groups of service processes for operating the distributed consistency protocol; the multiple groups of service processes comprise a distributed coordination service process group, a central service process group, a chat service process group and a gateway service process group;
the chat room creation request generation module is used for monitoring the load value stored by the distributed coordination service process group by adopting the central service process group and generating a chat room creation request when the stored load value meets a preset condition;
a chat room process creating module for creating a chat room process by adopting the chat service process group to respond to the chat room creating request;
and the target chat room process determining module is used for determining the target chat room process according to the stored load value when the gateway service process group receives the registration request.
Optionally, the method further includes:
and the load value updating module is used for detecting the real-time load value of the chat room process by adopting the chat service process group, and updating the load value stored by the distributed coordination service process group when the real-time load value exceeds a first preset threshold value.
Optionally, the registering request carries a user identifier, and further includes:
and the user adding module is used for extracting the user identification in the chat room process by adopting the chat service process group and adding the user corresponding to the user identification into the target chat room process.
Optionally, the target chat room process determining module includes:
and the target chat room process determining submodule is used for increasing the stored load value to generate an intermediate value when the gateway service process group receives a registration request, and determining the chat room process of which the intermediate value does not exceed a second preset threshold value as the target chat room process.
Optionally, the method further includes:
and the chat message broadcasting module is used for receiving the chat messages by adopting the gateway service process group and broadcasting the chat messages to the chat room process corresponding to the chat room identifier of the chat messages.
The embodiment of the invention also discloses an electronic device, which comprises:
one or more processors; and
one or more machine-readable media having instructions stored thereon, which when executed by the one or more processors, cause the electronic device to perform one or more of the method steps as described in embodiments of the invention.
Embodiments of the invention also disclose a computer-readable storage medium having instructions stored thereon, which, when executed by one or more processors, cause the processors to perform one or more of the method steps as described in embodiments of the invention.
The embodiment of the invention has the following advantages:
in the embodiment of the invention, the main selection function of the central service process group is realized by operating the central service process group of the distributed consistency protocol, and the fault transfer can be realized when the central service process fails at a single point. Although the non-availability period of the selected owner exists, the distribution of the chat room process does not depend on the central service process, so that even if the selected owner exists, if the number of the current chat room processes is enough, the gateway service process group can normally distribute the users to the chat room process, essentially, the system realizes decentralized chat room process distribution and can basically ensure all-weather uninterrupted service of the chat service process group.
Drawings
FIG. 1 is a flow chart of the steps of one embodiment of a method of data processing for a chat room process of the present invention;
FIG. 2 is a block flow diagram of a data processing process of the present invention;
figure 3 is a block diagram of an embodiment of a data processing system for a chat room process of the present invention.
Detailed Description
In order to make the aforementioned objects, features and advantages of the present invention comprehensible, embodiments accompanied with figures are described in further detail below.
Referring to fig. 1, a flowchart illustrating steps of an embodiment of a data processing method for a chat room process according to the present invention is shown, where the chat room process has a corresponding load value, and the method specifically includes the following steps:
step 101, establishing a plurality of groups of service processes for running a distributed consistency protocol; the multiple groups of service processes comprise a distributed coordination service process group, a central service process group, a chat service process group and a gateway service process group;
distributed consistency means that data of Multiple Nodes (Multiple Nodes) are identical. However, since a plurality of nodes are interconnected through a network and are not available at any moment, and when a service cannot be used because some nodes (especially a few nodes) are unavailable, the whole system is unavailable, and a distributed consistency protocol is used for ensuring the integrity and consistency of data.
The distributed coherency protocol may include: PaxOS protocol, Raft protocol, ZAB protocol (ZooKeeper Atomic Broadcast protocol), Pacifica protocol, and the like. In the embodiment of the invention, the distributed consistency protocol can be a Raft protocol, has the functions of synchronizing data on a plurality of machines, ensuring the completeness and consistency of the data, realizing the function of selecting a master on a plurality of machines and ensuring that one service process cannot be served due to downtime.
In the embodiment of the present invention, a plurality of groups of service processes running a distributed consistency protocol may be created, which are respectively: the system comprises a distributed coordination service process group, a central service process group, a chat service process group and a gateway service process group. Each group of service processes comprises more than or equal to 3 service processes, and the failover of each group of service processes is realized through a distributed consistency protocol.
The distributed coordination service process group is used for storing the load value of the chat room process and informing other service processes monitoring the distributed coordination service process group of corresponding data change.
The central service process group is used for monitoring the load value of the chat room process and timely sending a request for creating the chat room process to the chat service process group so as to create the chat room process and provide the created chat room process for the newly added user.
The chat service process group is used to create chat room processes, join users to the chat room processes, and broadcast chat messages for transmission to other users in the chat room processes. The chat service process group can detect the load value of the chat room process, and when the load value of the chat room process changes, the change value is sent to the distributed coordination service process group. It should be noted that, a chat room process may be a sub-process created by a chat service process group, and communication may be performed between users in the same sub-process, that is, communication may be performed between users in the same chat room process.
The gateway service process group is used for monitoring the load value of the chat room process and accessing the newly registered user, and distributing the user to the matched chat room process according to the load value of the chat room process.
Step 102, monitoring a load value stored by the distributed coordination service process group by adopting the central service process group, and generating a chat room establishing request when the stored load value meets a preset condition;
the load value of a chat room process may refer to the value of the user joining the chat room process.
In embodiments of the present invention, the distributed coordination service process group may store load values for chat room processes. The central service process group can register a listener of the load value stored by the distributed coordination service process group, and when the load value stored by the distributed coordination service process group changes, the central service process group can be notified, so that the central service process group can master the load condition of the chat room process.
Wherein the preset condition may be a preset condition for controlling the process of creating the chat room. For example, the preset condition is a certain numerical range.
And the central service process group can generate a chat room establishing request when monitoring that the load value stored in the distributed coordination service process group meets the preset condition. The chat room creation request may be a request message for indicating the creation of a chat room process, carrying a chat service process identification. Wherein, the chat service process identification can be a unique identification code of the chat service process. As an example, the preset condition may be that the number of users is 8 ten thousand, and the central service process group may generate the chat room creation request when the number of users insisting on the chat room process is greater than or equal to 8 ten thousand.
The central service process group can determine the chat service process with smaller load in the chat service process group as the target chat service process by monitoring the load value stored in the distributed coordination service process group. In order to realize load balance, the number of the chat room processes carried by each chat service process cannot be too large, so that the central service process group is required to distribute the chat room processes to the chat service processes with lower load when distributing the chat room processes. Since the central service process group can monitor the load condition of the chat room processes, the central service process group can know to which chat service process each chat room process is allocated, so that a chat service process with lower load can be selected for allocation.
103, adopting the chat service process group to respond to the chat room establishing request to establish a chat room process;
specifically, the chat room process group can determine a target chat service process of the chat room process to be created according to the chat service process identifier carried in the chat room creation request, create the chat room process by using the target chat service process, and maintain the data structure of the chat room process.
For example, the chat service process group includes: the chat service process 1, the chat service process 2, the chat service process 3 and the chat service process 4 can establish the chat room process in the chat service process 3 by determining that the chat service process 3 is needed to be established according to the chat service process identification carried in the chat room establishing request.
And step 104, determining a target chat room process according to the stored load value when the gateway service process group receives the registration request.
Wherein the registration request is a request message indicating an addition to a chat room process. When a user needs to join a chat room process, a registration request may be sent to the gateway service process.
In the embodiment of the invention, the gateway service process group can monitor the load value stored by the distributed coordination service process group, so that the load condition of each chat room process is known, and the target chat room process is determined according to the load value stored by the distributed coordination service process group.
In a specific implementation, the purpose of load balancing of the processes distributed to the chat rooms by the users is not to uniformly distribute the players to all the chat rooms, but to distribute the users to the chat rooms which do not reach the upper limit of the number of the players as much as possible. Therefore, the upper limit value of the number of users of one chat room process can be preset, the gateway service process group preferentially determines that the number of users is large, but the chat room process which does not reach the upper limit value is taken as the target chat room process, and therefore the number of users can be concentrated as much as possible.
As an example, the upper limit of the number of users in a chat room process is set to 10 ten thousand, and the number of users in 5 chat room processes is less than 10 ten thousand, where the number of users is: 9.5, 9, 8.8, 8.5, 8 ten thousand, and then it is determined that the chat room process with the user number of 9.5 ten thousand is the target chat room process.
It should be noted that, because the function of monitoring the change of the number of users in the chat room process provided by the distributed coordination service process group is not necessarily timely, if the users enter the chat room in a large batch, the creation speed of the chat room process may not reach the speed of the users registering in the chat room, in order to solve the problem, a corresponding low water level threshold is designed, if the number of the chat room processes lower than the low water level threshold in the current chat room process is less than Y, Y chat rooms are created, which is created in advance by the central service process, and under the design, as long as the Y design is reasonable enough, the requirement of the players for registering in a large batch can be met.
In the implementation of the solution of the embodiment of the present invention, the numerical value (corresponding to the low water level threshold) of the preset condition used for indicating the creation of the chat room process in step 102 may be set to be slightly smaller than the upper limit value of the number of users of the chat room process, so that a new chat room process may be created when the number of users in the chat room process has not reached the upper limit value, and it is ensured that the number of users in each chat room process does not exceed the upper limit value.
In a preferred embodiment of the present invention, the method may further comprise the steps of:
and detecting the real-time load value of the chat room process by adopting the chat service process group, and updating the load value stored by the distributed coordination service process group when the real-time load value exceeds a first preset threshold value.
Because the number of users in the chat room process changes frequently, if the number of people in the chat room process changes every time, the change information is updated to the distributed coordination service process group, the load of the distributed coordination service process group may be too high, and therefore the update amount of the change information of the number of users in the chat room process needs to be controlled. Furthermore, since the load balancing needs to know whether the number of users in the chat room process is full in many cases, the change information of the chat room process can be updated to the distributed coordination service process group when the number of users in the chat room process changes to a specific number (called step), so as to reduce the load of the distributed coordination service process group.
In a specific implementation, the chat service process group may detect a real-time load value of the chat room process, determine whether the real-time load value exceeds a first preset threshold, and update the load value stored in the distributed coordination service process group when the real-time load value exceeds the first preset threshold. The real-time load value may be a latest load value of a chat room process, and the first preset threshold may be a preset user number threshold. As an example, if the first preset threshold is 1 ten thousand, the group of chat service processes updates the load value stored in the group of distributed coordination service processes when the amount of change in the number of users in the chat room process is greater than or equal to 1 ten thousand.
In a preferred embodiment of the present invention, the registration request carries a user identifier, and the method further includes:
and extracting the user identification in the chat room process by adopting the chat service process group, and adding the user corresponding to the user identification into the target chat room process.
The user identifier may be a unique identifier of the user, for example, in a game application scenario, the user identifier may be a game name of the user.
In the embodiment of the invention, the chat service process group can extract the user identification in the chat room process, determine the user needing to be added into the target chat room process according to the user identification, and add the user into the target chat room process.
In a preferred embodiment of the present invention, the step 104 may comprise the following sub-steps:
and when the gateway service process group receives a registration request, increasing the stored load value to generate an intermediate value, and determining the chat room process of which the intermediate value does not exceed a second preset threshold value as a target chat room process.
Because there is a certain time delay in the monitoring function provided by the distributed coordination service process group, that is, a chat room process is created, and then the load value of the chat room process is stored in the distributed coordination service process group, the remaining services for monitoring the change of the number of users in the chat room process may have a certain time delay to sense the change of the load value of the chat room process. Therefore, when the gateway service process registers the user in a chat room process whose stored load value has not reached the upper limit of the maximum number of users, it is likely that the chat room process is full, which may cause the number of people in the chat room process to exceed the designed upper limit of the maximum number of users.
In order to solve the problem, when the user is added into the target chat room process, a step of pre-registration is needed, that is, the information of user registration is written into the preset storage system in advance, and the preset storage system ensures that the number of users in the chat room process does not exceed the upper limit value.
Specifically, the preset storage system may serve as an intermediate device for registering the user in the chat room process, one piece of data is maintained in the preset storage system, and the stored load value is incremented each time a registration request is received, so as to generate an intermediate value. As an example, assuming that the stored load value is 800, 10 registration requests are received, and the stored load value is incremented to 810. When the preset storage system receives a new registration request, judging whether the current intermediate value exceeds a second preset threshold value, if so, returning a failure message to the gateway service process group, and discarding the registration request. After the gateway service process group receives the failed message, the registration of the chat room process fails on behalf of the gateway service process group, and another chat room process can be reselected as the target chat room process by the gateway service process group. The second preset threshold may be a preset upper limit value of the number of users in the chat room process.
In a preferred embodiment of the present invention, the method may further comprise the steps of:
and receiving the chat message forwarded by the gateway service process group by adopting the chat service process group, and broadcasting the chat message to the chat room process corresponding to the chat room identifier of the chat message.
In the embodiment of the invention, the chat message can carry a chat room identifier, and the chat room identifier is used for uniquely identifying the chat room process. After the user completes the registration, the chat message can be sent to the gateway service process group, and the chat message is forwarded to the chat service process group by the gateway service process group. The chat service process group can receive the chat messages forwarded by the gateway service process group, extract the chat room identifiers in the chat messages, determine the chat room processes needing to broadcast the chat messages according to the chat room identifiers, and broadcast the chat messages to the chat room processes.
Fig. 2 is a flow chart illustrating a data processing procedure of the present invention, including distributed coordination service, central service, chat service and gateway service, and redis cluster cache database. The distributed coordination service, the central service, the chat service and the gateway service are respectively composed of a plurality of processes running a distributed consistency protocol. The distributed coordination service stores the load value of the chat room process in the chat service, and when the chat service detects that the change of the load value of the chat room process reaches a certain threshold value, the chat service can inform the change condition of the chat room process to the distributed coordination service, so that the distributed coordination service updates the stored load value. The central service and the gateway service monitor the load value stored by the distributed coordination service respectively, and when the central service determines that the stored load value meets the preset condition, the central service sends a chat room process creation request to the chat service, so that the chat service can create a new chat room process. The gateway service performs pre-registration to the redis when receiving the registration request sent by the user A, the redis sends the registration request to the chat service, the user B which has completed registration can directly send the chat message to the gateway service, and the gateway service sends the chat message to the chat service process.
In the embodiment of the invention, the main selection function of the central service process group is realized by operating the central service process group of the distributed consistency protocol, and the fault transfer can be realized when the central service process fails at a single point. Although the non-availability period of the selected owner exists, the distribution of the chat room process does not depend on the central service process, so that even if the selected owner exists, if the number of the current chat room processes is enough, the gateway service process group can normally distribute the users to the chat room process, essentially, the system realizes decentralized chat room process distribution and can basically ensure all-weather uninterrupted service of the chat service process group.
Secondly, the load balancing distribution of the chat room processes of the users is not random distribution, but the users are concentrated in the chat room processes as much as possible to improve the experience of the users, and the strategy can bring great experience to the users when the number of the users is large or small.
In addition, the problem that the creation of a single created chat room cannot keep up with the registration of the user is solved through the strategy of creating the chat room for setting the low water level threshold value. Moreover, the change data of the number of users is updated to the distributed coordination service process group only when the number of people in the chat room reaches a specific step (for example, every 200 people are changed), and the pressure of the distributed coordination service process group is greatly reduced under the condition that the requirement of globally sensing the load value of the chat room process is met.
It should be noted that, for simplicity of description, the method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present invention is not limited by the illustrated order of acts, as some steps may occur in other orders or concurrently in accordance with the embodiments of the present invention. Further, those skilled in the art will appreciate that the embodiments described in the specification are presently preferred and that no particular act is required to implement the invention.
Referring to fig. 3, a block diagram of a data processing system of a chat room process according to an embodiment of the present invention is shown, where the chat room process has a corresponding load value, and specifically includes the following modules:
a process creation module 301, configured to create multiple groups of service processes running a distributed consistency protocol; the multiple groups of service processes comprise a distributed coordination service process group, a central service process group, a chat service process group and a gateway service process group;
a chat room creation request generation module 302, configured to monitor the load value stored in the distributed coordination service process group by using the central service process group, and generate a chat room creation request when the stored load value meets a preset condition;
a chat room process creating module 303, configured to respond to the chat room creating request with the chat service process group to create a chat room process;
and a target chat room process determining module 304, configured to determine a target chat room process according to the stored load value when the gateway service process group receives the registration request.
In a preferred embodiment of the present invention, the system may further include the following modules:
and the load value updating module is used for detecting the real-time load value of the chat room process by adopting the chat service process group, and updating the load value stored by the distributed coordination service process group when the real-time load value exceeds a first preset threshold value.
In a preferred embodiment of the present invention, the registration request carries a user identifier, and the system may further include the following modules:
and the user adding module is used for extracting the user identification in the chat room process by adopting the chat service process group and adding the user corresponding to the user identification into the target chat room process.
In a preferred embodiment of the present invention, the target chat room schedule determining module may include the following sub-modules:
and the target chat room process determining submodule is used for increasing the stored load value to generate an intermediate value when the gateway service process group receives a registration request, and determining the chat room process of which the intermediate value does not exceed a second preset threshold value as the target chat room process.
In a preferred embodiment of the present invention, the system may further include the following modules:
and the chat message broadcasting module is used for receiving the chat messages by adopting the gateway service process group and broadcasting the chat messages to the chat room process corresponding to the chat room identifier of the chat messages.
For the device embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, refer to the partial description of the method embodiment.
An embodiment of the present invention further provides an electronic device, including:
one or more processors; and
one or more machine-readable media having instructions stored thereon, which when executed by the one or more processors, cause the electronic device to perform steps of a method as described by embodiments of the invention.
Embodiments of the present invention also provide a computer-readable storage medium having stored thereon instructions, which, when executed by one or more processors, cause the processors to perform the steps of the method according to embodiments of the present invention.
The embodiments in the present specification are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, apparatus, or computer program product. Accordingly, embodiments of the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
Embodiments of the present invention are described with reference to flowchart illustrations and/or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing terminal to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing terminal to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing terminal to cause a series of operational steps to be performed on the computer or other programmable terminal to produce a computer implemented process such that the instructions which execute on the computer or other programmable terminal provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications of these embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the embodiments of the invention.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or terminal that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or terminal. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or terminal that comprises the element.
The data processing method of the chat room process and the data processing device of the chat room process provided by the invention are introduced in detail, and the specific examples are applied in the text to explain the principle and the implementation mode of the invention, and the description of the above embodiments is only used for helping to understand the method and the core idea of the invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (12)

1. A method of data processing for a chat room process, the chat room process having a corresponding load value, the method comprising:
establishing a plurality of groups of service processes for running a distributed consistency protocol; the multiple groups of service processes comprise a distributed coordination service process group, a central service process group, a chat service process group and a gateway service process group;
monitoring the load value stored by the distributed coordination service process group by adopting the central service process group, and generating a chat room establishing request when the stored load value meets a preset condition;
adopting the chat service process group to respond to the chat room establishing request to establish a chat room process;
and when the gateway service process group receives a registration request, determining a target chat room process according to the stored load value.
2. The method of claim 1, further comprising:
and detecting the real-time load value of the chat room process by adopting the chat service process group, and updating the load value stored by the distributed coordination service process group when the real-time load value exceeds a first preset threshold value.
3. The method of claim 1, wherein the registration request carries a user identity, the method further comprising:
and extracting the user identification in the chat room process by adopting the chat service process group, and adding the user corresponding to the user identification into the target chat room process.
4. The method of claim 1, wherein said employing the gateway service process group to determine a target chat room process based on the stored load value upon receiving a registration request comprises:
and when the gateway service process group receives a registration request, increasing the stored load value to generate an intermediate value, and determining the chat room process of which the intermediate value does not exceed a second preset threshold value as a target chat room process.
5. The method of claim 1, further comprising:
and receiving the chat message by adopting the gateway service process group, and broadcasting the chat message to the chat room process corresponding to the chat room identifier of the chat message.
6. A data processing system for a chat room process, the chat room process having a corresponding load value, comprising:
the process creation module is used for creating a plurality of groups of service processes for operating the distributed consistency protocol; the multiple groups of service processes comprise a distributed coordination service process group, a central service process group, a chat service process group and a gateway service process group;
the chat room creation request generation module is used for monitoring the load value stored by the distributed coordination service process group by adopting the central service process group and generating a chat room creation request when the stored load value meets a preset condition;
a chat room process creating module for creating a chat room process by adopting the chat service process group to respond to the chat room creating request;
and the target chat room process determining module is used for determining the target chat room process according to the stored load value when the gateway service process group receives the registration request.
7. The system of claim 6, further comprising:
and the load value updating module is used for detecting the real-time load value of the chat room process by adopting the chat service process group, and updating the load value stored by the distributed coordination service process group when the real-time load value exceeds a first preset threshold value.
8. The system of claim 6, wherein the registration request carries a user identifier, further comprising:
and the user adding module is used for extracting the user identification in the chat room process by adopting the chat service process group and adding the user corresponding to the user identification into the target chat room process.
9. The system of claim 6, wherein said target chat room schedule determination module comprises:
and the target chat room process determining submodule is used for increasing the stored load value to generate an intermediate value when the gateway service process group receives a registration request, and determining the chat room process of which the intermediate value does not exceed a second preset threshold value as the target chat room process.
10. The system of claim 6, further comprising:
and the chat message broadcasting module is used for receiving the chat messages by adopting the gateway service process group and broadcasting the chat messages to the chat room process corresponding to the chat room identifier of the chat messages.
11. An electronic device, comprising:
one or more processors; and
one or more machine readable media having instructions stored thereon, which when executed by the one or more processors, cause the electronic device to perform the steps of the method of one or more of claims 1-5.
12. A computer-readable storage medium having stored thereon instructions, which, when executed by one or more processors, cause the processors to perform the steps of the method of one or more of claims 1-5.
CN201910996327.1A 2019-10-18 2019-10-18 Data processing method and system for chat room process Active CN110620673B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910996327.1A CN110620673B (en) 2019-10-18 2019-10-18 Data processing method and system for chat room process

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910996327.1A CN110620673B (en) 2019-10-18 2019-10-18 Data processing method and system for chat room process

Publications (2)

Publication Number Publication Date
CN110620673A true CN110620673A (en) 2019-12-27
CN110620673B CN110620673B (en) 2022-03-22

Family

ID=68926006

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910996327.1A Active CN110620673B (en) 2019-10-18 2019-10-18 Data processing method and system for chat room process

Country Status (1)

Country Link
CN (1) CN110620673B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111249747A (en) * 2020-01-20 2020-06-09 网易(杭州)网络有限公司 Information processing method and device in game

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1523844A (en) * 2003-02-20 2004-08-25 国际商业机器公司 Method and system for creating service instance in computational grid
CN101720063A (en) * 2009-12-02 2010-06-02 中兴通讯股份有限公司 Group creating method and device and chat room function implementing method and system
CN104243537A (en) * 2013-06-24 2014-12-24 中国银联股份有限公司 Automatic retractable method and system used under cloud computing environment
US20170206111A1 (en) * 2016-01-15 2017-07-20 Qualcomm Innovation Center, Inc. Managing processing capacity provided to threads based upon load prediction
CN108696364A (en) * 2017-04-06 2018-10-23 北京云中融信网络科技有限公司 Request message processing method, chatroom message server and chat room system
CN108737240A (en) * 2017-04-18 2018-11-02 阿里巴巴集团控股有限公司 The method that the method, apparatus and group that chat group automatically creates create
CN108958882A (en) * 2018-06-06 2018-12-07 麒麟合盛网络技术股份有限公司 A kind of container method of adjustment, device and system

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1523844A (en) * 2003-02-20 2004-08-25 国际商业机器公司 Method and system for creating service instance in computational grid
KR100826837B1 (en) * 2003-02-20 2008-05-06 인터내셔널 비지네스 머신즈 코포레이션 Grid service scheduling of related services using heuristics
CN101720063A (en) * 2009-12-02 2010-06-02 中兴通讯股份有限公司 Group creating method and device and chat room function implementing method and system
CN104243537A (en) * 2013-06-24 2014-12-24 中国银联股份有限公司 Automatic retractable method and system used under cloud computing environment
US20170206111A1 (en) * 2016-01-15 2017-07-20 Qualcomm Innovation Center, Inc. Managing processing capacity provided to threads based upon load prediction
CN108696364A (en) * 2017-04-06 2018-10-23 北京云中融信网络科技有限公司 Request message processing method, chatroom message server and chat room system
CN108737240A (en) * 2017-04-18 2018-11-02 阿里巴巴集团控股有限公司 The method that the method, apparatus and group that chat group automatically creates create
CN108958882A (en) * 2018-06-06 2018-12-07 麒麟合盛网络技术股份有限公司 A kind of container method of adjustment, device and system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
郭海军等: "基于C#的聊天室设计", 《电脑迷》 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111249747A (en) * 2020-01-20 2020-06-09 网易(杭州)网络有限公司 Information processing method and device in game
CN111249747B (en) * 2020-01-20 2023-05-09 网易(杭州)网络有限公司 Information processing method and device in game

Also Published As

Publication number Publication date
CN110620673B (en) 2022-03-22

Similar Documents

Publication Publication Date Title
US8838703B2 (en) Method and system for message processing
US9854027B2 (en) Providing clients access to a server service using an OPC unified architecture (OPC-UA)
US7937442B2 (en) Multipoint control unit (MCU) failure detection and rollover
CN100389392C (en) Method for realizing load uniform in clustering system, system and storage controller
CN108810100A (en) A kind of electoral machinery of host node, device and equipment
JP2002500785A (en) Load balancing and failover of network services
JP2008519477A (en) Method and system for monitoring server events in a node configuration by using direct communication between servers
JP4459999B2 (en) Non-stop service system using voting and information updating and providing method in the system
CN103259740A (en) Load balancing processing method and device
CN110620673B (en) Data processing method and system for chat room process
CN103812685B (en) Online statistics system and statistical method simultaneously
CN107483310B (en) Method and system for networking between terminal and forwarding node
US8909666B2 (en) Data query system and constructing method thereof and corresponding data query method
CN112423145B (en) Data processing method, device, system, server and medium
CN109413117B (en) Distributed data calculation method, device, server and computer storage medium
CN104079663B (en) The method of distributed real time synchronization network system and its notification data
CN103703745A (en) Method and apparatus for interconnecting a user agent to a cluster of servers
EP2692185A1 (en) Method and arrangement for providing update notifications in a telecommunication network
CN108093147B (en) Distributed multi-stage scheduling method and equipment
EP3424182A1 (en) Neighbor monitoring in a hyperscaled environment
CN105933131B (en) Multimedia Task processing method and processing device
CN113398570B (en) Server grouping method, device, storage medium and server cluster
CN113824776A (en) Automatic network request distribution method and system
CN116074319A (en) SDN controller load balancing method and system and SDN controller
CN117793108A (en) Large-scale cloud server cluster management method and device

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