WO2019119634A1 - Apparatus and method for sending interactive information during streaming, and computer readable storage medium - Google Patents

Apparatus and method for sending interactive information during streaming, and computer readable storage medium Download PDF

Info

Publication number
WO2019119634A1
WO2019119634A1 PCT/CN2018/076117 CN2018076117W WO2019119634A1 WO 2019119634 A1 WO2019119634 A1 WO 2019119634A1 CN 2018076117 W CN2018076117 W CN 2018076117W WO 2019119634 A1 WO2019119634 A1 WO 2019119634A1
Authority
WO
WIPO (PCT)
Prior art keywords
preset
time interval
time
timestamp
interactive information
Prior art date
Application number
PCT/CN2018/076117
Other languages
French (fr)
Chinese (zh)
Inventor
张国梁
Original Assignee
平安科技(深圳)有限公司
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 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2019119634A1 publication Critical patent/WO2019119634A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/47End-user applications
    • H04N21/478Supplemental services, e.g. displaying phone caller identification, shopping application
    • H04N21/4788Supplemental services, e.g. displaying phone caller identification, shopping application communicating with other users, e.g. chatting
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing 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/431Generation of visual interfaces for content selection or interaction; Content or additional data rendering
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/47End-user applications
    • H04N21/488Data services, e.g. news ticker
    • H04N21/4882Data services, e.g. news ticker for displaying messages, e.g. warnings, reminders
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/80Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
    • H04N21/85Assembly of content; Generation of multimedia applications
    • H04N21/854Content authoring
    • H04N21/8547Content authoring involving timestamps for synchronizing content

Definitions

  • the present invention relates to the field of network live broadcast technologies, and in particular, to a device, a method, and a computer readable storage medium for transmitting interactive information in a live broadcast.
  • the interactive information is generally sent by the live broadcast server to each of the received interactive messages in a message queue manner to the viewer's terminal.
  • the interactive information will not be received when the viewer's terminal appears, and a large amount of interactive information will be displayed on the screen so that it is too late to read.
  • the interactive information generates a lot of invalid information due to timeliness, which affects the interactive effect.
  • the application provides a device, a method and a computer readable storage medium for transmitting interactive information in a live broadcast, the main purpose of which is to reduce the transmission of invalid data, enhance the effectiveness of interactive information, and avoid the phenomenon that a large amount of interactive information is scrolled due to network jitter. .
  • the present application provides a device for transmitting interactive information in a live broadcast, the device comprising a memory and a processor, wherein the memory stores an interactive information transmitting program executable on the processor, the interactive information
  • the following steps are implemented when the sender is executed by the processor:
  • the interaction information acquisition request carries the first timestamp
  • the interaction information recorded between the time point corresponding to the difference between the first timestamp and the preset time length and the time point corresponding to the first timestamp is obtained, And sending the obtained interaction information to the user terminal for display, where the preset duration is less than or equal to the preset time interval.
  • the present application further provides a method for sending interactive information in a live broadcast, where the method includes:
  • the interaction information recorded between the time point corresponding to the difference between the first timestamp and the preset time length and the time point corresponding to the first timestamp is obtained, And sending the obtained interaction information to the user terminal for display, where the preset duration is less than or equal to the preset time interval.
  • the present application further provides a computer readable storage medium, where the interactive information transmitting program is stored, and the interactive information transmitting program can be executed by one or more processors. To achieve the following steps:
  • the interaction information recorded between the time point corresponding to the difference between the first timestamp and the preset time length and the time point corresponding to the first timestamp is obtained, And sending the obtained interaction information to the user terminal for display, where the preset duration is less than or equal to the preset time interval.
  • the apparatus, method, and computer readable storage medium for transmitting interactive information in a live broadcast the user terminal actively initiates an interactive information acquisition request to the sending device at intervals of a preset time interval, and carries the first time stamp in the request.
  • the sending device obtains the first timestamp from the received interactive information acquisition request, and acquires a second timestamp in the interactive information acquisition request sent by the user terminal, and calculates a time between the first timestamp and the second timestamp. If the time interval is greater than the preset time interval, the interaction information recorded between the time point of the difference between the first timestamp and the preset time length and the time point corresponding to the first timestamp is obtained and sent to the The user terminal performs display.
  • the sending device does not actively send the interaction information to the user terminal, and the user terminal periodically sends the interaction information acquisition request to acquire the interaction information and display, and network jitter or network delay occurs.
  • the time interval between the two consecutive requests received by the server is large, only the distance is Interactive information of the current timestamp more recent period of time to send the client display, can reduce the transmission of invalid data, enhance the effectiveness of chats, and avoid a lot of chat network jitter generated record rolling phenomenon.
  • FIG. 1 is a schematic diagram of a preferred embodiment of a device for transmitting interactive information in a live broadcast of the present application
  • FIG. 2 is a schematic diagram of a program module of an interactive information sending program in an embodiment of an apparatus for transmitting interactive information in a live broadcast of the present application;
  • FIG. 3 is a flowchart of a first embodiment of a method for transmitting interactive information in a live broadcast of the present application.
  • the application provides a device for transmitting interactive information in a live broadcast.
  • FIG. 1 it is a schematic diagram of a preferred embodiment of a device for transmitting interactive information in a live broadcast of the present application.
  • the transmitting device 1 for interactive information in the live broadcast may be a server capable of establishing a communication connection with the user terminal, for example, a live broadcast server.
  • the transmitting device 1 for interactive information in the live broadcast includes at least a memory 11, a processor 12, a communication bus 13, and a network interface 14.
  • the memory 11 includes at least one type of readable storage medium including a flash memory, a hard disk, a multimedia card, a card type memory (for example, an SD or DX memory, etc.), a magnetic memory, a magnetic disk, an optical disk, and the like.
  • the memory 11 may in some embodiments be an internal storage unit of the transmitting device 1 for interactive information in live broadcast, such as the hard disk of the transmitting device 1 for interactive information in the live broadcast.
  • the memory 11 may also be an external storage device of the transmitting device 1 for interactive information in the live broadcast, such as a plug-in hard disk equipped with the interactive device in the live broadcast, and a smart memory card (Smart Media Card, SMC). ), Secure Digital (SD) card, Flash Card, etc.
  • SD Secure Digital
  • the memory 11 may also include an internal storage unit of the transmitting device 1 that includes both interactive information in the live broadcast and an external storage device.
  • the memory 11 can be used not only for storing application software of the transmitting device 1 installed in the live broadcast, but also for various types of data, such as codes of the interactive information transmitting program 01, and for temporarily storing data that has been output or will be output.
  • the processor 12 may be a Central Processing Unit (CPU), controller, microcontroller, microprocessor or other data processing chip for running program code or processing stored in the memory 11.
  • the data for example, executes the interactive information transmitting program 01 and the like.
  • Communication bus 13 is used to implement connection communication between these components.
  • the network interface 14 can optionally include a standard wired interface, a wireless interface (such as a WI-FI interface), and is typically used to establish a communication connection between the device and other electronic devices.
  • a standard wired interface such as a WI-FI interface
  • FIG. 1 shows only the transmitting device 1 having the interactive information in the live broadcast of the components 11-14 and the interactive information transmitting program 01, but it should be understood that not all of the illustrated components are required to be implemented, and alternative implementations may be implemented or Fewer components.
  • the device may further include a user interface
  • the user interface may include a display
  • an input unit such as a keyboard
  • the optional user interface may further include a standard wired interface and a wireless interface.
  • the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch sensor, or the like.
  • the display may also be appropriately referred to as a display screen or a display unit for displaying information processed in the transmitting device 1 of the interactive information in the live broadcast and a user interface for displaying the visualization.
  • the interactive information transmitting program 01 is stored in the memory 11; when the processor 12 executes the interactive information transmitting program 01 stored in the memory 11, the following steps are implemented:
  • the first timestamp is obtained from the interaction information acquisition request, where the user terminal sends the interaction information to the sending device 1 at intervals of a preset time interval.
  • the request, the interaction information acquisition request carries the first timestamp.
  • the chat record in the live broadcast platform that is, the interactive information
  • the interactive information is generally displayed on the play screen of the live video in the form of a barrage, and the user sends the interactive information according to the content of the live broadcast, therefore, the immediacy requirement for the interactive information is relatively high.
  • the interactive information is sent to the user's mobile phone by the message queue, but when there is a network jitter or the like, the interactive information is accumulated in a large amount and sent to the user terminal for display. Invalid interactive information by the user, and the phenomenon that the interactive information scrolls and appears on the screen, resulting in poor user experience.
  • the client periodically sends an acquisition request to the sending device 1 for a preset time interval, which may be a preset fixed value.
  • the preset time The interval can also be set according to the number of viewers participating in the live interaction or the density of the interactive information. Generally, the time interval is very small, so that the user can obtain the interactive message sent by other viewers in time. For example, in some embodiments, the preset time interval is 0.01-5 seconds, and optionally, the preset time interval takes a value of 0.5 seconds.
  • the timestamp is obtained according to the current time of the terminal system, and the timestamp is added to the request and sent to the transmitting device 1.
  • the interaction information recorded between the time point corresponding to the difference between the first timestamp and the preset time length and the time point corresponding to the first timestamp is obtained, And sending the obtained interaction information to the user terminal for display, where the preset duration is less than or equal to the preset time interval.
  • the sending device 1 obtains the first timestamp from the interactive information acquisition request, and obtains the timestamp in the request sent by the user terminal last time, and calculates the time interval. If the time interval is greater than the preset time interval, the excessive interaction information may be accumulated. In order to prevent the phenomenon that information is scrolled when the interaction information is sent to the user terminal at one time, the time point corresponding to the difference between the first time stamp and the preset time length is recorded between the time points corresponding to the first time stamp.
  • the interactive information is sent to the user terminal in chronological order, that is, only the interactive information within the preset duration before the first time stamp is sent to the user. For example, the preset time interval and the preset duration are both 3 seconds.
  • the user terminal sends an interactive information acquisition request to the transmitting device 1 every 3 seconds, and the server receives an interactive information acquisition request every 3 seconds.
  • Sending the interactive information to the user terminal but when an abnormal situation such as a network delay occurs, when the sending device 1 receives the current request, the interval from the last request has been 10 seconds, then the interactive information of the last 3 seconds from the current request is The time sequence is sent to the user terminal.
  • the 7-second interactive information of the earlier time is not sent, because the interactive information is time-sensitive in the live broadcast, and the interactive information that has been separated for a long time becomes invalid information, even if it is sent to the mobile phone, it will be scrolled and the current screen. Can not be seen, this will not only avoid the scrolling caused by too much interactive information, but also ensure that users receive the latest interactive information.
  • the transmitting device 1 when the transmitting device 1 establishes a live connection with the user terminal, the current system time is sent to the user terminal, so that the user terminal receives the The system time acquires a time difference from the transmitting device 1, and when transmitting an interactive information acquisition request to the transmitting device 1, determines a timestamp according to the time difference, so that the timestamp matches the system time of the transmitting device 1. .
  • the transmitting device 1 since the system time of the user terminal may be inconsistent with the system time between the transmitting device 1, in order to avoid the phenomenon that the interactive information is not real-time due to such a situation, when the transmitting device 1 establishes a live connection with the user terminal, the transmitting device 1 sending the current system time to the user terminal, the user terminal determining whether the system time of the system is consistent with the system time of the transmitting device 1, and if not, recording the time difference, so as to adjust the time stamp in the interactive information obtaining request according to the time difference, so that The time stamp sent to the transmitting device 1 coincides with the time of the transmitting device 1.
  • the time interval of the timestamp in the two received requests is generally equal to the preset time interval, in which case, for the processing of the interactive message, There are many ways to do this. Two of them are listed below for explanation.
  • the interactive information sending program 01 is further executable by the processor to calculate a time interval between the first timestamp and the second timestamp, and determine whether the time interval is greater than a pre- After the step of time interval, the following steps are also implemented:
  • the interaction information recorded in the time interval is acquired, and the acquired interaction information is sent to the user terminal for display.
  • the interactive information sending program 01 is further executed by the processor to calculate a time interval between the first timestamp and the second timestamp, and determine whether the time interval is greater than a preset time. After the interval step, the following steps are also implemented:
  • time interval is equal to the preset time interval, acquiring interaction information recorded in the time interval, and determining the quantity of the acquired interaction information;
  • the preset number of interaction information that is closest to the time point corresponding to the first time stamp is sent to the user terminal for display;
  • the interaction information recorded in the time interval is acquired, and the acquired interaction information is sent to the user terminal for display.
  • the number of interactive participants participating in the live broadcast process is changing, the number of interactive messages generated during the same duration may be different. Therefore, in order to further reduce the transmission of invalid data, when the time interval is equal to the preset time interval, The number of pieces of interactive information recorded by the sending device 1 during the time interval is counted. If the number is greater than the preset number, the preset number of pieces of interactive information that is closest to the time point corresponding to the first time stamp is sent to the user terminal for display. Otherwise, the interactive information recorded in the above time interval is sent to the user terminal for display.
  • the device 1 for transmitting interactive information in the live broadcast of the present embodiment initiates an interactive information acquisition request to the transmitting device 1 at a preset time interval, and carries the first timestamp in the request, and the sending device 1 Obtaining a first timestamp in the received interactive information acquisition request, and acquiring a second timestamp in the interactive information acquisition request sent by the user terminal, and calculating a time interval between the first timestamp and the second timestamp. If the time interval is greater than the preset time interval, the interaction information recorded between the time point of the difference between the first time stamp and the preset time length and the time point corresponding to the first time stamp is obtained, and sent to the user terminal.
  • the sending device 1 does not actively send the interactive information to the user terminal, and the user terminal periodically sends the interactive information obtaining request to obtain the interactive information and display, which causes network jitter or network delay.
  • the interval between two consecutive requests received by the server is large, only the segment closer to the current timestamp is used.
  • the interactive information of the time is sent to the client display, which can reduce the transmission of invalid data, enhance the validity of the chat record, and avoid the phenomenon that a large number of chat records are scrolled due to network jitter.
  • a second embodiment of the transmitting apparatus 1 for interactive information in the live broadcast of the present application is proposed based on the first embodiment.
  • the interaction information sending program 01 may be further executed by the processor to obtain a time corresponding to the difference between the first time stamp and the preset time length to the time corresponding to the first time stamp.
  • time interval is greater than the preset time interval, determining the number of viewers currently participating in the live interaction
  • the preset duration is a dynamically adjustable value
  • the transmitting device 1 dynamically adjusts the preset duration according to the number of viewers participating in the live interaction.
  • the mapping relationship between the number of viewers participating in the live interaction and the preset duration is established in advance, and the more the number of viewers participating in the live interaction, the smaller the preset duration.
  • the preset duration corresponding to the number of viewers currently participating in the live interaction is determined according to the above mapping relationship. Then, the corresponding interactive information is obtained and sent to the user terminal.
  • the interactive information sending program 01 may also be divided into one or more modules, one or more modules are stored in the memory 11 and executed by one or more processors (this implementation)
  • the processor 12 is executed to complete the application.
  • the module referred to in the present application refers to a series of computer program instruction segments capable of performing a specific function, and is used to describe the transmitting device 1 for interactive information transmission program 01 in the live broadcast. The execution process in .
  • FIG. 2 it is a schematic diagram of a program module of an interactive information sending program in an embodiment of an apparatus for transmitting interactive information in a live broadcast of the present application.
  • the interactive information sending program may be divided into an obtaining module 10 and calculating Module 20, determination module 30, and transmission module 40, by way of example:
  • the module 10 is configured to: when receiving an interaction information acquisition request sent by the user terminal, obtain a first timestamp from the interaction information acquisition request, where the user terminal sends the preset time interval to the sending device at intervals An interaction information acquisition request, where the interaction information acquisition request carries the first timestamp;
  • the obtaining module 10 is further configured to: acquire a second timestamp of the interaction information acquisition request sent by the user terminal last time;
  • the calculating module 20 is configured to: calculate a time interval between the first timestamp and the second timestamp;
  • the determining module 30 is configured to: determine whether the time interval is greater than the preset time interval;
  • the sending module 40 is configured to: when the time interval is greater than the preset time interval, obtain a time point corresponding to the difference between the first timestamp and the preset time length to a time point corresponding to the first timestamp
  • the recorded interactive information is sent to the user terminal for display, and the preset duration is less than or equal to the preset time interval.
  • the present application also provides a method for transmitting interactive information in a live broadcast.
  • FIG. 3 it is a flowchart of a first embodiment of a method for transmitting interactive information in a live broadcast of the present application.
  • the method can be performed by a device that can be implemented by software and/or hardware.
  • the method for sending the interactive information in the live broadcast includes:
  • step S10 when receiving the interaction information acquisition request sent by the user terminal, the first timestamp is obtained from the interaction information acquisition request, where the user terminal sends an interaction to the live server every preset time interval.
  • the information acquisition request carries the first timestamp in the interaction information acquisition request.
  • the chat record in the live broadcast platform that is, the interactive information
  • the interactive information is generally displayed on the play screen of the live video in the form of a barrage, and the user sends the interactive information according to the content of the live broadcast, therefore, the immediacy requirement for the interactive information is relatively high.
  • the interactive information is sent to the user's mobile phone by the message queue, but when there is a network jitter or the like, the interactive information is accumulated in a large amount and sent to the user terminal for display. Invalid interactive information by the user, and the phenomenon that the interactive information scrolls and appears on the screen, resulting in poor user experience.
  • the client periodically sends an acquisition request to the live server, and the period is a preset time interval, and the preset time interval may be a preset fixed value. In other embodiments, the preset time interval. It can also be set according to the number of viewers participating in the live interaction or the density of the interactive information. Generally, the time interval is very small, so that the user can obtain the interactive message sent by other viewers in time. For example, in some embodiments, the preset time interval is 0.01-5 seconds, and optionally, the preset time interval takes a value of 0.5 seconds.
  • the timestamp is obtained according to the current time of the terminal system, and the timestamp is added to the request to be sent to the live broadcast server.
  • Step S20 Obtain a second timestamp of the interaction information acquisition request sent by the user terminal last time
  • Step S30 calculating a time interval between the first timestamp and the second timestamp, and determining whether the time interval is greater than the preset time interval;
  • step S40 if the time interval is greater than the preset time interval, the time point corresponding to the difference between the first timestamp and the preset time length is recorded to be recorded between the time points corresponding to the first timestamp.
  • the interaction information is sent to the user terminal for display, and the preset duration is less than or equal to the preset time interval.
  • the live server obtains the first timestamp from the interactive information acquisition request, and obtains the timestamp in the request sent by the user terminal last time, and calculates the time interval. If the time interval is greater than the preset time interval, the interactive information is accumulated excessively. In order to avoid the phenomenon that excessive interaction information is sent to the user terminal and the information scrolls, the time point corresponding to the difference between the first time stamp and the preset time length is recorded between the time points corresponding to the first time stamp.
  • the interactive information is sent to the user terminal and sent to the user terminal, that is, only the preset time duration interaction information before the first time stamp is sent to the user. For example, the preset time interval and the preset duration are both 3 seconds.
  • the user terminal sends an interactive information acquisition request to the transmitting device every 3 seconds, and the server receives an interactive information acquisition request every 3 seconds and The user terminal sends the interaction information, but when an abnormal situation such as a network delay occurs, the sending device receives the current request, and the interval from the last request has been 10 seconds, then the interaction information of the last 3 seconds from the current request is in chronological order. Send to the user terminal.
  • the 7-second interactive information of the earlier time is not sent, because the interactive information is time-sensitive in the live broadcast, and the interactive information that has been separated for a long time becomes invalid information, even if it is sent to the mobile phone, it will be scrolled and the current screen. Can not be seen, this will not only avoid the scrolling caused by too much interactive information, but also ensure that users receive the latest interactive information.
  • the live server when the live server establishes a live connection with the user terminal, the current system time is sent to the user terminal, so that the user terminal is configured according to the received system.
  • the live server obtains a time difference between the time and the live server, and sending an interaction information acquisition request to the live server, determining a timestamp according to the time difference, so that the timestamp matches the system time of the live server.
  • the live server Since the system time of the user terminal may be inconsistent with the system time between the live server, in order to avoid the phenomenon that the interactive information is not real-time due to the situation, when the live server establishes a live connection with the user terminal, the live server will be current.
  • the system time is sent to the user terminal, and the user terminal determines whether the system time of the user is consistent with the system time of the live server. If not, the time difference is recorded, so that the time stamp in the interactive information acquisition request is adjusted according to the time difference, so that the time is sent to the live server.
  • the timestamp is the same as the time of the live server.
  • the time interval of the timestamps in the two received requests is generally equal to the preset time interval.
  • the processing of the interactive message There are many implementations. Two of them are listed below for explanation.
  • the interactive information sending program is further executed by the processor to calculate a time interval between the first timestamp and the second timestamp, and determine whether the time interval is greater than a preset. After the time interval step, the following steps are also implemented:
  • the interaction information recorded in the time interval is acquired, and the acquired interaction information is sent to the user terminal for display.
  • the interactive information sending program is further executed by the processor to calculate a time interval between the first timestamp and the second timestamp, and determine whether the time interval is greater than a preset time interval.
  • time interval is equal to the preset time interval, acquiring interaction information recorded in the time interval, and determining the quantity of the acquired interaction information;
  • the preset number of interaction information that is closest to the time point corresponding to the first time stamp is sent to the user terminal for display;
  • the interaction information recorded in the time interval is acquired, and the acquired interaction information is sent to the user terminal for display.
  • the number of interactive participants participating in the live broadcast process is changing, the number of interactive messages generated during the same duration may be different. Therefore, in order to further reduce the transmission of invalid data, when the time interval is equal to the preset time interval, The number of the interactive information recorded by the live server during the time interval is counted. If the quantity is greater than the preset number, the preset number of interaction information that is closest to the time point corresponding to the first time stamp is sent to the user terminal for display. Otherwise, the interactive information recorded in the above time interval is sent to the user terminal for display.
  • the user terminal initiates an interactive information acquisition request to the live server at a preset interval, and carries the first timestamp in the request, and the live server receives the received information.
  • the live broadcast server does not actively send the interactive information to the user terminal, and the user terminal periodically sends the interactive information acquisition request to obtain the interactive information and display it, and the server end consecutively causes two reasons such as network jitter or network delay.
  • a second embodiment of a method for transmitting interactive information in a live broadcast of the present application is proposed based on the first embodiment.
  • the method before step S40, the method further includes the following steps:
  • time interval is greater than the preset time interval, determining the number of viewers currently participating in the live interaction
  • the preset duration is a dynamically adjustable value
  • the live server dynamically adjusts the preset duration according to the number of viewers participating in the live interaction.
  • the mapping relationship between the number of viewers participating in the live interaction and the preset duration is established in advance, and the more the number of viewers participating in the live interaction, the smaller the preset duration.
  • the preset duration corresponding to the number of viewers currently participating in the live interaction is determined according to the above mapping relationship. Then, the corresponding interactive information is obtained and sent to the user terminal.
  • the present application further provides a computer readable storage medium having an interactive information transmitting program stored thereon, the interactive information transmitting program being executable by one or more processors to implement the following steps:
  • the interaction information acquisition request carries the first timestamp
  • the interaction information recorded between the time point corresponding to the difference between the first timestamp and the preset time length and the time point corresponding to the first timestamp is obtained, And sending the obtained interaction information to the user terminal for display, where the preset duration is less than or equal to the preset time interval.
  • the specific embodiment of the computer readable storage medium of the present application is substantially the same as the embodiment of the apparatus and method for transmitting interactive information in the live broadcast, and is not described herein.
  • the technical solution of the present application which is essential or contributes to the prior art, may be embodied in the form of a software product stored in a storage medium (such as ROM/RAM as described above). , a disk, an optical disk, including a number of instructions for causing a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the methods described in the various embodiments of the present application.
  • a terminal device which may be a mobile phone, a computer, a server, or a network device, etc.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • General Engineering & Computer Science (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)

Abstract

Disclosed is an apparatus for sending interactive information during streaming, the apparatus comprising a memory and a processor, the memory storing an interactive information sending program that can be executed on the processor, the program when executed by the processor implementing the following steps: upon receipt of an interactive information acquisition request from a user terminal, acquiring a first time stamp from the interactive information acquisition request; acquiring a second time stamp previously sent; calculating a time interval between the first time stamp and the second time stamp, and determining whether the time interval is greater than a preset time interval; if so, acquiring interactive information between the time point corresponding to the difference between the first time stamp and the preset duration and the time point corresponding to the first time stamp, and sending the interactive information to the user terminal for display. The present application further proposes a method for sending interactive information during streaming and a computer readable storage medium. The present application reduces the transmission of invalid data, enhances the effectiveness of interactive information, and avoids the occurrence of a large amount of interactive information due to network jitter.

Description

直播中互动信息的发送装置、方法及计算机可读存储介质Transmitting device, method and computer readable storage medium for interactive information in live broadcast
本申请基于巴黎公约申明享有2017年12月21日递交的申请号为201711391821.2、名称为“直播中互动信息的发送装置、方法及计算机可读存储介质”的中国专利申请的优先权,该中国专利申请的整体内容以参考的方式结合在本申请中。The present application is based on the priority of the Chinese Patent Application entitled "Sending Device, Method and Computer-Readable Storage Medium for Interactive Information in Live Broadcasting", which is filed on December 21, 2017, with the application number of 201711391821. The entire content of the application is incorporated herein by reference.
技术领域Technical field
本申请涉及网络直播技术领域,尤其涉及一种直播中互动信息的发送装置、方法及计算机可读存储介质。The present invention relates to the field of network live broadcast technologies, and in particular, to a device, a method, and a computer readable storage medium for transmitting interactive information in a live broadcast.
背景技术Background technique
随着互联网技术的不断发展,网络直播逐渐兴起,观众在观看直播的过程中,可以通过终端将编辑好的文字、表情等互动信息发送至直播服务器,直播服务器接收到互动信息后,以弹幕的形式在直播画面中对互动信息进行显示,实现主播与观众之间、或者观众与观众之间的互动。With the continuous development of Internet technology, webcasting is gradually emerging. During the process of watching live broadcasts, viewers can send edited texts, expressions and other interactive information to the live broadcast server through the terminal. After receiving the interactive information, the live broadcast server will use the broadcast screen. The form displays interactive information in the live video to enable interaction between the anchor and the viewer, or between the viewer and the viewer.
现有的直播平台中,其互动信息一般采用由直播服务器以消息队列的方式将收到的每一条互动消息按照顺序发送到观众的终端。但是,在发生网络抖动、或者网络延迟等现象时,在观众的终端会出现时而收不到互动信息,时而收到大量的互动信息在画面上滚动显示,以至于来不及阅读,这样会使获取到的互动信息由于时效性而产生很多无效的信息,影响互动效果。In the existing live broadcast platform, the interactive information is generally sent by the live broadcast server to each of the received interactive messages in a message queue manner to the viewer's terminal. However, when network jitter or network delay occurs, the interactive information will not be received when the viewer's terminal appears, and a large amount of interactive information will be displayed on the screen so that it is too late to read. The interactive information generates a lot of invalid information due to timeliness, which affects the interactive effect.
发明内容Summary of the invention
本申请提供一种直播中互动信息的发送装置、方法及计算机可读存储介质,其主要目的在于减少无效数据的传输,增强互动信息的有效性,避免由于网络抖动产生的大量互动信息滚动的现象。The application provides a device, a method and a computer readable storage medium for transmitting interactive information in a live broadcast, the main purpose of which is to reduce the transmission of invalid data, enhance the effectiveness of interactive information, and avoid the phenomenon that a large amount of interactive information is scrolled due to network jitter. .
为实现上述目的,本申请提供一种直播中互动信息的发送装置,该装置包括存储器和处理器,所述存储器中存储有可在所述处理器上运行的互动信息发送程序,所述互动信息发送程序被所述处理器执行时实现如下步骤:To achieve the above object, the present application provides a device for transmitting interactive information in a live broadcast, the device comprising a memory and a processor, wherein the memory stores an interactive information transmitting program executable on the processor, the interactive information The following steps are implemented when the sender is executed by the processor:
当接收到用户终端发送的互动信息获取请求时,从所述互动信息获取请求中获取第一时间戳,其中,所述用户终端每间隔预设时间间隔向所述发送装置发送一次互动信息获取请求,所述互动信息获取请求中携带有所述第一时间戳;Obtaining a first timestamp from the interaction information acquisition request when receiving the interaction information acquisition request sent by the user terminal, where the user terminal sends an interaction information acquisition request to the sending device every preset time interval The interaction information acquisition request carries the first timestamp;
获取所述用户终端上次发送的互动信息获取请求的第二时间戳;Obtaining a second timestamp of the interaction information acquisition request sent by the user terminal last time;
计算所述第一时间戳与所述第二时间戳之间的时间间隔,并判断所述时间间隔是否大于所述预设时间间隔;Calculating a time interval between the first timestamp and the second timestamp, and determining whether the time interval is greater than the preset time interval;
若所述时间间隔大于所述预设时间间隔,则获取所述第一时间戳与预设时长的差值对应的时间点到所述第一时间戳对应的时间点之间记录的互动信息,并将获取的互动信息发送至所述用户终端进行显示,所述预设时长小于或等于所述预设时间间隔。If the time interval is greater than the preset time interval, the interaction information recorded between the time point corresponding to the difference between the first timestamp and the preset time length and the time point corresponding to the first timestamp is obtained, And sending the obtained interaction information to the user terminal for display, where the preset duration is less than or equal to the preset time interval.
此外,为实现上述目的,本申请还提供一种直播中互动信息的发送方法,该方法包括:In addition, in order to achieve the above object, the present application further provides a method for sending interactive information in a live broadcast, where the method includes:
发送装置在接收到用户终端发送的互动信息获取请求时,从所述互动信息获取请求中获取第一时间戳,其中,所述用户终端每间隔预设时间间隔向所述发送装置发送一次互动信息获取请求,所述互动信息获取请求中携带有所述第一时间戳;Receiving, by the sending device, the first timestamp from the interaction information acquisition request, where the user terminal sends the interaction information to the sending device every preset time interval. Obtaining a request, where the interaction information acquisition request carries the first timestamp;
获取所述用户终端上次发送的互动信息获取请求的第二时间戳;Obtaining a second timestamp of the interaction information acquisition request sent by the user terminal last time;
计算所述第一时间戳与所述第二时间戳之间的时间间隔,并判断所述时间间隔是否大于所述预设时间间隔;Calculating a time interval between the first timestamp and the second timestamp, and determining whether the time interval is greater than the preset time interval;
若所述时间间隔大于所述预设时间间隔,则获取所述第一时间戳与预设时长的差值对应的时间点到所述第一时间戳对应的时间点之间记录的互动信息,并将获取的互动信息发送至所述用户终端进行显示,所述预设时长小于或等于所述预设时间间隔。If the time interval is greater than the preset time interval, the interaction information recorded between the time point corresponding to the difference between the first timestamp and the preset time length and the time point corresponding to the first timestamp is obtained, And sending the obtained interaction information to the user terminal for display, where the preset duration is less than or equal to the preset time interval.
此外,为实现上述目的,本申请还提供一种计算机可读存储介质,所述计算机可读存储介质上存储有互动信息发送程序,所述互动信息发送程序可被一个或者多个处理器执行,以实现如下步骤:In addition, in order to achieve the above object, the present application further provides a computer readable storage medium, where the interactive information transmitting program is stored, and the interactive information transmitting program can be executed by one or more processors. To achieve the following steps:
在接收到用户终端发送的互动信息获取请求时,从所述互动信息获取请求中获取第一时间戳,其中,所述用户终端每间隔预设时间间隔向所述互动信息发送程序发送一次互动信息获取请求,所述互动信息获取请求中携带有所述第一时间戳;Obtaining a first timestamp from the interaction information acquisition request when receiving the interaction information acquisition request sent by the user terminal, where the user terminal sends the interaction information to the interaction information sending program every preset time interval Obtaining a request, where the interaction information acquisition request carries the first timestamp;
获取所述用户终端上次发送的互动信息获取请求的第二时间戳;Obtaining a second timestamp of the interaction information acquisition request sent by the user terminal last time;
计算所述第一时间戳与所述第二时间戳之间的时间间隔,并判断所述时间间隔是否大于所述预设时间间隔;Calculating a time interval between the first timestamp and the second timestamp, and determining whether the time interval is greater than the preset time interval;
若所述时间间隔大于所述预设时间间隔,则获取所述第一时间戳与预设时长的差值对应的时间点到所述第一时间戳对应的时间点之间记录的互动信息,并将获取的互动信息发送至所述用户终端进行显示,所述预设时长小于 或等于所述预设时间间隔。If the time interval is greater than the preset time interval, the interaction information recorded between the time point corresponding to the difference between the first timestamp and the preset time length and the time point corresponding to the first timestamp is obtained, And sending the obtained interaction information to the user terminal for display, where the preset duration is less than or equal to the preset time interval.
本申请提出的直播中互动信息的发送装置、方法及计算机可读存储介质,由用户终端每间隔预设时间间隔主动向发送装置发起一次互动信息获取请求,并在该请求中携带第一时间戳,发送装置从接收到的互动信息获取请求中获取第一时间戳,并获取该用户终端上一次发送的互动信息获取请求中的第二时间戳,计算第一时间戳与第二时间戳之间的时间间隔,若该时间间隔大于预设时间间隔,则获取第一时间戳与预设时长的差值的时间点到第一时间戳对应的时间点之间记录的互动信息,并发送至所述用户终端进行显示,本申请的上述方案中,发送装置并不主动向用户终端发送互动信息,由用户终端周期性地发送互动信息获取请求获取互动信息及进行显示,在发生网络抖动或者网络延迟等原因导致服务端连续两次接收到的请求的时间间隔较大时,只将距离当前时间戳较近的一段时间的互动信息发送客户端显示,能够减少无效数据的传输,增强聊天记录的有效性,避免由于网络抖动产生的大量聊天记录滚动的现象。The apparatus, method, and computer readable storage medium for transmitting interactive information in a live broadcast according to the present application, the user terminal actively initiates an interactive information acquisition request to the sending device at intervals of a preset time interval, and carries the first time stamp in the request. The sending device obtains the first timestamp from the received interactive information acquisition request, and acquires a second timestamp in the interactive information acquisition request sent by the user terminal, and calculates a time between the first timestamp and the second timestamp. If the time interval is greater than the preset time interval, the interaction information recorded between the time point of the difference between the first timestamp and the preset time length and the time point corresponding to the first timestamp is obtained and sent to the The user terminal performs display. In the above solution of the present application, the sending device does not actively send the interaction information to the user terminal, and the user terminal periodically sends the interaction information acquisition request to acquire the interaction information and display, and network jitter or network delay occurs. When the time interval between the two consecutive requests received by the server is large, only the distance is Interactive information of the current timestamp more recent period of time to send the client display, can reduce the transmission of invalid data, enhance the effectiveness of chats, and avoid a lot of chat network jitter generated record rolling phenomenon.
附图说明DRAWINGS
图1为本申请直播中互动信息的发送装置较佳实施例的示意图;1 is a schematic diagram of a preferred embodiment of a device for transmitting interactive information in a live broadcast of the present application;
图2为本申请直播中互动信息的发送装置一实施例中互动信息发送程序的程序模块示意图;2 is a schematic diagram of a program module of an interactive information sending program in an embodiment of an apparatus for transmitting interactive information in a live broadcast of the present application;
图3为本申请直播中互动信息的发送方法第一实施例的流程图。FIG. 3 is a flowchart of a first embodiment of a method for transmitting interactive information in a live broadcast of the present application.
本申请目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。The implementation, functional features and advantages of the present application will be further described with reference to the accompanying drawings.
具体实施方式Detailed ways
应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。It is understood that the specific embodiments described herein are merely illustrative of the application and are not intended to be limiting.
本申请提供一种直播中互动信息的发送装置。参照图1所示,为本申请直播中互动信息的发送装置较佳实施例的示意图。The application provides a device for transmitting interactive information in a live broadcast. Referring to FIG. 1 , it is a schematic diagram of a preferred embodiment of a device for transmitting interactive information in a live broadcast of the present application.
在本实施例中,直播中互动信息的发送装置1可以是能够与用户终端建立通讯连接的服务器,例如,直播服务器。该直播中互动信息的发送装置1至少包括存储器11、处理器12,通信总线13,以及网络接口14。In this embodiment, the transmitting device 1 for interactive information in the live broadcast may be a server capable of establishing a communication connection with the user terminal, for example, a live broadcast server. The transmitting device 1 for interactive information in the live broadcast includes at least a memory 11, a processor 12, a communication bus 13, and a network interface 14.
其中,存储器11至少包括一种类型的可读存储介质,所述可读存储介质包括闪存、硬盘、多媒体卡、卡型存储器(例如,SD或DX存储器等)、磁性存储器、磁盘、光盘等。存储器11在一些实施例中可以是直播中互动信息 的发送装置1的内部存储单元,例如该直播中互动信息的发送装置1的硬盘。存储器11在另一些实施例中也可以是直播中互动信息的发送装置1的外部存储设备,例如直播中互动信息的发送装置1上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。进一步地,存储器11还可以既包括直播中互动信息的发送装置1的内部存储单元也包括外部存储设备。存储器11不仅可以用于存储安装于直播中互动信息的发送装置1的应用软件及各类数据,例如互动信息发送程序01的代码等,还可以用于暂时地存储已经输出或者将要输出的数据。The memory 11 includes at least one type of readable storage medium including a flash memory, a hard disk, a multimedia card, a card type memory (for example, an SD or DX memory, etc.), a magnetic memory, a magnetic disk, an optical disk, and the like. The memory 11 may in some embodiments be an internal storage unit of the transmitting device 1 for interactive information in live broadcast, such as the hard disk of the transmitting device 1 for interactive information in the live broadcast. In other embodiments, the memory 11 may also be an external storage device of the transmitting device 1 for interactive information in the live broadcast, such as a plug-in hard disk equipped with the interactive device in the live broadcast, and a smart memory card (Smart Media Card, SMC). ), Secure Digital (SD) card, Flash Card, etc. Further, the memory 11 may also include an internal storage unit of the transmitting device 1 that includes both interactive information in the live broadcast and an external storage device. The memory 11 can be used not only for storing application software of the transmitting device 1 installed in the live broadcast, but also for various types of data, such as codes of the interactive information transmitting program 01, and for temporarily storing data that has been output or will be output.
处理器12在一些实施例中可以是一中央处理器(Central Processing Unit,CPU)、控制器、微控制器、微处理器或其他数据处理芯片,用于运行存储器11中存储的程序代码或处理数据,例如执行互动信息发送程序01等。The processor 12, in some embodiments, may be a Central Processing Unit (CPU), controller, microcontroller, microprocessor or other data processing chip for running program code or processing stored in the memory 11. The data, for example, executes the interactive information transmitting program 01 and the like.
通信总线13用于实现这些组件之间的连接通信。 Communication bus 13 is used to implement connection communication between these components.
网络接口14可选的可以包括标准的有线接口、无线接口(如WI-FI接口),通常用于在该装置与其他电子设备之间建立通信连接。The network interface 14 can optionally include a standard wired interface, a wireless interface (such as a WI-FI interface), and is typically used to establish a communication connection between the device and other electronic devices.
图1仅示出了具有组件11-14以及互动信息发送程序01的直播中互动信息的发送装置1,但是应理解的是,并不要求实施所有示出的组件,可以替代的实施更多或者更少的组件。1 shows only the transmitting device 1 having the interactive information in the live broadcast of the components 11-14 and the interactive information transmitting program 01, but it should be understood that not all of the illustrated components are required to be implemented, and alternative implementations may be implemented or Fewer components.
可选地,该装置还可以包括用户接口,用户接口可以包括显示器(Display)、输入单元比如键盘(Keyboard),可选的用户接口还可以包括标准的有线接口、无线接口。可选地,在一些实施例中,显示器可以是LED显示器、液晶显示器、触控式液晶显示器以及OLED(Organic Light-Emitting Diode,有机发光二极管)触摸器等。其中,显示器也可以适当的称为显示屏或显示单元,用于显示在直播中互动信息的发送装置1中处理的信息以及用于显示可视化的用户界面。Optionally, the device may further include a user interface, the user interface may include a display, an input unit such as a keyboard, and the optional user interface may further include a standard wired interface and a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch sensor, or the like. The display may also be appropriately referred to as a display screen or a display unit for displaying information processed in the transmitting device 1 of the interactive information in the live broadcast and a user interface for displaying the visualization.
在图1所示的装置实施例中,存储器11中存储有互动信息发送程序01;处理器12执行存储器11中存储的互动信息发送程序01时实现如下步骤:In the apparatus embodiment shown in FIG. 1, the interactive information transmitting program 01 is stored in the memory 11; when the processor 12 executes the interactive information transmitting program 01 stored in the memory 11, the following steps are implemented:
当接收到用户终端发送的互动信息获取请求时,从所述互动信息获取请求中获取第一时间戳,其中,所述用户终端每间隔预设时间间隔向所述发送装置1发送一次互动信息获取请求,所述互动信息获取请求中携带有所述第一时间戳。When receiving the interactive information acquisition request sent by the user terminal, the first timestamp is obtained from the interaction information acquisition request, where the user terminal sends the interaction information to the sending device 1 at intervals of a preset time interval. The request, the interaction information acquisition request carries the first timestamp.
由于直播平台中的聊天记录,即互动信息,一般以弹幕的形式直接显示在直播的视频的播放画面上,并且用户根据直播的内容发送互动信息,因此,对于互动信息的即时性要求比较高,现有技术中互动信息都是服务器以消息 队列的方式发送到用户的手机端进行显示,但是当出现网络抖动等故障时,会出现互动信息大量累积并一次性发送到用户终端显示,产生对用户来说无效的互动信息,并导致画面出现互动信息滚动显示的现象,导致用户体验差。Since the chat record in the live broadcast platform, that is, the interactive information, is generally displayed on the play screen of the live video in the form of a barrage, and the user sends the interactive information according to the content of the live broadcast, therefore, the immediacy requirement for the interactive information is relatively high. In the prior art, the interactive information is sent to the user's mobile phone by the message queue, but when there is a network jitter or the like, the interactive information is accumulated in a large amount and sent to the user terminal for display. Invalid interactive information by the user, and the phenomenon that the interactive information scrolls and appears on the screen, resulting in poor user experience.
在该实施例中,由客户端周期性地向发送装置1发送获取请求,周期为预设时间间隔,该预设时间间隔可以是预先设置的固定值,在其他实施例中,该预设时间间隔也可以根据参与直播互动的观众的数量或者互动信息的密度进行设置,一般该时间间隔非常小,以使用户能够及时地获取到其他观众发的互动消息。例如,在一些实施例中,预设时间间隔为0.01-5秒,可选地,预设时间间隔取值为0.5秒。用户终端每一次发送互动信息获取请求时,根据终端***的当前时间获取时间戳,在请求中添加该时间戳发送至发送装置1。In this embodiment, the client periodically sends an acquisition request to the sending device 1 for a preset time interval, which may be a preset fixed value. In other embodiments, the preset time The interval can also be set according to the number of viewers participating in the live interaction or the density of the interactive information. Generally, the time interval is very small, so that the user can obtain the interactive message sent by other viewers in time. For example, in some embodiments, the preset time interval is 0.01-5 seconds, and optionally, the preset time interval takes a value of 0.5 seconds. Each time the user terminal sends an interactive information acquisition request, the timestamp is obtained according to the current time of the terminal system, and the timestamp is added to the request and sent to the transmitting device 1.
获取所述用户终端上次发送的互动信息获取请求的第二时间戳;计算所述第一时间戳与所述第二时间戳之间的时间间隔,并判断所述时间间隔是否大于所述预设时间间隔;Obtaining a second timestamp of the interaction information acquisition request sent by the user terminal last time; calculating a time interval between the first timestamp and the second timestamp, and determining whether the time interval is greater than the pre-time Set the time interval;
若所述时间间隔大于所述预设时间间隔,则获取所述第一时间戳与预设时长的差值对应的时间点到所述第一时间戳对应的时间点之间记录的互动信息,并将获取的互动信息发送至所述用户终端进行显示,所述预设时长小于或等于所述预设时间间隔。If the time interval is greater than the preset time interval, the interaction information recorded between the time point corresponding to the difference between the first timestamp and the preset time length and the time point corresponding to the first timestamp is obtained, And sending the obtained interaction information to the user terminal for display, where the preset duration is less than or equal to the preset time interval.
发送装置1从互动信息获取请求中获取第一时间戳,并获取该用户终端上次发送的请求中的时间戳,计算时间间隔,若时间间隔大于预设时间间隔,会导致累计过多互动信息,为了避免有过多的互动信息一次性发送至用户终端导致出现信息滚动的现象,将第一时间戳与预设时长的差值对应的时间点到第一时间戳对应的时间点之间记录的互动信息按照时间顺序发送至用户终端,也就是说,只将第一时间戳之前的预设时长内互动信息发送给用户。例如,预设时间间隔和预设时长均为3秒,在正常情况下,用户终端每3秒向发送装置1发送一次互动信息获取请求对应地,服务器每3秒接收到一次互动信息获取请求并向用户终端发送互动信息,但是当发生网络延迟等异常状况时,发送装置1接收到本次请求时,距离上次请求的间隔已经10秒,那么将距离本次请求最近3秒的互动信息按照时间顺序发送至用户终端。而时间较早的7秒的互动信息就不发了,因为直播中对互动信息的时效性强,间隔时间久的互动信息成为无效信息,即使发送到手机端也会由于滚屏而在当前的画面上看不到,这样不仅能够避免出现互动信息过多造成的滚屏,而且能够保证用户接收到最新的互动信息。The sending device 1 obtains the first timestamp from the interactive information acquisition request, and obtains the timestamp in the request sent by the user terminal last time, and calculates the time interval. If the time interval is greater than the preset time interval, the excessive interaction information may be accumulated. In order to prevent the phenomenon that information is scrolled when the interaction information is sent to the user terminal at one time, the time point corresponding to the difference between the first time stamp and the preset time length is recorded between the time points corresponding to the first time stamp. The interactive information is sent to the user terminal in chronological order, that is, only the interactive information within the preset duration before the first time stamp is sent to the user. For example, the preset time interval and the preset duration are both 3 seconds. Under normal circumstances, the user terminal sends an interactive information acquisition request to the transmitting device 1 every 3 seconds, and the server receives an interactive information acquisition request every 3 seconds. Sending the interactive information to the user terminal, but when an abnormal situation such as a network delay occurs, when the sending device 1 receives the current request, the interval from the last request has been 10 seconds, then the interactive information of the last 3 seconds from the current request is The time sequence is sent to the user terminal. The 7-second interactive information of the earlier time is not sent, because the interactive information is time-sensitive in the live broadcast, and the interactive information that has been separated for a long time becomes invalid information, even if it is sent to the mobile phone, it will be scrolled and the current screen. Can not be seen, this will not only avoid the scrolling caused by too much interactive information, but also ensure that users receive the latest interactive information.
可选地,为了进一步提高互动信息同步的实时性,在发送装置1与所述 用户终端建立直播连接时,将当前的***时间发送至所述用户终端,以供所述用户终端根据接收到的***时间获取与发送装置1之间的时间差,并在向所述发送装置1发送互动信息获取请求时,根据所述时间差确定时间戳,以使该时间戳与所述发送装置1的***时间匹配。Optionally, in order to further improve real-time synchronization of the interaction information, when the transmitting device 1 establishes a live connection with the user terminal, the current system time is sent to the user terminal, so that the user terminal receives the The system time acquires a time difference from the transmitting device 1, and when transmitting an interactive information acquisition request to the transmitting device 1, determines a timestamp according to the time difference, so that the timestamp matches the system time of the transmitting device 1. .
由于用户终端的***时间与发送装置1之间的***时间可能存在不一致的情况,为了避免由于这种情况而造成互动信息不实时的现象,在发送装置1与用户终端建立直播连接时,发送装置1将当前的***时间发送至用户终端,用户终端判断自身的***时间与发送装置1的***时间是否一致,如果不一致,则记录时间差,以便于根据时间差调整互动信息获取请求中的时间戳,使得发送至发送装置1的时间戳与发送装置1的时间一致。Since the system time of the user terminal may be inconsistent with the system time between the transmitting device 1, in order to avoid the phenomenon that the interactive information is not real-time due to such a situation, when the transmitting device 1 establishes a live connection with the user terminal, the transmitting device 1 sending the current system time to the user terminal, the user terminal determining whether the system time of the system is consistent with the system time of the transmitting device 1, and if not, recording the time difference, so as to adjust the time stamp in the interactive information obtaining request according to the time difference, so that The time stamp sent to the transmitting device 1 coincides with the time of the transmitting device 1.
此外,在网络正常的情况下,对于发送装置1来说,相邻两次接收到的请求中的时间戳的时间间隔一般等于预设时间间隔,在这种情况下,对于互动消息的处理,可以有多种实施方式。以下列举其中的两种进行说明。In addition, in the case that the network is normal, for the transmitting device 1, the time interval of the timestamp in the two received requests is generally equal to the preset time interval, in which case, for the processing of the interactive message, There are many ways to do this. Two of them are listed below for explanation.
方式一,互动信息发送程序01还可被所述处理器执行,以在所述计算所述第一时间戳与所述第二时间戳之间的时间间隔,并判断所述时间间隔是否大于预设时间间隔的步骤之后,还实现如下步骤:In a first manner, the interactive information sending program 01 is further executable by the processor to calculate a time interval between the first timestamp and the second timestamp, and determine whether the time interval is greater than a pre- After the step of time interval, the following steps are also implemented:
若所述时间间隔等于所述预设时间间隔,则获取所述时间间隔内记录的互动信息,并将获取的互动信息发送至所述用户终端进行显示。If the time interval is equal to the preset time interval, the interaction information recorded in the time interval is acquired, and the acquired interaction information is sent to the user terminal for display.
方式二,互动信息发送程序01还可被所述处理器执行,以在计算所述第一时间戳与所述第二时间戳之间的时间间隔,并判断所述时间间隔是否大于预设时间间隔的步骤之后,还实现如下步骤:In a second manner, the interactive information sending program 01 is further executed by the processor to calculate a time interval between the first timestamp and the second timestamp, and determine whether the time interval is greater than a preset time. After the interval step, the following steps are also implemented:
若所述时间间隔等于所述预设时间间隔,则获取所述时间间隔内记录的互动信息,并确定获取的互动信息的数量;And if the time interval is equal to the preset time interval, acquiring interaction information recorded in the time interval, and determining the quantity of the acquired interaction information;
若获取的互动信息的数量大于预设数量,则将距离所述第一时间戳对应的时间点最近的预设数量的互动信息发送至所述用户终端进行显示;If the number of the acquired interactive information is greater than the preset number, the preset number of interaction information that is closest to the time point corresponding to the first time stamp is sent to the user terminal for display;
若获取的互动信息的数量小于或者等于所述预设数量,则获取所述时间间隔内记录的互动信息,并将获取的互动信息发送至所述用户终端进行显示。If the obtained number of pieces of interaction information is less than or equal to the preset number, the interaction information recorded in the time interval is acquired, and the acquired interaction information is sent to the user terminal for display.
由于直播过程中参与互动的观众的数量是在变化的,相同的时长内产生的互动消息的数量可能不同,因此,为了进一步减少无效数据的传输,在时间间隔等于预设时间间隔的情况下,对发送装置1在这个时间间隔内记录的互动信息的数量进行统计,若数量大于预设数量,则将距离第一时间戳对应的时间点最近的预设数量的互动信息发送至用户终端进行显示,否则,将上述时间间隔内记录的互动信息发送至用户终端进行显示。Since the number of interactive participants participating in the live broadcast process is changing, the number of interactive messages generated during the same duration may be different. Therefore, in order to further reduce the transmission of invalid data, when the time interval is equal to the preset time interval, The number of pieces of interactive information recorded by the sending device 1 during the time interval is counted. If the number is greater than the preset number, the preset number of pieces of interactive information that is closest to the time point corresponding to the first time stamp is sent to the user terminal for display. Otherwise, the interactive information recorded in the above time interval is sent to the user terminal for display.
本实施例提出的直播中互动信息的发送装置1,由用户终端每间隔预设时间间隔主动向发送装置1发起一次互动信息获取请求,并在该请求中携带第一时间戳,发送装置1从接收到的互动信息获取请求中获取第一时间戳,并获取该用户终端上一次发送的互动信息获取请求中的第二时间戳,计算第一时间戳与第二时间戳之间的时间间隔,若该时间间隔大于预设时间间隔,则获取第一时间戳与预设时长的差值的时间点到第一时间戳对应的时间点之间记录的互动信息,并发送至所述用户终端进行显示,本申请的上述方案中,发送装置1并不主动向用户终端发送互动信息,由用户终端周期性地发送互动信息获取请求获取互动信息及进行显示,在发生网络抖动或者网络延迟等原因导致服务端连续两次接收到的请求的时间间隔较大时,只将距离当前时间戳较近的一段时间的互动信息发送客户端显示,能够减少无效数据的传输,增强聊天记录的有效性,避免由于网络抖动产生的大量聊天记录滚动的现象。The device 1 for transmitting interactive information in the live broadcast of the present embodiment initiates an interactive information acquisition request to the transmitting device 1 at a preset time interval, and carries the first timestamp in the request, and the sending device 1 Obtaining a first timestamp in the received interactive information acquisition request, and acquiring a second timestamp in the interactive information acquisition request sent by the user terminal, and calculating a time interval between the first timestamp and the second timestamp. If the time interval is greater than the preset time interval, the interaction information recorded between the time point of the difference between the first time stamp and the preset time length and the time point corresponding to the first time stamp is obtained, and sent to the user terminal. It is shown that, in the above solution of the present application, the sending device 1 does not actively send the interactive information to the user terminal, and the user terminal periodically sends the interactive information obtaining request to obtain the interactive information and display, which causes network jitter or network delay. When the interval between two consecutive requests received by the server is large, only the segment closer to the current timestamp is used. The interactive information of the time is sent to the client display, which can reduce the transmission of invalid data, enhance the validity of the chat record, and avoid the phenomenon that a large number of chat records are scrolled due to network jitter.
基于第一实施例提出本申请直播中互动信息的发送装置1的第二实施例。在本实施例中,互动信息发送程序01还可被所述处理器执行,以在获取所述第一时间戳与预设时长的差值对应的时间点到所述第一时间戳对应的时间点之间记录的互动信息的步骤之前,还实现如下步骤:A second embodiment of the transmitting apparatus 1 for interactive information in the live broadcast of the present application is proposed based on the first embodiment. In this embodiment, the interaction information sending program 01 may be further executed by the processor to obtain a time corresponding to the difference between the first time stamp and the preset time length to the time corresponding to the first time stamp. Before the steps of recording interactive information between points, the following steps are also implemented:
若所述时间间隔大于所述预设时间间隔,则确定当前参与直播互动的观众数量;If the time interval is greater than the preset time interval, determining the number of viewers currently participating in the live interaction;
根据预先设置的参与直播互动的观众数量与预设时长之间的映射关系,获取与当前参与直播互动的观众数量对应的预设时长,其中,参与直播互动的观众数量越多,所述预设时长越小;Obtaining a preset duration corresponding to the number of viewers currently participating in the live broadcast according to a preset mapping relationship between the number of viewers participating in the live interaction and the preset duration, wherein the more the number of viewers participating in the live interaction, the preset The smaller the duration;
基于获取的预设时长,执行获取所述第一时间戳与预设时长的差值对应的时间点到所述第一时间戳对应的时间点之间记录的互动信息的步骤。And performing the step of acquiring the interaction information recorded between the time point corresponding to the difference between the first timestamp and the preset time length to the time point corresponding to the first timestamp.
在该实施例中,预设时长是一个可以动态调整的数值,发送装置1根据参与直播互动的观众数量动态的调节预设时长的大小。预先建立参与直播互动的观众数量与预设时长之间的映射关系,参与直播互动的观众数量越多,预设时长越小。按照上述映射关系确定当前参与直播互动的观众数量对应的预设时长。进而获取对应的互动信息发送至用户终端。In this embodiment, the preset duration is a dynamically adjustable value, and the transmitting device 1 dynamically adjusts the preset duration according to the number of viewers participating in the live interaction. The mapping relationship between the number of viewers participating in the live interaction and the preset duration is established in advance, and the more the number of viewers participating in the live interaction, the smaller the preset duration. The preset duration corresponding to the number of viewers currently participating in the live interaction is determined according to the above mapping relationship. Then, the corresponding interactive information is obtained and sent to the user terminal.
可选地,在其他的实施例中,互动信息发送程序01还可以被分割为一个或者多个模块,一个或者多个模块被存储于存储器11中,并由一个或多个处理器(本实施例为处理器12)所执行以完成本申请,本申请所称的模块是指能够完成特定功能的一系列计算机程序指令段,用于描述互动信息发送程序01在直播中互动信息的发送装置1中的执行过程。Optionally, in other embodiments, the interactive information sending program 01 may also be divided into one or more modules, one or more modules are stored in the memory 11 and executed by one or more processors (this implementation) For example, the processor 12) is executed to complete the application. The module referred to in the present application refers to a series of computer program instruction segments capable of performing a specific function, and is used to describe the transmitting device 1 for interactive information transmission program 01 in the live broadcast. The execution process in .
例如,参照图2所示,为本申请直播中互动信息的发送装置一实施例中的互动信息发送程序的程序模块示意图,该实施例中,互动信息发送程序可以被分割为获取模块10、计算模块20、判断模块30和发送模块40,示例性地:For example, referring to FIG. 2, it is a schematic diagram of a program module of an interactive information sending program in an embodiment of an apparatus for transmitting interactive information in a live broadcast of the present application. In this embodiment, the interactive information sending program may be divided into an obtaining module 10 and calculating Module 20, determination module 30, and transmission module 40, by way of example:
模块10用于:当接收到用户终端发送的互动信息获取请求时,从所述互动信息获取请求中获取第一时间戳,其中,所述用户终端每间隔预设时间间隔向所述发送装置发送一次互动信息获取请求,所述互动信息获取请求中携带有所述第一时间戳;The module 10 is configured to: when receiving an interaction information acquisition request sent by the user terminal, obtain a first timestamp from the interaction information acquisition request, where the user terminal sends the preset time interval to the sending device at intervals An interaction information acquisition request, where the interaction information acquisition request carries the first timestamp;
获取模块10还用于:获取所述用户终端上次发送的互动信息获取请求的第二时间戳;The obtaining module 10 is further configured to: acquire a second timestamp of the interaction information acquisition request sent by the user terminal last time;
计算模块20用于:计算所述第一时间戳与所述第二时间戳之间的时间间隔;The calculating module 20 is configured to: calculate a time interval between the first timestamp and the second timestamp;
判断模块30用于:判断所述时间间隔是否大于所述预设时间间隔;The determining module 30 is configured to: determine whether the time interval is greater than the preset time interval;
发送模块40用于:若所述时间间隔大于所述预设时间间隔,则获取所述第一时间戳与预设时长的差值对应的时间点到所述第一时间戳对应的时间点之间记录的互动信息,并将获取的互动信息发送至所述用户终端进行显示,所述预设时长小于或等于所述预设时间间隔。The sending module 40 is configured to: when the time interval is greater than the preset time interval, obtain a time point corresponding to the difference between the first timestamp and the preset time length to a time point corresponding to the first timestamp The recorded interactive information is sent to the user terminal for display, and the preset duration is less than or equal to the preset time interval.
上述获取模块10、计算模块20、判断模块30和发送模块40等程序模块被执行时所实现的功能或操作步骤与上述实施例大体相同,在此不再赘述。The functions or operation steps of the above-mentioned acquisition module 10, the calculation module 20, the determination module 30, and the transmission module 40 are substantially the same as those in the above embodiments, and are not described herein again.
此外,本申请还提供一种直播中互动信息的发送方法。参照图3所示,为本申请直播中互动信息的发送方法第一实施例的流程图。该方法可以由一个装置执行,该装置可以由软件和/或硬件实现。In addition, the present application also provides a method for transmitting interactive information in a live broadcast. Referring to FIG. 3, it is a flowchart of a first embodiment of a method for transmitting interactive information in a live broadcast of the present application. The method can be performed by a device that can be implemented by software and/or hardware.
在本实施例中,直播中互动信息的发送方法包括:In this embodiment, the method for sending the interactive information in the live broadcast includes:
步骤S10,当接收到用户终端发送的互动信息获取请求时,从所述互动信息获取请求中获取第一时间戳,其中,所述用户终端每间隔预设时间间隔向所述直播服务器发送一次互动信息获取请求,所述互动信息获取请求中携带有所述第一时间戳。In step S10, when receiving the interaction information acquisition request sent by the user terminal, the first timestamp is obtained from the interaction information acquisition request, where the user terminal sends an interaction to the live server every preset time interval. The information acquisition request carries the first timestamp in the interaction information acquisition request.
以下以直播服务器作为执行主体对本实施例的方法进行说明。由于直播平台中的聊天记录,即互动信息,一般以弹幕的形式直接显示在直播的视频的播放画面上,并且用户根据直播的内容发送互动信息,因此,对于互动信息的即时性要求比较高,现有技术中互动信息都是服务器以消息队列的方式发送到用户的手机端进行显示,但是当出现网络抖动等故障时,会出现互动信息大量累积并一次性发送到用户终端显示,产生对用户来说无效的互动信 息,并导致画面出现互动信息滚动显示的现象,导致用户体验差。The method of this embodiment will be described below with the live broadcast server as the execution subject. Since the chat record in the live broadcast platform, that is, the interactive information, is generally displayed on the play screen of the live video in the form of a barrage, and the user sends the interactive information according to the content of the live broadcast, therefore, the immediacy requirement for the interactive information is relatively high. In the prior art, the interactive information is sent to the user's mobile phone by the message queue, but when there is a network jitter or the like, the interactive information is accumulated in a large amount and sent to the user terminal for display. Invalid interactive information by the user, and the phenomenon that the interactive information scrolls and appears on the screen, resulting in poor user experience.
在该实施例中,由客户端周期性地向直播服务器发送获取请求,周期为预设时间间隔,该预设时间间隔可以是预先设置的固定值,在其他实施例中,该预设时间间隔也可以根据参与直播互动的观众的数量或者互动信息的密度进行设置,一般该时间间隔非常小,以使用户能够及时地获取到其他观众发的互动消息。例如,在一些实施例中,预设时间间隔为0.01-5秒,可选地,预设时间间隔取值为0.5秒。用户终端每一次发送互动信息获取请求时,根据终端***的当前时间获取时间戳,在请求中添加该时间戳发送至直播服务器。In this embodiment, the client periodically sends an acquisition request to the live server, and the period is a preset time interval, and the preset time interval may be a preset fixed value. In other embodiments, the preset time interval. It can also be set according to the number of viewers participating in the live interaction or the density of the interactive information. Generally, the time interval is very small, so that the user can obtain the interactive message sent by other viewers in time. For example, in some embodiments, the preset time interval is 0.01-5 seconds, and optionally, the preset time interval takes a value of 0.5 seconds. Each time the user terminal sends an interactive information acquisition request, the timestamp is obtained according to the current time of the terminal system, and the timestamp is added to the request to be sent to the live broadcast server.
步骤S20,获取所述用户终端上次发送的互动信息获取请求的第二时间戳;Step S20: Obtain a second timestamp of the interaction information acquisition request sent by the user terminal last time;
步骤S30,计算所述第一时间戳与所述第二时间戳之间的时间间隔,并判断所述时间间隔是否大于所述预设时间间隔;Step S30, calculating a time interval between the first timestamp and the second timestamp, and determining whether the time interval is greater than the preset time interval;
步骤S40,若所述时间间隔大于所述预设时间间隔,则获取所述第一时间戳与预设时长的差值对应的时间点到所述第一时间戳对应的时间点之间记录的互动信息,并将获取的互动信息发送至所述用户终端进行显示,所述预设时长小于或等于所述预设时间间隔。In step S40, if the time interval is greater than the preset time interval, the time point corresponding to the difference between the first timestamp and the preset time length is recorded to be recorded between the time points corresponding to the first timestamp. The interaction information is sent to the user terminal for display, and the preset duration is less than or equal to the preset time interval.
直播服务器从互动信息获取请求中获取第一时间戳,并获取该用户终端上次发送的请求中的时间戳,计算时间间隔,若时间间隔大于预设时间间隔,会导致累计过多互动信息,为了避免有过多的互动信息一次性发送至用户终端导致出现信息滚动的现象,将第一时间戳与预设时长的差值对应的时间点到第一时间戳对应的时间点之间记录的互动信息发送至用户终端发送至用户终端,也就是说,只将第一时间戳之前的预设时长内互动信息发送给用户。例如,预设时间间隔和预设时长均为3秒,在正常情况下,用户终端每3秒向发送装置发送一次互动信息获取请求对应地,服务器每3秒接收到一次互动信息获取请求并向用户终端发送互动信息,但是当发生网络延迟等异常状况时,发送装置接收到本次请求时,距离上次请求的间隔已经10秒,那么将距离本次请求最近3秒的互动信息按照时间顺序发送至用户终端。而时间较早的7秒的互动信息就不发了,因为直播中对互动信息的时效性强,间隔时间久的互动信息成为无效信息,即使发送到手机端也会由于滚屏而在当前的画面上看不到,这样不仅能够避免出现互动信息过多造成的滚屏,而且能够保证用户接收到最新的互动信息。The live server obtains the first timestamp from the interactive information acquisition request, and obtains the timestamp in the request sent by the user terminal last time, and calculates the time interval. If the time interval is greater than the preset time interval, the interactive information is accumulated excessively. In order to avoid the phenomenon that excessive interaction information is sent to the user terminal and the information scrolls, the time point corresponding to the difference between the first time stamp and the preset time length is recorded between the time points corresponding to the first time stamp. The interactive information is sent to the user terminal and sent to the user terminal, that is, only the preset time duration interaction information before the first time stamp is sent to the user. For example, the preset time interval and the preset duration are both 3 seconds. Under normal circumstances, the user terminal sends an interactive information acquisition request to the transmitting device every 3 seconds, and the server receives an interactive information acquisition request every 3 seconds and The user terminal sends the interaction information, but when an abnormal situation such as a network delay occurs, the sending device receives the current request, and the interval from the last request has been 10 seconds, then the interaction information of the last 3 seconds from the current request is in chronological order. Send to the user terminal. The 7-second interactive information of the earlier time is not sent, because the interactive information is time-sensitive in the live broadcast, and the interactive information that has been separated for a long time becomes invalid information, even if it is sent to the mobile phone, it will be scrolled and the current screen. Can not be seen, this will not only avoid the scrolling caused by too much interactive information, but also ensure that users receive the latest interactive information.
可选地,为了进一步提高互动信息同步的实时性,在直播服务器与所述用户终端建立直播连接时,将当前的***时间发送至所述用户终端,以供所述用户终端根据接收到的***时间获取与直播服务器之间的时间差,并在向 所述直播服务器发送互动信息获取请求时,根据所述时间差确定时间戳,以使该时间戳与所述直播服务器的***时间匹配。Optionally, in order to further improve real-time synchronization of the interaction information, when the live server establishes a live connection with the user terminal, the current system time is sent to the user terminal, so that the user terminal is configured according to the received system. Obtaining a time difference between the time and the live server, and sending an interaction information acquisition request to the live server, determining a timestamp according to the time difference, so that the timestamp matches the system time of the live server.
由于用户终端的***时间与直播服务器之间的***时间可能存在不一致的情况,为了避免由于这种情况而造成互动信息不实时的现象,在直播服务器与用户终端建立直播连接时,直播服务器将当前的***时间发送至用户终端,用户终端判断自身的***时间与直播服务器的***时间是否一致,如果不一致,则记录时间差,以便于根据时间差调整互动信息获取请求中的时间戳,使得发送至直播服务器的时间戳与直播服务器的时间一致。Since the system time of the user terminal may be inconsistent with the system time between the live server, in order to avoid the phenomenon that the interactive information is not real-time due to the situation, when the live server establishes a live connection with the user terminal, the live server will be current. The system time is sent to the user terminal, and the user terminal determines whether the system time of the user is consistent with the system time of the live server. If not, the time difference is recorded, so that the time stamp in the interactive information acquisition request is adjusted according to the time difference, so that the time is sent to the live server. The timestamp is the same as the time of the live server.
此外,在网络正常的情况下,对于直播服务器来说,相邻两次接收到的请求中的时间戳的时间间隔一般等于预设时间间隔,在这种情况下,对于互动消息的处理,可以有多种实施方式。以下列举其中的两种进行说明。In addition, in the case that the network is normal, for the live server, the time interval of the timestamps in the two received requests is generally equal to the preset time interval. In this case, for the processing of the interactive message, There are many implementations. Two of them are listed below for explanation.
方式一,互动信息发送程序还可被所述处理器执行,以在所述计算所述第一时间戳与所述第二时间戳之间的时间间隔,并判断所述时间间隔是否大于预设时间间隔的步骤之后,还实现如下步骤:In a first mode, the interactive information sending program is further executed by the processor to calculate a time interval between the first timestamp and the second timestamp, and determine whether the time interval is greater than a preset. After the time interval step, the following steps are also implemented:
若所述时间间隔等于所述预设时间间隔,则获取所述时间间隔内记录的互动信息,并将获取的互动信息发送至所述用户终端进行显示。If the time interval is equal to the preset time interval, the interaction information recorded in the time interval is acquired, and the acquired interaction information is sent to the user terminal for display.
方式二,互动信息发送程序还可被所述处理器执行,以在计算所述第一时间戳与所述第二时间戳之间的时间间隔,并判断所述时间间隔是否大于预设时间间隔的步骤之后,还实现如下步骤:In a second manner, the interactive information sending program is further executed by the processor to calculate a time interval between the first timestamp and the second timestamp, and determine whether the time interval is greater than a preset time interval. After the steps, the following steps are also implemented:
若所述时间间隔等于所述预设时间间隔,则获取所述时间间隔内记录的互动信息,并确定获取的互动信息的数量;And if the time interval is equal to the preset time interval, acquiring interaction information recorded in the time interval, and determining the quantity of the acquired interaction information;
若获取的互动信息的数量大于预设数量,则将距离所述第一时间戳对应的时间点最近的预设数量的互动信息发送至所述用户终端进行显示;If the number of the acquired interactive information is greater than the preset number, the preset number of interaction information that is closest to the time point corresponding to the first time stamp is sent to the user terminal for display;
若获取的互动信息的数量小于或者等于所述预设数量,则获取所述时间间隔内记录的互动信息,并将获取的互动信息发送至所述用户终端进行显示。If the obtained number of pieces of interaction information is less than or equal to the preset number, the interaction information recorded in the time interval is acquired, and the acquired interaction information is sent to the user terminal for display.
由于直播过程中参与互动的观众的数量是在变化的,相同的时长内产生的互动消息的数量可能不同,因此,为了进一步减少无效数据的传输,在时间间隔等于预设时间间隔的情况下,对直播服务器在这个时间间隔内记录的互动信息的数量进行统计,若数量大于预设数量,则将距离第一时间戳对应的时间点最近的预设数量的互动信息发送至用户终端进行显示,否则,将上述时间间隔内记录的互动信息发送至用户终端进行显示。Since the number of interactive participants participating in the live broadcast process is changing, the number of interactive messages generated during the same duration may be different. Therefore, in order to further reduce the transmission of invalid data, when the time interval is equal to the preset time interval, The number of the interactive information recorded by the live server during the time interval is counted. If the quantity is greater than the preset number, the preset number of interaction information that is closest to the time point corresponding to the first time stamp is sent to the user terminal for display. Otherwise, the interactive information recorded in the above time interval is sent to the user terminal for display.
本实施例提出的直播中互动信息的发送方法,由用户终端每间隔预设时间间隔主动向直播服务器发起一次互动信息获取请求,并在该请求中携带第 一时间戳,直播服务器从接收到的互动信息获取请求中获取第一时间戳,并获取该用户终端上一次发送的互动信息获取请求中的第二时间戳,计算第一时间戳与第二时间戳之间的时间间隔,若该时间间隔大于预设时间间隔,则获取第一时间戳与预设时长的差值的时间点到第一时间戳对应的时间点之间记录的互动信息,并发送至所述用户终端进行显示,本申请的上述方案中,直播服务器并不主动向用户终端发送互动信息,由用户终端周期性地发送互动信息获取请求获取互动信息及进行显示,在发生网络抖动或者网络延迟等原因导致服务端连续两次接收到的请求的时间间隔较大时,只将距离当前时间戳较近的一段时间的互动信息发送客户端显示,能够减少无效数据的传输,增强聊天记录的有效性,避免由于网络抖动产生的大量聊天记录滚动的现象。In the method for transmitting the interactive information in the live broadcast, the user terminal initiates an interactive information acquisition request to the live server at a preset interval, and carries the first timestamp in the request, and the live server receives the received information. Obtaining a first timestamp in the interactive information acquisition request, and acquiring a second timestamp in the interactive information acquisition request sent by the user terminal, and calculating a time interval between the first timestamp and the second timestamp, if the time is If the interval is greater than the preset time interval, the interaction information recorded between the time point of the difference between the first timestamp and the preset time length and the time point corresponding to the first timestamp is obtained, and sent to the user terminal for display, In the above solution, the live broadcast server does not actively send the interactive information to the user terminal, and the user terminal periodically sends the interactive information acquisition request to obtain the interactive information and display it, and the server end consecutively causes two reasons such as network jitter or network delay. When the time interval of the received request is large, only the current time stamp is closer. A period of interactive information transmission client display can reduce the transmission of invalid data, enhance the effectiveness of chat records, and avoid the phenomenon of a large number of chat records rolling due to network jitter.
基于第一实施例提出本申请直播中互动信息的发送方法的第二实施例。在本实施例中,步骤S40之前,该方法还包括如下步骤:A second embodiment of a method for transmitting interactive information in a live broadcast of the present application is proposed based on the first embodiment. In this embodiment, before step S40, the method further includes the following steps:
若所述时间间隔大于所述预设时间间隔,则确定当前参与直播互动的观众数量;If the time interval is greater than the preset time interval, determining the number of viewers currently participating in the live interaction;
根据预先设置的参与直播互动的观众数量与预设时长之间的映射关系,获取与当前参与直播互动的观众数量对应的预设时长,其中,参与直播互动的观众数量越多,所述预设时长越小;Obtaining a preset duration corresponding to the number of viewers currently participating in the live broadcast according to a preset mapping relationship between the number of viewers participating in the live interaction and the preset duration, wherein the more the number of viewers participating in the live interaction, the preset The smaller the duration;
基于获取的预设时长,执行获取所述第一时间戳与预设时长的差值对应的时间点到所述第一时间戳对应的时间点之间记录的互动信息的步骤。And performing the step of acquiring the interaction information recorded between the time point corresponding to the difference between the first timestamp and the preset time length to the time point corresponding to the first timestamp.
在该实施例中,预设时长是一个可以动态调整的数值,直播服务器根据参与直播互动的观众数量动态的调节预设时长的大小。预先建立参与直播互动的观众数量与预设时长之间的映射关系,参与直播互动的观众数量越多,预设时长越小。按照上述映射关系确定当前参与直播互动的观众数量对应的预设时长。进而获取对应的互动信息发送至用户终端。In this embodiment, the preset duration is a dynamically adjustable value, and the live server dynamically adjusts the preset duration according to the number of viewers participating in the live interaction. The mapping relationship between the number of viewers participating in the live interaction and the preset duration is established in advance, and the more the number of viewers participating in the live interaction, the smaller the preset duration. The preset duration corresponding to the number of viewers currently participating in the live interaction is determined according to the above mapping relationship. Then, the corresponding interactive information is obtained and sent to the user terminal.
此外,本申请还提出一种计算机可读存储介质,所述计算机可读存储介质上存储有互动信息发送程序,所述互动信息发送程序可被一个或多个处理器执行,以实现如下步骤:In addition, the present application further provides a computer readable storage medium having an interactive information transmitting program stored thereon, the interactive information transmitting program being executable by one or more processors to implement the following steps:
当接收到用户终端发送的互动信息获取请求时,从所述互动信息获取请求中获取第一时间戳,其中,所述用户终端每间隔预设时间间隔向所述发送装置发送一次互动信息获取请求,所述互动信息获取请求中携带有所述第一时间戳;Obtaining a first timestamp from the interaction information acquisition request when receiving the interaction information acquisition request sent by the user terminal, where the user terminal sends an interaction information acquisition request to the sending device every preset time interval The interaction information acquisition request carries the first timestamp;
获取所述用户终端上次发送的互动信息获取请求的第二时间戳;Obtaining a second timestamp of the interaction information acquisition request sent by the user terminal last time;
计算所述第一时间戳与所述第二时间戳之间的时间间隔,并判断所述时 间间隔是否大于所述预设时间间隔;Calculating a time interval between the first timestamp and the second timestamp, and determining whether the time interval is greater than the preset time interval;
若所述时间间隔大于所述预设时间间隔,则获取所述第一时间戳与预设时长的差值对应的时间点到所述第一时间戳对应的时间点之间记录的互动信息,并将获取的互动信息发送至所述用户终端进行显示,所述预设时长小于或等于所述预设时间间隔。If the time interval is greater than the preset time interval, the interaction information recorded between the time point corresponding to the difference between the first timestamp and the preset time length and the time point corresponding to the first timestamp is obtained, And sending the obtained interaction information to the user terminal for display, where the preset duration is less than or equal to the preset time interval.
本申请计算机可读存储介质具体实施方式与上述直播中互动信息的发送装置和方法各实施例基本相同,在此不作累述。The specific embodiment of the computer readable storage medium of the present application is substantially the same as the embodiment of the apparatus and method for transmitting interactive information in the live broadcast, and is not described herein.
需要说明的是,上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。并且本文中的术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、装置、物品或者方法不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、装置、物品或者方法所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、装置、物品或者方法中还存在另外的相同要素。It should be noted that the foregoing serial numbers of the embodiments of the present application are merely for the description, and do not represent the advantages and disadvantages of the embodiments. And the terms "including", "comprising", or any other variations thereof are intended to encompass a non-exclusive inclusion, such that a process, apparatus, article, or method that comprises a plurality of elements includes not only those elements but also Other elements listed, or elements that are inherent to such a process, device, item, or method. An element that is defined by the phrase "comprising a ..." does not exclude the presence of additional equivalent elements in the process, the device, the item, or the method that comprises the element.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在如上所述的一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,或者网络设备等)执行本申请各个实施例所述的方法。Through the description of the above embodiments, those skilled in the art can clearly understand that the foregoing embodiment method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be through hardware, but in many cases, the former is better. Implementation. Based on such understanding, the technical solution of the present application, which is essential or contributes to the prior art, may be embodied in the form of a software product stored in a storage medium (such as ROM/RAM as described above). , a disk, an optical disk, including a number of instructions for causing a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the methods described in the various embodiments of the present application.
以上仅为本申请的优选实施例,并非因此限制本申请的专利范围,凡是利用本申请说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本申请的专利保护范围内。The above is only a preferred embodiment of the present application, and is not intended to limit the scope of the patent application, and the equivalent structure or equivalent process transformations made by the specification and the drawings of the present application, or directly or indirectly applied to other related technical fields. The same is included in the scope of patent protection of this application.

Claims (20)

  1. 一种直播中互动信息的发送装置,其特征在于,所述装置包括存储器和处理器,所述存储器上存储有可在所述处理器上运行的互动信息发送程序,所述互动信息发送程序被所述处理器执行时实现如下步骤:A device for transmitting interactive information in a live broadcast, characterized in that the device comprises a memory and a processor, and the memory stores an interactive information transmitting program operable on the processor, and the interactive information transmitting program is The processor implements the following steps when executed:
    当接收到用户终端发送的互动信息获取请求时,从所述互动信息获取请求中获取第一时间戳,其中,所述用户终端每间隔预设时间间隔向所述发送装置发送一次互动信息获取请求,所述互动信息获取请求中携带有所述第一时间戳;Obtaining a first timestamp from the interaction information acquisition request when receiving the interaction information acquisition request sent by the user terminal, where the user terminal sends an interaction information acquisition request to the sending device every preset time interval The interaction information acquisition request carries the first timestamp;
    获取所述用户终端上次发送的互动信息获取请求的第二时间戳;Obtaining a second timestamp of the interaction information acquisition request sent by the user terminal last time;
    计算所述第一时间戳与所述第二时间戳之间的时间间隔,并判断所述时间间隔是否大于所述预设时间间隔;Calculating a time interval between the first timestamp and the second timestamp, and determining whether the time interval is greater than the preset time interval;
    若所述时间间隔大于所述预设时间间隔,则获取所述第一时间戳与预设时长的差值对应的时间点到所述第一时间戳对应的时间点之间记录的互动信息,并将获取的互动信息发送至所述用户终端进行显示,所述预设时长小于或等于所述预设时间间隔。If the time interval is greater than the preset time interval, the interaction information recorded between the time point corresponding to the difference between the first timestamp and the preset time length and the time point corresponding to the first timestamp is obtained, And sending the obtained interaction information to the user terminal for display, where the preset duration is less than or equal to the preset time interval.
  2. 如权利要求1所述的直播中互动信息的发送装置,其特征在于,所述互动信息发送程序还可被所述处理器执行,以在所述计算所述第一时间戳与所述第二时间戳之间的时间间隔,并判断所述时间间隔是否大于预设时间间隔的步骤之后,还实现如下步骤:The apparatus for transmitting interactive information in a live broadcast according to claim 1, wherein said interactive information transmitting program is further executable by said processor to calculate said first time stamp and said second at said After the time interval between the time stamps and the step of determining whether the time interval is greater than the preset time interval, the following steps are also implemented:
    若所述时间间隔等于所述预设时间间隔,则获取所述时间间隔内记录的互动信息,并将获取的互动信息发送至所述用户终端进行显示。If the time interval is equal to the preset time interval, the interaction information recorded in the time interval is acquired, and the acquired interaction information is sent to the user terminal for display.
  3. 如权利要求1所述的直播中互动信息的发送装置,其特征在于,所述互动信息发送程序还可被所述处理器执行,以在计算所述第一时间戳与所述第二时间戳之间的时间间隔,并判断所述时间间隔是否大于预设时间间隔的步骤之后,还实现如下步骤:The apparatus for transmitting interactive information in a live broadcast according to claim 1, wherein the interactive information transmitting program is further executable by the processor to calculate the first timestamp and the second timestamp After the time interval between the steps and the step of determining whether the time interval is greater than the preset time interval, the following steps are also implemented:
    若所述时间间隔等于所述预设时间间隔,则获取所述时间间隔内记录的互动信息,并确定获取的互动信息的数量;And if the time interval is equal to the preset time interval, acquiring interaction information recorded in the time interval, and determining the quantity of the acquired interaction information;
    若获取的互动信息的数量大于预设数量,则将距离所述第一时间戳对应的时间点最近的预设数量的互动信息发送至所述用户终端进行显示;If the number of the acquired interactive information is greater than the preset number, the preset number of interaction information that is closest to the time point corresponding to the first time stamp is sent to the user terminal for display;
    若获取的互动信息的数量小于或者等于所述预设数量,则获取所述时间间隔内记录的互动信息,并将获取的互动信息发送至所述用户终端进行显示。If the obtained number of pieces of interaction information is less than or equal to the preset number, the interaction information recorded in the time interval is acquired, and the acquired interaction information is sent to the user terminal for display.
  4. 如权利要求1所述的直播中互动信息的发送装置,其特征在于,所述互动信息发送程序还可被所述处理器执行,以在获取所述第一时间戳与预设 时长的差值对应的时间点到所述第一时间戳对应的时间点之间记录的互动信息的步骤之前,还实现如下步骤:The apparatus for transmitting interactive information in a live broadcast according to claim 1, wherein the interactive information transmitting program is further executable by the processor to obtain a difference between the first timestamp and a preset duration Before the step of recording the interactive information between the corresponding time points and the time points corresponding to the first time stamp, the following steps are also implemented:
    若所述时间间隔大于所述预设时间间隔,则确定当前参与直播互动的观众数量;If the time interval is greater than the preset time interval, determining the number of viewers currently participating in the live interaction;
    根据预先设置的参与直播互动的观众数量与预设时长之间的映射关系,获取与当前参与直播互动的观众数量对应的预设时长,其中,参与直播互动的观众数量越多,所述预设时长越小;Obtaining a preset duration corresponding to the number of viewers currently participating in the live broadcast according to a preset mapping relationship between the number of viewers participating in the live interaction and the preset duration, wherein the more the number of viewers participating in the live interaction, the preset The smaller the duration;
    基于获取的预设时长,执行获取所述第一时间戳与预设时长的差值对应的时间点到所述第一时间戳对应的时间点之间记录的互动信息的步骤。And performing the step of acquiring the interaction information recorded between the time point corresponding to the difference between the first timestamp and the preset time length to the time point corresponding to the first timestamp.
  5. 如权利要求2所述的直播中互动信息的发送装置,其特征在于,所述互动信息发送程序还可被所述处理器执行,以在获取所述第一时间戳与预设时长的差值对应的时间点到所述第一时间戳对应的时间点之间记录的互动信息的步骤之前,还实现如下步骤:The apparatus for transmitting interactive information in a live broadcast according to claim 2, wherein the interactive information transmitting program is further executable by the processor to obtain a difference between the first timestamp and a preset duration Before the step of recording the interactive information between the corresponding time points and the time points corresponding to the first time stamp, the following steps are also implemented:
    若所述时间间隔大于所述预设时间间隔,则确定当前参与直播互动的观众数量;If the time interval is greater than the preset time interval, determining the number of viewers currently participating in the live interaction;
    根据预先设置的参与直播互动的观众数量与预设时长之间的映射关系,获取与当前参与直播互动的观众数量对应的预设时长,其中,参与直播互动的观众数量越多,所述预设时长越小;Obtaining a preset duration corresponding to the number of viewers currently participating in the live broadcast according to a preset mapping relationship between the number of viewers participating in the live interaction and the preset duration, wherein the more the number of viewers participating in the live interaction, the preset The smaller the duration;
    基于获取的预设时长,执行获取所述第一时间戳与预设时长的差值对应的时间点到所述第一时间戳对应的时间点之间记录的互动信息的步骤。And performing the step of acquiring the interaction information recorded between the time point corresponding to the difference between the first timestamp and the preset time length to the time point corresponding to the first timestamp.
  6. 如权利要求3所述的直播中互动信息的发送装置,其特征在于,所述互动信息发送程序还可被所述处理器执行,以在获取所述第一时间戳与预设时长的差值对应的时间点到所述第一时间戳对应的时间点之间记录的互动信息的步骤之前,还实现如下步骤:The apparatus for transmitting interactive information in a live broadcast according to claim 3, wherein the interactive information transmitting program is further executable by the processor to obtain a difference between the first timestamp and a preset duration Before the step of recording the interactive information between the corresponding time points and the time points corresponding to the first time stamp, the following steps are also implemented:
    若所述时间间隔大于所述预设时间间隔,则确定当前参与直播互动的观众数量;If the time interval is greater than the preset time interval, determining the number of viewers currently participating in the live interaction;
    根据预先设置的参与直播互动的观众数量与预设时长之间的映射关系,获取与当前参与直播互动的观众数量对应的预设时长,其中,参与直播互动的观众数量越多,所述预设时长越小;Obtaining a preset duration corresponding to the number of viewers currently participating in the live broadcast according to a preset mapping relationship between the number of viewers participating in the live interaction and the preset duration, wherein the more the number of viewers participating in the live interaction, the preset The smaller the duration;
    基于获取的预设时长,执行获取所述第一时间戳与预设时长的差值对应的时间点到所述第一时间戳对应的时间点之间记录的互动信息的步骤。And performing the step of acquiring the interaction information recorded between the time point corresponding to the difference between the first timestamp and the preset time length to the time point corresponding to the first timestamp.
  7. 如权利要求3所述的直播中互动信息的发送装置,其特征在于,所述互动信息发送程序还可被所述处理器执行,以在当接收到用户终端发送的互 动信息获取请求时,从所述互动信息获取请求中获取第一时间戳的步骤之前,还实现如下步骤:The apparatus for transmitting interactive information in a live broadcast according to claim 3, wherein the interactive information transmitting program is further executable by the processor to receive an interactive information acquisition request sent by the user terminal, Before the step of obtaining the first timestamp in the interaction information acquisition request, the following steps are also implemented:
    在与所述用户终端建立直播连接时,将当前的***时间发送至所述用户终端,以供所述用户终端根据接收到的***时间获取与发送装置之间的时间差,并在向所述发送装置发送互动信息获取请求时,根据所述时间差确定时间戳,以使该时间戳与所述发送装置的***时间匹配。Transmitting a current system time to the user terminal when the live connection is established with the user terminal, so that the user terminal acquires a time difference from the transmitting device according to the received system time, and sends the data to the sending device. When the device sends the interactive information acquisition request, the time stamp is determined according to the time difference, so that the time stamp matches the system time of the transmitting device.
  8. 一种直播中互动信息的发送方法,其特征在于,所述方法包括:A method for transmitting interactive information in a live broadcast, characterized in that the method comprises:
    发送装置在接收到用户终端发送的互动信息获取请求时,从所述互动信息获取请求中获取第一时间戳,其中,所述用户终端每间隔预设时间间隔向所述发送装置发送一次互动信息获取请求,所述互动信息获取请求中携带有所述第一时间戳;Receiving, by the sending device, the first timestamp from the interaction information acquisition request, where the user terminal sends the interaction information to the sending device every preset time interval. Obtaining a request, where the interaction information acquisition request carries the first timestamp;
    获取所述用户终端上次发送的互动信息获取请求的第二时间戳;Obtaining a second timestamp of the interaction information acquisition request sent by the user terminal last time;
    计算所述第一时间戳与所述第二时间戳之间的时间间隔,并判断所述时间间隔是否大于所述预设时间间隔;Calculating a time interval between the first timestamp and the second timestamp, and determining whether the time interval is greater than the preset time interval;
    若所述时间间隔大于所述预设时间间隔,则获取所述第一时间戳与预设时长的差值对应的时间点到所述第一时间戳对应的时间点之间记录的互动信息,并将获取的互动信息发送至所述用户终端进行显示,所述预设时长小于或等于所述预设时间间隔。If the time interval is greater than the preset time interval, the interaction information recorded between the time point corresponding to the difference between the first timestamp and the preset time length and the time point corresponding to the first timestamp is obtained, And sending the obtained interaction information to the user terminal for display, where the preset duration is less than or equal to the preset time interval.
  9. 如权利要求8所述的直播中互动信息的发送方法,其特征在于,所述计算所述第一时间戳与所述第二时间戳之间的时间间隔,并判断所述时间间隔是否大于预设时间间隔的步骤之后,所述方法还包括步骤:The method for transmitting interactive information in a live broadcast according to claim 8, wherein the calculating a time interval between the first timestamp and the second timestamp, and determining whether the time interval is greater than a pre- After the step of time interval, the method further includes the steps of:
    若所述时间间隔等于所述预设时间间隔,则获取所述时间间隔内记录的互动信息,并将获取的互动信息发送至所述用户终端进行显示。If the time interval is equal to the preset time interval, the interaction information recorded in the time interval is acquired, and the acquired interaction information is sent to the user terminal for display.
  10. 如权利要求8所述的直播中互动信息的发送方法,其特征在于,所述计算所述第一时间戳与所述第二时间戳之间的时间间隔,并判断所述时间间隔是否大于预设时间间隔的步骤之后,所述方法还包括步骤:The method for transmitting interactive information in a live broadcast according to claim 8, wherein the calculating a time interval between the first timestamp and the second timestamp, and determining whether the time interval is greater than a pre- After the step of time interval, the method further includes the steps of:
    若所述时间间隔等于所述预设时间间隔,则获取所述时间间隔内记录的互动信息,并确定获取的互动信息的数量;And if the time interval is equal to the preset time interval, acquiring interaction information recorded in the time interval, and determining the quantity of the acquired interaction information;
    若获取的互动信息的数量大于预设数量,则将距离所述第一时间戳对应的时间点最近的预设数量的互动信息发送至所述用户终端进行显示;If the number of the acquired interactive information is greater than the preset number, the preset number of interaction information that is closest to the time point corresponding to the first time stamp is sent to the user terminal for display;
    若获取的互动信息的数量小于或者等于所述预设数量,则获取所述时间间隔内记录的互动信息,并将获取的互动信息发送至所述用户终端进行显示。If the obtained number of pieces of interaction information is less than or equal to the preset number, the interaction information recorded in the time interval is acquired, and the acquired interaction information is sent to the user terminal for display.
  11. 如权利要求8所述的直播中互动信息的发送方法,其特征在于,获 取所述第一时间戳与预设时长的差值对应的时间点到所述第一时间戳对应的时间点之间记录的互动信息的步骤之前,所述方法还包括步骤:The method for transmitting the interactive information in the live broadcast according to claim 8, wherein the time point corresponding to the difference between the first timestamp and the preset time length is obtained, and the time point corresponding to the first timestamp is obtained. Before the step of recording the interactive information, the method further includes the steps of:
    若所述时间间隔大于所述预设时间间隔,则确定当前参与直播互动的观众数量;If the time interval is greater than the preset time interval, determining the number of viewers currently participating in the live interaction;
    根据预先设置的参与直播互动的观众数量与预设时长之间的映射关系,获取与当前参与直播互动的观众数量对应的预设时长,其中,参与直播互动的观众数量越多,所述预设时长越小;Obtaining a preset duration corresponding to the number of viewers currently participating in the live broadcast according to a preset mapping relationship between the number of viewers participating in the live interaction and the preset duration, wherein the more the number of viewers participating in the live interaction, the preset The smaller the duration;
    基于获取的预设时长,执行获取所述第一时间戳与预设时长的差值对应的时间点到所述第一时间戳对应的时间点之间记录的互动信息的步骤。And performing the step of acquiring the interaction information recorded between the time point corresponding to the difference between the first timestamp and the preset time length to the time point corresponding to the first timestamp.
  12. 如权利要求9所述的直播中互动信息的发送方法,其特征在于,获取所述第一时间戳与预设时长的差值对应的时间点到所述第一时间戳对应的时间点之间记录的互动信息的步骤之前,所述方法还包括步骤:The method for transmitting the interactive information in the live broadcast according to claim 9, wherein the time point corresponding to the difference between the first timestamp and the preset time length is obtained, and the time point corresponding to the first timestamp is obtained. Before the step of recording the interactive information, the method further includes the steps of:
    若所述时间间隔大于所述预设时间间隔,则确定当前参与直播互动的观众数量;If the time interval is greater than the preset time interval, determining the number of viewers currently participating in the live interaction;
    根据预先设置的参与直播互动的观众数量与预设时长之间的映射关系,获取与当前参与直播互动的观众数量对应的预设时长,其中,参与直播互动的观众数量越多,所述预设时长越小;Obtaining a preset duration corresponding to the number of viewers currently participating in the live broadcast according to a preset mapping relationship between the number of viewers participating in the live interaction and the preset duration, wherein the more the number of viewers participating in the live interaction, the preset The smaller the duration;
    基于获取的预设时长,执行获取所述第一时间戳与预设时长的差值对应的时间点到所述第一时间戳对应的时间点之间记录的互动信息的步骤。And performing the step of acquiring the interaction information recorded between the time point corresponding to the difference between the first timestamp and the preset time length to the time point corresponding to the first timestamp.
  13. 如权利要求10所述的直播中互动信息的发送方法,其特征在于,获取所述第一时间戳与预设时长的差值对应的时间点到所述第一时间戳对应的时间点之间记录的互动信息的步骤之前,所述方法还包括步骤:The method for transmitting the interactive information in the live broadcast according to claim 10, wherein the time point corresponding to the difference between the first timestamp and the preset time length is obtained, and the time point corresponding to the first timestamp is obtained. Before the step of recording the interactive information, the method further includes the steps of:
    若所述时间间隔大于所述预设时间间隔,则确定当前参与直播互动的观众数量;If the time interval is greater than the preset time interval, determining the number of viewers currently participating in the live interaction;
    根据预先设置的参与直播互动的观众数量与预设时长之间的映射关系,获取与当前参与直播互动的观众数量对应的预设时长,其中,参与直播互动的观众数量越多,所述预设时长越小;Obtaining a preset duration corresponding to the number of viewers currently participating in the live broadcast according to a preset mapping relationship between the number of viewers participating in the live interaction and the preset duration, wherein the more the number of viewers participating in the live interaction, the preset The smaller the duration;
    基于获取的预设时长,执行获取所述第一时间戳与预设时长的差值对应的时间点到所述第一时间戳对应的时间点之间记录的互动信息的步骤。And performing the step of acquiring the interaction information recorded between the time point corresponding to the difference between the first timestamp and the preset time length to the time point corresponding to the first timestamp.
  14. 如权利要求10所述的直播中互动信息的发送方法,其特征在于,所述当接收到用户终端发送的互动信息获取请求时,从所述互动信息获取请求中获取第一时间戳的步骤之前,该方法还包括步骤:The method for transmitting the interactive information in the live broadcast according to claim 10, wherein, when receiving the interactive information acquisition request sent by the user terminal, before the step of acquiring the first timestamp from the interactive information acquisition request The method further includes the steps of:
    在与所述用户终端建立直播连接时,将当前的***时间发送至所述用户 终端,以供所述用户终端根据接收到的***时间获取与发送装置之间的时间差,并在向所述发送装置发送互动信息获取请求时,根据所述时间差确定时间戳,以使该时间戳与所述发送装置的***时间匹配。Transmitting a current system time to the user terminal when the live connection is established with the user terminal, so that the user terminal acquires a time difference from the transmitting device according to the received system time, and sends the data to the sending device. When the device sends the interactive information acquisition request, the time stamp is determined according to the time difference, so that the time stamp matches the system time of the transmitting device.
  15. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质上存储有互动信息发送程序,所述互动信息发送程序可被一个或者多个处理器执行,以实现如下步骤:A computer readable storage medium, characterized in that the computer readable storage medium stores an interactive information transmitting program, and the interactive information transmitting program can be executed by one or more processors to implement the following steps:
    在接收到用户终端发送的互动信息获取请求时,从所述互动信息获取请求中获取第一时间戳,其中,所述用户终端每间隔预设时间间隔向所述互动信息发送程序发送一次互动信息获取请求,所述互动信息获取请求中携带有所述第一时间戳;Obtaining a first timestamp from the interaction information acquisition request when receiving the interaction information acquisition request sent by the user terminal, where the user terminal sends the interaction information to the interaction information sending program every preset time interval Obtaining a request, where the interaction information acquisition request carries the first timestamp;
    获取所述用户终端上次发送的互动信息获取请求的第二时间戳;Obtaining a second timestamp of the interaction information acquisition request sent by the user terminal last time;
    计算所述第一时间戳与所述第二时间戳之间的时间间隔,并判断所述时间间隔是否大于所述预设时间间隔;Calculating a time interval between the first timestamp and the second timestamp, and determining whether the time interval is greater than the preset time interval;
    若所述时间间隔大于所述预设时间间隔,则获取所述第一时间戳与预设时长的差值对应的时间点到所述第一时间戳对应的时间点之间记录的互动信息,并将获取的互动信息发送至所述用户终端进行显示,所述预设时长小于或等于所述预设时间间隔。If the time interval is greater than the preset time interval, the interaction information recorded between the time point corresponding to the difference between the first timestamp and the preset time length and the time point corresponding to the first timestamp is obtained, And sending the obtained interaction information to the user terminal for display, where the preset duration is less than or equal to the preset time interval.
  16. 如权利要求15所述的计算机可读存储介质,其特征在于,所述计算所述第一时间戳与所述第二时间戳之间的时间间隔,并判断所述时间间隔是否大于预设时间间隔的步骤之后,所述互动信息发送程序还可被所述一个或者多个处理器执行,以实现如下步骤:The computer readable storage medium according to claim 15, wherein said calculating a time interval between said first time stamp and said second time stamp, and determining whether said time interval is greater than a preset time After the step of spacing, the interactive information transmitting program can also be executed by the one or more processors to implement the following steps:
    若所述时间间隔等于所述预设时间间隔,则获取所述时间间隔内记录的互动信息,并将获取的互动信息发送至所述用户终端进行显示。If the time interval is equal to the preset time interval, the interaction information recorded in the time interval is acquired, and the acquired interaction information is sent to the user terminal for display.
  17. 如权利要求15所述的计算机可读存储介质,其特征在于,所述计算所述第一时间戳与所述第二时间戳之间的时间间隔,并判断所述时间间隔是否大于预设时间间隔的步骤之后,所述互动信息发送程序还可被所述一个或者多个处理器执行,以实现如下步骤:The computer readable storage medium according to claim 15, wherein said calculating a time interval between said first time stamp and said second time stamp, and determining whether said time interval is greater than a preset time After the step of spacing, the interactive information transmitting program can also be executed by the one or more processors to implement the following steps:
    若所述时间间隔等于所述预设时间间隔,则获取所述时间间隔内记录的互动信息,并确定获取的互动信息的数量;And if the time interval is equal to the preset time interval, acquiring interaction information recorded in the time interval, and determining the quantity of the acquired interaction information;
    若获取的互动信息的数量大于预设数量,则将距离所述第一时间戳对应的时间点最近的预设数量的互动信息发送至所述用户终端进行显示;If the number of the acquired interactive information is greater than the preset number, the preset number of interaction information that is closest to the time point corresponding to the first time stamp is sent to the user terminal for display;
    若获取的互动信息的数量小于或者等于所述预设数量,则获取所述时间间隔内记录的互动信息,并将获取的互动信息发送至所述用户终端进行显示。If the obtained number of pieces of interaction information is less than or equal to the preset number, the interaction information recorded in the time interval is acquired, and the acquired interaction information is sent to the user terminal for display.
  18. 如权利要求15所述的计算机可读存储介质,其特征在于,获取所述第一时间戳与预设时长的差值对应的时间点到所述第一时间戳对应的时间点之间记录的互动信息的步骤之前,所述互动信息发送程序还可被所述一个或者多个处理器执行,以实现如下步骤:The computer readable storage medium according to claim 15, wherein the time point corresponding to the difference between the first time stamp and the preset time length is recorded to be recorded between the time points corresponding to the first time stamp Before the step of interactive information, the interactive information transmitting program may be executed by the one or more processors to implement the following steps:
    若所述时间间隔大于所述预设时间间隔,则确定当前参与直播互动的观众数量;If the time interval is greater than the preset time interval, determining the number of viewers currently participating in the live interaction;
    根据预先设置的参与直播互动的观众数量与预设时长之间的映射关系,获取与当前参与直播互动的观众数量对应的预设时长,其中,参与直播互动的观众数量越多,所述预设时长越小;Obtaining a preset duration corresponding to the number of viewers currently participating in the live broadcast according to a preset mapping relationship between the number of viewers participating in the live interaction and the preset duration, wherein the more the number of viewers participating in the live interaction, the preset The smaller the duration;
    基于获取的预设时长,执行获取所述第一时间戳与预设时长的差值对应的时间点到所述第一时间戳对应的时间点之间记录的互动信息的步骤。And performing the step of acquiring the interaction information recorded between the time point corresponding to the difference between the first timestamp and the preset time length to the time point corresponding to the first timestamp.
  19. 如权利要求17所述的计算机可读存储介质,其特征在于,获取所述第一时间戳与预设时长的差值对应的时间点到所述第一时间戳对应的时间点之间记录的互动信息的步骤之前,所述互动信息发送程序还可被所述一个或者多个处理器执行,以实现如下步骤:The computer readable storage medium according to claim 17, wherein the time point corresponding to the difference between the first time stamp and the preset time length is recorded to be recorded between the time points corresponding to the first time stamp Before the step of interactive information, the interactive information transmitting program may be executed by the one or more processors to implement the following steps:
    若所述时间间隔大于所述预设时间间隔,则确定当前参与直播互动的观众数量;If the time interval is greater than the preset time interval, determining the number of viewers currently participating in the live interaction;
    根据预先设置的参与直播互动的观众数量与预设时长之间的映射关系,获取与当前参与直播互动的观众数量对应的预设时长,其中,参与直播互动的观众数量越多,所述预设时长越小;Obtaining a preset duration corresponding to the number of viewers currently participating in the live broadcast according to a preset mapping relationship between the number of viewers participating in the live interaction and the preset duration, wherein the more the number of viewers participating in the live interaction, the preset The smaller the duration;
    基于获取的预设时长,执行获取所述第一时间戳与预设时长的差值对应的时间点到所述第一时间戳对应的时间点之间记录的互动信息的步骤。And performing the step of acquiring the interaction information recorded between the time point corresponding to the difference between the first timestamp and the preset time length to the time point corresponding to the first timestamp.
  20. 如权利要求17所述的计算机可读存储介质,其特征在于,所述当接收到用户终端发送的互动信息获取请求时,从所述互动信息获取请求中获取第一时间戳的步骤之前,所述互动信息发送程序还可被所述一个或者多个处理器执行,以实现如下步骤:The computer readable storage medium according to claim 17, wherein the step of obtaining the first time stamp from the interactive information acquisition request when receiving the interactive information acquisition request sent by the user terminal The interactive information transmitting program can also be executed by the one or more processors to implement the following steps:
    在与所述用户终端建立直播连接时,将当前的***时间发送至所述用户终端,以供所述用户终端根据接收到的***时间获取与发送装置之间的时间差,并在向所述发送装置发送互动信息获取请求时,根据所述时间差确定时间戳,以使该时间戳与所述发送装置的***时间匹配。Transmitting a current system time to the user terminal when the live connection is established with the user terminal, so that the user terminal acquires a time difference from the transmitting device according to the received system time, and sends the data to the sending device. When the device sends the interactive information acquisition request, the time stamp is determined according to the time difference, so that the time stamp matches the system time of the transmitting device.
PCT/CN2018/076117 2017-12-21 2018-02-10 Apparatus and method for sending interactive information during streaming, and computer readable storage medium WO2019119634A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201711391821.2A CN108174267B (en) 2017-12-21 2017-12-21 Device and method for sending interactive information in live broadcast and computer readable storage medium
CN201711391821.2 2017-12-21

Publications (1)

Publication Number Publication Date
WO2019119634A1 true WO2019119634A1 (en) 2019-06-27

Family

ID=62522987

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/076117 WO2019119634A1 (en) 2017-12-21 2018-02-10 Apparatus and method for sending interactive information during streaming, and computer readable storage medium

Country Status (2)

Country Link
CN (1) CN108174267B (en)
WO (1) WO2019119634A1 (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110971985B (en) * 2018-09-30 2021-11-26 武汉斗鱼网络科技有限公司 Method and related device for dynamically scheduling server
CN109660858A (en) * 2018-12-29 2019-04-19 北京字节跳动网络技术有限公司 Transmission method, device, terminal and the server of direct broadcasting room interaction data
CN109818851A (en) * 2019-01-23 2019-05-28 北京奇艺世纪科技有限公司 A kind of information persistence method, device and electronic equipment
CN110694277A (en) * 2019-09-26 2020-01-17 网易(杭州)网络有限公司 Method, device, medium and electronic equipment for responding to user request
CN111770351B (en) * 2020-06-23 2022-11-29 北京字节跳动网络技术有限公司 Live broadcast message display method and device
CN115802069A (en) * 2022-11-01 2023-03-14 上海哔哩哔哩科技有限公司 Interactive panel information transmission method, first service terminal, client and system

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130004138A1 (en) * 2011-06-30 2013-01-03 Hulu Llc Commenting Correlated To Temporal Point Of Video Data
CN104735543A (en) * 2015-03-30 2015-06-24 北京奇艺世纪科技有限公司 Barrage displaying method and device
CN105898377A (en) * 2015-12-11 2016-08-24 乐视网信息技术(北京)股份有限公司 User terminal, server and danmaku loading method and system
CN107071506A (en) * 2017-03-17 2017-08-18 武汉斗鱼网络科技有限公司 A kind of method and system for pushing barrage

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170257658A1 (en) * 2016-03-02 2017-09-07 Le Holdings (Beijing) Co., Ltd. Method for automatically pushing video based on analysis of user behavior and electronic device
CN106993234A (en) * 2017-03-22 2017-07-28 北京潘达互娱科技有限公司 Barrage display methods and device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130004138A1 (en) * 2011-06-30 2013-01-03 Hulu Llc Commenting Correlated To Temporal Point Of Video Data
CN104735543A (en) * 2015-03-30 2015-06-24 北京奇艺世纪科技有限公司 Barrage displaying method and device
CN105898377A (en) * 2015-12-11 2016-08-24 乐视网信息技术(北京)股份有限公司 User terminal, server and danmaku loading method and system
CN107071506A (en) * 2017-03-17 2017-08-18 武汉斗鱼网络科技有限公司 A kind of method and system for pushing barrage

Also Published As

Publication number Publication date
CN108174267A (en) 2018-06-15
CN108174267B (en) 2020-09-01

Similar Documents

Publication Publication Date Title
WO2019119634A1 (en) Apparatus and method for sending interactive information during streaming, and computer readable storage medium
US10798440B2 (en) Methods and systems for synchronizing data streams across multiple client devices
CN106454407B (en) Video live broadcasting method and device
WO2015090095A1 (en) Information pushing method, device, and system
CN106572358B (en) Live broadcast time shifting method and client
CN106303654B (en) Media information display method, client, plug-in and system
WO2018059353A1 (en) Message processing method and apparatus
CN108174226B (en) Transcoding device and method for live video and computer readable storage medium
CN109474854B (en) Video playing method, playlist generating method and related equipment
TWI470983B (en) Method and apparatus for updating http content descriptions
CN109714622B (en) Video data processing method and device and electronic equipment
CN106385594A (en) Method for optimizing video live broadcast services
EP3824638B1 (en) Advanced preparation for content revision based on expected latency in obtaining new content
US11503347B2 (en) Method of playing video, computing device, and computer program product
US11184669B2 (en) Distribution of network traffic for streaming content
US20210329319A1 (en) Method of Switching Resolution, Computing Device, and Computer-Readable Storage Medium
US9118742B2 (en) Delivering a video stream
CN107690093B (en) Video playing method and device
WO2023131269A1 (en) Method and system for monitoring playing of screen device, and storage medium
CN110740384A (en) IPTV time-shifted television positioning and skipping method and device
US10284889B1 (en) Determining an actual start of program content relative to a scheduled start of the program content
TW201707465A (en) Method, system for calibrating interactive time in a live program and a computer-readable storage device
US11356716B2 (en) System for inserting supplemental content within a media stream
CN109348249B (en) Method and device for determining user acquisition number of digital album and storage medium
JP6604092B2 (en) Broadcast content providing system, broadcast content providing device, playback device, advertisement providing device, and control method and control program thereof

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18890529

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 23/09/2020)

122 Ep: pct application non-entry in european phase

Ref document number: 18890529

Country of ref document: EP

Kind code of ref document: A1