CN112436997A - Chat room message distribution method, message distribution system and electronic equipment - Google Patents

Chat room message distribution method, message distribution system and electronic equipment Download PDF

Info

Publication number
CN112436997A
CN112436997A CN202011250536.0A CN202011250536A CN112436997A CN 112436997 A CN112436997 A CN 112436997A CN 202011250536 A CN202011250536 A CN 202011250536A CN 112436997 A CN112436997 A CN 112436997A
Authority
CN
China
Prior art keywords
server
message
client
sending
access
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
CN202011250536.0A
Other languages
Chinese (zh)
Other versions
CN112436997B (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.)
Hangzhou Miluoxing Technology Group Co ltd
Original Assignee
Hangzhou Miluoxing Technology Group 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 Hangzhou Miluoxing Technology Group Co ltd filed Critical Hangzhou Miluoxing Technology Group Co ltd
Priority to CN202011250536.0A priority Critical patent/CN112436997B/en
Publication of CN112436997A publication Critical patent/CN112436997A/en
Application granted granted Critical
Publication of CN112436997B publication Critical patent/CN112436997B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L51/00User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail
    • H04L51/04Real-time or near real-time messaging, e.g. instant messaging [IM]
    • 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
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for authentication of entities
    • H04L63/0807Network architectures or network communication protocols for network security for authentication of entities using tickets, e.g. Kerberos

Abstract

The invention provides a message distribution method, a message distribution system and electronic equipment of a chat room, wherein the method is applied to the message distribution system, and the message distribution system comprises a plurality of access servers, a logic server, at least one message queue server and a plurality of task servers; the method comprises the following steps: sending the received message input by the client to a logic server through an access server accessed by the client; the message carries an identifier, and the identifier comprises a server identity corresponding to an access server accessed by a client receiving the message; sending, by the logical server, the message to at least one message queue server; sending a message to at least one task server through a message queue server; and distributing the received message to an access server corresponding to the identifier through the task server so that the access server sends the message to the target client. The invention can avoid the problem of message distribution failure when the data volume is too large.

Description

Chat room message distribution method, message distribution system and electronic equipment
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a method, a system, and an electronic device for distributing messages in a chat room.
Background
With the rapid development of internet technology, chat rooms are widely used in leisure, recreation and work at ordinary times as a new communication mode. For a live chat room, each time a user sends a message, the message is distributed to other users in the chat room through the server. In the prior art, a client generally uploads a message (carrying an identifier) to a hub (multi-port repeater) server correspondingly connected to an access server through the access server, the hub server sends the message to a logic server, the logic server receives the message, and then sends the message to a corresponding hub server according to the identifier carried by the message, and finally the corresponding hub server sends the message to an access server corresponding to a target client. However, when the message distribution is performed in the above manner, if the data amount is too large, for example, the capacity of the hub server is exceeded, the message distribution may fail.
Disclosure of Invention
In view of the above, an object of the present invention is to provide a method, a system and an electronic device for distributing messages in a chat room, so as to avoid the problem of failure in message distribution when the data size is too large.
In order to achieve the above purpose, the embodiment of the present invention adopts the following technical solutions:
in a first aspect, an embodiment of the present invention provides a method for distributing messages in a chat room, where the method is applied to a message distribution system, and the message distribution system includes multiple access servers, a logic server, at least one message queue server, and multiple task servers; the method comprises the following steps: sending the received message input by the client to a logic server through an access server accessed by the client; the message carries an identifier, and the identifier comprises a server identity corresponding to an access server accessed by a client receiving the message; sending, by the logical server, the message to at least one message queue server; sending a message to at least one task server through a message queue server; and distributing the received message to an access server corresponding to the identifier through the task server so that the access server sends the message to the target client.
In one embodiment, the method further comprises: when a client logs in a live broadcast room, a session identifier is generated through a logic server; the session identifier includes a key of the client and a server identity of an access server accessed by the client.
In one embodiment, the step of sending the received message input by the client to the logic server through the access server accessed by the client comprises: and sending the received message input by the client to the logic server according to a preset distribution strategy through an access server accessed by the client.
In one embodiment, the step of sending the message to at least one message queue server by the logical server comprises: determining at least one target message queue server for receiving messages and a message storage mode according to preset logic of the message queue server; the storage mode comprises random storage and/or storage according to the sending time sequence of the message; and sending the message to a target message queue server through the logic server, and storing the message according to the storage mode.
In one embodiment, the step of sending a message to at least one task server via a message queue server comprises: and distributing the message to at least one task server through the target message queue server according to a preset distribution strategy according to the number of the task servers acquired by the target message queue server.
In one embodiment, the method further comprises: when a client logs in a live broadcast room, a token of the client is sent to a logic server; the token is sent to the client by the Java server when the user registers; and calling a remote procedure call protocol interface through the logic server to search whether the token exists in the Java server, and if so, checking that the client is allowed to log in the live broadcast room.
In one embodiment, the preset distribution policy includes one or more of the following: a weighted polling strategy, a weighted random strategy, a consistent hashing strategy and a minimum connection number lamp strategy.
In a second aspect, an embodiment of the present invention provides a message distribution system, including multiple access servers, a logic server, at least one message queue server, and multiple task servers; the access server is used for sending the received message input by the client to the logic server; the message carries an identifier, and the identifier comprises a server identity corresponding to an access server accessed by a client receiving the message; the logic server is used for sending the message to at least one message queue server; the message queue server is used for sending messages to at least one task server; and the task server is used for distributing the received message to the access server corresponding to the identifier so that the access server sends the message to the target client.
In a third aspect, an embodiment of the present invention provides an electronic device, which includes a processor and a memory, where the memory stores computer-executable instructions capable of being executed by the processor, and the processor executes the computer-executable instructions to implement the steps of any one of the methods provided in the first aspect.
In a fourth aspect, the present invention provides a computer-readable storage medium, on which a computer program is stored, where the computer program is executed by a processor to perform the steps of any one of the methods provided in the first aspect.
The embodiment of the invention has the following beneficial effects:
the message distribution method, the message distribution system and the electronic equipment of the chat room provided by the embodiment of the invention are applied to the message distribution system, wherein the message distribution system comprises a plurality of access servers, a logic server, at least one message queue server and a plurality of task servers; the method comprises the following steps: firstly, sending a received message (carrying an identifier which comprises a server identity corresponding to an access server accessed by a client for receiving the message) input by the client to a logic server through the access server accessed by the client; then sending the message to at least one message queue server through the logic server; then sending the message to at least one task server through a message queue server; and finally, the received message is distributed to a target access server corresponding to the identifier through the task server, so that the target access server sends the message to the target client. The method can store the messages in the chat room in the plurality of message queue servers and then distribute the messages to the corresponding target access servers through the task server, and the method distributes the messages through the plurality of message queue servers and the task server, so that the problem of message distribution failure when the data volume is too large can be avoided, and the message distribution efficiency is improved.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
In order to make the aforementioned and other objects, features and advantages of the present invention comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts.
Fig. 1 is a flowchart of a method for distributing messages in a chat room according to an embodiment of the present invention;
fig. 2 is a schematic diagram of message distribution of a chat room according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of a message distribution system according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
To make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is apparent that the described embodiments are some, but not all embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
At present, a client uploads a message (carrying an identifier, such as broadcast or unicast, and a unicast object) to a hub server correspondingly connected to an access server through the access server, the hub server sends the message to a logic server, the logic server sends the message to a corresponding hub server according to the identifier carried by the message after receiving the message (the unicast is sent to the hub server and the access server corresponding to the unicast, and the broadcast is sent to all the hub servers), and finally the corresponding hub server sends the message to the access server accessed by a target client. However, when the message distribution is performed in the above manner, if the data amount is too large, for example, the capacity of the hub server is exceeded, the message distribution may fail.
Based on this, the message distribution method, the message distribution system and the electronic device in the chat room provided by the embodiments of the present invention can avoid the problem of message distribution failure when the data volume is too large.
To facilitate understanding of the embodiment, first, a detailed description is given of a message distribution method for a chat room disclosed in the embodiment of the present invention, where the method can be applied to a message distribution system, where the message distribution system includes a plurality of access servers, a logic server, at least one message queue server, and a plurality of task servers. Referring to the flowchart of a method for distributing messages in a chat room shown in fig. 1, it is shown that the method mainly includes the following steps S102 to S108:
step S102: and sending the received message input by the client to the logic server through the access server accessed by the client.
The message carries an identifier, and the identifier comprises a server identity corresponding to an access server accessed by a client receiving the message. In a specific implementation manner, after a client enters a live broadcast room, a user client can send messages to chat and exchange with other users in a chat room of the live broadcast room, and a user can adopt a broadcast or unicast mode, wherein broadcast is to send messages to all users in the chat room, and unicast is to send messages to a specified user. Specifically, a user may input a message to be sent through a client, where the message carries an identifier, such as a server identity (server id) corresponding to an access server accessed by the client that receives the message, and if the message is broadcast, the identifier may be a server id corresponding to all access servers accessed by the clients that receive the message; if unicast, the identification may be the server ID corresponding to the access server accessed by the specified client receiving the message. After a user inputs a message through a client, the message can be sent to a logic server through an access server accessed by the client, and the logic server distributes subsequent messages.
Step S104: the message is sent to at least one message queue server by the logical server.
In an implementation manner, the message distribution system provided by the embodiment of the present invention includes at least one message queue server, and each message queue server may receive and store a message. Specifically, when the message queue server includes a plurality of message queue servers, which message queue service or services to store a message may be determined according to SDK (Software Development Kit) logic of different message queue servers. Based on this, in the embodiment of the present invention, after the logical server receives the message, the corresponding message queue server (one or more) may be determined first, and then the logical server may send the message to the corresponding message queue server.
Step S106: the message is sent to the at least one task server through the message queue server.
In a specific implementation manner, the task server and the message queue server may perform request interaction in real time, the message queue server may send a data transmission request to the plurality of task servers, the task server may send response information to the message queue according to its own state after receiving the request, and the message queue server may send a message to a corresponding task server according to the received response information.
Step S108: and distributing the received message to the access server corresponding to the identifier through the task server so that the target access server sends the message to the target client.
In an embodiment, after receiving a message, a task server may parse an identifier carried in the message, determine a target access server corresponding to the identifier (i.e., an access server accessed by a client that receives the message), and then send the message to the corresponding target access server. Because the message distribution system provided by the embodiment of the invention comprises a plurality of access servers, different clients can be accessed to different access servers when logging in a live broadcast room, and can also be accessed to the same access server, the target access server can be the same server as the access server accessed by the client sending the message, and can also be different servers. Specifically, the corresponding target access server may be searched according to the server id in the identifier, then the task server may send the message to the searched target access server, and after receiving the message, the target access server may send the message to the target client (i.e., the client that receives the message), where the target client is all clients in the chat room when the message is broadcast, and the target client is the designated client when the message is unicast.
The message distribution method of the chat room provided by the embodiment of the invention can store the messages in the chat room in the plurality of message queue servers, and then distribute the messages to the corresponding target access servers through the task server.
Considering that there are many users in the chat room, lawless persons or other users who do not belong to the chat room can enter the chat room to affect the normal chat order, and in order to ensure the normal chat order and the user security, the validity of the client needs to be checked when logging in the live broadcast room. Based on this, the method provided by the embodiment of the present invention further includes: when a client logs in a live broadcast room, a token of the client is sent to a logic server; the token is sent to the client by the Java server when the user registers; and calling a remote procedure call protocol interface through the logic server to search whether the token exists in the Java server, and if so, checking that the client is allowed to log in the live broadcast room.
In one embodiment, a user needs to register an account before logging in a live broadcast room, and during registration, a Java server (i.e., a server for platform registration) may send a token (token) to a client, where the token may be used as an identity credential for the user to log in the live broadcast room through the client. Therefore, in this embodiment, when the client logs in the live broadcast room (that is, the client clicks the live broadcast room to be entered), the token of the client may be sent to the logic server, the logic server may search whether the token exists in the Java server by calling a Remote Procedure Call (RPC) interface, and if the token exists, the client is allowed to log in the live broadcast room after verification.
Further, in order to distinguish different clients, the method provided in this embodiment further includes: when a client logs in a live broadcast room, a session identifier is generated through a logic server; the session identifier includes a key of the client and a server identity of an access server accessed by the client. Specifically, when each client logs in the live broadcast room, the logic server generates a session identifier (session) including a unique key (key) of the client and a server id corresponding to an access server accessed by the client. Therefore, when the client sends the message, the client receiving the message can be determined according to the session identification of each client, so that the message can be accurately sent to the corresponding client.
For the step S102, the embodiment of the present invention further provides a specific implementation manner, that is, sending the received message input by the client to the logic server through the access server accessed by the client may be implemented as follows: and sending the received message input by the client to the logic server according to a preset distribution strategy through an access server accessed by the client. In one embodiment, the preset distribution policy includes one or more of the following: a weighted polling strategy, a weighted random strategy, a consistent hashing strategy and a minimum connection number lamp strategy.
Further, for convenience of understanding, an embodiment of the present invention further provides a specific implementation manner for sending a message to at least one message queue server through a logical server, that is, for the step S104, the following steps 1 to 2 may be implemented:
step 1: and determining at least one target message queue server for receiving the message and a message storage mode according to the preset logic of the message queue server.
The storage mode comprises random storage and/or storage according to the sending time sequence of the messages. In one embodiment, after receiving a message, a logic server needs to send the received message to a message queue server for storage, and when only one message queue server exists in a system, the logic server can send the message to the message queue server for storage; when a plurality of message queue servers exist in the system, it is necessary to determine which message queue server or servers the message is stored in, and specifically, the determination may be performed according to preset logic (such as SDK logic) of different message queue servers, and the finally selected message queue server is determined as the target message queue server. In addition, the storage mode is determined according to the SDK logic of different message queue servers, and the storage mode can be random storage and/or storage according to the sending time sequence of the messages.
Step 2: and sending the message to a target message queue server through the logic server, and storing the message according to the storage mode.
After the target message queue server is determined, the logic server may send the received message to the corresponding message queue server for storage.
Further, for the step S106, that is, the step of sending the message to the at least one task server through the message queue server, the method includes: and distributing the message to at least one task server through the target message queue server according to a preset distribution strategy according to the number of the task servers acquired by the target message queue server.
In one embodiment, request interaction (such as pub/sub publish/subscribe and the like) can be carried out between the message queue server and the task server in real time. The target message queue server can acquire the number of the task servers, after receiving the message, the target message queue server can also send a data transmission request to the task server, the task server can determine whether the data transmission request corresponds to the data transmission request according to the self state of the task server, and if so, the task server sends response information to the target message queue server; the target message queue server can send the stored message to the task server corresponding to the response message according to the received response message and a preset distribution strategy. Specifically, the preset distribution policy includes one or more of the following: a weighted polling strategy, a weighted random strategy, a consistent hashing strategy and a minimum connection number lamp strategy.
For convenience of understanding, an embodiment of the present invention further provides a schematic diagram of message distribution of a chat room, and referring to the schematic diagram of message distribution of a chat room shown in fig. 2, it is shown that the method mainly includes: after a client logs in a live broadcast room, a message (carrying an identifier) is sent to a logic server through an access server according to a distribution strategy; the logic server sends the message to a message queue server; the message queue server sends the message to the corresponding task server according to the number of the acquired task servers and a distribution strategy, the task server receiving the message sends the message to the corresponding access server according to the identification of the message (mainly comprising the ServerID corresponding to the access server accessed by the client receiving the message, such as the ServerID corresponding to the access server accessed by all the clients in broadcast, and the ServerID corresponding to the access server accessed by the appointed client in unicast), and the access server finally sends the message to the target client.
In summary, in the message distribution method for the chat room provided in the embodiments of the present invention, the plurality of task servers and the message queue server replace the hub server, the message in the chat room is stored in the plurality of message queue servers, and then the task server distributes the message to the corresponding target access server, so that the problem of message distribution failure when the data size is too large can be avoided, and the message distribution efficiency is improved.
For the message distribution method of the chat room provided in the foregoing embodiment, an embodiment of the present invention further provides a message distribution system, referring to a schematic structural diagram of a message distribution system shown in fig. 3, where the system may include the following components: a plurality of access servers 301, a logical server 302, a plurality of message queue servers 303, and a plurality of task servers 304.
The access server 301 is used for sending the received message input by the client to the logic server 302; the message carries an identifier, and the identifier comprises a server identity corresponding to an access server accessed by a client receiving the message.
The logical server 302 is configured to send messages to at least one message queue server 303.
The message queue server 303 is used to send messages to at least one task server 304.
The task server 304 is configured to distribute the received message to the corresponding access server, so that the access server sends the message to the target client.
The message distribution system provided by the embodiment of the invention can store the messages in the chat room in the plurality of message queue servers, and then distribute the messages to the corresponding target access servers through the task server.
In one embodiment, the logic server 302 is further configured to generate a session identifier when the client logs into the live broadcast room; the session identifier includes a key of the client and a server identity of an access server accessed by the client.
In one embodiment, the access server 301 is further configured to send the received message input by the client to the logical server 302 according to a preset distribution policy. The preset distribution policy includes one or more of the following: a weighted polling strategy, a weighted random strategy, a consistent hashing strategy and a minimum connection number lamp strategy.
In one embodiment, the logic server 302 is further configured to determine at least one target message queue server for receiving the message and a storage manner of the message according to a preset logic of the message queue server 303; the storage mode comprises random storage and/or storage according to the sending time sequence of the message; and sending the message to a target message queue server, and storing the message according to the storage mode.
In an embodiment, the message queue server 303 is further configured to distribute the message to at least one task server 304 according to a preset distribution policy according to the number of the acquired task servers 304. The preset distribution policy includes one or more of the following: a weighted polling strategy, a weighted random strategy, a consistent hashing strategy and a minimum connection number lamp strategy.
In one embodiment, the logic server 302 is further configured to receive a token of the client when the client logs into the live broadcast room; the token is sent to the client by the Java server when the user registers; and calling a remote procedure call protocol to search whether the token exists in the Java server, and if so, checking that the client is allowed to log in the live broadcast room.
The system provided by the embodiment of the present invention has the same implementation principle and technical effect as the foregoing method embodiment, and for the sake of brief description, no mention is made in the system embodiment, and reference may be made to the corresponding contents in the foregoing method embodiment.
The embodiment of the invention also provides electronic equipment, which specifically comprises a processor and a storage device; the storage means has stored thereon a computer program which, when executed by the processor, performs the method of any of the above embodiments.
Fig. 4 is a schematic structural diagram of an electronic device 100 according to an embodiment of the present invention, where the electronic device 100 includes: a processor 40, a memory 41, a bus 42 and a communication interface 43, wherein the processor 40, the communication interface 43 and the memory 41 are connected through the bus 42; the processor 40 is arranged to execute executable modules, such as computer programs, stored in the memory 41.
The Memory 41 may include a high-speed Random Access Memory (RAM) and may also include a non-volatile Memory (non-volatile Memory), such as at least one disk Memory. The communication connection between the network element of the system and at least one other network element is realized through at least one communication interface 43 (which may be wired or wireless), and the internet, a wide area network, a local network, a metropolitan area network, etc. may be used.
The bus 42 may be an ISA bus, PCI bus, EISA bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one double-headed arrow is shown in FIG. 4, but that does not indicate only one bus or one type of bus.
The memory 41 is used for storing a program, the processor 40 executes the program after receiving an execution instruction, and the method executed by the apparatus defined by the flow disclosed in any of the foregoing embodiments of the present invention may be applied to the processor 40, or implemented by the processor 40.
The processor 40 may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware or instructions in the form of software in the processor 40. The Processor 40 may be a general-purpose Processor including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field-Programmable Gate arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components. The various methods, steps and logic blocks disclosed in the embodiments of the present invention may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of the method disclosed in connection with the embodiments of the present invention may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software module may be located in ram, flash memory, rom, prom, or eprom, registers, etc. storage media as is well known in the art. The storage medium is located in a memory 41, and the processor 40 reads the information in the memory 41 and completes the steps of the method in combination with the hardware thereof.
The computer program product of the readable storage medium provided in the embodiment of the present invention includes a computer readable storage medium storing a program code, where instructions included in the program code may be used to execute the method described in the foregoing method embodiment, and specific implementation may refer to the foregoing method embodiment, which is not described herein again.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
Finally, it should be noted that: the above-mentioned embodiments are only specific embodiments of the present invention, which are used for illustrating the technical solutions of the present invention and not for limiting the same, and the protection scope of the present invention is not limited thereto, although the present invention is described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: any person skilled in the art can modify or easily conceive the technical solutions described in the foregoing embodiments or equivalent substitutes for some technical features within the technical scope of the present disclosure; such modifications, changes or substitutions do not depart from the spirit and scope of the embodiments of the present invention, and they should be construed as being included therein. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (10)

1. A message distribution method of a chat room is applied to a message distribution system, wherein the message distribution system comprises a plurality of access servers, a logic server, at least one message queue server and a plurality of task servers; it is characterized by comprising:
sending the received message input by the client to the logic server through the access server accessed by the client; the message carries an identifier, and the identifier comprises a server identity corresponding to the access server accessed by the client receiving the message;
sending, by the logical server, the message to at least one of the message queue servers;
sending the message to at least one of the task servers through the message queue server;
and the received message is distributed to the access server corresponding to the identifier through the task server, so that the access server sends the message to a target client.
2. The method of claim 1, further comprising:
when the client logs in a live broadcast room, a session identifier is generated through the logic server; wherein the session identifier includes a key of the client and a server identity of the access server to which the client accesses.
3. The method of claim 1, wherein the step of sending the received message input by the client to the logical server via the access server accessed by the client comprises:
and sending the received message input by the client to the logic server according to a preset distribution strategy through the access server accessed by the client.
4. The method of claim 1, wherein the step of sending the message to at least one of the message queue servers via the logical server comprises:
determining at least one target message queue server for receiving the message and a storage mode of the message according to preset logic of the message queue server; wherein, the storage mode comprises random storage and/or storage according to the sending time sequence of the message;
and sending the message to the target message queue server through the logic server, and storing the message according to the storage mode.
5. The method of claim 4, wherein said step of sending said message to at least one of said task servers via said message queue server comprises:
and distributing the message to at least one task server through the target message queue server according to a preset distribution strategy according to the number of the task servers acquired by the target message queue server.
6. The method of claim 1, further comprising:
when the client logs in a live broadcast room, the token of the client is sent to the logic server; wherein the token is sent to the client by a Java server upon user registration;
and calling a remote procedure call protocol interface through the logic server to search whether the token exists in the Java server, and if so, checking that the client is allowed to log in a live broadcast room.
7. The method of claim 5, wherein the preset distribution policy comprises one or more of: a weighted polling strategy, a weighted random strategy, a consistent hashing strategy and a minimum connection number lamp strategy.
8. A message distribution system comprising a plurality of access servers, a logical server, at least one message queue server, and a plurality of task servers;
the access server is used for sending the received message input by the client to the logic server; the message carries an identifier, and the identifier comprises a server identity corresponding to the access server accessed by the client receiving the message;
the logic server is used for sending the message to at least one message queue server;
the message queue server is used for sending the message to at least one task server;
the task server is used for distributing the received message to the access server corresponding to the identifier, so that the access server sends the message to a target client.
9. An electronic device comprising a processor and a memory, the memory storing computer-executable instructions executable by the processor, the processor executing the computer-executable instructions to perform the steps of the method of any one of claims 1 to 7.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method according to any one of the claims 1 to 7.
CN202011250536.0A 2020-11-10 2020-11-10 Chat room message distribution method, message distribution system and electronic equipment Active CN112436997B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011250536.0A CN112436997B (en) 2020-11-10 2020-11-10 Chat room message distribution method, message distribution system and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011250536.0A CN112436997B (en) 2020-11-10 2020-11-10 Chat room message distribution method, message distribution system and electronic equipment

Publications (2)

Publication Number Publication Date
CN112436997A true CN112436997A (en) 2021-03-02
CN112436997B CN112436997B (en) 2023-03-03

Family

ID=74699705

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011250536.0A Active CN112436997B (en) 2020-11-10 2020-11-10 Chat room message distribution method, message distribution system and electronic equipment

Country Status (1)

Country Link
CN (1) CN112436997B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113259225A (en) * 2021-05-13 2021-08-13 杭州米络星科技(集团)有限公司 Instant messaging method, server and instant messaging system
CN113839853A (en) * 2021-08-24 2021-12-24 云智联网络科技(北京)有限公司 High-concurrency chat room message distribution method and device
CN115022110A (en) * 2022-08-08 2022-09-06 广州市千钧网络科技有限公司 Message distribution method, readable medium and electronic device
CN115297154A (en) * 2022-08-04 2022-11-04 中国工商银行股份有限公司 Instant messaging method, system, device, processor and electronic equipment

Citations (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070016643A1 (en) * 2005-07-14 2007-01-18 International Business Machines Corporation Active session queue management using contextual systems with an instant messaging proxy service
CN101373474A (en) * 2008-09-02 2009-02-25 北京开拓天际信息技术有限公司 Magnanimity data real time processing structure and real time processing platform following with necessaries for the same
US7685236B1 (en) * 2003-09-24 2010-03-23 Google Inc. Methods and systems for developing an instant messaging network
CN105472400A (en) * 2015-12-24 2016-04-06 Tcl集团股份有限公司 Message pushing method and system
US20170041259A1 (en) * 2014-04-22 2017-02-09 Tencent Technology (Shenzhen) Company Limited Instant message processing method, apparatus, and system
US9591083B1 (en) * 2005-11-23 2017-03-07 Avaya Inc. Method and apparatus providing connection recovery for a chat client
CN106533932A (en) * 2017-01-17 2017-03-22 百度在线网络技术(北京)有限公司 Method and device for pushing instant message
CN106961385A (en) * 2017-03-15 2017-07-18 腾讯科技(深圳)有限公司 The implementation method and device of real-time voice in virtual scene interaction
CN108174305A (en) * 2016-12-07 2018-06-15 北京云中融信网络科技有限公司 The message treatment method and device of chatroom is broadcast live
WO2018137521A1 (en) * 2017-01-25 2018-08-02 腾讯科技(深圳)有限公司 Method for realizing live voice broadcast in virtual scene interaction client, device and storage medium
WO2018145538A1 (en) * 2017-02-13 2018-08-16 北京奇虎科技有限公司 Message processing method and device for live broadcast platform
CN108696364A (en) * 2017-04-06 2018-10-23 北京云中融信网络科技有限公司 Request message processing method, chatroom message server and chat room system
CN110445882A (en) * 2019-09-19 2019-11-12 腾讯科技(深圳)有限公司 Communication connecting method, device, computer equipment and storage medium
CN111130990A (en) * 2019-11-22 2020-05-08 李子乾 Mobile comprehensive office system
CN111277847A (en) * 2020-01-21 2020-06-12 香港乐蜜有限公司 Method, device, server and system for displaying chat messages in live broadcast
CN111464824A (en) * 2020-04-03 2020-07-28 北京达佳互联信息技术有限公司 Message sending method and system, server and storage medium
CN111541555A (en) * 2020-03-24 2020-08-14 中国平安人寿保险股份有限公司 Group chat optimization method and related product

Patent Citations (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7685236B1 (en) * 2003-09-24 2010-03-23 Google Inc. Methods and systems for developing an instant messaging network
US20070016643A1 (en) * 2005-07-14 2007-01-18 International Business Machines Corporation Active session queue management using contextual systems with an instant messaging proxy service
US9591083B1 (en) * 2005-11-23 2017-03-07 Avaya Inc. Method and apparatus providing connection recovery for a chat client
CN101373474A (en) * 2008-09-02 2009-02-25 北京开拓天际信息技术有限公司 Magnanimity data real time processing structure and real time processing platform following with necessaries for the same
US20170041259A1 (en) * 2014-04-22 2017-02-09 Tencent Technology (Shenzhen) Company Limited Instant message processing method, apparatus, and system
CN105472400A (en) * 2015-12-24 2016-04-06 Tcl集团股份有限公司 Message pushing method and system
CN108174305A (en) * 2016-12-07 2018-06-15 北京云中融信网络科技有限公司 The message treatment method and device of chatroom is broadcast live
CN106533932A (en) * 2017-01-17 2017-03-22 百度在线网络技术(北京)有限公司 Method and device for pushing instant message
WO2018137521A1 (en) * 2017-01-25 2018-08-02 腾讯科技(深圳)有限公司 Method for realizing live voice broadcast in virtual scene interaction client, device and storage medium
WO2018145538A1 (en) * 2017-02-13 2018-08-16 北京奇虎科技有限公司 Message processing method and device for live broadcast platform
CN106961385A (en) * 2017-03-15 2017-07-18 腾讯科技(深圳)有限公司 The implementation method and device of real-time voice in virtual scene interaction
CN108696364A (en) * 2017-04-06 2018-10-23 北京云中融信网络科技有限公司 Request message processing method, chatroom message server and chat room system
CN110445882A (en) * 2019-09-19 2019-11-12 腾讯科技(深圳)有限公司 Communication connecting method, device, computer equipment and storage medium
CN111130990A (en) * 2019-11-22 2020-05-08 李子乾 Mobile comprehensive office system
CN111277847A (en) * 2020-01-21 2020-06-12 香港乐蜜有限公司 Method, device, server and system for displaying chat messages in live broadcast
CN111541555A (en) * 2020-03-24 2020-08-14 中国平安人寿保险股份有限公司 Group chat optimization method and related product
CN111464824A (en) * 2020-04-03 2020-07-28 北京达佳互联信息技术有限公司 Message sending method and system, server and storage medium

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113259225A (en) * 2021-05-13 2021-08-13 杭州米络星科技(集团)有限公司 Instant messaging method, server and instant messaging system
CN113839853A (en) * 2021-08-24 2021-12-24 云智联网络科技(北京)有限公司 High-concurrency chat room message distribution method and device
CN115297154A (en) * 2022-08-04 2022-11-04 中国工商银行股份有限公司 Instant messaging method, system, device, processor and electronic equipment
CN115022110A (en) * 2022-08-08 2022-09-06 广州市千钧网络科技有限公司 Message distribution method, readable medium and electronic device

Also Published As

Publication number Publication date
CN112436997B (en) 2023-03-03

Similar Documents

Publication Publication Date Title
CN112436997B (en) Chat room message distribution method, message distribution system and electronic equipment
US11411897B2 (en) Communication method and communication apparatus for message queue telemetry transport
CN110830564B (en) CDN scheduling method, device, system and computer readable storage medium
CN110633442A (en) Pushing method and device and electronic equipment
CN111104664B (en) Risk identification method of electronic equipment and server
WO2021243666A1 (en) Information processing method and system, and device, medium, chip and program
CN110445615B (en) Network request security verification method, device, medium and electronic equipment
CN113014584A (en) Internet of things communication method and device, electronic equipment and storage medium
CN111367693B (en) Method, system, device and medium for scheduling plug-in tasks based on message queue
CN112019516B (en) Access control method, device, equipment and storage medium for shared file
CN113157466A (en) Message pushing method, device, system, electronic equipment and storage medium
CN110602056A (en) Service parameter transmission method and device
CN111541662B (en) Communication method based on binary communication protocol, electronic equipment and storage medium
CN112165445A (en) Method, device, storage medium and computer equipment for detecting network attack
CN104519069A (en) Method and device for intercepting resource requests
CN113596105B (en) Content acquisition method, edge node and computer readable storage medium
CN116595099A (en) Asynchronous processing method and device for high concurrency data
CN112769863B (en) Method and device for processing service request message data, electronic equipment and readable storage medium
US8881241B2 (en) Method of and system for implementing privacy control
CN102045323A (en) Method and device for processing information of uniform resource identifier (URI) indexes
WO2006059852A1 (en) Method and system for providing resources by using virtual path
CN112597118A (en) Method and device for adding shared file
CN112330366A (en) Redemption code redemption request verification method, apparatus, device and computer readable medium
CN113973236B (en) Anti-hotlinking method and device for video service, computing equipment and storage medium
CN113542439B (en) Distributed data storage access 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