CN113965810A - Data processing method and device based on chat room - Google Patents
Data processing method and device based on chat room Download PDFInfo
- Publication number
- CN113965810A CN113965810A CN202111137132.5A CN202111137132A CN113965810A CN 113965810 A CN113965810 A CN 113965810A CN 202111137132 A CN202111137132 A CN 202111137132A CN 113965810 A CN113965810 A CN 113965810A
- Authority
- CN
- China
- Prior art keywords
- message
- chat room
- message data
- users
- data processing
- 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.)
- Pending
Links
- 238000003672 processing method Methods 0.000 title claims abstract description 16
- 238000012545 processing Methods 0.000 claims abstract description 103
- 238000004891 communication Methods 0.000 claims abstract description 87
- 238000000034 method Methods 0.000 claims abstract description 33
- 230000000977 initiatory effect Effects 0.000 claims abstract description 9
- 230000007246 mechanism Effects 0.000 claims description 20
- 238000002955 isolation Methods 0.000 claims description 12
- 238000009792 diffusion process Methods 0.000 claims description 11
- 230000002159 abnormal effect Effects 0.000 claims description 9
- 230000004044 response Effects 0.000 claims description 5
- 230000008569 process Effects 0.000 description 7
- 238000013461 design Methods 0.000 description 5
- 238000010586 diagram Methods 0.000 description 4
- 238000007619 statistical method Methods 0.000 description 4
- 230000000694 effects Effects 0.000 description 3
- 239000002360 explosive Substances 0.000 description 3
- 230000003993 interaction Effects 0.000 description 3
- 230000005856 abnormality Effects 0.000 description 2
- 238000013500 data storage Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000011218 segmentation Effects 0.000 description 2
- 238000004880 explosion Methods 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 238000000926 separation method Methods 0.000 description 1
- 230000001960 triggered effect Effects 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/47—End-user applications
- H04N21/478—Supplemental services, e.g. displaying phone caller identification, shopping application
- H04N21/4788—Supplemental services, e.g. displaying phone caller identification, shopping application communicating with other users, e.g. chatting
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/20—Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
- H04N21/23—Processing of content or additional data; Elementary server operations; Server middleware
- H04N21/24—Monitoring of processes or resources, e.g. monitoring of server load, available bandwidth, upstream requests
- H04N21/2407—Monitoring of transmitted content, e.g. distribution time, number of downloads
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/43—Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
- H04N21/442—Monitoring of processes or resources, e.g. detecting the failure of a recording device, monitoring the downstream bandwidth, the number of times a movie has been viewed, the storage space available from the internal hard disk
- H04N21/44204—Monitoring of content usage, e.g. the number of times a movie has been viewed, copied or the amount which has been watched
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/60—Network structure or processes for video distribution between server and client or between remote clients; Control signalling between clients, server and network components; Transmission of management data between server and client, e.g. sending from server to client commands for recording incoming content stream; Communication details between server and client
- H04N21/65—Transmission of management data between client and server
Abstract
The application discloses a data processing method and device based on a chat room. The method comprises the steps of determining the number of current online users in the chat room; responding to a message communication instruction of the user currently initiating the network request; and issuing and/or receiving message data based on the message communication instruction, the preset message data processing strategy of the number of the online users and the users with different roles in the chat room. The method and the device solve the technical problem that the stability and the correctness of message processing in the chat room of the large-scale online number of people are insufficient. By the method and the device, the information sent by each user in the chat room can be correctly and normally sent, and the user can very quickly and correctly receive the information sent by other users. The method and the device are suitable for processing the real-time messages of different roles in the chat room under the auction service scene.
Description
Technical Field
The application relates to the field of computer software, in particular to a data processing method and device based on a chat room.
Background
With the increase of live broadcast and similar live broadcast scenes, the demand of related services for real-time messages in an online state is increasing, and the related services need to be completed through live broadcast chat rooms.
When the number of users in the chat room reaches a certain number, the stability of the messages in the chat room cannot be supported, and the accuracy processing capability is reduced, so that the user experience is influenced.
Aiming at the problem of insufficient stability and accuracy of message processing in a chat room with large-scale online people in the related art, no effective solution is provided at present.
Disclosure of Invention
The present application mainly aims to provide a data processing method and device based on a chat room, so as to solve the problem of insufficient stability and accuracy of message processing in a large-scale online chat room.
To achieve the above object, according to one aspect of the present application, there is provided a data processing method based on a chat room.
The data processing method based on the chat room comprises the following steps: determining the number of current online users in the chat room; responding to a message communication instruction of the user currently initiating the network request; and issuing and/or receiving message data based on the message communication instruction, a preset message data processing strategy of the number of the online users and users with different roles in the chat room, wherein the message data is generated when the users with different chat roles interact through the chat room, each user enters the chat room through a user side, and the preset message data processing strategy is used for acquiring the message data from the users with different roles under the condition that new messages exist.
Further, the method further comprises: dividing the chat room into at least a first chat room and a second chat room according to the service access flow estimation result; obtaining a first chat room message channel and a second chat room message channel according to the first chat room, the second chat room and different preset message isolation channels; issuing first message data through the first chat room message channel, wherein the first message data is used for issuing through the appointed first chat room message channel; and issuing second message data through the second chat room message channel, wherein the first message data is used for issuing through the second chat room message channel or a third chat room message channel.
Further, issuing first message data through the first chat room message channel, wherein the first message data is used after being issued through the specified first chat room message channel, and the method includes: receiving message data in the first chat room through the first chat room message channel; issuing second message data through the second chat room message channel, wherein the first message data is used after the second message data is issued through the second chat room message channel or a third chat room message channel, and the method comprises the following steps: receiving message data in the second chat room and/or a third chat room through the second chat room message channel.
Further, the message communication instruction of the user responding to the current network request further comprises: the users with different roles in the chat room comprise: a first persona user to facilitate a transaction in the chat room; receiving a new message written by the first role user and storing message data; and responding to the message communication instruction of the subscribing user which currently initiates the network request based on the subscribing user of the first role user, and issuing the message data.
Further, the issuing and/or receiving of message data based on the message communication instruction, a preset message data processing policy and users with different roles in the chat room, where the message data is generated when the users with different chat roles interact with the chat room, each user enters the chat room through a user side, and the preset message data processing policy is used for acquiring message data from the users with different roles under the condition that a new message exists, and includes: receiving a network request of a client for pulling message data; based on a long polling mechanism, if no new message exists currently, keeping long connection with the client terminal until a new message is generated; within a preset period, receiving a network request used by the client for pulling message data again; and issuing the message data to the client and/or receiving the message data based on the message communication instruction with the first role user, the long connection message data processing strategy and the first role user in the chat room.
Further, the issuing and/or receiving of message data based on the message communication instruction, a preset message data processing policy and users with different roles in the chat room, where the message data is generated when the users with different chat roles interact with the chat room, each user enters the chat room through a user side, and the preset message data processing policy is used for acquiring message data from the users with different roles under the condition that a new message exists, and includes: when the real-time message in the online state in the chat room is abnormal, message data is issued to the client through an asynchronous thread task; and at least issuing the message data to the client once and/or receiving the message data based on the abnormal message communication instruction, the NoCache message data processing strategy and users with different roles in the chat room.
Further, the issuing and/or receiving of message data based on the message communication instruction, a preset message data processing policy and users with different roles in the chat room, where the message data is generated when the users with different chat roles interact with the chat room, each user enters the chat room through a user side, and the preset message data processing policy is used for acquiring message data from the users with different roles under the condition that a new message exists, and includes: marking the message based on the message communication instruction so as to distinguish different message lists when the client acquires message data; and issuing the message data to the client sides of the users with different roles in the chat room and/or receiving the message data according to a preset message priority message data processing strategy in the message list.
Further, the issuing and/or receiving of message data based on the message communication instruction, a preset message data processing policy and users with different roles in the chat room, where the message data is generated when the users with different chat roles interact with the chat room, each user enters the chat room through a user side, and the preset message data processing policy is used for acquiring message data from the users with different roles under the condition that a new message exists, and includes: performing duplicate removal statistics on the message based on the message communication instruction so as to perform duplicate removal in advance when the client acquires message data; and issuing the duplicate-removed message data to the client sides of the users with different roles in the chat room and/or receiving the message data according to a preset duplicate-removed message data processing strategy.
Further, the issuing and/or receiving of message data based on the message communication instruction, the preset message data processing policy for the number of online users, and users with different roles in the chat room, where the message data is generated when users with different chat roles interact with each other through the chat room, and each user enters the chat room through a user side, and the preset message data processing policy is used for acquiring message data from users with different roles under the condition that a new message exists, and includes: determining a transaction instruction in the message communication instruction through an application scene in the chat room, wherein the application scene comprises an auction service; determining the corresponding preset message data processing strategy based on the number of the online users; based on the message communication instruction, the preset message data processing strategy of the number of the online users and the users with different roles in the chat room, issuing and/or receiving message data to the client participating in the auction service, wherein the preset message data processing strategy of the number of the online users at least comprises one of the following strategies: read diffusion mechanism, longpoling strategy, NoCache strategy, message list grading strategy, Hyperoglog-based statistical strategy and VIP message server isolation strategy.
To achieve the above object, according to another aspect of the present application, there is provided a data processing apparatus for a chat room.
The data processing device for the chat room comprises: the confirming module is used for confirming the number of current online users in the chat room; the response module is used for responding to the message communication instruction of the user which currently initiates the network request; and the message processing module is used for issuing and/or receiving message data based on the message communication instruction, the preset message data processing strategy of the number of the online users and the users with different roles in the chat room, wherein the message data are generated when the users with different chat roles interact through the chat room, each user enters the chat room through a user side, and the preset message data processing strategy is used for acquiring the message data from the users with different roles under the condition of new messages.
In the data processing method and device based on the chat room in the embodiment of the application, the method of determining the number of current online users in the chat room is adopted, and the purpose of issuing and/or receiving message data based on the message communication instruction, the preset message data processing strategy of the number of online users and users with different roles in the chat room is achieved by responding to the message communication instruction of the user who initiates a network request currently, so that the technical effects of high stability and real-time performance of the message data based on the chat room are realized, and the technical problem of insufficient message processing stability and accuracy processing capability in the chat room of large-scale online users is solved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this application, serve to provide a further understanding of the application and to enable other features, objects, and advantages of the application to be more apparent. The drawings and their description illustrate the embodiments of the invention and do not limit it. In the drawings:
fig. 1 is a system architecture diagram of a chat-room-based data processing method according to an embodiment of the present application;
FIG. 2 is a schematic flow chart diagram illustrating a method for chat-room-based data processing according to an embodiment of the present application;
FIG. 3 is a schematic diagram of a chat room-based data processing apparatus according to an embodiment of the present application;
fig. 4 is a flow chart of a chat room based data processing method according to the preferred embodiment of the present application.
Detailed Description
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only partial embodiments of the present application, but not all embodiments. 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 application.
It should be noted that the terms "first," "second," and the like in the description and claims of this application and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It should be understood that the data so used may be interchanged under appropriate circumstances such that embodiments of the application described herein may be used. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
Fig. 1 is a schematic diagram of a system architecture of a data processing method based on a chat room according to an embodiment of the present application, which includes a client 100, a service background 200, and a chat room background 300. It is understood that the service background 200 and the chat room background 300 are provided at the server side for responding to the network request of the client 100. The data processing method in the embodiment of the present application mainly focuses on the chat room background 300. When the chat room background 300 receives and sends the chat information data of the user, the pressure of the background server is relieved as much as possible.
As shown in fig. 2, the method includes steps S201 to S203 as follows:
step S201, determining the number of current online users in the chat room;
step S202, responding to the message communication instruction of the user which initiates the network request currently;
step S203, based on the message communication instruction, the preset message data processing strategy of the online user number and the users with different roles in the chat room, issuing and/or receiving message data, wherein the message data are generated when the users with different chat roles interact through the chat room, each user enters the chat room through a user side, and the preset message data processing strategy is used for acquiring the message data from the users with different roles under the condition that new messages exist.
In the step S201, the server needs to count the number of current online users in the chat room, and for online users with different magnitudes, the server may process the message data in a corresponding manner.
As an alternative implementation, the number of users on line based on the history can be counted at the server side.
As a preferred embodiment, the number of online users can be predicted in advance at the server.
In step S202, the server responds to the message communication instruction of the user currently initiating the network request. When the user end needs to chat through the chat room, the corresponding communication instruction is sent. When the user end has the chat information data sending requirement, the communication instruction is sent correspondingly.
As an optional implementation manner, the communication instruction carries a user ID.
As a preferred embodiment, the communication instruction includes but is not limited to: based on chat information data in different scenes.
In step S203, based on the message communication command, the preset message data processing policy of the number of online users, and the users with different roles in the chat room, the server side issues and/or receives message data. And responding to the message communication instruction at the server end, and simultaneously combining the preset message data processing strategy of the number of the online users and the users with different roles in the chat room at the book searching server end to send message data to the users with different roles. And simultaneously, receiving message data sent by users with different roles through message communication instructions.
As an alternative embodiment, the message data is generated when the users of the different chat characters interact with each other through the chat room. The interaction scenario of the users through the chat room may be that the users without roles auction the products, such as users including auctioneers, clients, buyers, and the like, and the users can chat and auction through the chat room.
As a preferred embodiment, each user enters the chat room through a user side, and the preset message data processing policy is used for acquiring message data from users with different roles in the case of a new message. Each user can enter the chat room through the user terminal. In addition, it should be noted that the preset message data processing policy is used for acquiring message data from the users in different roles in the case of a new message. When a new message is generated, the user at the user end can pull the message data.
From the above description, it can be seen that the following technical effects are achieved by the present application:
by adopting the mode of determining the number of the current online users in the chat room and responding to the message communication instruction of the user who initiates the network request at present, the aim of issuing and/or receiving message data based on the message communication instruction, the preset message data processing strategy of the number of the online users and the users with different roles in the chat room is fulfilled, so that the technical effects of high stability and real-time performance of the message data based on the chat room are realized, and the technical problem of insufficient stability and accuracy processing capability of the message processing in the chat room with large-scale number of online users is solved.
As a preference in the present embodiment, the present invention further includes: dividing the chat room into at least a first chat room and a second chat room according to the service access flow estimation result; obtaining a first chat room message channel and a second chat room message channel according to the first chat room, the second chat room and different preset message isolation channels; issuing first message data through the first chat room message channel, wherein the first message data is used for issuing through the appointed first chat room message channel; and issuing second message data through the second chat room message channel, wherein the first message data is used for issuing through the second chat room message channel or a third chat room message channel.
If a large number of live broadcast rooms are generated, explosive requests can be brought, so that failure caused by the large number of live broadcast rooms cannot affect the majority of small live broadcast rooms. In specific implementation, the estimation result of the service access flow is obtained through operation estimation or historical data. Dividing the chat room into at least a first chat room and a second chat room according to the service access flow estimation result; obtaining a first chat room message channel and a second chat room message channel according to the first chat room, the second chat room and different preset message isolation channels; and issuing first message data through the first chat room message channel, wherein the first message data is used for issuing through the appointed first chat room message channel; and issuing second message data through the second chat room message channel, wherein the first message data is used for issuing through the second chat room message channel or a third chat room message channel.
The first chat room message channel is used for isolating the VIP message server, for example, the segmentation of a hot chat room and a common chat room server is carried out, the difference of occupied resources and the influence of problems are solved, and the traffic requests are isolated from a hardware server. For example, through business operation prejudgment, a hot auction is set as a VIP message server, and other people do not access the message server, so that the pressure of the system on the server is reduced. The second chat room message channel is used as a common message channel.
Preferably, the isolation VIP message server artificially separates the hot and ordinary auction chat rooms from the physical server, and the hot and ordinary auction chat room servers can be effectively prevented from influencing each other when an abnormality occurs.
As a preferable preference in this embodiment, issuing first message data through the first chat room message channel, where the first message data is used after being issued through the specified first chat room message channel, includes: receiving message data in the first chat room through the first chat room message channel; issuing second message data through the second chat room message channel, wherein the first message data is used after the second message data is issued through the second chat room message channel or a third chat room message channel, and the method comprises the following steps: receiving message data in the second chat room and/or a third chat room through the second chat room message channel.
In specific implementation, if a large number of live broadcast rooms are generated, explosive requests can be brought, so that failure caused by the large number of live broadcast rooms cannot affect most of small live broadcast rooms. In specific implementation, message data in the first chat room is received through the first chat room message channel; issuing second message data through the second chat room message channel, wherein the first message data is used after the second message data is issued through the second chat room message channel or a third chat room message channel, and the method comprises the following steps: receiving message data in the second chat room and/or a third chat room through the second chat room message channel.
As a preference in this embodiment, the message communication instruction of the user responding to the current network initiation request further includes: the users with different roles in the chat room comprise: a first persona user to facilitate a transaction in the chat room; receiving a new message written by the first role user and storing message data; and responding to the message communication instruction of the subscribing user which currently initiates the network request based on the subscribing user of the first role user, and issuing the message data.
The first persona user is used to facilitate a transaction in the chat room, for example, the first persona may be an auctioneer.
In specific implementation, the chat room is used for a first role user in users with different roles in the chat room. Receiving a new message written by the first role user at a background server and storing message data; and responding to the message communication instruction of the subscribing user which currently initiates the network request based on the subscribing user of the first role user, and issuing the message data. The above manner is a read diffusion mechanism, and writing data is very convenient and the data storage amount is relatively small through the read diffusion mechanism.
As a preferred option in this embodiment, the issuing and/or receiving message data based on the message communication instruction, a preset message data processing policy, and users with different roles in the chat room, where the message data is generated when the users with different chat roles interact with each other through the chat room, each of the users enters the chat room through a user side, and the preset message data processing policy is used for acquiring message data from the users with different roles in the case of a new message, and includes: receiving a network request of a client for pulling message data; based on a long polling mechanism, if no new message exists currently, keeping long connection with the client terminal until a new message is generated; within a preset period, receiving a network request used by the client for pulling message data again; and issuing the message data to the client and/or receiving the message data based on the message communication instruction with the first role user, the long connection message data processing strategy and the first role user in the chat room.
In specific implementation, through a longpoling mechanism, when the client side actively sends a request to the server side, the relevant data can be pulled. When the client initiates a Long Polling request, if the server does not have relevant data, the request is held by a hold until the server has the relevant data, or the request is returned after waiting for a certain time to timeout. After returning, the client side can immediately initiate the next Long Polling again. Based on a long polling mechanism, if no new message exists at the server terminal currently, the long link is kept with the client terminal until a new message is generated; in a preset period, the server receives the network request used by the client for pulling the message data again; and issuing the message data to the client side and/or receiving the message data through the server side based on the message communication instruction, the long connection message data processing strategy and the first role user in the chat room.
As a preferred option in this embodiment, the issuing and/or receiving message data based on the message communication instruction, a preset message data processing policy, and users with different roles in the chat room, where the message data is generated when the users with different chat roles interact with each other through the chat room, each of the users enters the chat room through a user side, and the preset message data processing policy is used for acquiring message data from the users with different roles in the case of a new message, and includes: when the real-time message in the online state in the chat room is abnormal, message data is issued to the client through an asynchronous thread task; and at least issuing the message data to the client once and/or receiving the message data based on the abnormal message communication instruction, the NoCache message data processing strategy and users with different roles in the chat room.
In specific implementation, the NoCache is a stateless cache. Stateless cache may be implemented including, but not limited to, by real-time notification: and writing the message into the list after sending the message, and sending a notice to the message server cluster. Asynchronous pulling: and after receiving the message notification, the message server triggers the asynchronous thread pulling. And (4) bottom polling: when the message server receives a chat room request, polling is triggered to ensure that the chat room has accessed the message list at least once in 1 second. Reading without lock: and through read-write table separation and atom switching, lock-free reading is realized. The message can be smoothly read by each client.
When the real-time message in the online state in the chat room is abnormal, the server sends message data to the client through the asynchronous thread task, and simultaneously sends the message data to the client through the asynchronous thread task; and at least issuing the message data to the client once based on the abnormal message communication instruction, the NoCache message data processing strategy and users with different roles in the chat room.
As a preferred option in this embodiment, the issuing and/or receiving message data based on the message communication instruction, a preset message data processing policy, and users with different roles in the chat room, where the message data is generated when the users with different chat roles interact with each other through the chat room, each of the users enters the chat room through a user side, and the preset message data processing policy is used for acquiring message data from the users with different roles in the case of a new message, and includes: marking the message based on the message communication instruction so as to distinguish different message lists when the client acquires message data; and issuing the message data to the client sides of the users with different roles in the chat room and/or receiving the message data according to a preset message priority message data processing strategy in the message list.
In specific implementation, a message list hierarchical design is adopted, in the case of message explosion, the message server list only stores about 1000 messages at most, and the messages may be covered or eliminated if not received. By marking the message, the message is divided into a common list and an important list when pulled again, the important message is received preferentially, and then the common message is received, so that the condition that the message is lost is avoided.
The server side marks the message based on the message communication instruction and is used for distinguishing different message lists when the client side obtains message data; and issuing the message data to the client sides of the users with different roles in the chat room and/or receiving the message data according to a preset message priority message data processing strategy in the message list.
As a preferred option in this embodiment, the issuing and/or receiving message data based on the message communication instruction, a preset message data processing policy, and users with different roles in the chat room, where the message data is generated when the users with different chat roles interact with each other through the chat room, each of the users enters the chat room through a user side, and the preset message data processing policy is used for acquiring message data from the users with different roles in the case of a new message, and includes: performing duplicate removal statistics on the message based on the message communication instruction so as to perform duplicate removal in advance when the client acquires message data; and issuing the duplicate-removed message data to the client sides of the users with different roles in the chat room and/or receiving the message data according to a preset duplicate-removed message data processing strategy.
In specific implementation, the preset deduplication message data processing strategy is based on a hyper-glog statistical method, and a probability algorithm is used for counting the approximate cardinality of the set, namely the most essential source of the algorithm is the Bernoulli process.
The server side performs duplicate removal statistics on the message based on the message communication instruction, so that the duplicate removal server side is performed in advance when the client side acquires message data; and issuing the duplicate-removed message data to the client sides of the users with different roles in the chat room and/or receiving the message data according to a preset duplicate-removed message data processing strategy.
As a preferable example in this embodiment, the issuing and/or receiving of message data based on the message communication instruction, the preset message data processing policy for the number of online users, and the users with different roles in the chat room, where the message data is generated when the users with different chat roles interact with each other through the chat room, each of the users enters the chat room through a user side, and the preset message data processing policy is used for acquiring the message data from the users with different roles in the case of a new message, and includes: determining a transaction instruction in the message communication instruction through an application scene in the chat room, wherein the application scene comprises an auction service; determining the corresponding preset message data processing strategy based on the number of the online users; based on the message communication instruction, the preset message data processing strategy of the number of the online users and the users with different roles in the chat room, issuing and/or receiving message data to the client participating in the auction service, wherein the preset message data processing strategy of the number of the online users at least comprises one of the following strategies: read diffusion mechanism, longpoling strategy, NoCache strategy, message list grading strategy, Hyperoglog-based statistical strategy and VIP message server isolation strategy.
In specific implementation, a transaction instruction in the message communication instruction is determined through an application scenario in the chat room, wherein the application scenario comprises an auction service.
Based on the service scene, the target that people need to support high online people is achieved according to the characteristics of the chat room, and a read diffusion mechanism is a better reasonable mode. And other reasonable mechanism measures are adopted to combine a reasonable and effective technical architecture scheme, wherein the scheme needs to comprise a read diffusion mechanism, a longpoling mechanism, NoCache design, message list classification, a hyper-glog statistical method-based isolation VIP message server.
It should be noted that the steps illustrated in the flowcharts of the figures may be performed in a computer system such as a set of computer-executable instructions and that, although a logical order is illustrated in the flowcharts, in some cases, the steps illustrated or described may be performed in an order different than presented herein.
According to an embodiment of the present application, there is also provided a data processing apparatus for a chat room, which is configured to implement the above method, and as shown in fig. 3, the apparatus includes:
a determining module 301, configured to determine the number of current online users in the chat room;
a response module 302, configured to respond to a message communication instruction of the user currently initiating a network request;
a message processing module 303, configured to issue and/or receive message data based on the message communication instruction, a preset message data processing policy for the number of online users, and users with different roles in the chat room, where the message data is generated when users with different chat roles interact with each other through the chat room, each user enters the chat room through a user side, and the preset message data processing policy is used to obtain message data from users with different roles in the case of a new message
In the embodiment of the present application, the server side in the determining module 301 needs to count the number of current online users in the chat room, and for the number of online users with different magnitudes, the server side may process the message data in a corresponding manner.
As an alternative implementation, the number of users on line based on the history can be counted at the server side.
As a preferred embodiment, the number of online users can be predicted in advance at the server.
In the response module 302 in this embodiment of the present application, a message communication instruction of the user, which is currently initiating a network request, is responded to at a server side. When the user end needs to chat through the chat room, the corresponding communication instruction is sent. When the user end has the chat information data sending requirement, the communication instruction is sent correspondingly.
As an optional implementation manner, the communication instruction carries a user ID.
As a preferred embodiment, the communication instruction includes but is not limited to: based on chat information data in different scenes.
In the message processing module 303 in the embodiment of the present application, based on the message communication instruction, the preset message data processing policy of the number of online users, and the users with different roles in the chat room, the message data is issued and/or received at the server side. And responding to the message communication instruction at the server end, and simultaneously combining the preset message data processing strategy of the number of the online users and the users with different roles in the chat room at the book searching server end to send message data to the users with different roles. And simultaneously, receiving message data sent by users with different roles through message communication instructions.
As an alternative embodiment, the message data is generated when the users of the different chat characters interact with each other through the chat room. The interaction scenario of the users through the chat room may be that the users without roles auction the products, such as users including auctioneers, clients, buyers, and the like, and the users can chat and auction through the chat room.
As a preferred embodiment, each user enters the chat room through a user side, and the preset message data processing policy is used for acquiring message data from users with different roles in the case of a new message. Each user can enter the chat room through the user terminal. In addition, it should be noted that the preset message data processing policy is used for acquiring message data from the users in different roles in the case of a new message. When a new message is generated, the user at the user end can pull the message data.
It will be apparent to those skilled in the art that the modules or steps of the present application described above may be implemented by a general purpose computing device, they may be centralized on a single computing device or distributed across a network of multiple computing devices, and they may alternatively be implemented by program code executable by a computing device, such that they may be stored in a storage device and executed by a computing device, or fabricated separately as individual integrated circuit modules, or fabricated as a single integrated circuit module from multiple modules or steps. Thus, the present application is not limited to any specific combination of hardware and software.
In order to better understand the above flow of the data processing method based on the chat room, the following explains the above technical solutions with reference to the preferred embodiments, but the technical solutions of the embodiments of the present invention are not limited thereto.
The data processing method based on the chat room in the embodiment of the application adopts a mode of determining the number of current online users in the chat room, and achieves the purpose of issuing and/or receiving message data based on the message communication instruction, the preset message data processing strategy of the number of the online users and users with different roles in the chat room by responding to the message communication instruction of the user who initiates the network request at present, thereby realizing the high stability and real-time performance of the message data based on the chat room,
as shown in fig. 4, which is a flow schematic of a data processing method based on a chat room in the embodiment of the present application, a specific implementation process includes the following steps:
step S401, dividing the chat room into at least a first chat room and a second chat room according to the service access flow estimation result.
Step S402, obtaining a first chat room message channel and a second chat room message channel according to the first chat room, the second chat room and different preset message isolation channels.
Step S403, issuing first message data through the first chat room message channel, where the first message data is used for issuing through the specified first chat room message channel.
Step S404, issuing second message data through the second chat room message channel, wherein the first message data is used for issuing through the second chat room message channel or a third chat room message channel.
The first chat room message channel is used for isolating the VIP message server, for example, the segmentation of a hot chat room and a common chat room server is carried out, the difference of occupied resources and the influence of problems are solved, and the traffic requests are isolated from a hardware server. For example, through business operation prejudgment, a hot auction is set as a VIP message server, and other people do not access the message server, so that the pressure of the system on the server is reduced. The second chat room message channel or the third chat room message channel is used as a common message channel.
Preferably, the isolation VIP message server artificially separates the hot and ordinary auction chat rooms from the physical server, and the hot and ordinary auction chat room servers can be effectively prevented from influencing each other when an abnormality occurs.
Step S405, receiving message data in the second chat room and/or the third chat room through the second chat room message channel.
Step S406, determining whether to issue the first message data through the first chat room message channel.
Step S407, receiving message data in the first chat room through the first chat room message channel.
In specific implementation, if a large number of live broadcast rooms are generated, explosive requests can be brought, so that failure caused by the large number of live broadcast rooms cannot affect most of small live broadcast rooms. In specific implementation, message data in the first chat room is received through the first chat room message channel; issuing second message data through the second chat room message channel, wherein the first message data is used after the second message data is issued through the second chat room message channel or a third chat room message channel, and the method comprises the following steps: receiving message data in the second chat room and/or a third chat room through the second chat room message channel.
Step S408, receiving message data in the second chat room and/or the third chat room through the second chat room message channel.
The server end needs to count the number of current online users in the chat room, and for the number of online users with different magnitudes, the server end can process the message data in a corresponding mode.
Step S409, receiving message data in the second chat room and/or the third chat room through the second chat room message channel.
And responding to the message communication instruction of the user currently initiating the network request at the server side. When the user end needs to chat through the chat room, the corresponding communication instruction is sent. When the user end has the chat information data sending requirement, the communication instruction is sent correspondingly.
Step S410, receiving message data in the second chat room and/or the third chat room through the second chat room message channel.
And issuing and/or receiving message data at a server side based on the message communication instruction, the preset message data processing strategy of the number of the online users and the users with different roles in the chat room. And responding to the message communication instruction at the server end, and simultaneously combining the preset message data processing strategy of the number of the online users and the users with different roles in the chat room at the book searching server end to send message data to the users with different roles. And simultaneously, receiving message data sent by users with different roles through message communication instructions.
As an alternative embodiment, the message data is generated when the users of the different chat characters interact with each other through the chat room. The interaction scenario of the users through the chat room may be that the users without roles auction the products, such as users including auctioneers, clients, buyers, and the like, and the users can chat and auction through the chat room.
As a preferred embodiment, each user enters the chat room through a user side, and the preset message data processing policy is used for acquiring message data from users with different roles in the case of a new message. Each user can enter the chat room through the user terminal. In addition, it should be noted that the preset message data processing policy is used for acquiring message data from the users in different roles in the case of a new message. When a new message is generated, the user at the user end can pull the message data.
And determining a transaction instruction in the message communication instruction through an application scene in the chat room, wherein the application scene comprises an auction service.
Based on the service scene, the target of supporting high online people is achieved according to the characteristics of the chat room, and a read diffusion mechanism is a better reasonable mode. And other reasonable mechanism measures are adopted to combine a reasonable and effective technical architecture scheme, wherein the scheme needs to comprise a read diffusion mechanism, a longpoling mechanism, NoCache design, message list classification, a hyper-glog statistical method-based isolation VIP message server. The read-diffusion mechanism is very convenient for writing data and the data storage is relatively small.
And a longpoling mechanism is adopted, the message is pulled through the client, the pressure of the server is reduced, and the message is not lost when the online number is higher.
And adopting NoCache design, adopting asynchronous message diffusion, and adopting bottom-trapping measures to pull the message at least once if the message is abnormal.
And (3) adopting a hyper-glog probability-based statistical method, reducing the cost of the duplicate removal data as much as possible, and reducing the cost from the time and space angles.
The important message is separated from the common message by adopting a hierarchical design of a message list.
The above description is only a preferred embodiment of the present application and is not intended to limit the present application, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims (10)
1. A data processing method based on a chat room is characterized by comprising the following steps:
determining the number of current online users in the chat room;
responding to a message communication instruction of the user currently initiating the network request;
and issuing and/or receiving message data based on the message communication instruction, a preset message data processing strategy of the number of the online users and users with different roles in the chat room, wherein the message data is generated when the users with different chat roles interact through the chat room, each user enters the chat room through a user side, and the preset message data processing strategy is used for acquiring the message data from the users with different roles under the condition that new messages exist.
2. The method of claim 1, further comprising:
dividing the chat room into at least a first chat room and a second chat room according to the service access flow estimation result;
obtaining a first chat room message channel and a second chat room message channel according to the first chat room, the second chat room and different preset message isolation channels;
issuing first message data through the first chat room message channel, wherein the first message data is used for issuing through the appointed first chat room message channel;
and issuing second message data through the second chat room message channel, wherein the first message data is used for issuing through the second chat room message channel or a third chat room message channel.
3. The method of claim 2, wherein;
issuing first message data through the first chat room message channel, wherein the first message data is used after being issued through the specified first chat room message channel, and the method comprises the following steps:
receiving message data in the first chat room through the first chat room message channel;
issuing second message data through the second chat room message channel, wherein the first message data is used after the second message data is issued through the second chat room message channel or a third chat room message channel, and the method comprises the following steps:
receiving message data in the second chat room and/or a third chat room through the second chat room message channel.
4. The method of claim 1, wherein the messaging instructions in response to the user currently initiating the network request further comprise:
the users with different roles in the chat room comprise: a first persona user to facilitate a transaction in the chat room;
receiving a new message written by the first role user and storing message data;
and responding to the message communication instruction of the subscribing user which currently initiates the network request based on the subscribing user of the first role user, and issuing the message data.
5. The method of claim 4, wherein the issuing and/or receiving message data based on the message communication command, a preset message data processing policy, and users with different roles in the chat room, the message data being generated when the users with different chat roles interact with each other through the chat room, each of the users entering the chat room through a user side, the preset message data processing policy being used for acquiring message data from the users with different roles in case of a new message comprises:
receiving a network request of a client for pulling message data;
based on a long polling mechanism, if no new message exists currently, keeping long connection with the client terminal until a new message is generated;
within a preset period, receiving a network request used by the client for pulling message data again;
and issuing the message data to the client and/or receiving the message data based on the message communication instruction with the first role user, the long connection message data processing strategy and the first role user in the chat room.
6. The method of claim 1, wherein the issuing and/or receiving message data based on the message communication command, a preset message data processing policy, and users with different roles in the chat room, the message data being generated when the users with different chat roles interact with each other through the chat room, each of the users entering the chat room through a user side, the preset message data processing policy being used for acquiring message data from the users with different roles in case of a new message comprises:
when the real-time message in the online state in the chat room is abnormal, message data is issued to the client through an asynchronous thread task;
and at least issuing the message data to the client once and/or receiving the message data based on the abnormal message communication instruction, the NoCache message data processing strategy and users with different roles in the chat room.
7. The method of claim 1, wherein the issuing and/or receiving message data based on the message communication command, a preset message data processing policy, and users with different roles in the chat room, the message data being generated when the users with different chat roles interact with each other through the chat room, each of the users entering the chat room through a user side, the preset message data processing policy being used for acquiring message data from the users with different roles in case of a new message comprises:
marking the message based on the message communication instruction so as to distinguish different message lists when the client acquires message data;
and issuing the message data to the client sides of the users with different roles in the chat room and/or receiving the message data according to a preset message priority message data processing strategy in the message list.
8. The method of claim 1, wherein the issuing and/or receiving message data based on the message communication command, a preset message data processing policy, and users with different roles in the chat room, the message data being generated when the users with different chat roles interact with each other through the chat room, each of the users entering the chat room through a user side, the preset message data processing policy being used for acquiring message data from the users with different roles in case of a new message comprises:
performing duplicate removal statistics on the message based on the message communication instruction so as to perform duplicate removal in advance when the client acquires message data;
and issuing the duplicate-removed message data to the client sides of the users with different roles in the chat room and/or receiving the message data according to a preset duplicate-removed message data processing strategy.
9. The method of claim 1, wherein the issuing and/or receiving message data based on the message communication command, the preset message data processing policy for the number of online users, and users with different roles in the chat room, the message data being generated when the users with different chat roles interact with each other through the chat room, each of the users entering the chat room through a user side, the preset message data processing policy for obtaining message data from the users with different roles in case of a new message comprises:
determining a transaction instruction in the message communication instruction through an application scene in the chat room, wherein the application scene comprises an auction service;
determining the corresponding preset message data processing strategy based on the number of the online users;
based on the message communication instruction, the preset message data processing strategy of the number of the online users and the users with different roles in the chat room, issuing and/or receiving message data to the client participating in the auction service, wherein the preset message data processing strategy of the number of the online users at least comprises one of the following strategies: read diffusion mechanism, longpoling strategy, NoCache strategy, message list grading strategy, Hyperoglog-based statistical strategy and VIP message server isolation strategy.
10. A data processing apparatus for a chat room, comprising:
the confirming module is used for confirming the number of current online users in the chat room;
the response module is used for responding to the message communication instruction of the user which currently initiates the network request;
and the message processing module is used for issuing and/or receiving message data based on the message communication instruction, the preset message data processing strategy of the number of the online users and the users with different roles in the chat room, wherein the message data are generated when the users with different chat roles interact through the chat room, each user enters the chat room through a user side, and the preset message data processing strategy is used for acquiring the message data from the users with different roles under the condition of new messages.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111137132.5A CN113965810A (en) | 2021-09-27 | 2021-09-27 | Data processing method and device based on chat room |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111137132.5A CN113965810A (en) | 2021-09-27 | 2021-09-27 | Data processing method and device based on chat room |
Publications (1)
Publication Number | Publication Date |
---|---|
CN113965810A true CN113965810A (en) | 2022-01-21 |
Family
ID=79462302
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111137132.5A Pending CN113965810A (en) | 2021-09-27 | 2021-09-27 | Data processing method and device based on chat room |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113965810A (en) |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2007016851A1 (en) * | 2005-08-10 | 2007-02-15 | Huawei Technologies Co., Ltd. | A method for establishing the chat room data transmission channel to realize the chat message transmission |
US20140149522A1 (en) * | 2012-11-27 | 2014-05-29 | Nhn Corporation | System and method for online fan meeting |
CN107038631A (en) * | 2017-04-21 | 2017-08-11 | 山东佳联电子商务有限公司 | It is a kind of to put the intelligent auction system for clapping net |
CN107222316A (en) * | 2017-05-25 | 2017-09-29 | 游密科技(深圳)有限公司 | A kind of the chatroom collocation method and chat room system of adaptive room number |
CN108173917A (en) * | 2017-12-22 | 2018-06-15 | 杭州顺网珑腾信息技术有限公司 | A kind of Internet chatroom message repeater system of distribution no maximum |
CN109361932A (en) * | 2018-11-23 | 2019-02-19 | 武汉斗鱼网络科技有限公司 | The method that temperature prediction is broadcast live, device, equipment and medium |
CN109831417A (en) * | 2018-12-28 | 2019-05-31 | 广州华多网络科技有限公司 | Method, apparatus, server and the storage medium of anti-harassment processing account number |
CN111414516A (en) * | 2020-03-17 | 2020-07-14 | 北京字节跳动网络技术有限公司 | Live broadcast room message processing method and device, electronic equipment and storage medium |
-
2021
- 2021-09-27 CN CN202111137132.5A patent/CN113965810A/en active Pending
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2007016851A1 (en) * | 2005-08-10 | 2007-02-15 | Huawei Technologies Co., Ltd. | A method for establishing the chat room data transmission channel to realize the chat message transmission |
US20140149522A1 (en) * | 2012-11-27 | 2014-05-29 | Nhn Corporation | System and method for online fan meeting |
CN107038631A (en) * | 2017-04-21 | 2017-08-11 | 山东佳联电子商务有限公司 | It is a kind of to put the intelligent auction system for clapping net |
CN107222316A (en) * | 2017-05-25 | 2017-09-29 | 游密科技(深圳)有限公司 | A kind of the chatroom collocation method and chat room system of adaptive room number |
CN108173917A (en) * | 2017-12-22 | 2018-06-15 | 杭州顺网珑腾信息技术有限公司 | A kind of Internet chatroom message repeater system of distribution no maximum |
CN109361932A (en) * | 2018-11-23 | 2019-02-19 | 武汉斗鱼网络科技有限公司 | The method that temperature prediction is broadcast live, device, equipment and medium |
CN109831417A (en) * | 2018-12-28 | 2019-05-31 | 广州华多网络科技有限公司 | Method, apparatus, server and the storage medium of anti-harassment processing account number |
CN111414516A (en) * | 2020-03-17 | 2020-07-14 | 北京字节跳动网络技术有限公司 | Live broadcast room message processing method and device, electronic equipment and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10817195B2 (en) | Key-value based message oriented middleware | |
US10701012B2 (en) | Method, apparatus and system for customer service information forwarding | |
US20140328478A1 (en) | Method and system for identifying prank call, client, server, and storage medium | |
US9881071B2 (en) | Transport layer abstraction for clustering implementation | |
CN111555963A (en) | Message pushing method and device, electronic equipment and storage medium | |
CN109547807B (en) | Information processing method and device based on live broadcast and server | |
CN110719221B (en) | Instant messaging method, device, equipment and storage medium | |
CN115004673B (en) | Message pushing method, device, electronic equipment and computer readable medium | |
CN103562890A (en) | Managing message subscription in publish/subscribe messaging system | |
CN111277483B (en) | Multi-terminal message synchronization method, server and storage medium | |
US9110739B2 (en) | Subscribing to multiple resources through a common connection | |
CN114338769A (en) | Access request processing method and device | |
CN110839061B (en) | Data distribution method, device and storage medium | |
CN112995266B (en) | Information pushing method and related equipment | |
CN112632093A (en) | Work order processing method, device, system, storage medium and program product | |
CN111797352A (en) | Method and device for sealing account and sealing system | |
CN113965810A (en) | Data processing method and device based on chat room | |
CN107730380B (en) | Method, system and server for processing joint account | |
CN106533891A (en) | Information processing method based on groups and device | |
CN113055461B (en) | ZooKeeper-based unmanned cluster distributed cooperative command control method | |
CN114595245A (en) | Data processing method and device | |
CN113014404A (en) | Message transmission method and device, server and second client | |
EP2194679B1 (en) | A method and system for managing the user information in the instant messaging system | |
CN115168366B (en) | Data processing method, data processing device, electronic equipment and storage medium | |
CN110198524A (en) | A kind of corresponding relationship processing method and processing device based on intercommunication RCS 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 |