CN112882847B - Barrage message processing method, device and system - Google Patents

Barrage message processing method, device and system Download PDF

Info

Publication number
CN112882847B
CN112882847B CN202110209311.9A CN202110209311A CN112882847B CN 112882847 B CN112882847 B CN 112882847B CN 202110209311 A CN202110209311 A CN 202110209311A CN 112882847 B CN112882847 B CN 112882847B
Authority
CN
China
Prior art keywords
message
barrage
live broadcast
live
server
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110209311.9A
Other languages
Chinese (zh)
Other versions
CN112882847A (en
Inventor
陈波
矫百龙
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hainan Chezhiyi Communication Information Technology Co ltd
Original Assignee
Hainan Chezhiyi Communication Information Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hainan Chezhiyi Communication Information Technology Co ltd filed Critical Hainan Chezhiyi Communication Information Technology Co ltd
Priority to CN202110209311.9A priority Critical patent/CN112882847B/en
Publication of CN112882847A publication Critical patent/CN112882847A/en
Application granted granted Critical
Publication of CN112882847B publication Critical patent/CN112882847B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • G06F16/24552Database cache management

Abstract

The invention discloses a barrage message processing method, which is suitable for being executed in a live broadcast server, wherein the live broadcast server comprises a data storage device, a first message buffer, a second message queue and a message processor, the live broadcast server is connected with a plurality of host broadcast terminals and a plurality of user terminals, and the host broadcast terminals are suitable for video live broadcast, and the method comprises the following steps: receiving bullet screen information sent by a user through a user terminal and storing the bullet screen information in a first information buffer; storing the barrage message in the first message buffer to a data storage device via a message processor, the message processor including a plurality of message consumers; when video live broadcasting corresponding to any bullet screen message is finished, the corresponding message consumer generates a live broadcasting finishing message and caches the live broadcasting finishing message to a second message queue; and according to the live broadcast ending message in the second message queue, performing deduplication processing on live broadcast barrage messages of the corresponding video stored in the data storage device. The invention also discloses a corresponding device and a system.

Description

Barrage message processing method, device and system
Technical Field
The invention relates to the field of live video broadcasting, in particular to a barrage message processing method, device and system.
Background
For years, video live broadcast services have been rapidly developed, various live broadcast technologies have also been developed, and in order to compete for traffic, various enterprises have to meet the requirements of video quality, response speed, video quality and the like when the user rebroadcasts video after live broadcast is finished, in addition to meeting the video quality requirements of the user to the greatest extent. One user interaction mode of live video is live video bullet screen, and how to quickly and accurately load bullet screen information during replay becomes a key factor affecting replay video effect.
The bullet screen information is generally buffered through a buffering mechanism, the buffering can be in multiple stages, when in live broadcasting, a user sends the bullet screen information to a live broadcasting server, the server receives the bullet screen information and stores the bullet screen information in a database, and a message consumer writes the bullet screen information into the database by inserting the bullet screen information into a message queue. Meanwhile, bullet screen information is cached, corresponding caching time is set, and common caching mechanisms include redis and encche. When the user rebroadcasts the video, a data request message is sent to request the barrage message of the corresponding period, firstly, the corresponding barrage message is obtained from the cache, if the corresponding barrage message does not exist in the cache, the corresponding barrage message is requested to the database, barrage deduplication is carried out after the barrage message is obtained, and the barrage message is returned to the user.
It can be seen that when the user sends the barrage message actively and a large number of users exist, a large number of barrage messages are queued in the message queue and cannot be stored in the database in time, so that when the user replay, the barrage message is not stored in the database in time, and a barrage idle period appears. On the other hand, performing deduplication upon a data request increases the risk of the data request interface. Meanwhile, the caching time of the data in the cache is uniformly set, so that the cache space is wasted for caching bullet screen data of the video with low heat.
Disclosure of Invention
Accordingly, the present invention provides a barrage message processing method, apparatus, and system that seeks to solve or at least mitigate the above-identified problems.
According to one aspect of the present invention, there is provided a barrage message processing method adapted to be executed in a live broadcast server, the live broadcast server comprising a data storage device, a first message buffer, a second message queue and a message processor, the live broadcast server being connected to a plurality of anchor terminals and a plurality of user terminals, the anchor terminals being adapted to perform live video broadcast, the method comprising: receiving a barrage message sent by a user through a user terminal, and storing the barrage message into a first message buffer; storing the barrage message in the first message buffer to a data storage device via a message processor, the message processor including a plurality of message consumers; when the live broadcast of the video corresponding to any bullet screen message is finished, a message consumer processing the live broadcast bullet screen message generates a live broadcast finishing message, and the live broadcast finishing message is cached to a second message queue; and according to the live broadcast ending message in the second message queue, performing deduplication processing on live broadcast barrage messages of the corresponding video stored in the data storage device.
Optionally, in the barrage message processing method according to the present invention, the first message buffer includes a plurality of message queues, receiving barrage messages sent by a user through a user terminal, and inserting the barrage messages into the first message buffer includes: generating a routing key of the barrage message according to the barrage message; and transmitting the barrage message to a plurality of message queues according to the routing key.
Optionally, in the barrage message processing method according to the present invention, the storing, by the message processor, the barrage message in the first message buffer to the data storage device includes: the message consumer obtains the barrage message from the corresponding message queue and stores the barrage message to the data storage device.
Optionally, in the barrage message processing method according to the present invention, according to the live broadcast end message in the second message queue, performing the deduplication processing on the barrage message of the corresponding live video stored in the data storage device includes: detecting repeated barrage messages in the corresponding video live broadcast according to the live broadcast ending message; and storing the repeated barrage messages in the form of barrage messages and repeated times, and deleting the repeated barrage messages.
Optionally, in the barrage message processing method according to the present invention, the user terminal is further adapted to replay the finished live video, and the live video server is communicatively connected to a cache server, where the cache server is used to cache the barrage message, and the cache server is communicatively connected to the user terminal, and the method further includes: when the user terminal plays back, sending a data request message to a cache server to acquire a corresponding barrage message; if the cache server does not have the barrage message, the cache server sends a data request message and a warming request message to the live broadcast server.
Optionally, in the barrage message processing method according to the present invention, the live broadcast server further includes a third message queue and a fourth message queue, and the method further includes: receiving a data request message sent by the user terminal through a third message queue, and returning a corresponding barrage message according to the data request message; and receiving the preheating request message sent by the cache server through the fourth message queue, and returning a corresponding barrage message according to the preheating request message so as to be cached by the cache server.
Optionally, in the barrage message processing method according to the present invention, each hosting terminal corresponds to a live broadcast room, and has a unique live broadcast room serial number, and the data request message includes a first start time, a first end time and a current live broadcast room serial number; the first ending time is the first starting time plus a second preset duration, the preheating request message comprises the second starting time, the second ending time and the current live broadcasting room serial number, the second starting time is the first ending time, and the second ending time is the second starting time plus the second preset duration.
Optionally, in the barrage message processing method according to the present invention, the cache server includes a hot value cache time relation table, and the cache server sets the cache time according to the hot value cache time relation table when caching the barrage message.
Optionally, in the barrage message processing method according to the present invention, the data storage device is a MySQL database.
Optionally, in the barrage message processing method according to the present invention, the cache server is a redis server.
According to another aspect of the present invention, there is provided a barrage message processing apparatus adapted to reside in a live broadcast server, the live broadcast server comprising a data storage device, a first message buffer, a second message queue, and a message processor, the live broadcast server being connected to a plurality of anchor terminals and a plurality of user terminals, the anchor terminals being adapted to conduct live video broadcast, the user terminals being adapted to receive barrage messages sent by the user terminals, wherein the first message buffer is adapted to receive barrage messages sent by the user terminals; a message processor adapted to store the barrage message in the first message buffer to the data storage device, the message processor including a plurality of message consumers; the second message queue is suitable for storing the live broadcast ending message when the live broadcast ending message is generated by a message consumer processing the live broadcast barrage message of any live broadcast corresponding to the barrage message; the data storage device is suitable for storing the barrage information and is also suitable for carrying out de-duplication processing on the barrage information of the corresponding video live broadcast stored in the data storage device according to the live broadcast ending information in the second information queue.
According to still another aspect of the present invention, there is provided a bullet screen message processing system, including a live broadcast server, a cache server, a user terminal, and a live broadcast terminal, where the live broadcast terminal is adapted to perform live video broadcast; the user terminal is suitable for sending bullet screen information and replaying video live broadcast; the live broadcast server is suitable for executing the barrage message processing method; and the cache server is suitable for caching live video barrage messages.
According to yet another aspect of the present invention, there is provided a computing device comprising: at least one processor; and a memory storing program instructions, wherein the program instructions are configured to be adapted to be executed by the at least one processor, the program instructions comprising instructions for performing the barrage message processing method as above.
According to still another aspect of the present invention, there is provided a readable storage medium storing program instructions that, when read and executed by a computing device, cause the computing device to perform the barrage message processing method as above.
According to the bullet screen message processing method, in the video live broadcast process, bullet screen messages cached in the first message buffer are stored into the data storage device through a plurality of message consumers, so that the processing speed of the bullet screen messages is improved, a large amount of backlog of the bullet screen messages is avoided, meanwhile, due to the improvement of the processing speed of the bullet screen messages, the bullet screen messages can be stored into the database quickly, and therefore when a user plays a video again, the corresponding bullet screen messages can be obtained from the database in time, and the defect of the bullet screen blank stage is avoided. The bullet screen message processing method also buffers the live broadcast ending message by adding the second message queue, so as to timely remove the duplication of the bullet screen message of the ending video live broadcast in the data storage device, and also alleviate the defect of overtime caused by interface duplication removal.
Further, when the cache server requests the barrage message of the current period, the barrage message of the next period is also requested through the preheating request message, so that the user can be ensured to acquire the barrage message of the next period through the cache, the interaction between the user and the database is reduced, and the data processing pressure of the database is reduced. And when the data is cached, the caching time is adjusted according to the heat of the video, so that the inventory time of invalid caching is reduced, and the effective utilization rate of the caching is improved.
Drawings
To the accomplishment of the foregoing and related ends, certain illustrative aspects are described herein in connection with the following description and the annexed drawings, which set forth the various ways in which the principles disclosed herein may be practiced, and all aspects and equivalents thereof are intended to fall within the scope of the claimed subject matter. The above, as well as additional objects, features, and advantages of the present disclosure will become more apparent from the following detailed description when read in conjunction with the accompanying drawings. Like reference numerals generally refer to like parts or elements throughout the present disclosure.
FIG. 1 shows a schematic diagram of a barrage message processing system 100 according to one embodiment of the invention;
FIG. 2 illustrates a block diagram of a computing device 200 in accordance with one embodiment of the invention;
FIG. 3 shows a schematic diagram of a barrage message processing apparatus 300 according to one embodiment of the invention;
FIG. 4 illustrates a flow diagram of a barrage message processing method 400 according to one embodiment of the invention;
fig. 5 shows a flow diagram of a barrage message processing method 500 according to one embodiment of the invention.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
FIG. 1 shows a schematic diagram of a barrage message processing system 100 according to one embodiment of the invention. As shown in fig. 1, the barrage message processing system 100 includes a anchor terminal 110, a user terminal 120, a cache server 130, and a live broadcast server 140, and is communicatively connected to each other. It should be noted that the barrage message processing system of fig. 1 is merely exemplary, and in particular practice there may be different numbers of anchor terminals 110 and user terminals 120 in the barrage message processing system 100, and the present invention is not limited to the number of anchor terminals and user terminals in the barrage message processing system.
The anchor terminal 110 and the user terminal 120 may be personal computers such as desktop computers and notebook computers, mobile terminal devices such as smart phones and tablet computers, smart televisions or other multimedia devices, but are not limited thereto.
The cache server 130 may be implemented as a server, or may be a cluster or a distributed system formed by a plurality of servers, where when the server is a plurality of servers, the plurality of servers may be deployed at the same geographic location, or may be distributed at a plurality of geographic locations, and the data storage form in the cache may be redis, encach, or the like, and the number of servers included in the cache server, the deployment location of each server, and the implementation form of the cache are not limited.
The live broadcast server 140 is a service end of a live broadcast application, and may receive a bullet screen message sent by a user terminal and store the bullet screen message in a data storage device (not shown in fig. 1), where the data storage device may be a data storage device inside the live broadcast server, or may be an external storage device communicatively connected to the live broadcast server 140, where the data storage device may be a relational database, for example MySQL, ACCESS, or may be a non-relational database, for example NoSQL, where the live broadcast server is used to store data, and the specific deployment and configuration situations of the data server are not limited in the present invention.
According to one embodiment of the invention, a host player can perform video live broadcast through the host broadcast terminal 110 to form a live broadcast room and has a corresponding live broadcast room serial number, and in the live broadcast process, a user can send barrage information through the user terminal 120 to interact, so that the user can review video replay and load corresponding barrage information after the live broadcast is finished, and in the live broadcast process, live broadcast video needs to be stored, and barrage information needs to be stored. The live broadcast server 140 sends the barrage message to the cache server 130 for data synchronization caching, and stores the barrage message. When the live broadcast is finished, the user plays back the video live broadcast which is finished through the user terminal 120, and loads the corresponding barrage message at the same time, at this time, the user firstly requests the barrage message corresponding to the current playing video time period from the cache server 130, when the barrage message requested by the user does not exist in the cache server 130 (for example, the barrage message is deleted after the cache time period is exceeded), the data is requested from the live broadcast server, and the cache server obtains the barrage message corresponding to the next time period of the video by sending the preheating request message to the live broadcast server 140, so that the user terminal can successfully obtain the next time of requesting the data without requesting from the live broadcast server.
Both the cache server and the live server of fig. 1 may be implemented by a computing device, and fig. 2 illustrates a block diagram of a computing device 200 in accordance with one embodiment of the invention. It should be noted that the computing device 200 shown in fig. 2 is only an example, and in practice, the computing device for implementing the barrage message processing method of the present invention may be any type of device, and the hardware configuration of the computing device may be the same as the computing device 200 shown in fig. 2 or may be different from the computing device 200 shown in fig. 2. In practice, the computing device for implementing the barrage message processing method of the present invention may add or delete hardware components of the computing device 200 shown in fig. 2, and the present invention is not limited to the specific hardware configuration of the computing device.
As shown in FIG. 2, in a basic configuration 202, a computing device 200 typically includes a system memory 206 and one or more processors 204. A memory bus 208 may be used for communication between the processor 204 and the system memory 206.
Depending on the desired configuration, the processor 204 may be any type of processing including, but not limited to: a microprocessor (μp), a microcontroller (μc), a digital information processor (DSP), or any combination thereof. Processor 204 may include one or more levels of cache, such as a first level cache 210 and a second level cache 212, a processor core 214, and registers 216. The example processor core 214 may include an Arithmetic Logic Unit (ALU), a Floating Point Unit (FPU), a digital signal processing core (DSP core), or any combination thereof. The example memory controller 218 may be used with the processor 204, or in some implementations, the memory controller 218 may be an internal part of the processor 204.
Depending on the desired configuration, system memory 206 may be any type of memory including, but not limited to: volatile memory (such as RAM), non-volatile memory (such as ROM, flash memory, etc.), or any combination thereof. Physical memory in a computing device is often referred to as volatile memory, RAM, and data in disk needs to be loaded into physical memory in order to be read by processor 204. The system memory 206 may include an operating system 220, one or more applications 222, and program data 224. In some implementations, the application 222 may be arranged to execute instructions on an operating system by the one or more processors 204 using the program data 224. The operating system 220 may be, for example, linux, windows or the like, which includes program instructions for handling basic system services and performing hardware-dependent tasks. The application 222 includes program instructions for implementing various user desired functions, and the application 222 may be, for example, a browser, instant messaging software, a software development tool (e.g., integrated development environment IDE, compiler, etc.), or the like, but is not limited thereto. When an application 222 is installed into computing device 200, a driver module may be added to operating system 220.
When the computing device 200 starts up running, the processor 204 reads the program instructions of the operating system 220 from the memory 206 and executes them. Applications 222 run on top of operating system 220, utilizing interfaces provided by operating system 220 and underlying hardware, to implement various user-desired functions. When the user launches the application 222, the application 222 is loaded into the memory 206, and the processor 204 reads and executes the program instructions of the application 222 from the memory 206.
Computing device 200 also includes a storage device 232, where storage device 232 includes removable storage 236 and non-removable storage 238, where removable storage 236 and non-removable storage 238 are each connected to storage interface bus 234.
Computing device 200 may also include an interface bus 240 that facilitates communication from various interface devices (e.g., output devices 242, peripheral interfaces 244, and communication devices 246) to basic configuration 202 via bus/interface controller 230. The example output device 242 includes a graphics processing unit 248 and an audio processing unit 250. They may be configured to facilitate communication with various external devices, such as a display or speakers, via one or more a/V ports 252. The example peripheral interface 244 may include a serial interface controller 254 and a parallel interface controller 256, which may be configured to facilitate communication via one or more I/O ports 258 and external devices such as input devices (e.g., keyboard, mouse, pen, voice input device, touch input device) or other peripherals (e.g., printer, scanner, etc.). The example communication device 246 may include a network controller 260 that may be arranged to facilitate communication with one or more other computing devices 262 over a network communication link via one or more communication ports 264.
The network communication link may be one example of a communication medium. Communication media may typically be embodied by computer readable instructions, data structures, program modules, and may include any information delivery media in a modulated data signal, such as a carrier wave or other transport mechanism. A "modulated data signal" may be a signal that has one or more of its data set or changed in such a manner as to encode information in the signal. By way of non-limiting example, communication media may include wired media such as a wired network or special purpose network, and wireless media such as acoustic, radio Frequency (RF), microwave, infrared (IR) or other wireless media. The term computer readable media as used herein may include both storage media and communication media.
In the computing device 200 according to the present invention, the application 222 includes instructions for performing the barrage message processing method 400/500 of the present invention, which may instruct the processor 204 to perform the system barrage message processing method 400/500 of the present invention.
FIG. 3 illustrates a barrage message processing apparatus adapted to reside in a computing device (such as the computing device shown in FIG. 1) to execute instructions of the barrage message processing method 400/500 of the present invention, according to one embodiment of the present invention. As shown in fig. 3, the barrage message processing apparatus includes a first message processor 310, a message consumer group 320, a second message queue 330, a data store 340, a third message queue 350, and a fourth message queue 360.
The first message processor 310 is adapted to store the barrage messages sent by the user while watching live to await writing to the data storage device 340, the first message processor 310 comprising a plurality of message queues, each message queue receiving barrage messages from a different live room. According to one embodiment of the present invention, after receiving the barrage message, a routing key is generated according to the serial number of the live broadcasting room carried in the barrage message, and the barrage message is sent to different message queues according to the routing key, for example, the first message processor 310 includes 5 message queues, and according to an average allocation principle, the number of the tail numbers 0-9 ten tail numbers in the live broadcasting room in the routing key corresponds to 5 message queues on average, so that the result is: bullet messages with serial numbers of 0 and 1 in the live broadcasting room are inserted into a first message queue, bullet messages with serial numbers of 2 and 3 in the live broadcasting room are inserted into a second message queue, and so on.
The message consumer group 320 may be a combination of message consumers that are in one-to-one correspondence with the message queues in the first message processor, and continuing with the above embodiment, the 5 message queues respectively correspond to 5 message consumers, each of which is responsible for processing the barrage message in its corresponding message queue, and generating a live end message when any video live ends, and inserting the live end message into the second message queue 330.
The data storage device 340 is typically a database, such as MySQL database, for storing live video bullet messages, and performing deduplication processing on bullet messages of live video corresponding to the live end messages in the database according to the live end messages in the second message queue 330.
The third message queue 350 is adapted to receive a data request message sent by a user when replaying video, i.e. when the user needs to load a barrage message when viewing video replay via the user terminal, data will first be requested from the cache server, and when no corresponding data is present in the cache server, a data request message will be sent to the live server, which data request message will be inserted into the third message queue 350.
The fourth message queue 360 is adapted to receive warm-up request messages sent by the cache server. According to the embodiment, when the data information requested by the user does not exist in the cache server, whether bullet screen data information of the next period is stored is detected, and when the bullet screen data information of the next period does not exist, preheating request information is sent to the live broadcast server, so that the user can timely return when sending the data request of the next period.
Fig. 4 shows a flow chart of a barrage message processing method 400 according to one embodiment of the invention. The method 400 is suitable for execution in a computing device (e.g., the computing device shown in fig. 2) that completes the storage of the barrage message during the live video.
As shown in fig. 4, the method 400 begins at step S410, where a live server receives a bullet screen message sent when a user views a live video through a user terminal, and stores the bullet screen message to a first message processor.
According to one embodiment of the invention, when a user watches live video through a terminal (such as a mobile phone), the user terminal sends a barrage message to interact, the barrage message is sent to a corresponding live application server (i.e. a live broadcast server), and the live broadcast server inserts the barrage message into the first message processor after receiving the barrage message. The first message processor includes a plurality of message queues that can process bullet screen data for a plurality of live rooms in parallel. The bullet screen information is prevented from being detained and blocked in the information queue and cannot be stored in the database in time, so that the user cannot load the bullet screen information in time when replaying the video immediately after the video live broadcast is finished.
According to one embodiment of the invention, when bullet screen information is received, the bullet screen information can be inserted into the corresponding information queue according to the tail number of the live room number carried in the bullet screen information as a routing key. The routing key can also be formed by combining a plurality of information such as service names, function names, live broadcast room number tail numbers and the like carried in the barrage message, and the invention is not limited to the information. For example, the first message processor includes 10 message queues, there are currently 100 live rooms, the serial numbers of the live rooms are 0001, 0002, 0003, 0004 and 0005 … …, and the serial numbers of the live rooms are used as routing keys, and the live rooms are polled in the corresponding 10 message queues, so that the result is: live broadcasting room barrage message with serial number and tail number of 1 is inserted into first message queue, live broadcasting room barrage message with tail number of 2 is inserted into second message queue, and so on.
According to one embodiment of the invention, the barrage message is also sent to the cache server for caching.
The barrage message in the message queue is then stored into a database by the message processor in step S420.
According to one embodiment of the invention, the message processor comprises a plurality of message consumers, each message queue uniquely corresponds to one message consumer, namely, the first message queue corresponds to the first message consumer, and taking the 10 message queues as an example, the first message consumer processes barrage messages with the live room number tail number of 1 in the first message queue, and the second message consumer processes barrage messages with the live room number tail number of 2 in the second message queue.
Through the storage of the bullet screen messages processed in parallel by a plurality of message queues and a plurality of message consumers, namely, the number of live broadcasting rooms is huge, watching users are active, and when a large number of bullet screen messages are generated, the bullet screen messages in the queues can be processed in time and stored in a database, so that the bullet screen messages can not be acquired when the user selects replay when the live broadcasting is just finished. According to the barrage message processing method, the processing speed can be greatly improved, and the problem of the barrage message idle stage can be effectively avoided.
When the video live broadcast in any live broadcast room is finished, the message consumer generates a live broadcast end message after processing the associated barrage message, and inserts the live broadcast end message into the second message queue in step S430.
Continuing with the above description of the embodiments, the first message consumer generates a live end message after processing the live barrage message of the 0001 live room, where the live end message includes serial number information of the live room, and inserts the message into the second message queue.
In step S440, the database deduplicates the barrage message according to the live end message. According to the above embodiment, when the database monitors the ending message of the live video in the 0001 live room in the second message queue, the database detects the repeated message in the barrage message corresponding to the live video, and performs deduplication. For example, in the period from 60 seconds to 70 seconds of the video, there are 9 continuous messages of 666, at this time, 9 messages of 666 are stored in the database, and the 9 messages are integrated into a record of 666 and marked with the number of 9, so when the user requests the barrage message data, when the user returns, the barrage message of 666 can be directly returned, and the number of 9 is marked, thereby improving the response speed and avoiding the uncertainty caused by the completion of the deduplication in the data request interface.
Fig. 5 illustrates a flow diagram of a barrage message processing method 500 according to one embodiment of the invention. As shown in fig. 5, the method starts with step S510, in which the user replays the video, and needs to load a barrage message, and the user terminal first sends a data request message to the cache server to request the barrage message.
When there is no corresponding data in the cache server, step S520 is performed, where the user directly sends a data request message to the live server, receives the data request message from the third message queue in the live server, and returns corresponding data according to the data request message. According to one embodiment of the present invention, the data request will generally request a barrage message within a second preset duration in the future, such as the user replaying the video from the 0 th second of the video, the second preset duration being 10 seconds, then a barrage message from the 0 th second (the first start time) to the 10 th second (the first end time) will be requested at this time, and the live server returns the corresponding data.
In step S530, the cache server transmits a warm-up request message to the live server. In the above embodiment, when the cache server first receives a data request from the user requesting from 0 th to 10 th seconds, it detects whether the bullet message cache data from 10 th to 20 th seconds (second start time) is stored, and if not, it sends a warm-up request message (i.e. requests bullet data from 10 th to 20 th seconds) to the live server. The preset request message is inserted into a fourth message queue of the live server. The live broadcast server returns corresponding data according to the preset request message to be cached in the cache server, so that when the user requests the next ten seconds, the live broadcast server can timely return to the user, and meanwhile requests the barrage message of the next time period (namely 20 th to 30 th seconds).
According to one embodiment of the invention, a relationship table of the cache time of the heat value is stored in the cache server, the heat value corresponding to the video is stored in the relationship table, the cache time corresponding to the heat value is set according to the heat value of the video. For example, the heat value is classified into three levels of high, medium and low, the cache time of the heat value is 10 minutes, the cache time of the heat value is 5 minutes, and the cache time of the heat value is 2 minutes. The cache time is set according to the hotness value, so that interaction between a user and a live broadcast server and interaction between the user and a cache server can be reduced when the video with the high hotness value is replayed, and the occupation of the cache space can be reduced for the video with the low hotness value, and unnecessary caches can be timely deleted.
According to the bullet screen message processing method, in the video live broadcast process, bullet screen messages cached in the first message buffer are stored into the data storage device through a plurality of message consumers, so that the processing speed of the bullet screen messages is improved, a large amount of backlog of the bullet screen messages is avoided, meanwhile, due to the improvement of the processing speed of the bullet screen messages, the bullet screen messages can be stored into the database quickly, and therefore when a user plays a video again, the corresponding bullet screen messages can be obtained from the database in time, and the defect of the bullet screen blank stage is avoided. The bullet screen message processing method also buffers the live broadcast ending message by adding the second message queue, so as to timely remove the duplication of the bullet screen message of the ending video live broadcast in the data storage device, and also alleviate the defect of overtime caused by interface duplication removal.
Further, when the cache server requests the barrage message of the current period, the barrage message of the next period is also requested through the preheating request message, so that the user can be ensured to acquire the barrage message of the next period through the cache, the interaction between the user and the database is reduced, and the data processing pressure of the database is reduced. And when the data is cached, the caching time is adjusted according to the heat of the video, so that the inventory time of invalid caching is reduced, and the effective utilization rate of the caching is improved.
The various techniques described herein may be implemented in connection with hardware or software or, alternatively, with a combination of both. Thus, the methods and apparatus of the present invention, or certain aspects or portions of the methods and apparatus of the present invention, may take the form of program code (i.e., instructions) embodied in tangible media, such as removable hard drives, U-drives, floppy diskettes, CD-ROMs, or any other machine-readable storage medium, wherein, when the program is loaded into and executed by a machine, such as a computer, the machine becomes an apparatus for practicing the invention.
In the case of program code execution on programmable computers, the computing device will generally include a processor, a storage medium readable by the processor (including volatile and non-volatile memory and/or storage elements), at least one input device, and at least one output device. Wherein the memory is configured to store program code; the processor is configured to execute the barrage message processing method of the invention in accordance with instructions in the program code stored in the memory.
By way of example, and not limitation, readable media comprise readable storage media and communication media. The readable storage medium stores information such as computer readable instructions, data structures, program modules, or other data. Communication media typically embodies computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism and includes any information delivery media. Combinations of any of the above are also included within the scope of readable media.
In the description provided herein, algorithms and displays are not inherently related to any particular computer, virtual system, or other apparatus. Various general-purpose systems may also be used with examples of the invention. The required structure for a construction of such a system is apparent from the description above. In addition, the present invention is not directed to any particular programming language. It will be appreciated that the teachings of the present invention described herein may be implemented in a variety of programming languages, and the above description of specific languages is provided for disclosure of enablement and best mode of the present invention.
In the description provided herein, numerous specific details are set forth. However, it is understood that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.
It should be appreciated that in the above description of exemplary embodiments of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof for the purpose of streamlining the disclosure and aiding in the understanding of one or more of the various inventive aspects. However, the disclosed method should not be construed as reflecting the intention that: i.e., the claimed invention requires more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive aspects lie in less than all features of a single foregoing disclosed embodiment. Thus, the claims following the detailed description are hereby expressly incorporated into this detailed description, with each claim standing on its own as a separate embodiment of this invention.
Those skilled in the art will appreciate that the modules or units or components of the devices in the examples disclosed herein may be arranged in a device as described in this embodiment, or alternatively may be located in one or more devices different from the devices in this example. The modules in the foregoing examples may be combined into one module or may be further divided into a plurality of sub-modules.
Those skilled in the art will appreciate that the modules in the apparatus of the embodiments may be adaptively changed and disposed in one or more apparatuses different from the embodiments. The modules or units or components of the embodiments may be combined into one module or unit or component and, furthermore, they may be divided into a plurality of sub-modules or sub-units or sub-components. Any combination of all features disclosed in this specification (including any accompanying claims, abstract and drawings), and all of the processes or units of any method or apparatus so disclosed, may be used in combination, except insofar as at least some of such features and/or processes or units are mutually exclusive. Each feature disclosed in this specification (including any accompanying claims, abstract and drawings), may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.
The invention also includes:
a7, the method as in A6, wherein each host broadcasting terminal corresponds to a live broadcasting room, and has a unique live broadcasting room serial number, and the data request message comprises a first starting time, a first ending time and a current live broadcasting room serial number; the first ending time is the first starting time plus a second preset duration, the preheating request message comprises a second starting time, a second ending time and a current live broadcasting room serial number, the second starting time is the first ending time, and the second ending time is the second starting time plus the second preset duration.
The method according to any one of A5-A7, wherein the cache server includes a hot value cache time relation table, and the cache server sets a cache time according to the hot value cache time relation table when caching the barrage message.
The method of any one of A1-A8, wherein the data storage device is a MySQL database.
A10, the method as in any one of A5-A9, wherein the cache server is a redis server.
Furthermore, those skilled in the art will appreciate that while some embodiments described herein include some features but not others included in other embodiments, combinations of features of different embodiments are meant to be within the scope of the invention and form different embodiments. For example, in the following claims, any of the claimed embodiments can be used in any combination.
Furthermore, some of the embodiments are described herein as methods or combinations of method elements that may be implemented by a processor of a computer system or by other means of performing the functions. Thus, a processor with the necessary instructions for implementing the described method or method element forms a means for implementing the method or method element. Furthermore, the elements of the apparatus embodiments described herein are examples of the following apparatus: the apparatus is for carrying out the functions performed by the elements for carrying out the objects of the invention.
As used herein, unless otherwise specified the use of the ordinal terms "first," "second," "third," etc., to describe a general object merely denote different instances of like objects, and are not intended to imply that the objects so described must have a given order, either temporally, spatially, in ranking, or in any other manner.
While the invention has been described with respect to a limited number of embodiments, those skilled in the art, having benefit of the above description, will appreciate that other embodiments are contemplated within the scope of the invention as described herein. Furthermore, it should be noted that the language used in the specification has been principally selected for readability and instructional purposes, and may not have been selected to delineate or circumscribe the inventive subject matter. Accordingly, many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the appended claims. The disclosure of the present invention is intended to be illustrative, but not limiting, of the scope of the invention, which is defined by the appended claims.

Claims (14)

1. A barrage message processing method adapted to be executed in a live broadcast server, the live broadcast server comprising a data storage device, a first message buffer, a second message queue and a message processor, the live broadcast server being connected to a plurality of anchor terminals and a plurality of user terminals, the anchor terminals being adapted to perform live video broadcast, the method comprising:
Receiving a barrage message sent by a user through the user terminal, and storing the barrage message into the first message buffer;
storing, by the message processor, the barrage message in the first message buffer to the data storage device, the message processor including a plurality of message consumers;
when the live video corresponding to any bullet screen message is finished, a message consumer processing the live video bullet screen message generates a live broadcast finishing message, and caches the live broadcast finishing message to the second message queue;
and according to the live broadcast ending message in the second message queue, performing de-duplication processing on the live broadcast barrage message of the corresponding video broadcast stored in the data storage device.
2. The method of claim 1, wherein the first message buffer includes a plurality of message queues, wherein the receiving the barrage message sent by the user through the user terminal and storing the barrage message in the first message buffer comprises:
generating a routing key of the barrage message according to the barrage message;
and sending the barrage message to the message queues according to the routing key.
3. The method of claim 2, wherein the plurality of message consumers are in one-to-one correspondence with the plurality of message queues, the storing, by the message processor, the barrage message in the first message buffer to the data storage device comprising:
The message consumer obtains the barrage message from the corresponding message queue and stores the barrage message to the data storage device.
4. A method according to any one of claims 1-3, wherein said deduplicating live barrage messages stored in said data storage means according to live end messages in said second message queue comprises:
detecting repeated barrage messages in the corresponding video live broadcast according to the live broadcast ending message;
and storing the repeated barrage messages in the form of barrage messages and repeated times, and deleting the repeated barrage messages.
5. The method of claim 1, wherein the user terminal is further adapted to replay an ending live video, the live server being communicatively coupled to a caching server for caching bullet messages, the caching server being communicatively coupled to the user terminal, the method further comprising:
when the user terminal plays back, sending a data request message to the cache server to acquire a corresponding barrage message;
if the cache server does not have the barrage message, sending a data request message and a preheating request message to the live broadcast server through the cache server, wherein the data request message is used for acquiring the barrage message of the current period, and the preheating request message is used for acquiring the barrage message of the next period.
6. The method of claim 5, wherein the live server further comprises a third message queue and a fourth message queue, the method further comprising:
receiving a data request message sent by the user terminal through the third message queue, and returning a corresponding barrage message according to the data request message;
and receiving a preheating request message sent by the cache server through the fourth message queue, and returning a corresponding barrage message according to the preheating request message so as to enable the cache server to cache.
7. The method as claimed in claim 6, wherein each anchor terminal corresponds to a live broadcast room, and has a unique live broadcast room serial number, and the data request message includes a first start time, a first end time, and a current live broadcast room serial number; the first ending time is the first starting time plus a second preset duration, the preheating request message comprises a second starting time, a second ending time and a current live broadcasting room serial number, the second starting time is the first ending time, and the second ending time is the second starting time plus the second preset duration.
8. The method of any one of claims 5-7, wherein the cache server includes a hotvalue cache time relationship table, and the cache server sets a cache time according to the hotvalue cache time relationship table when caching the barrage message.
9. A method as claimed in any one of claims 1 to 3, wherein the data store is a MySQL database.
10. The method of any of claims 5-7, wherein the cache server is a redis server.
11. A bullet screen message processing apparatus adapted to reside in a live broadcast server comprising a data storage device, a first message buffer, a second message queue, and a message processor, the live broadcast server being connected to a plurality of anchor terminals and a plurality of user terminals, the anchor terminals being adapted to conduct live video broadcast, wherein,
the first message buffer is suitable for receiving bullet screen messages sent by the user terminal;
a message processor adapted to store bullet screen messages in the first message buffer to the data store, the message processor comprising a plurality of message consumers;
the second message queue is suitable for storing the live broadcast ending message when a message consumer processing the live broadcast barrage message generates the live broadcast ending message when the live broadcast of the video corresponding to any barrage message is ended;
and the data storage device is suitable for storing the barrage message and is also suitable for carrying out duplication removal processing on the barrage message of the corresponding live video stored in the data storage device according to the live broadcast ending message in the second message queue.
12. A barrage message processing system comprises a live broadcast server, a cache server, a user terminal and a live broadcast terminal, wherein,
the live broadcast terminal is suitable for video live broadcast;
the user terminal is suitable for sending bullet screen information and replaying video live broadcast;
a live server adapted to perform the method of any of claims 1-10;
and the caching server is suitable for caching the live video barrage message.
13. A computing device, comprising:
at least one processor; and
a memory storing program instructions, wherein the program instructions are configured to be adapted to be executed by the at least one processor, the program instructions comprising instructions for performing the method of any of claims 1-10.
14. A readable storage medium storing program instructions which, when read and executed by a computing device, cause the computing device to perform the method of any of claims 1-10.
CN202110209311.9A 2021-02-24 2021-02-24 Barrage message processing method, device and system Active CN112882847B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110209311.9A CN112882847B (en) 2021-02-24 2021-02-24 Barrage message processing method, device and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110209311.9A CN112882847B (en) 2021-02-24 2021-02-24 Barrage message processing method, device and system

Publications (2)

Publication Number Publication Date
CN112882847A CN112882847A (en) 2021-06-01
CN112882847B true CN112882847B (en) 2023-07-28

Family

ID=76054414

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110209311.9A Active CN112882847B (en) 2021-02-24 2021-02-24 Barrage message processing method, device and system

Country Status (1)

Country Link
CN (1) CN112882847B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114666625B (en) * 2022-04-08 2023-12-01 海南车智易通信息技术有限公司 Hot anchor list generation method, live broadcast system and computing device

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108055593A (en) * 2017-12-20 2018-05-18 广州虎牙信息科技有限公司 A kind of processing method of interactive message, device, storage medium and electronic equipment
CN110460865A (en) * 2019-07-23 2019-11-15 中国农业大学 Extensive barrage acquisition methods and device

Family Cites Families (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105120006A (en) * 2015-09-11 2015-12-02 百度在线网络技术(北京)有限公司 Live commenting control method, live commenting server and live commenting control device for electronic readings
CN105812885B (en) * 2016-03-11 2018-11-27 武汉斗鱼网络科技有限公司 Barrage display methods and system in a kind of net cast
CN106101747B (en) * 2016-06-03 2019-07-16 腾讯科技(深圳)有限公司 A kind of barrage content processing method and application server, user terminal
CN105915931A (en) * 2016-06-07 2016-08-31 武汉斗鱼网络科技有限公司 Method of relevantly preserving live video and barrage information and apparatus thereof
CN106101848B (en) * 2016-06-08 2019-03-01 维沃移动通信有限公司 A kind of barrage display methods and electronic equipment
CN106559695A (en) * 2016-10-14 2017-04-05 北京金山安全软件有限公司 Barrage message processing method and device and electronic equipment
CN106878823A (en) * 2016-12-29 2017-06-20 武汉斗鱼网络科技有限公司 It is a kind of to filter word barrage and be converted to the method and system of voice barrage
CN108021604A (en) * 2017-10-24 2018-05-11 山东科技大学 A kind of web crawlers method for crawling barrage in Dou Yu webcast websites main broadcaster room
US11089377B2 (en) * 2018-01-29 2021-08-10 Guangzhou Huya Information Technology Co., Ltd. Interaction based on live webcast
CN110191348B (en) * 2018-02-23 2022-02-22 武汉斗鱼网络科技有限公司 Method and device for processing interactive messages in live video
CN110971941A (en) * 2018-09-30 2020-04-07 武汉斗鱼网络科技有限公司 Method, system, server and live broadcast room controller for dredging bullet screen congestion

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108055593A (en) * 2017-12-20 2018-05-18 广州虎牙信息科技有限公司 A kind of processing method of interactive message, device, storage medium and electronic equipment
CN110460865A (en) * 2019-07-23 2019-11-15 中国农业大学 Extensive barrage acquisition methods and device

Also Published As

Publication number Publication date
CN112882847A (en) 2021-06-01

Similar Documents

Publication Publication Date Title
WO2019205371A1 (en) Server, message allocation method, and storage medium
US7870272B2 (en) Preserving a user experience with content across multiple computing devices using location information
CN109408751B (en) Data processing method, terminal, server and storage medium
CN111651464B (en) Data processing method, system and computing device
WO2017185616A1 (en) File storage method and electronic equipment
CN110636340B (en) Video file uploading method, storage device, terminal device and storage medium
CN111475483B (en) Database migration method and device and computing equipment
CN110851253A (en) Remote operation and maintenance method, system, storage medium and electronic equipment
CN103200204A (en) Distributed transcoding system and method based on cloud storage
CN107197359B (en) Video file caching method and device
CN113329069B (en) Instant messaging method, system and computing device
CN106156148A (en) The rendering intent of a kind of page, device and terminal device
CN112882847B (en) Barrage message processing method, device and system
CN111586437B (en) Barrage message processing method, system, computing device and storage medium
CN108966316B (en) Method, device and equipment for displaying multimedia resources and predicting connection waiting duration
JP2016519380A (en) Information transmission based on reading speed
CN111414383B (en) Data request method, data processing system and computing device
CN112698793B (en) Data storage method, device, machine-readable medium and equipment
CN104463062B (en) Access method and system based on two-dimensional code scanning
CN113377289A (en) Cache management method, system, computing device and readable storage medium
CN112883307B (en) Cache updating method and device and social network system
CN112688980B (en) Resource distribution method and device, and computer equipment
CN114296897A (en) Method and device for sending advertisement request
CN104580276A (en) Information pushing method, device and system, as well as information access device
CN114053690A (en) Cloud game processing method, client, server 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