CN112073207A - Method, device and computer equipment for reducing message bandwidth of chat room - Google Patents
Method, device and computer equipment for reducing message bandwidth of chat room Download PDFInfo
- Publication number
- CN112073207A CN112073207A CN202011275662.1A CN202011275662A CN112073207A CN 112073207 A CN112073207 A CN 112073207A CN 202011275662 A CN202011275662 A CN 202011275662A CN 112073207 A CN112073207 A CN 112073207A
- Authority
- CN
- China
- Prior art keywords
- message
- chat room
- queue
- threshold value
- event
- 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
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/02—Details
- H04L12/16—Arrangements for providing special services to substations
- H04L12/18—Arrangements for providing special services to substations for broadcast or conference, e.g. multicast
- H04L12/1813—Arrangements for providing special services to substations for broadcast or conference, e.g. multicast for computer conferences, e.g. chat rooms
- H04L12/1827—Network arrangements for conference optimisation or adaptation
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/02—Details
- H04L12/16—Arrangements for providing special services to substations
- H04L12/18—Arrangements for providing special services to substations for broadcast or conference, e.g. multicast
- H04L12/1813—Arrangements for providing special services to substations for broadcast or conference, e.g. multicast for computer conferences, e.g. chat rooms
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/04—Protocols for data compression, e.g. ROHC
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/16—Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
- H04L69/161—Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields
- H04L69/162—Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields involving adaptations of sockets based mechanisms
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- General Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Computer Security & Cryptography (AREA)
- Information Transfer Between Computers (AREA)
- Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)
Abstract
The invention discloses a method, a device and computer equipment for reducing message bandwidth of a chat room. Wherein the method comprises the following steps: the method comprises the steps of dynamically adjusting a message compression threshold value of a chat room in real time according to the message amount and the load condition of the chat room, simplifying all event field contents of the chat room after the message compression threshold value is adjusted, adding a message queue mechanism to message events with high frequency and instantaneity not reaching a preset threshold value in the chat room after all event field contents are simplified to form a channel list, adding the message queue mechanism to the message events with high frequency and not high instantaneity requirement, and dynamically modifying the queue threshold value of a queue in the channel list to control the instant message concurrency amount of a high-concurrency live broadcast scene of the chat room. By the mode, the bandwidth consumption of the high-concurrency live broadcast scene of the chat room can be reduced, so that the bandwidth stability of the chat room is guaranteed.
Description
Technical Field
The invention relates to the technical field of chat rooms, in particular to a method, a device and computer equipment for reducing message bandwidth of a chat room.
Background
Existing chat rooms often have high-concurrency live scenes, interactive messages of the high-concurrency live scenes can generate great bandwidth consumption, and a series of problems of the chat rooms are easily caused due to the great bandwidth consumption, such as timeout/failure of new links of the chat rooms, message interaction delay of the chat rooms, failure of sending interactive messages of the chat rooms, instability/unavailability of other functions of the chat rooms and the like.
However, the prior art cannot reduce the bandwidth consumption of the high-concurrency live scene of the chat room to ensure the stable bandwidth of the chat room.
Disclosure of Invention
In view of this, the present invention provides a method, an apparatus, and a computer device for reducing a chat room message bandwidth, which can reduce the bandwidth consumption of a high-concurrency live broadcast scenario of a chat room to ensure stable bandwidth of the chat room.
According to one aspect of the present invention, there is provided a method for reducing message bandwidth in a chat room, comprising: dynamically adjusting the message compression threshold of the chat room in real time according to the message amount and the load condition of the chat room; simplifying all event field contents of the chat room after the threshold value of the message compression is adjusted; and adding the message events with high frequency and instantaneity not reaching a preset threshold value into the chat room after the contents of all the event fields are simplified to form a channel list, and controlling the instantaneous message concurrency amount of the high-concurrency live broadcast scene of the chat room by dynamically modifying the queue threshold value of the queue in the channel list through adding the message events with high frequency and instantaneity not too high into the message queue mechanism.
Wherein, the dynamic adjustment of the message compression threshold value of the chat room according to the message amount and the load condition of the chat room in real time comprises: by adding a mode of dynamically modifying the message compression threshold value at the server end of the chat room, the message compression threshold value of the chat room is dynamically adjusted in real time according to the message amount and the load condition of the chat room.
Wherein, the reducing the content of all event fields of the chat room after the threshold value of the message compression is adjusted comprises: and simplifying all the event field contents of the chat room after the threshold value of the message compression is adjusted by a mode of reserving the main field contents of all the event field contents of the chat room.
The method for controlling the instantaneous message concurrence amount of the high-concurrency live broadcast scene of the chat room by dynamically modifying the queue threshold value of the queue in the channel list comprises the following steps: by judging whether the message type of the socket message received by the chat room is the preset type needing to enter the queue, when the message type of the socket message is the preset type needing to enter the queue, a channel list is formed by a message event adding message queue mechanism which adds the message with high frequency and real-time property not reaching a preset threshold value in the chat room after the contents of all event fields are reduced, when the message type of the socket message is not the preset type needing to enter the queue, whether the number of the online people of the chat room after the contents of all event fields are reduced exceeds the specified number of people is judged, if the number of the online people exceeds the specified number of people, the socket message is added into the message queue mechanism to form the channel list, the rooms corresponding to the chat room after the contents of all event fields are reduced are marked as the rooms needing to enter the queue, and an independent process is started, the system is in charge of the message queue, regularly checks whether the message queue has a value, if so, broadcasts the message and accumulates the number of the online people, if the number of the online people exceeds a preset value, stops broadcasting the message, enters a rest, finishes the rest and then enters a queue consumption mode to control the instantaneous message concurrence amount of the high-concurrence live broadcast scene of the chat room.
Wherein, after the message event joining message queue mechanism that adds message events with high frequency and whose real-time performance does not reach the preset threshold value in the chat room after the contents of all the event fields are reduced forms a channel list, and the message event joining message queue mechanism that adds message events with high frequency and whose real-time performance is not too high controls the instantaneous message concurrency amount of the high-concurrency live broadcast scene in the chat room by dynamically modifying the queue threshold value of the queue in the channel list, the method further comprises: and periodically emptying the formed channel list according to a preset time period.
According to another aspect of the present invention, there is provided an apparatus for reducing message bandwidth in a chat room, comprising: the device comprises an adjusting module, a simplifying module and a control module; the adjusting module is used for dynamically adjusting the message compression threshold value of the chat room in real time according to the message amount and the load condition of the chat room; the simplification module is used for simplifying all event field contents of the chat room after the threshold value of the message compression is adjusted; the control module is used for adding a message queue mechanism to the message events with high frequency and real-time performance not reaching a preset threshold value in the chat room after the contents of all event fields are simplified to form a channel list, adding the message queue mechanism to the message events with high frequency and not high real-time performance requirement, and dynamically modifying the queue threshold value of the queue in the channel list to control the instantaneous message concurrence amount of the high-concurrence live broadcast scene in the chat room.
Wherein, the adjusting module is specifically configured to: by adding a mode of dynamically modifying the message compression threshold value at the server end of the chat room, the message compression threshold value of the chat room is dynamically adjusted in real time according to the message amount and the load condition of the chat room.
Wherein, the retrench module is specifically configured to: and simplifying all the event field contents of the chat room after the threshold value of the message compression is adjusted by a mode of reserving the main field contents of all the event field contents of the chat room.
Wherein, the control module is specifically configured to: by judging whether the message type of the socket message received by the chat room is the preset type needing to enter the queue, when the message type of the socket message is the preset type needing to enter the queue, a channel list is formed by a message event adding message queue mechanism which adds the message with high frequency and real-time property not reaching a preset threshold value in the chat room after the contents of all event fields are reduced, when the message type of the socket message is not the preset type needing to enter the queue, whether the number of the online people of the chat room after the contents of all event fields are reduced exceeds the specified number of people is judged, if the number of the online people exceeds the specified number of people, the socket message is added into the message queue mechanism to form the channel list, the rooms corresponding to the chat room after the contents of all event fields are reduced are marked as the rooms needing to enter the queue, and an independent process is started, the system is in charge of the message queue, regularly checks whether the message queue has a value, if so, broadcasts the message and accumulates the number of the online people, if the number of the online people exceeds a preset value, stops broadcasting the message, enters a rest, finishes the rest and then enters a queue consumption mode to control the instantaneous message concurrence amount of the high-concurrence live broadcast scene of the chat room.
Wherein, the device for reducing the message bandwidth of the chat room further comprises: clearing the module; and the emptying module is used for regularly emptying the formed channel list according to a preset time period.
According to yet another aspect of the present invention, there is provided a computer apparatus comprising: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to cause the at least one processor to perform a method of reducing chat room message bandwidth as in any above.
According to a further aspect of the present invention there is provided a computer readable storage medium storing a computer program which when executed by a processor implements a method of reducing chat room message bandwidth as defined in any one of the above.
It can be found that, according to the above scheme, the threshold value of message compression of the chat room can be dynamically adjusted in real time according to the message amount and the load condition of the chat room, all event field contents of the chat room after the threshold value of message compression is adjusted can be simplified, a message event adding message queue mechanism with high frequency and instantaneity not reaching the preset threshold value in the chat room after all event field contents are simplified can be used for forming a channel list, the instantaneous message concurrent amount of the high-concurrent live broadcast scene of the chat room is controlled by dynamically modifying the queue threshold value of the queue in the channel list through the message event adding message queue mechanism with high frequency but not high instantaneity requirement, and the bandwidth consumption of the high-concurrent live broadcast scene of the chat room can be reduced to ensure the bandwidth stability of the chat room.
Furthermore, according to the scheme, the message compression threshold value of the chat room can be dynamically adjusted in real time according to the message amount and the load condition of the chat room by adding a mode of dynamically modifying the message compression threshold value at the server side of the chat room, so that the advantage that the bandwidth consumption of a high-concurrency live broadcast scene of the chat room can be effectively reduced is realized.
Furthermore, the above scheme can simplify all event field contents of the chat room after the threshold value of message compression is adjusted by reserving main field contents of all event field contents of the chat room, so that the advantage of effectively reducing bandwidth consumption of message transmission of a high-concurrency live broadcast scene of the chat room can be realized.
Further, the above solution can be implemented by determining whether the message type of the socket message received by the chat room is the predetermined type that needs to enter the queue, when the message type of the socket message is the predetermined type that needs to enter the queue, adding a message queue mechanism to the message event that the high frequency and real-time property in the chat room after the contents of all event fields are reduced does not reach the preset threshold value to form a channel list, when the message type of the socket message is not the predetermined type that needs to enter the queue, determining whether the number of online people in the chat room after the contents of all event fields are reduced exceeds the specified number of people, if the number of online people exceeds the specified number of people, adding the socket message to the message queue mechanism to form a channel list, and marking the room corresponding to the chat room after the contents of all event fields are reduced as the room that needs to enter the queue, and opening an independent process which is responsible for the message queue, regularly checking whether the message queue has a value, broadcasting the message and accumulating the number of online people if the message queue has the value, stopping broadcasting the message if the number of online people exceeds a preset value, entering rest, finishing the rest, and controlling the instantaneous message concurrence amount of the high-concurrency live broadcast scene of the chat room by entering a queue consumption mode.
Further, the above scheme can regularly empty the formed channel list according to a preset time period, which has the advantages of ensuring that the subsequent live broadcast of the channel corresponding to the channel list does not enter the message queue by default, and reducing the bandwidth consumption of the high-concurrency live broadcast scene in the chat room.
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, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a flow chart illustrating an embodiment of a method for reducing chat room message bandwidth;
FIG. 2 is a flow diagram illustrating another embodiment of a method for reducing chat room message bandwidth;
FIG. 3 is a schematic diagram of an embodiment of an apparatus for reducing message bandwidth in a chat room;
FIG. 4 is a schematic diagram of an alternative embodiment of an apparatus for reducing message bandwidth in a chat room;
FIG. 5 is a schematic structural diagram of an embodiment of the computer apparatus of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be noted that the following examples are only illustrative of the present invention, and do not limit the scope of the present invention. Similarly, the following examples are only some but not all examples of the present invention, and all other examples obtained by those skilled in the art without any inventive work are within the scope of the present invention.
The invention provides a method for reducing the message bandwidth of a chat room, which can reduce the bandwidth consumption of a high-concurrency live broadcast scene of the chat room so as to ensure the bandwidth stability of the chat room.
Referring to fig. 1, fig. 1 is a flowchart illustrating a method for reducing message bandwidth in a chat room according to an embodiment of the present invention. It should be noted that the method of the present invention is not limited to the flow sequence shown in fig. 1 if the results are substantially the same. As shown in fig. 1, the method comprises the steps of:
s101: and dynamically adjusting the message compression threshold of the chat room in real time according to the message amount and the load condition of the chat room.
Wherein, the dynamically adjusting the message compression threshold of the chat room according to the message amount and the load condition of the chat room in real time may include:
by adding a mode of dynamically modifying the message compression threshold value at the server side of the chat room, the message compression threshold value of the chat room is dynamically adjusted according to the message amount and the load condition of the chat room, and the advantage is that the bandwidth consumption of a high-concurrency live broadcast scene of the chat room can be effectively reduced.
In this embodiment, a parameter threshold may be directly added through a socket.io (real-time two-way communication based on events) module to adjust a threshold for message compression of a chat room, and the present invention is not limited thereto.
In this embodiment, when performance and memory loss caused by compression are found to be excessive in the process running process of the chat room, the compression threshold may be dynamically increased, so that the message compression amount of the chat room is reduced, and the threshold may be dynamically modified according to memory consumption by starting a timer to check the memory consumption, which is not limited in the present invention.
S102: and simplifying the contents of all event fields of the chat room after the threshold value of the message compression is adjusted.
The reducing the content of all event fields of the chat room after the threshold of message compression is adjusted may include:
the method has the advantages that the main field contents of all event field contents of the chat room are reserved, all event field contents of the chat room after the threshold value of message compression is adjusted are simplified, and the method can effectively reduce the bandwidth consumption of message transmission of high-concurrency live scenes of the chat room.
S103: and adding the message events with high frequency and instantaneity not reaching a preset threshold value into the chat room after the contents of all the event fields are simplified to form a channel list, and controlling the instantaneous message concurrency amount of the high-concurrency live broadcast scene of the chat room by dynamically modifying the queue threshold value of the queue in the channel list through adding the message events with high frequency and instantaneity not too high to the message queue mechanism.
The adding of the message event with high frequency and real-time performance not reaching the preset threshold value in the chat room after the contents of all the event fields are reduced into the message queue mechanism forms a channel list, the adding of the message event with high frequency and not high real-time performance requirement into the message queue mechanism controls the instantaneous message concurrence amount of the high-concurrence live broadcast scene of the chat room by dynamically modifying the queue threshold value of the queue in the channel list, and the adding of the message event into the message queue mechanism can include:
by judging whether the message type of a socket message received by a chat room is a preset type needing to enter a queue or not, when the message type of the socket message is the preset type needing to enter the queue, adding a message queue mechanism to the message event with high frequency and real-time property not reaching a preset threshold value in the chat room after the contents of all event fields are reduced to form a channel list, when the message type of the socket message is not the preset type needing to enter the queue, judging whether the number of online people of the chat room after the contents of all event fields are reduced exceeds a specified number of people or not, if the number of online people exceeds the specified number, adding the socket message into the message queue mechanism to form a channel list, marking the room corresponding to the chat room after the contents of all event fields as a room needing to enter the queue, and starting an independent process, the method is in charge of the message queue, regularly checks whether the message queue has a value, broadcasts the message and accumulates the number of online people if the message queue has the value, stops broadcasting the message if the number of online people exceeds a preset value, enters rest, finishes the rest and controls the instant message concurrency amount of the high-concurrency live broadcast scene of the chat room in a queue consumption mode, and the method has the advantages that the effect of reducing the instant bandwidth consumption of the high-concurrency live broadcast scene of the chat room can be achieved.
Wherein, after the adding the message event with high frequency and real-time performance not reaching the preset threshold value into the message queue mechanism to form the channel list, and controlling the instantaneous message concurrency amount of the high-concurrency live broadcast scene in the chat room by dynamically modifying the queue threshold value of the queue in the channel list through adding the message queue mechanism to the message event with high frequency and not high real-time performance requirement in the chat room after the contents of all the event fields are reduced, the method may further include:
and periodically emptying the formed channel list according to a preset time period, so that the advantage that the subsequent live broadcast of the channel corresponding to the channel list is ensured to be free from entering a message queue by default, and the bandwidth consumption of a high-concurrency live broadcast scene in a chat room can be reduced.
It can be found that, in this embodiment, the threshold of message compression of the chat room can be dynamically adjusted in real time according to the message amount and the load condition of the chat room, all event field contents of the chat room after the threshold of message compression is adjusted can be simplified, and a message event joining message queue mechanism that the high frequency in the chat room after all event field contents are simplified and the real-time property does not reach the preset threshold can be added to form a channel list.
Further, in this embodiment, the message compression threshold of the chat room can be dynamically adjusted in real time according to the message amount and the load condition of the chat room by adding a mode of dynamically modifying the message compression threshold at the server side of the chat room, which has the advantage of effectively reducing the bandwidth consumption of the high-concurrency live broadcast scene of the chat room.
Further, in this embodiment, the contents of all event fields of the chat room after the threshold of message compression is adjusted may be reduced by retaining the main field contents of all event field contents of the chat room, which is beneficial to effectively reduce the bandwidth consumption of message transmission in the high-concurrency live broadcast scenario of the chat room.
Further, in this embodiment, by determining whether the message type of the socket message received by the chat room is the predetermined type that needs to enter the queue, when the message type of the socket message is the predetermined type that needs to enter the queue, a message queue adding mechanism is added to the message event in the chat room after the contents of all event fields are reduced, the message queue adding mechanism having a high frequency and a real-time property that does not reach a preset threshold value, to form a channel list, when the message type of the socket message is not the predetermined type that needs to enter the queue, it is determined whether the number of online people in the chat room after the contents of all event fields are reduced exceeds a specified number of people, if the number of online people exceeds the specified number, the socket message is added to the message queue mechanism to form a channel list, and the room corresponding to the chat room after the contents of all event fields are reduced is marked as a room that needs to enter the queue, and opening an independent process which is responsible for the message queue, regularly checking whether the message queue has a value, broadcasting the message and accumulating the number of online people if the message queue has the value, stopping broadcasting the message if the number of online people exceeds a preset value, entering rest, finishing the rest, and controlling the instantaneous message concurrence amount of the high-concurrency live broadcast scene of the chat room by entering a queue consumption mode.
Referring to fig. 2, fig. 2 is a flow chart illustrating another embodiment of the method for reducing the message bandwidth of the chat room according to the present invention. In this embodiment, the method includes the steps of:
s201: and dynamically adjusting the message compression threshold of the chat room in real time according to the message amount and the load condition of the chat room.
As described above in S101, further description is omitted here.
S202: and simplifying the contents of all event fields of the chat room after the threshold value of the message compression is adjusted.
As described above in S102, further description is omitted here.
S203: and adding the message events with high frequency and instantaneity not reaching a preset threshold value into the chat room after the contents of all the event fields are simplified to form a channel list, and controlling the instantaneous message concurrency amount of the high-concurrency live broadcast scene of the chat room by dynamically modifying the queue threshold value of the queue in the channel list through adding the message events with high frequency and instantaneity not too high to the message queue mechanism.
As described above in S103, which is not described herein.
S204: and periodically emptying the formed channel list according to a preset time period.
It can be found that, in this embodiment, the formed channel list may be periodically emptied according to a preset time period, which is advantageous in ensuring that subsequent live broadcast of the channel corresponding to the channel list does not enter the message queue by default, and reducing bandwidth consumption of a high-concurrence live broadcast scene in a chat room.
The invention also provides a device for reducing the message bandwidth of the chat room, which can reduce the bandwidth consumption of the high-concurrency live broadcast scene of the chat room so as to ensure the bandwidth stability of the chat room.
Referring to fig. 3, fig. 3 is a schematic structural diagram of an embodiment of the apparatus for reducing message bandwidth in a chat room according to the invention. In this embodiment, the apparatus 30 for reducing the message bandwidth of the chat room includes an adjusting module 31, a reducing module 32 and a control module 33.
The adjusting module 31 is configured to dynamically adjust the threshold of message compression of the chat room in real time according to the message amount and the load condition of the chat room.
The reducing module 32 is configured to reduce the contents of all event fields of the chat room after the threshold of message compression is adjusted.
The control module 33 is configured to add a message queue mechanism to the message events with high frequency and whose instantaneity does not reach a preset threshold in the chat room after the contents of all event fields are reduced to form a channel list, and control the instantaneous message concurrence amount of the high-concurrency live broadcast scene in the chat room by adding a message queue mechanism to the message events with high frequency and without high instantaneity requirement and dynamically modifying the queue threshold of the queue in the channel list.
Optionally, the adjusting module 31 may be specifically configured to:
by adding a mode of dynamically modifying the message compression threshold value at the server end of the chat room, the message compression threshold value of the chat room is dynamically adjusted in real time according to the message amount and the load condition of the chat room.
Optionally, the reduction module 32 may be specifically configured to:
and simplifying all the event field contents of the chat room after the threshold value of the message compression is adjusted by a mode of reserving the main field contents of all the event field contents of the chat room.
Optionally, the control module 33 may be specifically configured to:
by judging whether the message type of the socket message received by the chat room is the preset type which needs to enter the queue, when the message type of the socket message is the preset type which needs to enter the queue, a channel list is formed by a message event adding message queue mechanism which adds the message event with high frequency and real-time property which does not reach the preset threshold value in the chat room after the contents of all event fields are reduced, when the message type of the socket message is not the preset type which needs to enter the queue, whether the number of the online people of the chat room after the contents of all event fields are reduced exceeds the specified number of people is judged, if the number of the online people exceeds the specified number of the people, the socket message is added into the message queue mechanism to form the channel list, the rooms corresponding to the chat room after the contents of all event fields are reduced are marked as the rooms which need to enter the queue, and an independent process is opened, the system is in charge of the message queue, regularly checks whether the message queue has a value, broadcasts the message and accumulates the number of the online people if the value exists, stops broadcasting the message if the number of the online people exceeds a preset value, and enters a rest and finishes the rest, and then enters a queue consumption mode to control the instantaneous message concurrence amount of the high-concurrence live broadcast scene of the chat room.
Referring to fig. 4, fig. 4 is a schematic structural diagram of another embodiment of the apparatus for reducing the message bandwidth of the chat room according to the present invention. Unlike the previous embodiment, the apparatus 40 for reducing the message bandwidth of the chat room further includes a clearing module 41.
The clearing module 41 is configured to periodically clear the formed channel list according to a preset time period.
Each unit module of the apparatus 30/40 for reducing the message bandwidth of the chat room can respectively execute the corresponding steps in the above embodiments of the method, and therefore, the details of each unit module are not repeated herein, please refer to the description of the corresponding steps above.
The present invention further provides a computer device, as shown in fig. 5, comprising: at least one processor 51; and a memory 52 communicatively coupled to the at least one processor 51; wherein the memory 52 stores instructions executable by the at least one processor 51 to cause the at least one processor 51 to perform the method for reducing chat room message bandwidth described above.
Wherein the memory 52 and the processor 51 are coupled in a bus, which may comprise any number of interconnected buses and bridges, which couple one or more of the various circuits of the processor 51 and the memory 52 together. The bus may also connect various other circuits such as peripherals, voltage regulators, power management circuits, and the like, which are well known in the art, and therefore, will not be described any further herein. A bus interface provides an interface between the bus and the transceiver. The transceiver may be one element or a plurality of elements, such as a plurality of receivers and transmitters, providing a means for communicating with various other apparatus over a transmission medium. The data processed by the processor 51 is transmitted over a wireless medium via an antenna, which further receives the data and transmits the data to the processor 51.
The processor 51 is responsible for managing the bus and general processing and may also provide various functions including timing, peripheral interfaces, voltage regulation, power management, and other control functions. And the memory 52 may be used to store data used by the processor 51 in performing operations.
The present invention further provides a computer-readable storage medium storing a computer program. The computer program realizes the above-described method embodiments when executed by a processor.
It can be found that, according to the above scheme, the threshold value of message compression of the chat room can be dynamically adjusted in real time according to the message amount and the load condition of the chat room, all event field contents of the chat room after the threshold value of message compression is adjusted can be simplified, a message event adding message queue mechanism with high frequency and instantaneity not reaching the preset threshold value in the chat room after all event field contents are simplified can be used for forming a channel list, the instantaneous message concurrent amount of the high-concurrent live broadcast scene of the chat room is controlled by dynamically modifying the queue threshold value of the queue in the channel list through the message event adding message queue mechanism with high frequency but not high instantaneity requirement, and the bandwidth consumption of the high-concurrent live broadcast scene of the chat room can be reduced to ensure the bandwidth stability of the chat room.
Furthermore, according to the scheme, the message compression threshold value of the chat room can be dynamically adjusted in real time according to the message amount and the load condition of the chat room by adding a mode of dynamically modifying the message compression threshold value at the server side of the chat room, so that the advantage that the bandwidth consumption of a high-concurrency live broadcast scene of the chat room can be effectively reduced is realized.
Furthermore, the above scheme can simplify all event field contents of the chat room after the threshold value of message compression is adjusted by reserving main field contents of all event field contents of the chat room, so that the advantage of effectively reducing bandwidth consumption of message transmission of a high-concurrency live broadcast scene of the chat room can be realized.
Further, the above solution can be implemented by determining whether the message type of the socket message received by the chat room is the predetermined type that needs to enter the queue, when the message type of the socket message is the predetermined type that needs to enter the queue, adding a message queue mechanism to the message event that the high frequency and real-time property in the chat room after the contents of all event fields are reduced does not reach the preset threshold value to form a channel list, when the message type of the socket message is not the predetermined type that needs to enter the queue, determining whether the number of online people in the chat room after the contents of all event fields are reduced exceeds the specified number of people, if the number of online people exceeds the specified number of people, adding the socket message to the message queue mechanism to form a channel list, and marking the room corresponding to the chat room after the contents of all event fields are reduced as the room that needs to enter the queue, and opening an independent process which is responsible for the message queue, regularly checking whether the message queue has a value, broadcasting the message and accumulating the number of online people if the message queue has the value, stopping broadcasting the message if the number of online people exceeds a preset value, entering rest, finishing the rest, and controlling the instantaneous message concurrence amount of the high-concurrency live broadcast scene of the chat room by entering a queue consumption mode.
Further, the above scheme can regularly empty the formed channel list according to a preset time period, which has the advantages of ensuring that the subsequent live broadcast of the channel corresponding to the channel list does not enter the message queue by default, and reducing the bandwidth consumption of the high-concurrency live broadcast scene in the chat room.
In the several embodiments provided in the present invention, it should be understood that the disclosed system, apparatus and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, a division of a module or a unit is merely a logical division, and an actual implementation may have another division, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
Units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be substantially or partially implemented in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, a network device, or the like) or a processor (processor) 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.
The above description is only a part of the embodiments of the present invention, and not intended to limit the scope of the present invention, and all equivalent devices or equivalent processes performed by the present invention through the contents of the specification and the drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.
Claims (10)
1. A method for reducing message bandwidth in a chat room, comprising:
dynamically adjusting the message compression threshold of the chat room in real time according to the message amount and the load condition of the chat room;
simplifying all event field contents of the chat room after the threshold value of the message compression is adjusted;
and adding the message events with high frequency and instantaneity not reaching a preset threshold value into the chat room after the contents of all the event fields are simplified to form a channel list, and controlling the instantaneous message concurrency amount of the high-concurrency live broadcast scene of the chat room by dynamically modifying the queue threshold value of the queue in the channel list through adding the message events with high frequency and instantaneity not too high into the message queue mechanism.
2. The method for reducing message bandwidth in a chat room of claim 1, wherein dynamically adjusting the threshold for message compression in the chat room in real time based on the message volume and the load of the chat room comprises:
by adding a mode of dynamically modifying the message compression threshold value at the server end of the chat room, the message compression threshold value of the chat room is dynamically adjusted in real time according to the message amount and the load condition of the chat room.
3. The method of reducing chat room message bandwidth as in claim 1, wherein the reducing all event field contents of the chat room after the threshold for message compression is adjusted comprises:
and simplifying all the event field contents of the chat room after the threshold value of the message compression is adjusted by a mode of reserving the main field contents of all the event field contents of the chat room.
4. The method for reducing the message bandwidth of the chat room according to claim 1, wherein the message event joining message queuing mechanism for the message events with high frequency and real-time performance not reaching the preset threshold value in the chat room after the contents of all the event fields are reduced forms a channel list, and the message concurrency amount at the moment of the high-concurrency live broadcast scene in the chat room is controlled by dynamically modifying the queue threshold value of the queue in the channel list through the message event joining message queuing mechanism for the message events with high frequency and not high real-time performance requirement, comprising:
by judging whether the message type of the socket message received by the chat room is the preset type needing to enter the queue, when the message type of the socket message is the preset type needing to enter the queue, a channel list is formed by a message event adding message queue mechanism which adds the message with high frequency and real-time property not reaching a preset threshold value in the chat room after the contents of all event fields are reduced, when the message type of the socket message is not the preset type needing to enter the queue, whether the number of the online people of the chat room after the contents of all event fields are reduced exceeds the specified number of people is judged, if the number of the online people exceeds the specified number of people, the socket message is added into the message queue mechanism to form the channel list, the rooms corresponding to the chat room after the contents of all event fields are reduced are marked as the rooms needing to enter the queue, and an independent process is started, the system is in charge of the message queue, regularly checks whether the message queue has a value, if so, broadcasts the message and accumulates the number of the online people, if the number of the online people exceeds a preset value, stops broadcasting the message, enters a rest, finishes the rest and then enters a queue consumption mode to control the instantaneous message concurrence amount of the high-concurrence live broadcast scene of the chat room.
5. The method for reducing message bandwidth in a chat room according to claim 1, wherein after the message event joining message queuing mechanism that adds a high frequency message event in the chat room after the contents of all the event fields are reduced and the real-time property of the message event does not reach the preset threshold value forms a channel list, and the message concurrency amount at the moment of the live broadcast scene with high concurrency in the chat room is controlled by dynamically modifying the queue threshold value of the queue in the channel list through the message event joining message queuing mechanism that adds a high frequency message event but does not have a high real-time property requirement, the method further comprises:
and periodically emptying the formed channel list according to a preset time period.
6. An apparatus for reducing message bandwidth in a chat room, comprising:
the device comprises an adjusting module, a simplifying module and a control module;
the adjusting module is used for dynamically adjusting the message compression threshold value of the chat room in real time according to the message amount and the load condition of the chat room;
the simplification module is used for simplifying all event field contents of the chat room after the threshold value of the message compression is adjusted;
the control module is used for adding a message queue mechanism to the message events with high frequency and real-time performance not reaching a preset threshold value in the chat room after the contents of all event fields are simplified to form a channel list, adding the message queue mechanism to the message events with high frequency and not high real-time performance requirement, and dynamically modifying the queue threshold value of the queue in the channel list to control the instantaneous message concurrence amount of the high-concurrence live broadcast scene in the chat room.
7. The apparatus for reducing chat room message bandwidth as in claim 6, wherein the adjustment module is specifically configured to:
by adding a mode of dynamically modifying the message compression threshold value at the server end of the chat room, the message compression threshold value of the chat room is dynamically adjusted in real time according to the message amount and the load condition of the chat room.
8. The apparatus for reducing chat room message bandwidth as in claim 6, wherein the reduction module is specifically configured to:
and simplifying all the event field contents of the chat room after the threshold value of the message compression is adjusted by a mode of reserving the main field contents of all the event field contents of the chat room.
9. The apparatus for reducing chat room message bandwidth as in claim 6, wherein the control module is specifically configured to:
by judging whether the message type of the socket message received by the chat room is the preset type needing to enter the queue, when the message type of the socket message is the preset type needing to enter the queue, a channel list is formed by a message event adding message queue mechanism which adds the message with high frequency and real-time property not reaching a preset threshold value in the chat room after the contents of all event fields are reduced, when the message type of the socket message is not the preset type needing to enter the queue, whether the number of the online people of the chat room after the contents of all event fields are reduced exceeds the specified number of people is judged, if the number of the online people exceeds the specified number of people, the socket message is added into the message queue mechanism to form the channel list, the rooms corresponding to the chat room after the contents of all event fields are reduced are marked as the rooms needing to enter the queue, and an independent process is started, the system is in charge of the message queue, regularly checks whether the message queue has a value, if so, broadcasts the message and accumulates the number of the online people, if the number of the online people exceeds a preset value, stops broadcasting the message, enters a rest, finishes the rest and then enters a queue consumption mode to control the instantaneous message concurrence amount of the high-concurrence live broadcast scene of the chat room.
10. The apparatus for reducing chat room message bandwidth of claim 6, wherein the apparatus for reducing chat room message bandwidth further comprises:
clearing the module;
and the emptying module is used for regularly emptying the formed channel list according to a preset time period.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011275662.1A CN112073207B (en) | 2020-11-16 | 2020-11-16 | Method, device and computer equipment for reducing message bandwidth of chat room |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011275662.1A CN112073207B (en) | 2020-11-16 | 2020-11-16 | Method, device and computer equipment for reducing message bandwidth of chat room |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112073207A true CN112073207A (en) | 2020-12-11 |
CN112073207B CN112073207B (en) | 2021-02-09 |
Family
ID=73655148
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011275662.1A Active CN112073207B (en) | 2020-11-16 | 2020-11-16 | Method, device and computer equipment for reducing message bandwidth of chat room |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112073207B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113296942A (en) * | 2021-05-13 | 2021-08-24 | 广州博冠信息科技有限公司 | Message adjusting method, message adjusting device, storage medium and electronic equipment |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102724557A (en) * | 2012-07-03 | 2012-10-10 | 广州盈可视电子科技有限公司 | Method and device for coding control in multi-flow audio live broadcasting |
CN107231350A (en) * | 2017-05-24 | 2017-10-03 | 北京潘达互娱科技有限公司 | A kind of message treatment method and device |
CN108418743A (en) * | 2018-01-16 | 2018-08-17 | 北京奇艺世纪科技有限公司 | A kind of chatroom message distributing method, device and electronic equipment |
CN108616378A (en) * | 2016-12-13 | 2018-10-02 | 北京唱吧科技股份有限公司 | A kind of the chat optimization method and server of bandwidth self-adaption |
CN111106996A (en) * | 2019-12-28 | 2020-05-05 | 安徽微沃信息科技股份有限公司 | WebSocket and cache-based multi-terminal online chat system |
-
2020
- 2020-11-16 CN CN202011275662.1A patent/CN112073207B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102724557A (en) * | 2012-07-03 | 2012-10-10 | 广州盈可视电子科技有限公司 | Method and device for coding control in multi-flow audio live broadcasting |
CN108616378A (en) * | 2016-12-13 | 2018-10-02 | 北京唱吧科技股份有限公司 | A kind of the chat optimization method and server of bandwidth self-adaption |
CN107231350A (en) * | 2017-05-24 | 2017-10-03 | 北京潘达互娱科技有限公司 | A kind of message treatment method and device |
CN108418743A (en) * | 2018-01-16 | 2018-08-17 | 北京奇艺世纪科技有限公司 | A kind of chatroom message distributing method, device and electronic equipment |
CN111106996A (en) * | 2019-12-28 | 2020-05-05 | 安徽微沃信息科技股份有限公司 | WebSocket and cache-based multi-terminal online chat system |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113296942A (en) * | 2021-05-13 | 2021-08-24 | 广州博冠信息科技有限公司 | Message adjusting method, message adjusting device, storage medium and electronic equipment |
Also Published As
Publication number | Publication date |
---|---|
CN112073207B (en) | 2021-02-09 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9462343B2 (en) | System and method of delivering video content | |
EP2525620B1 (en) | Method, device and communication system for dormancy timer control | |
US11438223B2 (en) | Adaptive capacity management of connections associated with a service | |
CN105553870B (en) | Service request distribution method and device | |
US8972593B2 (en) | Load sharing method, load sharing system and access server | |
CN103731448A (en) | Method and system for compressing picture | |
CN112073207B (en) | Method, device and computer equipment for reducing message bandwidth of chat room | |
CN114567519B (en) | Method and device for managing instruction messages of multiple intelligent devices in multithreading parallel | |
US11502518B2 (en) | Energy management device, energy management system, and energy management method | |
US20090313634A1 (en) | Dynamically selecting an optimal path to a remote node | |
CN111328136A (en) | Data transmission control method and device based on eMBMS and electronic equipment | |
US10397797B2 (en) | Devices, systems, and methods for resource allocation of shared spectrum | |
CN103227794A (en) | Data transmission control method, device and system | |
CN113315718B (en) | System, method and device for self-adaptive current limiting | |
CN102238423B (en) | A kind of equipment scheduling method, Apparatus and system | |
CN110636104B (en) | Resource request method, electronic device and storage medium | |
CN110247808B (en) | Information transmission method, device, equipment and readable storage medium | |
CN116132705B (en) | Live broadcast buffer volume adjusting method, device, equipment and storage medium | |
CN111309484A (en) | Management method and device for improving terminal performance and computer readable storage medium | |
CN116048424B (en) | IO data processing method, device, equipment and medium | |
CN117793793A (en) | Internet of things communication method and device and electronic device | |
CN116760779A (en) | Network congestion control method, system, storage medium and electronic equipment | |
CN114615277A (en) | EMQ X-based multi-cluster dynamic expansion method and system | |
CN116743517A (en) | Message broadcasting method, apparatus, device, storage medium and computer program product | |
CN117729246A (en) | Message processing method and system |
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 | ||
CP03 | Change of name, title or address |
Address after: Room 402, No. 66, North Street, University Town Center, Panyu District, Guangzhou City, Guangdong Province, 510006 Patentee after: Yifang Information Technology Co.,Ltd. Address before: 510006 Room 601, 603, 605, science museum, Guangdong University of technology, 100 Waihuan West Road, Xiaoguwei street, Panyu District, Guangzhou City, Guangdong Province Patentee before: GUANGZHOU EASEFUN INFORMATION TECHNOLOGY Co.,Ltd. |
|
CP03 | Change of name, title or address |