CN110971922B - Live broadcast and microphone connection state monitoring method, client, server, medium and system - Google Patents

Live broadcast and microphone connection state monitoring method, client, server, medium and system Download PDF

Info

Publication number
CN110971922B
CN110971922B CN201811161813.3A CN201811161813A CN110971922B CN 110971922 B CN110971922 B CN 110971922B CN 201811161813 A CN201811161813 A CN 201811161813A CN 110971922 B CN110971922 B CN 110971922B
Authority
CN
China
Prior art keywords
timer
function
headbeattimer
server
heartbeat
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201811161813.3A
Other languages
Chinese (zh)
Other versions
CN110971922A (en
Inventor
汪刚
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wuhan Douyu Network Technology Co Ltd
Original Assignee
Wuhan Douyu Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Wuhan Douyu Network Technology Co Ltd filed Critical Wuhan Douyu Network Technology Co Ltd
Priority to CN201811161813.3A priority Critical patent/CN110971922B/en
Publication of CN110971922A publication Critical patent/CN110971922A/en
Application granted granted Critical
Publication of CN110971922B publication Critical patent/CN110971922B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/21Server components or server architectures
    • H04N21/218Source of audio or video content, e.g. local disk arrays
    • H04N21/2187Live feed
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/239Interfacing the upstream path of the transmission network, e.g. prioritizing client content requests
    • H04N21/2393Interfacing the upstream path of the transmission network, e.g. prioritizing client content requests involving handling client requests
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/24Monitoring of processes or resources, e.g. monitoring of server load, available bandwidth, upstream requests
    • H04N21/2408Monitoring of the upstream path of the transmission network, e.g. client requests
    • 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/442Monitoring of processes or resources, e.g. detecting the failure of a recording device, monitoring the downstream bandwidth, the number of times a movie has been viewed, the storage space available from the internal hard disk
    • H04N21/4425Monitoring of client processing errors or hardware failure
    • 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
    • H04N7/00Television systems
    • H04N7/14Systems for two-way working

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Databases & Information Systems (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • General Engineering & Computer Science (AREA)
  • Telephonic Communication Services (AREA)

Abstract

The invention discloses a method, equipment, a storage medium and a system for monitoring live broadcast wheat connecting states, which relate to the field of application development of Internet mobile terminals, and comprise that a client receives a message which is sent by a server through a message receiving function and is used for indicating successful wheat connecting; calling a timer headBeatTimer to set a timing period, and periodically sending heartbeat information for indicating the continuous microphone state to a server by a client through a heartbeat sending function sendHeartBateat; the server receives the heartbeat information sent by the client through a function sendHeartBetRespond, and judges an error code contained in the heartbeat information: when the error Code is Code _ successful, the heartbeat information is successfully sent, and the current microphone is normal; when the error Code is Code _ timeOut, it indicates that the heartbeat information is sent overtime, and the current microphone is in fault. The invention monitors the state of the main broadcast connecting the wheat in real time, effectively reduces the pause time when the live broadcast frame connecting the wheat fails, and ensures the watching experience of the user.

Description

Live broadcast and microphone connection state monitoring method, client, server, medium and system
Technical Field
The invention relates to the field of application development of internet mobile terminals, in particular to a live broadcast and microphone connecting state monitoring method, a client, a server, a medium and a system.
Background
With the rapid development of mobile terminals of mobile phones, more and more young people like to play off-hours by watching live broadcast, and meanwhile, live broadcast companies develop more live broadcast functional experiences for improving the watching experience of users on live broadcast, such as connecting with wheat.
Currently, a main broadcast often uses a wheat connecting technology in a live broadcasting process, wherein wheat connecting means that voice communication or video communication is carried out between the main broadcast and the main broadcast, and all live broadcast watching users can see the video communication or the voice communication between the main broadcast and the main broadcast. Further subdivision is as follows: the method comprises the following steps that (1) a main broadcasting voice and main broadcasting voices can be seen by all users, and the voice is connected with wheat; the main broadcast and the main broadcast carry out videos, and all users can see the videos of the main broadcast and the main broadcast, which is a video with wheat.
No matter whether the video is connected with the microphone or the voice is connected with the microphone, the microphone connecting state needs to be monitored in time so as to be processed in time when the microphone is disconnected, and the technical scheme for better monitoring the microphone connecting state does not exist in the prior art.
Disclosure of Invention
Aiming at the defects in the prior art, the invention aims to provide a live broadcast connecting state monitoring method, which can monitor the main broadcast connecting state in real time, effectively reduce the pause time when live broadcast pictures have connecting faults and ensure the watching experience of users. The invention also correspondingly provides a client, a server, a medium and a system.
In order to achieve the above purposes, the technical scheme adopted by the invention is as follows:
the invention provides a live broadcast wheat-connecting state monitoring method in a first aspect, which comprises the following steps:
the client receives a message which is sent by the server and used for indicating successful connection of the wheat through a message receiving function;
calling a timer headBeatTimer to set a timing period, and periodically sending heartbeat information for indicating the continuous microphone state to a server by a client through a heartbeat sending function sendHeartBateat;
the server receives the heartbeat information sent by the client through a function sendHeartBetRespond, and judges an error code contained in the heartbeat information:
when the error Code is Code _ successful, the heartbeat information is successfully sent, and the current microphone is normal;
when the error Code is Code _ timeOut, it indicates that the heartbeat information is sent overtime, and the current microphone is in fault.
With reference to the first aspect, in a first possible implementation manner, the client receives, through a message receiving function, a message that is sent by the server and used for indicating successful wheat connection, and the specific steps are as follows:
the client receives the message sent by the server through a message receiving function;
the client saves the received message in a parameter decoder of a message receiving function;
and converting the parameters into a model, judging the field type used for pushing the notification message on behalf of the server in the model, and when the field type is a set type used for indicating successful wheat connection, indicating that the current wheat connection is successful.
With reference to the first aspect, in a second possible implementation manner, the invoking a timer headBeatTimer sets a timing period, and the specific steps are as follows:
s201: judging whether a timer headBeatTimer exists, if so, turning to the step S202, otherwise, turning to the step S203;
s202: setting a timing period for a timer headBeatTimer;
s203: a timer header timer of the weak reference type is created using a timer variable creation function GCDTimer.
With reference to the second possible implementation manner of the first aspect, in a third possible implementation manner, the client periodically sends heartbeat information indicating a microphone connecting state to the server through a heartbeat sending function sendHeartBeat, and the specific steps are as follows:
s211: the timer headBeatTimer periodically calls an updateTimer function;
s212: the updateTimer function uses a queue creating function to create a queue, the created queue comprises a first parameter and a second parameter, the first parameter is a queue name, and the second parameter is a queue type;
s213: in the created queue, heartbeat information indicating the microphone connecting state is transmitted to the server through a heartbeat transmitting function sendHeartBeat.
With reference to the first aspect, in a fourth possible implementation manner, when the heartbeat information is sent out overtime and a current microphone is in failure:
disconnecting the connection of the live broadcast, simultaneously disconnecting the display of the live broadcast pictures of all live broadcast watching users, and releasing a timer, wherein the specific steps of releasing the timer are as follows: and acquiring a timer headBeatTimer, calling a method destroy for destroying the timer to destroy the timer headBeatTimer, and setting nil of the timer headBeatTimer.
With reference to the first aspect, in a fifth possible implementation manner, the server receives the heartbeat information sent by the client through a function sendheartbeat message, and if the server does not receive the heartbeat information sent by the client within a set time, disconnects the connected microphone.
A second aspect of the present invention provides a client, including:
a first receiving unit for receiving a message indicating successful connection to a wheat;
the calling unit is used for calling the timer headBeatTimer and setting a timing period for the timer headBeatTimer;
and a first sending unit, configured to periodically send heartbeat information indicating a connected state through a heartbeat sending function sendHeartBeat based on a timing period set by the timer headBeatTimer.
A third aspect of the present invention provides a server comprising:
a second transmitting unit for transmitting a message indicating successful connection to the wheat;
a second receiving unit for receiving the heartbeat information through a function sendHeartBetRespond;
a judging unit, configured to judge an error code included in the heartbeat information received by the second receiving unit:
when the error Code is Code _ successful, the heartbeat information is successfully sent, and the current microphone is normal;
when the error Code is Code _ timeOut, it indicates that the heartbeat information is sent overtime, and the current microphone is in fault.
A fourth aspect of the present invention provides a storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of:
the client receives a message which is sent by the server and used for indicating successful connection of the wheat through a message receiving function;
calling a timer headBeatTimer to set a timing period, and periodically sending heartbeat information for indicating the continuous microphone state to a server by a client through a heartbeat sending function sendHeartBateat;
the server receives the heartbeat information sent by the client through a function sendHeartBetRespond, and judges an error code contained in the heartbeat information:
when the error Code is Code _ successful, the heartbeat information is successfully sent, and the current microphone is normal;
when the error Code is Code _ timeOut, it indicates that the heartbeat information is sent overtime, and the current microphone is in fault.
A fifth aspect of the present invention provides a live broadcast wheat-connecting state monitoring system, including:
the first receiving module is used for driving the client to receive the message which is sent by the server and used for indicating successful wheat connection through the message receiving function;
the sending module is used for calling a timer headBeatTimer to set a timing period and driving the client to send heartbeat information for indicating the microphone connecting state to the server periodically through a heartbeat sending function sendHeartBateat;
a second receiving module, configured to drive the server to receive the heartbeat information sent by the client through a function sendheartbeat response;
the judging module is used for judging error codes contained in the heartbeat information received by the server:
when the error Code is Code _ successful, the heartbeat information is successfully sent, and the current microphone is normal;
when the error Code is Code _ timeOut, it indicates that the heartbeat information is sent overtime, and the current microphone is in fault.
Compared with the prior art, the invention has the advantages that: when the client receives a message which is sent by the server and used for indicating successful wheat connection, the client periodically sends heartbeat information used for indicating the wheat connection state to the server, the server judges the current wheat connection state according to an error code in the heartbeat information, if the heartbeat information is sent overtime, the current wheat connection fault is indicated, so that the current wheat connection state is timely disconnected, a live broadcast interface of a live broadcast watching user returns to an original main broadcast live broadcast room, namely, the main broadcast wheat connection state is monitored in real time, the pause time of live broadcast picture wheat connection fault is effectively reduced, and the watching experience of the user is ensured.
Drawings
Fig. 1 is a flowchart of a live broadcast and live broadcast connection state monitoring method according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of a client according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of a server according to an embodiment of the present invention.
Detailed Description
The embodiment of the invention provides a live broadcast connecting state monitoring method which is used for monitoring the connecting state of a main broadcast, and when the connecting state is abnormal, the connecting state is cut off in time, so that the long-time occurrence of the pause phenomenon of a live broadcast interface watched by a live broadcast watching user is effectively avoided. The embodiment of the invention also provides a corresponding client, a server, a storage medium and a live broadcast microphone connecting state monitoring system.
The technical solutions in the embodiments of the present invention are clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1, an embodiment of a live broadcast microphone connection state monitoring method according to an embodiment of the present invention includes:
s1: and the client receives the message which is sent by the server and used for indicating successful connection to the wheat through the message receiving function.
In the embodiment of the invention, the client is a main broadcasting side client, when the main broadcasting and the main broadcasting or the main broadcasting and the user start to connect the wheat and the wheat is successfully connected, the server pushes a message for indicating the successful wheat connection to the client to inform the client that the wheat connection is successful currently, and when the client receives the message sent by the server, the client sends heartbeat information for indicating the wheat connection state to the server. And the heartbeat message is sent only after the microphone is successfully connected, because the sending of the heartbeat message needs to consume the resources of the equipment where the client is located, the minimum resource consumption can be ensured by sending the heartbeat message at the moment.
S2: calling a timer headBeatTimer to set a timing period, and periodically sending heartbeat information for indicating the continuous microphone state to a server by a client through a heartbeat sending function sendHeartBateat;
s3: the server receives the heartbeat information sent by the client through a function sendHeartBetRespond, and judges an error code contained in the heartbeat information:
when the error Code is Code _ successful, the heartbeat information is successfully sent, and the current microphone is normal;
when the error Code is Code _ timeOut, it indicates that the heartbeat information is sent overtime, and the current microphone is in fault.
In the embodiment of the present invention, the function sendheartbeat response is used to receive the heartbeat information sent by the client, and the function only receives the heartbeat information.
In the embodiment of the invention, the specific content of the error code is set according to the preset, different error codes are appointed to represent different meanings, the type of the error code is lianmai PKRespondorrcode, and for the error code which indicates that the heartbeat information is successfully sent, the specific content of the error code can be DYPSKServiceToAnchorResponErrorCode _ Succesed; the error code indicating that the heartbeat information is sent overtime can be dypkserver to account and response error code _ timeOut, when the microphone is connected, the possible condition is that the anchor terminal is stuck or the network is failed, the interface of the live broadcast watching user is in a stuck state, at the moment, the server pushes heartbeat overtime information to all users, the microphone is disconnected, and the interface of the live broadcast watching user returns to the original interface of the live broadcast, so that the watching of the live broadcast by the user is not influenced.
Optionally, on the basis of the embodiment corresponding to fig. 1, in a first optional embodiment of the method for monitoring a live microphone connection status according to the embodiment of the present invention, the client receives, through the message receiving function, a message that indicates that the microphone connection is successful, where the message is sent by the server, and the specific steps are as follows:
s101: the client receives the message sent by the server through a message receiving function;
s102: the client saves the received message in a parameter decoder of a message receiving function;
s103: and converting the parameters into a model, judging the field type used for pushing the notification message on behalf of the server in the model, and when the field type is a set type used for indicating successful wheat connection, indicating that the current wheat connection is successful.
In the embodiment of the invention, the field for pushing the notification message on behalf of the server is lianmai control news ToAnchorType, then the field is judged, and when the type is DYPSKService ToAnchorNoticeMsgTypeAnchorLianmaiSuccess, the current successful connection is indicated.
Optionally, on the basis of the first optional embodiment corresponding to fig. 1 and fig. 1, in a second optional embodiment of the live broadcast wheat-connecting state monitoring method provided in the embodiment of the present invention, a timer header timer is called to set a timing period, and the specific steps are as follows:
s201: judging whether a timer headBeatTimer exists, if so, turning to the step S202, otherwise, turning to the step S203;
s202: setting a timing period for a timer headBeatTimer;
s203: a timer header timer of the weak reference type is created using a timer variable creation function GCDTimer.
In the embodiment of the invention, when the timer headBeatTimer does not exist, an intHeartBeatTimer function needs to be called to initialize a heartbeat, the function for initializing the heartbeat is the intHeartBeatTimer, and the function is realized in the function: defining a timer variable headBeatTimer of a weak reference type, then creating and initializing an object by using a timer class GCDTimer, and storing the object by using the timer variable headBeatTimer, so that the timer variable headBeatTimer and the created object represent a variable, thereby completing the creation of the timer headBeatTimer.
Optionally, on the basis of the first and second embodiments corresponding to fig. 1 and fig. 1, in a third optional embodiment of the live broadcast microphone connecting state monitoring method provided in the embodiment of the present invention, the client periodically sends, to the server, heartbeat information indicating a microphone connecting state through a heartbeat sending function sendHeartBeat send, and the specific steps are as follows:
s211: the timer headBeatTimer periodically calls an updateTimer function; if the set period is 5 seconds, the timer is not operated for 5 seconds. The updateTimer function is used to update the specified column with a time value according to a given column index.
S212: the updateTimer function creates a queue using a queue creating function, wherein the created queue includes a first parameter and a second parameter, the first parameter is a queue name, and the second parameter is a queue type.
In the embodiment of the invention, the first parameter is a unique character string; the QUEUE type comprises a parallel QUEUE and a SERIAL QUEUE, and the task needs to be sequentially executed in sequence, so the QUEUE type in the embodiment of the invention is the SERIAL QUEUE DISPATCH _ QUEUE _ SERIAL. The embodiment of the invention can effectively transfer the task by adding the queue, and the process of sending the heartbeat message is carried out according to the sequence and is asynchronous, so that the thread cannot be blocked.
S213: in the created queue, heartbeat information indicating the microphone connecting state is transmitted to the server through a heartbeat transmitting function sendHeartBeat. The currently connected room number can also be sent to the server by using the barrage sending function danmumPKSignalingControl, and the barrage sending function danmumPKSignalingControl is repeatedly executed because the updateTimer function is repeatedly executed.
Optionally, on the basis of the embodiment and the optional embodiment corresponding to fig. 1, in a fourth optional embodiment of the method for monitoring a live microphone connection state according to the embodiment of the present invention, when the heartbeat information is sent out overtime and the current microphone connection fails:
disconnecting the connection of the live broadcast, simultaneously disconnecting the display of the live broadcast pictures of all live broadcast watching users, and releasing a timer, wherein the specific steps of releasing the timer are as follows: and acquiring a timer headBeatTimer, calling a method destroy for destroying the timer to destroy the timer headBeatTimer, and setting nil of the timer headBeatTimer, wherein nil indicates null, namely the timer headBeatTimer is completely destroyed in the memory.
Optionally, on the basis of the embodiment and the optional embodiment corresponding to fig. 1, in a fifth optional embodiment of the method for monitoring a live microphone connection status according to the embodiment of the present invention, the server receives the heartbeat information sent by the client through a function sendheartbeat message, and if the server does not receive the heartbeat information sent by the client within a set time, disconnects the microphone connection.
In the embodiment of the invention, the set time can be 2-3 times of the timing period, if the server does not receive heartbeat information sent by the client in the set time, the server can judge that the anchor broadcast has a card death or a network problem, the microphone connection can be disconnected at the moment, the card pause time of a live broadcast picture is effectively reduced, when the timing period is 5 seconds, the card pause time of the live broadcast picture is 15 seconds at most, compared with the previous time of the minute level, the card pause time is greatly reduced, and the use experience of a live broadcast watching user is effectively ensured.
According to the live broadcast connecting-to-wheat state monitoring method, when the client receives the message which is sent by the server and used for indicating the successful connecting-to-wheat, the client periodically sends heartbeat information used for indicating the connecting-to-wheat state to the server, the server judges the current connecting-to-wheat state according to the error codes in the heartbeat information, if the heartbeat information is sent overtime, the current connecting-to-wheat fault is indicated, so that the current connecting-to-wheat state is disconnected timely, a live broadcast interface of a live broadcast watching user returns to an original main broadcast and live broadcast room, the monitoring on the main broadcast and live wheat state is equivalent to real-time monitoring, the pause time when a live broadcast picture is in the live broadcast and wheat fault is effectively reduced, and the watching experience of the user is guaranteed.
Referring to fig. 2, an embodiment of a client according to an embodiment of the present invention includes:
a first receiving unit for receiving a message indicating successful connection to a wheat;
the calling unit is used for calling the timer headBeatTimer and setting a timing period for the timer headBeatTimer;
and a first sending unit, configured to periodically send heartbeat information indicating a connected state through a heartbeat sending function sendHeartBeat based on a timing period set by the timer headBeatTimer.
Optionally, on the basis of the embodiment corresponding to fig. 2, in a first optional embodiment of the client according to an embodiment of the present invention, the first receiving unit receives a message sent by a server, and the first sending unit sends a heartbeat message to the server. The client side is the client side of the main broadcast, when the main broadcast and the main broadcast or the main broadcast and the user start to connect the wheat and the wheat is successfully connected, the server pushes a message for indicating the successful wheat connection to the client side to inform the client side that the wheat connection is successful currently, and when the client side receives the message sent by the server, the client side sends heartbeat information for indicating the wheat connection state to the server. And the heartbeat message is sent only after the microphone is successfully connected, because the sending of the heartbeat message needs to consume the resources of the equipment where the client is located, the minimum resource consumption can be ensured by sending the heartbeat message at the moment.
Referring to fig. 3, an embodiment of a server according to an embodiment of the present invention includes:
a second transmitting unit for transmitting a message indicating successful connection to the wheat;
a second receiving unit for receiving the heartbeat information through a function sendHeartBetRespond;
a judging unit, configured to judge an error code included in the heartbeat information received by the second receiving unit:
when the error Code is Code _ successful, the heartbeat information is successfully sent, and the current microphone is normal;
when the error Code is Code _ timeOut, it indicates that the heartbeat information is sent overtime, and the current microphone is in fault.
Optionally, on the basis of the embodiment corresponding to fig. 3, in a first optional embodiment of the server provided in the embodiment of the present invention, the second sending unit sends, to the client, a message indicating that the microphone connection is successful. The second receiving unit receives the heartbeat message sent by the server.
An embodiment of a storage medium provided in an embodiment of the present invention includes: the storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of:
the client receives a message which is sent by the server and used for indicating successful connection of the wheat through a message receiving function;
calling a timer headBeatTimer to set a timing period, and periodically sending heartbeat information for indicating the continuous microphone state to a server by a client through a heartbeat sending function sendHeartBateat;
the server receives the heartbeat information sent by the client through a function sendHeartBetRespond, and judges an error code contained in the heartbeat information:
when the error Code is Code _ successful, the heartbeat information is successfully sent, and the current microphone is normal;
when the error Code is Code _ timeOut, it indicates that the heartbeat information is sent overtime, and the current microphone is in fault.
Optionally, on the basis of the above storage medium embodiment, in a first optional embodiment of the storage medium provided by the embodiment of the present invention, the storage medium may adopt any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. The computer-readable storage medium may be, for example but not limited to: an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
Alternatively, on the basis of the above embodiment of the storage medium and the first alternative embodiment, in a second alternative embodiment of the storage medium provided by the embodiment of the present invention, the computer-readable signal medium may include a data signal propagating in a baseband or as a part of a carrier wave, in which a computer-readable program code is carried. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
Optionally, on the basis of the above embodiment of the storage medium and the first and second alternative embodiments, in a third alternative embodiment of the storage medium provided by the embodiment of the present invention, the computer program code for performing the operations of the present invention may be written in one or more programming languages, or a combination thereof, the programming languages including an object oriented programming language, such as Java, Smalltalk, C + +, and further including a conventional procedural programming language, such as "C" programming language or a similar programming language. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
An embodiment of a system for monitoring a live broadcast microphone connecting state provided by an embodiment of the present invention includes:
the first receiving module is used for driving the client to receive the message which is sent by the server and used for indicating successful wheat connection through the message receiving function;
the sending module is used for calling a timer headBeatTimer to set a timing period and driving the client to send heartbeat information for indicating the microphone connecting state to the server periodically through a heartbeat sending function sendHeartBateat;
a second receiving module, configured to drive the server to receive the heartbeat information sent by the client through the function sendheartbeat response
The judging module is used for judging error codes contained in the heartbeat information received by the server:
when the error Code is Code _ successful, the heartbeat information is successfully sent, and the current microphone is normal;
when the error Code is Code _ timeOut, it indicates that the heartbeat information is sent overtime, and the current microphone is in fault.
According to the live broadcast wheat-connecting state monitoring system provided by the embodiment of the invention, when the client receives the message which is sent by the server and used for indicating the successful wheat connection, the client periodically sends heartbeat information for indicating the wheat-connecting state to the server, the server judges the current wheat-connecting state according to the error code in the heartbeat information, if the heartbeat information is overtime, the current wheat-connecting state is indicated, and the live broadcast interface of a live broadcast watching user returns to the original main broadcast live broadcast room, so that the live broadcast wheat-connecting state monitoring system is equivalent to monitoring the main broadcast wheat-connecting state in real time, the pause time of live broadcast picture wheat-connecting fault is effectively reduced, and the watching experience of the user is ensured.
The present invention is not limited to the above-described embodiments, and it will be apparent to those skilled in the art that various modifications and improvements can be made without departing from the principle of the present invention, and such modifications and improvements are also considered to be within the scope of the present invention. Those not described in detail in this specification are within the skill of the art.

Claims (8)

1. A live broadcast wheat connecting state monitoring method is characterized by comprising the following steps:
the client receives a message which is sent by the server and used for indicating successful connection of the wheat through a message receiving function;
calling a timer headBeatTimer to set a timing period, and periodically sending heartbeat information for indicating the continuous microphone state to a server by a client through a heartbeat sending function sendHeartBateat;
the server receives the heartbeat information sent by the client through a function sendHeartBetRespond, and judges an error code contained in the heartbeat information:
when the error Code is Code _ successful, the heartbeat information is successfully sent, and the current microphone is normal;
when the error Code is Code _ timeOut, the heartbeat information is indicated to be sent overtime, and the current microphone is in fault;
the method comprises the following steps of calling a timer, wherein the called timer sets a timing period, and the specific steps are as follows:
s201: judging whether a timer headBeatTimer exists, if so, turning to the step S202, otherwise, turning to the step S203;
s202: setting a timing period for a timer headBeatTimer;
s203: using a timer variable creation function GCDTimer to create a timer headBeatTimer of a weak reference type;
the client periodically sends heartbeat information used for indicating the microphone connecting state to the server through a heartbeat sending function sendHeartbeat, and the method comprises the following specific steps:
s211: the timer headBeatTimer periodically calls an updateTimer function;
s212: the updateTimer function uses a queue creating function to create a queue, the created queue comprises a first parameter and a second parameter, the first parameter is a queue name, and the second parameter is a queue type;
s213: in the created queue, heartbeat information indicating the microphone connecting state is transmitted to the server through a heartbeat transmitting function sendHeartBeat.
2. The live broadcast wheat-connecting state monitoring method as claimed in claim 1, characterized in that: the client receives a message which is sent by the server and used for indicating successful wheat connection through a message receiving function, and the specific steps are as follows:
the client receives the message sent by the server through a message receiving function;
the client saves the received message in a parameter decoder of a message receiving function;
and converting the parameters into a model, judging the field type used for pushing the notification message on behalf of the server in the model, and when the field type is a set type used for indicating successful wheat connection, indicating that the current wheat connection is successful.
3. The live broadcast microphone connecting state monitoring method as claimed in claim 1, wherein when the heartbeat information is sent overtime and the current microphone connecting fails:
disconnecting the connection of the live broadcast, simultaneously disconnecting the display of the live broadcast pictures of all live broadcast watching users, and releasing a timer, wherein the specific steps of releasing the timer are as follows: and acquiring a timer headBeatTimer, calling a method destroy for destroying the timer to destroy the timer headBeatTimer, and setting nil of the timer headBeatTimer.
4. The method as claimed in claim 1, wherein the server receives the heartbeat message sent by the client through a function sendHeartpeetRespond, and disconnects the microphone if the server does not receive the heartbeat message sent by the client within a set time.
5. A client, comprising:
a first receiving unit for receiving a message indicating successful connection to a wheat;
the calling unit is used for calling the timer headBeatTimer and setting a timing period for the timer headBeatTimer;
a first sending unit, configured to periodically send heartbeat information indicating a connected microphone state through a heartbeat sending function sendHeartBeat based on a timing period set by a timer headBeatTimer;
the method comprises the following steps of calling a timer headBeatTimer, and setting a timing period for the timer headBeatTimer, wherein the method specifically comprises the following steps:
s201: judging whether a timer headBeatTimer exists, if so, turning to the step S202, otherwise, turning to the step S203;
s202: setting a timing period for a timer headBeatTimer;
s203: using a timer variable creation function GCDTimer to create a timer headBeatTimer of a weak reference type;
the method comprises the following steps of periodically sending heartbeat information used for indicating the microphone connecting state through a heartbeat sending function sendHeartbeat, and specifically comprises the following steps:
s211: the timer headBeatTimer periodically calls an updateTimer function;
s212: the updateTimer function uses a queue creating function to create a queue, the created queue comprises a first parameter and a second parameter, the first parameter is a queue name, and the second parameter is a queue type;
s213: in the created queue, heartbeat information indicating the microphone connecting state is transmitted to the server through a heartbeat transmitting function sendHeartBeat.
6. A server, comprising:
a second transmitting unit for transmitting a message indicating successful connection to the wheat;
a second receiving unit for receiving the heartbeat information through a function sendHeartBetRespond;
a judging unit, configured to judge an error code included in the heartbeat information received by the second receiving unit:
when the error Code is Code _ successful, the heartbeat information is successfully sent, and the current microphone is normal;
when the error Code is Code _ timeOut, the heartbeat information is indicated to be sent overtime, and the current microphone is in fault;
the heartbeat information received by the second receiving unit specifically includes: calling a timer headBeatTimer to set a timing period, and periodically sending heartbeat information for indicating the microphone connecting state to a second receiving unit by a client through a heartbeat sending function sendHeartBateat;
the method comprises the following steps of calling a timer, wherein the called timer sets a timing period, and the specific steps are as follows:
s201: judging whether a timer headBeatTimer exists, if so, turning to the step S202, otherwise, turning to the step S203;
s202: setting a timing period for a timer headBeatTimer;
s203: using a timer variable creation function GCDTimer to create a timer headBeatTimer of a weak reference type;
the client periodically sends heartbeat information used for indicating the microphone connecting state to the second receiving unit through a heartbeat sending function sendHeartbeat, and the specific steps are as follows:
s211: the timer headBeatTimer periodically calls an updateTimer function;
s212: the updateTimer function uses a queue creating function to create a queue, the created queue comprises a first parameter and a second parameter, the first parameter is a queue name, and the second parameter is a queue type;
s213: in the created queue, heartbeat information indicating the microphone connecting state is transmitted to the second receiving unit by the heartbeat transmitting function sendHeartBeat.
7. A storage medium having a computer program stored thereon, characterized in that: the computer program when executed by a processor implementing the steps of:
the client receives a message which is sent by the server and used for indicating successful connection of the wheat through a message receiving function;
calling a timer headBeatTimer to set a timing period, and periodically sending heartbeat information for indicating the continuous microphone state to a server by a client through a heartbeat sending function sendHeartBateat;
the server receives the heartbeat information sent by the client through a function sendHeartBetRespond, and judges an error code contained in the heartbeat information:
when the error Code is Code _ successful, the heartbeat information is successfully sent, and the current microphone is normal;
when the error Code is Code _ timeOut, the heartbeat information is indicated to be sent overtime, and the current microphone is in fault;
the method comprises the following steps of calling a timer, wherein the called timer sets a timing period, and the specific steps are as follows:
s201: judging whether a timer headBeatTimer exists, if so, turning to the step S202, otherwise, turning to the step S203;
s202: setting a timing period for a timer headBeatTimer;
s203: using a timer variable creation function GCDTimer to create a timer headBeatTimer of a weak reference type;
the client periodically sends heartbeat information used for indicating the microphone connecting state to the server through a heartbeat sending function sendHeartbeat, and the method comprises the following specific steps:
s211: the timer headBeatTimer periodically calls an updateTimer function;
s212: the updateTimer function uses a queue creating function to create a queue, the created queue comprises a first parameter and a second parameter, the first parameter is a queue name, and the second parameter is a queue type;
s213: in the created queue, heartbeat information indicating the microphone connecting state is transmitted to the server through a heartbeat transmitting function sendHeartBeat.
8. A live broadcast wheat connecting state monitoring system is characterized by comprising:
the first receiving module is used for driving the client to receive the message which is sent by the server and used for indicating successful wheat connection through the message receiving function;
the sending module is used for calling a timer headBeatTimer to set a timing period and driving the client to send heartbeat information for indicating the microphone connecting state to the server periodically through a heartbeat sending function sendHeartBateat;
a second receiving module, configured to drive the server to receive the heartbeat information sent by the client through a function sendheartbeat response;
the judging module is used for judging error codes contained in the heartbeat information received by the server:
when the error Code is Code _ successful, the heartbeat information is successfully sent, and the current microphone is normal;
when the error Code is Code _ timeOut, the heartbeat information is indicated to be sent overtime, and the current microphone is in fault;
the method comprises the following steps of calling a timer, wherein the called timer sets a timing period, and the specific steps are as follows:
s201: judging whether a timer headBeatTimer exists, if so, turning to the step S202, otherwise, turning to the step S203;
s202: setting a timing period for a timer headBeatTimer;
s203: using a timer variable creation function GCDTimer to create a timer headBeatTimer of a weak reference type;
the client periodically sends heartbeat information used for indicating the microphone connecting state to the server through a heartbeat sending function sendHeartbeat, and the method comprises the following specific steps:
s211: the timer headBeatTimer periodically calls an updateTimer function;
s212: the updateTimer function uses a queue creating function to create a queue, the created queue comprises a first parameter and a second parameter, the first parameter is a queue name, and the second parameter is a queue type;
s213: in the created queue, heartbeat information indicating the microphone connecting state is transmitted to the server through a heartbeat transmitting function sendHeartBeat.
CN201811161813.3A 2018-09-30 2018-09-30 Live broadcast and microphone connection state monitoring method, client, server, medium and system Active CN110971922B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811161813.3A CN110971922B (en) 2018-09-30 2018-09-30 Live broadcast and microphone connection state monitoring method, client, server, medium and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811161813.3A CN110971922B (en) 2018-09-30 2018-09-30 Live broadcast and microphone connection state monitoring method, client, server, medium and system

Publications (2)

Publication Number Publication Date
CN110971922A CN110971922A (en) 2020-04-07
CN110971922B true CN110971922B (en) 2021-11-09

Family

ID=70029257

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811161813.3A Active CN110971922B (en) 2018-09-30 2018-09-30 Live broadcast and microphone connection state monitoring method, client, server, medium and system

Country Status (1)

Country Link
CN (1) CN110971922B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111683262B (en) * 2020-06-04 2022-03-15 广州酷狗计算机科技有限公司 Method, device, server, terminal and storage medium for determining continuous microphone time
CN112291316B (en) * 2020-10-19 2022-03-15 北京字节跳动网络技术有限公司 Connection processing method and device, electronic equipment and computer readable storage medium
CN114554230B (en) * 2020-11-27 2023-07-25 北京字节跳动网络技术有限公司 Method, device, terminal, computer equipment and storage medium for processing wheat connecting state
CN112911325B (en) * 2021-01-29 2023-07-14 百果园技术(新加坡)有限公司 Method and device for recovering inter-live-broadcast room connection
CN113204440A (en) * 2021-04-29 2021-08-03 北京达佳互联信息技术有限公司 Message sending method and device, electronic equipment and storage medium
CN113259697B (en) * 2021-05-12 2022-04-08 腾讯科技(深圳)有限公司 Live broadcast state notification method, related device, equipment and storage medium
CN113810775B (en) * 2021-09-13 2023-04-07 上海哔哩哔哩科技有限公司 Voice and video connection system and method

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102523280A (en) * 2011-12-13 2012-06-27 深圳市融创天下科技股份有限公司 Detection method of transmission control abnormal disconnection, apparatus thereof, server and system
CN106027548A (en) * 2016-06-28 2016-10-12 武汉斗鱼网络科技有限公司 System and method for generating white list based on page heartbeat event of a live broadcast website
CN106571973A (en) * 2016-09-28 2017-04-19 杭州鸿雁智能科技有限公司 Heartbeat packet timeout management method and system
CN107743250A (en) * 2017-10-10 2018-02-27 武汉斗鱼网络科技有限公司 Realize that main broadcaster connects wheat PK method, storage medium, equipment and system on PC
CN108111879A (en) * 2017-12-12 2018-06-01 福建中金在线信息科技有限公司 A kind of method, apparatus and electronic equipment of net cast abnormality processing
CN108184140A (en) * 2018-01-10 2018-06-19 武汉斗鱼网络科技有限公司 A kind of live streaming connects wheat method and device
CN108259448A (en) * 2016-12-30 2018-07-06 广州华多网络科技有限公司 The method and device of abnormal broken line during a kind of company of preventing wheat
CN108306942A (en) * 2018-01-09 2018-07-20 武汉斗鱼网络科技有限公司 Communication means, storage medium, electronic equipment and the system that multi-user is broadcast live simultaneously

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9191622B2 (en) * 2007-10-17 2015-11-17 At&T Intellectual Property I, Lp System for fault detection in an internet protocol television communication system
US11425079B2 (en) * 2014-12-16 2022-08-23 All Phase Consulting, Inc. Simultaneous uninterrupted media play and call management

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102523280A (en) * 2011-12-13 2012-06-27 深圳市融创天下科技股份有限公司 Detection method of transmission control abnormal disconnection, apparatus thereof, server and system
CN106027548A (en) * 2016-06-28 2016-10-12 武汉斗鱼网络科技有限公司 System and method for generating white list based on page heartbeat event of a live broadcast website
CN106571973A (en) * 2016-09-28 2017-04-19 杭州鸿雁智能科技有限公司 Heartbeat packet timeout management method and system
CN108259448A (en) * 2016-12-30 2018-07-06 广州华多网络科技有限公司 The method and device of abnormal broken line during a kind of company of preventing wheat
CN107743250A (en) * 2017-10-10 2018-02-27 武汉斗鱼网络科技有限公司 Realize that main broadcaster connects wheat PK method, storage medium, equipment and system on PC
CN108111879A (en) * 2017-12-12 2018-06-01 福建中金在线信息科技有限公司 A kind of method, apparatus and electronic equipment of net cast abnormality processing
CN108306942A (en) * 2018-01-09 2018-07-20 武汉斗鱼网络科技有限公司 Communication means, storage medium, electronic equipment and the system that multi-user is broadcast live simultaneously
CN108184140A (en) * 2018-01-10 2018-06-19 武汉斗鱼网络科技有限公司 A kind of live streaming connects wheat method and device

Also Published As

Publication number Publication date
CN110971922A (en) 2020-04-07

Similar Documents

Publication Publication Date Title
CN110971922B (en) Live broadcast and microphone connection state monitoring method, client, server, medium and system
CN109474688B (en) Method, device, equipment and medium for sending instant communication network request message
CN110166791B (en) Connection establishing method, device, equipment and storage medium
CN110704582B (en) Information processing method, device and equipment
CN108259448B (en) Method and device for preventing abnormal disconnection during wheat connection
WO2017101297A1 (en) Method and device for video messaging, terminal, and server
CN112291316B (en) Connection processing method and device, electronic equipment and computer readable storage medium
CN108965932A (en) A kind of even wheat window methods of exhibiting and device
CN108874825B (en) Abnormal data verification method and device
CN110308951B (en) Processing method and device for starting interface card pause, equipment and storage medium
CN108572837A (en) Method for upgrading software, device, readable storage medium storing program for executing and computer equipment
CN109309859A (en) Direct broadcasting room method for showing interface, framework and correlation technique, device and equipment
CN115412597A (en) Real-time data communication method
CN117793418B (en) Monitoring method, device, equipment and storage medium for third-party media live broadcast
CN111467797B (en) Game data processing method and device, computer storage medium and electronic equipment
CN115086263B (en) IM message sending method, system, storage medium and computer equipment of IOS terminal
CN114244700A (en) Port processing method and device, electronic equipment and computer readable storage medium
CN115514980A (en) Push stream live broadcast management method and device, computer and readable storage medium
CN102710989A (en) Method and device for processing notifications of television applications
CN117793418A (en) Monitoring method, device, equipment and storage medium for third-party media live broadcast
CN115278328B (en) Video cross-screen transmission system and method
CN111142740A (en) Data updating method, device and storage medium
CN114401254B (en) Streaming media service processing method and device, electronic equipment and storage medium
CN114363665B (en) Multi-service code stream pushing method, system, computer equipment and storage medium
CN108989401A (en) Alarm clock setting method, device, terminal, server and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant