WO2019071829A1 - Pc上实现主播连麦pk的方法、存储介质、设备及系统 - Google Patents

Pc上实现主播连麦pk的方法、存储介质、设备及系统 Download PDF

Info

Publication number
WO2019071829A1
WO2019071829A1 PCT/CN2017/117379 CN2017117379W WO2019071829A1 WO 2019071829 A1 WO2019071829 A1 WO 2019071829A1 CN 2017117379 W CN2017117379 W CN 2017117379W WO 2019071829 A1 WO2019071829 A1 WO 2019071829A1
Authority
WO
WIPO (PCT)
Prior art keywords
anchor
client
web browser
wheat
background server
Prior art date
Application number
PCT/CN2017/117379
Other languages
English (en)
French (fr)
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 WO2019071829A1 publication Critical patent/WO2019071829A1/zh

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/25Management operations performed by the server for facilitating the content distribution or administrating data related to end-users or client devices, e.g. end-user or client device authentication, learning user preferences for recommending movies
    • H04N21/258Client or end-user data management, e.g. managing client capabilities, user preferences or demographics, processing of multiple end-users preferences to derive collaborative data
    • H04N21/25866Management of end-user data
    • H04N21/25875Management of end-user data involving end-user authentication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/143Termination or inactivation of sessions, e.g. event-controlled end of session
    • H04L67/145Termination or inactivation of sessions, e.g. event-controlled end of session avoiding end of session, e.g. keep-alive, heartbeats, resumption message or wake-up for inactive or interrupted session
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/535Tracking the activity of the user
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/16Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
    • H04L69/161Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields
    • H04L69/162Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields involving adaptations of sockets based mechanisms
    • 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/25Management operations performed by the server for facilitating the content distribution or administrating data related to end-users or client devices, e.g. end-user or client device authentication, learning user preferences for recommending movies
    • H04N21/258Client or end-user data management, e.g. managing client capabilities, user preferences or demographics, processing of multiple end-users preferences to derive collaborative data
    • H04N21/25866Management of end-user data
    • H04N21/25891Management of end-user data being end-user preferences
    • 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/25Management operations performed by the server for facilitating the content distribution or administrating data related to end-users or client devices, e.g. end-user or client device authentication, learning user preferences for recommending movies
    • H04N21/266Channel or content management, e.g. generation and management of keys and entitlement messages in a conditional access system, merging a VOD unicast channel into a multicast channel
    • 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
    • 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/80Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
    • H04N21/81Monomedia components thereof
    • H04N21/8166Monomedia components thereof involving executable data, e.g. software
    • H04N21/8173End-user applications, e.g. Web browser, game

Definitions

  • the invention relates to the field of real-time application development technology, in particular to a method, a storage medium, a device and a system for realizing a host-connected wheat PK on a PC.
  • the anchor there are more than one type of tools for the live broadcast of the anchor, such as a mobile phone mobile terminal, a PC client on a PC (personal computer), and a web browser on the PC.
  • the anchor on the PC the user needs to rely on the PC client, but as far as the current statistics are concerned, the most commonly used anchor on the PC is the web browser, because the web browser is convenient to use and more comprehensive. . So, why not focus on the PK-related functions on the web browser, but also rely on a PC client? This is because the video streaming between the two live broadcasts is mixed on the anchor PC. This is not a problem on a dedicated PC client, but it is technically difficult to do video streaming on a web browser.
  • the object of the present invention is to overcome the deficiencies of the above-mentioned background art, and to provide a method, a storage medium, a device and a system for realizing an anchor connected to a PK on a PC, by splitting the entrance of the connected wheat and the PK (on the PC client) On the web, the PK is operated on the web browser, so that the anchor does not need to be frequently switched during the process of connecting the PK, which is more convenient to use and high in usability.
  • the technical solution adopted by the present invention is to provide a method for implementing an anchor-connected wheat PK on a PC, the method comprising the following steps:
  • step S1 After the anchor is logged in through the PC client or the web browser, record the login type currently used by the anchor.
  • the login type includes PC client login and web browser login; and the recorded login type is sent to the background server. Going to step S2;
  • step S2 When the anchor clicks the link button to initiate the connection request, it is determined according to the recorded login type whether the connected microphone host is a PC client login; if so, the PC client of the connected wheat anchor passes the background server to the connected host. The PC client sends a connection request message, and proceeds to step S3; if not, it prompts that the wheat anchor is logged in through the PC client to return to the wheat, and returns to step S1;
  • step S3 After being connected to the connected request message sent by Lianmai anchor and clicked the consent to connect the button, the PC client of the connected wheat anchor sends the consent to the PC client of the Lianmai anchor through the background server. Message; after the PC client of the Mai Mai host receives the consent to connect the Mai message, the two parties succeed in the transaction, and the process proceeds to step S4;
  • step S4 when the anchor of the two parties in the PC is successfully connected to the PC client, it will switch to the respective web browser, and perform PK operation on the web browser, and proceed to step S5;
  • step S4 the specific process of performing a PK operation on a web browser is as follows:
  • Step 1 The web browser of the maimai anchor obtains the current maimai state data of the two sides, and the maimai state data of the two sides includes: a room number, a nickname, a grade, and a lianmai state of the two anchors;
  • Step 2 The web browser of the maimai anchor sends a PK request message to the background server according to the acquired maimai state data of the two parties, and requests the PK to be carried out with the connected wheat anchor;
  • the PK request message carries the maimai anchor Room number and the room number of the connected wheat anchor;
  • Step 3 The background server searches for the corresponding web browser of the connected wheat anchor according to the room number of the connected wheat anchor in the PK request message, and forwards the PK request message to the web browser of the connected wheat anchor through the SOCKET method;
  • Step 4 When the connected microphone receives the PK request message sent by the connected host through the web browser and clicks the agree PK button, the web browser of the connected wheat anchor sends a consent PK message to the background server, the consent PK The message carries the room number of the connected wheat anchor and the room number of the connected wheat anchor;
  • Step 5 The background server finds the web browser of the corresponding maimai anchor according to the room number of the maimai anchor in the PK message, and forwards the PK message to the web browser of the maimai anchor through the SOCKET mode.
  • the PC client sends a heartbeat message to the background server at a specified time; the background server is each connected wheat.
  • the PC client records the active time.
  • the active time of the corresponding PC client is updated, and the active time of all PC clients is checked every second. If a PC client is active from the current time. If the difference exceeds the preset disconnection time, the PC client will be disconnected, and the corresponding connection between the PC clients of the two parties will be disconnected.
  • the present invention also provides a storage medium having stored thereon a computer program, the computer program being executed by the processor to implement the steps of the method for implementing the anchor connection PK on the PC.
  • the present invention also provides an apparatus for implementing an anchor connection PK on a PC, comprising a memory, a processor, and a computer program stored on the memory and running on the processor, the processor implementing the computer program to implement the above The steps of the method for implementing the anchor connection to the PK on the PC.
  • the present invention further provides a system for implementing an anchor connection with a PK on a PC, the system comprising a login operation processing module, a connection operation processing module, a PK operation processing module, and a PK interrupt processing module;
  • the login operation processing module is configured to: after receiving the login processing signal, record the login type currently used by the anchor after the anchor logs in through the PC client or the web browser, and the login type includes a PC client login and a web browser. Log in; send the recorded login type to the background server, and send the Lianmai processing signal to the Lianmai operation processing module;
  • the Lianmai operation processing module is configured to: after receiving the Lianmai processing signal, when the anchor clicks the link button to initiate the Lianmai request, determine whether the Lianmai anchor is a PC client login according to the recorded login type; if not, Prompt that even the Mai anchor logs in through the PC client to send the login processing signal to the login operation processing module; if so, the PC client controlling the connection with the Mai anchor sends a connection request to the PC client connected to the main anchor through the background server. Message; when the PC client connected to the linker receives the link request message and clicks the agree button, the PC client controlling the connected host sends a message to the PC client of the linker through the background server. After the PC client of the Mai Mai host receives the consent to connect the Mai message, the two parties succeed in sending the PK processing signal to the PK operation processing module;
  • the PK operation processing module is configured to: after receiving the PK processing signal, control the PCs of both sides to switch to their respective web browsers, and perform PK operations on the web browser; after the operation is completed, send the PK interrupt processing module to the PK interrupt processing module.
  • PK interrupt processing signal ;
  • the PK interrupt processing module is configured to: after receiving the PK interrupt processing signal, when the PC client of any one of the two parties is disconnected, the web browser controlling the two anchors interrupts the current PK operation.
  • the specific process of the Lianmai operation processing module controlling the PC client of the Lianmai anchor to send the Lianmai request message to the PC client connected to the Mianzhuo host through the background server is as follows:
  • the PC client controlling the connected malt is sent a connection request message to the background server, and the request is connected to the connected wheat anchor;
  • the connected request message carries the room number of the connected wheat anchor and the room number of the connected wheat anchor;
  • the background server searches for the corresponding PC client of the connected malt anchor according to the room number of the connected wheat anchor in the connection request message, and forwards the connection request message to the PC client of the connected wheat anchor through the SOCKET method; If the connected network host is not logged in by the PC client, the background server also needs to prompt the response that the connected network owner is logged in through the PC client to perform the connection request.
  • the specific process of the Lianmai operation processing module for controlling the PC client that is connected to the main malt anchor to send the consent to the connected client via the background server to the PC client of the Lianmai anchor is as follows:
  • the background server finds the PC client of the corresponding maimai anchor according to the room number of the maimai anchor in the maiden message, and agrees to forward the mai news to the PC client of the maimai anchor through the SOCKET mode.
  • the web browser controlling the maimai anchor obtains the current maimai state data of the two sides, and the maimai state data of the two sides includes: a room number, a nickname, a grade, and a lianmai state of the two anchors;
  • the web browser controlling the maimai anchor sends a PK request message to the background server according to the acquired maimai status data of the two parties, requesting the PK to be performed with the connected wheat anchor;
  • the PK request message carries the room with the maimai anchor No. and the room number of the owner of the connected wheat;
  • the background server searches for the corresponding web browser of the connected malt anchor according to the room number of the connected wheat anchor in the PK request message, and forwards the PK request message to the web browser of the connected wheat anchor through the SOCKET method;
  • the web browser controlling the connected linker sends a consent PK message to the background server, and the consent PK message carries The room number of the connected wheat anchor and the room number of the connected wheat anchor;
  • the background server finds the corresponding web browser of the connected malt anchor according to the room number of the connected wheat anchor in the PK message, and forwards the PK message to the web browser of the connected wheat anchor through the SOCKET mode.
  • the Lianmai operation processing module is further configured to: after controlling the PC client of the Lianmai, the PC client sends a heartbeat message to the background server at a specified time;
  • the background server records the active time for each PC client in the connected wheat.
  • the active time of the corresponding PC client is updated, and the active time of all PC clients is checked every second, if a PC client If the difference between the active time and the current time exceeds the preset disconnection time, the PC client is considered to be disconnected, and the corresponding connection between the PC clients of the two parties is disconnected.
  • the processing end of the connected operation and the processing end of the PK operation are split, so that the anchor performs the connection operation on the PC client, and performs the PK operation on the web browser, so that the anchor does not It is necessary to frequently switch between the PC client and the web browser in the process of PK, which is not only more convenient to use, but also easy to use; and after improving the usability, it can better stimulate the interest of the anchor using the PK function. It is very helpful to improve the gift income of the live platform and the economic benefits are better.
  • the PC clients of the two anchors send heartbeat information to the background server every specified time (for example, 5 seconds) after the success of the connection, and the background server will be used for each of the connected servers.
  • the PC client records the active time.
  • the active time of the corresponding PC client is updated, and the active time of all PC clients is checked every second. If the difference between the active time of a PC client and the current time is If the default connection loss time (such as 15 seconds) is exceeded, the PC client will be disconnected, and the connection between the PC clients of the two anchors will be disconnected.
  • the above operation can understand the connection state in the continuous wheat process in real time, so that the connection validity is guaranteed and the utility is strong.
  • FIG. 1 is a flowchart of a method for implementing an anchor connection with a PK on a PC according to an embodiment of the present invention
  • FIG. 2 is a schematic flowchart of performing a continuous wheat operation process in an embodiment of the present invention
  • FIG. 3 is a schematic flowchart of performing PK operation processing in an embodiment of the present invention.
  • FIG. 4 is a schematic structural diagram of an apparatus for implementing an anchor connected to a PK on a PC according to an embodiment of the present invention
  • FIG. 5 is a structural block diagram of a system for implementing an anchor connected to a PK on a PC according to an embodiment of the present invention.
  • an embodiment of the present invention provides a method for implementing a host-connected PK on a PC, and the method includes the following steps:
  • Step S1 After the anchor is logged in through the PC client or the web browser, the login type currently used by the anchor is recorded, and the login type includes a PC client login and a web browser login; and the recorded login type is sent to the background server.
  • the background server can maintain two types of sessions: the PC client login type session PcLoginSession and the web browser login type. Session WebLoginSession. Both types of sessions are Map type data structures, with the anchor room number as the Key, mapped to the current session state data of the anchor, and the session state data also contains the SOCKET ID of the TCP connection between the background server and the PC.
  • the login type field ClientType is defined in the anchor registration request protocol LoginRequest, indicating the login type currently used by the anchor, 1 means PC client login, and 2 means web browser login.
  • the current login type is recorded in the login type field ClientType.
  • the background server can determine the login type of the current login based on the ClientType field in the login request LoginReqeust. If the PC client logs in, the login session state data of the anchor will be recorded in the PcLoginSession. If it is a web browser login login, it will be recorded in the WebLoginSession. In this way, when the background server subsequently sends different types of connected wheat signaling messages to different terminals, the session of the respective terminal can be found.
  • Step S2 When the anchor clicks the link button to initiate the connection request, according to the recorded login type, it is determined whether the connected wheat anchor is a PC client login; if so, the PC client of the connected wheat anchor passes the background server to the connected wheat anchor The PC client sends a continuation request message, and proceeds to step S3; if not, the web browser of the maimai anchor prompts the maimai anchor to log in through the PC client, and returns to step S1.
  • the specific process of sending a connection request message to the PC client connected to the host by the background server in step S2 is as follows:
  • connection request message PHONE_REQUEST to the background server to perform the connection with the connected wheat anchor, and the connection request PHONE_REQUEST carries the room number LOCAL_ROOM_ID of the connected wheat anchor and the room of the connected wheat anchor. No. PEER_ROOM_ID;
  • the background server finds the corresponding PC client of the connected malt anchor according to the room number PEER_ROOM_ID of the connected wheat anchor in the PHONE_REQUEST, and forwards the connected request message PHONE_REQUEST through the SOCKET (socket) manner.
  • the background server can search for the PC client login session of the connected network anchor in the session PcLoginSession of the PC client login type, and store the login session in the session through the PC client.
  • the TCP link SOCKET forwards the connected request message PHONE_REQUEST to the PC client that is connected to the connected host;
  • the background server also needs to prompt the response that the connected network owner is logged in through the PC client to perform the connection request.
  • step S3 when the connected host receives the Lianmai request message sent by the Lianmai anchor through the PC client and clicks the agree to connect the button, the PC client connected to the linker through the background server sends the PC client to the connected host through the background server.
  • the terminal sends the consent to connect to the wheat message; after the PC client of the wheat anchor receives the consent to connect the wheat message, the two parties succeed in the transaction, and the process proceeds to step S4.
  • the specific process of sending the consent of the PC client connected to the main anchor by the background server to the PC client of the Lianmai anchor in the step S3 is as follows:
  • the PC client connected to the maimai anchor sends a consent to the background message PHONE_ACCEPT to the background server, and the consent even the wheat message PHONE_ACCEPT carries the room number LOCAL_ROOM_ID of the connected wheat anchor and the room number PEER_ROOM_ID of the connected wheat anchor;
  • the background server finds the PC client of the corresponding maimai anchor according to the room number LOCAL_ROOM_ID of the maimai anchor in the PHONE_ACCEPT, and agrees to forward the PHONE_ACCEPT to the company via SOCKET (socket).
  • the PC client of the MG anchor in the specific operation, the background server can search for the PC client login session of the MG anchor in the session PcLoginSession of the PC client login type, and log in through the TCP link SOCKET stored in the PC client login session. Will agree to forward the wheat message PHONE_ACCEPT to the PC client of the Lianmai anchor.
  • the PC clients of the two anchors send a heartbeat information PHONE_HEARTBEAT to the background server every specified time (for example, 5 seconds) after the success of the connection, and the background server is the PC client of each connected computer. Record the active time.
  • the heartbeat message is received, the active time of the corresponding PC client is updated, and the active time of all PC clients is checked every second. If the difference between the active time of a PC client and the current time exceeds the preset. If the PC client loses connection, the disconnection time (such as 15 seconds) will disconnect the PC connection between the two host PC clients.
  • Step S4 When the anchors of the two parties succeed in the PC client, they will switch to their respective web browsers and perform PK operations on the web browser.
  • step S4 further includes the following operations: after the two anchors succeed in the PC client, the background server may store the connected state data of the two parties in the connection state session PhoneSession.
  • the data of the continuous wheat status of the two sides includes: the room number, the nickname, the grade of the two anchors, and the state of the continuous wheat (such as the continuous wheat, the broken wheat, the PK, the PK disconnection, etc.).
  • the connection state session PhoneSession uses the combination of the room numbers of the two anchors as its search key Key, such as: std::pair ⁇ ROO M_ID_BIG, ROOM_ID_SMALL>, the two room numbers are larger in the front and the smaller in the back.
  • the background server saves the connection state session PhoneSession of all the two anchors in a connection status index session PhoneIndexSession, and the background server can find the corresponding connection status session PhoneSession according to the room number of each anchor.
  • the word Key is then found according to the search key Key to find the corresponding connection state session PhoneSession, thereby obtaining the current connection status information.
  • the corresponding continuous wheat status data can be found according to a single room number, which is more convenient, more user-friendly, and easy to use.
  • step S4 further includes the following operations: when the two anchors succeed in the PC client, the background server sends a continuous broadcast message PHONE_BROADCAST in the room of the two connected hosts.
  • Lian Mai's successful broadcast message PHONE_BROADCAST carries the data of the continuous wheat status of both sides. All users who log in to the two live rooms and the anchor themselves will receive the broadcast message.
  • step S4 the specific process of performing a PK operation on the web browser in step S4 is as follows:
  • the web browser of the wheat anchor acquires the current state data of the two sides of the Lianmai, and the data of the continuous wheat status of the two sides includes: the room number, the nickname, the grade of the two anchors, and the state of the continuous wheat (such as Maizhong, Lianmai disconnection, PK, PK disconnection, etc.).
  • the web browser of the wheat anchor acquires the current state data of the two sides of the two sides, the following two scenarios are as follows: First, even when the web anchor is logged into the web browser, the web client is not connected to the host host. Mai, the second is that when the main anchor is logged into the web browser, both anchors have completed the connection in the PC client.
  • the web browser received the successful broadcast message PHONE_BROADCAST broadcast by the background server after the success of the connection.
  • the data of the continuous wheat status of the two sides of the company is obtained from the broadcast message.
  • the successful broadcast message PHONE_BROADCAST broadcast by the background server after the success of the connection may not be received. At that time, the connection status of the server can only be queried from the connection status session PhoneSession of the server.
  • the web browser of the maimai anchor sends a PK request message PHONE_PK_REQUEST request to the background server to perform PK according to the acquired maimai status data of the lianmai, and the PK request message PHONE_PK_REQUEST carries the room with the maimai anchor.
  • the background server finds the corresponding web browser of the connected wheat anchor according to the room number PEER_ROOM_ID of the connected wheat anchor in the PK request message PHONE_PK_REQUEST, and forwards the PK request message PHONE_PK_REQUEST to the called by the SOCKET (socket). Even the web browser of the wheat anchor.
  • the background server may search the web browser login session of the web browser in the web browser login type webLoginSession, and forward the PK request message PHONE_PK_REQUEST through the TCP link SOCKET stored in the web browser login session. Go to the web browser that is connected to the wheat anchor.
  • the web browser of the connected wheat anchor sends a consent PK message PHONE_PK_ACCEPT to the background server, the consent PK
  • the message PHONE_PK_ACCEPT carries the room number LOCAL_ROOM_ID of the connected wheat anchor and the room number PEER_ROOM_ID of the connected wheat anchor;
  • the background server finds the corresponding web browser of the connected malt anchor according to the room number LOCAL_ROOM_ID of the connected microphone in the PK message PHONE_PK_ACCEPT, and forwards the PK message PHONE_PK_ACCEPT to the connected anchor through the SOCKET (socket). Web browser. During the specific operation, the background server may search the web browser login session of the web browser in the web browser login type webLoginSession, and forward the PK message PHONE_PK_ACCEPT to the TCP link SOCKET stored in the web browser login session. Even the web browser of the wheat anchor.
  • the web browsers of the two anchors can no longer send the heartbeat information. Even if the web browser is lost or closed, since the anchor is still connected to the PC client, it does not affect the current status of both parties.
  • the PK prompt message PHONE_TIPS carries the continuous wheat status data, the total PK duration and the remaining time of the PK. Data, the web browser can display the current continuous PK status in real time according to the connected PK prompt message PHONE_TIPS.
  • Step S5 When the PC client of any one of the two parties in the connection is disconnected from the connection (may be disconnected from the connection due to a network abnormality, the anchor may be actively disconnected from the connection), and the background server will be in the live broadcast of the anchors of both parties. Send a broadcast message disconnected from the connection, telling all users that the current connection has been disconnected; at the same time, the web browser of the two anchors will synchronize the broadcast message and interrupt the current PK operation. (It can be understood that if the PK operation or the PK operation and the end are not performed in the current web browser, it is not necessary to perform the operation of interrupting the PK again).
  • a host-connected PK solution on a PC is implemented.
  • the processing end of the connected operation and the processing end of the PK operation are split, so that the anchor performs the connection operation on the PC client, and performs the PK operation on the web browser, so that the anchor is no longer Need to frequently switch between PC client and web browser in the process of PK, not only is it more convenient to use, but also easy to use; and after improving the usability, it can better stimulate the interest of the anchor to use the PK function of the anchor.
  • the gift income of the live platform is very helpful and the economic benefits are better.
  • the embodiment of the present invention further provides a storage medium, where the computer program is stored on the PC, and the computer program is executed by the processor, and the implementation on the PC in the foregoing embodiments can be implemented.
  • the steps of the method of anchoring the Mai PK includes a U disk, a mobile hard disk, a ROM (Read-Only Memory), a RAM (Random Access Memory), a disk or an optical disk, and the like.
  • the medium of the code includes a U disk, a mobile hard disk, a ROM (Read-Only Memory), a RAM (Random Access Memory), a disk or an optical disk, and the like.
  • the medium of the code includes a U disk, a mobile hard disk, a ROM (Read-Only Memory), a RAM (Random Access Memory), a disk or an optical disk, and the like.
  • an embodiment of the present invention further provides a device for implementing an anchor connection PK on a PC, including a memory, a processor, and being stored in the memory.
  • an embodiment of the present invention further provides a system for implementing an anchor connection PK on a PC, where the system includes a login operation processing module, a Lianmai operation processing module, a PK operation processing module, and a PK interrupt processing module.
  • the login operation processing module is configured to: after receiving the login processing signal, record the login type currently used by the anchor after the anchor logs in through the PC client or the web browser, and the login type includes a PC client login and a web browser. Log in; send the recorded login type to the background server, and send the Lianmai processing signal to the Lianmai operation processing module;
  • the Lianmai operation processing module is used to: after receiving the continuous wheat processing signal, when the anchor clicks the link button to initiate the connection request, it is determined according to the recorded login type whether the connected wheat anchor is a PC client login; if not, the prompt is connected
  • the Mai anchor sends a login processing signal to the login operation processing module through the PC client login; if so, the PC client controlling the connection with the Mai anchor sends a connection request message to the PC client connected to the main anchor through the background server;
  • the PC client that is connected to the main host receives the Lianmai request message and clicks the agree to connect the button, the PC client controlling the connected Ms.
  • anchor sends a message to the PC client of the Lianmai anchor through the background server; After the PC client of the Mai anchor receives the consent to connect the Mai message, the two parties succeed in sending the PK processing signal to the PK operation processing module;
  • the PK operation processing module is configured to: after receiving the PK processing signal, control the PCs of both sides to switch to their respective web browsers, and perform PK operations on the web browser; after the operation is completed, send a PK interrupt to the PK interrupt processing module. Processing signals;
  • the PK interrupt processing module is configured to: after receiving the PK interrupt processing signal, when the PC client of any one of the two hosts is disconnected, the web browser controlling the two anchors interrupts the current PK operation.
  • each functional module in the system for implementing the anchor connection to the PK on the PC corresponds to the detailed process of each step of the method for implementing the anchor connection to the PK on the PC. Let me repeat.

Landscapes

  • Engineering & Computer Science (AREA)
  • Signal Processing (AREA)
  • Multimedia (AREA)
  • Databases & Information Systems (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Graphics (AREA)
  • Health & Medical Sciences (AREA)
  • Cardiology (AREA)
  • General Health & Medical Sciences (AREA)
  • Software Systems (AREA)
  • Computer Hardware Design (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

本发明公开了一种PC上实现主播连麦PK的方法、存储介质、设备及系统,涉及直播应用开发技术领域。该方法包括:当连麦主播发起连麦请求时,该连麦主播的PC客户端通过后台服务器向被连麦主播的PC客户端发送连麦请求消息;被连麦主播的PC客户端收到连麦请求消息后,通过后台服务器向连麦主播的PC客户端发送同意连麦消息;当连麦双方的主播在PC客户端连麦成功后,切换到各自的web浏览器,并在web浏览器上进行PK操作;当连麦双方中任意一个主播的PC客户端断开连麦时,两主播的web浏览器中断当前PK操作。本发明通过将连麦入口和PK的入口进行拆分,使得主播不再需要在连麦PK的过程中频繁切换,使用更加方便,易用性高。

Description

PC上实现主播连麦PK的方法、存储介质、设备及系统 技术领域
本发明涉及直播应用开发技术领域,具体来讲是一种PC上实现主播连麦PK的方法、存储介质、设备及系统。
背景技术
随着互联网技术的迅速发展,越来越多的用户可以使用电脑、手机等终端通过网络观看在线视频直播。现在直播行业中最普通的直播形式是一个主播在自己直播间面向粉丝直播。随着直播技术的发展,也已出现了让两个主播进行连麦,使画面和声音都面向双方房间的粉丝直播的这种形态。而为了能更大程度的提升直播的趣味性,在主播连麦的基础上,又引入了竞赛性的PK机制让双方主播进行一场短暂的比赛,这也称为主播连麦PK。
目前,主播进行直播的工具不止一种,有手机移动端,PC(personal computer,个人计算机)上的PC客户端,以及PC上的web浏览器等。就PC上的主播连麦PK来说,用户需要依赖PC客户端,但是就目前的统计数据来看,主播在PC上使用最多的还是web浏览器,因为web浏览器使用起来方便,功能更全面。那么,为什么不把连麦PK相关功能都集中到web浏览器上,还需要依赖一个PC客户端呢?这是因为两个直播间连麦后的视频混流是在主播PC上混的,这在专门的PC客户端上实现不是问题,而在web浏览器上做视频混流则存在技术难度。这就导致一个现有技术架构上的一个缺陷:主播在使用连麦功能的过程中,需要先在PC客户端上与对方连麦,然后在web浏 览器上盯着自己的直播窗口和各种数据;而在与对方进行PK的时候双方又都需要切换回PC客户端,各自进行发起PK及接受PK等操作,使用起来非常不方便。
因此,如何在现有技术架构上,优化PC上主播连麦PK的实现方法,使得主播使用起来更加方便,是本领域技术人员亟待解决的问题。
发明内容
本发明的目的是为了克服上述背景技术的不足,提供一种PC上实现主播连麦PK的方法、存储介质、设备及系统,通过将连麦入口和PK的入口进行拆分(在PC客户端上进行连麦,在web浏览器上操作PK),使得主播不再需要在连麦PK的过程中频繁切换,使用更加方便,易用性高。
为达到以上目的,本发明采取的技术方案是:提供一种PC上实现主播连麦PK的方法,该方法包括以下步骤:
S1、当主播通过PC客户端或web浏览器登录后,记录下主播当前使用的登录类型,该登录类型包括PC客户端登录、web浏览器登录;并将记录的登录类型发送给后台服务器,转入步骤S2;
S2、当主播点击连麦按钮发起连麦请求时,根据记录的登录类型判断该连麦主播是否是PC客户端登录;若是,该连麦主播的PC客户端通过后台服务器向被连麦主播的PC客户端发送连麦请求消息,转入步骤S3;若否,提示连麦主播通过PC客户端登录进行连麦,返回步骤S1;
S3、当被连麦主播收到连麦主播发来的连麦请求消息并点击同意连麦按钮后,被连麦主播的PC客户端通过后台服务器向连麦主播的PC客户端发送同意连麦消息;连麦主播的PC客户端收到该同意连 麦消息后,双方连麦成功,转入步骤S4;
S4、当连麦双方的主播在PC客户端连麦成功后,将切换到各自的web浏览器,并在web浏览器上进行PK操作,转入步骤S5;
S5、当连麦双方中任意一个主播的PC客户端断开连麦时,两主播的web浏览器中断当前PK操作,结束。
在上述技术方案的基础上,步骤S4中,在web浏览器上进行PK操作的具体流程如下:
步骤1、连麦主播的web浏览器获取当前的连麦双方的连麦状态数据,所述连麦双方的连麦状态数据包括:两个主播的房间号、昵称、等级以及连麦状态;
步骤2、连麦主播的web浏览器根据获取到的连麦双方的连麦状态数据,向后台服务器发送PK请求消息,请求与被连麦主播进行PK;所述PK请求消息携带有连麦主播的房间号和被连麦主播的房间号;
步骤3、后台服务器根据PK请求消息中的被连麦主播的房间号查找到相应的被连麦主播的web浏览器,并将PK请求消息通过SOCKET方式转发至被连麦主播的web浏览器;
步骤4、当被连麦主播通过web浏览器收到连麦主播发来的PK请求消息并点击同意PK按钮后,被连麦主播的web浏览器向后台服务器发送同意PK消息,所述同意PK消息携带有连麦主播的房间号和被连麦主播的房间号;
步骤5、后台服务器根据同意PK消息中的连麦主播的房间号查找到相应的连麦主播的web浏览器,并将同意PK消息通过SOCKET方式转发至连麦主播的web浏览器。
在上述技术方案的基础上,步骤S3之后还包括以下操作:连麦双方的PC客户端在连麦成功后,均会每隔指定时间向后台服务器发 送一次心跳信息;后台服务器为每个连麦中的PC客户端记录活跃时间,收到心跳消息时会更新相应的PC客户端的活跃时间,并每隔一秒检查一次所有PC客户端的活跃时间,如果某个PC客户端活跃时间距当前时间的差值超过预设的失连时间,就会认为该PC客户端失连,则断开相应的连麦双方的PC客户端间的连麦连接。
本发明还提供一种存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现上述PC上实现主播连麦PK的方法的步骤。
本发明还提供一种PC上实现主播连麦PK的设备,包括存储器、处理器及存储在存储器上并在所述处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现上述PC上实现主播连麦PK的方法的步骤。
本发明还提供一种PC上实现主播连麦PK的系统,该系统包括登录操作处理模块、连麦操作处理模块、PK操作处理模块和PK中断处理模块;
所述登录操作处理模块用于:收到登录处理信号后,当主播通过PC客户端或web浏览器登录后,记录下主播当前使用的登录类型,该登录类型包括PC客户端登录、web浏览器登录;并将记录的登录类型发送给后台服务器,向连麦操作处理模块发送连麦处理信号;
所述连麦操作处理模块用于:收到连麦处理信号后,当主播点击连麦按钮发起连麦请求时,根据记录的登录类型判断该连麦主播是否是PC客户端登录;若不是,提示连麦主播通过PC客户端登录进行连麦,并向登录操作处理模块发送登录处理信号;若是,控制连麦主播的PC客户端通过后台服务器向被连麦主播的PC客户端发送连麦请求消息;当被连麦主播的PC客户端收到连麦请求消息并点击同意 连麦按钮时,控制被连麦主播的PC客户端通过后台服务器向连麦主播的PC客户端发送同意连麦消息;连麦主播的PC客户端收到该同意连麦消息后,双方连麦成功,向PK操作处理模块发送PK处理信号;
所述PK操作处理模块用于:收到PK处理信号后,控制连麦双方的PC切换到各自的web浏览器,并在web浏览器上进行PK操作;操作完成后,向PK中断处理模块发送PK中断处理信号;
所述PK中断处理模块用于:收到PK中断处理信号后,当连麦双方中任意一个主播的PC客户端断开连麦时,控制两主播的web浏览器中断当前PK操作。
在上述技术方案的基础上,所述连麦操作处理模块控制连麦主播的PC客户端通过后台服务器向被连麦主播的PC客户端发送连麦请求消息的具体流程如下:
控制连麦主播的PC客户端向后台服务器发送连麦请求消息,请求与被连麦主播进行连麦;该连麦请求消息携带有连麦主播的房间号和被连麦主播的房间号;
后台服务器根据连麦请求消息中的被连麦主播的房间号查找到相应的被连麦主播的PC客户端,并将连麦请求消息通过SOCKET方式转发至被连麦主播的PC客户端;若被连麦主播不是PC客户端登录的,则后台服务器还需提示被连麦主播通过PC客户端登录进行连麦请求的响应。
在上述技术方案的基础上,所述连麦操作处理模块控制被连麦主播的PC客户端通过后台服务器向连麦主播的PC客户端发送同意连麦消息的具体流程如下:
控制被连麦主播的PC客户端向后台服务器发送同意连麦消息, 该同意连麦消息携带有连麦主播的房间号和被连麦主播的房间号;
后台服务器根据同意连麦消息中的连麦主播的房间号查找到相应的连麦主播的PC客户端,并将同意连麦消息通过SOCKET方式转发至连麦主播的PC客户端。
在上述技术方案的基础上,所述PK操作处理模块在web浏览器上进行PK操作具体流程如下:
控制连麦主播的web浏览器获取当前的连麦双方的连麦状态数据,所述连麦双方的连麦状态数据包括:两个主播的房间号、昵称、等级以及连麦状态;
控制连麦主播的web浏览器根据获取到的连麦双方的连麦状态数据,向后台服务器发送PK请求消息,请求与被连麦主播进行PK;所述PK请求消息携带有连麦主播的房间号和被连麦主播的房间号;
后台服务器根据PK请求消息中的被连麦主播的房间号查找到相应的被连麦主播的web浏览器,并将PK请求消息通过SOCKET方式转发至被连麦主播的web浏览器;
当被连麦主播通过web浏览器收到连麦主播发来的PK请求消息并点击同意PK按钮后,控制被连麦主播的web浏览器向后台服务器发送同意PK消息,所述同意PK消息携带有连麦主播的房间号和被连麦主播的房间号;
后台服务器根据同意PK消息中的连麦主播的房间号查找到相应的连麦主播的web浏览器,并将同意PK消息通过SOCKET方式转发至连麦主播的web浏览器。
在上述技术方案的基础上,所述连麦操作处理模块还用于:控制连麦双方的PC客户端在连麦成功后,会每隔指定时间向后台服务器发送一次心跳信息;
后台服务器为每个连麦中的PC客户端记录活跃时间,收到心跳消息时会更新相应的PC客户端的活跃时间,并每隔一秒检查一次所有PC客户端的活跃时间,如果某个PC客户端活跃时间距当前时间的差值超过预设的失连时间,就会认为该PC客户端失连,则断开相应的连麦双方的PC客户端间的连麦连接。
本发明的有益效果在于:
(1)本发明中,将连麦操作的处理端和PK操作的处理端进行了拆分,使得主播在PC客户端上进行连麦操作,在web浏览器上进行PK操作,从而让主播不再需要在PK的过程中频繁切换PC客户端和web浏览器,不但使用更加方便,易用性高;而且在提升易用性后,可以更好地激发主播使用连麦PK功能的兴趣,对提升直播平台的礼物收益有很好的帮助,经济效益更好。
(2)本发明中,两个主播的PC客户端在连麦成功后,均会每隔指定时间(如5秒)向后台服务器发送一次心跳信息;后台服务器则会为每个连麦中的PC客户端记录活跃时间,收到心跳消息时会更新相应的PC客户端的活跃时间,并每隔一秒检查一次所有PC客户端的活跃时间,如果某个PC客户端活跃时间距当前时间的差值超过预设的失连时间(如15秒),就会认为该PC客户端失连,则断开两个主播的PC客户端之间的连麦连接。上述操作能够实时的了解连麦过程中的连接状态,使得连接有效性得到保障,实用性强。
附图说明
图1为本发明实施例中PC上实现主播连麦PK的方法的流程图;
图2为本发明实施例中进行连麦操作处理的流程示意图;
图3为本发明实施例中进行PK操作处理的流程示意图;
图4为本发明实施例中PC上实现主播连麦PK的设备的结构示 意图;
图5为本发明实施例中PC上实现主播连麦PK的系统结构框图。
具体实施方式
下面结合附图及具体实施例对本发明作进一步的详细描述。
参见图1所示,本发明实施例提供一种PC上实现主播连麦PK的方法,该方法包括以下步骤:
步骤S1、当主播通过PC客户端或web浏览器登录后,记录下主播当前使用的登录类型,该登录类型包括PC客户端登录、web浏览器登录;并将记录的登录类型发送给后台服务器。
可以理解的是,在实际操作中,为了支持主播可选择在PC客户端或web浏览器登录,后台服务器可维护两种类型的会话:PC客户端登录类型的会话PcLoginSession和web浏览器登录类型的会话WebLoginSession。两种类型的会话都是Map类型数据结构,以主播房间号作为Key,映射到主播的当前会话状态数据,会话状态数据也包含了后台服务器与PC端的TCP连接的SOCKET ID。在主播登录请求协议LoginRequest中定义登录类型字段ClientType,表示主播当前使用的登录类型,1表示PC客户端登录,2表示web浏览器登录。主播在PC上使用不同的登录方式进行登录后,会将当前的登录类型记录在登录类型字段ClientType中;后台服务器根据登录请求LoginReqeust中的ClientType字段,就能判断主播当前登录的登录类型。如果是PC客户端登录,主播的登录会话状态数据会记录到PcLoginSession中,如果是web浏览器登录登录,则会记录到WebLoginSession中。这样后台服务器后续把不同类型的连麦信令消息发送到不同的终端时,就能找到各自终端的会话了。
步骤S2、当主播点击连麦按钮发起连麦请求时,根据记录的登 录类型判断该连麦主播是否是PC客户端登录;若是,该连麦主播的PC客户端通过后台服务器向被连麦主播的PC客户端发送连麦请求消息,转入步骤S3;若否,该连麦主播的web浏览器提示连麦主播通过PC客户端登录进行连麦,返回步骤S1。
在一种实施方式中,如图2所示,步骤S2中通过后台服务器向被连麦主播的PC客户端发送连麦请求消息的具体流程如下:
1、连麦主播的PC客户端向后台服务器发送连麦请求消息PHONE_REQUEST请求与被连麦主播进行连麦,该连麦请求消息PHONE_REQUEST携带有连麦主播的房间号LOCAL_ROOM_ID和被连麦主播的房间号PEER_ROOM_ID;
2、后台服务器根据连麦请求消息PHONE_REQUEST中的被连麦主播的房间号PEER_ROOM_ID查找到相应的被连麦主播的PC客户端,并将连麦请求消息PHONE_REQUEST通过SOCKET(套接字)的方式转发至被连麦主播的PC客户端;具体操作时,后台服务器可在PC客户端登录类型的会话PcLoginSession中查找被连麦主播的PC客户端登录会话,并通过该PC客户端登录会话中存储的TCP链接SOCKET,将连麦请求消息PHONE_REQUEST转发到被连麦主播的PC客户端;
3、若被连麦主播不是PC客户端登录的,则后台服务器还需提示被连麦主播通过PC客户端登录进行连麦请求的响应。
步骤S3、当被连麦主播通过PC客户端收到连麦主播发来的连麦请求消息并点击同意连麦按钮后,被连麦主播的PC客户端通过后台服务器向连麦主播的PC客户端发送同意连麦消息;连麦主播的PC客户端收到该同意连麦消息后,双方连麦成功,转入步骤S4。
在一种实施方式中,如图2所示,步骤S3中被连麦主播的PC 客户端通过后台服务器向连麦主播的PC客户端发送同意连麦消息的具体流程如下:
1、被连麦主播的PC客户端向后台服务器发送同意连麦消息PHONE_ACCEPT,该同意连麦消息PHONE_ACCEPT携带有连麦主播的房间号LOCAL_ROOM_ID和被连麦主播的房间号PEER_ROOM_ID;
2、后台服务器根据同意连麦消息PHONE_ACCEPT中的连麦主播的房间号LOCAL_ROOM_ID查找到相应的连麦主播的PC客户端,并将同意连麦消息PHONE_ACCEPT通过SOCKET(套接字)的方式转发至连麦主播的PC客户端;具体操作时,后台服务器可在PC客户端登录类型的会话PcLoginSession中查找连麦主播的PC客户端登录会话,并通过该PC客户端登录会话中存储的TCP链接SOCKET,将同意连麦消息PHONE_ACCEPT转发到连麦主播的PC客户端。
通过上述步骤S2和步骤S3,完成了双方主播在各自PC客户端的连麦操作。
进一步的,为了能够实时的了解连麦过程中的连接状态,使得连接有效性得到保障。本实施例中,两个主播的PC客户端在连麦成功后,均会每隔指定时间(如5秒)向后台服务器发送一次心跳信息PHONE_HEARTBEAT;后台服务器为每个连麦中的PC客户端记录活跃时间,收到心跳消息时会更新相应的PC客户端的活跃时间,并每隔一秒检查一次所有PC客户端的活跃时间,如果某个PC客户端活跃时间距当前时间的差值超过预设的失连时间(如15秒),就会认为该PC客户端失连,则断开两个主播的PC客户端之间的连麦连接。
步骤S4、当连麦双方的主播在PC客户端连麦成功后,将切换到各自的web浏览器,并在web浏览器上进行PK操作。
进一步地,在一种实施方式中,步骤S4还包括以下操作:当两个主播在PC客户端连麦成功后,后台服务器可以将连麦双方的连麦状态数据存储在连接状态会话PhoneSession中,该连麦双方的连麦状态数据包括:两个主播的房间号、昵称、等级以及连麦状态(如连麦中、连麦断开、PK中、PK断开等)。该连接状态会话PhoneSession以双方主播的房间号组合作为其查找关键字Key,如:std::pair<ROO M_ID_BIG,ROOM_ID_SMALL>,两个房间号值较大的在前面,较小的在后面。并且,后台服务器将所有连麦中的两个主播的连接状态会话PhoneSession均保存在一个连接状态索引会话PhoneIndexSession中,后台服务器可根据每个主播的房间号查找到对应的连接状态会话PhoneSession的查找关键字Key,然后根据该查找关键字Key查找到对应的连接状态会话PhoneSession,从而得到当前的连麦状态信息。上述查找过程中,可以根据单个房间号查找到相应的连麦状态数据,使用更加方便、更加人性化,易用性高。
更进一步地,在一种实施方式中,步骤S4还包括以下操作:当两个主播在PC客户端连麦成功后,后台服务器在两个连麦主播的房间内发送连麦成功的广播消息PHONE_BROADCAST,连麦成功的广播消息PHONE_BROADCAST携带有连麦双方的连麦状态数据。所有登录到这两个直播间的用户以及主播自己都会收到该广播消息。
在上述操作基础上,如图3所示,在一种实施方式中,步骤S4中在web浏览器上进行PK操作的具体流程如下:
1、连麦主播的web浏览器获取当前的连麦双方的连麦状态数据,所述连麦双方的连麦状态数据包括:两个主播的房间号、昵称、等级以及连麦状态(如连麦中、连麦断开、PK中、PK断开等)。具体来说,连麦主播的web浏览器获取当前的连麦双方的连麦状态数据时, 分以下两种场景:一是连麦主播登录web浏览器时还未在PC客户端与对方主播连麦,二是连麦主播登录web浏览器时双方主播已经在PC客户端完成了连麦。第一种情况下,双方连麦成功时连麦主播已经通过web浏览器登录直播间,因此,其web浏览器会收到连麦成功后由后台服务器广播的麦成功的广播消息PHONE_BROADCAST,并可从该广播消息中获取到连麦双方的连麦状态数据。第二种情况下,由于连麦主播登录web浏览器时双方主播已经在PC客户端完成了连麦,因此,可能无法收到连麦成功后由后台服务器广播的麦成功的广播消息PHONE_BROADCAST;此时,就只能从服务器的连接状态会话PhoneSession中查询到连麦双方的连麦状态数据。
2、连麦主播的web浏览器根据获取的连麦双方的连麦状态数据,向后台服务器发送PK请求消息PHONE_PK_REQUEST请求与被连麦主播进行PK,该PK请求消息PHONE_PK_REQUEST携带有连麦主播的房间号LOCAL_ROOM_ID和被连麦主播的房间号PEER_ROOM_ID。
3、后台服务器根据PK请求消息PHONE_PK_REQUEST中的被连麦主播的房间号PEER_ROOM_ID查找到相应的被连麦主播的web浏览器,并将PK请求消息PHONE_PK_REQUEST通过SOCKET(套接字)的方式转发至被连麦主播的web浏览器。具体操作时,后台服务器可在web浏览器登录类型的会话WebLoginSession中查找被连麦主播的web浏览器登录会话,并通过该web浏览器登录会话中存储的TCP链接SOCKET,将PK请求消息PHONE_PK_REQUEST转发到被连麦主播的web浏览器。
4、当被连麦主播通过web浏览器收到连麦主播发来的PK请求消息PHONE_PK_REQUEST并点击同意PK按钮后,被连麦主播的 web浏览器向后台服务器发送同意PK消息PHONE_PK_ACCEPT,该同意PK消息PHONE_PK_ACCEPT携带有连麦主播的房间号LOCAL_ROOM_ID和被连麦主播的房间号PEER_ROOM_ID;
5、后台服务器根据同意PK消息PHONE_PK_ACCEPT中的连麦主播的房间号LOCAL_ROOM_ID查找到相应的连麦主播的web浏览器,并将同意PK消息PHONE_PK_ACCEPT通过SOCKET(套接字)的方式转发至连麦主播的web浏览器。具体操作时,后台服务器可在web浏览器登录类型的会话WebLoginSession中查找连麦主播的web浏览器登录会话,并通过该web浏览器登录会话中存储的TCP链接SOCKET,将同意PK消息PHONE_PK_ACCEPT转发到连麦主播的web浏览器。
可以理解的是,当两个主播在web浏览器上进行PK操作时,由于两个主播的PC客户端会定时发送心跳信息,因此两个主播的web浏览器可不再发送心跳信息。即使web浏览器失连或关闭,由于主播仍然在PC客户端端连麦,不影响当前双方的连麦状态。当主播再次登录web浏览器时,会收到后台服务器发送来的连麦PK提示消息PHONE_TIPS,该连麦PK提示消息PHONE_TIPS携带有连麦双方的连麦状态数据、PK总时长和PK剩余时长等数据,web浏览器可根据该连麦PK提示消息PHONE_TIPS实时展示当前的连麦PK状态。
步骤S5、当连麦双方中任意一个主播的PC客户端断开连麦时(可能由于网络异常导致断开连麦,也可能是主播主动关闭连麦),后台服务器将在双方主播的直播间发送连麦断开的广播消息,告知所有用户当前连麦已经断开;同时,两主播的web浏览器将同步该广播消息,并中断当前PK操作。(可以理解的是,若当前web浏览器中没进行PK操作或PK操作以及结束,则无需再次进行中断PK的操作)。
通过上述方法,实现了一种PC上的主播连麦PK方案。在上述操作过程中,将连麦操作的处理端和PK操作的处理端进行了拆分,使得主播在PC客户端上进行连麦操作,在web浏览器上进行PK操作,从而让主播不再需要在PK的过程中频繁切换PC客户端和web浏览器,不但使用更加方便,易用性高;而且在提升易用性后,可以更好地激发主播使用连麦PK功能的兴趣,对提升直播平台的礼物收益有很好的帮助,经济效益更好。
对应上述的PC上实现主播连麦PK的方法,本发明实施例还提供一种存储介质,其上存储有计算机程序,该计算机程序被处理器执行时可实现上述各实施例中的PC上实现主播连麦PK的方法的步骤。需要说明的是,所述存储介质包括U盘、移动硬盘、ROM(Read-Only Memory,只读存储器)、RAM(Random Access Memory,随机存取存储器)、磁碟或者光盘等各种可以存储程序代码的介质。
另外,参见图4所示,对应上述的PC上实现主播连麦PK的方法,本发明实施例还提供一种PC上实现主播连麦PK的设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,该处理器执行计算机程序时可实现上述各实施例中的PC上实现主播连麦PK的方法的步骤。
参见图5所示,本发明实施例还提供一种PC上实现主播连麦PK的系统,该系统包括登录操作处理模块、连麦操作处理模块、PK操作处理模块和PK中断处理模块。
其中,登录操作处理模块用于:收到登录处理信号后,当主播通过PC客户端或web浏览器登录后,记录下主播当前使用的登录类型,该登录类型包括PC客户端登录、web浏览器登录;并将记录的登录类型发送给后台服务器,向连麦操作处理模块发送连麦处理信号;
连麦操作处理模块用于:收到连麦处理信号后,当主播点击连麦按钮发起连麦请求时,根据记录的登录类型判断该连麦主播是否是PC客户端登录;若不是,提示连麦主播通过PC客户端登录进行连麦,并向登录操作处理模块发送登录处理信号;若是,控制连麦主播的PC客户端通过后台服务器向被连麦主播的PC客户端发送连麦请求消息;当被连麦主播的PC客户端收到连麦请求消息并点击同意连麦按钮时,控制被连麦主播的PC客户端通过后台服务器向连麦主播的PC客户端发送同意连麦消息;连麦主播的PC客户端收到该同意连麦消息后,双方连麦成功,向PK操作处理模块发送PK处理信号;
PK操作处理模块用于:收到PK处理信号后,控制连麦双方的PC切换到各自的web浏览器,并在web浏览器上进行PK操作;操作完成后,向PK中断处理模块发送PK中断处理信号;
PK中断处理模块用于:收到PK中断处理信号后,当连麦双方中任意一个主播的PC客户端断开连麦时,控制两主播的web浏览器中断当前PK操作。
可以理解的是,PC上实现主播连麦PK的系统中的各功能模块的具体实现流程,是与上文PC上实现主播连麦PK的方法的各步骤详细流程一一对应的,此处不再赘述。
需要说明的是:上述实施例提供的系统在PC上实现主播连麦PK的操作时,仅以上述各功能模块的划分进行举例说明,实际应用中,可根据需要将上述功能分配由不同的功能模块完成,即将系统的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。
本发明不局限于上述实施方式,对于本技术领域的普通技术人员来说,在不脱离本发明原理的前提下,还可以做出若干改进和润饰,这些改进和润饰也视为本发明的保护范围之内。
本说明书中未作详细描述的内容属于本领域专业技术人员公知的现有技术。

Claims (10)

  1. 一种PC上实现主播连麦PK的方法,其特征在于,该方法包括以下步骤:
    S1、当主播通过PC客户端或web浏览器登录后,记录下主播当前使用的登录类型,该登录类型包括PC客户端登录、web浏览器登录;并将记录的登录类型发送给后台服务器,转入步骤S2;
    S2、当主播点击连麦按钮发起连麦请求时,根据记录的登录类型判断该连麦主播是否是PC客户端登录;若是,该连麦主播的PC客户端通过后台服务器向被连麦主播的PC客户端发送连麦请求消息,转入步骤S3;若否,提示连麦主播通过PC客户端登录进行连麦,返回步骤S1;
    S3、当被连麦主播收到连麦主播发来的连麦请求消息并点击同意连麦按钮后,被连麦主播的PC客户端通过后台服务器向连麦主播的PC客户端发送同意连麦消息;连麦主播的PC客户端收到该同意连麦消息后,双方连麦成功,转入步骤S4;
    S4、当连麦双方的主播在PC客户端连麦成功后,将切换到各自的web浏览器,并在web浏览器上进行PK操作,转入步骤S5;
    S5、当连麦双方中任意一个主播的PC客户端断开连麦时,两主播的web浏览器中断当前PK操作,结束。
  2. 如权利要求1所述的PC上实现主播连麦PK的方法,其特征在于,步骤S4中,在web浏览器上进行PK操作的具体流程如下:
    步骤1、连麦主播的web浏览器获取当前的连麦双方的连麦状态数据,所述连麦双方的连麦状态数据包括:两个主播的房间号、昵称、等级以及连麦状态;
    步骤2、连麦主播的web浏览器根据获取到的连麦双方的连麦状 态数据,向后台服务器发送PK请求消息,请求与被连麦主播进行PK;所述PK请求消息携带有连麦主播的房间号和被连麦主播的房间号;
    步骤3、后台服务器根据PK请求消息中的被连麦主播的房间号查找到相应的被连麦主播的web浏览器,并将PK请求消息通过SOCKET方式转发至被连麦主播的web浏览器;
    步骤4、当被连麦主播通过web浏览器收到连麦主播发来的PK请求消息并点击同意PK按钮后,被连麦主播的web浏览器向后台服务器发送同意PK消息,所述同意PK消息携带有连麦主播的房间号和被连麦主播的房间号;
    步骤5、后台服务器根据同意PK消息中的连麦主播的房间号查找到相应的连麦主播的web浏览器,并将同意PK消息通过SOCKET方式转发至连麦主播的web浏览器。
  3. 如权利要求1所述的PC上实现主播连麦PK的方法,其特征在于,步骤S3之后还包括以下操作:连麦双方的PC客户端在连麦成功后,均会每隔指定时间向后台服务器发送一次心跳信息;后台服务器为每个连麦中的PC客户端记录活跃时间,收到心跳消息时会更新相应的PC客户端的活跃时间,并每隔一秒检查一次所有PC客户端的活跃时间,如果某个PC客户端活跃时间距当前时间的差值超过预设的失连时间,就会认为该PC客户端失连,则断开相应的连麦双方的PC客户端间的连麦连接。
  4. 一种存储介质,其上存储有计算机程序,其特征在于:所述计算机程序被处理器执行时实现上述权利要求1至3中任一项所述方法的步骤。
  5. 一种PC上实现主播连麦PK的设备,包括存储器、处理器及存储在所述存储器上并在所述处理器上运行的计算机程序,其特征在 于:所述处理器执行所述计算机程序时实现上述权利要求1至3中任一项所述方法的步骤。
  6. 一种PC上实现主播连麦PK的系统,其特征在于:该系统包括登录操作处理模块、连麦操作处理模块、PK操作处理模块和PK中断处理模块;
    所述登录操作处理模块用于:收到登录处理信号后,当主播通过PC客户端或web浏览器登录后,记录下主播当前使用的登录类型,该登录类型包括PC客户端登录、web浏览器登录;并将记录的登录类型发送给后台服务器,向连麦操作处理模块发送连麦处理信号;
    所述连麦操作处理模块用于:收到连麦处理信号后,当主播点击连麦按钮发起连麦请求时,根据记录的登录类型判断该连麦主播是否是PC客户端登录;若不是,提示连麦主播通过PC客户端登录进行连麦,并向登录操作处理模块发送登录处理信号;若是,控制连麦主播的PC客户端通过后台服务器向被连麦主播的PC客户端发送连麦请求消息;当被连麦主播的PC客户端收到连麦请求消息并点击同意连麦按钮时,控制被连麦主播的PC客户端通过后台服务器向连麦主播的PC客户端发送同意连麦消息;连麦主播的PC客户端收到该同意连麦消息后,双方连麦成功,向PK操作处理模块发送PK处理信号;
    所述PK操作处理模块用于:收到PK处理信号后,控制连麦双方的PC切换到各自的web浏览器,并在web浏览器上进行PK操作;操作完成后,向PK中断处理模块发送PK中断处理信号;
    所述PK中断处理模块用于:收到PK中断处理信号后,当连麦双方中任意一个主播的PC客户端断开连麦时,控制两主播的web浏览器中断当前PK操作。
  7. 如权利要求6所述的PC上实现主播连麦PK的系统,其特征在于,所述连麦操作处理模块控制连麦主播的PC客户端通过后台服务器向被连麦主播的PC客户端发送连麦请求消息的具体流程如下:
    控制连麦主播的PC客户端向后台服务器发送连麦请求消息,请求与被连麦主播进行连麦;该连麦请求消息携带有连麦主播的房间号和被连麦主播的房间号;
    后台服务器根据连麦请求消息中的被连麦主播的房间号查找到相应的被连麦主播的PC客户端,并将连麦请求消息通过SOCKET方式转发至被连麦主播的PC客户端;若被连麦主播不是PC客户端登录的,则后台服务器还需提示被连麦主播通过PC客户端登录进行连麦请求的响应。
  8. 如权利要求6所述的PC上实现主播连麦PK的系统,其特征在于,所述连麦操作处理模块控制被连麦主播的PC客户端通过后台服务器向连麦主播的PC客户端发送同意连麦消息的具体流程如下:
    控制被连麦主播的PC客户端向后台服务器发送同意连麦消息,该同意连麦消息携带有连麦主播的房间号和被连麦主播的房间号;
    后台服务器根据同意连麦消息中的连麦主播的房间号查找到相应的连麦主播的PC客户端,并将同意连麦消息通过SOCKET方式转发至连麦主播的PC客户端。
  9. 如权利要求6所述的PC上实现主播连麦PK的系统,其特征在于,所述PK操作处理模块在web浏览器上进行PK操作具体流程如下:
    控制连麦主播的web浏览器获取当前的连麦双方的连麦状态数据,所述连麦双方的连麦状态数据包括:两个主播的房间号、昵称、等级以及连麦状态;
    控制连麦主播的web浏览器根据获取到的连麦双方的连麦状态数据,向后台服务器发送PK请求消息,请求与被连麦主播进行PK;所述PK请求消息携带有连麦主播的房间号和被连麦主播的房间号;
    后台服务器根据PK请求消息中的被连麦主播的房间号查找到相应的被连麦主播的web浏览器,并将PK请求消息通过SOCKET方式转发至被连麦主播的web浏览器;
    当被连麦主播通过web浏览器收到连麦主播发来的PK请求消息并点击同意PK按钮后,控制被连麦主播的web浏览器向后台服务器发送同意PK消息,所述同意PK消息携带有连麦主播的房间号和被连麦主播的房间号;
    后台服务器根据同意PK消息中的连麦主播的房间号查找到相应的连麦主播的web浏览器,并将同意PK消息通过SOCKET方式转发至连麦主播的web浏览器。
  10. 如权利要求6所述的PC上实现主播连麦PK的系统,其特征在于,所述连麦操作处理模块还用于:控制连麦双方的PC客户端在连麦成功后,会每隔指定时间向后台服务器发送一次心跳信息;
    后台服务器为每个连麦中的PC客户端记录活跃时间,收到心跳消息时会更新相应的PC客户端的活跃时间,并每隔一秒检查一次所有PC客户端的活跃时间,如果某个PC客户端活跃时间距当前时间的差值超过预设的失连时间,就会认为该PC客户端失连,则断开相应的连麦双方的PC客户端间的连麦连接。
PCT/CN2017/117379 2017-10-10 2017-12-20 Pc上实现主播连麦pk的方法、存储介质、设备及系统 WO2019071829A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710932717.3 2017-10-10
CN201710932717.3A CN107743250B (zh) 2017-10-10 2017-10-10 Pc上实现主播连麦pk的方法、存储介质、设备及系统

Publications (1)

Publication Number Publication Date
WO2019071829A1 true WO2019071829A1 (zh) 2019-04-18

Family

ID=61237076

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/117379 WO2019071829A1 (zh) 2017-10-10 2017-12-20 Pc上实现主播连麦pk的方法、存储介质、设备及系统

Country Status (2)

Country Link
CN (1) CN107743250B (zh)
WO (1) WO2019071829A1 (zh)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111881940A (zh) * 2020-06-29 2020-11-03 广州华多网络科技有限公司 直播连麦匹配方法、装置、电子设备及存储介质
CN112911325A (zh) * 2021-01-29 2021-06-04 百果园技术(新加坡)有限公司 一种跨直播间连线的恢复方法和装置
CN115484468A (zh) * 2021-06-15 2022-12-16 北京字节跳动网络技术有限公司 一种连麦系统、方法、装置、设备及存储介质
CN115484469A (zh) * 2021-06-15 2022-12-16 北京字节跳动网络技术有限公司 一种连麦系统、方法、装置、设备及存储介质

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108810576B (zh) * 2018-03-28 2022-01-07 广州方硅信息技术有限公司 连麦直播的方法、装置及存储介质
CN109151592B (zh) * 2018-09-21 2021-12-28 广州方硅信息技术有限公司 跨频道连麦的互动方法、装置以及服务器
CN110971922B (zh) * 2018-09-30 2021-11-09 武汉斗鱼网络科技有限公司 直播连麦状态监控方法、客户端、服务器、介质及系统
CN111107441B (zh) * 2018-10-25 2022-01-04 武汉斗鱼网络科技有限公司 一种连麦通信建立方法、存储介质、电子设备及系统
CN109361930A (zh) * 2018-11-12 2019-02-19 广州酷狗计算机科技有限公司 业务处理方法、装置及计算机可读存储介质
CN109618191A (zh) * 2018-12-17 2019-04-12 广州市百果园信息技术有限公司 直播连麦方法、装置、计算机可读存储介质及终端
CN110324655B (zh) * 2019-08-05 2021-07-06 北京字节跳动网络技术有限公司 一种直播间客户端的连线方法、装置、设备及存储介质
CN110765366B (zh) * 2019-10-30 2022-11-08 网易(杭州)网络有限公司 直播连麦匹配方法、装置、设备及计算机可读存储介质
CN111683262B (zh) * 2020-06-04 2022-03-15 广州酷狗计算机科技有限公司 连麦时长确定方法、装置、服务器、终端及存储介质
CN112291316B (zh) * 2020-10-19 2022-03-15 北京字节跳动网络技术有限公司 连接处理方法、装置、电子设备及计算机可读存储介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TW200949610A (en) * 2008-05-30 2009-12-01 Media System Co Ltd D Live competition interactive system and the viewing device thereof
CN105812951A (zh) * 2016-03-24 2016-07-27 广州华多网络科技有限公司 流媒体数据交互方法、终端、服务器及系统
CN106060597A (zh) * 2016-06-30 2016-10-26 广州华多网络科技有限公司 一种进行主播竞赛的方法和系统
CN107027048A (zh) * 2017-05-17 2017-08-08 广州市千钧网络科技有限公司 一种直播连麦及信息展示的方法及装置

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TW200949610A (en) * 2008-05-30 2009-12-01 Media System Co Ltd D Live competition interactive system and the viewing device thereof
CN105812951A (zh) * 2016-03-24 2016-07-27 广州华多网络科技有限公司 流媒体数据交互方法、终端、服务器及系统
CN106060597A (zh) * 2016-06-30 2016-10-26 广州华多网络科技有限公司 一种进行主播竞赛的方法和系统
CN107027048A (zh) * 2017-05-17 2017-08-08 广州市千钧网络科技有限公司 一种直播连麦及信息展示的方法及装置

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111881940A (zh) * 2020-06-29 2020-11-03 广州华多网络科技有限公司 直播连麦匹配方法、装置、电子设备及存储介质
CN111881940B (zh) * 2020-06-29 2023-11-24 广州方硅信息技术有限公司 直播连麦匹配方法、装置、电子设备及存储介质
CN112911325A (zh) * 2021-01-29 2021-06-04 百果园技术(新加坡)有限公司 一种跨直播间连线的恢复方法和装置
CN115484468A (zh) * 2021-06-15 2022-12-16 北京字节跳动网络技术有限公司 一种连麦系统、方法、装置、设备及存储介质
CN115484469A (zh) * 2021-06-15 2022-12-16 北京字节跳动网络技术有限公司 一种连麦系统、方法、装置、设备及存储介质
CN115484469B (zh) * 2021-06-15 2024-01-09 北京字节跳动网络技术有限公司 一种连麦系统、方法、装置、设备及存储介质
CN115484468B (zh) * 2021-06-15 2024-01-09 北京字节跳动网络技术有限公司 一种连麦系统、方法、装置、设备及存储介质

Also Published As

Publication number Publication date
CN107743250B (zh) 2019-07-09
CN107743250A (zh) 2018-02-27

Similar Documents

Publication Publication Date Title
WO2019071829A1 (zh) Pc上实现主播连麦pk的方法、存储介质、设备及系统
CN108184140B (zh) 一种直播连麦方法、服务器、存储介质及计算机设备
CN107911437B (zh) 屏幕共享的方法、装置、电子设备及存储介质
CA2767191C (en) Method and server for instant messaging
US10887359B2 (en) Parallel peer to peer connection establishment in webRTC conferencing
CN108833950B (zh) 一种弹幕消息下发方法、服务器、系统和存储介质
CN109995741B (zh) 一种网络直播中连麦实现方法及系统
CN110266810B (zh) 基于mqtt协议的消息接收方法、设备及存储介质
WO2017005060A1 (zh) 语音聊天的模式自适应方法及装置
US20190222877A1 (en) Video monitoring method and device, storage medium, and electronic device
EP4029582A1 (en) Information processing method, system and apparatus, and device and storage medium
CN111917562B (zh) 广播消息转发方法、装置、设备及存储介质
US9561438B2 (en) Method for realizing multi-party interactive communication and system thereof
JP2002157218A (ja) 同時に複数のユーザによってデータ・ストリームにアクセスするための装置及び方法
WO2016110258A1 (zh) 用户数据存储方法和装置
CN107846609B (zh) 控制室数据实时传输方法、装置和系统
KR101206604B1 (ko) 온라인 게임 클라이언트간 피어 투 피어 통신방법
US20230388440A1 (en) Video call method and apparatus, and electronic device and storage medium
WO2019071857A1 (zh) 一种直播平台中防止刷礼物的方法及装置
US20050154794A1 (en) Systems and methods for providing a discovery protocol
CN116308671A (zh) 基于mqtt协议的在线竞价方法、电子设备及存储介质
CN107982912B (zh) 一种信息处理方法和终端
KR101106873B1 (ko) 온라인 게임 클라이언트간 피어 투 피어 통신방법
CN113413614A (zh) 游戏数据处理方法及装置、电子设备、存储介质
US20180212789A1 (en) Communication Method and Storage Medium Storing Communication Program

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: 17928455

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 17928455

Country of ref document: EP

Kind code of ref document: A1